cordova-plugin-pixlive
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"name": "cordova-plugin-pixlive", | ||
@@ -4,0 +4,0 @@ "cordova_name": "PixLive", |
@@ -13,2 +13,19 @@ var exec = require('cordova/exec'); | ||
PixLive.Context = function(prop) { | ||
// Apply properties to the context object | ||
var keys = Object.keys(prop); | ||
for (var j = keys.length - 1; j >= 0; j--) { | ||
this[keys[j]] = prop[keys[j]]; | ||
} | ||
}; | ||
PixLive.Context.prototype = { | ||
activate: function() { | ||
exec(null, null, "PixLive", "activateContext", [this.contextId]); | ||
}, | ||
ignore: function() { | ||
exec(null, null, "PixLive", "ignoreContext", [this.contextId]); | ||
} | ||
}; | ||
PixLive.prototype = { | ||
@@ -46,3 +63,3 @@ beforeEnter: function() { | ||
return new PixLive(handle); | ||
} | ||
}; | ||
@@ -53,20 +70,37 @@ PixLive.onEventReceived = null; | ||
exec(null, null, "PixLive", "setNotificationsSupport", [ enabled ? (apiKey ? apiKey : true) : null]); | ||
} | ||
}; | ||
PixLive.setNotificationsSupport = function( enabled, apiKey ) { | ||
exec(null, null, "PixLive", "setNotificationsSupport", [ enabled ? (apiKey ? apiKey : true) : null]); | ||
} | ||
}; | ||
PixLive.synchronize = function( tags, success, error ) { | ||
exec(success, error, "PixLive", "synchronize", [tags]); | ||
} | ||
}; | ||
PixLive.presentNotificationsList = function(success, error) { | ||
exec(success, error, "PixLive", "presentNotificationsList", []); | ||
} | ||
}; | ||
PixLive.openURLInInternalBrowser = function(url) { | ||
exec(success, error, "PixLive", "openURLInInternalBrowser", [url]); | ||
} | ||
}; | ||
PixLive.getContexts = function(success, error) { | ||
exec(function(list) { | ||
if(success !== null) { | ||
var ret = []; | ||
for (var i = 0; i < list.length; i++) { | ||
var prop = list[i]; | ||
var object = new PixLive.Context(prop); | ||
// Add the object to the array | ||
ret.push(object); | ||
} | ||
success(ret); | ||
} | ||
}, error, "PixLive", "getContexts", []); | ||
}; | ||
// Used to signal the plugin that the page is fully loaded | ||
@@ -73,0 +107,0 @@ document.addEventListener("deviceready", function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
189147
3956