You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by gt...@apache.org on 2012/12/14 03:11:49 UTC

[1/2] js commit: Small refactor to injection of webworks.js

Updated Branches:
  refs/heads/master 861ff3d50 -> d8204cc0f


Small refactor to injection of webworks.js

- changed to document.head
- added error handler and alert if things go south


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/d8204cc0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/d8204cc0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/d8204cc0

Branch: refs/heads/master
Commit: d8204cc0f8f1f2e72d95b4c811caa0635bb05a84
Parents: 877fec1
Author: Gord Tanner <gt...@gmail.com>
Authored: Thu Dec 13 18:09:00 2012 -0800
Committer: Gord Tanner <gt...@gmail.com>
Committed: Thu Dec 13 18:09:00 2012 -0800

----------------------------------------------------------------------
 lib/scripts/bootstrap-blackberry.js |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/d8204cc0/lib/scripts/bootstrap-blackberry.js
----------------------------------------------------------------------
diff --git a/lib/scripts/bootstrap-blackberry.js b/lib/scripts/bootstrap-blackberry.js
index fd9839b..f5d11fc 100644
--- a/lib/scripts/bootstrap-blackberry.js
+++ b/lib/scripts/bootstrap-blackberry.js
@@ -20,18 +20,19 @@
 */
 
 document.addEventListener("DOMContentLoaded", function () {
-    var wwjs;
     switch(require('cordova/platform').runtime()) {
     case 'qnx':
-        wwjs = document.createElement("script");
-        wwjs.type = "text/javascript";
+        var wwjs = document.createElement("script");
         wwjs.src = "local:///chrome/webworks.js";
         wwjs.onload = function () {
             document.addEventListener("webworksready", function () {
                 require('cordova/channel').onNativeReady.fire();
             });
         };
-        document.getElementsByTagName("head")[0].appendChild(wwjs);
+        wwjs.onerror = function () {
+            alert('there was a problem loading webworks.js');
+        };
+        document.head.appendChild(wwjs);
         break;
     case 'air':
         require('cordova/channel').onNativeReady.fire();