You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by lo...@apache.org on 2013/05/07 17:14:18 UTC

[31/50] [abbrv] Update plugin script and template to work with plugman changes

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/Notification/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/Notification/src/blackberry10/index.js b/blackberry10/bin/templates/project/plugins/Notification/src/blackberry10/index.js
new file mode 100644
index 0000000..fad04f7
--- /dev/null
+++ b/blackberry10/bin/templates/project/plugins/Notification/src/blackberry10/index.js
@@ -0,0 +1,91 @@
+/*
+* Copyright 2013 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+function showDialog(args, dialogType, result) {
+    //Unpack and map the args
+    var msg = JSON.parse(decodeURIComponent(args[0])),
+    title = JSON.parse(decodeURIComponent(args[1])),
+    btnLabel = JSON.parse(decodeURIComponent(args[2]));
+
+    if (!Array.isArray(btnLabel)) {
+        //Converts to array for (string) and (string,string, ...) cases
+        btnLabel = btnLabel.split(",");
+    }
+
+    if (msg && typeof msg === "string") {
+        msg = msg.replace(/^"|"$/g, "").replace(/\\"/g, '"').replace(/\\\\/g, '\\');
+    } else {
+        result.error("message is undefined");
+        return;
+    }
+
+    var messageObj = {
+        title : title,
+        htmlmessage :  msg,
+        dialogType : dialogType,
+        optionalButtons : btnLabel
+    };
+
+    //TODO replace with getOverlayWebview() when available in webplatform
+    qnx.webplatform.getWebViews()[2].dialog.show(messageObj, function (data) {
+        if (typeof data === "number") {
+            //Confirm dialog call back needs to be called with one-based indexing [1,2,3 etc]
+            result.callbackOk(++data, false);
+        } else {
+            //Prompt dialog callback expects object
+            result.callbackOk({
+                buttonIndex: data.ok ? 1 : 0,
+                input1: (data.oktext) ? decodeURIComponent(data.oktext) : ""
+            }, false);
+        }
+    });
+
+    result.noResult(true);
+}
+
+module.exports = {
+    alert: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+
+        if (Object.keys(args).length < 3) {
+            result.error("Notification action - alert arguments not found.");
+        } else {
+            showDialog(args, "CustomAsk", result);
+        }
+    },
+    confirm: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+
+        if (Object.keys(args).length < 3) {
+            result.error("Notification action - confirm arguments not found.");
+        } else {
+            showDialog(args, "CustomAsk", result);
+        }
+    },
+    prompt: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+
+        if (Object.keys(args).length < 3) {
+            result.error("Notification action - prompt arguments not found.");
+        } else {
+            showDialog(args, "JavaScriptPrompt", result);
+        }
+    },
+    beep: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        result.error("Beep not supported");
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/SplashScreen/index.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/SplashScreen/index.js b/blackberry10/bin/templates/project/plugins/SplashScreen/index.js
deleted file mode 100644
index bd7e48c..0000000
--- a/blackberry10/bin/templates/project/plugins/SplashScreen/index.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2013 Research In Motion Limited.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-module.exports = {
-    show: function (success, fail, args, env) {
-        var result = new PluginResult(args, env);
-        result.error("Not supported on platform", false);
-    },
-
-    hide: function (success, fail, args, env) {
-        var result = new PluginResult(args, env);
-        window.qnx.webplatform.getApplication().windowVisible = true;
-        result.ok(undefined, false);
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/SplashScreen/plugin.xml
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/SplashScreen/plugin.xml b/blackberry10/bin/templates/project/plugins/SplashScreen/plugin.xml
new file mode 100644
index 0000000..48c5824
--- /dev/null
+++ b/blackberry10/bin/templates/project/plugins/SplashScreen/plugin.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+     specific language governing permissions and limitations
+      under the License.
+
+-->
+
+<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
+    id="org.apache.cordova.core"
+    version="0.0.1">
+
+    <name>SplashScreen</name>
+
+    <platform name="blackberry10">
+        <config-file target="www/config.xml" parent="/widget">
+            <feature name="SplashScreen" value="SplashScreen"/>
+        </config-file>
+    </platform>
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/SplashScreen/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/SplashScreen/src/blackberry10/index.js b/blackberry10/bin/templates/project/plugins/SplashScreen/src/blackberry10/index.js
new file mode 100644
index 0000000..bd7e48c
--- /dev/null
+++ b/blackberry10/bin/templates/project/plugins/SplashScreen/src/blackberry10/index.js
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2013 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+module.exports = {
+    show: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        result.error("Not supported on platform", false);
+    },
+
+    hide: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        window.qnx.webplatform.getApplication().windowVisible = true;
+        result.ok(undefined, false);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/Utils/native/Makefile
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/Utils/native/Makefile b/blackberry10/bin/templates/project/plugins/Utils/native/Makefile
deleted file mode 100644
index 0cc5eae..0000000
--- a/blackberry10/bin/templates/project/plugins/Utils/native/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=CPU
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/Utils/native/common.mk
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/Utils/native/common.mk b/blackberry10/bin/templates/project/plugins/Utils/native/common.mk
deleted file mode 100644
index 90a43db..0000000
--- a/blackberry10/bin/templates/project/plugins/Utils/native/common.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-ifndef QCONFIG
-QCONFIG=qconfig.mk
-endif
-include $(QCONFIG)
-
-NAME=utils
-LDFLAGS+=-Wl,-h,libutils.so
-
-include ../../../../../../meta.mk
-
-SRCS+=$(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.6.0-rc2/src/lib_json/json_reader.cpp \
-      $(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.6.0-rc2/src/lib_json/json_value.cpp \
-      $(WEBWORKS_DIR)/dependencies/JsonCpp/jsoncpp-src-0.6.0-rc2/src/lib_json/json_writer.cpp \
-      webworks_utils.cpp
-
-include $(MKFILES_ROOT)/qtargets.mk
-
-LIBS += socket

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so b/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so
deleted file mode 100644
index 126d02c..0000000
Binary files a/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/Utils/native/simulator/libutils.so
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/Utils/native/simulator/libutils.so b/blackberry10/bin/templates/project/plugins/Utils/native/simulator/libutils.so
deleted file mode 100644
index 392ad33..0000000
Binary files a/blackberry10/bin/templates/project/plugins/Utils/native/simulator/libutils.so and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp b/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp
deleted file mode 100644
index 68397a1..0000000
--- a/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Research In Motion Limited.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <resolv.h>
-#include <sstream>
-#include <string>
-
-#include "webworks_utils.hpp"
-
-namespace webworks {
-
-std::string Utils::intToStr(const int val)
-{
-    std::string s;
-    std::stringstream out;
-    out << val;
-    return out.str();
-}
-
-int Utils::strToInt(const std::string& val) {
-    int number;
-
-    if (!(std::istringstream(val) >> number)) {
-        return -1;
-    }
-    return number;
-}
-
-std::string Utils::toBase64(const unsigned char *input, const size_t size)
-{
-    size_t outputSize = size * 4;
-    char *output = new char[outputSize];
-    outputSize = b64_ntop(input, size, output, outputSize);
-    output[outputSize] = 0;
-
-    std::string outputString(output);
-    delete output;
-
-    return outputString;
-}
-
-} // namespace webworks

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp b/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp
deleted file mode 100644
index 4ab2ca7..0000000
--- a/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 Research In Motion Limited.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WW_UTILS_HPP_
-#define WW_UTILS_HPP_
-
-#include <string.h>
-#include <string>
-
-namespace webworks {
-
-class Utils {
-public:
-    static std::string intToStr(const int val);
-    static int strToInt(const std::string& val);
-    static std::string toBase64(const unsigned char *input, const size_t size);
-};
-
-} // namespace webworks
-
-#endif // WW_UTILS_HPP_

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/plugin.xml
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/plugin.xml b/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/plugin.xml
new file mode 100644
index 0000000..9a3be81
--- /dev/null
+++ b/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/plugin.xml
@@ -0,0 +1,22 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
+    id="com.blackberry.jpps"
+    version="1.0.0">
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/device/libjpps.so
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/device/libjpps.so b/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/device/libjpps.so
new file mode 100644
index 0000000..f0eb90d
Binary files /dev/null and b/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/device/libjpps.so differ

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/simulator/libjpps.so
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/simulator/libjpps.so b/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/simulator/libjpps.so
new file mode 100644
index 0000000..f2c12ff
Binary files /dev/null and b/blackberry10/bin/templates/project/plugins/com.blackberry.jpps/src/blackberry10/native/simulator/libjpps.so differ

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/com.blackberry.utils/plugin.xml
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/com.blackberry.utils/plugin.xml b/blackberry10/bin/templates/project/plugins/com.blackberry.utils/plugin.xml
new file mode 100644
index 0000000..f855ee8
--- /dev/null
+++ b/blackberry10/bin/templates/project/plugins/com.blackberry.utils/plugin.xml
@@ -0,0 +1,22 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
+    id="com.blackberry.utils"
+    version="1.0.0">
+</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so b/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so
new file mode 100644
index 0000000..126d02c
Binary files /dev/null and b/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so differ

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so b/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so
new file mode 100644
index 0000000..392ad33
Binary files /dev/null and b/blackberry10/bin/templates/project/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so differ

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b0a540b8/blackberry10/javascript/cordova.blackberry10.js
----------------------------------------------------------------------
diff --git a/blackberry10/javascript/cordova.blackberry10.js b/blackberry10/javascript/cordova.blackberry10.js
index 286891b..a5e250d 100644
--- a/blackberry10/javascript/cordova.blackberry10.js
+++ b/blackberry10/javascript/cordova.blackberry10.js
@@ -1,8 +1,8 @@
 // Platform: blackberry10
 
-// commit dd02e6c9cd4121910c714e798f84fad2dc072879
+// commit cf23fc942bd8443aa673b6834690e9c55c811b36
 
-// File generated at :: Fri Apr 19 2013 11:54:58 GMT-0400 (EDT)
+// File generated at :: Thu Apr 25 2013 16:30:38 GMT-0400 (EDT)
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one
@@ -929,19 +929,16 @@ define("cordova/platform", function(require, exports, module) {
 module.exports = {
     id: "blackberry10",
     initialize: function() {
-        var builder = require('cordova/builder'),
-            modulemapper = require('cordova/modulemapper'),
-            platform = require('cordova/plugin/blackberry10/platform');
-
-        builder.buildIntoButDoNotClobber(platform.defaults, window);
-        builder.buildIntoAndClobber(platform.clobbers, window);
-        builder.buildIntoAndMerge(platform.merges, window);
+        var modulemapper = require('cordova/modulemapper'),
+            cordova = require('cordova');
 
         modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
         modulemapper.loadMatchingModules(new RegExp('cordova/blackberry10/.*bbsymbols$'));
-        modulemapper.mapModules(window);
 
-        platform.initialize();
+        modulemapper.clobbers('cordova/plugin/blackberry10/vibrate', 'navigator.notification.vibrate');
+        modulemapper.clobbers('cordova/plugin/File', 'navigator.File');
+        modulemapper.merges('cordova/plugin/blackberry10/compass', 'navigator.compass');
+
     }
 };
 
@@ -1728,20 +1725,17 @@ Entry.prototype.setMetadata = function(successCallback, errorCallback, metadataO
 
 Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {
     argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
-    var fail = errorCallback && function(code) {
-            errorCallback(new FileError(code));
-        },
-        srcPath = this.fullPath,
+    var srcPath = this.fullPath,
         name = newName || this.name,
         success = function(entry) {
             if (entry) {
-                if (successCallback === 'function') {
+                if (typeof successCallback === 'function') {
                     successCallback(fileUtils.createEntry(entry));
                 }
             }
             else {
-                if (typeof fail === 'function') {
-                    fail(FileError.NOT_FOUND_ERR);
+                if (typeof errorCallback === 'function') {
+                    errorCallback(new FileError(FileError.NOT_FOUND_ERR));
                 }
             }
         };
@@ -1751,10 +1745,7 @@ Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallbac
 
 Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {
     argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
-    var fail = errorCallback && function(code) {
-            errorCallback(new FileError(code));
-        },
-        srcPath = this.fullPath,
+    var srcPath = this.fullPath,
         name = newName || this.name,
         success = function(entry) {
             if (entry) {
@@ -1763,8 +1754,8 @@ Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallbac
                 }
             }
             else {
-                if (typeof fail === 'function') {
-                    fail(FileError.NOT_FOUND_ERR);
+                if (typeof errorCallback === 'function') {
+                    errorCallback(new FileError(FileError.NOT_FOUND_ERR));
                 }
             }
         };
@@ -4016,135 +4007,6 @@ module.exports = {
 
 });
 
-// file: lib/blackberry10/plugin/blackberry10/platform.js
-define("cordova/plugin/blackberry10/platform", function(require, exports, module) {
-
-var cordova = require('cordova');
-
-module.exports = {
-    id: "blackberry10",
-    initialize: function () {
-        document.addEventListener("deviceready", function () {
-            /*
-             TODO
-            blackberry.event.addEventListener("pause", function () {
-                cordova.fireDocumentEvent("pause");
-            });
-            blackberry.event.addEventListener("resume", function () {
-                cordova.fireDocumentEvent("resume");
-            });
-            */
-            window.addEventListener("online", function () {
-                cordova.fireDocumentEvent("online");
-            });
-
-            window.addEventListener("offline", function () {
-                cordova.fireDocumentEvent("offline");
-            });
-        });
-    },
-    clobbers: {
-        navigator: {
-            children: {
-                notification: {
-                    children: {
-                        vibrate: {
-                            path: 'cordova/plugin/blackberry10/vibrate'
-                        }
-                    }
-                }
-            }
-        },
-        File: {
-            path: 'cordova/plugin/File'
-        }
-    },
-    merges: {
-        navigator: {
-            children: {
-                compass: {
-                    path: 'cordova/plugin/blackberry10/compass'
-                }
-            }
-        }
-    }
-};
-
-});
-
-// file: lib/blackberry10/plugin/blackberry10/pluginUtils.js
-define("cordova/plugin/blackberry10/pluginUtils", function(require, exports, module) {
-
-function build(plugins) {
-    var builder = require('cordova/builder'),
-        plugin;
-    for (plugin in plugins) {
-        if (plugins.hasOwnProperty(plugin)) {
-            if (plugins[plugin].clobbers) {
-                builder.buildIntoAndClobber(plugins[plugin].clobbers, window);
-            }
-            if (plugins[plugin].merges) {
-                builder.buildIntoAndMerge(plugins[plugin].merges, window);
-            }
-        }
-    }
-}
-
-module.exports = {
-
-    loadClientJs: function (plugins, callback) {
-        var plugin,
-            script,
-            i,
-            count = 0;
-        for (plugin in plugins) {
-            if (plugins.hasOwnProperty(plugin) && plugins[plugin].modules) {
-                for (i = 0; i < plugins[plugin].modules.length; i++) {
-                    script = document.createElement('script');
-                    script.src = 'local:///plugins/' + plugin + '/' + plugins[plugin].modules[i];
-                    script.onload = function () {
-                        if (--count === 0 && typeof callback === 'function') {
-                            build(plugins);
-                            callback();
-                        }
-                    };
-                    count++;
-                    document.head.appendChild(script);
-                }
-            }
-        }
-        if (count === 0) {
-            callback();
-        }
-    },
-
-    getPlugins: function (success, error) {
-        var request,
-            response;
-        request = new XMLHttpRequest();
-        request.open('GET', 'local:///plugins/plugins.json', true);
-        request.onreadystatechange = function () {
-            if (request.readyState === 4) {
-                if (request.status === 200) {
-                    try {
-                        response = JSON.parse(decodeURIComponent(request.responseText));
-                        success(response);
-                    }
-                    catch (e) {
-                        error(e);
-                    }
-                }
-                else {
-                    error(request.status);
-                }
-            }
-        };
-        request.send(null);
-    }
-};
-
-});
-
 // file: lib/blackberry10/plugin/blackberry10/utils.js
 define("cordova/plugin/blackberry10/utils", function(require, exports, module) {
 
@@ -6287,7 +6149,7 @@ module.exports = {
         // Android and iOS take an array of button label names.
         // Other platforms take a comma separated list.
         // For compatibility, we convert to the desired type based on the platform.
-        if (platform.id == "android" || platform.id == "ios") {
+        if (platform.id == "android" || platform.id == "ios" || platform.id == "blackberry10") {
             if (typeof _buttonLabels === 'string') {
                 var buttonLabelString = _buttonLabels;
                 _buttonLabels = buttonLabelString.split(",");
@@ -6762,8 +6624,7 @@ window.cordova = require('cordova');
 // file: lib/scripts/bootstrap-blackberry10.js
 
 (function () {
-    var pluginUtils = require('cordova/plugin/blackberry10/pluginUtils'),
-        docAddEventListener = document.addEventListener,
+    var docAddEventListener = document.addEventListener,
         webworksReady = false,
         alreadyFired = false,
         listenerRegistered = false;
@@ -6866,20 +6727,11 @@ window.cordova = require('cordova');
         event: require("cordova/plugin/blackberry10/event")
     };
 
-    //Fire webworks ready once plugin javascript has been loaded
-    pluginUtils.getPlugins(
-        function (plugins) {
-            pluginUtils.loadClientJs(plugins, function () {
-                webworksReady = true;
-                fireWebworksReadyEvent();
-            });
-        },
-        function () {
-            console.log('Unable to load plugins.json');
-            webworksReady = true;
-            fireWebworksReadyEvent();
-        }
-    );
+    require("cordova/channel").onPluginsReady.subscribe(function () {
+        require("cordova/modulemapper").mapModules(window);
+        webworksReady = true;
+        fireWebworksReadyEvent();
+    });
 }());
 
 document.addEventListener("DOMContentLoaded", function () {
@@ -6980,7 +6832,7 @@ document.addEventListener("DOMContentLoaded", function () {
         xhr.onerror = function() {
             finishPluginLoading();
         };
-        xhr.open('GET', 'cordova_plugins.json', true); // Async
+        xhr.open('GET', '/cordova_plugins.json', true); // Async
         xhr.send();
     }
     catch(err){