plugins.js
923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
! function(root, factory) {
if (typeof exports == 'object' && typeof module != 'undefined') {
module.exports = factory()
} else if (typeof define == 'function' && define.amd) {
define(factory)
} else {
// 5+ 兼容
document.addEventListener(
'plusready',
function()
{
// 修改此处为插件命名
var moduleName = 'plugintest';
// 挂载在plus下
root.plus[moduleName] = factory()
},
false
);
}
}(this, function() {
var _BARCODE = 'plugintest';
var plugintest = {
PluginTestFunction: function(MethodName,UserToken) {
var success = typeof successCallback !== 'function' ? null : function(args) {successCallback(args);};
var callbackID = plus.bridge.callbackId(null,null);
return plus.bridge.exec(_BARCODE, "PluginTestFunction", [callbackID, MethodName,UserToken]);
},
};
return plugintest;
});