如何在phonegap网站中提交插件
How to submit a plugin in phonegap site?
我正在Phonegap中创建我的第一个应用程序。我做了一些插件,比如FileOpener、Downloader和stausBarNotification。插件是这样的:
FileOpener.js是这样的:
cordova.define("cordova/plugin/fileopener",
function(require, exports, module) {
var exec = require("cordova/exec");
var FileOpener = function () {};
FileOpener.prototype.open = function(url) {
exec(null, null, "FileOpener", "openFile", [url]);
};
var fileOpener = new FileOpener();
module.exports = fileOpener;
});
/**
* Load Plugin
*/
if (!window.plugins) {
window.plugins = {};
}
if (!window.plugins.fileOpener) {
window.plugins.fileOpener = cordova.require("cordova/plugin/fileopener");
}
Downloader.js是这样的:
cordova.define("cordova/plugin/downloader",
function(require, exports, module) {
var exec = require("cordova/exec");
var Downloader = function () {};
Downloader.prototype.downloadFile = function(fileUrl, dirName, fileName, overwrite, win, fail) {
navigator.notification.alert('url: '+fileUrl+' to dir: '+dirName + ' to file: '+fileName);
if (overwrite == false)
overwrite = "false";
else
overwrite = "true";
exec(win, fail, "Downloader", "downloadFile", [ fileUrl, dirName, fileName, overwrite ]);
};
var downloader = new Downloader();
module.exports = downloader;
});
if (!window.plugins) {
window.plugins = {};
}
if (!window.plugins.downloader) {
window.plugins.downloader = cordova.require("cordova/plugin/downloader");
}
我还制作了一些java文件来实现is。现在它在安卓设备中按预期运行。但现在我想为ios做一个相同的项目,我想build.phonegap.com会为我做这件事。
我在config.xml中包含了这个插件,如下所示:
<gap:plugin name="FileOpener" value="com.phonegap.plugins.fileOpener.FileOpener"/>
<gap:plugin name="Downloader" value="com.phonegap.plugins.downloader.Downloader"/>
<gap:plugin name="StatusBarNotification" value="com.phonegap.plugins.statusBarNotification.StatusBarNotification"/>
现在该何去何从?我读过一些文章,告诉我把插件提交到phonegap.com,我该怎么做?该项目会像iPhone中的android设备一样运行吗?感谢您提前提供的帮助。
要提交插件,请参阅https://build.phonegap.com/docs/plugins-contributing.一旦提交,将对其进行审查并向公众开放。您可以在上查看可用插件的列表https://build.phonegap.com/plugins
相关文章:
- Jquery表单验证插件-如果选中复选框,如何在提交时执行某些操作
- ajaxForm插件在任何单击<按钮>上提交
- 在使用 jQuery 验证插件进行验证后,使用 AJAX 提交表单
- jQuery验证插件停止表单提交,提交按钮获胜'不起作用
- jQuery验证插件-表单不提交
- Firefox插件-在提交之前捕获post变量[no-enctype]
- WordPress插件表单未提交
- Braintree插件,在处理时禁用提交按钮
- jQuery 表单插件 - 如何防止重复提交
- jquery.form/validate 插件只允许在输入更改时提交
- 使用 jquery.form.js jquery 插件导致我的表单提交两次
- jQuery 验证插件:相同的表单,不同的验证提交处理程序
- 根据条件在 JQuery 表单插件中提交回调之前删除项目
- 使用JQuery表单插件触发文件上传提交
- 使用 ajaxForm 插件提交表单时没有警报
- 如何在phonegap网站中提交插件
- 使用jQuery Form插件上传文件时,如何提交额外数据
- 尝试使用atomsphere的jquery插件对流星表单提交进行表单验证
- 如何使用jQuery表单插件获取表单提交结果
- APEX模态页面插件没有'不允许多个提交/编辑而不刷新