nativescript-toast
Advanced tools
Comparing version 1.1.4 to 1.2.0
{ | ||
"name": "nativescript-toast", | ||
"version": "1.1.4", | ||
"version": "1.2.0", | ||
"description": "A NativeScript Toast Plugin for Android.", | ||
@@ -8,4 +8,4 @@ "main": "toast.js", | ||
"platforms": { | ||
"android": "1.2.0", | ||
"ios": "1.2.0" | ||
"android": "1.3.0", | ||
"ios": "1.3.0" | ||
} | ||
@@ -12,0 +12,0 @@ }, |
# NativeScript Toast Plugin | ||
> A NativeScript Toast Plugin for Android apps. | ||
> A NativeScript Toast Plugin for Android and iOS apps. | ||
@@ -15,2 +15,4 @@ ## What is a toast? | ||
Want simple example application to play with? [nativescript-toast-example](https://github.com/TobiasHennig/nativescript-toast-example) | ||
## Installation | ||
@@ -17,0 +19,0 @@ |
@@ -1,16 +0,12 @@ | ||
/*global module*/ | ||
/*global exports*/ | ||
var Toast = function(){ | ||
this.text = ''; | ||
function makeText(text, duration) { | ||
"use strict"; | ||
if (typeof (text) !== "string") { | ||
throw new Error("The `text` parameter is missing."); | ||
} | ||
var d = (typeof (duration) === "string" && duration[0] === "l") ? 3.5 : 2; | ||
return JLToast.makeText(text); | ||
}; | ||
Toast.prototype.makeText = function(text) { | ||
this.text = text; | ||
return this; | ||
}; | ||
Toast.prototype.show = function() { | ||
console.log(this.text); | ||
}; | ||
module.exports = new Toast(); | ||
exports.makeText = makeText; |
11405
9
47
23