Toast fix
This commit is contained in:
parent
9bcf0ca925
commit
226c182039
@ -19,7 +19,13 @@
|
|||||||
"name": "demo",
|
"name": "demo",
|
||||||
"description": "demo: An Ionic project",
|
"description": "demo: An Ionic project",
|
||||||
"cordovaPlugins": [
|
"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": [
|
"cordovaPlatforms": [
|
||||||
"ios"
|
"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);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||||
switch (arguments.length) {
|
switch (arguments.length) {
|
||||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
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);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||||
switch (arguments.length) {
|
switch (arguments.length) {
|
||||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
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);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||||
switch (arguments.length) {
|
switch (arguments.length) {
|
||||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
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);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||||
switch (arguments.length) {
|
switch (arguments.length) {
|
||||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
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);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||||
switch (arguments.length) {
|
switch (arguments.length) {
|
||||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
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.hide = function () { };
|
||||||
;
|
;
|
||||||
Toast.showWithOptions = function (options) {
|
Toast.showWithOptions = function (options) { };
|
||||||
console.log('Show with options');
|
|
||||||
};
|
|
||||||
;
|
;
|
||||||
Object.defineProperty(Toast, "hide",
|
Object.defineProperty(Toast, "hide",
|
||||||
__decorate([
|
__decorate([
|
||||||
plugin_1.Cordova({
|
plugin_1.Cordova()
|
||||||
successIndex: 0,
|
|
||||||
errIndex: 1
|
|
||||||
})
|
|
||||||
], Toast, "hide", Object.getOwnPropertyDescriptor(Toast, "hide")));
|
], Toast, "hide", Object.getOwnPropertyDescriptor(Toast, "hide")));
|
||||||
Object.defineProperty(Toast, "showWithOptions",
|
Object.defineProperty(Toast, "showWithOptions",
|
||||||
__decorate([
|
__decorate([
|
||||||
plugin_1.Cordova({
|
plugin_1.Cordova()
|
||||||
successIndex: 1,
|
|
||||||
errIndex: 2
|
|
||||||
})
|
|
||||||
], Toast, "showWithOptions", Object.getOwnPropertyDescriptor(Toast, "showWithOptions")));
|
], Toast, "showWithOptions", Object.getOwnPropertyDescriptor(Toast, "showWithOptions")));
|
||||||
Toast = __decorate([
|
Toast = __decorate([
|
||||||
plugin_1.Plugin({
|
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.hide = function () { };
|
||||||
;
|
;
|
||||||
Toast.showWithOptions = function (options) {
|
Toast.showWithOptions = function (options) { };
|
||||||
console.log('Show with options');
|
|
||||||
};
|
|
||||||
;
|
;
|
||||||
__decorate([
|
__decorate([
|
||||||
plugin_1.Cordova({
|
plugin_1.Cordova(),
|
||||||
successIndex: 0,
|
|
||||||
errIndex: 1
|
|
||||||
}),
|
|
||||||
__metadata('design:type', Function),
|
__metadata('design:type', Function),
|
||||||
__metadata('design:paramtypes', []),
|
__metadata('design:paramtypes', []),
|
||||||
__metadata('design:returntype', void 0)
|
__metadata('design:returntype', void 0)
|
||||||
], Toast, "hide", null);
|
], Toast, "hide", null);
|
||||||
__decorate([
|
__decorate([
|
||||||
plugin_1.Cordova({
|
plugin_1.Cordova(),
|
||||||
successIndex: 1,
|
|
||||||
errIndex: 2
|
|
||||||
}),
|
|
||||||
__metadata('design:type', Function),
|
__metadata('design:type', Function),
|
||||||
__metadata('design:paramtypes', [Object]),
|
__metadata('design:paramtypes', [Object]),
|
||||||
__metadata('design:returntype', void 0)
|
__metadata('design:returntype', void 0)
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"build": "rm -rf dist && tsc"
|
"build": "tsc --experimentalDecorators",
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"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'
|
repo: 'https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin'
|
||||||
})
|
})
|
||||||
export class Toast {
|
export class Toast {
|
||||||
@Cordova({
|
@Cordova()
|
||||||
successIndex: 0,
|
|
||||||
errIndex: 1
|
|
||||||
})
|
|
||||||
static hide(){};
|
static hide(){};
|
||||||
|
|
||||||
@Cordova({
|
@Cordova()
|
||||||
successIndex: 1,
|
static showWithOptions(options:any){};
|
||||||
errIndex: 2
|
|
||||||
})
|
|
||||||
static showWithOptions(options:any){
|
|
||||||
console.log('Show with options');
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user