This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// API URL | |
var url = "https://gateway.watsonplatform.net/language-translator/api/v2/translate"; | |
// Optional parameters | |
var text = request.get("text") || "Hello"; | |
var source = request.get("source") || "en"; | |
var target = request.get("target") || "es"; | |
// Credentials | |
var username = "Username from service credentials"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check online or offline | |
Apperyio.get("AppClientGeneralOperations").getState().then(function(state) { | |
if (state === "online") | |
$scope.appState = true; | |
else | |
$scope.appState = false; | |
console.log(state); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Alert | |
navigator.notification.alert( | |
'Build apps fast with Appery.io', | |
alertDismissed, | |
'My App', | |
'Got it.' | |
); | |
function alertDismissed () { | |
alert ("Nice - that worked"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
***Custom CSS | |
.ui-btn { | |
font-weight:bold; | |
font-size:24px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use the 'id' | |
element.on("click", function () { | |
Apperyio.storage.<variable_name>.set(value.id); | |
}); | |
// use the whole object | |
element.on("click", function () { | |
Apperyio.storage.<variable_name>.set(value.); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cordova.define("nl.xservices.plugins.Toast", function(require, exports, module) { | |
function Toast() {} | |
Toast.prototype.show = function(message, duration, position, successCallback, errorCallback) { | |
cordova.exec(successCallback, errorCallback, "Toast", "show", [message, duration, position]); | |
}; | |
Toast.prototype.showShortTop = function(message, successCallback, errorCallback) { | |
this.show(message, "short", "top", successCallback, errorCallback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"file": "plugins/nl.xservices.plugins/www/Toast.js", | |
"id": "nl.xservices.plugins.Toast", | |
"clobbers": ["ToastPlugin"] | |
} | |
<feature name="Toast"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var message = Apperyio("message").val(); | |
var duration = Apperyio("duration").val(); | |
var position = Apperyio("position").val(); | |
ToastPlugin.show(message, duration, position); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"delay": "false", | |
"IATA": "IAD", | |
"state": "District of Columbia", | |
"name": "Washington Dulles International", | |
"weather": { | |
"visibility": 4, | |
"weather": "Light Rain Fog/Mist", | |
"meta": { | |
"credit": "NOAA's National Weather Service", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOA login URL: | |
https://p0st3r.eap.soa.com/oauth/auz/authorize | |
Airport service URL: | |
https://p0st3r.broker.soa.com:443/v6/faa/airport/status/{airportCode} |
NewerOlder