Toast fix

This commit is contained in:
Max Lynch 2015-11-30 10:11:48 -06:00
parent 9bcf0ca925
commit 226c182039
10 changed files with 22 additions and 98 deletions

View File

@ -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"

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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
View File

@ -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({

View File

@ -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)

View File

@ -11,7 +11,7 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rm -rf dist && tsc"
"build": "tsc --experimentalDecorators",
},
"repository": {
"type": "git",

View File

@ -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',
},
]

View File

@ -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){};
}