mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
Toast fix
This commit is contained in:
parent
9bcf0ca925
commit
226c182039
@ -19,7 +19,13 @@
|
||||
"name": "demo",
|
||||
"description": "demo: An Ionic project",
|
||||
"cordovaPlugins": [
|
||||
"cordova-plugin-x-toast"
|
||||
"cordova-plugin-x-toast",
|
||||
"cordova-plugin-device",
|
||||
"cordova-plugin-console",
|
||||
"cordova-plugin-whitelist",
|
||||
"cordova-plugin-splashscreen",
|
||||
"cordova-plugin-statusbar",
|
||||
"ionic-plugin-keyboard"
|
||||
],
|
||||
"cordovaPlatforms": [
|
||||
"ios"
|
||||
|
2
dist/plugins/actionsheet.js
vendored
2
dist/plugins/actionsheet.js
vendored
@ -1,4 +1,4 @@
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
|
2
dist/plugins/camera.js
vendored
2
dist/plugins/camera.js
vendored
@ -1,4 +1,4 @@
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
|
2
dist/plugins/device.js
vendored
2
dist/plugins/device.js
vendored
@ -1,4 +1,4 @@
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
|
2
dist/plugins/statusbar.js
vendored
2
dist/plugins/statusbar.js
vendored
@ -1,4 +1,4 @@
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
|
16
dist/plugins/toast.js
vendored
16
dist/plugins/toast.js
vendored
@ -1,4 +1,4 @@
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
@ -12,23 +12,15 @@ var Toast = (function () {
|
||||
}
|
||||
Toast.hide = function () { };
|
||||
;
|
||||
Toast.showWithOptions = function (options) {
|
||||
console.log('Show with options');
|
||||
};
|
||||
Toast.showWithOptions = function (options) { };
|
||||
;
|
||||
Object.defineProperty(Toast, "hide",
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
successIndex: 0,
|
||||
errIndex: 1
|
||||
})
|
||||
plugin_1.Cordova()
|
||||
], Toast, "hide", Object.getOwnPropertyDescriptor(Toast, "hide")));
|
||||
Object.defineProperty(Toast, "showWithOptions",
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
successIndex: 1,
|
||||
errIndex: 2
|
||||
})
|
||||
plugin_1.Cordova()
|
||||
], Toast, "showWithOptions", Object.getOwnPropertyDescriptor(Toast, "showWithOptions")));
|
||||
Toast = __decorate([
|
||||
plugin_1.Plugin({
|
||||
|
14
dist/src/plugins/toast.js
vendored
14
dist/src/plugins/toast.js
vendored
@ -13,24 +13,16 @@ var Toast = (function () {
|
||||
}
|
||||
Toast.hide = function () { };
|
||||
;
|
||||
Toast.showWithOptions = function (options) {
|
||||
console.log('Show with options');
|
||||
};
|
||||
Toast.showWithOptions = function (options) { };
|
||||
;
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
successIndex: 0,
|
||||
errIndex: 1
|
||||
}),
|
||||
plugin_1.Cordova(),
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', []),
|
||||
__metadata('design:returntype', void 0)
|
||||
], Toast, "hide", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova({
|
||||
successIndex: 1,
|
||||
errIndex: 2
|
||||
}),
|
||||
plugin_1.Cordova(),
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', [Object]),
|
||||
__metadata('design:returntype', void 0)
|
||||
|
@ -11,7 +11,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "rm -rf dist && tsc"
|
||||
"build": "tsc --experimentalDecorators",
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -1,58 +0,0 @@
|
||||
export interface CordovaPlugin {
|
||||
id: string,
|
||||
className: string;
|
||||
plugin: string;
|
||||
pluginRef: string;
|
||||
promise?: any //should really be Promise
|
||||
}
|
||||
|
||||
|
||||
export var PluginConfig:CordovaPlugin[] = [
|
||||
{
|
||||
id: 'device',
|
||||
className: 'Device',
|
||||
plugin: 'cordova-plugin-device',
|
||||
pluginRef: 'device'
|
||||
},
|
||||
{
|
||||
id: 'camera',
|
||||
className: 'Camera',
|
||||
plugin: 'cordova-plugin-camera',
|
||||
promise: ['takePicture'],
|
||||
pluginRef: 'navigator.camera'
|
||||
},
|
||||
{
|
||||
id: 'statusbar',
|
||||
className: 'StatusBar',
|
||||
plugin: 'cordova-plugin-statusbar',
|
||||
pluginRef: 'StatusBar',
|
||||
promise: ['show', 'hide', 'styleDefault', 'styleLightContent', 'styleBlackTranslucent', 'styleBlackOpaque']
|
||||
},
|
||||
{
|
||||
id: 'applinks',
|
||||
className: 'AppLinks',
|
||||
plugin: 'com.lampa.startapp',
|
||||
pluginRef: 'navigator.startApp',
|
||||
promise: ['start', 'check']
|
||||
},
|
||||
{
|
||||
id: 'barcode',
|
||||
className: 'Barcode',
|
||||
plugin: 'phonegap-plugin-barcodescanner',
|
||||
pluginRef: 'cordova.plugins.barcodeScanner',
|
||||
promise: ['scan', 'encode']
|
||||
},
|
||||
{
|
||||
id: 'camera-roll',
|
||||
className: 'CameraRoll',
|
||||
plugin: 'cordova-plugin-camera-roll',
|
||||
pluginRef: 'CameraRoll',
|
||||
promise: ['saveToCameraRoll', 'getPhotos']
|
||||
},
|
||||
{
|
||||
id: 'contacts',
|
||||
className: 'Contacts',
|
||||
plugin: 'cordova-plugin-contacts',
|
||||
pluginRef: 'navigator.contacts',
|
||||
},
|
||||
]
|
@ -7,17 +7,9 @@ import {Plugin, Cordova} from './plugin';
|
||||
repo: 'https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin'
|
||||
})
|
||||
export class Toast {
|
||||
@Cordova({
|
||||
successIndex: 0,
|
||||
errIndex: 1
|
||||
})
|
||||
@Cordova()
|
||||
static hide(){};
|
||||
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errIndex: 2
|
||||
})
|
||||
static showWithOptions(options:any){
|
||||
console.log('Show with options');
|
||||
};
|
||||
@Cordova()
|
||||
static showWithOptions(options:any){};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user