awesome-cordova-plugins/dist/index.js

51 lines
1.0 KiB
JavaScript
Raw Normal View History

2015-11-26 01:44:58 +08:00
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require('./plugins/camera'));
2015-11-29 06:17:04 +08:00
__export(require('./plugins/statusbar'));
2015-11-29 06:24:38 +08:00
__export(require('./plugins/toast'));
2015-11-26 01:44:58 +08:00
/*
let wrappedPlugins = {}
let promised;
2015-11-25 08:37:29 +08:00
function newPluginClass(config) {
2015-11-26 01:44:58 +08:00
let obj = {
installed: () => {
return !!obj.plugin();
},
// Get the plugin by checking the plugin ref path on window
plugin: () => {
return get(window, config.pluginRef)
},
pluginName: config.plugin
};
return obj;
2015-11-25 08:37:29 +08:00
}
2015-11-26 01:44:58 +08:00
2015-11-25 08:37:29 +08:00
// Go through each registered plugin
2015-11-26 01:44:58 +08:00
for(let i = 0; i < PluginConfig.length; i++) {
let plugin = PluginConfig[i];
// Create the wrapped class
let cls = newPluginClass(plugin);
promised = plugin.promise || [];
for(let j = 0; j < promised.length; j++) {
let method = promised[j];
let p = promisifyCordova(cls, plugin.id, method)
cls[method] = p;
}
// Save the plugin object
wrappedPlugins[plugin.className] = cls;
2015-11-25 08:37:29 +08:00
}
2015-11-26 01:44:58 +08:00
export default wrappedPlugins;
*/
//window['Native'] = wrappedPlugins;