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:24:06 UTC

[01/51] [partial] [BlackBerry10] Added support for new platform

Updated Branches:
  refs/heads/future-bb10 [created] 6831bed4f


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js
new file mode 100644
index 0000000..f637390
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js
@@ -0,0 +1,142 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;
+
+  exports.OptionParser = OptionParser = (function() {
+    function OptionParser(rules, banner) {
+      this.banner = banner;
+      this.rules = buildRules(rules);
+    }
+
+    OptionParser.prototype.parse = function(args) {
+      var arg, i, isOption, matchedRule, options, originalArgs, pos, rule, seenNonOptionArg, skippingArgument, value, _i, _j, _len, _len1, _ref;
+
+      options = {
+        "arguments": []
+      };
+      skippingArgument = false;
+      originalArgs = args;
+      args = normalizeArguments(args);
+      for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
+        arg = args[i];
+        if (skippingArgument) {
+          skippingArgument = false;
+          continue;
+        }
+        if (arg === '--') {
+          pos = originalArgs.indexOf('--');
+          options["arguments"] = options["arguments"].concat(originalArgs.slice(pos + 1));
+          break;
+        }
+        isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG));
+        seenNonOptionArg = options["arguments"].length > 0;
+        if (!seenNonOptionArg) {
+          matchedRule = false;
+          _ref = this.rules;
+          for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
+            rule = _ref[_j];
+            if (rule.shortFlag === arg || rule.longFlag === arg) {
+              value = true;
+              if (rule.hasArgument) {
+                skippingArgument = true;
+                value = args[i + 1];
+              }
+              options[rule.name] = rule.isList ? (options[rule.name] || []).concat(value) : value;
+              matchedRule = true;
+              break;
+            }
+          }
+          if (isOption && !matchedRule) {
+            throw new Error("unrecognized option: " + arg);
+          }
+        }
+        if (seenNonOptionArg || !isOption) {
+          options["arguments"].push(arg);
+        }
+      }
+      return options;
+    };
+
+    OptionParser.prototype.help = function() {
+      var letPart, lines, rule, spaces, _i, _len, _ref;
+
+      lines = [];
+      if (this.banner) {
+        lines.unshift("" + this.banner + "\n");
+      }
+      _ref = this.rules;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        rule = _ref[_i];
+        spaces = 15 - rule.longFlag.length;
+        spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
+        letPart = rule.shortFlag ? rule.shortFlag + ', ' : '    ';
+        lines.push('  ' + letPart + rule.longFlag + spaces + rule.description);
+      }
+      return "\n" + (lines.join('\n')) + "\n";
+    };
+
+    return OptionParser;
+
+  })();
+
+  LONG_FLAG = /^(--\w[\w\-]*)/;
+
+  SHORT_FLAG = /^(-\w)$/;
+
+  MULTI_FLAG = /^-(\w{2,})/;
+
+  OPTIONAL = /\[(\w+(\*?))\]/;
+
+  buildRules = function(rules) {
+    var tuple, _i, _len, _results;
+
+    _results = [];
+    for (_i = 0, _len = rules.length; _i < _len; _i++) {
+      tuple = rules[_i];
+      if (tuple.length < 3) {
+        tuple.unshift(null);
+      }
+      _results.push(buildRule.apply(null, tuple));
+    }
+    return _results;
+  };
+
+  buildRule = function(shortFlag, longFlag, description, options) {
+    var match;
+
+    if (options == null) {
+      options = {};
+    }
+    match = longFlag.match(OPTIONAL);
+    longFlag = longFlag.match(LONG_FLAG)[1];
+    return {
+      name: longFlag.substr(2),
+      shortFlag: shortFlag,
+      longFlag: longFlag,
+      description: description,
+      hasArgument: !!(match && match[1]),
+      isList: !!(match && match[2])
+    };
+  };
+
+  normalizeArguments = function(args) {
+    var arg, l, match, result, _i, _j, _len, _len1, _ref;
+
+    args = args.slice(0);
+    result = [];
+    for (_i = 0, _len = args.length; _i < _len; _i++) {
+      arg = args[_i];
+      if (match = arg.match(MULTI_FLAG)) {
+        _ref = match[1].split('');
+        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
+          l = _ref[_j];
+          result.push('-' + l);
+        }
+      } else {
+        result.push(arg);
+      }
+    }
+    return result;
+  };
+
+}).call(this);


[40/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/.project
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/.project b/lib/cordova-blackberry/blackberry/framework/ext/.project
new file mode 100644
index 0000000..ecbf8d5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>CordovaExtension</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>net.rim.ejde.internal.builder.BlackBerryPreprocessBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>net.rim.ejde.internal.builder.BlackBerryResourcesBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>net.rim.ejde.BlackBerryPreProcessNature</nature>
+		<nature>net.rim.ejde.BlackBerryProjectCoreNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/.settings/net.rim.browser.tools.debug.widget.prefs
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/.settings/net.rim.browser.tools.debug.widget.prefs b/lib/cordova-blackberry/blackberry/framework/ext/.settings/net.rim.browser.tools.debug.widget.prefs
new file mode 100644
index 0000000..524fddd
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/.settings/net.rim.browser.tools.debug.widget.prefs
@@ -0,0 +1,3 @@
+#Sun May 23 23:01:24 PDT 2010
+eclipse.preferences.version=1
+outputfolder=build

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/.settings/org.eclipse.jdt.core.prefs b/lib/cordova-blackberry/blackberry/framework/ext/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..be7e57d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Sun May 23 23:00:44 PDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore
+org.eclipse.jdt.core.compiler.source=1.3

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/BlackBerry_App_Descriptor.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/BlackBerry_App_Descriptor.xml b/lib/cordova-blackberry/blackberry/framework/ext/BlackBerry_App_Descriptor.xml
new file mode 100644
index 0000000..bb973e8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/BlackBerry_App_Descriptor.xml
@@ -0,0 +1,36 @@
+<Properties ModelVersion="1.1.2">
+<!-- 
+     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.
+-->
+  <General Title="" Version="1.0.0" Vendor="BlackBerry Developer" Description=""/>
+  <Application Type="BlackBerry Application" MainMIDletName="" MainArgs="" HomeScreenPosition="0" StartupTier="7" IsSystemModule="false" IsAutostartup="false"/>
+  <Resources hasTitleResource="false" TitleResourceBundleName="" TitleResourceBundleRelativePath="" TitleResourceBundleClassName="" TitleResourceBundleKey="" DescriptionId="">
+    <Icons/>
+  </Resources>
+  <Compile OutputCompilerMessages="false" ConvertImages="false" CreateWarningForNoExportedRoutine="true" CompressResources="false" AliasList="">
+    <PreprocessorDefines/>
+  </Compile>
+  <Packaging OutputFileName="Cordova" OutputFolder="deliverables" PreBuildStep="" PostBuildStep="" CleanStep="" GenerateALXFile="false">
+    <AlxFiles/>
+  </Packaging>
+  <HiddenProperties>
+    <ClassProtection/>
+    <PackageProtection/>
+  </HiddenProperties>
+  <AlternateEntryPoints/>
+</Properties>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/library.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/library.xml b/lib/cordova-blackberry/blackberry/framework/ext/src/library.xml
new file mode 100644
index 0000000..d408e9f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/library.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+       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.
+-->
+<library>
+	<extension>
+		<entryClass>org.apache.cordova.CordovaExtension</entryClass>
+	</extension>
+	<features>
+		<feature id="org.apache.cordova" version="1.0.0">Cordova JavaScript Extension</feature>
+		<feature id="blackberry.connection" version="1.0.0">Stub in for backwards bb10 support</feature>
+		<feature id="blackberry.io" version="1.0.0">Stub in for backwards bb10 support</feature>
+		<feature id="blackberry.invoked" version="1.0.0">Stub in for backwards bb10 support</feature>
+		<feature id="blackberry.invoke.card" version="1.0.0">Stub in for backwards bb10 support</feature>
+		<feature id="blackberry.ui.contextmenu" version="1.0.0">Stub in for backwards bb10 support</feature>
+		<feature id="blackberry.io.filetransfer" version="1.0.0">Stub in for backwards bb10 support</feature>
+		<feature id="blackberry.pim.contacts" version="1.0.0">Stub in for backwards bb10 support</feature>
+		<feature id="blackberry.bbm.platform" version="1.0.0">Stub in for backwards bb10 support</feature>
+	</features>
+</library>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/CordovaExtension.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/CordovaExtension.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/CordovaExtension.java
new file mode 100644
index 0000000..62943b4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/CordovaExtension.java
@@ -0,0 +1,208 @@
+/*
+ * 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.
+ *
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+package org.apache.cordova;
+
+import net.rim.device.api.browser.field2.BrowserField;
+import net.rim.device.api.script.ScriptEngine;
+import net.rim.device.api.system.Application;
+import net.rim.device.api.web.WidgetConfig;
+import net.rim.device.api.web.WidgetExtension;
+import net.rim.device.api.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.cordova.api.PluginManager;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.notification.Notification;
+import org.apache.cordova.util.Log;
+import org.apache.cordova.util.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * CordovaExtension is a BlackBerry WebWorks JavaScript extension.  It
+ * represents a single feature that can be used to access device capabilities.
+ */
+public final class CordovaExtension implements WidgetExtension {
+
+    // Weak reference encapsulating BrowserField object used to display the application
+    // We use the weak reference because keeping a direct reference can
+    // cause memory leak issues in WebWorks. Original solution described
+    // and suggested by Tim Neil on the BlackBerry support forums.
+    // Thanks Tim!
+    protected static WeakReference browser = null;
+
+    // Browser script engine
+    //
+    protected static ScriptEngine script;
+
+    // Application name
+    //
+    protected static String appName;
+
+    // Application GUID
+    //
+    protected static long appID;
+
+    // Plugin Manager
+    //
+    protected PluginManager pluginManager;
+
+    // Feature ID
+    //
+    private static final String FEATURE_ID ="org.apache.cordova";
+
+    // Called when the BlackBerry Widget references this extension for the first time.
+    // It provides a list of feature IDs exposed by this extension.
+    //
+    public String[] getFeatureList() {
+      return new String[] {FEATURE_ID};
+    }
+
+    // Called whenever a widget loads a resource that requires a feature ID that is supplied
+    // in the getFeatureList
+    //
+    public void loadFeature(String feature, String version, Document doc,
+            ScriptEngine scriptEngine) throws Exception {
+        script = scriptEngine;
+        // Not sure why logger is not already enabled?
+        Logger.enableLogging();
+        if (feature.equals(FEATURE_ID)) {
+            pluginManager = new PluginManager(this);
+
+            // create and parse the plugins.xml
+            Document c = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(Application.class.getResourceAsStream("/plugins.xml"));
+
+            NodeList plugins = c.getElementsByTagName("plugin");
+            if (plugins.getLength() == 0) {
+                Logger.warn("If you are using any Cordova APIs you will need to "+
+                        "specify them in the config.xml using <gap:plugin name=\"MyPlugin\" "+
+                        "value=\"com.example.MyPlugin\"/>");
+            }
+            for(int i=0; i<plugins.getLength() ; i++){
+                Node plugin = plugins.item(i);
+                Logger.log("Found plugin " + plugin.getAttributes().getNamedItem("name").getNodeValue() + " = " +
+                        plugin.getAttributes().getNamedItem("value").getNodeValue());
+                pluginManager.addService(plugin.getAttributes().getNamedItem("name").getNodeValue(),
+                        plugin.getAttributes().getNamedItem("value").getNodeValue());
+            }
+
+            scriptEngine.addExtension("org.apache.cordova.JavaPluginManager",  pluginManager);
+            scriptEngine.addExtension("org.apache.cordova.Logger",         new Log());
+
+            // let Cordova JavaScript know that extensions have been loaded
+            // if this is premature, we at least set the _nativeReady flag to true
+            // so that when the JS side is ready, it knows native side is too
+            Logger.log(this.getClass().getName() + ": invoking Cordova.onNativeReady.fire()");
+            scriptEngine.executeScript("try {cordova.require('cordova/channel').onNativeReady.fire();} catch(e) {_nativeReady = true;}", null);
+        }
+    }
+
+    // Called so that the extension can get a reference to the configuration or browser field object
+    //
+    public void register(WidgetConfig widgetConfig, BrowserField browserField) {
+        browser = new WeakReference(browserField);
+
+        // grab widget application name and use it to generate a unique ID
+        appName = widgetConfig.getName();
+        appID = Long.parseLong(Math.abs(("org.apache.cordova."+appName).hashCode())+"",16);
+
+        // create a notification profile for the application
+        Notification.registerProfile();
+    }
+
+    /**
+     * Called to clean up any features when the extension is unloaded.  This is
+     * invoked by the WebWorks Framework when another URL is loaded.
+     *
+     * @see net.rim.device.api.web.WidgetExtension#unloadFeatures(org.w3c.dom.Document)
+     */
+    public void unloadFeatures(Document doc) {
+        // Cleanup plugin resources.
+        if (pluginManager != null) {
+            pluginManager.destroy();
+        }
+    }
+
+    public static void invokeScript(final String js) {
+        // Use a new thread so that JavaScript is invoked asynchronously.
+        // Otherwise executeScript doesn't return until JavaScript call back
+        // is finished.
+        (new Thread() {
+            public void run() {
+                try {
+                    script.executeScript(js, null);
+                } catch (Exception e) {
+                    // This is likely an IllegalStateException which is thrown
+                    // because the framework is in the process of being shutdown
+                    // so communication to JavaScript side is not allowed.
+                    Logger.log("Caught exception while executing script: "
+                            + e.getMessage());
+                }
+            }
+        }).start();
+    }
+
+    /**
+     * Invokes the Cordova success callback specified by callbackId.
+     * @param callbackId   unique callback ID
+     * @param result       Cordova PluginResult containing result
+     */
+    public static void invokeSuccessCallback(String callbackId, PluginResult result) {
+      invokeScript(result.toSuccessCallbackString(callbackId));
+    }
+
+    /**
+     * Invokes the Cordova error callback specified by callbackId.
+     * @param callbackId   unique callback ID
+     * @param result       Cordova PluginResult containing result
+     */
+    public static void invokeErrorCallback(String callbackId, PluginResult result) {
+      invokeScript(result.toErrorCallbackString(callbackId));
+    }
+
+    /**
+     * Provides access to the browser instance for the application.
+     */
+    public static BrowserField getBrowserField() {
+      Object o = browser.get();
+      if ( o instanceof BrowserField ) {
+        return (BrowserField)o;
+      } else {
+        return null;
+      }
+    }
+
+    /**
+     * Returns the widget application name.
+     */
+    public static String getAppName() {
+        return appName;
+    }
+
+    /**
+     * Returns unique ID of the widget application.
+     */
+    public static long getAppID() {
+        return appID;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/accelerometer/Accelerometer.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/accelerometer/Accelerometer.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/accelerometer/Accelerometer.java
new file mode 100644
index 0000000..2088122
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/accelerometer/Accelerometer.java
@@ -0,0 +1,228 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.accelerometer;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import net.rim.device.api.system.AccelerometerData;
+import net.rim.device.api.system.AccelerometerListener;
+import net.rim.device.api.system.AccelerometerSensor;
+import net.rim.device.api.system.Application;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+
+public class Accelerometer extends Plugin implements AccelerometerListener {
+    private static final String LOG_TAG = "Accelerometer: ";
+
+    private static final String ACTION_START = "start";
+    private static final String ACTION_STOP = "stop";
+
+    private static final int STOPPED = 0;
+    private static final int STARTING = 1;
+    private static final int RUNNING = 2;
+    private static final int ERROR_FAILED_TO_START = 3;
+
+    // BlackBerry uses a value of 1000 (AccelerometerSensor.G_FORCE_VALUE) to
+    // represent g force constant. Spec uses m/s^2. This constant is used
+    // to normalize BlackBerry values to the spec.
+    private static final short G_FORCE_NORMALIZE = 981;
+
+    // the single channel to the device sensor
+    private static AccelerometerSensor.Channel _rawDataChannel = null;
+
+    private int state = STOPPED; // state of this listener
+    private long initTime = 0;
+
+    /**
+     * Reference to single start callbackid
+     */
+    private String callbackId;
+
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+        PluginResult result;
+        if (!AccelerometerSensor.isSupported()) {
+            result = new PluginResult(
+                    PluginResult.Status.ILLEGAL_ACCESS_EXCEPTION,
+                    "Accelerometer sensor not supported");
+        } else if (ACTION_START.equals(action)) {
+            result = start(callbackId);
+        } else if (ACTION_STOP.equals(action)) {
+            result = stop();
+        } else {
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION,
+                    "Accelerometer: Invalid action:" + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Implements the AccelerometerListener method. We listen for the purpose of
+     * closing the application's accelerometer sensor channel after timeout has
+     * been exceeded.
+     */
+    public void onData(AccelerometerData accelData) {
+        short x = accelData.getLastXAcceleration();
+        short y = accelData.getLastYAcceleration();
+        short z = accelData.getLastZAcceleration();
+
+        // If any value is not zero, assume sensor is now active and set state.
+        if (state == STARTING && (x != 0 || y != 0 || z != 0)) {
+            state = RUNNING;
+        }
+
+        if (state == RUNNING) {
+            // Send the new accelerometer data.
+            JSONObject accel = new JSONObject();
+            try {
+                accel.put("x", normalize(x));
+                accel.put("y", normalize(y));
+                accel.put("z", normalize(z));
+                accel.put("timestamp", accelData.getLastTimestamp());
+                sendResult(true,
+                        new PluginResult(PluginResult.Status.OK, accel), true);
+            } catch (JSONException e) {
+                sendResult(false, new PluginResult(
+                        PluginResult.Status.JSON_EXCEPTION, "JSONException:"
+                                + e.getMessage()), false);
+            }
+        } else if ((System.currentTimeMillis() - initTime) > 2000) {
+            // If the sensor does not become active within 2 seconds of
+            // the request to start it, fail out.
+            stop();
+            state = ERROR_FAILED_TO_START;
+            JSONObject errorObj = new JSONObject();
+            try {
+                errorObj.put("code", ERROR_FAILED_TO_START);
+                errorObj.put("message", "Accelerometer could not be started.");
+            } catch (JSONException e) {
+                Logger.log(LOG_TAG
+                        + "Failed to build JSON object for ERROR_FAILED_TO_START.");
+            }
+            sendResult(false, new PluginResult(PluginResult.Status.ERROR,
+                    errorObj), false);
+        }
+    }
+
+    /**
+     * Called when Plugin is destroyed.
+     */
+    public void onDestroy() {
+        stop();
+    }
+
+    /**
+     * Adds a SystemListener to listen for changes to the battery state. The
+     * listener is only registered if one has not already been added.
+     */
+    private PluginResult start(String callbackId) {
+        this.callbackId = callbackId;
+        if (_rawDataChannel == null || !_rawDataChannel.isOpen()) {
+            _rawDataChannel = AccelerometerSensor
+                    .openRawDataChannel(Application.getApplication());
+            Logger.log(LOG_TAG + "sensor channel opened");
+
+            initTime = System.currentTimeMillis();
+            state = STARTING;
+            _rawDataChannel.setAccelerometerListener(this);
+            Logger.log(LOG_TAG + "sensor listener added");
+        }
+
+        PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
+        result.setKeepCallback(true);
+        return result;
+    }
+
+    /**
+     * Normalize the range of values returned by BlackBerry to the agreed upon
+     * cross platform range.
+     *
+     * @param value
+     * @return normalized value
+     */
+    private double normalize(short value) {
+        // Integer multiplication is less troublesome then floating point.
+        StringBuffer buf = new StringBuffer(String.valueOf(value
+                * G_FORCE_NORMALIZE));
+
+        // Manipulate the string to properly insert zeros and decimal point so
+        // something like -708910 becomes -7.08910 and 764 becomes .00764.
+        // Due to the values returned by BlackBerry there will always be 5
+        // decimal precision in the normalized value.
+        int idx = buf.charAt(0) == '-' ? 1 : 0;
+        while (buf.length() < (5 + idx)) {
+            buf.insert(idx, '0');
+        }
+        buf.insert(buf.length() - 5, '.');
+
+        return Double.parseDouble(buf.toString());
+    }
+
+    /**
+     * Helper function to send a PluginResult to the saved call back ID.
+     *
+     * @param issuccess
+     *            true if this is a successful result, false otherwise.
+     * @param result
+     *            the PluginResult to return
+     * @param keepCallback
+     *            Boolean value indicating whether to keep the call back id
+     *            active.
+     */
+    private synchronized void sendResult(boolean issuccess,
+            PluginResult result, boolean keepCallback) {
+
+        if (result != null) {
+            // Must keep the call back active for future watch events.
+            result.setKeepCallback(keepCallback);
+
+            if (issuccess) {
+                success(result, this.callbackId);
+            } else {
+                error(result, this.callbackId);
+            }
+        }
+    }
+
+    /**
+     * Stops accelerometer listener and closes the sensor channel.
+     */
+    private synchronized PluginResult stop() {
+        if (_rawDataChannel != null && _rawDataChannel.isOpen()) {
+
+            // Remove the battery listener.
+            _rawDataChannel.removeAccelerometerListener();
+            _rawDataChannel.close();
+            _rawDataChannel = null;
+
+            Logger.log(LOG_TAG + "sensor channel closed");
+        }
+
+        state = STOPPED;
+
+        return new PluginResult(PluginResult.Status.OK);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/IPlugin.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/IPlugin.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/IPlugin.java
new file mode 100644
index 0000000..7e09d31
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/IPlugin.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.api;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.json4j.JSONArray;
+
+/**
+ * Plugin interface must be implemented by any plugin classes.
+ *
+ * The execute method is called by the PluginManager.
+ */
+public interface IPlugin {
+
+	/**
+	 * Executes the request and returns PluginResult.
+	 *
+	 * @param action 		The action to execute.
+	 * @param args 			JSONArry of arguments for the plugin.
+	 * @param callbackId	The callback id used when calling back into JavaScript.
+	 * @return 				A PluginResult object with a status and message.
+	 */
+	PluginResult execute(String action, JSONArray args, String callbackId);
+
+	/**
+	 * Identifies if action to be executed returns a value and should be run synchronously.
+	 *
+	 * @param action	The action to execute
+	 * @return			T=returns value
+	 */
+	public boolean isSynch(String action);
+
+	/**
+	 * Sets the context of the Plugin. This can then be used to do things like
+	 * get file paths associated with the Activity.
+	 *
+	 * @param ctx The main application class.
+	 */
+	void setContext(CordovaExtension ctx);
+
+    /**
+     * Called when the system is about to start resuming a previous activity.
+     */
+    void onPause();
+
+    /**
+     * Called when the activity will start interacting with the user.
+     */
+    void onResume();
+
+    /**
+     * The final call you receive before your activity is destroyed.
+     */
+    void onDestroy();
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/Plugin.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/Plugin.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/Plugin.java
new file mode 100644
index 0000000..6f70b85
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/Plugin.java
@@ -0,0 +1,114 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.api;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.json4j.JSONArray;
+
+/**
+ * Plugin interface must be implemented by any plugin classes.
+ *
+ * The execute method is called by the PluginManager.
+ */
+public abstract class Plugin implements IPlugin {
+
+    public CordovaExtension ctx;					// Main application object
+
+	/**
+	 * Executes the request and returns PluginResult.
+	 *
+	 * @param action 		The action to execute.
+	 * @param args 			JSONArry of arguments for the plugin.
+	 * @param callbackId	The callback id used when calling back into JavaScript.
+	 * @return 				A PluginResult object with a status and message.
+	 */
+	public abstract PluginResult execute(String action, JSONArray args, String callbackId);
+
+	/**
+	 * Identifies if action to be executed returns a value and should be run synchronously.
+	 *
+	 * @param action	The action to execute
+	 * @return			T=returns value
+	 */
+	public boolean isSynch(String action) {
+		return false;
+	}
+
+	/**
+	 * Sets the context of the Plugin. This can then be used to do things like
+	 * get file paths associated with the Activity.
+	 *
+	 * @param ctx The context of the main Activity.
+	 */
+	public void setContext(CordovaExtension ctx) {
+		this.ctx = ctx;
+	}
+
+    /**
+     * Called when Plugin is paused.
+     */
+    public void onPause() {
+    }
+
+    /**
+     * Called when Plugin is resumed.
+     */
+    public void onResume() {
+    }
+
+    /**
+     * Called when Plugin is destroyed.
+     */
+    public void onDestroy() {
+    }
+
+    /**
+     * Send generic JavaScript statement back to JavaScript.
+     * success(...) and error(...) should be used instead where possible.
+     *
+     * @param statement
+     */
+    public void invokeScript(String statement) {
+        CordovaExtension.invokeScript(statement);
+    }
+
+    /**
+     * Call the JavaScript success callback for this plugin.
+     *
+     * This can be used if the execute code for the plugin is asynchronous meaning
+     * that execute should return null and the callback from the async operation can
+     * call success(...) or error(...)
+     *
+     * @param pluginResult		The result to return.
+	 * @param callbackId		The callback id used when calling back into JavaScript.
+     */
+    public static void success(PluginResult pluginResult, String callbackId) {
+        CordovaExtension.invokeSuccessCallback(callbackId, pluginResult);
+    }
+
+    /**
+     * Call the JavaScript error callback for this plugin.
+     *
+     * @param pluginResult		The result to return.
+	 * @param callbackId		The callback id used when calling back into JavaScript.
+     */
+    public static void error(PluginResult pluginResult, String callbackId) {
+        CordovaExtension.invokeErrorCallback(callbackId, pluginResult);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManager.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManager.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManager.java
new file mode 100644
index 0000000..a8e5e9b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManager.java
@@ -0,0 +1,168 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.api;
+
+import java.util.Hashtable;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.script.Scriptable;
+import net.rim.device.api.script.ScriptableFunction;
+
+/**
+ * PluginManager represents an object in the script engine. It can be accessed
+ * from the script environment using <code>cordova.PluginManager</code>.
+ *
+ * PluginManager provides a function, <code>exec</code>, that can be invoked
+ * from the script environment: <code>cordova.PluginManager.exec(...)</code>.
+ * Invoking this function causes the script engine to load the appropriate
+ * Cordova Plugin and perform the specified action.
+ */
+public final class PluginManager extends Scriptable {
+
+    /**
+     * Field used to invoke Plugin actions.
+     */
+    public static String FIELD_EXEC = "exec";
+
+    /**
+     * Field used to cleanup Plugins.
+     */
+    public static String FIELD_DESTROY = "destroy";
+
+    /**
+     * Field used to indicate application has been brought to foreground.
+     */
+    public static String FIELD_RESUME = "resume";
+
+    /**
+     * Field used to indicate application has been sent to background
+     */
+    public static String FIELD_PAUSE = "pause";
+
+    /**
+     * Field used to register a Plugin.
+     */
+    public static String FIELD_ADD_PLUGIN = "addPlugin";
+
+    /**
+     * Loads the appropriate Cordova Plugins and invokes their actions.
+     */
+    private final PluginManagerFunction pluginManagerFunction;
+
+    /**
+     * Maps available services to Java class names.
+     */
+    private Hashtable services = new Hashtable();
+
+    /**
+     * Constructor.  Adds available Cordova services.
+     * @param ext   The Cordova JavaScript Extension
+     */
+    public PluginManager(CordovaExtension ext) {
+        this.pluginManagerFunction = new PluginManagerFunction(ext, this);
+    }
+
+    /**
+     * The following fields are supported from the script environment:
+     *
+     *  <code>cordova.pluginManager.exec</code> - Loads the appropriate
+     *  Plugin and invokes the specified action.
+     *
+     *  <code>cordova.pluginManager.destroy</code> - Invokes the <code>onDestroy</code>
+     *  method on all Plugins to give them a chance to cleanup before exit.
+     */
+    public Object getField(String name) throws Exception {
+        if (name.equals(FIELD_EXEC)) {
+            return this.pluginManagerFunction;
+        }
+        else if (name.equals(FIELD_DESTROY)) {
+            return new ScriptableFunction() {
+                public Object invoke(Object obj, Object[] oargs) throws Exception {
+                    destroy();
+                    return null;
+                }
+            };
+        }
+        else if (name.equals(FIELD_RESUME)) {
+            final PluginManagerFunction plugin_mgr = this.pluginManagerFunction;
+            return new ScriptableFunction() {
+                public Object invoke(Object obj, Object[] oargs) throws Exception {
+                    plugin_mgr.onResume();
+                    return null;
+                }
+            };
+        }
+        else if (name.equals(FIELD_PAUSE)) {
+            final PluginManagerFunction plugin_mgr = this.pluginManagerFunction;
+            return new ScriptableFunction() {
+                public Object invoke(Object obj, Object[] oargs) throws Exception {
+                    plugin_mgr.onPause();
+                    return null;
+                }
+            };
+        }
+        else if (name.equals(FIELD_ADD_PLUGIN)) {
+            Logger.log("Plugins are now added through the plugins.xml in the application root.");
+        }
+        return super.getField(name);
+    }
+
+    /**
+     * Add a class that implements a service.
+     *
+     * @param serviceName   The service name.
+     * @param className     The Java class name that implements the service.
+     */
+    public void addService(String serviceName, String className) {
+        this.services.put(serviceName, className);
+    }
+
+    /**
+     * Cleanup the plugin resources and delete temporary directory that may have
+     * been created.
+     */
+    public void destroy() {
+        // allow plugins to clean up
+        pluginManagerFunction.onDestroy();
+
+        // delete temporary application directory
+        // NOTE: doing this on a background thread doesn't work because the app
+        // is closing and the thread is killed before it completes.
+        try {
+            FileUtils.deleteApplicationTempDirectory();
+        } catch (Exception e) {
+            Logger.log(this.getClass().getName()
+                    + ": error deleting application temp directory: "
+                    + e.getMessage());
+        }
+    }
+
+    /**
+     * Get the class that implements a service.
+     *
+     * @param serviceName   The service name.
+     * @return The Java class name that implements the service.
+     */
+    public String getClassForService(String serviceName) {
+        return (String)this.services.get(serviceName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManagerFunction.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManagerFunction.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManagerFunction.java
new file mode 100644
index 0000000..13a0e77
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginManagerFunction.java
@@ -0,0 +1,240 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.api;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import net.rim.device.api.script.ScriptableFunction;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.util.Logger;
+
+/**
+ * PluginManagerFunction represents a function that can be invoked from the
+ * script environment of the widget framework.  It manages the plugins for
+ * the Cordova JavaScript Extension.
+ *
+ * Calling <code>cordova.pluginManager.exec(...)</code> from JavaScript will
+ * result in this class' <code>invoke()</code> method being called.
+ */
+public class PluginManagerFunction extends ScriptableFunction {
+
+	private final static int ARG_SERVICE = 0;
+	private final static int ARG_ACTION = 1;
+	private final static int ARG_CALLBACK_ID = 2;
+	private final static int ARG_ARGS = 3;
+	private final static int ARG_ASYNC = 4;
+
+	private Hashtable plugins = new Hashtable();
+
+	private final CordovaExtension ext;
+	private final PluginManager pluginManager;
+
+	/**
+	 * Constructor.
+	 * @param ext              The Cordova JavaScript Extension
+	 * @param pluginManager    The PluginManager that exposes the scriptable object.
+	 */
+	public PluginManagerFunction(CordovaExtension ext, PluginManager pluginManager) {
+		this.ext = ext;
+		this.pluginManager = pluginManager;
+	}
+
+	/**
+	 * The invoke method is called when cordova.pluginManager.exec(...) is
+	 * used from the script environment.  It instantiates the appropriate plugin
+	 * and invokes the specified action.  JavaScript arguments are passed in
+	 * as an array of objects.
+	 *
+	 * @param service 		String containing the service to run
+	 * @param action 		String containing the action that the service is supposed to perform. This is
+	 * 						passed to the plugin execute method and it is up to the plugin developer
+	 * 						how to deal with it.
+	 * @param callbackId 	String containing the id of the callback that is executed in JavaScript if
+	 * 						this is an async plugin call.
+	 * @param args 			An Array literal string containing any arguments needed in the
+	 * 						plugin execute method.
+	 * @param async 		Boolean indicating whether the calling JavaScript code is expecting an
+	 * 						immediate return value. If true, either CordovaExtension.callbackSuccess(...) or
+	 * 						CordovaExtension.callbackError(...) is called once the plugin code has executed.
+	 *
+	 * @return 				JSON encoded string with a response message and status.
+	 *
+	 * @see net.rim.device.api.script.ScriptableFunction#invoke(java.lang.Object, java.lang.Object[])
+	 */
+	public Object invoke(Object obj, Object[] oargs) throws Exception {
+		final String service = (String)oargs[ARG_SERVICE];
+		final String action = (String)oargs[ARG_ACTION];
+		final String callbackId = (String)oargs[ARG_CALLBACK_ID];
+		boolean async = (oargs[ARG_ASYNC].toString().equals("true") ? true : false);
+		PluginResult pr = null;
+
+		try {
+			// action arguments
+			final JSONArray args = new JSONArray((String)oargs[ARG_ARGS]);
+
+			// get the class for the specified service
+			String clazz = this.pluginManager.getClassForService(service);
+			Class c = null;
+			if (clazz != null) {
+				c = getClassByName(clazz);
+			}
+
+			if (isCordovaPlugin(c)) {
+				// Create a new instance of the plugin and set the context
+				final Plugin plugin = this.loadPlugin(clazz, c);
+				async = async && !plugin.isSynch(action);
+				if (async) {
+					// Run this async on a background thread so that JavaScript can continue on
+					Thread thread = new Thread(new Runnable() {
+						public void run() {
+							// Call execute on the plugin so that it can do it's thing
+						    final PluginResult result = plugin.execute(action, args, callbackId);
+
+						    if (result != null) {
+						        int status = result.getStatus();
+
+						        // If plugin status is OK,
+						        // or plugin is not going to send an immediate result (NO_RESULT)
+						        if (status == PluginResult.Status.OK.ordinal() ||
+						            status == PluginResult.Status.NO_RESULT.ordinal()) {
+						            CordovaExtension.invokeSuccessCallback(callbackId, result);
+						        }
+						        // error
+						        else {
+						            CordovaExtension.invokeErrorCallback(callbackId, result);
+						        }
+						    }
+						}
+					});
+					thread.start();
+					return "";
+				} else {
+					// Call execute on the plugin so that it can do it's thing
+					pr = plugin.execute(action, args, callbackId);
+				}
+			}
+		} catch (ClassNotFoundException e) {
+		    Logger.log(this.getClass().getName() + ": " + e);
+			pr = new PluginResult(PluginResult.Status.CLASS_NOT_FOUND_EXCEPTION, "ClassNotFoundException: " + e.getMessage());
+		} catch (IllegalAccessException e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+			pr = new PluginResult(PluginResult.Status.ILLEGAL_ACCESS_EXCEPTION, "IllegalAccessException:" + e.getMessage());
+		} catch (InstantiationException e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+			pr = new PluginResult(PluginResult.Status.INSTANTIATION_EXCEPTION, "InstantiationException: " + e.getMessage());
+		} catch (JSONException e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+			pr = new PluginResult(PluginResult.Status.JSON_EXCEPTION, "JSONException: " + e.getMessage());
+		}
+		// if async we have already returned at this point unless there was an error...
+		if (async) {
+			CordovaExtension.invokeErrorCallback(callbackId, pr);
+		}
+		return ( pr != null ? pr.getJSONString() : "{ status: 0, message: 'all good' }" );
+	}
+
+	/**
+	 * Get the class.
+	 *
+	 * @param clazz
+	 * @return
+	 * @throws ClassNotFoundException
+	 */
+	private Class getClassByName(final String clazz) throws ClassNotFoundException {
+		return Class.forName(clazz);
+	}
+
+	/**
+	 * Determines if the class implements org.apache.cordova.api.Plugin interface.
+	 *
+	 * @param c The class to check.
+	 * @return Boolean indicating if the class implements org.apache.cordova.api.Plugin
+	 */
+	private boolean isCordovaPlugin(Class c) {
+		if (c != null) {
+			return org.apache.cordova.api.Plugin.class.isAssignableFrom(c) || org.apache.cordova.api.IPlugin.class.isAssignableFrom(c);
+		}
+		return false;
+	}
+
+    /**
+     * Add plugin to be loaded and cached.
+     * If plugin is already created, then just return it.
+     *
+     * @param className				The class to load
+     * @return						The plugin
+     */
+	public Plugin loadPlugin(String className, Class clazz) throws IllegalAccessException, InstantiationException {
+	    if (this.plugins.containsKey(className)) {
+                return this.getPlugin(className);
+	    }
+        Logger.log(this.getClass().getName() + ": Loading plugin " + clazz);
+        Plugin plugin = (Plugin)clazz.newInstance();
+        this.plugins.put(className, plugin);
+        plugin.setContext(this.ext);
+        return plugin;
+    }
+
+    /**
+     * Get the loaded plugin.
+     *
+     * @param className				The class of the loaded plugin.
+     * @return
+     */
+    public Plugin getPlugin(String className) {
+        return (Plugin)this.plugins.get(className);
+    }
+
+    /**
+     * Called when application is paused.
+     */
+    public void onPause() {
+        Enumeration e = this.plugins.elements();
+        while (e.hasMoreElements()) {
+            Plugin plugin = (Plugin)e.nextElement();
+            plugin.onPause();
+        }
+    }
+
+    /**
+     * Called when application is resumed.
+     */
+    public void onResume() {
+        Enumeration e = this.plugins.elements();
+        while (e.hasMoreElements()) {
+            Plugin plugin = (Plugin)e.nextElement();
+            plugin.onResume();
+        }
+    }
+
+    /**
+     * Called when application is destroyed.
+     */
+    public void onDestroy() {
+        Enumeration e = this.plugins.elements();
+        while (e.hasMoreElements()) {
+            Plugin plugin = (Plugin)e.nextElement();
+            plugin.onDestroy();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginResult.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginResult.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginResult.java
new file mode 100644
index 0000000..ce84884
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/api/PluginResult.java
@@ -0,0 +1,152 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.api;
+
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONObject;
+
+/**
+ * This class defines the standard object that should be returned as the
+ * result of any Cordova plugin invocation.
+ */
+public class PluginResult {
+
+    private final int status;
+    private final String message;
+    private boolean keepCallback = false;
+
+    public PluginResult(Status status) {
+        this.status = status.ordinal();
+        this.message = JSONObject.quote(status.getMessage());
+    }
+
+    public PluginResult(Status status, String message) {
+        this.status = status.ordinal();
+        this.message = JSONObject.quote(message);
+    }
+
+    public PluginResult(Status status, JSONArray message) {
+        this.status = status.ordinal();
+        this.message = message.toString();
+    }
+
+    public PluginResult(Status status, JSONObject message) {
+        this.status = status.ordinal();
+        this.message = (message != null) ? message.toString(): "null";
+    }
+
+    public PluginResult(Status status, int i) {
+        this.status = status.ordinal();
+        this.message = ""+i;
+    }
+
+    public PluginResult(Status status, float f) {
+        this.status = status.ordinal();
+        this.message = ""+f;
+    }
+
+    public PluginResult(Status status, boolean b) {
+        this.status = status.ordinal();
+        this.message = ""+b;
+    }
+
+    public PluginResult(Status status, long l) {
+        this.status = status.ordinal();
+        this.message = ""+l;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setKeepCallback(boolean b) {
+        this.keepCallback = b;
+    }
+
+    public boolean getKeepCallback() {
+        return this.keepCallback;
+    }
+
+    public String getJSONString() {
+        return "{\"status\":" + this.status + ",\"message\":" + this.message + ",\"keepCallback\":" + this.keepCallback + "}";
+    }
+
+    /**
+     * Returns the JavaScript string that executes the success callback for the
+     * appropriate Cordova plugin.  The string is intended to be passed to the
+     * JavaScript engine.
+     * @param callbackId Unique id of the callback that is associated with the invoked plugin
+     * @return JavaScript string that invokes the appropriate plugin success callback
+     */
+    public String toSuccessCallbackString(String callbackId) {
+        return "try { cordova.callbackSuccess('"+callbackId+"', " + this.getJSONString() + "); } catch(e) { alert('error in callbackSuccess:' + e.message); }";
+    }
+
+    /**
+     * Returns the JavaScript string that executes the error callback for the
+     * appropriate Cordova plugin.  The string is intended to be passed to the
+     * JavaScript engine.
+     * @param callbackId Unique id of the callback that is associated with the invoked plugin
+     * @return JavaScript string that invokes the appropriate plugin error callback
+     */
+    public String toErrorCallbackString(String callbackId) {
+        return "try { cordova.callbackError('"+callbackId+"', " + this.getJSONString() + "); } catch(e) { alert('error in callbackError:' + e.message); }";
+    }
+
+    public String toErrorString() {
+        return "alert('general error');";
+    }
+
+    /**
+     * Enumerates PluginResult status.
+     */
+    public static class Status
+    {
+        private int val;
+        private String message;
+
+        protected Status(int val, String message) {
+            this.val = val;
+            this.message = message;
+        }
+
+        public int ordinal() {
+            return this.val;
+        }
+
+        public String getMessage() {
+            return this.message;
+        }
+
+        public static final Status NO_RESULT = new Status(0, "No result");
+        public static final Status OK = new Status(1, "OK");
+        public static final Status CLASS_NOT_FOUND_EXCEPTION = new Status(2, "Class not found");
+        public static final Status ILLEGAL_ACCESS_EXCEPTION = new Status(3, "Illegal access");
+        public static final Status INSTANTIATION_EXCEPTION = new Status(4, "Instantiation error");
+        public static final Status MALFORMED_URL_EXCEPTION = new Status(5, "Malformed URL");
+        public static final Status IO_EXCEPTION = new Status(6, "IO error");
+        public static final Status INVALID_ACTION = new Status(7, "Invalid action");
+        public static final Status JSON_EXCEPTION = new Status(8, "JSON error");
+        public static final Status ERROR = new Status(9, "Error");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/app/App.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/app/App.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/app/App.java
new file mode 100644
index 0000000..38ae205
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/app/App.java
@@ -0,0 +1,147 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.app;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+
+import net.rim.device.api.browser.field2.BrowserFieldHistory;
+import net.rim.device.api.system.Application;
+import net.rim.device.api.system.SystemListener2;
+
+/**
+ * The App plug-in. This class provides access to application specific
+ * management. The following actions are supported:
+ *
+ *      clearHistory    - Clear the browser history.
+ *      backHistory     - Navigate back in the browser history.
+ *      detectBacklight - Start a system listener for backlight changes.
+ *      ignoreBacklight - Stop the system listener for backlight changes.
+ */
+public class App extends Plugin {
+
+    private final static String ACTION_CLEAR_HISTORY = "clearHistory";
+    private final static String ACTION_BACK_HISTORY = "backHistory";
+    private final static String ACTION_DETECT_BACKLIGHT = "detectBacklight";
+    private final static String ACTION_IGNORE_BACKLIGHT = "ignoreBacklight";
+
+    private SystemListener2 listener = null;
+    private String callbackId = null;
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action
+     *            The action to execute.
+     * @param callbackId
+     *            The callback ID to be invoked upon action completion
+     * @param args
+     *            JSONArry of arguments for the action.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args,
+            final String callbackId) {
+        PluginResult result = null;
+
+        if (ACTION_CLEAR_HISTORY.equals(action)) {
+            BrowserFieldHistory history = CordovaExtension.getBrowserField()
+                    .getHistory();
+            if (history != null) {
+                history.clearHistory();
+            }
+            result = new PluginResult(PluginResult.Status.OK);
+        } else if (ACTION_BACK_HISTORY.equals(action)) {
+            CordovaExtension.getBrowserField().back();
+            result = new PluginResult(PluginResult.Status.OK);
+        } else if (ACTION_DETECT_BACKLIGHT.equals(action)) {
+            addListener(callbackId);
+            result = new PluginResult(PluginResult.Status.NO_RESULT);
+            result.setKeepCallback(true);
+        } else if (ACTION_IGNORE_BACKLIGHT.equals(action)) {
+            removeListener();
+            result = new PluginResult(PluginResult.Status.OK);
+        } else {
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION,
+                    "App: Invalid action: " + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Called when Plugin is destroyed.
+     */
+    public void onDestroy() {
+        removeListener();
+    }
+
+    /**
+     * Register a system listener for backlight changes if one has not already
+     * been registered.
+     *
+     * @param callbackId
+     *            the callback ID associated with the system listener
+     */
+    private synchronized void addListener(final String callbackId) {
+        if (listener == null) {
+            listener = new SystemListener2() {
+                public void batteryGood() {}
+                public void batteryLow() {}
+                public void batteryStatusChange(int status) {}
+                public void powerOff() {}
+                public void powerUp() {}
+
+                public void backlightStateChange(boolean on) {
+                    PluginResult result = new PluginResult(
+                            PluginResult.Status.OK, on);
+
+                    // Must keep the call back active for future events.
+                    result.setKeepCallback(true);
+                    success(result, callbackId);
+                }
+
+                public void cradleMismatch(boolean mismatch) {}
+                public void fastReset() {}
+                public void powerOffRequested(int reason) {}
+                public void usbConnectionStateChange(int state) {}
+            };
+
+            this.callbackId = callbackId;
+            Application.getApplication().addSystemListener(listener);
+        }
+    }
+
+    /**
+     * Remove the system listener if it is registered and close out the
+     * callback handler.
+     */
+    private synchronized void removeListener() {
+        if (listener != null) {
+            Application.getApplication().removeSystemListener(listener);
+            listener = null;
+
+            if (callbackId != null) {
+                success(new PluginResult(PluginResult.Status.NO_RESULT),
+                        callbackId);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/battery/Battery.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/battery/Battery.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/battery/Battery.java
new file mode 100644
index 0000000..55356a5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/battery/Battery.java
@@ -0,0 +1,210 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.battery;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.system.Application;
+import net.rim.device.api.system.DeviceInfo;
+import net.rim.device.api.system.SystemListener;
+
+/**
+ * The Battery plug-in. This class provides information about the state of the
+ * battery on the phone. The following actions are supported:
+ *
+ *      start - Start listening for changes in battery level (%) and batter
+ *              charging state.
+ *      stop  - Stop listening for changes in battery level and state.
+ */
+public class Battery extends Plugin {
+
+    /** Actions to start and stop listening for battery changes. */
+    private final static String ACTION_START = "start";
+    private final static String ACTION_STOP = "stop";
+
+    /** The percentage of battery remaining. */
+    private final static String LEVEL = "level";
+
+    /** Whether the battery is currently charging or not. */
+    private final static String CHARGING = "isPlugged";
+
+    // The set of call back IDs to send results to. Using Hashtable because
+    // BlackBerry does not support Collections. There should only ever be one
+    // call back ID, but this allows multiple.
+    private Hashtable callbackIds = new Hashtable();
+
+    private SystemListener batteryListener = null;
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action
+     *            The action to execute.
+     * @param callbackId
+     *            The callback ID to be invoked upon action completion
+     * @param args
+     *            JSONArry of arguments for the action.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+        PluginResult result = null;
+
+        if (ACTION_START.equals(action)) {
+            // Register a listener to detect battery changes.
+            addListener(callbackId);
+
+            // Don't return any result now, since battery status results are
+            // sent when listener is notified.
+            result = new PluginResult(PluginResult.Status.NO_RESULT);
+
+            // Must keep the call back active for future events.
+            result.setKeepCallback(true);
+        } else if (ACTION_STOP.equals(action)) {
+            // Remove the battery listener and cleanup call back IDs.
+            removeListener();
+            result = new PluginResult(PluginResult.Status.OK);
+        } else {
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION,
+                    "Battery: Invalid action: " + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Remove the listener when the application is destroyed. Note that onPause
+     * is not overridden, so the listener will continue if the application is
+     * simply paused instead of destroyed.
+     */
+    public void onDestroy() {
+        removeListener();
+    }
+
+    /**
+     * Adds a SystemListener to listen for changes to the battery state. The
+     * listener is only registered if one has not already been added. If a
+     * listener has already been registered the call back id is simply saved so
+     * that it can be notified upon next battery state change.
+     *
+     * @param callbackId
+     *            The reference point to call back when a listener event occurs.
+     */
+    private synchronized void addListener(String callbackId) {
+        callbackIds.put(callbackId, callbackId);
+
+        // Only register a listener if one has not been registered.
+        if (batteryListener == null) {
+            batteryListener = new SystemListener() {
+                // Initialize the charging state and battery level.
+                private boolean prevChargeState = (DeviceInfo
+                        .getBatteryStatus() & DeviceInfo.BSTAT_CHARGING) != 0;
+                private int prevLevel = DeviceInfo.getBatteryLevel();
+
+                public void batteryGood() { }
+                public void batteryLow() { }
+
+                public void batteryStatusChange(int status) {
+                    // The status bits passed into this method are unreliable
+                    // in determining when the battery level has changed.
+                    // Instead, when any state change occurs, get the current
+                    // battery level and report the change if it is different
+                    // then previous value.
+                    int newLevel = DeviceInfo.getBatteryLevel();
+                    boolean newChargeState = (DeviceInfo.BSTAT_CHARGING & status) != 0;
+
+                    // Report change if level or charge state is different then
+                    // previous values.
+                    if (newLevel != prevLevel || newChargeState != prevChargeState) {
+                        prevChargeState = newChargeState;
+                        prevLevel = newLevel;
+
+                        // Store the retrieved properties in a JSON object.
+                        JSONObject connectionInfo = new JSONObject();
+                        try {
+                            connectionInfo.put(LEVEL, newLevel);
+                            connectionInfo.put(CHARGING, newChargeState);
+                        } catch (JSONException e) {
+                            Logger.error("JSONException: " + e.getMessage());
+                            return;
+                        }
+
+                        PluginResult result = new PluginResult(
+                                PluginResult.Status.OK, connectionInfo);
+
+                        sendSuccessResult(result, true);
+                    }
+                }
+
+                public void powerOff() { }
+                public void powerUp() { }
+            };
+            Application.getApplication().addSystemListener(batteryListener);
+        }
+    }
+
+    /**
+     * Remove the registered battery status listener and cleanup the call back
+     * IDs.
+     */
+    private synchronized void removeListener() {
+        if (batteryListener != null) {
+
+            // Remove the battery listener.
+            Application.getApplication().removeSystemListener(batteryListener);
+            batteryListener = null;
+
+            // Close out the call back IDs.
+            sendSuccessResult(new PluginResult(PluginResult.Status.OK), false);
+            callbackIds.clear();
+        }
+    }
+
+    /**
+     * Helper function to send the PluginResult to the saved call back IDs.
+     *
+     * @param result
+     *            the PluginResult to return
+     * @param keepCallback
+     *            Boolean value indicating whether to keep the call back id
+     *            active.
+     */
+    private void sendSuccessResult(PluginResult result, boolean keepCallback) {
+
+        if (result != null) {
+            // Must keep the call back active for future events.
+            result.setKeepCallback(keepCallback);
+
+            // Iterate through the saved call back IDs. Really should only ever
+            // be one.
+            for (Enumeration callbacks = this.callbackIds.elements(); callbacks
+                    .hasMoreElements();) {
+                success(result, (String) callbacks.nextElement());
+            }
+        }
+    }
+
+}


[15/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webkitHandlers/networkResourceRequested.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webkitHandlers/networkResourceRequested.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webkitHandlers/networkResourceRequested.js
new file mode 100644
index 0000000..efd4efe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webkitHandlers/networkResourceRequested.js
@@ -0,0 +1,167 @@
+describe("NetworkResourceRequested event handler", function () {
+    var LIB_PATH  = "./../../../../lib/",
+        networkResourceRequested = require(LIB_PATH + "webkitHandlers/networkResourceRequested"),
+        Whitelist = require(LIB_PATH + 'policy/whitelist').Whitelist,
+        server = require(LIB_PATH + 'server'),
+        utils = require(LIB_PATH + 'utils'),
+        mockedWebview;
+
+    beforeEach(function () {
+        mockedWebview = {
+            originalLocation : "http://www.origin.com",
+            executeJavaScript : jasmine.createSpy(),
+            id: 42,
+            uiWebView: {
+                childwebviewcontrols: {
+                    open: jasmine.createSpy()
+                }
+            }
+        };
+    });
+
+    afterEach(function () {
+        mockedWebview = undefined;
+    });
+
+    it("creates a callback for yous", function () {
+        var requestObj = networkResourceRequested.createHandler();
+        expect(requestObj.networkResourceRequestedHandler).toBeDefined();
+    });
+
+
+    it("can access the whitelist", function () {
+        spyOn(Whitelist.prototype, "isAccessAllowed").andReturn(true);
+        var url = "http://www.google.com",
+            requestObj = networkResourceRequested.createHandler(mockedWebview);
+        requestObj.networkResourceRequestedHandler(JSON.stringify({url: url}));
+        expect(Whitelist.prototype.isAccessAllowed).toHaveBeenCalled();
+    });
+
+    it("checks whether the request is for an iframe when accessing the whitelist", function () {
+        spyOn(Whitelist.prototype, "isAccessAllowed").andReturn(true);
+        var url = "http://www.google.com",
+            requestObj = networkResourceRequested.createHandler(mockedWebview);
+        requestObj.networkResourceRequestedHandler(JSON.stringify({url: url, targetType: "TargetIsXMLHTTPRequest"}));
+        expect(Whitelist.prototype.isAccessAllowed).toHaveBeenCalledWith(url, true);
+    });
+
+    it("can apply whitelist rules and allow valid urls", function () {
+        spyOn(Whitelist.prototype, "isAccessAllowed").andReturn(true);
+        var url = "http://www.google.com",
+            requestObj = networkResourceRequested.createHandler(mockedWebview),
+            returnValue = requestObj.networkResourceRequestedHandler(JSON.stringify({url: url}));
+        expect(Whitelist.prototype.isAccessAllowed).toHaveBeenCalled();
+        expect(JSON.parse(returnValue).setAction).toEqual("ACCEPT");
+    });
+
+    it("can apply whitelist rules and deny blocked urls", function () {
+        spyOn(Whitelist.prototype, "isAccessAllowed").andReturn(false);
+        spyOn(utils, "invokeInBrowser");
+        spyOn(console, "warn");
+
+        var url = "http://www.google.com",
+            requestObj = networkResourceRequested.createHandler(mockedWebview),
+            returnValue = requestObj.networkResourceRequestedHandler(JSON.stringify({url: url})),
+            deniedMsg = "Access to \"" + url + "\" not allowed";
+
+        expect(Whitelist.prototype.isAccessAllowed).toHaveBeenCalled();
+        expect(JSON.parse(returnValue).setAction).toEqual("DENY");
+        expect(utils.invokeInBrowser).not.toHaveBeenCalledWith(url);
+        expect(mockedWebview.uiWebView.childwebviewcontrols.open).not.toHaveBeenCalledWith(url);
+        expect(mockedWebview.executeJavaScript).toHaveBeenCalledWith("alert('" + deniedMsg + "')");
+        expect(console.warn).toHaveBeenCalledWith(deniedMsg);
+    });
+
+    it("can apply whitelist rules and deny blocked urls and route to a uiWebView when target is main frame", function () {
+        spyOn(Whitelist.prototype, "isAccessAllowed").andReturn(false);
+        spyOn(utils, "invokeInBrowser");
+        spyOn(console, "warn");
+
+        var url = "http://www.google.com",
+            requestObj = networkResourceRequested.createHandler(mockedWebview),
+            returnValue = requestObj.networkResourceRequestedHandler(JSON.stringify({url: url, targetType: "TargetIsMainFrame"})),
+            deniedMsg = "Access to \"" + url + "\" not allowed";
+
+        expect(Whitelist.prototype.isAccessAllowed).toHaveBeenCalled();
+        expect(mockedWebview.uiWebView.childwebviewcontrols.open).toHaveBeenCalledWith(url);
+        expect(mockedWebview.executeJavaScript).not.toHaveBeenCalledWith("alert('" + deniedMsg + "')");
+        expect(console.warn).toHaveBeenCalledWith(deniedMsg);
+        expect(utils.invokeInBrowser).not.toHaveBeenCalledWith(url);
+        expect(JSON.parse(returnValue).setAction).toEqual("DENY");
+    });
+
+    it("can apply whitelist rules and deny blocked urls and route to the browser when target is main frame and childWebView is disabled", function () {
+        var url = "http://www.google.com",
+            config = require(LIB_PATH + "config"),
+            deniedMsg = "Access to \"" + url + "\" not allowed",
+            requestObj,
+            returnValue;
+
+        spyOn(Whitelist.prototype, "isAccessAllowed").andReturn(false);
+        spyOn(utils, "invokeInBrowser");
+        spyOn(console, "warn");
+
+        config.enableChildWebView = false;
+
+        this.after(function () {
+            delete require.cache[require.resolve(LIB_PATH + "config")];
+        });
+
+        requestObj = networkResourceRequested.createHandler(mockedWebview);
+        returnValue = requestObj.networkResourceRequestedHandler(JSON.stringify({url: url, targetType: "TargetIsMainFrame"}));
+
+        expect(Whitelist.prototype.isAccessAllowed).toHaveBeenCalled();
+        expect(mockedWebview.uiWebView.childwebviewcontrols.open).not.toHaveBeenCalledWith(url);
+        expect(mockedWebview.executeJavaScript).not.toHaveBeenCalledWith("alert('" + deniedMsg + "')");
+        expect(console.warn).toHaveBeenCalledWith(deniedMsg);
+        expect(utils.invokeInBrowser).toHaveBeenCalledWith(url);
+        expect(JSON.parse(returnValue).setAction).toEqual("DENY");
+    });
+
+    it("can call the server handler when certain urls are detected", function () {
+        spyOn(server, "handle");
+        var url = "http://localhost:8472/roomService/kungfuAction/customExt/crystalMethod?blargs=yes",
+            requestObj = networkResourceRequested.createHandler(mockedWebview),
+            returnValue = requestObj.networkResourceRequestedHandler(JSON.stringify({url: url, referrer: "http://www.origin.com"})),
+            expectedRequest = {
+                params: {
+                    service: "roomService",
+                    action: "kungfuAction",
+                    ext: "customExt",
+                    method: "crystalMethod",
+                    args: "blargs=yes"
+                },
+                body: undefined,
+                origin: "http://www.origin.com"
+            },
+            expectedResponse = {
+                send: jasmine.any(Function)
+            };
+        expect(JSON.parse(returnValue).setAction).toEqual("SUBSTITUTE");
+        expect(server.handle).toHaveBeenCalledWith(expectedRequest, expectedResponse, mockedWebview);
+    });
+
+    it("can call the server handler correctly with a multi-level method", function () {
+        spyOn(server, "handle");
+        var url = "http://localhost:8472/roomService/kungfuAction/customExt/crystal/Method?blargs=yes",
+            requestObj = networkResourceRequested.createHandler(mockedWebview),
+            returnValue = requestObj.networkResourceRequestedHandler(JSON.stringify({url: url, referrer: "http://www.origin.com"})),
+            expectedRequest = {
+                params: {
+                    service: "roomService",
+                    action: "kungfuAction",
+                    ext: "customExt",
+                    method: "crystal/Method",
+                    args: "blargs=yes"
+                },
+                body: undefined,
+                origin: "http://www.origin.com"
+            },
+            expectedResponse = {
+                send: jasmine.any(Function)
+            };
+        expect(JSON.parse(returnValue).setAction).toEqual("SUBSTITUTE");
+        expect(server.handle).toHaveBeenCalledWith(expectedRequest, expectedResponse, mockedWebview);
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webview.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webview.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webview.js
new file mode 100644
index 0000000..e96eb18
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/webview.js
@@ -0,0 +1,334 @@
+describe("webview", function () {
+    var libPath = "./../../../lib/",
+        networkResourceRequested = require(libPath + "webkitHandlers/networkResourceRequested"),
+        webkitOriginAccess = require(libPath + "policy/webkitOriginAccess"),
+        webview,
+        mockedController,
+        mockedWebview,
+        mockedQnx,
+        globalCreate;
+
+    beforeEach(function () {
+        webview = require(libPath + "webview");
+        mockedController = {
+            enableWebInspector: undefined,
+            enableCrossSiteXHR: undefined,
+            visible: undefined,
+            active: undefined,
+            setGeometry: jasmine.createSpy(),
+            dispatchEvent : jasmine.createSpy(),
+            addEventListener : jasmine.createSpy()
+        };
+        mockedWebview = {
+            id: 42,
+            enableCrossSiteXHR: undefined,
+            visible: undefined,
+            active: undefined,
+            zOrder: undefined,
+            url: undefined,
+            reload: jasmine.createSpy(),
+            extraHttpHeaders: undefined,
+            setFileSystemSandbox: undefined,
+            addOriginAccessWhitelistEntry: jasmine.createSpy(),
+            setGeometry: jasmine.createSpy(),
+            setApplicationOrientation: jasmine.createSpy(),
+            setExtraPluginDirectory: jasmine.createSpy(),
+            setEnablePlugins: jasmine.createSpy(),
+            getEnablePlugins: jasmine.createSpy(),
+            notifyApplicationOrientationDone: jasmine.createSpy(),
+            onContextMenuRequestEvent: undefined,
+            onContextMenuCancelEvent: undefined,
+            onNetworkResourceRequested: undefined,
+            destroy: jasmine.createSpy(),
+            executeJavaScript: jasmine.createSpy(),
+            windowGroup: undefined,
+            addEventListener: jasmine.createSpy(),
+            enableWebEventRedirect: jasmine.createSpy(),
+            addKnownSSLCertificate: jasmine.createSpy(),
+            continueSSLHandshaking: jasmine.createSpy(),
+            setSensitivity: jasmine.createSpy(),
+            getSensitivity: jasmine.createSpy(),
+            setBackgroundColor: jasmine.createSpy(),
+            getBackgroundColor: jasmine.createSpy(),
+            allowWebEvent: jasmine.createSpy(),
+            allowUserMedia: jasmine.createSpy(),
+            disallowUserMedia: jasmine.createSpy()
+        };
+        mockedQnx = {
+            callExtensionMethod: jasmine.createSpy(),
+            webplatform: {
+                getController: function () {
+                    return mockedController;
+                },
+                createWebView: function (options, createFunction) {
+                    //process.nextTick(createFunction);
+                    //setTimeout(createFunction,0);
+                    if (typeof options === 'function') {
+                        runs(options);
+                        globalCreate = options;
+                    }
+                    else {
+                        runs(createFunction);
+                        globalCreate = createFunction;
+                    }
+                    return mockedWebview;
+                },
+                getApplication: jasmine.createSpy()
+            }
+        };
+        GLOBAL.qnx = mockedQnx;
+        GLOBAL.window = {
+            qnx: mockedQnx
+        };
+        GLOBAL.screen = {
+            width : 1024,
+            height: 768
+        };
+    });
+
+    afterEach(function () {
+        delete GLOBAL.qnx;
+        delete GLOBAL.window;
+        delete GLOBAL.screen;
+    });
+
+    describe("create", function () {
+        it("sets up the visible webview", function () {
+            var mockNetworkHandler = { networkResourceRequestedHandler: function onNetworkResourceRequested() {} };
+
+            spyOn(networkResourceRequested, "createHandler").andReturn(mockNetworkHandler);
+            spyOn(webkitOriginAccess, "addWebView");
+            webview.create();
+            waits(1);
+            runs(function () {
+                expect(mockedWebview.visible).toEqual(true);
+                expect(mockedWebview.active).toEqual(true);
+                expect(mockedWebview.zOrder).toEqual(0);
+                expect(mockedWebview.setGeometry).toHaveBeenCalledWith(0, 0, screen.width, screen.height);
+                expect(Object.getOwnPropertyDescriptor(webview, 'onContextMenuRequestEvent')).toEqual(jasmine.any(Object));
+                expect(Object.getOwnPropertyDescriptor(webview, 'onContextMenuCancelEvent')).toEqual(jasmine.any(Object));
+                expect(Object.getOwnPropertyDescriptor(webview, 'onGeolocationPermissionRequest')).toEqual(jasmine.any(Object));
+
+
+                expect(networkResourceRequested.createHandler).toHaveBeenCalledWith(mockedWebview);
+                expect(mockedWebview.onNetworkResourceRequested).toEqual(mockNetworkHandler.networkResourceRequestedHandler);
+
+                expect(mockedWebview.allowWebEvent).toHaveBeenCalledWith("DialogRequested");
+                expect(mockedController.dispatchEvent).toHaveBeenCalledWith("webview.initialized", jasmine.any(Array));
+                //The default config.xml only has access to WIDGET_LOCAL
+                //and has permission for two apis
+                expect(webkitOriginAccess.addWebView).toHaveBeenCalledWith(mockedWebview);
+            });
+        });
+
+        it("calls the ready function", function () {
+            var chuck = jasmine.createSpy();
+            webview.create(chuck);
+            waits(1);
+            runs(function () {
+                expect(chuck).toHaveBeenCalled();
+            });
+        });
+
+    });
+
+    describe("file system sandbox", function () {
+        it("setSandbox", function () {
+            webview.create();
+            webview.setSandbox(false);
+            expect(mockedWebview.setFileSystemSandbox).toBeFalsy();
+        });
+
+        it("getSandbox", function () {
+            webview.create();
+            webview.setSandbox(false);
+            expect(webview.getSandbox()).toBeFalsy();
+        });
+    });
+
+    describe("id", function () {
+        it("can get the id for the webiew", function () {
+            webview.create();
+            expect(webview.id).toEqual(mockedWebview.id);
+        });
+    });
+
+    describe("enableCrossSiteXHR", function () {
+        it("can set enableCrossSiteXHR", function () {
+            webview.create();
+            webview.enableCrossSiteXHR = true;
+            expect(mockedWebview.enableCrossSiteXHR).toBe(true);
+            webview.enableCrossSiteXHR = false;
+            expect(mockedWebview.enableCrossSiteXHR).toBe(false);
+        });
+    });
+
+    describe("geometry", function () {
+        it("can set geometry", function () {
+            webview.create();
+            webview.setGeometry(0, 0, 100, 200);
+            expect(mockedWebview.setGeometry).toHaveBeenCalledWith(0, 0, 100, 200);
+        });
+
+        it("can get geometry", function () {
+            webview.create();
+            webview.setGeometry(0, 0, 100, 100);
+            expect(webview.getGeometry()).toEqual({x: 0, y: 0, w: 100, h: 100});
+        });
+    });
+
+    describe("application orientation", function () {
+        it("can set application orientation", function () {
+            webview.create();
+            webview.setApplicationOrientation(90);
+            expect(mockedWebview.setApplicationOrientation).toHaveBeenCalledWith(90);
+        });
+
+        it("can notifyApplicationOrientationDone", function () {
+            webview.create();
+            webview.notifyApplicationOrientationDone();
+            expect(mockedWebview.notifyApplicationOrientationDone).toHaveBeenCalled();
+        });
+    });
+
+    describe("plugins", function () {
+        it("can set an extra plugin directory", function () {
+            webview.create();
+            webview.setExtraPluginDirectory('/usr/lib/browser/plugins');
+            expect(mockedWebview.setExtraPluginDirectory).toHaveBeenCalledWith('/usr/lib/browser/plugins');
+        });
+
+        it("can enable plugins for the webview", function () {
+            webview.create();
+            webview.setEnablePlugins(true);
+            expect(mockedWebview.pluginsEnabled).toBeTruthy();
+        });
+
+        it("can retrieve whether plugins are enabled", function () {
+            webview.create();
+            webview.setEnablePlugins(true);
+            expect(webview.getEnablePlugins()).toBeTruthy();
+        });
+    });
+
+    describe("SSL Exception Methods", function () {
+        it("addKnownSSLException", function () {
+            var url = 'https://bojaps.com',
+                certificateInfo = {
+                    test : 'test'
+                };
+            webview.create();
+            webview.addKnownSSLCertificate(url, certificateInfo);
+            expect(mockedWebview.addKnownSSLCertificate).toHaveBeenCalledWith(url, certificateInfo);
+        });
+
+        it("continue SSL Hanshaking", function () {
+            var streamId = 8,
+                SSLAction = 'SSLActionReject';
+            webview.create();
+            webview.continueSSLHandshaking(streamId, SSLAction);
+            expect(mockedWebview.continueSSLHandshaking).toHaveBeenCalledWith(streamId, SSLAction);
+        });
+    });
+
+    describe("User Media", function () {
+        it("has allowUserMedia defined", function () {
+            webview.create();
+            expect(webview.allowUserMedia).toBeDefined();
+        });
+
+        it("has disallowUserMedia defined", function () {
+            webview.create();
+            expect(webview.disallowUserMedia).toBeDefined();
+        });
+
+        it("calls allowUserMedia on WebView", function () {
+            var evtId = 10,
+                cameraName = "CAMERA_UNIT_FRONT";
+
+            webview.create();
+            webview.allowUserMedia(evtId, cameraName);
+            expect(mockedWebview.allowUserMedia).toHaveBeenCalledWith(evtId, cameraName);
+        });
+
+        it("calls disallowUserMedia on WebView", function () {
+            var evtId = 10;
+
+            webview.create();
+            webview.disallowUserMedia(evtId);
+            expect(mockedWebview.disallowUserMedia).toHaveBeenCalledWith(evtId);
+        });
+    });
+
+    describe("methods other than create", function () {
+
+        it("calls the underlying destroy", function () {
+            webview.create(mockedWebview);
+            webview.destroy();
+            expect(mockedWebview.destroy).toHaveBeenCalled();
+        });
+
+        it("sets the url property", function () {
+            var url = "http://AWESOMESAUCE.com";
+            webview.create(mockedWebview);
+            webview.setURL(url);
+            expect(mockedWebview.url).toEqual(url);
+        });
+
+        it("calls the underlying executeJavaScript", function () {
+            var js = "var awesome='Jasmine BDD'";
+            webview.create(mockedWebview);
+            webview.executeJavascript(js);
+            expect(mockedWebview.executeJavaScript).toHaveBeenCalledWith(js);
+        });
+        it("calls the underlying windowGroup property", function () {
+            webview.create(mockedWebview);
+            expect(webview.windowGroup()).toEqual(mockedWebview.windowGroup);
+        });
+
+        it("expect the config to set the extraHttpHeader", function () {
+            webview.create();
+            waits(1);
+            runs(function () {
+                expect(mockedWebview.extraHttpHeaders).toEqual({"rim-header": "RIM-Widget:rim/widget"});
+            });
+        });
+
+        it("expect the config to set the user agent", function () {
+            webview.create();
+            waits(1);
+            runs(function () {
+                expect(mockedWebview.userAgent).toEqual("Some extremely long user agent (with) spe/cial, characters");
+            });
+        });
+
+        it("expect reload to be defined", function () {
+            webview.create();
+            waits(1);
+            expect(webview.reload).toBeDefined();
+            webview.reload();
+            expect(mockedWebview.reload).toHaveBeenCalled();
+        });
+    });
+
+    describe("methods for sensitivity", function () {
+
+        it("setter getter for sensitivity", function () {
+            webview.create(mockedWebview);
+            webview.setSensitivity("Something");
+            expect(mockedWebview.setSensitivity).toHaveBeenCalled();
+            webview.getSensitivity();
+            expect(mockedWebview.getSensitivity).toHaveBeenCalled();
+        });
+
+        it("setter getter for background", function () {
+            webview.create(mockedWebview);
+            webview.setBackgroundColor("Something");
+            expect(mockedWebview.setBackgroundColor).toHaveBeenCalled();
+            webview.getBackgroundColor();
+            expect(mockedWebview.getBackgroundColor).toHaveBeenCalled();
+        });
+
+    });
+
+});


[43/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz
new file mode 100644
index 0000000..b45e6fe
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz
new file mode 100644
index 0000000..fff6196
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz
new file mode 100644
index 0000000..08c6e67
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz
new file mode 100644
index 0000000..54e241a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz
new file mode 100644
index 0000000..9912df3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz
new file mode 100644
index 0000000..af1052d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz
new file mode 100644
index 0000000..35870dc
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz
new file mode 100644
index 0000000..3c3a9b4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz
new file mode 100644
index 0000000..a2136b7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz
new file mode 100644
index 0000000..aa47e36
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz
new file mode 100644
index 0000000..ffb547d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz
new file mode 100644
index 0000000..c664df2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz
new file mode 100644
index 0000000..6b9d6b5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz
new file mode 100644
index 0000000..d7d24e7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz
new file mode 100644
index 0000000..7d3c880
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz
new file mode 100644
index 0000000..66416b2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz
new file mode 100644
index 0000000..4d0608c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz
new file mode 100644
index 0000000..6b07571
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz
new file mode 100644
index 0000000..cbfb8a6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz
new file mode 100644
index 0000000..61c88c4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz
new file mode 100644
index 0000000..61e3c8c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz
new file mode 100644
index 0000000..cabecb1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz
new file mode 100644
index 0000000..4d3edc6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz
new file mode 100644
index 0000000..4c914db
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz
new file mode 100644
index 0000000..5005d70
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz
new file mode 100644
index 0000000..3f982c4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz
new file mode 100644
index 0000000..903b3f2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz
new file mode 100644
index 0000000..5a7a4cf
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz
new file mode 100644
index 0000000..f9ffdb8
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz
new file mode 100644
index 0000000..0c474dd
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz
new file mode 100644
index 0000000..fc88b58
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz
new file mode 100644
index 0000000..ef6be7a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz
new file mode 100644
index 0000000..956a656
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz
new file mode 100644
index 0000000..e51daa1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz
new file mode 100644
index 0000000..5d604b3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz
new file mode 100644
index 0000000..ef1956f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz
new file mode 100644
index 0000000..358b709
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz
new file mode 100644
index 0000000..d1bc61a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz
new file mode 100644
index 0000000..40a1732
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz
new file mode 100644
index 0000000..4a668ab
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz
new file mode 100644
index 0000000..f813453
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz
new file mode 100644
index 0000000..a3752b4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz
new file mode 100644
index 0000000..a1d6b83
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz
new file mode 100644
index 0000000..959e78f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz
new file mode 100644
index 0000000..d981980
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz
new file mode 100644
index 0000000..cf11515
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz
new file mode 100644
index 0000000..c438a65
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz
new file mode 100644
index 0000000..a768a43
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz
new file mode 100644
index 0000000..b877f68
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz
new file mode 100644
index 0000000..9a4fa57
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz
new file mode 100644
index 0000000..757c861
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz
new file mode 100644
index 0000000..b437e2b
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz
new file mode 100644
index 0000000..9dba801
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz
new file mode 100644
index 0000000..f0553f1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz
new file mode 100644
index 0000000..3f00081
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz
new file mode 100644
index 0000000..3f4e42f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz
new file mode 100644
index 0000000..47b15ab
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz
new file mode 100644
index 0000000..d4b42f4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz
new file mode 100644
index 0000000..f46acdf
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz
new file mode 100644
index 0000000..65bd5d4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz
new file mode 100644
index 0000000..c371c5a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz
new file mode 100644
index 0000000..272ed07
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz
new file mode 100644
index 0000000..953b051
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz
new file mode 100644
index 0000000..1fc0521
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz
new file mode 100644
index 0000000..4ea4bd5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz
new file mode 100644
index 0000000..b69f55a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz
new file mode 100644
index 0000000..f10c527
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz
new file mode 100644
index 0000000..a36a696
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz
new file mode 100644
index 0000000..2828495
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz
new file mode 100644
index 0000000..f027493
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz
new file mode 100644
index 0000000..71e5b02
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz
new file mode 100644
index 0000000..fcec744
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz
new file mode 100644
index 0000000..a818414
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz
new file mode 100644
index 0000000..e86fc9d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz
new file mode 100644
index 0000000..92a36df
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz
new file mode 100644
index 0000000..be45a80
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz
new file mode 100644
index 0000000..ad0dd65
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz
new file mode 100644
index 0000000..a0c6116
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz
new file mode 100644
index 0000000..1a02bc1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz
new file mode 100644
index 0000000..89adc5e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz
new file mode 100644
index 0000000..9f38787
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz
new file mode 100644
index 0000000..5adb184
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz
new file mode 100644
index 0000000..3e04e6e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz
new file mode 100644
index 0000000..1ef6e7d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz
new file mode 100644
index 0000000..664de07
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz
new file mode 100644
index 0000000..49bc219
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz
new file mode 100644
index 0000000..3db9b20
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz
new file mode 100644
index 0000000..0f62a17
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz
new file mode 100644
index 0000000..8636208
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz
new file mode 100644
index 0000000..dfb2908
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz
new file mode 100644
index 0000000..baddfcf
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz
new file mode 100644
index 0000000..e1cc9e0
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz
new file mode 100644
index 0000000..ac93f3e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz
new file mode 100644
index 0000000..7286da1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz
new file mode 100644
index 0000000..1eabc09
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz
new file mode 100644
index 0000000..0a5f716
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz
new file mode 100644
index 0000000..2969ca7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz
new file mode 100644
index 0000000..45a8f4b
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz
new file mode 100644
index 0000000..89f8484
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz
new file mode 100644
index 0000000..9d3d758
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz
new file mode 100644
index 0000000..d50466e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz
new file mode 100644
index 0000000..66e041f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz
new file mode 100644
index 0000000..9cc15d6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz
new file mode 100644
index 0000000..a3a9a93
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz
new file mode 100644
index 0000000..eec6524
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz
new file mode 100644
index 0000000..ec4b9a7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz
new file mode 100644
index 0000000..2f860b9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz
new file mode 100644
index 0000000..1bfce15
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz
new file mode 100644
index 0000000..d7581ea
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz
new file mode 100644
index 0000000..d94fe66
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz
new file mode 100644
index 0000000..c69b725
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz
new file mode 100644
index 0000000..2f21145
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz
new file mode 100644
index 0000000..13b44cc
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz
new file mode 100644
index 0000000..9a44dfe
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz
new file mode 100644
index 0000000..cfd9252
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz
new file mode 100644
index 0000000..f54579f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz
new file mode 100644
index 0000000..27e9cd3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz
new file mode 100644
index 0000000..246525c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz
new file mode 100644
index 0000000..f73c575
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz
new file mode 100644
index 0000000..7a47737
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz
new file mode 100644
index 0000000..9cdd564
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz
new file mode 100644
index 0000000..ea819e5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz
new file mode 100644
index 0000000..eeddad9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz
new file mode 100644
index 0000000..63130e3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz
new file mode 100644
index 0000000..ced2c42
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz
new file mode 100644
index 0000000..105e4fa
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png
new file mode 100644
index 0000000..29873e9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec.html b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec.html
new file mode 100644
index 0000000..71f00de
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!--
+    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.
+-->
+<html>
+    <head>
+        <title>Jasmine Spec Runner</title>
+
+        <!-- jasmine source -->
+        <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png">
+        <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css">
+        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script>
+        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script>
+
+        <!-- include source files here... -->
+        <script type="text/javascript" src="js/index.js"></script>
+
+        <!-- include spec files here... -->
+        <script type="text/javascript" src="spec/helper.js"></script>
+        <script type="text/javascript" src="spec/index.js"></script>
+
+        <script type="text/javascript">
+            (function() {
+                var jasmineEnv = jasmine.getEnv();
+                jasmineEnv.updateInterval = 1000;
+
+                var htmlReporter = new jasmine.HtmlReporter();
+
+                jasmineEnv.addReporter(htmlReporter);
+
+                jasmineEnv.specFilter = function(spec) {
+                    return htmlReporter.specFilter(spec);
+                };
+
+                var currentWindowOnload = window.onload;
+
+                window.onload = function() {
+                    if (currentWindowOnload) {
+                        currentWindowOnload();
+                    }
+                    execJasmine();
+                };
+
+                function execJasmine() {
+                    jasmineEnv.execute();
+                }
+            })();
+        </script>
+    </head>
+    <body>
+        <div id="stage" style="display:none;"></div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/helper.js b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/helper.js
new file mode 100644
index 0000000..929f776
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/helper.js
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+afterEach(function() {
+    document.getElementById('stage').innerHTML = '';
+});
+
+var helper = {
+    trigger: function(obj, name) {
+        var e = document.createEvent('Event');
+        e.initEvent(name, true, true);
+        obj.dispatchEvent(e);
+    },
+    getComputedStyle: function(querySelector, property) {
+        var element = document.querySelector(querySelector);
+        return window.getComputedStyle(element).getPropertyValue(property);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/index.js b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/index.js
new file mode 100644
index 0000000..20f8be5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/index.js
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+describe('app', function() {
+    describe('initialize', function() {
+        it('should bind deviceready', function() {
+            runs(function() {
+                spyOn(app, 'onDeviceReady');
+                app.initialize();
+                helper.trigger(window.document, 'deviceready');
+            });
+
+            waitsFor(function() {
+                return (app.onDeviceReady.calls.length > 0);
+            }, 'onDeviceReady should be called once', 500);
+
+            runs(function() {
+                expect(app.onDeviceReady).toHaveBeenCalled();
+            });
+        });
+    });
+
+    describe('onDeviceReady', function() {
+        it('should report that it fired', function() {
+            spyOn(app, 'receivedEvent');
+            app.onDeviceReady();
+            expect(app.receivedEvent).toHaveBeenCalledWith('deviceready');
+        });
+    });
+
+    describe('receivedEvent', function() {
+        beforeEach(function() {
+            var el = document.getElementById('stage');
+            el.innerHTML = ['<div id="deviceready">',
+                            '    <p class="event listening">Listening</p>',
+                            '    <p class="event received">Received</p>',
+                            '</div>'].join('\n');
+        });
+
+        it('should hide the listening element', function() {
+            app.receivedEvent('deviceready');
+            var displayStyle = helper.getComputedStyle('#deviceready .listening', 'display');
+            expect(displayStyle).toEqual('none');
+        });
+
+        it('should show the received element', function() {
+            app.receivedEvent('deviceready');
+            var displayStyle = helper.getComputedStyle('#deviceready .received', 'display');
+            expect(displayStyle).toEqual('block');
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
new file mode 100644
index 0000000..7c435ba
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2008-2011 Pivotal Labs
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


[11/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/Makefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/Makefile b/lib/cordova-blackberry/blackberry10/node_modules/jake/Makefile
new file mode 100644
index 0000000..3d0574e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/Makefile
@@ -0,0 +1,44 @@
+#
+# Jake JavaScript build tool
+# Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+#
+# 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.
+#
+
+.PHONY: all build install clean uninstall
+
+PREFIX=/usr/local
+DESTDIR=
+
+all: build
+
+build:
+	@echo 'Jake built.'
+
+install:
+	@mkdir -p $(DESTDIR)$(PREFIX)/bin && \
+    mkdir -p $(DESTDIR)$(PREFIX)/lib/node_modules/jake && \
+    mkdir -p ./node_modules && \
+    npm install utilities minimatch && \
+		cp -R ./* $(DESTDIR)$(PREFIX)/lib/node_modules/jake/ && \
+		ln -snf ../lib/node_modules/jake/bin/cli.js $(DESTDIR)$(PREFIX)/bin/jake && \
+		chmod 755 $(DESTDIR)$(PREFIX)/lib/node_modules/jake/bin/cli.js && \
+		echo 'Jake installed.'
+
+clean:
+	@true
+
+uninstall:
+	@rm -f $(DESTDIR)$(PREFIX)/bin/jake && \
+		rm -fr $(DESTDIR)$(PREFIX)/lib/node_modules/jake/ && \
+		echo 'Jake uninstalled.'

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/README.md b/lib/cordova-blackberry/blackberry10/node_modules/jake/README.md
new file mode 100644
index 0000000..5cb7cc9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/README.md
@@ -0,0 +1,946 @@
+### Jake -- JavaScript build tool for Node.js
+
+### Installing with [NPM](http://npmjs.org/)
+
+Install globally with:
+
+    npm install -g jake
+
+Or you may also install it as a development dependency in a package.json file:
+
+    // package.json
+    "devDependencies": {
+      "jake": "latest"
+    }
+
+Then install it with `npm install`
+
+Note Jake is intended to be mostly a command-line tool, but lately there have been
+changes to it so it can be either embedded, or run from inside your project.
+
+### Installing from source
+
+Prerequisites: Jake requires [Node.js](<http://nodejs.org/>), and the
+[utilities](https://npmjs.org/package/utilities) and
+[minimatch](https://npmjs.org/package/minimatch) modules.
+
+Get Jake:
+
+    git clone git://github.com/mde/jake.git
+
+Build Jake:
+
+    cd jake && make && sudo make install
+
+Even if you're installing Jake from source, you'll still need NPM for installing
+the few modules Jake depends on. `make install` will do this automatically for
+you.
+
+By default Jake is installed in "/usr/local." To install it into a different
+directory (e.g., one that doesn't require super-user privilege), pass the PREFIX
+variable to the `make install` command.  For example, to install it into a
+"jake" directory in your home directory, you could use this:
+
+    make && make install PREFIX=~/jake
+
+If do you install Jake somewhere special, you'll need to add the "bin" directory
+in the install target to your PATH to get access to the `jake` executable.
+
+### Windows, installing from source
+
+For Windows users installing from source, there are some additional steps.
+
+*Assumed: current directory is the same directory where node.exe is present.*
+
+Get Jake:
+
+    git clone git://github.com/mde/jake.git node_modules/jake
+
+Copy jake.bat and jake to the same directory as node.exe
+
+    copy node_modules/jake/jake.bat jake.bat
+    copy node_modules/jake/jake jake
+
+Add the directory of node.exe to the environment PATH variable.
+
+### Basic usage
+
+    jake [options ...] [env variables ...] target
+
+### Description
+
+    Jake is a simple JavaScript build program with capabilities similar to the
+    regular make or rake command.
+
+    Jake has the following features:
+        * Jakefiles are in standard JavaScript syntax
+        * Tasks with prerequisites
+        * Namespaces for tasks
+        * Async task execution
+
+### Options
+
+    -V/v
+    --version                   Display the Jake version.
+
+    -h
+    --help                      Display help message.
+
+    -f *FILE*
+    --jakefile *FILE*           Use FILE as the Jakefile.
+
+    -C *DIRECTORY*
+    --directory *DIRECTORY*     Change to DIRECTORY before running tasks.
+
+    -q
+    --quiet                     Do not log messages to standard output.
+
+    -J *JAKELIBDIR*
+    --jakelibdir *JAKELIBDIR*   Auto-import any .jake files in JAKELIBDIR.
+                                (default is 'jakelib')
+
+    -B
+    --always-make               Unconditionally make all targets.
+
+    -t
+    --trace                     Enable full backtrace.
+
+    -T/ls
+    --tasks                     Display the tasks (matching optional PATTERN)
+                                with descriptions, then exit.
+
+### Jakefile syntax
+
+A Jakefile is just executable JavaScript. You can include whatever JavaScript
+you want in it.
+
+## API Docs
+
+API docs [can be found here](http://mde.github.com/jake/doc/).
+
+## Tasks
+
+Use `task` to define tasks. It has one required argument, the task-name, and
+three optional arguments:
+
+```javascript
+task(name, [prerequisites], [action], [opts]);
+```
+
+The `name` argument is a String with the name of the task, and `prerequisites`
+is an optional Array arg of the list of prerequisite tasks to perform first.
+
+The `action` is a Function defininng the action to take for the task. (Note that
+Object-literal syntax for name/prerequisites in a single argument a la Rake is
+also supported, but JavaScript's lack of support for dynamic keys in Object
+literals makes it not very useful.) The action is invoked with the Task object
+itself as the execution context (i.e, "this" inside the action references the
+Task object).
+
+The `opts` argument is the normal JavaScript-style 'options' object. When a
+task's operations are asynchronous, the `async` property should be set to
+`true`, and the task must call `complete()` to signal to Jake that the task is
+done, and execution can proceed. By default the `async` property is `false`.
+
+Tasks created with `task` are always executed when asked for (or are a
+prerequisite). Tasks created with `file` are only executed if no file with the
+given name exists or if any of its file-prerequisites are more recent than the
+file named by the task. Also, if any prerequisite is a regular task, the file
+task will always be executed.
+
+Use `desc` to add a string description of the task.
+
+Here's an example:
+
+```javascript
+desc('This is the default task.');
+task('default', function (params) {
+  console.log('This is the default task.');
+});
+
+desc('This task has prerequisites.');
+task('hasPrereqs', ['foo', 'bar', 'baz'], function (params) {
+  console.log('Ran some prereqs first.');
+});
+```
+
+And here's an example of an asynchronous task:
+
+```javascript
+desc('This is an asynchronous task.');
+task('asyncTask', {async: true}, function () {
+  setTimeout(complete, 1000);
+});
+```
+
+A Task is also an EventEmitter which emits the 'complete' event when it is
+finished. This allows asynchronous tasks to be run from within other asked via
+either `invoke` or `execute`, and ensure they will complete before the rest of
+the containing task executes. See the section "Running tasks from within other
+tasks," below.
+
+### File-tasks
+
+Create a file-task by calling `file`.
+
+File-tasks create a file from one or more other files. With a file-task, Jake
+checks both that the file exists, and also that it is not older than the files
+specified by any prerequisite tasks. File-tasks are particularly useful for
+compiling something from a tree of source files.
+
+```javascript
+desc('This builds a minified JS file for production.');
+file('foo-minified.js', ['bar', 'foo-bar.js', 'foo-baz.js'], function () {
+  // Code to concat and minify goes here
+});
+```
+
+### Directory-tasks
+
+Create a directory-task by calling `directory`.
+
+Directory-tasks create a directory for use with for file-tasks. Jake checks for
+the existence of the directory, and only creates it if needed.
+
+```javascript
+desc('This creates the bar directory for use with the foo-minified.js file-task.');
+directory('bar');
+```
+
+This task will create the directory when used as a prerequisite for a file-task,
+or when run from the command-line.
+
+### Namespaces
+
+Use `namespace` to create a namespace of tasks to perform. Call it with two arguments:
+
+```javascript
+namespace(name, namespaceTasks);
+```
+
+Where is `name` is the name of the namespace, and `namespaceTasks` is a function
+with calls inside it to `task` or `desc` definining all the tasks for that
+namespace.
+
+Here's an example:
+
+```javascript
+desc('This is the default task.');
+task('default', function () {
+  console.log('This is the default task.');
+});
+
+namespace('foo', function () {
+  desc('This the foo:bar task');
+  task('bar', function () {
+    console.log('doing foo:bar task');
+  });
+
+  desc('This the foo:baz task');
+  task('baz', ['default', 'foo:bar'], function () {
+    console.log('doing foo:baz task');
+  });
+
+});
+```
+
+In this example, the foo:baz task depends on the the default and foo:bar tasks.
+
+### Passing parameters to jake
+
+Parameters can be passed to Jake two ways: plain arguments, and environment
+variables.
+
+To pass positional arguments to the Jake tasks, enclose them in square braces,
+separated by commas, after the name of the task on the command-line. For
+example, with the following Jakefile:
+
+```javascript
+desc('This is an awesome task.');
+task('awesome', function (a, b, c) {
+  console.log(a, b, c);
+});
+```
+
+You could run `jake` like this:
+
+    jake awesome[foo,bar,baz]
+
+And you'd get the following output:
+
+    foo bar baz
+
+Note that you *cannot* uses spaces between the commas separating the parameters.
+
+Any parameters passed after the Jake task that contain an equals sign (=) will
+be added to process.env.
+
+With the following Jakefile:
+
+```javascript
+desc('This is an awesome task.');
+task('awesome', function (a, b, c) {
+  console.log(a, b, c);
+  console.log(process.env.qux, process.env.frang);
+});
+```
+
+You could run `jake` like this:
+
+    jake awesome[foo,bar,baz] qux=zoobie frang=asdf
+
+And you'd get the following output:
+
+    foo bar baz
+    zoobie asdf
+Running `jake` with no arguments runs the default task.
+
+__Note for zsh users__ : you will need to escape the brackets or wrap in single
+quotes like this to pass parameters :
+
+    jake 'awesome[foo,bar,baz]'
+
+An other solution is to desactivate permannently file-globbing for the `jake`
+command. You can do this by adding this line to your `.zshrc` file :
+
+    alias jake="noglob jake"
+
+### Cleanup after all tasks run, jake 'complete' event
+
+The base 'jake' object is an EventEmitter, and fires a 'complete' event after
+running all tasks.
+
+This is sometimes useful when a task starts a process which keeps the Node
+event-loop running (e.g., a database connection). If you know you want to stop
+the running Node process after all tasks have finished, you can set a listener
+for the 'complete' event, like so:
+
+```javascript
+jake.addListener('complete', function () {
+  process.exit();
+});
+```
+
+### Running tasks from within other tasks
+
+Jake supports the ability to run a task from within another task via the
+`invoke` and `execute` methods.
+
+The `invoke` method will run the desired task, along with its prerequisites:
+
+```javascript
+desc('Calls the foo:bar task and its prerequisites.');
+task('invokeFooBar', function () {
+  // Calls foo:bar and its prereqs
+  jake.Task['foo:bar'].invoke();
+});
+```
+
+The `invoke` method will only run the task once, even if you call it repeatedly.
+
+```javascript
+desc('Calls the foo:bar task and its prerequisites.');
+task('invokeFooBar', function () {
+  // Calls foo:bar and its prereqs
+  jake.Task['foo:bar'].invoke();
+  // Does nothing
+  jake.Task['foo:bar'].invoke();
+});
+```
+
+The `execute` method will run the desired task without its prerequisites:
+
+```javascript
+desc('Calls the foo:bar task without its prerequisites.');
+task('executeFooBar', function () {
+  // Calls foo:bar without its prereqs
+  jake.Task['foo:baz'].execute();
+});
+```
+
+Calling `execute` repeatedly will run the desired task repeatedly.
+
+```javascript
+desc('Calls the foo:bar task without its prerequisites.');
+task('executeFooBar', function () {
+  // Calls foo:bar without its prereqs
+  jake.Task['foo:baz'].execute();
+  // Can keep running this over and over
+  jake.Task['foo:baz'].execute();
+  jake.Task['foo:baz'].execute();
+});
+```
+
+If you want to run the task and its prerequisites more than once, you can use
+`invoke` with the `reenable` method.
+
+```javascript
+desc('Calls the foo:bar task and its prerequisites.');
+task('invokeFooBar', function () {
+  // Calls foo:bar and its prereqs
+  jake.Task['foo:bar'].invoke();
+  // Does nothing
+  jake.Task['foo:bar'].invoke();
+  // Only re-runs foo:bar, but not its prerequisites
+  jake.Task['foo:bar'].reenable();
+  jake.Task['foo:bar'].invoke();
+});
+```
+
+The `reenable` method takes a single Boolean arg, a 'deep' flag, which reenables
+the task's prerequisites if set to true.
+
+```javascript
+desc('Calls the foo:bar task and its prerequisites.');
+task('invokeFooBar', function () {
+  // Calls foo:bar and its prereqs
+  jake.Task['foo:bar'].invoke();
+  // Does nothing
+  jake.Task['foo:bar'].invoke();
+  // Re-runs foo:bar and all of its prerequisites
+  jake.Task['foo:bar'].reenable(true);
+  jake.Task['foo:bar'].invoke();
+});
+```
+
+It's easy to pass params on to a sub-task run via `invoke` or `execute`:
+
+```javascript
+desc('Passes params on to other tasks.');
+task('passParams', function () {
+  var t = jake.Task['foo:bar'];
+  // Calls foo:bar, passing along current args
+  t.invoke.apply(t, arguments);
+});
+```
+
+### Managing asynchrony without prereqs (e.g., when using `invoke`)
+
+You can mix sync and async without problems when using normal prereqs, because
+the Jake execution loop takes care of the difference for you. But when you call
+`invoke` or `execute`, you have to manage the asynchrony yourself.
+
+Here's a correct working example:
+
+```javascript
+task('async1', ['async2'], {async: true}, function () {
+    console.log('-- async1 start ----------------');
+    setTimeout(function () {
+        console.log('-- async1 done ----------------');
+        complete();
+    }, 1000);
+});
+
+task('async2', {async: true}, function () {
+    console.log('-- async2 start ----------------');
+    setTimeout(function () {
+        console.log('-- async2 done ----------------');
+        complete();
+    }, 500);
+});
+
+task('init', ['async1', 'async2'], {async: true}, function () {
+    console.log('-- init start ----------------');
+    setTimeout(function () {
+        console.log('-- init done ----------------');
+        complete();
+    }, 100);
+});
+
+task('default', {async: true}, function () {
+  console.log('-- default start ----------------');
+  var init = jake.Task.init;
+  init.addListener('complete', function () {
+    console.log('-- default done ----------------');
+    complete();
+  });
+  init.invoke();
+});
+```
+
+You have to declare the "default" task as asynchronous as well, and call
+`complete` on it when "init" finishes. Here's the output:
+
+    -- default start ----------------
+    -- async2 start ----------------
+    -- async2 done ----------------
+    -- async1 start ----------------
+    -- async1 done ----------------
+    -- init start ----------------
+    -- init done ----------------
+    -- default done ----------------
+
+You get what you expect -- "default" starts, the rest runs, and finally
+"default" finishes.
+
+### Evented tasks
+
+Tasks are EventEmitters. They can fire 'complete' and 'error' events.
+
+If a task called via `invoke` is asynchronous, you can set a listener on the
+'complete' event to run any code that depends on it.
+
+```javascript
+desc('Calls the async foo:baz task and its prerequisites.');
+task('invokeFooBaz', {async: true}, function () {
+  var t = jake.Task['foo:baz'];
+  t.addListener('complete', function () {
+    console.log('Finished executing foo:baz');
+    // Maybe run some other code
+    // ...
+    // Complete the containing task
+    complete();
+  });
+  // Kick off foo:baz
+  t.invoke();
+});
+```
+
+If you want to handle the errors in a task in some specific way, you can set a
+listener for the 'error' event, like so:
+
+```javascript
+namespace('vronk', function () {
+  task('groo', function () {
+    var t = jake.Task['vronk:zong'];
+    t.addListener('error', function (e) {
+      console.log(e.message);
+    });
+    t.invoke();
+  });
+
+  task('zong', function () {
+    throw new Error('OMFGZONG');
+  });
+});
+```
+
+If no specific listener is set for the "error" event, errors are handled by
+Jake's generic error-handling.
+
+### Aborting a task
+
+You can abort a task by calling the `fail` function, and Jake will abort the
+currently running task. You can pass a customized error message to `fail`:
+
+```javascript
+desc('This task fails.');
+task('failTask', function () {
+  fail('Yikes. Something back happened.');
+});
+```
+
+You can also pass an optional exit status-code to the fail command, like so:
+
+```javascript
+desc('This task fails with an exit-status of 42.');
+task('failTaskQuestionCustomStatus', function () {
+  fail('What is the answer?', 42);
+});
+```
+
+The process will exit with a status of 42.
+
+Uncaught errors will also abort the currently running task.
+
+### Showing the list of tasks
+
+Passing `jake` the -T or --tasks flag will display the full list of tasks
+available in a Jakefile, along with their descriptions:
+
+    $ jake -T
+    jake default       # This is the default task.
+    jake asdf          # This is the asdf task.
+    jake concat.txt    # File task, concating two files together
+    jake failure       # Failing task.
+    jake lookup        # Jake task lookup by name.
+    jake foo:bar       # This the foo:bar task
+    jake foo:fonebone  # This the foo:fonebone task
+
+Setting a value for -T/--tasks will filter the list by that value:
+
+    $ jake -T foo
+    jake foo:bar       # This the foo:bar task
+    jake foo:fonebone  # This the foo:fonebone task
+
+The list displayed will be all tasks whose namespace/name contain the filter-string.
+
+## Breaking things up into multiple files
+
+Jake will automatically look for files with a .jake extension in a 'jakelib'
+directory in your project, and load them (via `require`) after loading your
+Jakefile. (The directory name can be overridden using the -J/--jakelibdir
+command-line option.)
+
+This allows you to break your tasks up over multiple files -- a good way to do
+it is one namespace per file: e.g., a `zardoz` namespace full of tasks in
+'jakelib/zardox.jake'.
+
+Note that these .jake files each run in their own module-context, so they don't
+have access to each others' data. However, the Jake API methods, and the
+task-hierarchy are globally available, so you can use tasks in any file as
+prerequisites for tasks in any other, just as if everything were in a single
+file.
+
+Environment-variables set on the command-line are likewise also naturally
+available to code in all files via process.env.
+
+## File-utils
+
+Since shelling out in Node is an asynchronous operation, Jake comes with a few
+useful file-utilities with a synchronous API, that make scripting easier.
+
+The `jake.mkdirP` utility recursively creates a set of nested directories. It
+will not throw an error if any of the directories already exists. Here's an example:
+
+```javascript
+jake.mkdirP('app/views/layouts');
+```
+
+The `jake.cpR` utility does a recursive copy of a file or directory. It takes
+two arguments, the file/directory to copy, and the destination. Note that this
+command can only copy files and directories; it does not perform globbing (so
+arguments like '*.txt' are not possible).
+
+```javascript
+jake.cpR(path.join(sourceDir, '/templates'), currentDir);
+```
+
+This would copy 'templates' (and all its contents) into `currentDir`.
+
+The `jake.readdirR` utility gives you a recursive directory listing, giving you
+output somewhat similar to the Unix `find` command. It only works with a
+directory name, and does not perform filtering or globbing.
+
+```javascript
+jake.readdirR('pkg');
+```
+
+This would return an array of filepaths for all files in the 'pkg' directory,
+and all its subdirectories.
+
+The `jake.rmRf` utility recursively removes a directory and all its contents.
+
+```javascript
+jake.rmRf('pkg');
+```
+
+This would remove the 'pkg' directory, and all its contents.
+
+## Running shell-commands: `jake.exec` and `jake.createExec`
+
+Jake also provides a more general utility function for running a sequence of
+shell-commands.
+
+### `jake.exec`
+
+The `jake.exec` command takes an array of shell-command strings, and an optional
+callback to run after completing them. Here's an example from Jake's Jakefile,
+that runs the tests:
+
+```javascript
+desc('Runs the Jake tests.');
+task('test', {async: true}, function () {
+  var cmds = [
+    'node ./tests/parseargs.js'
+  , 'node ./tests/task_base.js'
+  , 'node ./tests/file_task.js'
+  ];
+  jake.exec(cmds, {printStdout: true}, function () {
+    console.log('All tests passed.');
+    complete();
+  });
+
+desc('Runs some apps in interactive mode.');
+task('interactiveTask', {async: true}, function () {
+  var cmds = [
+    'node' // Node conosle
+  , 'vim' // Open Vim
+  ];
+  jake.exec(cmds, {interactive: true}, function () {
+    complete();
+  });
+});
+```
+
+It also takes an optional options-object, with the following options:
+
+ * `interactive` (tasks are interactive, trumps printStdout and
+    printStderr below, default false)
+
+ * `printStdout` (print to stdout, default false)
+
+ * `printStderr` (print to stderr, default false)
+
+ * `breakOnError` (stop execution on error, default true)
+
+This command doesn't pipe input between commands -- it's for simple execution.
+
+### `jake.createExec` and the evented Exec object
+
+Jake also provides an evented interface for running shell commands. Calling
+`jake.createExec` returns an instance of `jake.Exec`, which is an `EventEmitter`
+that fires events as it executes commands.
+
+It emits the following events:
+
+* 'cmdStart': When a new command begins to run. Passes one arg, the command
+being run.
+
+* 'cmdEnd': When a command finishes. Passes one arg, the command
+being run.
+
+* 'stdout': When the stdout for the child-process recieves data. This streams
+the stdout data. Passes one arg, the chunk of data.
+
+* 'stderr': When the stderr for the child-process recieves data. This streams
+the stderr data. Passes one arg, the chunk of data.
+
+* 'error': When a shell-command exits with a non-zero status-code. Passes two
+args -- the error message, and the status code. If you do not set an error
+handler, and a command exits with an error-code, Jake will throw the unhandled
+error. If `breakOnError` is set to true, the Exec object will emit and 'error'
+event after the first error, and stop any further execution.
+
+To begin running the commands, you have to call the `run` method on it. It also
+has an `append` method for adding new commands to the list of commands to run.
+
+Here's an example:
+
+```javascript
+var ex = jake.createExec(['do_thing.sh'], {printStdout: true});
+ex.addListener('error', function (msg, code) {
+  if (code == 127) {
+    console.log("Couldn't find do_thing script, trying do_other_thing");
+    ex.append('do_other_thing.sh');
+  }
+  else {
+    fail('Fatal error: ' + msg, code);
+  }
+});
+ex.run();
+```
+
+Using the evented Exec object gives you a lot more flexibility in running shell
+commmands. But if you need something more sophisticated, Procstreams
+(<https://github.com/polotek/procstreams>) might be a good option.
+
+## Logging and output
+
+Using the -q/--quiet flag at the command-line will stop Jake from sending its
+normal output to standard output. Note that this only applies to built-in output
+from Jake; anything you output normally from your tasks will still be displayed.
+
+If you want to take advantage of the -q/--quiet flag in your own programs, you
+can use `jake.logger.log` and `jake.logger.error` for displaying output. These
+two commands will respect the flag, and suppress output correctly when the
+quiet-flag is on.
+
+You can check the current value of this flag in your own tasks by using
+`jake.program.opts.quiet`. If you want the output of a `jake.exec` shell-command
+to respect the quiet-flag, set your `printStdout` and `printStderr` options to
+false if the quiet-option is on:
+
+```javascript
+task('echo', {async: true}, function () {
+  jake.exec(['echo "hello"'], function () {
+    jake.logger.log('Done.');
+    complete();
+  }, {printStdout: !jake.program.opts.quiet});
+});
+```
+
+## PackageTask
+
+Instantiating a PackageTask programmically creates a set of tasks for packaging
+up your project for distribution. Here's an example:
+
+```javascript
+var t = new jake.PackageTask('fonebone', 'v0.1.2112', function () {
+  var fileList = [
+    'Jakefile'
+  , 'README.md'
+  , 'package.json'
+  , 'lib/*'
+  , 'bin/*'
+  , 'tests/*'
+  ];
+  this.packageFiles.include(fileList);
+  this.needTarGz = true;
+  this.needTarBz2 = true;
+});
+```
+
+This will automatically create a 'package' task that will assemble the specified
+files in 'pkg/fonebone-v0.1.2112,' and compress them according to the specified
+options. After running `jake package`, you'll have the following in pkg/:
+
+    fonebone-v0.1.2112
+    fonebone-v0.1.2112.tar.bz2
+    fonebone-v0.1.2112.tar.gz
+
+PackageTask also creates a 'clobber' task that removes the pkg/
+directory.
+
+The [PackageTask API
+docs](http://mde.github.com/jake/doc/symbols/jake.PackageTask.html) include a
+lot more information, including different archiving options.
+
+### FileList
+
+Jake's FileList takes a list of glob-patterns and file-names, and lazy-creates a
+list of files to include. Instead of immediately searching the filesystem to
+find the files, a FileList holds the pattern until it is actually used.
+
+When any of the normal JavaScript Array methods (or the `toArray` method) are
+called on the FileList, the pending patterns are resolved into an actual list of
+file-names. FileList uses the [minimatch](https://github.com/isaacs/minimatch) module.
+
+To build the list of files, use FileList's `include` and `exclude` methods:
+
+```javascript
+var list = new jake.FileList();
+list.include('foo/*.txt');
+list.include(['bar/*.txt', 'README.md']);
+list.include('Makefile', 'package.json');
+list.exclude('foo/zoobie.txt');
+list.exclude(/foo\/src.*.txt/);
+console.log(list.toArray());
+```
+
+The `include` method can be called either with an array of items, or multiple
+single parameters. Items can be either glob-patterns, or individual file-names.
+
+The `exclude` method will prevent files from being included in the list. These
+files must resolve to actual files on the filesystem. It can be called either
+with an array of items, or mutliple single parameters. Items can be
+glob-patterns, individual file-names, string-representations of
+regular-expressions, or regular-expression literals.
+
+## TestTask
+
+Instantiating a TestTask programmically creates a simple task for running tests
+for your project. The first argument of the constructor is the project-name
+(used in the description of the task), and the second argument is a function
+that defines the task. It allows you to specifify what files to run as tests,
+and what to name the task that gets created (defaults to "test" if unset).
+
+```javascript
+var t = new jake.TestTask('fonebone', function () {
+  var fileList = [
+    'tests/*'
+  , 'lib/adapters/**/test.js'
+  ];
+  this.testFiles.include(fileList);
+  this.testFiles.exclude('tests/helper.js');
+  this.testName = 'testMainAndAdapters';
+});
+```
+
+Tests in the specified file should be in the very simple format of
+test-functions hung off the export. These tests are converted into Jake tasks
+which Jake then runs normally.
+
+If a test needs to run asynchronously, simply define the test-function with a
+single argument, a callback. Jake will define this as an asynchronous task, and
+will wait until the callback is called in the test function to run the next test.
+
+Here's an example test-file:
+
+```javascript
+var assert = require('assert')
+  , tests;
+
+tests = {
+  'sync test': function () {
+    // Assert something
+    assert.ok(true);
+  }
+, 'async test': function (next) {
+    // Assert something else
+    assert.ok(true);
+    // Won't go next until this is called
+    next();
+  }
+, 'another sync test': function () {
+    // Assert something else
+    assert.ok(true);
+  }
+};
+
+module.exports = tests;
+```
+
+Jake's tests are also a good example of use of a TestTask.
+
+## NpmPublishTask
+
+The NpmPublishTask builds on top of PackageTask to allow you to do a version
+bump of your project, package it, and publish it to NPM. Define the task with
+your project's name, and the list of files you want packaged and published to
+NPM.
+
+Here's an example from Jake's Jakefile:
+
+```javascript
+var p = new jake.NpmPublishTask('jake', [
+  'Makefile'
+, 'Jakefile'
+, 'README.md'
+, 'package.json'
+, 'lib/*'
+, 'bin/*'
+, 'tests/*'
+]);
+```
+
+The NpmPublishTask will automatically create a `publish` task which performs the
+following steps:
+
+1. Bump the version number in your package.json
+2. Commit change in git, push it to GitHub
+3. Create a git tag for the version
+4. Push the tag to GitHub
+5. Package the new version of your project
+6. Publish it to NPM
+7. Clean up the package
+
+## CoffeeScript Jakefiles
+
+Jake can also handle Jakefiles in CoffeeScript. Be sure to make it
+Jakefile.coffee so Jake knows it's in CoffeeScript.
+
+Here's an example:
+
+```coffeescript
+util = require('util')
+
+desc 'This is the default task.'
+task 'default', (params) ->
+  console.log 'Ths is the default task.'
+  console.log(util.inspect(arguments))
+  jake.Task['new'].invoke []
+
+task 'new', ->
+  console.log 'ello from new'
+  jake.Task['foo:next'].invoke ['param']
+
+namespace 'foo', ->
+  task 'next', (param) ->
+    console.log 'ello from next with param: ' + param
+```
+
+## Related projects
+
+James Coglan's "Jake": <http://github.com/jcoglan/jake>
+
+Confusingly, this is a Ruby tool for building JavaScript packages from source code.
+
+280 North's Jake: <http://github.com/280north/jake>
+
+This is also a JavaScript port of Rake, which runs on the Narwhal platform.
+
+### License
+
+Licensed under the Apache License, Version 2.0
+(<http://www.apache.org/licenses/LICENSE-2.0>)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/bin/cli.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/bin/cli.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/bin/cli.js
new file mode 100755
index 0000000..e241f2b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/bin/cli.js
@@ -0,0 +1,23 @@
+#!/usr/bin/env node
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var args = process.argv.slice(2)
+  , jake = require('../lib/jake');
+
+jake.run.apply(jake, args);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/api.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/api.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/api.js
new file mode 100644
index 0000000..97d7c78
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/api.js
@@ -0,0 +1,241 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var exec = require('child_process').exec;
+
+var api = new (function () {
+  /**
+    @name task
+    @static
+    @function
+    @description Creates a Jake Task
+    `
+    @param {String} name The name of the Task
+    @param {Array} [prereqs] Prerequisites to be run before this task
+    @param {Function} [action] The action to perform for this task
+    @param {Object} [opts]
+      @param {Boolean} [opts.asyc=false] Perform this task asynchronously.
+      If you flag a task with this option, you must call the global
+      `complete` method inside the task's action, for execution to proceed
+      to the next task.
+
+    @example
+    desc('This is the default task.');
+    task('default', function (params) {
+      console.log('This is the default task.');
+    });
+
+    desc('This task has prerequisites.');
+    task('hasPrereqs', ['foo', 'bar', 'baz'], function (params) {
+      console.log('Ran some prereqs first.');
+    });
+
+    desc('This is an asynchronous task.');
+    task('asyncTask', function () {
+      setTimeout(complete, 1000);
+    }, {async: true});
+   */
+  this.task = function (name, prereqs, action, opts) {
+    var args = Array.prototype.slice.call(arguments)
+      , type
+      , createdTask;
+    args.unshift('task');
+    createdTask = jake.createTask.apply(global, args);
+    jake.currentTaskDescription = null;
+    return createdTask;
+  };
+
+  /**
+    @name directory
+    @static
+    @function
+    @description Creates a Jake DirectoryTask. Can be used as a prerequisite
+    for FileTasks, or for simply ensuring a directory exists for use with a
+    Task's action.
+    `
+    @param {String} name The name of the DiretoryTask
+
+    @example
+
+    // Creates the package directory for distribution
+    directory('pkg');
+   */
+  this.directory = function (name) {
+    var args = Array.prototype.slice.call(arguments)
+      , createdTask;
+    args.unshift('directory');
+    createdTask = jake.createTask.apply(global, args);
+    jake.currentTaskDescription = null;
+    return createdTask;
+  };
+
+  /**
+    @name file
+    @static
+    @function
+    @description Creates a Jake FileTask.
+    `
+    @param {String} name The name of the FileTask
+    @param {Array} [prereqs] Prerequisites to be run before this task
+    @param {Function} [action] The action to create this file, if it doesn't
+    exist already.
+    @param {Object} [opts]
+      @param {Array} [opts.asyc=false] Perform this task asynchronously.
+      If you flag a task with this option, you must call the global
+      `complete` method inside the task's action, for execution to proceed
+      to the next task.
+
+   */
+  this.file = function (name, prereqs, action, opts) {
+    var args = Array.prototype.slice.call(arguments)
+      , createdTask;
+    args.unshift('file');
+    createdTask = jake.createTask.apply(global, args);
+    jake.currentTaskDescription = null;
+    return createdTask;
+  };
+
+  /**
+    @name desc
+    @static
+    @function
+    @description Creates a description for a Jake Task (or FileTask,
+    DirectoryTask). When invoked, the description that iscreated will
+    be associated with whatever Task is created next.
+    `
+    @param {String} description The description for the Task
+   */
+  this.desc = function (description) {
+    jake.currentTaskDescription = description;
+  };
+
+  /**
+    @name namespace
+    @static
+    @function
+    @description Creates a namespace which allows logical grouping
+    of tasks, and prevents name-collisions with task-names. Namespaces
+    can be nested inside of other namespaces.
+    `
+    @param {String} name The name of the namespace
+    @param {Function} scope The enclosing scope for the namespaced tasks
+
+    @example
+    namespace('doc', function () {
+      task('generate', ['doc:clobber'], function () {
+        // Generate some docs
+      });
+
+      task('clobber', function () {
+        // Clobber the doc directory first
+      });
+    });
+   */
+  this.namespace = function (name, scope) {
+    var curr = jake.currentNamespace
+      , ns = curr.childNamespaces[name] || new jake.Namespace(name, curr);
+    curr.childNamespaces[name] = ns;
+    jake.currentNamespace = ns;
+    scope();
+    jake.currentNamespace = curr;
+    jake.currentTaskDescription = null;
+    return ns;
+  };
+
+  /**
+    @name complete
+    @static
+    @function
+    @description Complets an asynchronous task, allowing Jake's
+    execution to proceed to the next task
+    `
+    @example
+    task('generate', ['doc:clobber'], function () {
+      exec('./generate_docs.sh', function (err, stdout, stderr) {
+        if (err || stderr) {
+          fail(err || stderr);
+        }
+        else {
+          console.log(stdout);
+          complete();
+        }
+      });
+    }, {async: true});
+   */
+  this.complete = function () {
+    var current = jake._invocationChain.pop();
+    if (current) {
+      current.complete();
+    }
+  };
+
+  /**
+    @name fail
+    @static
+    @function
+    @description Causes Jake execution to abort with an error.
+    Allows passing an optional error code, which will be used to
+    set the exit-code of exiting process.
+    `
+    @param {Error|String} err The error to thow when aborting execution.
+    If this argument is an Error object, it will simply be thrown. If
+    a String, it will be used as the error-message. (If it is a multi-line
+    String, the first line will be used as the Error message, and the
+    remaining lines will be used as the error-stack.)
+
+    @example
+    task('createTests, function () {
+      if (!fs.existsSync('./tests')) {
+        fail('Test directory does not exist.');
+      }
+      else {
+        // Do some testing stuff ...
+      }
+    });
+   */
+  this.fail = function (err, code) {
+    var msg
+      , errObj;
+    if (code) {
+      jake.errorCode = code;
+    }
+    if (err) {
+      if (typeof err == 'string') {
+        // Use the initial or only line of the error as the error-message
+        // If there was a multi-line error, use the rest as the stack
+        msg = err.split('/n');
+        errObj = new Error(msg.shift());
+        if (msg.length) {
+          errObj.stack = msg.join('\n');
+        }
+        throw errObj;
+      }
+      else if (err instanceof Error) {
+        throw err;
+      }
+      else {
+        throw new Error(err.toString());
+      }
+    }
+    else {
+      throw new Error();
+    }
+  };
+
+})();
+
+module.exports = api;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/file_list.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/file_list.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/file_list.js
new file mode 100644
index 0000000..f0dd732
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/file_list.js
@@ -0,0 +1,284 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var fs = require('fs')
+, path = require('path')
+, minimatch = require('minimatch')
+, utils = require('utilities')
+, globSync;
+
+globSync = function (pat) {
+  var dirname = jake.basedir(pat)
+    , files = jake.readdirR(dirname)
+    , matches;
+  pat = path.normalize(pat);
+  // Hack, Minimatch doesn't support backslashes in the pattern
+  // https://github.com/isaacs/minimatch/issues/7
+  pat = pat.replace(/\\/g, '/');
+  matches = minimatch.match(files, pat, {});
+  return matches;
+};
+
+// Constants
+// ---------------
+// List of all the builtin Array methods we want to override
+var ARRAY_METHODS = Object.getOwnPropertyNames(Array.prototype)
+// Array methods that return a copy instead of affecting the original
+  , SPECIAL_RETURN = {
+      'concat': true
+    , 'slice': true
+    , 'filter': true
+    , 'map': true
+    }
+// Default file-patterns we want to ignore
+  , DEFAULT_IGNORE_PATTERNS = [
+      /(^|[\/\\])CVS([\/\\]|$)/
+    , /(^|[\/\\])\.svn([\/\\]|$)/
+    , /(^|[\/\\])\.git([\/\\]|$)/
+    , /\.bak$/
+    , /~$/
+    ]
+// Ignore core files
+  , DEFAULT_IGNORE_FUNCS = [
+      function (name) {
+        var isDir = false
+          , stats;
+        try {
+          stats = fs.statSync(name);
+          isDir = stats.isDirectory();
+        }
+        catch(e) {}
+        return (/(^|[\/\\])core$/).test(name) && !isDir;
+      }
+    ];
+
+var FileList = function () {
+  var self = this
+    , wrap;
+
+  // List of glob-patterns or specific filenames
+  this.pendingAdd = [];
+  // Switched to false after lazy-eval of files
+  this.pending = true;
+  // Used to calculate exclusions from the list of files
+  this.excludes = {
+    pats: DEFAULT_IGNORE_PATTERNS.slice()
+  , funcs: DEFAULT_IGNORE_FUNCS.slice()
+  , regex: null
+  };
+  this.items = [];
+
+  // Wrap the array methods with the delegates
+  wrap = function (prop) {
+    var arr;
+    self[prop] = function () {
+      if (self.pending) {
+        self.resolve();
+      }
+      if (typeof self.items[prop] == 'function') {
+        // Special method that return a copy
+        if (SPECIAL_RETURN[prop]) {
+          arr = self.items[prop].apply(self.items, arguments);
+          return FileList.clone(self, arr);
+        }
+        else {
+          return self.items[prop].apply(self.items, arguments);
+        }
+      }
+      else {
+        return self.items[prop];
+      }
+    };
+  };
+  for (var i = 0, ii = ARRAY_METHODS.length; i < ii; i++) {
+    wrap(ARRAY_METHODS[i]);
+  }
+
+  // Include whatever files got passed to the constructor
+  this.include.apply(this, arguments);
+
+  // Fix constructor linkage
+  this.constructor = FileList;
+};
+
+FileList.prototype = new (function () {
+  var globPattern = /[*?\[\{]/;
+
+  var _addMatching = function (pat) {
+        var matches = globSync(pat);
+        this.items = this.items.concat(matches);
+      }
+
+    , _resolveAdd = function (name) {
+        if (globPattern.test(name)) {
+          _addMatching.call(this, name);
+        }
+        else {
+          this.push(name);
+        }
+      }
+
+    , _calculateExcludeRe = function () {
+        var pats = this.excludes.pats
+          , pat
+          , excl = []
+          , matches = [];
+
+        for (var i = 0, ii = pats.length; i < ii; i++) {
+          pat = pats[i];
+          if (typeof pat == 'string') {
+            // Glob, look up files
+            if (/[*?]/.test(pat)) {
+              matches = globSync(pat);
+              excl = excl.concat(matches);
+            }
+            // String for regex
+            else {
+              excl.push(utils.string.escapeRegExpChars(pat));
+            }
+          }
+          // Regex, grab the string-representation
+          else if (pat instanceof RegExp) {
+            excl.push(pat.toString().replace(/^\/|\/$/g, ''));
+          }
+        }
+        if (excl.length) {
+          this.excludes.regex = new RegExp('(' + excl.join(')|(') + ')');
+        }
+        else {
+          this.excludes.regex = /^$/;
+        }
+      }
+
+    , _resolveExclude = function () {
+        var self = this;
+        _calculateExcludeRe.call(this);
+        // No `reject` method, so use reverse-filter
+        this.items = this.items.filter(function (name) {
+          return !self.shouldExclude(name);
+        });
+      }
+
+  /**
+   * Includes file-patterns in the FileList. Should be called with one or more
+   * pattern for finding file to include in the list. Arguments should be strings
+   * for either a glob-pattern or a specific file-name, or an array of them
+   */
+  this.include = function () {
+    var args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
+    for (var i = 0, ii = args.length; i < ii; i++) {
+      this.pendingAdd.push(args[i]);
+    }
+    return this;
+  };
+
+  /**
+   * Indicates whether a particular file would be filtered out by the current
+   * exclusion rules for this FileList.
+   * @param {String} name The filename to check
+   * @return {Boolean} Whether or not the file should be excluded
+   */
+  this.shouldExclude = function (name) {
+    if (!this.excludes.regex) {
+      _calculateExcludeRe.call(this);
+    }
+    var excl = this.excludes;
+    return excl.regex.test(name) || excl.funcs.some(function (f) {
+      return !!f(name);
+    });
+  };
+
+  /**
+   * Excludes file-patterns from the FileList. Should be called with one or more
+   * pattern for finding file to include in the list. Arguments can be:
+   * 1. Strings for either a glob-pattern or a specific file-name
+   * 2. Regular expression literals
+   * 3. Functions to be run on the filename that return a true/false
+   */
+  this.exclude = function () {
+    var args = Array.isArray(arguments[0]) ? arguments[0] : arguments
+      , arg;
+    for (var i = 0, ii = args.length; i < ii; i++) {
+      arg = args[i];
+      if (typeof arg == 'function' && !(arg instanceof RegExp)) {
+        this.excludes.funcs.push(arg);
+      }
+      else {
+        this.excludes.pats.push(arg);
+      }
+    }
+    if (!this.pending) {
+      _resolveExclude.call(this);
+    }
+    return this;
+  };
+
+  /**
+   * Populates the FileList from the include/exclude rules with a list of
+   * actual files
+   */
+  this.resolve = function () {
+    var name;
+    if (this.pending) {
+      this.pending = false;
+      while ((name = this.pendingAdd.shift())) {
+        _resolveAdd.call(this, name);
+      }
+      _resolveExclude.call(this);
+    }
+    return this;
+  };
+
+  /**
+   * Convert to a plain-jane array
+   */
+  this.toArray = function () {
+    // Call slice to ensure lazy-resolution before slicing items
+    var ret = this.slice().items.slice();
+    return ret;
+  };
+
+  /**
+   * Get rid of any current exclusion rules
+   */
+  this.clearExclude = function () {
+    this.excludes = {
+      pats: []
+    , funcs: []
+    , regex: null
+    };
+    return this;
+  };
+
+})();
+
+// Static method, used to create copy returned by special
+// array methods
+FileList.clone = function (list, items) {
+  var clone = new FileList();
+  if (items) {
+    clone.items = items;
+  }
+  clone.pendingAdd = list.pendingAdd;
+  clone.pending = list.pending;
+  for (var p in list.excludes) {
+    clone.excludes[p] = list.excludes[p];
+  }
+  return clone;
+};
+
+exports.FileList = FileList;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/jake.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/jake.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/jake.js
new file mode 100644
index 0000000..e271342
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/jake.js
@@ -0,0 +1,280 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var jake
+  , EventEmitter = require('events').EventEmitter
+  , fs = require('fs')
+  , path = require('path')
+  , taskNs = require('./task')
+  , Task = taskNs.Task
+  , FileTask = taskNs.FileTask
+  , DirectoryTask = taskNs.DirectoryTask
+  , api = require('./api')
+  , utils = require('./utils')
+  , Program = require('./program').Program
+  , Loader = require('./loader').Loader
+  , pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString());
+
+var Namespace = function (name, parentNamespace) {
+  this.name = name;
+  this.parentNamespace = parentNamespace;
+  this.childNamespaces = {};
+  this.tasks = {};
+
+  this.resolve = function(relativeName) {
+    var parts = relativeName.split(':')
+      , name  = parts.pop()
+      , ns    = this
+      , task;
+    for(var i = 0, l = parts.length; ns && i < l; i++) {
+      ns = ns.childNamespaces[parts[i]];
+    }
+
+    return (ns && ns.tasks[name]) ||
+      (this.parentNamespace && this.parentNamespace.resolve(relativeName));
+  }
+
+};
+
+var Invocation = function (taskName, args) {
+  this.taskName = taskName;
+  this.args = args;
+};
+
+// And so it begins
+jake = new EventEmitter();
+
+// Globalize jake and top-level API methods (e.g., `task`, `desc`)
+global.jake = jake;
+utils.mixin(global, api);
+
+// Copy utils onto base jake
+utils.mixin(jake, utils);
+// File utils should be aliased directly on base jake as well
+utils.mixin(jake, utils.file);
+
+utils.mixin(jake, new (function () {
+
+  this._invocationChain = [];
+
+  // Private variables
+  // =================
+  // Local reference for scopage
+  var self = this;
+
+  // Public properties
+  // =================
+  this.version = pkg.version;
+  // Used when Jake exits with a specific error-code
+  this.errorCode = undefined;
+  // Loads Jakefiles/jakelibdirs
+  this.loader = new Loader();
+  // Name/value map of all the various tasks defined in a Jakefile.
+  // Non-namespaced tasks are placed into 'default.'
+  this.defaultNamespace = new Namespace('default', null);
+  // For namespaced tasks -- tasks with no namespace are put into the
+  // 'default' namespace so lookup code can work the same for both
+  // namespaced and non-namespaced.
+  this.currentNamespace = this.defaultNamespace;
+  // Saves the description created by a 'desc' call that prefaces a
+  // 'task' call that defines a task.
+  this.currentTaskDescription = null;
+  this.program = new Program()
+  this.FileList = require('./file_list').FileList;
+  this.PackageTask = require('./package_task').PackageTask;
+  this.NpmPublishTask = require('./npm_publish_task').NpmPublishTask;
+  this.TestTask = require('./test_task').TestTask;
+  this.Task = Task;
+  this.FileTask = FileTask;
+  this.DirectoryTask = DirectoryTask;
+  this.Namespace = Namespace;
+
+  this.parseAllTasks = function () {
+    var _parseNs = function (name, ns) {
+      var nsTasks = ns.tasks
+        , task
+        , nsNamespaces = ns.childNamespaces
+        , fullName;
+      // Iterate through the tasks in each namespace
+      for (var q in nsTasks) {
+        task = nsTasks[q];
+        // Preface only the namespaced tasks
+        fullName = name == 'default' ? q : name + ':' + q;
+        // Save with 'taskname' or 'namespace:taskname' key
+        task.fullName = fullName;
+        jake.Task[fullName] = task;
+      }
+      for (var p in nsNamespaces) {
+        fullName = name  == 'default' ? p : name + ':' + p;
+        _parseNs(fullName, nsNamespaces[p]);
+      }
+    };
+
+    _parseNs('default', jake.defaultNamespace);
+  };
+
+  /**
+   * Displays the list of descriptions avaliable for tasks defined in
+   * a Jakefile
+   */
+  this.showAllTaskDescriptions = function (f) {
+    var maxTaskNameLength = 0
+      , task
+      , str = ''
+      , padding
+      , name
+      , descr
+      , filter = typeof f == 'string' ? f : null;
+
+    for (var p in jake.Task) {
+      task = jake.Task[p];
+      // Record the length of the longest task name -- used for
+      // pretty alignment of the task descriptions
+      maxTaskNameLength = p.length > maxTaskNameLength ?
+        p.length : maxTaskNameLength;
+    }
+    // Print out each entry with descriptions neatly aligned
+    for (var p in jake.Task) {
+      if (filter && p.indexOf(filter) == -1) {
+        continue;
+      }
+      task = jake.Task[p];
+
+      name = '\033[32m' + p + '\033[39m ';
+
+      // Create padding-string with calculated length
+      padding = (new Array(maxTaskNameLength - p.length + 2)).join(' ');
+
+      descr = task.description
+      if (descr) {
+        descr = '\033[90m # ' + descr + '\033[39m \033[37m \033[39m';
+        console.log('jake ' + name + padding + descr);
+      }
+    }
+  };
+
+  this.createTask = function () {
+    var args = Array.prototype.slice.call(arguments)
+      , arg
+      , task
+      , type
+      , name
+      , action
+      , opts = {}
+      , prereqs = [];
+
+      type = args.shift()
+
+    // name, [deps], [action]
+    // Name (string) + deps (array) format
+    if (typeof args[0] == 'string') {
+      name = args.shift();
+      if (Array.isArray(args[0])) {
+        prereqs = args.shift();
+      }
+    }
+    // name:deps, [action]
+    // Legacy object-literal syntax, e.g.: {'name': ['depA', 'depB']}
+    else {
+      obj = args.shift()
+      for (var p in obj) {
+        prereqs = prereqs.concat(obj[p]);
+        name = p;
+      }
+    }
+
+    // Optional opts/callback or callback/opts
+    while ((arg = args.shift())) {
+      if (typeof arg == 'function') {
+        action = arg;
+      }
+      else {
+        opts = arg;
+      }
+    }
+
+    task = jake.currentNamespace.resolve(name);
+    if (task && !action) {
+      // Task already exists and no action, just update prereqs, and return it.
+      task.prereqs = task.prereqs.concat(prereqs);
+      return task;
+    }
+
+    switch (type) {
+      case 'directory':
+        action = function () {
+          jake.mkdirP(name);
+        };
+        task = new DirectoryTask(name, prereqs, action, opts);
+        break;
+      case 'file':
+        task = new FileTask(name, prereqs, action, opts);
+        break;
+      default:
+        task = new Task(name, prereqs, action, opts);
+    }
+
+    if (jake.currentTaskDescription) {
+      task.description = jake.currentTaskDescription;
+      jake.currentTaskDescription = null;
+    }
+    jake.currentNamespace.tasks[name] = task;
+    task.namespace = jake.currentNamespace;
+
+    // FIXME: Should only need to add a new entry for the current
+    // task-definition, not reparse the entire structure
+    jake.parseAllTasks();
+
+    return task;
+  };
+
+  this.init = function () {
+    var self = this;
+    process.addListener('uncaughtException', function (err) {
+      self.program.handleErr(err);
+    });
+
+  };
+
+  this.run = function () {
+    var args = Array.prototype.slice.call(arguments)
+      , program = this.program
+      , loader = this.loader
+      , preempt
+      , opts;
+
+    program.parseArgs(args);
+    program.init();
+
+    preempt = program.firstPreemptiveOption();
+    if (preempt) {
+      preempt();
+    }
+    else {
+      opts = program.opts;
+      // Load Jakefile and jakelibdir files
+      loader.loadFile(opts.jakefile);
+      loader.loadDirectory(opts.jakelibdir);
+
+      program.run();
+    }
+  };
+
+})());
+
+module.exports = jake;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/loader.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/loader.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/loader.js
new file mode 100644
index 0000000..58c7080
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/loader.js
@@ -0,0 +1,94 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var path = require('path')
+  , fs = require('fs')
+  , existsSync = typeof fs.existsSync == 'function' ?
+      fs.existsSync : path.existsSync
+  , utils = require('utilities')
+  , Loader;
+
+
+Loader = function () {
+
+  var JAKEFILE_PAT = /\.jake(\.js|\.coffee)?$/;
+
+  var _requireCoffee = function () {
+        try {
+          return require('coffee-script');
+        }
+        catch (e) {
+          fail('CoffeeScript is missing! Try `npm install coffee-script`');
+        }
+      };
+
+  this.loadFile = function (file) {
+    var jakefile = file ?
+            file.replace(/\.js$/, '').replace(/\.coffee$/, '') : 'Jakefile'
+      , fileSpecified = !!file
+      // Dear God, why?
+      , isCoffee = false
+      // Warning, recursive
+      , exists;
+
+    exists = function () {
+      var cwd = process.cwd();
+      if (existsSync(jakefile) || existsSync(jakefile + '.js') ||
+        existsSync(jakefile + '.coffee')) {
+        return true;
+      }
+      if (!fileSpecified) {
+        process.chdir("..");
+        if (cwd === process.cwd()) {
+          return false;
+        }
+        return exists();
+      }
+    };
+
+    if (!exists()) {
+      fail('No Jakefile. Specify a valid path with -f/--jakefile, ' +
+          'or place one in the current directory.');
+    }
+
+    isCoffee = existsSync(jakefile + '.coffee');
+    if (isCoffee) {
+      CoffeeScript = _requireCoffee();
+    }
+    require(utils.file.absolutize(jakefile));
+  };
+
+  this.loadDirectory = function (d) {
+    var dirname = d || 'jakelib'
+      , dirlist;
+    dirname = utils.file.absolutize(dirname);
+    if (existsSync(dirname)) {
+      dirlist = fs.readdirSync(dirname);
+      dirlist.forEach(function (filePath) {
+        if (JAKEFILE_PAT.test(filePath)) {
+          if (/\.coffee$/.test(filePath)) {
+            CoffeeScript = _requireCoffee();
+          }
+          require(path.join(dirname, filePath));
+        }
+      });
+    }
+  };
+};
+
+module.exports.Loader = Loader;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/npm_publish_task.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/npm_publish_task.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/npm_publish_task.js
new file mode 100644
index 0000000..d4f029b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/npm_publish_task.js
@@ -0,0 +1,193 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var fs = require('fs')
+  , exec = require('child_process').exec
+  , utils = require('utilities')
+  , currDir = process.cwd();
+
+var NpmPublishTask = function (name, packageFiles) {
+  this.name = name;
+  this.packageFiles = packageFiles;
+  this.define();
+};
+
+
+NpmPublishTask.prototype = new (function () {
+
+  var _currentBranch = null;
+
+  var getPackage = function () {
+        var pkg = JSON.parse(fs.readFileSync(process.cwd() + '/package.json').toString());
+        return pkg;
+      }
+    , getPackageVersionNumber = function () {
+        return getPackage().version;
+      };
+
+  this.define = function () {
+    var self = this;
+
+    namespace('npm', function () {
+      task('fetchTags', {async: true}, function () {
+        // Make sure local tags are up to date
+        cmds = [
+          'git fetch --tags'
+        ];
+        jake.exec(cmds, function () {
+          console.log('Fetched remote tags.');
+          complete();
+        });
+      });
+
+      task('getCurrentBranch', {async: true}, function () {
+        // Figure out what branch to push to
+        exec('git symbolic-ref --short HEAD',
+            function (err, stdout, stderr) {
+          if (err) {
+            fail(err);
+          }
+          if (stderr) {
+            fail(new Error(stderr));
+          }
+          if (!stdout) {
+            fail(new Error('No current Git branch found'));
+          }
+          _currentBranch = utils.string.trim(stdout);
+          console.log('On branch ' + _currentBranch);
+          complete();
+        });
+      });
+
+      task('version', {async: true}, function () {
+        // Only bump, push, and tag if the Git repo is clean
+        exec('git status --porcelain --untracked-files=no',
+            function (err, stdout, stderr) {
+          var cmds
+            , path
+            , pkg
+            , version
+            , arr
+            , patch
+            , message;
+
+          if (err) {
+            fail(err);
+          }
+          if (stderr) {
+            fail(new Error(stderr));
+          }
+          if (stdout.length) {
+            fail(new Error('Git repository is not clean.'));
+          }
+
+          // Grab the current version-string
+          path = process.cwd() + '/package.json';
+          pkg = getPackage();
+          version = pkg.version;
+          // Increment the patch-number for the version
+          arr = version.split('.');
+          patch = parseInt(arr.pop(), 10) + 1;
+          arr.push(patch);
+          version = arr.join('.');
+          // New package-version
+          pkg.version = version;
+          // Commit-message
+          message = 'Version ' + version
+
+          // Update package.json with the new version-info
+          fs.writeFileSync(path, JSON.stringify(pkg, true, 2));
+
+          cmds = [
+            'git commit package.json -m "' + message + '"'
+          , 'git push origin ' + _currentBranch
+          , 'git tag -a v' + version + ' -m "' + message + '"'
+          , 'git push --tags'
+          ];
+
+          jake.exec(cmds, function () {
+            var version = getPackageVersionNumber();
+            console.log('Bumped version number to v' + version + '.');
+            complete();
+          });
+        });
+      });
+
+      task('definePackage', function () {
+        var version = getPackageVersionNumber()
+          , t;
+        t = new jake.PackageTask(self.name, 'v' + version, function () {
+          this.packageFiles.include(self.packageFiles);
+          this.needTarGz = true;
+        });
+      });
+
+      task('package', {async: true}, function () {
+        var definePack = jake.Task['npm:definePackage']
+          , pack = jake.Task['package']
+          , version = getPackageVersionNumber();
+        // May have already been run
+        definePack.reenable(true);
+        definePack.addListener('complete', function () {
+          pack.addListener('complete', function () {
+            console.log('Created package for ' + self.name + ' v' + version);
+            complete();
+          });
+          pack.invoke();
+        });
+        definePack.invoke();
+      });
+
+      task('publish', {async: true}, function () {
+        var version = getPackageVersionNumber();
+        console.log('Publishing ' + self.name + ' v' + version);
+        cmds = [
+          'npm publish pkg/' + self.name + '-v' + version + '.tar.gz'
+        ];
+        // Hackity hack -- NPM publish sometimes returns errror like:
+        // Error sending version data\nnpm ERR!
+        // Error: forbidden 0.2.4 is modified, should match modified time
+        setTimeout(function () {
+          jake.exec(cmds, function () {
+            console.log('Published to NPM');
+            complete();
+          }, {stdout: true});
+        }, 5000);
+      });
+
+      task('cleanup', function () {
+        var clobber = jake.Task['clobber'];
+        clobber.reenable(true);
+        clobber.invoke();
+        console.log('Cleaned up package');
+      });
+
+    });
+
+    desc('Bump version-number, package, and publish to NPM.');
+    task('publish', ['npm:fetchTags', 'npm:getCurrentBranch', 'npm:version',
+        'npm:package', 'npm:publish', 'npm:cleanup'], function () {});
+
+    jake.Task['npm:definePackage'].invoke();
+  };
+
+})();
+
+jake.NpmPublishTask = NpmPublishTask;
+exports.NpmPublishTask = NpmPublishTask;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/package_task.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/package_task.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/package_task.js
new file mode 100644
index 0000000..6d972ef
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/package_task.js
@@ -0,0 +1,365 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var path = require('path')
+  , fs = require('fs')
+  , exec = require('child_process').exec
+  , FileList = require('./file_list').FileList;
+
+/**
+  @name jake
+  @namespace jake
+*/
+/**
+  @name jake.PackageTask
+  @constructor
+  @description Instantiating a PackageTask creates a number of Jake
+  Tasks that make packaging and distributing your software easy.
+
+  @param {String} name The name of the project
+  @param {String} version The current project version (will be
+  appended to the project-name in the package-archive
+  @param {Function} definition Defines the contents of the package,
+  and format of the package-archive. Will be executed on the instantiated
+  PackageTask (i.e., 'this', will be the PackageTask instance),
+  to set the various instance-propertiess.
+
+  @example
+  var t = new jake.PackageTask('rous', 'v' + version, function () {
+    var files = [
+      'Capfile'
+    , 'Jakefile'
+    , 'README.md'
+    , 'package.json'
+    , 'app/*'
+    , 'bin/*'
+    , 'config/*'
+    , 'lib/*'
+    , 'node_modules/*'
+    ];
+    this.packageFiles.include(files);
+    this.packageFiles.exclude('node_modules/foobar');
+    this.needTarGz = true;
+  });
+
+ */
+var PackageTask = function (name, version, definition) {
+  /**
+    @name jake.PackageTask#name
+    @public
+    @type {String}
+    @description The name of the project
+   */
+  this.name = name;
+  /**
+    @name jake.PackageTask#version
+    @public
+    @type {String}
+    @description The project version-string
+   */
+  this.version = version;
+  /**
+    @name jake.PackageTask#version
+    @public
+    @type {String='pkg'}
+    @description The directory-name to use for packaging the software
+   */
+  this.packageDir = 'pkg';
+  /**
+    @name jake.PackageTask#packageFiles
+    @public
+    @type {jake.FileList}
+    @description The list of files and directories to include in the
+    package-archive
+   */
+  this.packageFiles = new FileList();
+  /**
+    @name jake.PackageTask#needTar
+    @public
+    @type {Boolean=false}
+    @description If set to true, uses the `tar` utility to create
+    a gzip .tgz archive of the pagckage
+   */
+  this.needTar = false;
+  /**
+    @name jake.PackageTask#needTar
+    @public
+    @type {Boolean=false}
+    @description If set to true, uses the `tar` utility to create
+    a gzip .tar.gz archive of the pagckage
+   */
+  this.needTarGz = false;
+  /**
+    @name jake.PackageTask#needTarBz2
+    @public
+    @type {Boolean=false}
+    @description If set to true, uses the `tar` utility to create
+    a bzip2 .bz2 archive of the pagckage
+   */
+  this.needTarBz2 = false;
+  /**
+    @name jake.PackageTask#needJar
+    @public
+    @type {Boolean=false}
+    @description If set to true, uses the `jar` utility to create
+    a .jar archive of the pagckage
+   */
+  this.needJar = false;
+  /**
+    @name jake.PackageTask#needZip
+    @public
+    @type {Boolean=false}
+    @description If set to true, uses the `zip` utility to create
+    a .zip archive of the pagckage
+   */
+  this.needZip = false;
+  /**
+    @name jake.PackageTask#manifestFile
+    @public
+    @type {String=null}
+    @description Can be set to point the `jar` utility at a manifest
+    file to use in a .jar archive. If unset, one will be automatically
+    created by the `jar` utility. This path should be relative to the
+    root of the package directory (this.packageDir above, likely 'pkg')
+   */
+  this.manifestFile = null;
+  /**
+    @name jake.PackageTask#tarCommand
+    @public
+    @type {String='tar'}
+    @description The shell-command to use for creating tar archives.
+   */
+  this.tarCommand = 'tar';
+  /**
+    @name jake.PackageTask#jarCommand
+    @public
+    @type {String='jar'}
+    @description The shell-command to use for creating jar archives.
+   */
+  this.jarCommand = 'jar';
+  /**
+    @name jake.PackageTask#zipCommand
+    @public
+    @type {String='zip'}
+    @description The shell-command to use for creating zip archives.
+   */
+  this.zipCommand = 'zip';
+  /**
+    @name jake.PackageTask#archiveChangeDir
+    @public
+    @type {String=null}
+    @description Equivalent to the '-C' command for the `tar` and `jar`
+    commands. ("Change to this directory before adding files.")
+   */
+  this.archiveChangeDir = null;
+  /**
+    @name jake.PackageTask#archiveContentDir
+    @public
+    @type {String=null}
+    @description Specifies the files and directories to include in the
+    package-archive. If unset, this will default to the main package
+    directory -- i.e., name + version.
+   */
+  this.archiveContentDir = null;
+
+  if (typeof definition == 'function') {
+    definition.call(this);
+  }
+  this.define();
+};
+
+PackageTask.prototype = new (function () {
+
+  var _compressOpts = {
+        Tar: {
+          ext: '.tgz'
+        , flags: 'cvzf'
+        , cmd: 'tar'
+        }
+      , TarGz: {
+          ext: '.tar.gz'
+        , flags: 'cvzf'
+        , cmd: 'tar'
+        }
+      , TarBz2: {
+          ext: '.tar.bz2'
+        , flags: 'cvjf'
+        , cmd: 'tar'
+        }
+      , Jar: {
+          ext: '.jar'
+        , flags: 'cf'
+        , cmd: 'jar'
+        }
+      , Zip: {
+          ext: '.zip'
+        , flags: 'r'
+        , cmd: 'zip'
+        }
+      };
+
+  this.define = function () {
+    var self = this
+      , packageDirPath = this.packageDirPath()
+      , compressTaskArr = [];
+
+    desc('Build the package for distribution');
+    task('package', ['clobberPackage', 'buildPackage']);
+    // Backward-compat alias
+    task('repackage', ['package']);
+
+    task('clobberPackage', function () {
+      jake.rmRf(self.packageDir, {silent: true});
+    });
+
+    desc('Remove the package');
+    task('clobber', ['clobberPackage']);
+
+    for (var p in _compressOpts) {
+      if (this['need' + p]) {
+        (function (p) {
+          var filename = path.resolve(self.packageDir + '/' + self.packageName() +
+              _compressOpts[p].ext);
+          compressTaskArr.push(filename);
+
+          file(filename, [packageDirPath], function () {
+            var cmd
+              , opts = _compressOpts[p]
+            // Directory to move to when doing the compression-task
+            // Changes in the case of zip for emulating -C option
+              , chdir = self.packageDir
+            // Save the current dir so it's possible to pop back up
+            // after compressing
+              , currDir = process.cwd();
+
+            cmd = self[opts.cmd + 'Command'];
+            cmd += ' -' + opts.flags;
+            if (opts.cmd == 'jar' && self.manifestFile) {
+              cmd += 'm';
+            }
+
+            // The name of the archive to create -- use full path
+            // so compression can be performed from a different dir
+            // if needed
+            cmd += ' ' + filename;
+
+            if (opts.cmd == 'jar' && self.manifestFile) {
+              cmd += ' ' + self.manifestFile;
+            }
+
+            // Where to perform the compression -- -C option isn't
+            // supported in zip, so actually do process.chdir for this
+            if (self.archiveChangeDir) {
+                if (opts.cmd == 'zip') {
+                    chdir = path.join(chdir, self.archiveChangeDir);
+                }
+                else {
+                    cmd += ' -C ' + self.archiveChangeDir;
+                }
+            }
+
+            // Where to stick the archive
+            if (self.archiveContentDir) {
+              cmd += ' ' + self.archiveContentDir;
+            }
+            else {
+              cmd += ' ' + self.packageName();
+            }
+
+            // Move into the desired dir (usually packageDir) to compress
+            // Return back up to the current dir after the exec
+            process.chdir(chdir);
+
+            exec(cmd, function (err, stdout, stderr) {
+              if (err) { throw err; }
+
+              // Return back up to the starting directory (see above,
+              // before exec)
+              process.chdir(currDir);
+
+              complete();
+            });
+          }, {async: true});
+        })(p);
+      }
+    }
+
+    task('buildPackage', compressTaskArr, function () {});
+
+    directory(this.packageDir);
+
+    file(packageDirPath,
+        FileList.clone(this.packageFiles).include(this.packageDir), function () {
+      var fileList = [];
+      self.packageFiles.forEach(function (name) {
+        var f = path.join(self.packageDirPath(), name)
+          , fDir = path.dirname(f)
+          , stats;
+        jake.mkdirP(fDir, {silent: true});
+
+        // Add both files and directories
+        fileList.push({
+          from: name
+        , to: f
+        });
+      });
+      var _copyFile = function () {
+        var cmd
+          , file = fileList.pop()
+          , stat;
+        if (file) {
+          stat = fs.statSync(file.from);
+          // Target is a directory, just create it
+          if (stat.isDirectory()) {
+            jake.mkdirP(file.to, {silent: true});
+            _copyFile();
+          }
+          // Otherwise copy the file
+          else {
+            jake.cpR(file.from, file.to, {silent: true});
+            _copyFile();
+          }
+        }
+        else {
+          complete();
+        }
+      };
+      _copyFile();
+    }, {async: true});
+
+
+  };
+
+  this.packageName = function () {
+    if (this.version) {
+      return this.name + '-' + this.version;
+    }
+    else {
+      return this.name;
+    }
+  };
+
+  this.packageDirPath = function () {
+    return this.packageDir + '/' + this.packageName();
+  };
+
+})();
+
+jake.PackageTask = PackageTask;
+exports.PackageTask = PackageTask;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/parseargs.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/parseargs.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/parseargs.js
new file mode 100644
index 0000000..dd2495b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/parseargs.js
@@ -0,0 +1,134 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var parseargs = {};
+
+/**
+ * @constructor
+ * Parses a list of command-line args into a key/value object of
+ * options and an array of positional commands.
+ * @ param {Array} opts A list of options in the following format:
+ * [{full: 'foo', abbr: 'f'}, {full: 'bar', abbr: 'b'}]]
+ */
+parseargs.Parser = function (opts) {
+  // A key/value object of matching options parsed out of the args
+  this.opts = {};
+  this.taskNames = null;
+  this.envVars = null;
+
+  // Data structures used for parsing
+  this.reg = [];
+  this.shortOpts = {};
+  this.longOpts = {};
+
+  var item;
+  for (var i = 0, ii = opts.length; i < ii; i++) {
+    item = opts[i];
+    this.shortOpts[item.abbr] = item;
+    this.longOpts[item.full] = item;
+  }
+  this.reg = opts;
+};
+
+parseargs.Parser.prototype = new function () {
+
+  var _trueOrNextVal = function (argParts, args) {
+        if (argParts[1]) {
+          return argParts[1];
+        }
+        else {
+          return (!args[0] || (args[0].indexOf('-') == 0)) ?
+              true : args.shift();
+        }
+      };
+
+  /**
+   * Parses an array of arguments into options and positional commands
+   * @param {Array} args The command-line args to parse
+   */
+  this.parse = function (args) {
+    var cmds = []
+      , cmd
+      , envVars = {}
+      , opts = {}
+      , arg
+      , argItem
+      , argParts
+      , cmdItems
+      , taskNames = []
+      , preempt;
+
+    while (args.length) {
+      arg = args.shift();
+
+      if (arg.indexOf('-') == 0) {
+        arg = arg.replace(/^--/, '').replace(/^-/, '');
+        argParts = arg.split('=');
+        argItem = this.longOpts[argParts[0]] || this.shortOpts[argParts[0]];
+        if (argItem) {
+          // First-encountered preemptive opt takes precedence -- no further opts
+          // or possibility of ambiguity, so just look for a value, or set to
+          // true and then bail
+          if (argItem.preempts) {
+            opts[argItem.full] = _trueOrNextVal(argParts, args);
+            preempt = true;
+            break;
+          }
+          // If the opt requires a value, see if we can get a value from the
+          // next arg, or infer true from no-arg -- if it's followed by another
+          // opt, throw an error
+          if (argItem.expectValue) {
+            opts[argItem.full] = _trueOrNextVal(argParts, args);
+            if (!opts[argItem.full]) {
+              throw new Error(argItem.full + ' option expects a value.');
+            }
+          }
+          else {
+            opts[argItem.full] = true;
+          }
+        }
+      }
+      else {
+        cmds.unshift(arg);
+      }
+    }
+
+    if (!preempt) {
+      // Parse out any env-vars and task-name
+      while (!!(cmd = cmds.pop())) {
+        cmdItems = cmd.split('=');
+        if (cmdItems.length > 1) {
+          envVars[cmdItems[0]] = cmdItems[1];
+        }
+        else {
+          taskNames.push(cmd);
+        }
+      }
+
+    }
+
+    return {
+      opts: opts
+    , envVars: envVars
+    , taskNames: taskNames
+    };
+  };
+
+};
+
+module.exports = parseargs;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/program.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/program.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/program.js
new file mode 100644
index 0000000..b64b7b9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/program.js
@@ -0,0 +1,235 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var fs = require('fs')
+  , parseargs = require('./parseargs')
+  , utils = require('./utils')
+  , Program
+  , optsReg
+  , preempts
+  , usage
+  , die;
+
+optsReg = [
+  { full: 'jakefile'
+  , abbr: 'f'
+  , preempts: false
+  , expectValue: true
+  }
+, { full: 'quiet'
+  , abbr: 'q'
+  , preempts: false
+  , expectValue: false
+  }
+, { full: 'directory'
+  , abbr: 'C'
+  , preempts: false
+  , expectValue: true
+  }
+, { full: 'always-make'
+  , abbr: 'B'
+  , preempts: false
+  , expectValue: false
+  }
+, { full: 'tasks'
+  , abbr: 'T'
+  , preempts: true
+  }
+// Alias ls
+, { full: 'tasks'
+  , abbr: 'ls'
+  , preempts: true
+  }
+, { full: 'trace'
+  , abbr: 't'
+  , preempts: false
+  , expectValue: false
+  }
+, { full: 'help'
+  , abbr: 'h'
+  , preempts: true
+  }
+, { full: 'version'
+  , abbr: 'V'
+  , preempts: true
+  }
+  // Alias lowercase v
+, { full: 'version'
+  , abbr: 'v'
+  , preempts: true
+  }
+, { full: 'jakelibdir'
+  , abbr: 'J'
+  , preempts: false
+  , expectValue: true
+  }
+];
+
+preempts = {
+  version: function () {
+    die(jake.version);
+  }
+, help: function () {
+    die(usage);
+  }
+};
+
+usage = ''
+    + 'Jake JavaScript build tool\n'
+    + '********************************************************************************\n'
+    + 'If no flags are given, Jake looks for a Jakefile or Jakefile.js in the current directory.\n'
+    + '********************************************************************************\n'
+    + '{Usage}: jake [options ...] [env variables ...] target\n'
+    + '\n'
+    + '{Options}:\n'
+    + '  -f,     --jakefile FILE            Use FILE as the Jakefile.\n'
+    + '  -C,     --directory DIRECTORY      Change to DIRECTORY before running tasks.\n'
+    + '  -q,     --quiet                    Do not log messages to standard output.\n'
+    + '  -B,     --always-make              Unconditionally make all targets.\n'
+    + '  -T/ls,  --tasks                 Display the tasks (matching optional PATTERN) with descriptions, then exit.\n'
+    + '  -J,     --jakelibdir JAKELIBDIR    Auto-import any .jake files in JAKELIBDIR. (default is \'jakelib\')\n'
+    + '  -t,     --trace                    Enable full backtrace.\n'
+    + '  -h,     --help                     Display this help message.\n'
+    + '  -V/v,   --version                  Display the Jake version.\n'
+    + '';
+
+Program = function () {
+  this.opts = {};
+  this.taskNames = null;
+  this.taskArgs = null;
+  this.envVars = null;
+};
+
+Program.prototype = new (function () {
+
+  this.handleErr = function (err) {
+    var msg;
+    utils.logger.error('jake aborted.');
+    if (this.opts.trace && err.stack) {
+      utils.logger.error(err.stack);
+    }
+    else {
+      if (err.stack) {
+        msg = err.stack.split('\n').slice(0, 2).join('\n');
+        utils.logger.error(msg);
+        utils.logger.error('(See full trace by running task with --trace)');
+      }
+      else {
+        utils.logger.error(err.message);
+      }
+    }
+    process.exit(jake.errorCode || 1);
+  };
+
+  this.parseArgs = function (args) {
+    var result = (new parseargs.Parser(optsReg)).parse(args);
+    this.setOpts(result.opts);
+    this.setTaskNames(result.taskNames);
+    this.setEnvVars(result.envVars);
+  };
+
+  this.setOpts = function (options) {
+    var opts = options || {};
+    utils.mixin(this.opts, opts);
+  };
+
+  this.setTaskNames = function (names) {
+    if (names && !Array.isArray(names)) {
+      throw new Error('Task names must be an array');
+    }
+    this.taskNames = (names && names.length) ? names : ['default'];
+  };
+
+  this.setEnvVars = function (vars) {
+    this.envVars = vars || null;
+  };
+
+  this.firstPreemptiveOption = function () {
+    var opts = this.opts;
+    for (var p in opts) {
+      if (preempts[p]) {
+        return preempts[p];
+      }
+    }
+    return false;
+  };
+
+  this.init = function (configuration) {
+    var self = this
+      , config = configuration || {};
+    if (config.options) {
+      this.setOpts(config.options);
+    }
+    if (config.taskNames) {
+      this.setTaskNames(config.taskNames);
+    }
+    if (config.envVars) {
+      this.setEnvVars(config.envVars);
+    }
+    process.addListener('uncaughtException', function (err) {
+      self.handleErr(err);
+    });
+    if (this.envVars) {
+      utils.mixin(process.env, this.envVars);
+    }
+  };
+
+  this.run = function () {
+    var taskNames
+      , dirname
+      , opts = this.opts;
+
+    // Run with `jake -T`, just show descriptions
+    if (opts.tasks) {
+      return jake.showAllTaskDescriptions(opts.tasks);
+    }
+
+    taskNames = this.taskNames;
+    if (!(Array.isArray(taskNames) && taskNames.length)) {
+      throw new Error('Please pass jake.runTasks an array of task-names');
+    }
+
+    // Set working dir
+    dirname = opts.directory;
+    if (dirname) {
+      if (utils.file.existsSync(dirname) &&
+        fs.statSync(dirname).isDirectory()) {
+        process.chdir(dirname);
+      }
+      else {
+        throw new Error(dirname + ' is not a valid directory path');
+      }
+    }
+
+    task('__root__', taskNames, function () {});
+
+    rootTask = jake.Task['__root__'];
+    rootTask.once('complete', function () {
+      jake.emit('complete');
+    });
+    rootTask.invoke();
+  };
+
+})();
+
+die = function (msg) {
+  console.log(msg);
+  process.exit();
+};
+
+module.exports.Program = Program;


[47/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz
deleted file mode 100644
index a3a9a93..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz
deleted file mode 100644
index eec6524..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz
deleted file mode 100644
index ec4b9a7..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz
deleted file mode 100644
index 2f860b9..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz
deleted file mode 100644
index 1bfce15..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz
deleted file mode 100644
index d7581ea..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz
deleted file mode 100644
index d94fe66..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz
deleted file mode 100644
index c69b725..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz
deleted file mode 100644
index 2f21145..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/te_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz
deleted file mode 100644
index 13b44cc..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz
deleted file mode 100644
index 9a44dfe..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz
deleted file mode 100644
index cfd9252..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz
deleted file mode 100644
index f54579f..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz
deleted file mode 100644
index 27e9cd3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz
deleted file mode 100644
index 246525c..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz
deleted file mode 100644
index f73c575..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz
deleted file mode 100644
index 7a47737..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz
deleted file mode 100644
index 9cdd564..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz
deleted file mode 100644
index ea819e5..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz
deleted file mode 100644
index eeddad9..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz
deleted file mode 100644
index 63130e3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz
deleted file mode 100644
index ced2c42..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz
deleted file mode 100644
index 105e4fa..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png b/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png
deleted file mode 100644
index 29873e9..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/spec.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/spec.html b/lib/cordova-blackberry/bin/templates/project/www/spec.html
deleted file mode 100644
index 71f00de..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/spec.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE html>
-<!--
-    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.
--->
-<html>
-    <head>
-        <title>Jasmine Spec Runner</title>
-
-        <!-- jasmine source -->
-        <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png">
-        <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css">
-        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script>
-        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script>
-
-        <!-- include source files here... -->
-        <script type="text/javascript" src="js/index.js"></script>
-
-        <!-- include spec files here... -->
-        <script type="text/javascript" src="spec/helper.js"></script>
-        <script type="text/javascript" src="spec/index.js"></script>
-
-        <script type="text/javascript">
-            (function() {
-                var jasmineEnv = jasmine.getEnv();
-                jasmineEnv.updateInterval = 1000;
-
-                var htmlReporter = new jasmine.HtmlReporter();
-
-                jasmineEnv.addReporter(htmlReporter);
-
-                jasmineEnv.specFilter = function(spec) {
-                    return htmlReporter.specFilter(spec);
-                };
-
-                var currentWindowOnload = window.onload;
-
-                window.onload = function() {
-                    if (currentWindowOnload) {
-                        currentWindowOnload();
-                    }
-                    execJasmine();
-                };
-
-                function execJasmine() {
-                    jasmineEnv.execute();
-                }
-            })();
-        </script>
-    </head>
-    <body>
-        <div id="stage" style="display:none;"></div>
-    </body>
-</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/spec/helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/spec/helper.js b/lib/cordova-blackberry/bin/templates/project/www/spec/helper.js
deleted file mode 100644
index 929f776..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/spec/helper.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-afterEach(function() {
-    document.getElementById('stage').innerHTML = '';
-});
-
-var helper = {
-    trigger: function(obj, name) {
-        var e = document.createEvent('Event');
-        e.initEvent(name, true, true);
-        obj.dispatchEvent(e);
-    },
-    getComputedStyle: function(querySelector, property) {
-        var element = document.querySelector(querySelector);
-        return window.getComputedStyle(element).getPropertyValue(property);
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/spec/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/spec/index.js b/lib/cordova-blackberry/bin/templates/project/www/spec/index.js
deleted file mode 100644
index 20f8be5..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/spec/index.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.
- */
-describe('app', function() {
-    describe('initialize', function() {
-        it('should bind deviceready', function() {
-            runs(function() {
-                spyOn(app, 'onDeviceReady');
-                app.initialize();
-                helper.trigger(window.document, 'deviceready');
-            });
-
-            waitsFor(function() {
-                return (app.onDeviceReady.calls.length > 0);
-            }, 'onDeviceReady should be called once', 500);
-
-            runs(function() {
-                expect(app.onDeviceReady).toHaveBeenCalled();
-            });
-        });
-    });
-
-    describe('onDeviceReady', function() {
-        it('should report that it fired', function() {
-            spyOn(app, 'receivedEvent');
-            app.onDeviceReady();
-            expect(app.receivedEvent).toHaveBeenCalledWith('deviceready');
-        });
-    });
-
-    describe('receivedEvent', function() {
-        beforeEach(function() {
-            var el = document.getElementById('stage');
-            el.innerHTML = ['<div id="deviceready">',
-                            '    <p class="event listening">Listening</p>',
-                            '    <p class="event received">Received</p>',
-                            '</div>'].join('\n');
-        });
-
-        it('should hide the listening element', function() {
-            app.receivedEvent('deviceready');
-            var displayStyle = helper.getComputedStyle('#deviceready .listening', 'display');
-            expect(displayStyle).toEqual('none');
-        });
-
-        it('should show the received element', function() {
-            app.receivedEvent('deviceready');
-            var displayStyle = helper.getComputedStyle('#deviceready .received', 'display');
-            expect(displayStyle).toEqual('block');
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE b/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
deleted file mode 100644
index 7c435ba..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2008-2011 Pivotal Labs
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js b/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
deleted file mode 100644
index a0b0639..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
+++ /dev/null
@@ -1,616 +0,0 @@
-jasmine.HtmlReporterHelpers = {};
-
-jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
-  var el = document.createElement(type);
-
-  for (var i = 2; i < arguments.length; i++) {
-    var child = arguments[i];
-
-    if (typeof child === 'string') {
-      el.appendChild(document.createTextNode(child));
-    } else {
-      if (child) {
-        el.appendChild(child);
-      }
-    }
-  }
-
-  for (var attr in attrs) {
-    if (attr == "className") {
-      el[attr] = attrs[attr];
-    } else {
-      el.setAttribute(attr, attrs[attr]);
-    }
-  }
-
-  return el;
-};
-
-jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
-  var results = child.results();
-  var status = results.passed() ? 'passed' : 'failed';
-  if (results.skipped) {
-    status = 'skipped';
-  }
-
-  return status;
-};
-
-jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
-  var parentDiv = this.dom.summary;
-  var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
-  var parent = child[parentSuite];
-
-  if (parent) {
-    if (typeof this.views.suites[parent.id] == 'undefined') {
-      this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
-    }
-    parentDiv = this.views.suites[parent.id].element;
-  }
-
-  parentDiv.appendChild(childElement);
-};
-
-
-jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
-  for(var fn in jasmine.HtmlReporterHelpers) {
-    ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
-  }
-};
-
-jasmine.HtmlReporter = function(_doc) {
-  var self = this;
-  var doc = _doc || window.document;
-
-  var reporterView;
-
-  var dom = {};
-
-  // Jasmine Reporter Public Interface
-  self.logRunningSpecs = false;
-
-  self.reportRunnerStarting = function(runner) {
-    var specs = runner.specs() || [];
-
-    if (specs.length == 0) {
-      return;
-    }
-
-    createReporterDom(runner.env.versionString());
-    doc.body.appendChild(dom.reporter);
-
-    reporterView = new jasmine.HtmlReporter.ReporterView(dom);
-    reporterView.addSpecs(specs, self.specFilter);
-  };
-
-  self.reportRunnerResults = function(runner) {
-    reporterView && reporterView.complete();
-  };
-
-  self.reportSuiteResults = function(suite) {
-    reporterView.suiteComplete(suite);
-  };
-
-  self.reportSpecStarting = function(spec) {
-    if (self.logRunningSpecs) {
-      self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
-    }
-  };
-
-  self.reportSpecResults = function(spec) {
-    reporterView.specComplete(spec);
-  };
-
-  self.log = function() {
-    var console = jasmine.getGlobal().console;
-    if (console && console.log) {
-      if (console.log.apply) {
-        console.log.apply(console, arguments);
-      } else {
-        console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
-      }
-    }
-  };
-
-  self.specFilter = function(spec) {
-    if (!focusedSpecName()) {
-      return true;
-    }
-
-    return spec.getFullName().indexOf(focusedSpecName()) === 0;
-  };
-
-  return self;
-
-  function focusedSpecName() {
-    var specName;
-
-    (function memoizeFocusedSpec() {
-      if (specName) {
-        return;
-      }
-
-      var paramMap = [];
-      var params = doc.location.search.substring(1).split('&');
-
-      for (var i = 0; i < params.length; i++) {
-        var p = params[i].split('=');
-        paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
-      }
-
-      specName = paramMap.spec;
-    })();
-
-    return specName;
-  }
-
-  function createReporterDom(version) {
-    dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
-      dom.banner = self.createDom('div', { className: 'banner' },
-        self.createDom('span', { className: 'title' }, "Jasmine "),
-        self.createDom('span', { className: 'version' }, version)),
-
-      dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
-      dom.alert = self.createDom('div', {className: 'alert'}),
-      dom.results = self.createDom('div', {className: 'results'},
-        dom.summary = self.createDom('div', { className: 'summary' }),
-        dom.details = self.createDom('div', { id: 'details' }))
-    );
-  }
-};
-jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
-  this.startedAt = new Date();
-  this.runningSpecCount = 0;
-  this.completeSpecCount = 0;
-  this.passedCount = 0;
-  this.failedCount = 0;
-  this.skippedCount = 0;
-
-  this.createResultsMenu = function() {
-    this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
-      this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
-      ' | ',
-      this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
-
-    this.summaryMenuItem.onclick = function() {
-      dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
-    };
-
-    this.detailsMenuItem.onclick = function() {
-      showDetails();
-    };
-  };
-
-  this.addSpecs = function(specs, specFilter) {
-    this.totalSpecCount = specs.length;
-
-    this.views = {
-      specs: {},
-      suites: {}
-    };
-
-    for (var i = 0; i < specs.length; i++) {
-      var spec = specs[i];
-      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
-      if (specFilter(spec)) {
-        this.runningSpecCount++;
-      }
-    }
-  };
-
-  this.specComplete = function(spec) {
-    this.completeSpecCount++;
-
-    if (isUndefined(this.views.specs[spec.id])) {
-      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
-    }
-
-    var specView = this.views.specs[spec.id];
-
-    switch (specView.status()) {
-      case 'passed':
-        this.passedCount++;
-        break;
-
-      case 'failed':
-        this.failedCount++;
-        break;
-
-      case 'skipped':
-        this.skippedCount++;
-        break;
-    }
-
-    specView.refresh();
-    this.refresh();
-  };
-
-  this.suiteComplete = function(suite) {
-    var suiteView = this.views.suites[suite.id];
-    if (isUndefined(suiteView)) {
-      return;
-    }
-    suiteView.refresh();
-  };
-
-  this.refresh = function() {
-
-    if (isUndefined(this.resultsMenu)) {
-      this.createResultsMenu();
-    }
-
-    // currently running UI
-    if (isUndefined(this.runningAlert)) {
-      this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
-      dom.alert.appendChild(this.runningAlert);
-    }
-    this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
-
-    // skipped specs UI
-    if (isUndefined(this.skippedAlert)) {
-      this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
-    }
-
-    this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
-
-    if (this.skippedCount === 1 && isDefined(dom.alert)) {
-      dom.alert.appendChild(this.skippedAlert);
-    }
-
-    // passing specs UI
-    if (isUndefined(this.passedAlert)) {
-      this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
-    }
-    this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
-
-    // failing specs UI
-    if (isUndefined(this.failedAlert)) {
-      this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
-    }
-    this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
-
-    if (this.failedCount === 1 && isDefined(dom.alert)) {
-      dom.alert.appendChild(this.failedAlert);
-      dom.alert.appendChild(this.resultsMenu);
-    }
-
-    // summary info
-    this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
-    this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
-  };
-
-  this.complete = function() {
-    dom.alert.removeChild(this.runningAlert);
-
-    this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
-
-    if (this.failedCount === 0) {
-      dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
-    } else {
-      showDetails();
-    }
-
-    dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
-  };
-
-  return this;
-
-  function showDetails() {
-    if (dom.reporter.className.search(/showDetails/) === -1) {
-      dom.reporter.className += " showDetails";
-    }
-  }
-
-  function isUndefined(obj) {
-    return typeof obj === 'undefined';
-  }
-
-  function isDefined(obj) {
-    return !isUndefined(obj);
-  }
-
-  function specPluralizedFor(count) {
-    var str = count + " spec";
-    if (count > 1) {
-      str += "s"
-    }
-    return str;
-  }
-
-};
-
-jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
-
-
-jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
-  this.spec = spec;
-  this.dom = dom;
-  this.views = views;
-
-  this.symbol = this.createDom('li', { className: 'pending' });
-  this.dom.symbolSummary.appendChild(this.symbol);
-
-  this.summary = this.createDom('div', { className: 'specSummary' },
-      this.createDom('a', {
-        className: 'description',
-        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
-        title: this.spec.getFullName()
-      }, this.spec.description)
-  );
-
-  this.detail = this.createDom('div', { className: 'specDetail' },
-      this.createDom('a', {
-        className: 'description',
-        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
-        title: this.spec.getFullName()
-      }, this.spec.getFullName())
-  );
-};
-
-jasmine.HtmlReporter.SpecView.prototype.status = function() {
-  return this.getSpecStatus(this.spec);
-};
-
-jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
-  this.symbol.className = this.status();
-
-  switch (this.status()) {
-    case 'skipped':
-      break;
-
-    case 'passed':
-      this.appendSummaryToSuiteDiv();
-      break;
-
-    case 'failed':
-      this.appendSummaryToSuiteDiv();
-      this.appendFailureDetail();
-      break;
-  }
-};
-
-jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
-  this.summary.className += ' ' + this.status();
-  this.appendToSummary(this.spec, this.summary);
-};
-
-jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
-  this.detail.className += ' ' + this.status();
-
-  var resultItems = this.spec.results().getItems();
-  var messagesDiv = this.createDom('div', { className: 'messages' });
-
-  for (var i = 0; i < resultItems.length; i++) {
-    var result = resultItems[i];
-
-    if (result.type == 'log') {
-      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
-    } else if (result.type == 'expect' && result.passed && !result.passed()) {
-      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
-
-      if (result.trace.stack) {
-        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
-      }
-    }
-  }
-
-  if (messagesDiv.childNodes.length > 0) {
-    this.detail.appendChild(messagesDiv);
-    this.dom.details.appendChild(this.detail);
-  }
-};
-
-jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
-  this.suite = suite;
-  this.dom = dom;
-  this.views = views;
-
-  this.element = this.createDom('div', { className: 'suite' },
-      this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
-  );
-
-  this.appendToSummary(this.suite, this.element);
-};
-
-jasmine.HtmlReporter.SuiteView.prototype.status = function() {
-  return this.getSpecStatus(this.suite);
-};
-
-jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
-  this.element.className += " " + this.status();
-};
-
-jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
-
-/* @deprecated Use jasmine.HtmlReporter instead
- */
-jasmine.TrivialReporter = function(doc) {
-  this.document = doc || document;
-  this.suiteDivs = {};
-  this.logRunningSpecs = false;
-};
-
-jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
-  var el = document.createElement(type);
-
-  for (var i = 2; i < arguments.length; i++) {
-    var child = arguments[i];
-
-    if (typeof child === 'string') {
-      el.appendChild(document.createTextNode(child));
-    } else {
-      if (child) { el.appendChild(child); }
-    }
-  }
-
-  for (var attr in attrs) {
-    if (attr == "className") {
-      el[attr] = attrs[attr];
-    } else {
-      el.setAttribute(attr, attrs[attr]);
-    }
-  }
-
-  return el;
-};
-
-jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
-  var showPassed, showSkipped;
-
-  this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
-      this.createDom('div', { className: 'banner' },
-        this.createDom('div', { className: 'logo' },
-            this.createDom('span', { className: 'title' }, "Jasmine"),
-            this.createDom('span', { className: 'version' }, runner.env.versionString())),
-        this.createDom('div', { className: 'options' },
-            "Show ",
-            showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
-            this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
-            showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
-            this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
-            )
-          ),
-
-      this.runnerDiv = this.createDom('div', { className: 'runner running' },
-          this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
-          this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
-          this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
-      );
-
-  this.document.body.appendChild(this.outerDiv);
-
-  var suites = runner.suites();
-  for (var i = 0; i < suites.length; i++) {
-    var suite = suites[i];
-    var suiteDiv = this.createDom('div', { className: 'suite' },
-        this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
-        this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
-    this.suiteDivs[suite.id] = suiteDiv;
-    var parentDiv = this.outerDiv;
-    if (suite.parentSuite) {
-      parentDiv = this.suiteDivs[suite.parentSuite.id];
-    }
-    parentDiv.appendChild(suiteDiv);
-  }
-
-  this.startedAt = new Date();
-
-  var self = this;
-  showPassed.onclick = function(evt) {
-    if (showPassed.checked) {
-      self.outerDiv.className += ' show-passed';
-    } else {
-      self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
-    }
-  };
-
-  showSkipped.onclick = function(evt) {
-    if (showSkipped.checked) {
-      self.outerDiv.className += ' show-skipped';
-    } else {
-      self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
-    }
-  };
-};
-
-jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
-  var results = runner.results();
-  var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
-  this.runnerDiv.setAttribute("class", className);
-  //do it twice for IE
-  this.runnerDiv.setAttribute("className", className);
-  var specs = runner.specs();
-  var specCount = 0;
-  for (var i = 0; i < specs.length; i++) {
-    if (this.specFilter(specs[i])) {
-      specCount++;
-    }
-  }
-  var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
-  message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
-  this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
-
-  this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
-};
-
-jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
-  var results = suite.results();
-  var status = results.passed() ? 'passed' : 'failed';
-  if (results.totalCount === 0) { // todo: change this to check results.skipped
-    status = 'skipped';
-  }
-  this.suiteDivs[suite.id].className += " " + status;
-};
-
-jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
-  if (this.logRunningSpecs) {
-    this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
-  }
-};
-
-jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
-  var results = spec.results();
-  var status = results.passed() ? 'passed' : 'failed';
-  if (results.skipped) {
-    status = 'skipped';
-  }
-  var specDiv = this.createDom('div', { className: 'spec '  + status },
-      this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
-      this.createDom('a', {
-        className: 'description',
-        href: '?spec=' + encodeURIComponent(spec.getFullName()),
-        title: spec.getFullName()
-      }, spec.description));
-
-
-  var resultItems = results.getItems();
-  var messagesDiv = this.createDom('div', { className: 'messages' });
-  for (var i = 0; i < resultItems.length; i++) {
-    var result = resultItems[i];
-
-    if (result.type == 'log') {
-      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
-    } else if (result.type == 'expect' && result.passed && !result.passed()) {
-      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
-
-      if (result.trace.stack) {
-        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
-      }
-    }
-  }
-
-  if (messagesDiv.childNodes.length > 0) {
-    specDiv.appendChild(messagesDiv);
-  }
-
-  this.suiteDivs[spec.suite.id].appendChild(specDiv);
-};
-
-jasmine.TrivialReporter.prototype.log = function() {
-  var console = jasmine.getGlobal().console;
-  if (console && console.log) {
-    if (console.log.apply) {
-      console.log.apply(console, arguments);
-    } else {
-      console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
-    }
-  }
-};
-
-jasmine.TrivialReporter.prototype.getLocation = function() {
-  return this.document.location;
-};
-
-jasmine.TrivialReporter.prototype.specFilter = function(spec) {
-  var paramMap = {};
-  var params = this.getLocation().search.substring(1).split('&');
-  for (var i = 0; i < params.length; i++) {
-    var p = params[i].split('=');
-    paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
-  }
-
-  if (!paramMap.spec) {
-    return true;
-  }
-  return spec.getFullName().indexOf(paramMap.spec) === 0;
-};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css b/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
deleted file mode 100644
index 826e575..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
+++ /dev/null
@@ -1,81 +0,0 @@
-body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
-
-#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
-#HTMLReporter a { text-decoration: none; }
-#HTMLReporter a:hover { text-decoration: underline; }
-#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
-#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
-#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
-#HTMLReporter .version { color: #aaaaaa; }
-#HTMLReporter .banner { margin-top: 14px; }
-#HTMLReporter .duration { color: #aaaaaa; float: right; }
-#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
-#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
-#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
-#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
-#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
-#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
-#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
-#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
-#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
-#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
-#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
-#HTMLReporter .runningAlert { background-color: #666666; }
-#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
-#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
-#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
-#HTMLReporter .passingAlert { background-color: #a6b779; }
-#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
-#HTMLReporter .failingAlert { background-color: #cf867e; }
-#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
-#HTMLReporter .results { margin-top: 14px; }
-#HTMLReporter #details { display: none; }
-#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
-#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
-#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
-#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
-#HTMLReporter.showDetails .summary { display: none; }
-#HTMLReporter.showDetails #details { display: block; }
-#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
-#HTMLReporter .summary { margin-top: 14px; }
-#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
-#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
-#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
-#HTMLReporter .description + .suite { margin-top: 0; }
-#HTMLReporter .suite { margin-top: 14px; }
-#HTMLReporter .suite a { color: #333333; }
-#HTMLReporter #details .specDetail { margin-bottom: 28px; }
-#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
-#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
-#HTMLReporter .resultMessage span.result { display: block; }
-#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
-
-#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
-#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
-#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
-#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
-#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
-#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
-#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
-#TrivialReporter .runner.running { background-color: yellow; }
-#TrivialReporter .options { text-align: right; font-size: .8em; }
-#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
-#TrivialReporter .suite .suite { margin: 5px; }
-#TrivialReporter .suite.passed { background-color: #dfd; }
-#TrivialReporter .suite.failed { background-color: #fdd; }
-#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
-#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
-#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
-#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
-#TrivialReporter .spec.skipped { background-color: #bbb; }
-#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
-#TrivialReporter .passed { background-color: #cfc; display: none; }
-#TrivialReporter .failed { background-color: #fbb; }
-#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
-#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
-#TrivialReporter .resultMessage .mismatch { color: black; }
-#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
-#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
-#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
-#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
-#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }


[51/51] [partial] git commit: [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
[BlackBerry10] Added support for new platform

- Renamed from 'blackberry' to 'blackberry10'
- Update parser to use bin/check_reqs


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

Branch: refs/heads/future-bb10
Commit: 6831bed4f3459055efd6d72a881aebfb4129764a
Parents: 67d94ca
Author: Rosa Tse <rt...@rim.com>
Authored: Mon Feb 25 11:36:33 2013 -0500
Committer: Jeffrey Heifetz <jh...@blackberry.com>
Committed: Tue Apr 23 14:30:11 2013 -0400

----------------------------------------------------------------------
 bootstrap.js                                       |   28 +-
 lib/cordova-blackberry/.gitignore                  |   27 +
 lib/cordova-blackberry/LICENSE                     |  268 -
 lib/cordova-blackberry/NOTICE                      |    8 -
 lib/cordova-blackberry/README.md                   |  184 +-
 lib/cordova-blackberry/VERSION                     |    1 -
 lib/cordova-blackberry/bin/create                  |  104 -
 lib/cordova-blackberry/bin/create.bat              |   33 -
 lib/cordova-blackberry/bin/create.js               |  129 -
 .../bin/templates/dist/README.md                   |   90 -
 .../bin/templates/project/blackberry.xml           |  456 -
 .../bin/templates/project/build.xml                |  160 -
 .../bin/templates/project/cordova/build            |   34 -
 .../bin/templates/project/cordova/run              |   41 -
 .../project/lib/ant-contrib/ant-contrib-1.0b3.jar  |  Bin 224277 -> 0 bytes
 .../bin/templates/project/playbook.xml             |  338 -
 .../bin/templates/project/project.properties       |  137 -
 .../bin/templates/project/qnx.xml                  |  336 -
 .../bin/templates/project/www/LICENSE              |  296 -
 .../bin/templates/project/www/NOTICE               |    8 -
 .../bin/templates/project/www/README.md            |   30 -
 .../bin/templates/project/www/VERSION              |    1 -
 .../bin/templates/project/www/config.xml           |   96 -
 .../bin/templates/project/www/css/index.css        |  115 -
 .../bin/templates/project/www/img/logo.png         |  Bin 21814 -> 0 bytes
 .../bin/templates/project/www/index.html           |   42 -
 .../bin/templates/project/www/js/index.js          |   49 -
 .../bin/templates/project/www/json2.js             |  482 -
 .../bin/templates/project/www/plugins.xml          |   35 -
 .../project/www/res/icon/blackberry/icon-80.png    |  Bin 7287 -> 0 bytes
 .../project/www/res/resourceBundles/ar.js.gz       |  Bin 708 -> 0 bytes
 .../project/www/res/resourceBundles/ar_AE.js.gz    |  Bin 745 -> 0 bytes
 .../project/www/res/resourceBundles/ar_BH.js.gz    |  Bin 738 -> 0 bytes
 .../project/www/res/resourceBundles/ar_DZ.js.gz    |  Bin 737 -> 0 bytes
 .../project/www/res/resourceBundles/ar_EG.js.gz    |  Bin 735 -> 0 bytes
 .../project/www/res/resourceBundles/ar_IQ.js.gz    |  Bin 736 -> 0 bytes
 .../project/www/res/resourceBundles/ar_JO.js.gz    |  Bin 736 -> 0 bytes
 .../project/www/res/resourceBundles/ar_KW.js.gz    |  Bin 738 -> 0 bytes
 .../project/www/res/resourceBundles/ar_LB.js.gz    |  Bin 735 -> 0 bytes
 .../project/www/res/resourceBundles/ar_LY.js.gz    |  Bin 736 -> 0 bytes
 .../project/www/res/resourceBundles/ar_MA.js.gz    |  Bin 738 -> 0 bytes
 .../project/www/res/resourceBundles/ar_OM.js.gz    |  Bin 736 -> 0 bytes
 .../project/www/res/resourceBundles/ar_QA.js.gz    |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/ar_SA.js.gz    |  Bin 704 -> 0 bytes
 .../project/www/res/resourceBundles/ar_SD.js.gz    |  Bin 737 -> 0 bytes
 .../project/www/res/resourceBundles/ar_SY.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/ar_TN.js.gz    |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/ar_YE.js.gz    |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/be.js.gz       |  Bin 703 -> 0 bytes
 .../project/www/res/resourceBundles/be_BY.js.gz    |  Bin 686 -> 0 bytes
 .../project/www/res/resourceBundles/bg.js.gz       |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/bg_BG.js.gz    |  Bin 688 -> 0 bytes
 .../project/www/res/resourceBundles/bn_IN.js.gz    |  Bin 767 -> 0 bytes
 .../project/www/res/resourceBundles/ca.js.gz       |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/ca_ES.js.gz    |  Bin 678 -> 0 bytes
 .../www/res/resourceBundles/ca_ES_PREEURO.js.gz    |  Bin 696 -> 0 bytes
 .../project/www/res/resourceBundles/cs.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/cs_CZ.js.gz    |  Bin 687 -> 0 bytes
 .../www/res/resourceBundles/cs_CZ_EURO.js.gz       |  Bin 702 -> 0 bytes
 .../www/res/resourceBundles/cs_CZ_PREEURO.js.gz    |  Bin 706 -> 0 bytes
 .../project/www/res/resourceBundles/da.js.gz       |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/da_DK.js.gz    |  Bin 717 -> 0 bytes
 .../www/res/resourceBundles/da_DK_EURO.js.gz       |  Bin 731 -> 0 bytes
 .../project/www/res/resourceBundles/de.js.gz       |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/de_AT.js.gz    |  Bin 719 -> 0 bytes
 .../www/res/resourceBundles/de_AT_PREEURO.js.gz    |  Bin 737 -> 0 bytes
 .../project/www/res/resourceBundles/de_CH.js.gz    |  Bin 723 -> 0 bytes
 .../project/www/res/resourceBundles/de_DE.js.gz    |  Bin 678 -> 0 bytes
 .../www/res/resourceBundles/de_DE_PREEURO.js.gz    |  Bin 696 -> 0 bytes
 .../project/www/res/resourceBundles/de_LU.js.gz    |  Bin 682 -> 0 bytes
 .../www/res/resourceBundles/de_LU_PREEURO.js.gz    |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/el.js.gz       |  Bin 696 -> 0 bytes
 .../project/www/res/resourceBundles/el_CY.js.gz    |  Bin 712 -> 0 bytes
 .../www/res/resourceBundles/el_CY_EURO.js.gz       |  Bin 726 -> 0 bytes
 .../www/res/resourceBundles/el_CY_PREEURO.js.gz    |  Bin 730 -> 0 bytes
 .../project/www/res/resourceBundles/el_GR.js.gz    |  Bin 690 -> 0 bytes
 .../www/res/resourceBundles/el_GR_PREEURO.js.gz    |  Bin 708 -> 0 bytes
 .../project/www/res/resourceBundles/en.js.gz       |  Bin 670 -> 0 bytes
 .../project/www/res/resourceBundles/en_AU.js.gz    |  Bin 689 -> 0 bytes
 .../project/www/res/resourceBundles/en_BE.js.gz    |  Bin 680 -> 0 bytes
 .../www/res/resourceBundles/en_BE_PREEURO.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/en_CA.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/en_GB.js.gz    |  Bin 692 -> 0 bytes
 .../www/res/resourceBundles/en_GB_EURO.js.gz       |  Bin 706 -> 0 bytes
 .../project/www/res/resourceBundles/en_HK.js.gz    |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/en_IE.js.gz    |  Bin 692 -> 0 bytes
 .../www/res/resourceBundles/en_IE_PREEURO.js.gz    |  Bin 710 -> 0 bytes
 .../project/www/res/resourceBundles/en_IN.js.gz    |  Bin 762 -> 0 bytes
 .../project/www/res/resourceBundles/en_MT.js.gz    |  Bin 686 -> 0 bytes
 .../project/www/res/resourceBundles/en_NZ.js.gz    |  Bin 691 -> 0 bytes
 .../project/www/res/resourceBundles/en_PH.js.gz    |  Bin 703 -> 0 bytes
 .../project/www/res/resourceBundles/en_SG.js.gz    |  Bin 688 -> 0 bytes
 .../project/www/res/resourceBundles/en_US.js.gz    |  Bin 705 -> 0 bytes
 .../project/www/res/resourceBundles/en_ZA.js.gz    |  Bin 692 -> 0 bytes
 .../project/www/res/resourceBundles/es.js.gz       |  Bin 681 -> 0 bytes
 .../project/www/res/resourceBundles/es_AR.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/es_BO.js.gz    |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/es_CL.js.gz    |  Bin 696 -> 0 bytes
 .../project/www/res/resourceBundles/es_CO.js.gz    |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/es_CR.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/es_DO.js.gz    |  Bin 708 -> 0 bytes
 .../project/www/res/resourceBundles/es_EC.js.gz    |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/es_ES.js.gz    |  Bin 679 -> 0 bytes
 .../www/res/resourceBundles/es_ES_PREEURO.js.gz    |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/es_GT.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/es_HN.js.gz    |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/es_MX.js.gz    |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/es_NI.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/es_PA.js.gz    |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/es_PE.js.gz    |  Bin 695 -> 0 bytes
 .../project/www/res/resourceBundles/es_PR.js.gz    |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/es_PY.js.gz    |  Bin 720 -> 0 bytes
 .../project/www/res/resourceBundles/es_SV.js.gz    |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/es_US.js.gz    |  Bin 707 -> 0 bytes
 .../project/www/res/resourceBundles/es_UY.js.gz    |  Bin 721 -> 0 bytes
 .../project/www/res/resourceBundles/es_VE.js.gz    |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/et.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/et_EE.js.gz    |  Bin 677 -> 0 bytes
 .../www/res/resourceBundles/et_EE_EURO.js.gz       |  Bin 691 -> 0 bytes
 .../www/res/resourceBundles/et_EE_PREEURO.js.gz    |  Bin 695 -> 0 bytes
 .../project/www/res/resourceBundles/fi.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/fi_FI.js.gz    |  Bin 685 -> 0 bytes
 .../www/res/resourceBundles/fi_FI_PREEURO.js.gz    |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/fr.js.gz       |  Bin 661 -> 0 bytes
 .../project/www/res/resourceBundles/fr_BE.js.gz    |  Bin 679 -> 0 bytes
 .../www/res/resourceBundles/fr_BE_PREEURO.js.gz    |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/fr_CA.js.gz    |  Bin 696 -> 0 bytes
 .../project/www/res/resourceBundles/fr_CH.js.gz    |  Bin 723 -> 0 bytes
 .../project/www/res/resourceBundles/fr_FR.js.gz    |  Bin 682 -> 0 bytes
 .../www/res/resourceBundles/fr_FR_PREEURO.js.gz    |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/fr_LU.js.gz    |  Bin 682 -> 0 bytes
 .../www/res/resourceBundles/fr_LU_PREEURO.js.gz    |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/ga.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/ga_IE.js.gz    |  Bin 691 -> 0 bytes
 .../project/www/res/resourceBundles/gu.js.gz       |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/gu_IN.js.gz    |  Bin 763 -> 0 bytes
 .../project/www/res/resourceBundles/hi_IN.js.gz    |  Bin 759 -> 0 bytes
 .../project/www/res/resourceBundles/hr.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/hr_HR.js.gz    |  Bin 712 -> 0 bytes
 .../project/www/res/resourceBundles/hu.js.gz       |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/hu_HU.js.gz    |  Bin 680 -> 0 bytes
 .../www/res/resourceBundles/hu_HU_EURO.js.gz       |  Bin 694 -> 0 bytes
 .../www/res/resourceBundles/hu_HU_PREEURO.js.gz    |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/in.js.gz       |  Bin 669 -> 0 bytes
 .../project/www/res/resourceBundles/in_ID.js.gz    |  Bin 684 -> 0 bytes
 .../project/www/res/resourceBundles/is.js.gz       |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/is_IS.js.gz    |  Bin 679 -> 0 bytes
 .../project/www/res/resourceBundles/it.js.gz       |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/it_CH.js.gz    |  Bin 723 -> 0 bytes
 .../project/www/res/resourceBundles/it_IT.js.gz    |  Bin 717 -> 0 bytes
 .../www/res/resourceBundles/it_IT_PREEURO.js.gz    |  Bin 734 -> 0 bytes
 .../project/www/res/resourceBundles/iw.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/iw_IL.js.gz    |  Bin 683 -> 0 bytes
 .../project/www/res/resourceBundles/ja.js.gz       |  Bin 703 -> 0 bytes
 .../project/www/res/resourceBundles/ja_JP.js.gz    |  Bin 692 -> 0 bytes
 .../project/www/res/resourceBundles/ja_JP_JP.js.gz |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/kk.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/kk_KZ.js.gz    |  Bin 711 -> 0 bytes
 .../project/www/res/resourceBundles/kn.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/kn_IN.js.gz    |  Bin 761 -> 0 bytes
 .../project/www/res/resourceBundles/ko.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/ko_KR.js.gz    |  Bin 695 -> 0 bytes
 .../project/www/res/resourceBundles/lt.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/lt_LT.js.gz    |  Bin 676 -> 0 bytes
 .../www/res/resourceBundles/lt_LT_EURO.js.gz       |  Bin 690 -> 0 bytes
 .../www/res/resourceBundles/lt_LT_PREEURO.js.gz    |  Bin 694 -> 0 bytes
 .../project/www/res/resourceBundles/lv.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/lv_LV.js.gz    |  Bin 677 -> 0 bytes
 .../www/res/resourceBundles/lv_LV_EURO.js.gz       |  Bin 691 -> 0 bytes
 .../www/res/resourceBundles/lv_LV_PREEURO.js.gz    |  Bin 695 -> 0 bytes
 .../project/www/res/resourceBundles/mk.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/mk_MK.js.gz    |  Bin 720 -> 0 bytes
 .../project/www/res/resourceBundles/ml_IN.js.gz    |  Bin 762 -> 0 bytes
 .../project/www/res/resourceBundles/mr.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/mr_IN.js.gz    |  Bin 761 -> 0 bytes
 .../project/www/res/resourceBundles/ms.js.gz       |  Bin 696 -> 0 bytes
 .../project/www/res/resourceBundles/ms_MY.js.gz    |  Bin 694 -> 0 bytes
 .../project/www/res/resourceBundles/mt.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/mt_MT.js.gz    |  Bin 685 -> 0 bytes
 .../www/res/resourceBundles/mt_MT_EURO.js.gz       |  Bin 699 -> 0 bytes
 .../www/res/resourceBundles/mt_MT_PREEURO.js.gz    |  Bin 703 -> 0 bytes
 .../project/www/res/resourceBundles/nb_NO.js.gz    |  Bin 688 -> 0 bytes
 .../project/www/res/resourceBundles/nl.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/nl_BE.js.gz    |  Bin 679 -> 0 bytes
 .../www/res/resourceBundles/nl_BE_PREEURO.js.gz    |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/nl_NL.js.gz    |  Bin 724 -> 0 bytes
 .../www/res/resourceBundles/nl_NL_PREEURO.js.gz    |  Bin 741 -> 0 bytes
 .../project/www/res/resourceBundles/no.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/no_NO.js.gz    |  Bin 680 -> 0 bytes
 .../project/www/res/resourceBundles/no_NO_NY.js.gz |  Bin 692 -> 0 bytes
 .../project/www/res/resourceBundles/or_IN.js.gz    |  Bin 761 -> 0 bytes
 .../project/www/res/resourceBundles/pa.js.gz       |  Bin 737 -> 0 bytes
 .../project/www/res/resourceBundles/pa_IN.js.gz    |  Bin 753 -> 0 bytes
 .../project/www/res/resourceBundles/pl.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/pl_PL.js.gz    |  Bin 683 -> 0 bytes
 .../www/res/resourceBundles/pl_PL_EURO.js.gz       |  Bin 697 -> 0 bytes
 .../www/res/resourceBundles/pl_PL_PREEURO.js.gz    |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/pt.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/pt_BR.js.gz    |  Bin 717 -> 0 bytes
 .../project/www/res/resourceBundles/pt_PT.js.gz    |  Bin 681 -> 0 bytes
 .../www/res/resourceBundles/pt_PT_PREEURO.js.gz    |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/ro.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/ro_RO.js.gz    |  Bin 675 -> 0 bytes
 .../project/www/res/resourceBundles/ru.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/ru_RU.js.gz    |  Bin 689 -> 0 bytes
 .../project/www/res/resourceBundles/sh.js.gz       |  Bin 691 -> 0 bytes
 .../project/www/res/resourceBundles/sh_CS.js.gz    |  Bin 725 -> 0 bytes
 .../project/www/res/resourceBundles/sk.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/sk_SK.js.gz    |  Bin 679 -> 0 bytes
 .../www/res/resourceBundles/sk_SK_EURO.js.gz       |  Bin 693 -> 0 bytes
 .../www/res/resourceBundles/sk_SK_PREEURO.js.gz    |  Bin 696 -> 0 bytes
 .../project/www/res/resourceBundles/sl.js.gz       |  Bin 700 -> 0 bytes
 .../project/www/res/resourceBundles/sl_SI.js.gz    |  Bin 676 -> 0 bytes
 .../www/res/resourceBundles/sl_SI_PREEURO.js.gz    |  Bin 693 -> 0 bytes
 .../project/www/res/resourceBundles/sq.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/sq_AL.js.gz    |  Bin 684 -> 0 bytes
 .../project/www/res/resourceBundles/sr.js.gz       |  Bin 698 -> 0 bytes
 .../project/www/res/resourceBundles/sr_BA.js.gz    |  Bin 727 -> 0 bytes
 .../project/www/res/resourceBundles/sr_CS.js.gz    |  Bin 727 -> 0 bytes
 .../project/www/res/resourceBundles/sr_ME.js.gz    |  Bin 716 -> 0 bytes
 .../project/www/res/resourceBundles/sr_RS.js.gz    |  Bin 712 -> 0 bytes
 .../www/res/resourceBundles/sr_RS_Cyrl.js.gz       |  Bin 727 -> 0 bytes
 .../www/res/resourceBundles/sr_RS_Latn.js.gz       |  Bin 724 -> 0 bytes
 .../project/www/res/resourceBundles/sv.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/sv_SE.js.gz    |  Bin 679 -> 0 bytes
 .../www/res/resourceBundles/sv_SE_EURO.js.gz       |  Bin 693 -> 0 bytes
 .../www/res/resourceBundles/sv_SE_PREEURO.js.gz    |  Bin 697 -> 0 bytes
 .../project/www/res/resourceBundles/ta.js.gz       |  Bin 736 -> 0 bytes
 .../project/www/res/resourceBundles/ta_IN.js.gz    |  Bin 759 -> 0 bytes
 .../project/www/res/resourceBundles/te.js.gz       |  Bin 701 -> 0 bytes
 .../project/www/res/resourceBundles/te_IN.js.gz    |  Bin 761 -> 0 bytes
 .../project/www/res/resourceBundles/th.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/th_TH.js.gz    |  Bin 705 -> 0 bytes
 .../project/www/res/resourceBundles/th_TH_TH.js.gz |  Bin 712 -> 0 bytes
 .../project/www/res/resourceBundles/tr.js.gz       |  Bin 699 -> 0 bytes
 .../project/www/res/resourceBundles/tr_TR.js.gz    |  Bin 676 -> 0 bytes
 .../project/www/res/resourceBundles/uk.js.gz       |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/uk_UA.js.gz    |  Bin 693 -> 0 bytes
 .../project/www/res/resourceBundles/vi.js.gz       |  Bin 663 -> 0 bytes
 .../project/www/res/resourceBundles/vi_VN.js.gz    |  Bin 678 -> 0 bytes
 .../project/www/res/resourceBundles/zh.js.gz       |  Bin 702 -> 0 bytes
 .../project/www/res/resourceBundles/zh_CN.js.gz    |  Bin 691 -> 0 bytes
 .../project/www/res/resourceBundles/zh_HK.js.gz    |  Bin 705 -> 0 bytes
 .../project/www/res/resourceBundles/zh_SG.js.gz    |  Bin 690 -> 0 bytes
 .../project/www/res/resourceBundles/zh_TW.js.gz    |  Bin 689 -> 0 bytes
 .../www/res/screen/blackberry/screen-225.png       |  Bin 16776 -> 0 bytes
 .../bin/templates/project/www/spec.html            |   68 -
 .../bin/templates/project/www/spec/helper.js       |   33 -
 .../bin/templates/project/www/spec/index.js        |   67 -
 .../project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE |   20 -
 .../www/spec/lib/jasmine-1.2.0/jasmine-html.js     |  616 -
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.css |   81 -
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.js  | 2529 -
 lib/cordova-blackberry/blackberry/LICENSE          |  268 +
 lib/cordova-blackberry/blackberry/NOTICE           |    8 +
 lib/cordova-blackberry/blackberry/README.md        |  183 +
 lib/cordova-blackberry/blackberry/VERSION          |    1 +
 lib/cordova-blackberry/blackberry/bin/create       |  108 +
 lib/cordova-blackberry/blackberry/bin/create.bat   |   33 +
 lib/cordova-blackberry/blackberry/bin/create.js    |  129 +
 .../bin/templates/project/blackberry.xml           |  456 +
 .../blackberry/bin/templates/project/build.xml     |  154 +
 .../blackberry/bin/templates/project/cordova/build |   34 +
 .../blackberry/bin/templates/project/cordova/run   |   41 +
 .../blackberry/bin/templates/project/playbook.xml  |  338 +
 .../bin/templates/project/project.properties       |  100 +
 .../blackberry/bin/templates/project/www/LICENSE   |  296 +
 .../blackberry/bin/templates/project/www/NOTICE    |    8 +
 .../blackberry/bin/templates/project/www/README.md |   30 +
 .../blackberry/bin/templates/project/www/VERSION   |    1 +
 .../bin/templates/project/www/config.xml           |   96 +
 .../bin/templates/project/www/css/index.css        |  115 +
 .../bin/templates/project/www/img/logo.png         |  Bin 0 -> 21814 bytes
 .../bin/templates/project/www/index.html           |   42 +
 .../bin/templates/project/www/js/index.js          |   49 +
 .../blackberry/bin/templates/project/www/json2.js  |  482 +
 .../bin/templates/project/www/plugins.xml          |   35 +
 .../project/www/res/icon/blackberry/icon-80.png    |  Bin 0 -> 7287 bytes
 .../project/www/res/resourceBundles/ar.js.gz       |  Bin 0 -> 708 bytes
 .../project/www/res/resourceBundles/ar_AE.js.gz    |  Bin 0 -> 745 bytes
 .../project/www/res/resourceBundles/ar_BH.js.gz    |  Bin 0 -> 738 bytes
 .../project/www/res/resourceBundles/ar_DZ.js.gz    |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/ar_EG.js.gz    |  Bin 0 -> 735 bytes
 .../project/www/res/resourceBundles/ar_IQ.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_JO.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_KW.js.gz    |  Bin 0 -> 738 bytes
 .../project/www/res/resourceBundles/ar_LB.js.gz    |  Bin 0 -> 735 bytes
 .../project/www/res/resourceBundles/ar_LY.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_MA.js.gz    |  Bin 0 -> 738 bytes
 .../project/www/res/resourceBundles/ar_OM.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_QA.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ar_SA.js.gz    |  Bin 0 -> 704 bytes
 .../project/www/res/resourceBundles/ar_SD.js.gz    |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/ar_SY.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/ar_TN.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ar_YE.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/be.js.gz       |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/be_BY.js.gz    |  Bin 0 -> 686 bytes
 .../project/www/res/resourceBundles/bg.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/bg_BG.js.gz    |  Bin 0 -> 688 bytes
 .../project/www/res/resourceBundles/bn_IN.js.gz    |  Bin 0 -> 767 bytes
 .../project/www/res/resourceBundles/ca.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/ca_ES.js.gz    |  Bin 0 -> 678 bytes
 .../www/res/resourceBundles/ca_ES_PREEURO.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/cs.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/cs_CZ.js.gz    |  Bin 0 -> 687 bytes
 .../www/res/resourceBundles/cs_CZ_EURO.js.gz       |  Bin 0 -> 702 bytes
 .../www/res/resourceBundles/cs_CZ_PREEURO.js.gz    |  Bin 0 -> 706 bytes
 .../project/www/res/resourceBundles/da.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/da_DK.js.gz    |  Bin 0 -> 717 bytes
 .../www/res/resourceBundles/da_DK_EURO.js.gz       |  Bin 0 -> 731 bytes
 .../project/www/res/resourceBundles/de.js.gz       |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/de_AT.js.gz    |  Bin 0 -> 719 bytes
 .../www/res/resourceBundles/de_AT_PREEURO.js.gz    |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/de_CH.js.gz    |  Bin 0 -> 723 bytes
 .../project/www/res/resourceBundles/de_DE.js.gz    |  Bin 0 -> 678 bytes
 .../www/res/resourceBundles/de_DE_PREEURO.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/de_LU.js.gz    |  Bin 0 -> 682 bytes
 .../www/res/resourceBundles/de_LU_PREEURO.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/el.js.gz       |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/el_CY.js.gz    |  Bin 0 -> 712 bytes
 .../www/res/resourceBundles/el_CY_EURO.js.gz       |  Bin 0 -> 726 bytes
 .../www/res/resourceBundles/el_CY_PREEURO.js.gz    |  Bin 0 -> 730 bytes
 .../project/www/res/resourceBundles/el_GR.js.gz    |  Bin 0 -> 690 bytes
 .../www/res/resourceBundles/el_GR_PREEURO.js.gz    |  Bin 0 -> 708 bytes
 .../project/www/res/resourceBundles/en.js.gz       |  Bin 0 -> 670 bytes
 .../project/www/res/resourceBundles/en_AU.js.gz    |  Bin 0 -> 689 bytes
 .../project/www/res/resourceBundles/en_BE.js.gz    |  Bin 0 -> 680 bytes
 .../www/res/resourceBundles/en_BE_PREEURO.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/en_CA.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/en_GB.js.gz    |  Bin 0 -> 692 bytes
 .../www/res/resourceBundles/en_GB_EURO.js.gz       |  Bin 0 -> 706 bytes
 .../project/www/res/resourceBundles/en_HK.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/en_IE.js.gz    |  Bin 0 -> 692 bytes
 .../www/res/resourceBundles/en_IE_PREEURO.js.gz    |  Bin 0 -> 710 bytes
 .../project/www/res/resourceBundles/en_IN.js.gz    |  Bin 0 -> 762 bytes
 .../project/www/res/resourceBundles/en_MT.js.gz    |  Bin 0 -> 686 bytes
 .../project/www/res/resourceBundles/en_NZ.js.gz    |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/en_PH.js.gz    |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/en_SG.js.gz    |  Bin 0 -> 688 bytes
 .../project/www/res/resourceBundles/en_US.js.gz    |  Bin 0 -> 705 bytes
 .../project/www/res/resourceBundles/en_ZA.js.gz    |  Bin 0 -> 692 bytes
 .../project/www/res/resourceBundles/es.js.gz       |  Bin 0 -> 681 bytes
 .../project/www/res/resourceBundles/es_AR.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_BO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_CL.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/es_CO.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/es_CR.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_DO.js.gz    |  Bin 0 -> 708 bytes
 .../project/www/res/resourceBundles/es_EC.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_ES.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/es_ES_PREEURO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_GT.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_HN.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/es_MX.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_NI.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_PA.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_PE.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/es_PR.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/es_PY.js.gz    |  Bin 0 -> 720 bytes
 .../project/www/res/resourceBundles/es_SV.js.gz    |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/es_US.js.gz    |  Bin 0 -> 707 bytes
 .../project/www/res/resourceBundles/es_UY.js.gz    |  Bin 0 -> 721 bytes
 .../project/www/res/resourceBundles/es_VE.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/et.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/et_EE.js.gz    |  Bin 0 -> 677 bytes
 .../www/res/resourceBundles/et_EE_EURO.js.gz       |  Bin 0 -> 691 bytes
 .../www/res/resourceBundles/et_EE_PREEURO.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/fi.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/fi_FI.js.gz    |  Bin 0 -> 685 bytes
 .../www/res/resourceBundles/fi_FI_PREEURO.js.gz    |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/fr.js.gz       |  Bin 0 -> 661 bytes
 .../project/www/res/resourceBundles/fr_BE.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/fr_BE_PREEURO.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/fr_CA.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/fr_CH.js.gz    |  Bin 0 -> 723 bytes
 .../project/www/res/resourceBundles/fr_FR.js.gz    |  Bin 0 -> 682 bytes
 .../www/res/resourceBundles/fr_FR_PREEURO.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/fr_LU.js.gz    |  Bin 0 -> 682 bytes
 .../www/res/resourceBundles/fr_LU_PREEURO.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ga.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ga_IE.js.gz    |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/gu.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/gu_IN.js.gz    |  Bin 0 -> 763 bytes
 .../project/www/res/resourceBundles/hi_IN.js.gz    |  Bin 0 -> 759 bytes
 .../project/www/res/resourceBundles/hr.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/hr_HR.js.gz    |  Bin 0 -> 712 bytes
 .../project/www/res/resourceBundles/hu.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/hu_HU.js.gz    |  Bin 0 -> 680 bytes
 .../www/res/resourceBundles/hu_HU_EURO.js.gz       |  Bin 0 -> 694 bytes
 .../www/res/resourceBundles/hu_HU_PREEURO.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/in.js.gz       |  Bin 0 -> 669 bytes
 .../project/www/res/resourceBundles/in_ID.js.gz    |  Bin 0 -> 684 bytes
 .../project/www/res/resourceBundles/is.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/is_IS.js.gz    |  Bin 0 -> 679 bytes
 .../project/www/res/resourceBundles/it.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/it_CH.js.gz    |  Bin 0 -> 723 bytes
 .../project/www/res/resourceBundles/it_IT.js.gz    |  Bin 0 -> 717 bytes
 .../www/res/resourceBundles/it_IT_PREEURO.js.gz    |  Bin 0 -> 734 bytes
 .../project/www/res/resourceBundles/iw.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/iw_IL.js.gz    |  Bin 0 -> 683 bytes
 .../project/www/res/resourceBundles/ja.js.gz       |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/ja_JP.js.gz    |  Bin 0 -> 692 bytes
 .../project/www/res/resourceBundles/ja_JP_JP.js.gz |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/kk.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/kk_KZ.js.gz    |  Bin 0 -> 711 bytes
 .../project/www/res/resourceBundles/kn.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/kn_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/ko.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ko_KR.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/lt.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/lt_LT.js.gz    |  Bin 0 -> 676 bytes
 .../www/res/resourceBundles/lt_LT_EURO.js.gz       |  Bin 0 -> 690 bytes
 .../www/res/resourceBundles/lt_LT_PREEURO.js.gz    |  Bin 0 -> 694 bytes
 .../project/www/res/resourceBundles/lv.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/lv_LV.js.gz    |  Bin 0 -> 677 bytes
 .../www/res/resourceBundles/lv_LV_EURO.js.gz       |  Bin 0 -> 691 bytes
 .../www/res/resourceBundles/lv_LV_PREEURO.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/mk.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/mk_MK.js.gz    |  Bin 0 -> 720 bytes
 .../project/www/res/resourceBundles/ml_IN.js.gz    |  Bin 0 -> 762 bytes
 .../project/www/res/resourceBundles/mr.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/mr_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/ms.js.gz       |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/ms_MY.js.gz    |  Bin 0 -> 694 bytes
 .../project/www/res/resourceBundles/mt.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/mt_MT.js.gz    |  Bin 0 -> 685 bytes
 .../www/res/resourceBundles/mt_MT_EURO.js.gz       |  Bin 0 -> 699 bytes
 .../www/res/resourceBundles/mt_MT_PREEURO.js.gz    |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/nb_NO.js.gz    |  Bin 0 -> 688 bytes
 .../project/www/res/resourceBundles/nl.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/nl_BE.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/nl_BE_PREEURO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/nl_NL.js.gz    |  Bin 0 -> 724 bytes
 .../www/res/resourceBundles/nl_NL_PREEURO.js.gz    |  Bin 0 -> 741 bytes
 .../project/www/res/resourceBundles/no.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/no_NO.js.gz    |  Bin 0 -> 680 bytes
 .../project/www/res/resourceBundles/no_NO_NY.js.gz |  Bin 0 -> 692 bytes
 .../project/www/res/resourceBundles/or_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/pa.js.gz       |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/pa_IN.js.gz    |  Bin 0 -> 753 bytes
 .../project/www/res/resourceBundles/pl.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/pl_PL.js.gz    |  Bin 0 -> 683 bytes
 .../www/res/resourceBundles/pl_PL_EURO.js.gz       |  Bin 0 -> 697 bytes
 .../www/res/resourceBundles/pl_PL_PREEURO.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/pt.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/pt_BR.js.gz    |  Bin 0 -> 717 bytes
 .../project/www/res/resourceBundles/pt_PT.js.gz    |  Bin 0 -> 681 bytes
 .../www/res/resourceBundles/pt_PT_PREEURO.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/ro.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/ro_RO.js.gz    |  Bin 0 -> 675 bytes
 .../project/www/res/resourceBundles/ru.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ru_RU.js.gz    |  Bin 0 -> 689 bytes
 .../project/www/res/resourceBundles/sh.js.gz       |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/sh_CS.js.gz    |  Bin 0 -> 725 bytes
 .../project/www/res/resourceBundles/sk.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/sk_SK.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/sk_SK_EURO.js.gz       |  Bin 0 -> 693 bytes
 .../www/res/resourceBundles/sk_SK_PREEURO.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/sl.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/sl_SI.js.gz    |  Bin 0 -> 676 bytes
 .../www/res/resourceBundles/sl_SI_PREEURO.js.gz    |  Bin 0 -> 693 bytes
 .../project/www/res/resourceBundles/sq.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/sq_AL.js.gz    |  Bin 0 -> 684 bytes
 .../project/www/res/resourceBundles/sr.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/sr_BA.js.gz    |  Bin 0 -> 727 bytes
 .../project/www/res/resourceBundles/sr_CS.js.gz    |  Bin 0 -> 727 bytes
 .../project/www/res/resourceBundles/sr_ME.js.gz    |  Bin 0 -> 716 bytes
 .../project/www/res/resourceBundles/sr_RS.js.gz    |  Bin 0 -> 712 bytes
 .../www/res/resourceBundles/sr_RS_Cyrl.js.gz       |  Bin 0 -> 727 bytes
 .../www/res/resourceBundles/sr_RS_Latn.js.gz       |  Bin 0 -> 724 bytes
 .../project/www/res/resourceBundles/sv.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/sv_SE.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/sv_SE_EURO.js.gz       |  Bin 0 -> 693 bytes
 .../www/res/resourceBundles/sv_SE_PREEURO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/ta.js.gz       |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ta_IN.js.gz    |  Bin 0 -> 759 bytes
 .../project/www/res/resourceBundles/te.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/te_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/th.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/th_TH.js.gz    |  Bin 0 -> 705 bytes
 .../project/www/res/resourceBundles/th_TH_TH.js.gz |  Bin 0 -> 712 bytes
 .../project/www/res/resourceBundles/tr.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/tr_TR.js.gz    |  Bin 0 -> 676 bytes
 .../project/www/res/resourceBundles/uk.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/uk_UA.js.gz    |  Bin 0 -> 693 bytes
 .../project/www/res/resourceBundles/vi.js.gz       |  Bin 0 -> 663 bytes
 .../project/www/res/resourceBundles/vi_VN.js.gz    |  Bin 0 -> 678 bytes
 .../project/www/res/resourceBundles/zh.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/zh_CN.js.gz    |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/zh_HK.js.gz    |  Bin 0 -> 705 bytes
 .../project/www/res/resourceBundles/zh_SG.js.gz    |  Bin 0 -> 690 bytes
 .../project/www/res/resourceBundles/zh_TW.js.gz    |  Bin 0 -> 689 bytes
 .../www/res/screen/blackberry/screen-225.png       |  Bin 0 -> 16776 bytes
 .../blackberry/bin/templates/project/www/spec.html |   68 +
 .../bin/templates/project/www/spec/helper.js       |   33 +
 .../bin/templates/project/www/spec/index.js        |   67 +
 .../project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE |   20 +
 .../www/spec/lib/jasmine-1.2.0/jasmine-html.js     |  616 +
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.css |   81 +
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.js  | 2529 +
 lib/cordova-blackberry/blackberry/build.xml        |  317 +
 .../framework/ext-air/Cordova_Network/library.xml  |   40 +
 .../src/org/apache/cordova/network/Network.as      |   88 +
 .../blackberry/framework/ext/.classpath            |    7 +
 .../blackberry/framework/ext/.project              |   29 +
 .../net.rim.browser.tools.debug.widget.prefs       |    3 +
 .../ext/.settings/org.eclipse.jdt.core.prefs       |   12 +
 .../framework/ext/BlackBerry_App_Descriptor.xml    |   36 +
 .../blackberry/framework/ext/src/library.xml       |   35 +
 .../src/org/apache/cordova/CordovaExtension.java   |  208 +
 .../cordova/accelerometer/Accelerometer.java       |  228 +
 .../ext/src/org/apache/cordova/api/IPlugin.java    |   71 +
 .../ext/src/org/apache/cordova/api/Plugin.java     |  114 +
 .../src/org/apache/cordova/api/PluginManager.java  |  168 +
 .../apache/cordova/api/PluginManagerFunction.java  |  240 +
 .../src/org/apache/cordova/api/PluginResult.java   |  152 +
 .../ext/src/org/apache/cordova/app/App.java        |  147 +
 .../src/org/apache/cordova/battery/Battery.java    |  210 +
 .../ext/src/org/apache/cordova/camera/Camera.java  |  470 +
 .../org/apache/cordova/camera/CameraOptions.java   |  193 +
 .../org/apache/cordova/camera/PhotoListener.java   |  107 +
 .../cordova/capture/AudioCaptureListener.java      |   80 +
 .../cordova/capture/AudioCaptureOperation.java     |  173 +
 .../org/apache/cordova/capture/AudioControl.java   |   75 +
 .../org/apache/cordova/capture/CameraControl.java  |   87 +
 .../org/apache/cordova/capture/CaptureControl.java |  169 +
 .../org/apache/cordova/capture/CaptureMode.java    |   87 +
 .../apache/cordova/capture/CaptureOperation.java   |  202 +
 .../cordova/capture/ImageCaptureListener.java      |   84 +
 .../cordova/capture/ImageCaptureOperation.java     |  161 +
 .../org/apache/cordova/capture/MediaCapture.java   |  502 +
 .../src/org/apache/cordova/capture/MediaQueue.java |   44 +
 .../cordova/capture/VideoCaptureListener.java      |  107 +
 .../cordova/capture/VideoCaptureOperation.java     |  124 +
 .../ext/src/org/apache/cordova/device/Device.java  |   70 +
 .../ext/src/org/apache/cordova/file/Entry.java     |   66 +
 .../ext/src/org/apache/cordova/file/File.java      |   84 +
 .../src/org/apache/cordova/file/FileManager.java   | 1051 +
 .../apache/cordova/geolocation/Geolocation.java    |  372 +
 .../cordova/geolocation/GeolocationListener.java   |  133 +
 .../cordova/geolocation/GeolocationResult.java     |   73 +
 .../cordova/geolocation/GeolocationStatus.java     |   36 +
 .../org/apache/cordova/geolocation/Position.java   |  133 +
 .../cordova/geolocation/PositionOptions.java       |   42 +
 .../cordova/globalization/Globalization.java       |  558 +
 .../cordova/globalization/GlobalizationError.java  |  115 +
 .../apache/cordova/globalization/Resources.java    |   99 +
 .../src/org/apache/cordova/globalization/Util.java |  721 +
 .../src/org/apache/cordova/http/FileTransfer.java  |  473 +
 .../org/apache/cordova/http/FileUploadResult.java  |   63 +
 .../src/org/apache/cordova/http/FileUploader.java  |  280 +
 .../ext/src/org/apache/cordova/http/HttpUtils.java |   66 +
 .../ext/src/org/apache/cordova/json4j/JSON.java    |  208 +
 .../src/org/apache/cordova/json4j/JSONArray.java   | 1123 +
 .../org/apache/cordova/json4j/JSONArtifact.java    |  118 +
 .../org/apache/cordova/json4j/JSONException.java   |   55 +
 .../src/org/apache/cordova/json4j/JSONObject.java  | 1367 +
 .../src/org/apache/cordova/json4j/JSONString.java  |   32 +
 .../org/apache/cordova/json4j/JSONStringer.java    |   58 +
 .../src/org/apache/cordova/json4j/JSONWriter.java  |  586 +
 .../cordova/json4j/internal/JSON4JNumber.java      |   22 +
 .../cordova/json4j/internal/JSON4JPBackReader.java |   47 +
 .../json4j/internal/JSON4JStringReader.java        |   54 +
 .../json4j/internal/JSON4JStringWriter.java        |   68 +
 .../apache/cordova/json4j/internal/NumberUtil.java |  109 +
 .../org/apache/cordova/json4j/internal/Parser.java |  338 +
 .../apache/cordova/json4j/internal/Serializer.java |  353 +
 .../cordova/json4j/internal/SerializerVerbose.java |  102 +
 .../org/apache/cordova/json4j/internal/Token.java  |  115 +
 .../apache/cordova/json4j/internal/Tokenizer.java  |  619 +
 .../src/org/apache/cordova/media/AudioPlayer.java  |  654 +
 .../ext/src/org/apache/cordova/media/Media.java    |  344 +
 .../cordova/network/ConnectionInfoAction.java      |  355 +
 .../src/org/apache/cordova/network/Network.java    |   66 +
 .../cordova/notification/ActivityDialog.java       |  146 +
 .../apache/cordova/notification/AlertAction.java   |   83 +
 .../apache/cordova/notification/AlertDialog.java   |   68 +
 .../apache/cordova/notification/BeepAction.java    |  160 +
 .../apache/cordova/notification/ConfirmAction.java |   85 +
 .../apache/cordova/notification/ConfirmDialog.java |  100 +
 .../apache/cordova/notification/Notification.java  |  135 +
 .../cordova/notification/ProgressDialog.java       |  182 +
 .../apache/cordova/notification/VibrateAction.java |   64 +
 .../ext/src/org/apache/cordova/pim/Contact.java    |  430 +
 .../ext/src/org/apache/cordova/ui/SpacerField.java |   71 +
 .../org/apache/cordova/util/ApplicationUtils.java  |  108 +
 .../ext/src/org/apache/cordova/util/FileUtils.java |  730 +
 .../ext/src/org/apache/cordova/util/Log.java       |   83 +
 .../src/org/apache/cordova/util/LogFunction.java   |   41 +
 .../ext/src/org/apache/cordova/util/Logger.java    |  155 +
 .../src/org/apache/cordova/util/StringUtils.java   |  103 +
 .../blackberry/javascript/cordova.blackberry.js    |10857 +
 lib/cordova-blackberry/blackberry10/.gitignore     |   27 +
 lib/cordova-blackberry/blackberry10/.jshint        |    3 +
 lib/cordova-blackberry/blackberry10/.jshintignore  |    1 +
 lib/cordova-blackberry/blackberry10/.npmignore     |    2 +
 lib/cordova-blackberry/blackberry10/Jakefile       |  148 +
 lib/cordova-blackberry/blackberry10/LICENSE        |  268 +
 lib/cordova-blackberry/blackberry10/NOTICE         |    8 +
 lib/cordova-blackberry/blackberry10/README.md      |    7 +
 lib/cordova-blackberry/blackberry10/VERSION        |    1 +
 lib/cordova-blackberry/blackberry10/bin/check_reqs |   28 +
 .../blackberry10/bin/check_reqs.bat                |   21 +
 lib/cordova-blackberry/blackberry10/bin/create     |   25 +
 lib/cordova-blackberry/blackberry10/bin/create.bat |   21 +
 lib/cordova-blackberry/blackberry10/bin/create.js  |  168 +
 .../blackberry10/bin/lib/localize.js               |   26 +
 .../blackberry10/bin/lib/utils.js                  |  167 +
 .../bin/templates/project/cordova/build            |    6 +
 .../bin/templates/project/cordova/build.bat        |    8 +
 .../bin/templates/project/cordova/clean            |    4 +
 .../bin/templates/project/cordova/clean.bat        |    6 +
 .../templates/project/cordova/lib/bar-builder.js   |  100 +
 .../bin/templates/project/cordova/lib/bar-conf.js  |   27 +
 .../templates/project/cordova/lib/bbwpignore.js    |  129 +
 .../bin/templates/project/cordova/lib/build        |  173 +
 .../bin/templates/project/cordova/lib/clean        |   24 +
 .../bin/templates/project/cordova/lib/cmdline.js   |   67 +
 .../bin/templates/project/cordova/lib/conf.js      |   45 +
 .../templates/project/cordova/lib/config-parser.js |  669 +
 .../project/cordova/lib/debugtoken-helper.js       |  211 +
 .../templates/project/cordova/lib/file-manager.js  |  311 +
 .../templates/project/cordova/lib/i18n-manager.js  |  146 +
 .../bin/templates/project/cordova/lib/localize.js  |  207 +
 .../bin/templates/project/cordova/lib/logger.js    |   38 +
 .../project/cordova/lib/native-packager.js         |  286 +
 .../project/cordova/lib/packager-utils.js          |  178 +
 .../project/cordova/lib/packager-validator.js      |  110 +
 .../bin/templates/project/cordova/lib/packager.js  |   74 +
 .../bin/templates/project/cordova/lib/run          |  204 +
 .../bin/templates/project/cordova/lib/session.js   |  120 +
 .../project/cordova/lib/signing-helper.js          |  127 +
 .../bin/templates/project/cordova/lib/target       |  187 +
 .../bin/templates/project/cordova/plugin           |    7 +
 .../bin/templates/project/cordova/plugin.bat       |    7 +
 .../blackberry10/bin/templates/project/cordova/run |    4 +
 .../bin/templates/project/cordova/run.bat          |    6 +
 .../bin/templates/project/cordova/target           |    5 +
 .../bin/templates/project/cordova/target.bat       |   24 +
 .../cordova/third_party/data2xml/data2xml.js       |   86 +
 .../project/cordova/third_party/wrench/wrench.js   |   78 +
 .../project/plugins/Accelerometer/index.js         |   45 +
 .../bin/templates/project/plugins/Battery/index.js |   49 +
 .../bin/templates/project/plugins/Camera/index.js  |  124 +
 .../bin/templates/project/plugins/Device/index.js  |   60 +
 .../templates/project/plugins/JPPS/native/Makefile |    8 +
 .../project/plugins/JPPS/native/common.mk          |   34 +
 .../project/plugins/JPPS/native/device/libjpps.so  |  Bin 0 -> 138046 bytes
 .../plugins/JPPS/native/simulator/libjpps.so       |  Bin 0 -> 224392 bytes
 .../plugins/JPPS/native/src/core/PPSEvent.h        |  108 +
 .../plugins/JPPS/native/src/core/PPSInterface.cpp  |  632 +
 .../plugins/JPPS/native/src/core/PPSInterface.h    |  238 +
 .../plugins/JPPS/native/src/core/PPSNotifier.cpp   |  126 +
 .../plugins/JPPS/native/src/core/PPSNotifier.h     |  159 +
 .../JPPS/native/src/core/PPSNotifyGroupManager.cpp |  107 +
 .../JPPS/native/src/core/PPSNotifyGroupManager.h   |  133 +
 .../plugins/JPPS/native/src/core/PPSTypes.h        |   96 +
 .../plugins/JPPS/native/src/plugin/JPPSPlugin.cpp  |  149 +
 .../plugins/JPPS/native/src/plugin/JPPSPlugin.h    |  122 +
 .../JPPS/native/src/plugin/JPPSServerPlugin.cpp    |  168 +
 .../JPPS/native/src/plugin/JPPSServerPlugin.h      |  115 +
 .../JPPS/native/src/plugin/PPSInterfaceGlue.cpp    |  355 +
 .../JPPS/native/src/plugin/PPSInterfaceGlue.h      |  177 +
 .../JPPS/native/src/plugin/PPSServerGlue.cpp       |  300 +
 .../plugins/JPPS/native/src/plugin/PPSServerGlue.h |  165 +
 .../plugins/JPPS/native/src/plugin/PluginTypes.h   |   35 +
 .../JPPS/native/src/plugin/pluginManifest.cpp      |   76 +
 .../project/plugins/JPPS/native/src/utils/Logger.h |   94 +
 .../plugins/JPPS/native/src/utils/Thread.cpp       |   71 +
 .../project/plugins/JPPS/native/src/utils/Thread.h |   73 +
 .../bin/templates/project/plugins/Logger/index.js  |   25 +
 .../project/plugins/NetworkStatus/index.js         |   59 +
 .../project/plugins/Notification/index.js          |   91 +
 .../project/plugins/SplashScreen/index.js          |   28 +
 .../project/plugins/Utils/native/Makefile          |    8 +
 .../project/plugins/Utils/native/common.mk         |   18 +
 .../plugins/Utils/native/device/libutils.so        |  Bin 0 -> 130206 bytes
 .../plugins/Utils/native/simulator/libutils.so     |  Bin 0 -> 183184 bytes
 .../plugins/Utils/native/webworks_utils.cpp        |   55 +
 .../plugins/Utils/native/webworks_utils.hpp        |   34 +
 .../bin/templates/project/project.json             |    6 +
 .../blackberry10/bin/templates/project/www/LICENSE |  296 +
 .../blackberry10/bin/templates/project/www/NOTICE  |    8 +
 .../bin/templates/project/www/README.md            |   30 +
 .../blackberry10/bin/templates/project/www/VERSION |    1 +
 .../bin/templates/project/www/config.xml           |   65 +
 .../bin/templates/project/www/css/index.css        |  115 +
 .../bin/templates/project/www/img/logo.png         |  Bin 0 -> 21814 bytes
 .../bin/templates/project/www/index.html           |   42 +
 .../bin/templates/project/www/js/index.js          |   49 +
 .../bin/templates/project/www/json2.js             |  482 +
 .../project/www/res/icon/blackberry/icon-80.png    |  Bin 0 -> 7287 bytes
 .../project/www/res/resourceBundles/ar.js.gz       |  Bin 0 -> 708 bytes
 .../project/www/res/resourceBundles/ar_AE.js.gz    |  Bin 0 -> 745 bytes
 .../project/www/res/resourceBundles/ar_BH.js.gz    |  Bin 0 -> 738 bytes
 .../project/www/res/resourceBundles/ar_DZ.js.gz    |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/ar_EG.js.gz    |  Bin 0 -> 735 bytes
 .../project/www/res/resourceBundles/ar_IQ.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_JO.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_KW.js.gz    |  Bin 0 -> 738 bytes
 .../project/www/res/resourceBundles/ar_LB.js.gz    |  Bin 0 -> 735 bytes
 .../project/www/res/resourceBundles/ar_LY.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_MA.js.gz    |  Bin 0 -> 738 bytes
 .../project/www/res/resourceBundles/ar_OM.js.gz    |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ar_QA.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ar_SA.js.gz    |  Bin 0 -> 704 bytes
 .../project/www/res/resourceBundles/ar_SD.js.gz    |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/ar_SY.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/ar_TN.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ar_YE.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/be.js.gz       |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/be_BY.js.gz    |  Bin 0 -> 686 bytes
 .../project/www/res/resourceBundles/bg.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/bg_BG.js.gz    |  Bin 0 -> 688 bytes
 .../project/www/res/resourceBundles/bn_IN.js.gz    |  Bin 0 -> 767 bytes
 .../project/www/res/resourceBundles/ca.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/ca_ES.js.gz    |  Bin 0 -> 678 bytes
 .../www/res/resourceBundles/ca_ES_PREEURO.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/cs.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/cs_CZ.js.gz    |  Bin 0 -> 687 bytes
 .../www/res/resourceBundles/cs_CZ_EURO.js.gz       |  Bin 0 -> 702 bytes
 .../www/res/resourceBundles/cs_CZ_PREEURO.js.gz    |  Bin 0 -> 706 bytes
 .../project/www/res/resourceBundles/da.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/da_DK.js.gz    |  Bin 0 -> 717 bytes
 .../www/res/resourceBundles/da_DK_EURO.js.gz       |  Bin 0 -> 731 bytes
 .../project/www/res/resourceBundles/de.js.gz       |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/de_AT.js.gz    |  Bin 0 -> 719 bytes
 .../www/res/resourceBundles/de_AT_PREEURO.js.gz    |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/de_CH.js.gz    |  Bin 0 -> 723 bytes
 .../project/www/res/resourceBundles/de_DE.js.gz    |  Bin 0 -> 678 bytes
 .../www/res/resourceBundles/de_DE_PREEURO.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/de_LU.js.gz    |  Bin 0 -> 682 bytes
 .../www/res/resourceBundles/de_LU_PREEURO.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/el.js.gz       |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/el_CY.js.gz    |  Bin 0 -> 712 bytes
 .../www/res/resourceBundles/el_CY_EURO.js.gz       |  Bin 0 -> 726 bytes
 .../www/res/resourceBundles/el_CY_PREEURO.js.gz    |  Bin 0 -> 730 bytes
 .../project/www/res/resourceBundles/el_GR.js.gz    |  Bin 0 -> 690 bytes
 .../www/res/resourceBundles/el_GR_PREEURO.js.gz    |  Bin 0 -> 708 bytes
 .../project/www/res/resourceBundles/en.js.gz       |  Bin 0 -> 670 bytes
 .../project/www/res/resourceBundles/en_AU.js.gz    |  Bin 0 -> 689 bytes
 .../project/www/res/resourceBundles/en_BE.js.gz    |  Bin 0 -> 680 bytes
 .../www/res/resourceBundles/en_BE_PREEURO.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/en_CA.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/en_GB.js.gz    |  Bin 0 -> 692 bytes
 .../www/res/resourceBundles/en_GB_EURO.js.gz       |  Bin 0 -> 706 bytes
 .../project/www/res/resourceBundles/en_HK.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/en_IE.js.gz    |  Bin 0 -> 692 bytes
 .../www/res/resourceBundles/en_IE_PREEURO.js.gz    |  Bin 0 -> 710 bytes
 .../project/www/res/resourceBundles/en_IN.js.gz    |  Bin 0 -> 762 bytes
 .../project/www/res/resourceBundles/en_MT.js.gz    |  Bin 0 -> 686 bytes
 .../project/www/res/resourceBundles/en_NZ.js.gz    |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/en_PH.js.gz    |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/en_SG.js.gz    |  Bin 0 -> 688 bytes
 .../project/www/res/resourceBundles/en_US.js.gz    |  Bin 0 -> 705 bytes
 .../project/www/res/resourceBundles/en_ZA.js.gz    |  Bin 0 -> 692 bytes
 .../project/www/res/resourceBundles/es.js.gz       |  Bin 0 -> 681 bytes
 .../project/www/res/resourceBundles/es_AR.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_BO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_CL.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/es_CO.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/es_CR.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_DO.js.gz    |  Bin 0 -> 708 bytes
 .../project/www/res/resourceBundles/es_EC.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_ES.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/es_ES_PREEURO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_GT.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_HN.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/es_MX.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_NI.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/es_PA.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/es_PE.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/es_PR.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/es_PY.js.gz    |  Bin 0 -> 720 bytes
 .../project/www/res/resourceBundles/es_SV.js.gz    |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/es_US.js.gz    |  Bin 0 -> 707 bytes
 .../project/www/res/resourceBundles/es_UY.js.gz    |  Bin 0 -> 721 bytes
 .../project/www/res/resourceBundles/es_VE.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/et.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/et_EE.js.gz    |  Bin 0 -> 677 bytes
 .../www/res/resourceBundles/et_EE_EURO.js.gz       |  Bin 0 -> 691 bytes
 .../www/res/resourceBundles/et_EE_PREEURO.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/fi.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/fi_FI.js.gz    |  Bin 0 -> 685 bytes
 .../www/res/resourceBundles/fi_FI_PREEURO.js.gz    |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/fr.js.gz       |  Bin 0 -> 661 bytes
 .../project/www/res/resourceBundles/fr_BE.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/fr_BE_PREEURO.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/fr_CA.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/fr_CH.js.gz    |  Bin 0 -> 723 bytes
 .../project/www/res/resourceBundles/fr_FR.js.gz    |  Bin 0 -> 682 bytes
 .../www/res/resourceBundles/fr_FR_PREEURO.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/fr_LU.js.gz    |  Bin 0 -> 682 bytes
 .../www/res/resourceBundles/fr_LU_PREEURO.js.gz    |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ga.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ga_IE.js.gz    |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/gu.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/gu_IN.js.gz    |  Bin 0 -> 763 bytes
 .../project/www/res/resourceBundles/hi_IN.js.gz    |  Bin 0 -> 759 bytes
 .../project/www/res/resourceBundles/hr.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/hr_HR.js.gz    |  Bin 0 -> 712 bytes
 .../project/www/res/resourceBundles/hu.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/hu_HU.js.gz    |  Bin 0 -> 680 bytes
 .../www/res/resourceBundles/hu_HU_EURO.js.gz       |  Bin 0 -> 694 bytes
 .../www/res/resourceBundles/hu_HU_PREEURO.js.gz    |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/in.js.gz       |  Bin 0 -> 669 bytes
 .../project/www/res/resourceBundles/in_ID.js.gz    |  Bin 0 -> 684 bytes
 .../project/www/res/resourceBundles/is.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/is_IS.js.gz    |  Bin 0 -> 679 bytes
 .../project/www/res/resourceBundles/it.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/it_CH.js.gz    |  Bin 0 -> 723 bytes
 .../project/www/res/resourceBundles/it_IT.js.gz    |  Bin 0 -> 717 bytes
 .../www/res/resourceBundles/it_IT_PREEURO.js.gz    |  Bin 0 -> 734 bytes
 .../project/www/res/resourceBundles/iw.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/iw_IL.js.gz    |  Bin 0 -> 683 bytes
 .../project/www/res/resourceBundles/ja.js.gz       |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/ja_JP.js.gz    |  Bin 0 -> 692 bytes
 .../project/www/res/resourceBundles/ja_JP_JP.js.gz |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/kk.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/kk_KZ.js.gz    |  Bin 0 -> 711 bytes
 .../project/www/res/resourceBundles/kn.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/kn_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/ko.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ko_KR.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/lt.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/lt_LT.js.gz    |  Bin 0 -> 676 bytes
 .../www/res/resourceBundles/lt_LT_EURO.js.gz       |  Bin 0 -> 690 bytes
 .../www/res/resourceBundles/lt_LT_PREEURO.js.gz    |  Bin 0 -> 694 bytes
 .../project/www/res/resourceBundles/lv.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/lv_LV.js.gz    |  Bin 0 -> 677 bytes
 .../www/res/resourceBundles/lv_LV_EURO.js.gz       |  Bin 0 -> 691 bytes
 .../www/res/resourceBundles/lv_LV_PREEURO.js.gz    |  Bin 0 -> 695 bytes
 .../project/www/res/resourceBundles/mk.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/mk_MK.js.gz    |  Bin 0 -> 720 bytes
 .../project/www/res/resourceBundles/ml_IN.js.gz    |  Bin 0 -> 762 bytes
 .../project/www/res/resourceBundles/mr.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/mr_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/ms.js.gz       |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/ms_MY.js.gz    |  Bin 0 -> 694 bytes
 .../project/www/res/resourceBundles/mt.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/mt_MT.js.gz    |  Bin 0 -> 685 bytes
 .../www/res/resourceBundles/mt_MT_EURO.js.gz       |  Bin 0 -> 699 bytes
 .../www/res/resourceBundles/mt_MT_PREEURO.js.gz    |  Bin 0 -> 703 bytes
 .../project/www/res/resourceBundles/nb_NO.js.gz    |  Bin 0 -> 688 bytes
 .../project/www/res/resourceBundles/nl.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/nl_BE.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/nl_BE_PREEURO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/nl_NL.js.gz    |  Bin 0 -> 724 bytes
 .../www/res/resourceBundles/nl_NL_PREEURO.js.gz    |  Bin 0 -> 741 bytes
 .../project/www/res/resourceBundles/no.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/no_NO.js.gz    |  Bin 0 -> 680 bytes
 .../project/www/res/resourceBundles/no_NO_NY.js.gz |  Bin 0 -> 692 bytes
 .../project/www/res/resourceBundles/or_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/pa.js.gz       |  Bin 0 -> 737 bytes
 .../project/www/res/resourceBundles/pa_IN.js.gz    |  Bin 0 -> 753 bytes
 .../project/www/res/resourceBundles/pl.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/pl_PL.js.gz    |  Bin 0 -> 683 bytes
 .../www/res/resourceBundles/pl_PL_EURO.js.gz       |  Bin 0 -> 697 bytes
 .../www/res/resourceBundles/pl_PL_PREEURO.js.gz    |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/pt.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/pt_BR.js.gz    |  Bin 0 -> 717 bytes
 .../project/www/res/resourceBundles/pt_PT.js.gz    |  Bin 0 -> 681 bytes
 .../www/res/resourceBundles/pt_PT_PREEURO.js.gz    |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/ro.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/ro_RO.js.gz    |  Bin 0 -> 675 bytes
 .../project/www/res/resourceBundles/ru.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/ru_RU.js.gz    |  Bin 0 -> 689 bytes
 .../project/www/res/resourceBundles/sh.js.gz       |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/sh_CS.js.gz    |  Bin 0 -> 725 bytes
 .../project/www/res/resourceBundles/sk.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/sk_SK.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/sk_SK_EURO.js.gz       |  Bin 0 -> 693 bytes
 .../www/res/resourceBundles/sk_SK_PREEURO.js.gz    |  Bin 0 -> 696 bytes
 .../project/www/res/resourceBundles/sl.js.gz       |  Bin 0 -> 700 bytes
 .../project/www/res/resourceBundles/sl_SI.js.gz    |  Bin 0 -> 676 bytes
 .../www/res/resourceBundles/sl_SI_PREEURO.js.gz    |  Bin 0 -> 693 bytes
 .../project/www/res/resourceBundles/sq.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/sq_AL.js.gz    |  Bin 0 -> 684 bytes
 .../project/www/res/resourceBundles/sr.js.gz       |  Bin 0 -> 698 bytes
 .../project/www/res/resourceBundles/sr_BA.js.gz    |  Bin 0 -> 727 bytes
 .../project/www/res/resourceBundles/sr_CS.js.gz    |  Bin 0 -> 727 bytes
 .../project/www/res/resourceBundles/sr_ME.js.gz    |  Bin 0 -> 716 bytes
 .../project/www/res/resourceBundles/sr_RS.js.gz    |  Bin 0 -> 712 bytes
 .../www/res/resourceBundles/sr_RS_Cyrl.js.gz       |  Bin 0 -> 727 bytes
 .../www/res/resourceBundles/sr_RS_Latn.js.gz       |  Bin 0 -> 724 bytes
 .../project/www/res/resourceBundles/sv.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/sv_SE.js.gz    |  Bin 0 -> 679 bytes
 .../www/res/resourceBundles/sv_SE_EURO.js.gz       |  Bin 0 -> 693 bytes
 .../www/res/resourceBundles/sv_SE_PREEURO.js.gz    |  Bin 0 -> 697 bytes
 .../project/www/res/resourceBundles/ta.js.gz       |  Bin 0 -> 736 bytes
 .../project/www/res/resourceBundles/ta_IN.js.gz    |  Bin 0 -> 759 bytes
 .../project/www/res/resourceBundles/te.js.gz       |  Bin 0 -> 701 bytes
 .../project/www/res/resourceBundles/te_IN.js.gz    |  Bin 0 -> 761 bytes
 .../project/www/res/resourceBundles/th.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/th_TH.js.gz    |  Bin 0 -> 705 bytes
 .../project/www/res/resourceBundles/th_TH_TH.js.gz |  Bin 0 -> 712 bytes
 .../project/www/res/resourceBundles/tr.js.gz       |  Bin 0 -> 699 bytes
 .../project/www/res/resourceBundles/tr_TR.js.gz    |  Bin 0 -> 676 bytes
 .../project/www/res/resourceBundles/uk.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/uk_UA.js.gz    |  Bin 0 -> 693 bytes
 .../project/www/res/resourceBundles/vi.js.gz       |  Bin 0 -> 663 bytes
 .../project/www/res/resourceBundles/vi_VN.js.gz    |  Bin 0 -> 678 bytes
 .../project/www/res/resourceBundles/zh.js.gz       |  Bin 0 -> 702 bytes
 .../project/www/res/resourceBundles/zh_CN.js.gz    |  Bin 0 -> 691 bytes
 .../project/www/res/resourceBundles/zh_HK.js.gz    |  Bin 0 -> 705 bytes
 .../project/www/res/resourceBundles/zh_SG.js.gz    |  Bin 0 -> 690 bytes
 .../project/www/res/resourceBundles/zh_TW.js.gz    |  Bin 0 -> 689 bytes
 .../www/res/screen/blackberry/screen-225.png       |  Bin 0 -> 16776 bytes
 .../bin/templates/project/www/spec.html            |   68 +
 .../bin/templates/project/www/spec/helper.js       |   33 +
 .../bin/templates/project/www/spec/index.js        |   67 +
 .../project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE |   20 +
 .../www/spec/lib/jasmine-1.2.0/jasmine-html.js     |  616 +
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.css |   81 +
 .../project/www/spec/lib/jasmine-1.2.0/jasmine.js  | 2529 +
 .../test/cordova/functional/debugtoken-helper.js   |  377 +
 .../bin/test/cordova/integration/create.js         |  158 +
 .../bin/test/cordova/integration/target.js         |  237 +
 .../bin/test/cordova/unit/config-bare-minimum.xml  |   21 +
 .../bin/test/cordova/unit/config-license.xml       |   10 +
 .../blackberry10/bin/test/cordova/unit/config.xml  |   53 +
 .../bin/test/cordova/unit/data/ascii_text.txt      |    1 +
 .../bin/test/cordova/unit/data/ucs2be_text.txt     |  Bin 0 -> 24 bytes
 .../bin/test/cordova/unit/data/ucs2le_text.txt     |  Bin 0 -> 24 bytes
 .../bin/test/cordova/unit/data/utf8_text.txt       |    1 +
 .../bin/test/cordova/unit/params-bad.json          |   10 +
 .../blackberry10/bin/test/cordova/unit/params.json |    9 +
 .../bin/test/cordova/unit/spec/lib/bar-builder.js  |   40 +
 .../bin/test/cordova/unit/spec/lib/bbwpignore.js   |  135 +
 .../bin/test/cordova/unit/spec/lib/cmdline.js      |   77 +
 .../test/cordova/unit/spec/lib/config-parser.js    | 1411 +
 .../bin/test/cordova/unit/spec/lib/file-manager.js |  178 +
 .../bin/test/cordova/unit/spec/lib/i18n-manager.js |  298 +
 .../bin/test/cordova/unit/spec/lib/logger.js       |  101 +
 .../test/cordova/unit/spec/lib/native-packager.js  |  347 +
 .../test/cordova/unit/spec/lib/packager-utils.js   |   65 +
 .../cordova/unit/spec/lib/packager-validator.js    |  277 +
 .../bin/test/cordova/unit/spec/lib/session.js      |  209 +
 .../test/cordova/unit/spec/lib/signing-helper.js   |  420 +
 .../bin/test/cordova/unit/spec/lib/test-data.js    |   87 +
 .../test/cordova/unit/spec/lib/test-utilities.js   |   82 +
 .../blackberry10/bin/test/cordova/unit/test.zip    |  Bin 0 -> 4984 bytes
 .../bin/test/plugins/Accelerometer/index.js        |   81 +
 .../blackberry10/bin/test/plugins/Battery/index.js |   85 +
 .../blackberry10/bin/test/plugins/Camera/index.js  |  298 +
 .../blackberry10/bin/test/plugins/Device/index.js  |   76 +
 .../blackberry10/bin/test/plugins/Logger/index.js  |   51 +
 .../bin/test/plugins/NetworkStatus/index.js        |  118 +
 .../bin/test/plugins/Notification/index.js         |  119 +
 .../bin/test/plugins/SplashScreen/index.js         |   82 +
 .../blackberry10/framework/bootstrap/index.html    |   23 +
 .../blackberry10/framework/bootstrap/require.js    |  251 +
 .../blackberry10/framework/bootstrap/ui.html       |   73 +
 .../blackberry10/framework/bootstrap/wwe           |    2 +
 .../blackberry10/framework/lib/PluginResult.js     |   55 +
 .../blackberry10/framework/lib/config.js           |   22 +
 .../blackberry10/framework/lib/config/default.js   |   76 +
 .../blackberry10/framework/lib/config/user.js      |   49 +
 .../framework/lib/controllerWebView.js             |   72 +
 .../blackberry10/framework/lib/event.js            |   84 +
 .../framework/lib/events/applicationEvents.js      |   34 +
 .../framework/lib/events/deviceEvents.js           |   34 +
 .../blackberry10/framework/lib/exception.js        |   69 +
 .../blackberry10/framework/lib/framework.js        |  138 +
 .../blackberry10/framework/lib/jnext.js            |  185 +
 .../blackberry10/framework/lib/overlayWebView.js   |  143 +
 .../blackberry10/framework/lib/plugins/default.js  |   71 +
 .../blackberry10/framework/lib/plugins/event.js    |   42 +
 .../framework/lib/policy/folderAccess.js           |  175 +
 .../framework/lib/policy/webkitOriginAccess.js     |  123 +
 .../blackberry10/framework/lib/policy/whitelist.js |  317 +
 .../blackberry10/framework/lib/server.js           |  121 +
 .../blackberry10/framework/lib/utils.js            |  549 +
 .../blackberry10/framework/lib/webkitEvent.js      |   87 +
 .../lib/webkitHandlers/networkResourceRequested.js |  126 +
 .../blackberry10/framework/lib/webview.js          |  271 +
 .../blackberry10/framework/test/unit/lib/config.js |   30 +
 .../framework/test/unit/lib/controllerWebView.js   |  107 +
 .../blackberry10/framework/test/unit/lib/event.js  |  139 +
 .../test/unit/lib/events/applicationEvents.js      |   82 +
 .../framework/test/unit/lib/events/deviceEvents.js |   77 +
 .../framework/test/unit/lib/framework.js           |  429 +
 .../framework/test/unit/lib/overlayWebView.js      |  187 +
 .../framework/test/unit/lib/plugins/default.js     |  154 +
 .../framework/test/unit/lib/plugins/event.js       |   78 +
 .../test/unit/lib/policy/webkitOriginAccess.js     |  194 +
 .../framework/test/unit/lib/policy/whitelist.js    |  859 +
 .../blackberry10/framework/test/unit/lib/server.js |  293 +
 .../blackberry10/framework/test/unit/lib/utils.js  |  280 +
 .../lib/webkitHandlers/networkResourceRequested.js |  167 +
 .../framework/test/unit/lib/webview.js             |  334 +
 .../javascript/cordova.blackberry10.js             | 6993 +
 .../blackberry10/node_modules/.bin/jake            |    1 +
 .../blackberry10/node_modules/.bin/jasmine-node    |    1 +
 .../blackberry10/node_modules/.bin/plugman         |    1 +
 .../blackberry10/node_modules/.bin/xlocalize       |    1 +
 .../blackberry10/node_modules/commander/.npmignore |    4 +
 .../node_modules/commander/.travis.yml             |    4 +
 .../blackberry10/node_modules/commander/History.md |  107 +
 .../blackberry10/node_modules/commander/Makefile   |    7 +
 .../blackberry10/node_modules/commander/Readme.md  |  262 +
 .../blackberry10/node_modules/commander/index.js   |    2 +
 .../node_modules/commander/lib/commander.js        | 1026 +
 .../node_modules/commander/package.json            |   38 +
 .../blackberry10/node_modules/jWorkflow/.npmignore |    1 +
 .../blackberry10/node_modules/jWorkflow/LICENSE    |    9 +
 .../blackberry10/node_modules/jWorkflow/README.md  |  170 +
 .../blackberry10/node_modules/jWorkflow/Rakefile   |   12 +
 .../node_modules/jWorkflow/jworkflow-min-0.8.0.js  |    3 +
 .../node_modules/jWorkflow/lib/jWorkflow.js        |  140 +
 .../node_modules/jWorkflow/package.json            |   27 +
 .../node_modules/jWorkflow/test/test.html          |   17 +
 .../node_modules/jWorkflow/test/test_jworkflow.js  |  521 +
 .../node_modules/jWorkflow/test/vendor/jquery.js   |   19 +
 .../node_modules/jWorkflow/test/vendor/qunit.css   |   17 +
 .../node_modules/jWorkflow/test/vendor/qunit.js    |  997 +
 .../blackberry10/node_modules/jake/Jakefile        |   43 +
 .../blackberry10/node_modules/jake/Makefile        |   44 +
 .../blackberry10/node_modules/jake/README.md       |  946 +
 .../blackberry10/node_modules/jake/bin/cli.js      |   23 +
 .../blackberry10/node_modules/jake/lib/api.js      |  241 +
 .../node_modules/jake/lib/file_list.js             |  284 +
 .../blackberry10/node_modules/jake/lib/jake.js     |  280 +
 .../blackberry10/node_modules/jake/lib/loader.js   |   94 +
 .../node_modules/jake/lib/npm_publish_task.js      |  193 +
 .../node_modules/jake/lib/package_task.js          |  365 +
 .../node_modules/jake/lib/parseargs.js             |  134 +
 .../blackberry10/node_modules/jake/lib/program.js  |  235 +
 .../node_modules/jake/lib/task/directory_task.js   |   29 +
 .../node_modules/jake/lib/task/file_task.js        |  134 +
 .../node_modules/jake/lib/task/index.js            |    9 +
 .../node_modules/jake/lib/task/task.js             |  240 +
 .../node_modules/jake/lib/test_task.js             |  216 +
 .../node_modules/jake/lib/utils/index.js           |  242 +
 .../node_modules/jake/lib/utils/logger.js          |   24 +
 .../jake/node_modules/minimatch/LICENSE            |   23 +
 .../jake/node_modules/minimatch/README.md          |  218 +
 .../jake/node_modules/minimatch/minimatch.js       | 1079 +
 .../minimatch/node_modules/lru-cache/.npmignore    |    1 +
 .../minimatch/node_modules/lru-cache/AUTHORS       |    8 +
 .../minimatch/node_modules/lru-cache/LICENSE       |   23 +
 .../minimatch/node_modules/lru-cache/README.md     |   97 +
 .../node_modules/lru-cache/lib/lru-cache.js        |  257 +
 .../minimatch/node_modules/lru-cache/package.json  |   59 +
 .../minimatch/node_modules/lru-cache/s.js          |   25 +
 .../minimatch/node_modules/lru-cache/test/basic.js |  329 +
 .../node_modules/lru-cache/test/foreach.js         |   52 +
 .../node_modules/lru-cache/test/memory-leak.js     |   50 +
 .../minimatch/node_modules/sigmund/LICENSE         |   27 +
 .../minimatch/node_modules/sigmund/README.md       |   53 +
 .../minimatch/node_modules/sigmund/bench.js        |  283 +
 .../minimatch/node_modules/sigmund/package.json    |   38 +
 .../minimatch/node_modules/sigmund/sigmund.js      |   39 +
 .../minimatch/node_modules/sigmund/test/basic.js   |   24 +
 .../jake/node_modules/minimatch/package.json       |   36 +
 .../jake/node_modules/minimatch/test/basic.js      |  399 +
 .../node_modules/minimatch/test/brace-expand.js    |   33 +
 .../jake/node_modules/minimatch/test/caching.js    |   14 +
 .../jake/node_modules/minimatch/test/defaults.js   |  274 +
 .../jake/node_modules/utilities/Jakefile           |   37 +
 .../jake/node_modules/utilities/README.md          |    6 +
 .../jake/node_modules/utilities/lib/array.js       |   93 +
 .../jake/node_modules/utilities/lib/async.js       |  291 +
 .../jake/node_modules/utilities/lib/core.js        |  106 +
 .../jake/node_modules/utilities/lib/date.js        |  903 +
 .../node_modules/utilities/lib/event_buffer.js     |  109 +
 .../jake/node_modules/utilities/lib/file.js        |  520 +
 .../jake/node_modules/utilities/lib/i18n.js        |   60 +
 .../jake/node_modules/utilities/lib/index.js       |   59 +
 .../jake/node_modules/utilities/lib/inflection.js  |  222 +
 .../jake/node_modules/utilities/lib/log.js         |   67 +
 .../jake/node_modules/utilities/lib/network.js     |   72 +
 .../jake/node_modules/utilities/lib/object.js      |  108 +
 .../jake/node_modules/utilities/lib/request.js     |  143 +
 .../utilities/lib/sorted_collection.js             |  558 +
 .../jake/node_modules/utilities/lib/string.js      |  791 +
 .../jake/node_modules/utilities/lib/uri.js         |  177 +
 .../jake/node_modules/utilities/lib/xml.js         |  282 +
 .../jake/node_modules/utilities/package.json       |   34 +
 .../jake/node_modules/utilities/test/array.js      |   71 +
 .../jake/node_modules/utilities/test/core.js       |   75 +
 .../jake/node_modules/utilities/test/date.js       |   75 +
 .../node_modules/utilities/test/event_buffer.js    |   45 +
 .../jake/node_modules/utilities/test/file.js       |  218 +
 .../jake/node_modules/utilities/test/i18n.js       |   60 +
 .../jake/node_modules/utilities/test/inflection.js |  388 +
 .../jake/node_modules/utilities/test/network.js    |   41 +
 .../jake/node_modules/utilities/test/object.js     |   76 +
 .../utilities/test/sorted_collection.js            |  115 +
 .../jake/node_modules/utilities/test/string.js     |  411 +
 .../jake/node_modules/utilities/test/uri.js        |   99 +
 .../jake/node_modules/utilities/test/xml.js        |  122 +
 .../blackberry10/node_modules/jake/package.json    |   37 +
 .../blackberry10/node_modules/jake/test/Jakefile   |  214 +
 .../blackberry10/node_modules/jake/test/exec.js    |  113 +
 .../node_modules/jake/test/file_task.js            |  123 +
 .../blackberry10/node_modules/jake/test/helpers.js |   59 +
 .../node_modules/jake/test/namespace.js            |   27 +
 .../node_modules/jake/test/parseargs.js            |  150 +
 .../node_modules/jake/test/task_base.js            |  137 +
 .../node_modules/jasmine-node/.npmignore           |    9 +
 .../blackberry10/node_modules/jasmine-node/LICENSE |   22 +
 .../node_modules/jasmine-node/README.md            |   34 +
 .../node_modules/jasmine-node/bin/jasmine-node     |    7 +
 .../jasmine-node/lib/jasmine-node/cli.js           |   94 +
 .../jasmine-node/lib/jasmine-node/index.js         |  147 +
 .../jasmine-node/lib/jasmine-node/jasmine-1.0.1.js | 2421 +
 .../jasmine-node/lib/jasmine-node/reporter.js      |  141 +
 .../jasmine-node/node_modules/.bin/cake            |    7 +
 .../jasmine-node/node_modules/.bin/coffee          |    7 +
 .../node_modules/coffee-script/.npmignore          |   11 +
 .../jasmine-node/node_modules/coffee-script/CNAME  |    1 +
 .../node_modules/coffee-script/CONTRIBUTING.md     |    9 +
 .../node_modules/coffee-script/LICENSE             |   22 +
 .../jasmine-node/node_modules/coffee-script/README |   51 +
 .../node_modules/coffee-script/Rakefile            |   79 +
 .../node_modules/coffee-script/bin/cake            |    7 +
 .../node_modules/coffee-script/bin/coffee          |    7 +
 .../node_modules/coffee-script/extras/jsl.conf     |   44 +
 .../coffee-script/lib/coffee-script/browser.js     |  125 +
 .../coffee-script/lib/coffee-script/cake.js        |  118 +
 .../lib/coffee-script/coffee-script.js             |  342 +
 .../coffee-script/lib/coffee-script/command.js     |  558 +
 .../coffee-script/lib/coffee-script/grammar.js     |  625 +
 .../coffee-script/lib/coffee-script/helpers.js     |  236 +
 .../coffee-script/lib/coffee-script/index.js       |   11 +
 .../coffee-script/lib/coffee-script/lexer.js       |  914 +
 .../coffee-script/lib/coffee-script/nodes.js       | 3145 +
 .../coffee-script/lib/coffee-script/optparse.js    |  142 +
 .../coffee-script/lib/coffee-script/parser.js      |  608 +
 .../coffee-script/lib/coffee-script/repl.js        |  115 +
 .../coffee-script/lib/coffee-script/rewriter.js    |  509 +
 .../coffee-script/lib/coffee-script/scope.js       |  152 +
 .../coffee-script/lib/coffee-script/sourcemap.js   |  248 +
 .../node_modules/coffee-script/package.json        |   48 +
 .../node_modules/jasmine-node/package.json         |   52 +
 .../jasmine-node/spec/CoffeeSpec.coffee            |    4 +
 .../node_modules/jasmine-node/spec/SampleSpecs.js  |   15 +
 .../node_modules/jasmine-node/spec/TestSpec.js     |    5 +
 .../node_modules/jasmine-node/spec/helper_spec.js  |    7 +
 .../jasmine-node/spec/include/include_spec.js      |    7 +
 .../jasmine-node/spec/include/lib/test.js          |    3 +
 .../jasmine-node/spec/nested.js/NestedSpec.js      |    5 +
 .../jasmine-node/spec/nested/NestedSpec.js         |    5 +
 .../spec/nested/uber-nested/UberNestedSpec.js      |   11 +
 .../jasmine-node/spec/sample_helper.js             |   19 +
 .../node_modules/jasmine-node/specs.sh             |    2 +
 .../blackberry10/node_modules/localize/README.md   |  267 +
 .../node_modules/localize/bin/translations.json    |    6 +
 .../node_modules/localize/bin/xlocalize.js         |  139 +
 .../node_modules/localize/lib/localize.js          |  405 +
 .../node_modules/localize/package.json             |   38 +
 .../node_modules/localize/test/localize.test.js    |  179 +
 .../translations/subsitution/translations.json     |    8 +
 .../localize/test/translations/translations.json   |    5 +
 .../translations/translations/helloWorld.es.txt    |    1 +
 .../test/translations/translations/helloWorld.txt  |    1 +
 .../node_modules/localize/test/xlocalize.test.sh   |   37 +
 .../localize/test/xlocalize.testfile1.json         |    8 +
 .../localize/test/xlocalize.testfile2.json         |    8 +
 .../localize/test/xlocalize.testfile3.json         |    9 +
 .../localize/test/xlocalize.testfile4.json         |    9 +
 .../localize/test/xlocalize/subdir/test2.js        |    3 +
 .../node_modules/localize/test/xlocalize/test.html |   13 +
 .../blackberry10/node_modules/plugman/.gitmodules  |    3 +
 .../blackberry10/node_modules/plugman/.npmignore   |    2 +
 .../blackberry10/node_modules/plugman/LICENSE      |   14 +
 .../blackberry10/node_modules/plugman/README.md    |  372 +
 .../node_modules/plugman/config/remote.js          |   24 +
 .../node_modules/plugman/node_modules/.bin/nopt    |   44 +
 .../node_modules/plugman/node_modules/.bin/shjs    |   51 +
 .../plugman/node_modules/bplist-parser/.npmignore  |    8 +
 .../plugman/node_modules/bplist-parser/README.md   |   47 +
 .../node_modules/bplist-parser/bplistParser.js     |  309 +
 .../node_modules/bplist-parser/package.json        |   30 +
 .../node_modules/bplist-parser/test/airplay.bplist |  Bin 0 -> 341 bytes
 .../bplist-parser/test/iTunes-small.bplist         |  Bin 0 -> 24433 bytes
 .../node_modules/bplist-parser/test/parseTest.js   |  120 +
 .../node_modules/bplist-parser/test/sample1.bplist |  Bin 0 -> 605 bytes
 .../node_modules/bplist-parser/test/sample2.bplist |  Bin 0 -> 384 bytes
 .../node_modules/bplist-parser/test/uid.bplist     |  Bin 0 -> 365 bytes
 .../node_modules/bplist-parser/test/utf16.bplist   |  Bin 0 -> 1273 bytes
 .../plugman/node_modules/elementtree/.npmignore    |    1 +
 .../plugman/node_modules/elementtree/.travis.yml   |   10 +
 .../plugman/node_modules/elementtree/CHANGES.md    |   34 +
 .../plugman/node_modules/elementtree/LICENSE.txt   |  203 +
 .../plugman/node_modules/elementtree/Makefile      |   21 +
 .../plugman/node_modules/elementtree/NOTICE        |    5 +
 .../plugman/node_modules/elementtree/README.md     |   27 +
 .../node_modules/elementtree/lib/constants.js      |   20 +
 .../node_modules/elementtree/lib/elementpath.js    |  343 +
 .../node_modules/elementtree/lib/elementtree.js    |  598 +
 .../plugman/node_modules/elementtree/lib/errors.js |   31 +
 .../plugman/node_modules/elementtree/lib/parser.js |   33 +
 .../node_modules/elementtree/lib/parsers/index.js  |    1 +
 .../node_modules/elementtree/lib/parsers/sax.js    |   56 +
 .../node_modules/elementtree/lib/sprintf.js        |   86 +
 .../node_modules/elementtree/lib/treebuilder.js    |   60 +
 .../plugman/node_modules/elementtree/lib/utils.js  |   72 +
 .../elementtree/node_modules/sax/AUTHORS           |    9 +
 .../elementtree/node_modules/sax/LICENSE           |   23 +
 .../elementtree/node_modules/sax/README.md         |  213 +
 .../node_modules/sax/examples/big-not-pretty.xml   | 8002 +
 .../node_modules/sax/examples/example.js           |   41 +
 .../node_modules/sax/examples/get-products.js      |   58 +
 .../node_modules/sax/examples/hello-world.js       |    4 +
 .../node_modules/sax/examples/not-pretty.xml       |    8 +
 .../node_modules/sax/examples/pretty-print.js      |   74 +
 .../node_modules/sax/examples/shopping.xml         |    2 +
 .../node_modules/sax/examples/strict.dtd           |  870 +
 .../node_modules/sax/examples/switch-bench.js      |   45 +
 .../node_modules/sax/examples/test.html            |   15 +
 .../elementtree/node_modules/sax/examples/test.xml | 1254 +
 .../elementtree/node_modules/sax/lib/sax.js        | 1006 +
 .../elementtree/node_modules/sax/package.json      |   60 +
 .../node_modules/sax/test/buffer-overrun.js        |   25 +
 .../node_modules/sax/test/cdata-chunked.js         |   11 +
 .../node_modules/sax/test/cdata-end-split.js       |   15 +
 .../node_modules/sax/test/cdata-fake-end.js        |   28 +
 .../node_modules/sax/test/cdata-multiple.js        |   15 +
 .../elementtree/node_modules/sax/test/cdata.js     |   10 +
 .../elementtree/node_modules/sax/test/index.js     |   86 +
 .../elementtree/node_modules/sax/test/issue-23.js  |   43 +
 .../elementtree/node_modules/sax/test/issue-30.js  |   24 +
 .../elementtree/node_modules/sax/test/issue-35.js  |   15 +
 .../elementtree/node_modules/sax/test/issue-47.js  |   13 +
 .../elementtree/node_modules/sax/test/issue-49.js  |   31 +
 .../node_modules/sax/test/parser-position.js       |   28 +
 .../elementtree/node_modules/sax/test/script.js    |   12 +
 .../sax/test/self-closing-child-strict.js          |   40 +
 .../node_modules/sax/test/self-closing-child.js    |   40 +
 .../node_modules/sax/test/self-closing-tag.js      |   25 +
 .../node_modules/sax/test/stray-ending.js          |   17 +
 .../sax/test/trailing-non-whitespace.js            |   17 +
 .../elementtree/node_modules/sax/test/unquoted.js  |   17 +
 .../node_modules/sax/test/xmlns-issue-41.js        |   67 +
 .../node_modules/sax/test/xmlns-rebinding.js       |   59 +
 .../node_modules/sax/test/xmlns-strict.js          |   71 +
 .../node_modules/sax/test/xmlns-unbound.js         |   15 +
 .../sax/test/xmlns-xml-default-prefix-attribute.js |   35 +
 .../sax/test/xmlns-xml-default-prefix.js           |   20 +
 .../sax/test/xmlns-xml-default-redefine.js         |   40 +
 .../plugman/node_modules/elementtree/package.json  |   56 +
 .../node_modules/elementtree/tests/data/xml1.xml   |   17 +
 .../node_modules/elementtree/tests/data/xml2.xml   |   14 +
 .../node_modules/elementtree/tests/test-simple.js  |  299 +
 .../plugman/node_modules/glob/.npmignore           |    2 +
 .../plugman/node_modules/glob/.travis.yml          |    4 +
 .../plugman/node_modules/glob/README.md            |  114 +
 .../plugman/node_modules/glob/examples/g.js        |    9 +
 .../node_modules/glob/examples/usr-local.js        |    9 +
 .../node_modules/plugman/node_modules/glob/glob.js |  402 +
 .../glob/node_modules/fast-list/.npmignore         |    1 +
 .../glob/node_modules/fast-list/.travis.yml        |    4 +
 .../glob/node_modules/fast-list/README.md          |  111 +
 .../glob/node_modules/fast-list/bench.js           |   55 +
 .../glob/node_modules/fast-list/fast-list.js       |  144 +
 .../glob/node_modules/fast-list/package.json       |   28 +
 .../glob/node_modules/fast-list/test.js            |  112 +
 .../glob/node_modules/graceful-fs/.npmignore       |    1 +
 .../glob/node_modules/graceful-fs/LICENSE          |   23 +
 .../glob/node_modules/graceful-fs/README.md        |    5 +
 .../glob/node_modules/graceful-fs/graceful-fs.js   |  312 +
 .../glob/node_modules/graceful-fs/package.json     |   36 +
 .../glob/node_modules/graceful-fs/test/open.js     |   41 +
 .../glob/node_modules/inherits/README.md           |   51 +
 .../glob/node_modules/inherits/inherits.js         |   29 +
 .../glob/node_modules/inherits/package.json        |   26 +
 .../glob/node_modules/minimatch/.travis.yml        |    4 +
 .../glob/node_modules/minimatch/LICENSE            |   23 +
 .../glob/node_modules/minimatch/README.md          |  212 +
 .../glob/node_modules/minimatch/minimatch.js       | 1010 +
 .../minimatch/node_modules/lru-cache/.npmignore    |    1 +
 .../minimatch/node_modules/lru-cache/LICENSE       |   23 +
 .../minimatch/node_modules/lru-cache/README.md     |   14 +
 .../node_modules/lru-cache/lib/lru-cache.js        |  106 +
 .../minimatch/node_modules/lru-cache/package.json  |   28 +
 .../minimatch/node_modules/lru-cache/test/basic.js |  117 +
 .../glob/node_modules/minimatch/package.json       |   37 +
 .../glob/node_modules/minimatch/test/basic.js      |  261 +
 .../node_modules/minimatch/test/brace-expand.js    |   33 +
 .../glob/node_modules/minimatch/test/caching.js    |   14 +
 .../plugman/node_modules/glob/package.json         |   36 +
 .../plugman/node_modules/glob/test/00-setup.js     |   61 +
 .../node_modules/glob/test/bash-comparison.js      |  103 +
 .../plugman/node_modules/glob/test/zz-cleanup.js   |   11 +
 .../node_modules/plugman/node_modules/nopt/LICENSE |   23 +
 .../plugman/node_modules/nopt/README.md            |  208 +
 .../plugman/node_modules/nopt/bin/nopt.js          |   44 +
 .../node_modules/nopt/examples/my-program.js       |   30 +
 .../plugman/node_modules/nopt/lib/nopt.js          |  552 +
 .../node_modules/nopt/node_modules/abbrev/LICENSE  |   23 +
 .../nopt/node_modules/abbrev/README.md             |   23 +
 .../nopt/node_modules/abbrev/lib/abbrev.js         |  111 +
 .../nopt/node_modules/abbrev/package.json          |   25 +
 .../plugman/node_modules/nopt/package.json         |   32 +
 .../plugman/node_modules/osenv/LICENSE             |   25 +
 .../plugman/node_modules/osenv/README.md           |   63 +
 .../plugman/node_modules/osenv/osenv.js            |   80 +
 .../plugman/node_modules/osenv/package.json        |   39 +
 .../plugman/node_modules/osenv/test/unix.js        |   76 +
 .../plugman/node_modules/osenv/test/windows.js     |   82 +
 .../plugman/node_modules/plist/.npmignore          |    2 +
 .../plugman/node_modules/plist/LICENSE             |   22 +
 .../plugman/node_modules/plist/README.md           |   62 +
 .../plugman/node_modules/plist/lib/plist.js        |  301 +
 .../plist/node_modules/xmlbuilder/.npmignore       |    8 +
 .../plist/node_modules/xmlbuilder/README.md        |   73 +
 .../node_modules/xmlbuilder/lib/XMLBuilder.js      |  119 +
 .../node_modules/xmlbuilder/lib/XMLFragment.js     |  422 +
 .../plist/node_modules/xmlbuilder/lib/index.js     |   15 +
 .../plist/node_modules/xmlbuilder/package.json     |   41 +
 .../plist/node_modules/xmldom/.project             |   11 +
 .../plist/node_modules/xmldom/__package__.js       |    4 +
 .../plist/node_modules/xmldom/changelog            |    5 +
 .../plist/node_modules/xmldom/dom-parser.js        |  253 +
 .../node_modules/plist/node_modules/xmldom/dom.js  | 1138 +
 .../plist/node_modules/xmldom/package.json         |   71 +
 .../plist/node_modules/xmldom/readme.md            |  213 +
 .../node_modules/plist/node_modules/xmldom/sax.js  |  551 +
 .../node_modules/xmldom/test/3rd-cases/index.js    |    1 +
 .../node_modules/xmldom/test/3rd-cases/mock.js     |    1 +
 .../node_modules/xmldom/test/3rd-cases/o3xml.js    |   21 +
 .../xmldom/test/big-file-performance.js            |  152 +
 .../plist/node_modules/xmldom/test/dom/attr.js     |   64 +
 .../plist/node_modules/xmldom/test/dom/clone.js    |   22 +
 .../plist/node_modules/xmldom/test/dom/element.js  |  139 +
 .../plist/node_modules/xmldom/test/dom/fragment.js |   15 +
 .../plist/node_modules/xmldom/test/dom/index.js    |    5 +
 .../plist/node_modules/xmldom/test/dom/level3.js   |    8 +
 .../node_modules/xmldom/test/dom/serializer.js     |   14 +
 .../plist/node_modules/xmldom/test/error.js        |   71 +
 .../node_modules/xmldom/test/html/normalize.js     |   89 +
 .../plist/node_modules/xmldom/test/index.js        |   63 +
 .../plist/node_modules/xmldom/test/locator.js      |   50 +
 .../plist/node_modules/xmldom/test/namespace.js    |   32 +
 .../plist/node_modules/xmldom/test/node.js         |  102 +
 .../node_modules/xmldom/test/parse-element.js      |   31 +
 .../plist/node_modules/xmldom/test/simple.js       |   11 +
 .../plist/node_modules/xmldom/test/test.js         |   24 +
 .../plist/node_modules/xmldom/test/test.xml        |19719 +
 .../plugman/node_modules/plist/package.json        |   55 +
 .../plugman/node_modules/plist/tests/Cordova.plist |   87 +
 .../node_modules/plist/tests/Xcode-Info.plist      |   49 +
 .../node_modules/plist/tests/Xcode-PhoneGap.plist  |   55 +
 .../plugman/node_modules/plist/tests/airplay.xml   |   38 +
 .../node_modules/plist/tests/iTunes-BIG.xml        |299484 +++++++++++++++
 .../node_modules/plist/tests/iTunes-small.xml      | 1704 +
 .../plugman/node_modules/plist/tests/sample1.plist |   35 +
 .../plugman/node_modules/plist/tests/sample2.plist |   45 +
 .../node_modules/plist/tests/test-base64.js        |   28 +
 .../node_modules/plist/tests/test-big-xml.js       |   28 +
 .../plugman/node_modules/plist/tests/test-build.js |  171 +
 .../node_modules/plist/tests/test-parseFile.js     |   52 +
 .../node_modules/plist/tests/test-parseString.js   |   45 +
 .../plugman/node_modules/plist/tests/utf8data.xml  |   10 +
 .../plugman/node_modules/shelljs/.documentup.json  |    6 +
 .../plugman/node_modules/shelljs/.npmignore        |    1 +
 .../plugman/node_modules/shelljs/.travis.yml       |    5 +
 .../plugman/node_modules/shelljs/LICENSE           |   26 +
 .../plugman/node_modules/shelljs/README.md         |  513 +
 .../plugman/node_modules/shelljs/bin/shjs          |   51 +
 .../plugman/node_modules/shelljs/global.js         |    3 +
 .../plugman/node_modules/shelljs/jshint.json       |    4 +
 .../plugman/node_modules/shelljs/make.js           |   48 +
 .../node_modules/shelljs/node_modules/.bin/jshint  |    3 +
 .../shelljs/node_modules/jshint/.npmignore         |    8 +
 .../shelljs/node_modules/jshint/.travis.yml        |    3 +
 .../shelljs/node_modules/jshint/CONTRIBUTING.md    |  102 +
 .../shelljs/node_modules/jshint/LICENSE            |   20 +
 .../shelljs/node_modules/jshint/README.md          |   92 +
 .../shelljs/node_modules/jshint/bin/jshint         |    3 +
 .../node_modules/jshint/examples/.jshintignore     |    2 +
 .../shelljs/node_modules/jshint/examples/.jshintrc |   84 +
 .../node_modules/jshint/examples/reporter.js       |   21 +
 .../shelljs/node_modules/jshint/jshint.json        |   14 +
 .../shelljs/node_modules/jshint/make.js            |  129 +
 .../node_modules/jshint/node_modules/.bin/esparse  |  117 +
 .../jshint/node_modules/.bin/esvalidate            |  199 +
 .../node_modules/jshint/node_modules/cli/README.md |  196 +
 .../node_modules/jshint/node_modules/cli/cli.js    | 1127 +
 .../jshint/node_modules/cli/examples/cat.js        |   17 +
 .../jshint/node_modules/cli/examples/command.js    |   16 +
 .../jshint/node_modules/cli/examples/echo.js       |   54 +
 .../jshint/node_modules/cli/examples/glob.js       |    6 +
 .../jshint/node_modules/cli/examples/long_desc.js  |   20 +
 .../jshint/node_modules/cli/examples/progress.js   |   11 +
 .../jshint/node_modules/cli/examples/sort.js       |   18 +
 .../jshint/node_modules/cli/examples/spinner.js    |    9 +
 .../jshint/node_modules/cli/examples/static.coffee |   27 +
 .../jshint/node_modules/cli/examples/static.js     |   25 +
 .../node_modules/jshint/node_modules/cli/index.js  |    1 +
 .../node_modules/cli/node_modules/glob/.npmignore  |    2 +
 .../node_modules/cli/node_modules/glob/.travis.yml |    3 +
 .../node_modules/cli/node_modules/glob/LICENSE     |   27 +
 .../node_modules/cli/node_modules/glob/README.md   |  250 +
 .../cli/node_modules/glob/examples/g.js            |    9 +
 .../cli/node_modules/glob/examples/usr-local.js    |    9 +
 .../node_modules/cli/node_modules/glob/glob.js     |  675 +
 .../glob/node_modules/graceful-fs/.npmignore       |    1 +
 .../glob/node_modules/graceful-fs/LICENSE          |   23 +
 .../glob/node_modules/graceful-fs/README.md        |    5 +
 .../glob/node_modules/graceful-fs/graceful-fs.js   |  316 +
 .../glob/node_modules/graceful-fs/package.json     |   36 +
 .../glob/node_modules/graceful-fs/test/open.js     |   46 +
 .../glob/node_modules/inherits/README.md           |   51 +
 .../glob/node_modules/inherits/inherits.js         |   29 +
 .../glob/node_modules/inherits/package.json        |   27 +
 .../cli/node_modules/glob/package.json             |   39 +
 .../cli/node_modules/glob/test/00-setup.js         |  176 +
 .../cli/node_modules/glob/test/bash-comparison.js  |   63 +
 .../cli/node_modules/glob/test/bash-results.json   |  350 +
 .../cli/node_modules/glob/test/cwd-test.js         |   55 +
 .../cli/node_modules/glob/test/globstar-match.js   |   19 +
 .../cli/node_modules/glob/test/mark.js             |   74 +
 .../cli/node_modules/glob/test/nocase-nomagic.js   |  113 +
 .../cli/node_modules/glob/test/pause-resume.js     |   73 +
 .../cli/node_modules/glob/test/root-nomount.js     |   39 +
 .../cli/node_modules/glob/test/root.js             |   46 +
 .../cli/node_modules/glob/test/stat.js             |   32 +
 .../cli/node_modules/glob/test/zz-cleanup.js       |   11 +
 .../jshint/node_modules/cli/package.json           |   57 +
 .../jshint/node_modules/esprima/.npmignore         |    8 +
 .../jshint/node_modules/esprima/CONTRIBUTING.md    |   20 +
 .../jshint/node_modules/esprima/ChangeLog          |   17 +
 .../jshint/node_modules/esprima/LICENSE.BSD        |   19 +
 .../jshint/node_modules/esprima/README.md          |   24 +
 .../jshint/node_modules/esprima/bin/esparse.js     |  117 +
 .../jshint/node_modules/esprima/bin/esvalidate.js  |  199 +
 .../jshint/node_modules/esprima/component.json     |   14 +
 .../jshint/node_modules/esprima/doc/index.html     |  480 +
 .../jshint/node_modules/esprima/esprima.js         | 4038 +
 .../esprima/examples/detectnestedternary.js        |  106 +
 .../esprima/examples/findbooleantrap.js            |  173 +
 .../node_modules/esprima/examples/tokendist.js     |   33 +
 .../jshint/node_modules/esprima/index.html         |  136 +
 .../jshint/node_modules/esprima/package.json       |   55 +
 .../node_modules/esprima/test/benchmarks.html      |  128 +
 .../jshint/node_modules/esprima/test/benchmarks.js |  335 +
 .../jshint/node_modules/esprima/test/compare.html  |  140 +
 .../jshint/node_modules/esprima/test/compare.js    |  328 +
 .../jshint/node_modules/esprima/test/compat.html   |  115 +
 .../jshint/node_modules/esprima/test/compat.js     |  241 +
 .../jshint/node_modules/esprima/test/coverage.html |  110 +
 .../node_modules/esprima/test/esprima.js.html      |11752 +
 .../jshint/node_modules/esprima/test/index.html    |  114 +
 .../jshint/node_modules/esprima/test/module.html   |  112 +
 .../jshint/node_modules/esprima/test/module.js     |  131 +
 .../jshint/node_modules/esprima/test/reflect.js    |  422 +
 .../jshint/node_modules/esprima/test/run.js        |   66 +
 .../jshint/node_modules/esprima/test/runner.js     |  432 +
 .../jshint/node_modules/esprima/test/test.js       |22184 ++
 .../jshint/node_modules/minimatch/LICENSE          |   23 +
 .../jshint/node_modules/minimatch/README.md        |  218 +
 .../jshint/node_modules/minimatch/minimatch.js     | 1079 +
 .../minimatch/node_modules/lru-cache/.npmignore    |    1 +
 .../minimatch/node_modules/lru-cache/AUTHORS       |    8 +
 .../minimatch/node_modules/lru-cache/LICENSE       |   23 +
 .../minimatch/node_modules/lru-cache/README.md     |   97 +
 .../node_modules/lru-cache/lib/lru-cache.js        |  257 +
 .../minimatch/node_modules/lru-cache/package.json  |   59 +
 .../minimatch/node_modules/lru-cache/s.js          |   25 +
 .../minimatch/node_modules/lru-cache/test/basic.js |  329 +
 .../node_modules/lru-cache/test/foreach.js         |   52 +
 .../node_modules/lru-cache/test/memory-leak.js     |   50 +
 .../minimatch/node_modules/sigmund/LICENSE         |   27 +
 .../minimatch/node_modules/sigmund/README.md       |   53 +
 .../minimatch/node_modules/sigmund/bench.js        |  283 +
 .../minimatch/node_modules/sigmund/package.json    |   38 +
 .../minimatch/node_modules/sigmund/sigmund.js      |   39 +
 .../minimatch/node_modules/sigmund/test/basic.js   |   24 +
 .../jshint/node_modules/minimatch/package.json     |   36 +
 .../jshint/node_modules/minimatch/test/basic.js    |  399 +
 .../node_modules/minimatch/test/brace-expand.js    |   33 +
 .../jshint/node_modules/minimatch/test/caching.js  |   14 +
 .../jshint/node_modules/minimatch/test/defaults.js |  274 +
 .../jshint/node_modules/peakle/.npmignore          |    1 +
 .../jshint/node_modules/peakle/LICENSE             |   19 +
 .../node_modules/jshint/node_modules/peakle/README |   40 +
 .../jshint/node_modules/peakle/grunt.js            |   28 +
 .../jshint/node_modules/peakle/package.json        |   20 +
 .../jshint/node_modules/peakle/peakle.js           |   59 +
 .../jshint/node_modules/peakle/test.js             |   49 +
 .../jshint/node_modules/underscore/.npmignore      |    4 +
 .../jshint/node_modules/underscore/.travis.yml     |    5 +
 .../jshint/node_modules/underscore/CNAME           |    1 +
 .../jshint/node_modules/underscore/CONTRIBUTING.md |    9 +
 .../jshint/node_modules/underscore/LICENSE         |   22 +
 .../jshint/node_modules/underscore/README.md       |   19 +
 .../jshint/node_modules/underscore/favicon.ico     |  Bin 0 -> 1406 bytes
 .../jshint/node_modules/underscore/index.html      | 2467 +
 .../jshint/node_modules/underscore/index.js        |    1 +
 .../jshint/node_modules/underscore/package.json    |   32 +
 .../node_modules/underscore/underscore-min.js      |    1 +
 .../jshint/node_modules/underscore/underscore.js   | 1226 +
 .../shelljs/node_modules/jshint/package.json       |   43 +
 .../shelljs/node_modules/jshint/res/jshint.ai      | 4372 +
 .../shelljs/node_modules/jshint/src/cli/cli.js     |  398 +
 .../node_modules/jshint/src/next/constants.js      |   43 +
 .../shelljs/node_modules/jshint/src/next/jshint.js |  194 +
 .../shelljs/node_modules/jshint/src/next/reason.js |  302 +
 .../shelljs/node_modules/jshint/src/next/regexp.js |  125 +
 .../shelljs/node_modules/jshint/src/next/utils.js  |  359 +
 .../node_modules/jshint/src/platforms/rhino.js     |   86 +
 .../jshint/src/reporters/checkstyle.js             |  107 +
 .../node_modules/jshint/src/reporters/default.js   |   34 +
 .../jshint/src/reporters/jslint_xml.js             |   56 +
 .../node_modules/jshint/src/reporters/non_error.js |   45 +
 .../node_modules/jshint/src/shared/messages.js     |  206 +
 .../shelljs/node_modules/jshint/src/shared/vars.js |  395 +
 .../node_modules/jshint/src/stable/jshint.js       | 3692 +
 .../shelljs/node_modules/jshint/src/stable/lex.js  | 1650 +
 .../shelljs/node_modules/jshint/src/stable/reg.js  |   34 +
 .../node_modules/jshint/src/stable/state.js        |   22 +
 .../node_modules/jshint/src/stable/style.js        |  171 +
 .../shelljs/node_modules/jshint/tests/cli.js       |  439 +
 .../jshint/tests/next/fixtures/parser/comments.js  |   13 +
 .../tests/next/fixtures/parser/simple_file.js      |    9 +
 .../jshint/tests/next/fixtures/parser/tokens.json  |  398 +
 .../jshint/tests/next/fixtures/reason/arguments.js |   28 +
 .../jshint/tests/next/fixtures/reason/asi.js       |   46 +
 .../jshint/tests/next/fixtures/reason/bitwise.js   |   21 +
 .../tests/next/fixtures/reason/comparison.js       |   51 +
 .../jshint/tests/next/fixtures/reason/debugger.js  |    7 +
 .../jshint/tests/next/fixtures/reason/esprima.js   |    5 +
 .../tests/next/fixtures/reason/expr_in_test.js     |   11 +
 .../jshint/tests/next/fixtures/reason/fifty.js     |   58 +
 .../jshint/tests/next/fixtures/reason/iterator.js  |   26 +
 .../jshint/tests/next/fixtures/reason/native.js    |   24 +
 .../jshint/tests/next/fixtures/reason/proto.js     |   38 +
 .../jshint/tests/next/fixtures/reason/shadow.js    |   19 +
 .../jshint/tests/next/fixtures/reason/trailing.js  |   10 +
 .../jshint/tests/next/fixtures/reason/undef.js     |   42 +
 .../jshint/tests/next/fixtures/regexp/dashes.js    |   10 +
 .../tests/next/fixtures/utils/simple_file.js       |    9 +
 .../node_modules/jshint/tests/next/lib/helpers.js  |  121 +
 .../node_modules/jshint/tests/next/unit/parser.js  |   84 +
 .../node_modules/jshint/tests/next/unit/reason.js  |  130 +
 .../node_modules/jshint/tests/next/unit/regexp.js  |   39 +
 .../node_modules/jshint/tests/next/unit/utils.js   |  128 +
 .../jshint/tests/stable/helpers/coveraje.js        |   82 +
 .../jshint/tests/stable/helpers/fixture.js         |    7 +
 .../jshint/tests/stable/helpers/testhelper.js      |  148 +
 .../tests/stable/regression/libs/backbone.js       | 1158 +
 .../tests/stable/regression/libs/codemirror3.js    | 4561 +
 .../tests/stable/regression/libs/jquery-1.7.js     | 9304 +
 .../jshint/tests/stable/regression/libs/json2.js   |  487 +
 .../jshint/tests/stable/regression/libs/lodash.js  | 4454 +
 .../tests/stable/regression/libs/prototype-17.js   | 6082 +
 .../jshint/tests/stable/regression/npm.js          |    8 +
 .../jshint/tests/stable/regression/thirdparty.js   |  245 +
 .../node_modules/jshint/tests/stable/unit/core.js  |  623 +
 .../node_modules/jshint/tests/stable/unit/envs.js  |  653 +
 .../jshint/tests/stable/unit/fixtures/asi.js       |   28 +
 .../jshint/tests/stable/unit/fixtures/blocks.js    |   31 +
 .../jshint/tests/stable/unit/fixtures/boss.js      |   33 +
 .../jshint/tests/stable/unit/fixtures/browser.js   |   18 +
 .../jshint/tests/stable/unit/fixtures/camelcase.js |   17 +
 .../tests/stable/unit/fixtures/caseExpressions.js  |   11 +
 .../jshint/tests/stable/unit/fixtures/comma.js     |   50 +
 .../jshint/tests/stable/unit/fixtures/const.js     |   72 +
 .../jshint/tests/stable/unit/fixtures/curly.js     |    8 +
 .../jshint/tests/stable/unit/fixtures/curly2.js    |   11 +
 .../jshint/tests/stable/unit/fixtures/emptystmt.js |   23 +
 .../jshint/tests/stable/unit/fixtures/eqeqeq.js    |   10 +
 .../tests/stable/unit/fixtures/es5.funcexpr.js     |   15 +
 .../jshint/tests/stable/unit/fixtures/es5.js       |   78 +
 .../tests/stable/unit/fixtures/es5Reserved.js      |    8 +
 .../jshint/tests/stable/unit/fixtures/exported.js  |   18 +
 .../jshint/tests/stable/unit/fixtures/forin.js     |   15 +
 .../stable/unit/fixtures/functionScopedOptions.js  |    8 +
 .../jshint/tests/stable/unit/fixtures/gh-226.js    |   21 +
 .../jshint/tests/stable/unit/fixtures/gh-334.js    |   15 +
 .../jshint/tests/stable/unit/fixtures/gh247.js     |   23 +
 .../jshint/tests/stable/unit/fixtures/gh431.js     |   15 +
 .../jshint/tests/stable/unit/fixtures/gh56.js      |    4 +
 .../jshint/tests/stable/unit/fixtures/gh618.js     |    7 +
 .../jshint/tests/stable/unit/fixtures/gh668.js     |    6 +
 .../jshint/tests/stable/unit/fixtures/gh878.js     |    4 +
 .../tests/stable/unit/fixtures/gruntComment.js     |   20 +
 .../tests/stable/unit/fixtures/identifiers.js      |    7 +
 .../jshint/tests/stable/unit/fixtures/ignored.js   |    4 +
 .../jshint/tests/stable/unit/fixtures/immed.js     |   31 +
 .../jshint/tests/stable/unit/fixtures/indent.js    |   12 +
 .../tests/stable/unit/fixtures/insideEval.js       |   17 +
 .../tests/stable/unit/fixtures/jslintInverted.js   |    4 +
 .../tests/stable/unit/fixtures/jslintOptions.js    |    9 +
 .../tests/stable/unit/fixtures/jslintRenamed.js    |    5 +
 .../jshint/tests/stable/unit/fixtures/lastsemic.js |    6 +
 .../jshint/tests/stable/unit/fixtures/latedef.js   |   21 +
 .../tests/stable/unit/fixtures/latedefundef.js     |   46 +
 .../jshint/tests/stable/unit/fixtures/laxbreak.js  |   19 +
 .../jshint/tests/stable/unit/fixtures/laxcomma.js  |   17 +
 .../jshint/tests/stable/unit/fixtures/loopfunc.js  |   11 +
 .../max-cyclomatic-complexity-per-function.js      |   74 +
 .../max-nested-block-depth-per-function.js         |   18 +
 .../unit/fixtures/max-parameters-per-function.js   |    5 +
 .../unit/fixtures/max-statements-per-function.js   |   19 +
 .../jshint/tests/stable/unit/fixtures/maxlen.js    |    3 +
 .../tests/stable/unit/fixtures/missingspaces.js    |    8 +
 .../unit/fixtures/nestedFunctions-locations.js     |    1 +
 .../tests/stable/unit/fixtures/nestedFunctions.js  |   35 +
 .../jshint/tests/stable/unit/fixtures/newcap.js    |   13 +
 .../jshint/tests/stable/unit/fixtures/noarg.js     |    7 +
 .../jshint/tests/stable/unit/fixtures/onevar.js    |   11 +
 .../tests/stable/unit/fixtures/protoiterator.js    |   37 +
 .../jshint/tests/stable/unit/fixtures/quotes.js    |    3 +
 .../jshint/tests/stable/unit/fixtures/quotes2.js   |    3 +
 .../jshint/tests/stable/unit/fixtures/quotes3.js   |   36 +
 .../jshint/tests/stable/unit/fixtures/redef.js     |   11 +
 .../tests/stable/unit/fixtures/regex_array.js      |    6 +
 .../jshint/tests/stable/unit/fixtures/reserved.js  |   15 +
 .../jshint/tests/stable/unit/fixtures/return.js    |   40 +
 .../jshint/tests/stable/unit/fixtures/scope.js     |   43 +
 .../jshint/tests/stable/unit/fixtures/scripturl.js |   11 +
 .../jshint/tests/stable/unit/fixtures/smarttabs.js |   14 +
 .../tests/stable/unit/fixtures/strict_incorrect.js |   59 +
 .../tests/stable/unit/fixtures/strict_newcap.js    |   21 +
 .../tests/stable/unit/fixtures/strict_this.js      |   17 +
 .../tests/stable/unit/fixtures/strict_this2.js     |   18 +
 .../stable/unit/fixtures/strict_violations.js      |    9 +
 .../jshint/tests/stable/unit/fixtures/strings.js   |   25 +
 .../jshint/tests/stable/unit/fixtures/supernew.js  |   11 +
 .../stable/unit/fixtures/switchDefaultFirst.js     |   16 +
 .../stable/unit/fixtures/switchFallThrough.js      |   40 +
 .../jshint/tests/stable/unit/fixtures/trycatch.js  |   24 +
 .../jshint/tests/stable/unit/fixtures/undef.js     |   24 +
 .../tests/stable/unit/fixtures/undef_func.js       |    8 +
 .../tests/stable/unit/fixtures/undefstrict.js      |    6 +
 .../jshint/tests/stable/unit/fixtures/unused.js    |   26 +
 .../tests/stable/unit/fixtures/unusedglobals.js    |    4 +
 .../jshint/tests/stable/unit/fixtures/white.js     |   66 +
 .../jshint/tests/stable/unit/fixtures/with.js      |   16 +
 .../jshint/tests/stable/unit/options.js            | 1472 +
 .../jshint/tests/stable/unit/parser.js             |  522 +
 .../plugman/node_modules/shelljs/package.json      |   44 +
 .../plugman/node_modules/shelljs/scripts/docs.js   |   15 +
 .../node_modules/shelljs/scripts/run-tests.js      |   50 +
 .../plugman/node_modules/shelljs/shell.js          | 1892 +
 .../plugman/node_modules/shelljs/test/.npmignore   |    2 +
 .../plugman/node_modules/shelljs/test/cat.js       |   57 +
 .../plugman/node_modules/shelljs/test/cd.js        |   64 +
 .../plugman/node_modules/shelljs/test/chmod.js     |   81 +
 .../plugman/node_modules/shelljs/test/config.js    |   50 +
 .../plugman/node_modules/shelljs/test/cp.js        |  143 +
 .../plugman/node_modules/shelljs/test/dirs.js      |   37 +
 .../plugman/node_modules/shelljs/test/echo.js      |   50 +
 .../plugman/node_modules/shelljs/test/env.js       |   19 +
 .../plugman/node_modules/shelljs/test/exec.js      |  109 +
 .../plugman/node_modules/shelljs/test/find.js      |   56 +
 .../plugman/node_modules/shelljs/test/grep.js      |   59 +
 .../plugman/node_modules/shelljs/test/ls.js        |  202 +
 .../plugman/node_modules/shelljs/test/make.js      |   20 +
 .../plugman/node_modules/shelljs/test/mkdir.js     |   79 +
 .../plugman/node_modules/shelljs/test/mv.js        |  130 +
 .../plugman/node_modules/shelljs/test/popd.js      |  118 +
 .../plugman/node_modules/shelljs/test/pushd.js     |  228 +
 .../plugman/node_modules/shelljs/test/pwd.js       |   28 +
 .../node_modules/shelljs/test/resources/a.txt      |   11 +
 .../shelljs/test/resources/chmod/file1             |    2 +
 .../node_modules/shelljs/test/resources/cp/a       |    1 +
 .../node_modules/shelljs/test/resources/cp/b       |    1 +
 .../node_modules/shelljs/test/resources/cp/dir_a/z |    1 +
 .../test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z    |    1 +
 .../shelljs/test/resources/external/node_script.js |    2 +
 .../node_modules/shelljs/test/resources/file1      |    1 +
 .../node_modules/shelljs/test/resources/file1.js   |    1 +
 .../node_modules/shelljs/test/resources/file1.txt  |    1 +
 .../node_modules/shelljs/test/resources/file2      |    1 +
 .../node_modules/shelljs/test/resources/file2.js   |    1 +
 .../node_modules/shelljs/test/resources/file2.txt  |    1 +
 .../shelljs/test/resources/find/.hidden            |    1 +
 .../node_modules/shelljs/test/resources/find/a     |    1 +
 .../node_modules/shelljs/test/resources/find/b     |    1 +
 .../shelljs/test/resources/find/dir1/a_dir1        |    1 +
 .../shelljs/test/resources/find/dir1/dir11/a_dir11 |    1 +
 .../shelljs/test/resources/find/dir2/a_dir1        |    1 +
 .../shelljs/test/resources/issue44/main.js         |    1 +
 .../shelljs/test/resources/ls/.hidden_dir/nada     |    1 +
 .../shelljs/test/resources/ls/.hidden_file         |    1 +
 .../test/resources/ls/a_dir/.hidden_dir/nada       |    1 +
 .../shelljs/test/resources/ls/a_dir/b_dir/z        |    1 +
 .../shelljs/test/resources/ls/a_dir/nada           |    1 +
 .../node_modules/shelljs/test/resources/ls/file1   |    1 +
 .../shelljs/test/resources/ls/file1.js             |    1 +
 .../node_modules/shelljs/test/resources/ls/file2   |    1 +
 .../shelljs/test/resources/ls/file2.js             |    1 +
 .../ls/filename(with)[chars$]^that.must+be-escaped |    1 +
 .../shelljs/test/resources/pushd/a/dummy           |    1 +
 .../shelljs/test/resources/pushd/b/c/dummy         |    1 +
 .../plugman/node_modules/shelljs/test/rm.js        |  183 +
 .../plugman/node_modules/shelljs/test/sed.js       |   58 +
 .../plugman/node_modules/shelljs/test/tempdir.js   |   27 +
 .../plugman/node_modules/shelljs/test/test.js      |   91 +
 .../plugman/node_modules/shelljs/test/to.js        |   39 +
 .../plugman/node_modules/shelljs/test/which.js     |   38 +
 .../plugman/node_modules/xcode/.npmignore          |    3 +
 .../plugman/node_modules/xcode/LICENSE             |   14 +
 .../plugman/node_modules/xcode/Makefile            |    5 +
 .../plugman/node_modules/xcode/README.md           |   27 +
 .../plugman/node_modules/xcode/index.js            |    1 +
 .../plugman/node_modules/xcode/lib/parseJob.js     |   16 +
 .../node_modules/xcode/lib/parser/pbxproj.js       | 2659 +
 .../node_modules/xcode/lib/parser/pbxproj.pegjs    |  256 +
 .../plugman/node_modules/xcode/lib/pbxFile.js      |   89 +
 .../plugman/node_modules/xcode/lib/pbxProject.js   |  483 +
 .../plugman/node_modules/xcode/lib/pbxWriter.js    |  282 +
 .../node_modules/xcode/node_modules/.bin/pegjs     |  142 +
 .../xcode/node_modules/node-uuid/.npmignore        |    2 +
 .../xcode/node_modules/node-uuid/LICENSE.md        |    3 +
 .../xcode/node_modules/node-uuid/README.md         |  199 +
 .../node_modules/node-uuid/benchmark/README.md     |   53 +
 .../node_modules/node-uuid/benchmark/bench.gnu     |  174 +
 .../node_modules/node-uuid/benchmark/bench.sh      |   34 +
 .../node-uuid/benchmark/benchmark-native.c         |   34 +
 .../node_modules/node-uuid/benchmark/benchmark.js  |   84 +
 .../xcode/node_modules/node-uuid/package.json      |   31 +
 .../node_modules/node-uuid/test/compare_v1.js      |   63 +
 .../xcode/node_modules/node-uuid/test/test.html    |   17 +
 .../xcode/node_modules/node-uuid/test/test.js      |  240 +
 .../xcode/node_modules/node-uuid/uuid.js           |  249 +
 .../xcode/node_modules/pegjs/CHANGELOG             |  146 +
 .../node_modules/xcode/node_modules/pegjs/LICENSE  |   22 +
 .../xcode/node_modules/pegjs/README.md             |  226 +
 .../node_modules/xcode/node_modules/pegjs/VERSION  |    1 +
 .../xcode/node_modules/pegjs/bin/pegjs             |  142 +
 .../node_modules/pegjs/examples/arithmetics.pegjs  |   22 +
 .../xcode/node_modules/pegjs/examples/css.pegjs    |  554 +
 .../node_modules/pegjs/examples/javascript.pegjs   | 1530 +
 .../xcode/node_modules/pegjs/examples/json.pegjs   |  120 +
 .../xcode/node_modules/pegjs/lib/peg.js            | 5141 +
 .../xcode/node_modules/pegjs/package.json          |   30 +
 .../plugman/node_modules/xcode/package.json        |   33 +
 .../node_modules/xcode/test/addFramework.js        |  136 +
 .../node_modules/xcode/test/addHeaderFile.js       |   78 +
 .../node_modules/xcode/test/addResourceFile.js     |  146 +
 .../node_modules/xcode/test/addSourceFile.js       |  142 +
 .../xcode/test/fixtures/buildFiles.json            |    1 +
 .../xcode/test/fixtures/full-project.json          |    1 +
 .../node_modules/xcode/test/parser/build-config.js |   30 +
 .../node_modules/xcode/test/parser/comments.js     |   12 +
 .../plugman/node_modules/xcode/test/parser/hash.js |   35 +
 .../xcode/test/parser/header-search.js             |   16 +
 .../test/parser/projects/build-config.pbxproj      |  112 +
 .../xcode/test/parser/projects/build-files.pbxproj |   41 +
 .../xcode/test/parser/projects/comments.pbxproj    |   30 +
 .../xcode/test/parser/projects/fail.pbxproj        |   18 +
 .../test/parser/projects/file-references.pbxproj   |   45 +
 .../xcode/test/parser/projects/full.pbxproj        |  534 +
 .../xcode/test/parser/projects/hash.pbxproj        |    9 +
 .../test/parser/projects/header-search.pbxproj     |   47 +
 .../test/parser/projects/nested-object.pbxproj     |   39 +
 .../test/parser/projects/section-entries.pbxproj   |   28 +
 .../xcode/test/parser/projects/section.pbxproj     |   17 +
 .../test/parser/projects/two-sections.pbxproj      |   29 +
 .../xcode/test/parser/projects/with_array.pbxproj  |   18 +
 .../xcode/test/parser/section-entries.js           |   25 +
 .../node_modules/xcode/test/parser/section.js      |   28 +
 .../node_modules/xcode/test/parser/two-sections.js |   18 +
 .../node_modules/xcode/test/parser/with_array.js   |   39 +
 .../plugman/node_modules/xcode/test/pbxFile.js     |  175 +
 .../plugman/node_modules/xcode/test/pbxProject.js  |  155 +
 .../plugman/node_modules/xcode/test/pbxWriter.js   |   75 +
 .../node_modules/xcode/test/removeFramework.js     |  103 +
 .../node_modules/xcode/test/removeHeaderFile.js    |  105 +
 .../node_modules/xcode/test/removeResourceFile.js  |  184 +
 .../node_modules/xcode/test/removeSourceFile.js    |  131 +
 .../blackberry10/node_modules/plugman/package.json |   43 +
 .../node_modules/plugman/platforms/android.js      |  207 +
 .../node_modules/plugman/platforms/bb10.js         |  119 +
 .../node_modules/plugman/platforms/ios.js          |  321 +
 .../node_modules/plugman/platforms/www.js          |   43 +
 .../blackberry10/node_modules/plugman/plugman.js   |  126 +
 .../plugman/test/android-one-install.js            |  145 +
 .../plugman/test/android-one-uninstall.js          |  163 +
 .../plugman/test/android-two-install.js            |  157 +
 .../plugman/test/android-two-uninstall.js          |  173 +
 .../node_modules/plugman/test/bb10-install.js      |   98 +
 .../node_modules/plugman/test/bb10-uninstall.js    |  111 +
 .../node_modules/plugman/test/config-changes.js    |   57 +
 .../node_modules/plugman/test/dummy.xml            |   87 +
 .../node_modules/plugman/test/equalNodes.js        |   77 +
 .../node_modules/plugman/test/ios-install.js       |  260 +
 .../node_modules/plugman/test/ios-uninstall.js     |  238 +
 .../node_modules/plugman/test/multiple-children.js |  132 +
 .../multiple-children/project/AndroidManifest.xml  |   21 +
 .../plugman/test/plugins/ChildBrowser/plugin.xml   |   83 +
 .../ChildBrowser/src/android/ChildBrowser.java     |   19 +
 .../src/ios/ChildBrowser.bundle/arrow_left.png     |  Bin 0 -> 2946 bytes
 .../src/ios/ChildBrowser.bundle/arrow_left@2x.png  |  Bin 0 -> 2946 bytes
 .../src/ios/ChildBrowser.bundle/arrow_right.png    |  Bin 0 -> 2946 bytes
 .../src/ios/ChildBrowser.bundle/arrow_right@2x.png |  Bin 0 -> 2946 bytes
 .../src/ios/ChildBrowser.bundle/but_refresh.png    |  Bin 0 -> 3369 bytes
 .../src/ios/ChildBrowser.bundle/but_refresh@2x.png |  Bin 0 -> 3369 bytes
 .../src/ios/ChildBrowser.bundle/compass.png        |  Bin 0 -> 3035 bytes
 .../src/ios/ChildBrowser.bundle/compass@2x.png     |  Bin 0 -> 3035 bytes
 .../ChildBrowser/src/ios/ChildBrowserCommand.h     |   49 +
 .../ChildBrowser/src/ios/ChildBrowserCommand.m     |   86 +
 .../src/ios/ChildBrowserViewController.h           |   73 +
 .../src/ios/ChildBrowserViewController.m           |  239 +
 .../src/ios/ChildBrowserViewController.xib         |  875 +
 .../plugins/ChildBrowser/src/ios/TargetDirTest.h   |   20 +
 .../plugins/ChildBrowser/src/ios/TargetDirTest.m   |    1 +
 .../src/ios/preserveDirs/PreserveDirsTest.h        |   20 +
 .../src/ios/preserveDirs/PreserveDirsTest.m        |    1 +
 .../test/plugins/ChildBrowser/www/childbrowser.js  |   19 +
 .../ChildBrowser/www/childbrowser/image.jpg        |    1 +
 .../plugman/test/plugins/DummyPlugin/plugin.xml    |   93 +
 .../plugins/DummyPlugin/src/BlackBerry10/client.js |   19 +
 .../plugins/DummyPlugin/src/BlackBerry10/index.js  |   19 +
 .../DummyPlugin/src/android/DummyPlugin.java       |   19 +
 .../test/plugins/DummyPlugin/www/dummyplugin.js    |   19 +
 .../plugins/DummyPlugin/www/dummyplugin/image.jpg  |    1 +
 .../test/plugins/WebNotifications/plugin.xml       |   45 +
 .../WebNotifications/src/ios/AppDelegate.m.diff    |   18 +
 .../WebNotifications/src/ios/WebNotifications.h    |   35 +
 .../WebNotifications/src/ios/WebNotifications.m    |  124 +
 .../WebNotifications/www/webnotifications.js       |  123 +
 .../plugman/test/plugins/WeblessPlugin/plugin.xml  |   74 +
 .../WeblessPlugin/src/android/WeblessPlugin.java   |   19 +
 .../src/ios/WeblessPlugin.bundle/arrow_left.png    |  Bin 0 -> 2946 bytes
 .../src/ios/WeblessPlugin.bundle/arrow_left@2x.png |  Bin 0 -> 2946 bytes
 .../src/ios/WeblessPlugin.bundle/arrow_right.png   |  Bin 0 -> 2946 bytes
 .../ios/WeblessPlugin.bundle/arrow_right@2x.png    |  Bin 0 -> 2946 bytes
 .../src/ios/WeblessPlugin.bundle/but_refresh.png   |  Bin 0 -> 3369 bytes
 .../ios/WeblessPlugin.bundle/but_refresh@2x.png    |  Bin 0 -> 3369 bytes
 .../src/ios/WeblessPlugin.bundle/compass.png       |  Bin 0 -> 3035 bytes
 .../src/ios/WeblessPlugin.bundle/compass@2x.png    |  Bin 0 -> 3035 bytes
 .../WeblessPlugin/src/ios/WeblessPluginCommand.h   |   49 +
 .../WeblessPlugin/src/ios/WeblessPluginCommand.m   |   86 +
 .../src/ios/WeblessPluginViewController.h          |   73 +
 .../src/ios/WeblessPluginViewController.m          |  239 +
 .../src/ios/WeblessPluginViewController.xib        |  875 +
 .../plugman/test/plugins/cordova.echo/plugin.xml   |   25 +
 .../plugins/cordova.echo/src/BlackBerry10/index.js |   85 +
 .../src/BlackBerry10/native/device/echoJnext.so    |  Bin 0 -> 1291818 bytes
 .../src/BlackBerry10/native/public/json/autolink.h |   38 +
 .../src/BlackBerry10/native/public/json/config.h   |   62 +
 .../src/BlackBerry10/native/public/json/features.h |   61 +
 .../src/BlackBerry10/native/public/json/forwards.h |   58 +
 .../src/BlackBerry10/native/public/json/json.h     |   29 +
 .../src/BlackBerry10/native/public/json/reader.h   |  215 +
 .../src/BlackBerry10/native/public/json/value.h    | 1088 +
 .../src/BlackBerry10/native/public/json/writer.h   |  193 +
 .../native/public/json_batchallocator.h            |  144 +
 .../native/public/json_internalarray.inl           |  448 +
 .../native/public/json_internalmap.inl             |  607 +
 .../src/BlackBerry10/native/public/json_reader.cpp |  913 +
 .../src/BlackBerry10/native/public/json_value.cpp  | 1745 +
 .../native/public/json_valueiterator.inl           |  292 +
 .../src/BlackBerry10/native/public/json_writer.cpp |  848 +
 .../src/BlackBerry10/native/public/plugin.cpp      |  339 +
 .../src/BlackBerry10/native/public/plugin.h        |   89 +
 .../src/BlackBerry10/native/public/tokenizer.cpp   |  241 +
 .../src/BlackBerry10/native/public/tokenizer.h     |   74 +
 .../src/BlackBerry10/native/simulator/echoJnext.so |  Bin 0 -> 231778 bytes
 .../src/BlackBerry10/native/src/echo.cpp           |  121 +
 .../src/BlackBerry10/native/src/echo.hpp           |   45 +
 .../test/plugins/cordova.echo/www/client.js        |   53 +
 .../test/plugins/multiple-children/plugin.xml      |  109 +
 .../test/projects/BlackBerry10/www/config.xml      |   97 +
 .../test/projects/BlackBerry10/www/plugins.xml     |   35 +
 .../test/projects/android_one/AndroidManifest.xml  |   69 +
 .../test/projects/android_one/res/xml/plugins.xml  |   38 +
 .../test/projects/android_two/AndroidManifest.xml  |   69 +
 .../test/projects/android_two/res/xml/config.xml   |   54 +
 .../CordovaLib.xcodeproj/project.pbxproj           |  636 +
 .../SampleApp.xcodeproj/project.orig.pbxproj       |  498 +
 .../SampleApp.xcodeproj/project.pbxproj            |  498 +
 .../projects/ios-config-xml/SampleApp/config.xml   |   59 +
 .../CordovaLib.xcodeproj/project.pbxproj           |  636 +
 .../ios/SampleApp.xcodeproj/project.orig.pbxproj   |  498 +
 .../ios/SampleApp.xcodeproj/project.pbxproj        |  498 +
 .../test/projects/ios/SampleApp/PhoneGap.plist     |   53 +
 .../projects/multiple-children/AndroidManifest.xml |   69 +
 .../projects/multiple-children/res/xml/plugins.xml |   38 +
 .../node_modules/plugman/test/remote-test.js       |   45 +
 .../node_modules/plugman/test/www-only.js          |   80 +
 .../node_modules/plugman/util/config-changes.js    |   38 +
 .../blackberry10/node_modules/plugman/util/fs.js   |   34 +
 .../node_modules/plugman/util/plugins.js           |  106 +
 .../node_modules/plugman/util/xml-helpers.js       |  175 +
 .../blackberry10/node_modules/validator/.npmignore |    1 +
 .../blackberry10/node_modules/validator/LICENSE    |   20 +
 .../blackberry10/node_modules/validator/README.md  |  221 +
 .../blackberry10/node_modules/validator/index.html |   15 +
 .../blackberry10/node_modules/validator/index.js   |    1 +
 .../node_modules/validator/lib/defaultError.js     |   33 +
 .../node_modules/validator/lib/entities.js         |  291 +
 .../node_modules/validator/lib/filter.js           |  102 +
 .../node_modules/validator/lib/index.js            |   16 +
 .../node_modules/validator/lib/validator.js        |   42 +
 .../node_modules/validator/lib/validators.js       |  155 +
 .../blackberry10/node_modules/validator/lib/xss.js |  203 +
 .../node_modules/validator/package.json            |   64 +
 .../blackberry10/node_modules/validator/test.js    |    4 +
 .../node_modules/validator/test/filter.test.js     |  145 +
 .../node_modules/validator/test/run.js             |    8 +
 .../node_modules/validator/test/validator.test.js  |  604 +
 .../node_modules/validator/validator-min.js        |   22 +
 .../node_modules/validator/validator.js            |  865 +
 .../blackberry10/node_modules/wrench/.npmignore    |    2 +
 .../blackberry10/node_modules/wrench/LICENSE       |   21 +
 .../blackberry10/node_modules/wrench/lib/wrench.js |  399 +
 .../blackberry10/node_modules/wrench/lib/x.js      |    1 +
 .../blackberry10/node_modules/wrench/package.json  |   40 +
 .../blackberry10/node_modules/wrench/readme.md     |   60 +
 .../node_modules/wrench/tests/mkdir.js             |   26 +
 .../node_modules/wrench/tests/readdir.js           |   52 +
 .../node_modules/wrench/tests/runner.js            |    7 +
 .../blackberry10/node_modules/xml2js/.npmignore    |    2 +
 .../blackberry10/node_modules/xml2js/Cakefile      |   12 +
 .../blackberry10/node_modules/xml2js/LICENSE       |   19 +
 .../blackberry10/node_modules/xml2js/README.md     |  139 +
 .../blackberry10/node_modules/xml2js/lib/xml2js.js |  152 +
 .../node_modules/xml2js/node_modules/sax/AUTHORS   |   10 +
 .../node_modules/xml2js/node_modules/sax/LICENSE   |   32 +
 .../xml2js/node_modules/sax/LICENSE-W3C.html       |  188 +
 .../node_modules/xml2js/node_modules/sax/README.md |  216 +
 .../xml2js/node_modules/sax/component.json         |   12 +
 .../node_modules/sax/examples/big-not-pretty.xml   | 8002 +
 .../xml2js/node_modules/sax/examples/example.js    |   29 +
 .../node_modules/sax/examples/get-products.js      |   58 +
 .../node_modules/sax/examples/hello-world.js       |    4 +
 .../node_modules/sax/examples/not-pretty.xml       |    8 +
 .../node_modules/sax/examples/pretty-print.js      |   74 +
 .../xml2js/node_modules/sax/examples/shopping.xml  |    2 +
 .../xml2js/node_modules/sax/examples/strict.dtd    |  870 +
 .../xml2js/node_modules/sax/examples/test.html     |   15 +
 .../xml2js/node_modules/sax/examples/test.xml      | 1254 +
 .../xml2js/node_modules/sax/lib/sax.js             | 1315 +
 .../xml2js/node_modules/sax/package.json           |   64 +
 .../xml2js/node_modules/sax/test/attribute-name.js |   33 +
 .../xml2js/node_modules/sax/test/buffer-overrun.js |   26 +
 .../xml2js/node_modules/sax/test/case.js           |   50 +
 .../xml2js/node_modules/sax/test/cdata-chunked.js  |   11 +
 .../node_modules/sax/test/cdata-end-split.js       |   15 +
 .../xml2js/node_modules/sax/test/cdata-fake-end.js |   28 +
 .../xml2js/node_modules/sax/test/cdata-multiple.js |   15 +
 .../xml2js/node_modules/sax/test/cdata.js          |   10 +
 .../xml2js/node_modules/sax/test/cyrillic.js       |    8 +
 .../node_modules/sax/test/duplicate-attribute.js   |   13 +
 .../xml2js/node_modules/sax/test/entities.js       |   10 +
 .../xml2js/node_modules/sax/test/entity-mega.js    |   16 +
 .../xml2js/node_modules/sax/test/index.js          |   86 +
 .../xml2js/node_modules/sax/test/issue-23.js       |   43 +
 .../xml2js/node_modules/sax/test/issue-30.js       |   24 +
 .../xml2js/node_modules/sax/test/issue-35.js       |   15 +
 .../xml2js/node_modules/sax/test/issue-47.js       |   12 +
 .../xml2js/node_modules/sax/test/issue-49.js       |   31 +
 .../xml2js/node_modules/sax/test/issue-84.js       |   13 +
 .../node_modules/sax/test/parser-position.js       |   28 +
 .../node_modules/sax/test/script-close-better.js   |   12 +
 .../xml2js/node_modules/sax/test/script.js         |   12 +
 .../sax/test/self-closing-child-strict.js          |   44 +
 .../node_modules/sax/test/self-closing-child.js    |   44 +
 .../node_modules/sax/test/self-closing-tag.js      |   25 +
 .../xml2js/node_modules/sax/test/stray-ending.js   |   17 +
 .../sax/test/trailing-attribute-no-value.js        |   10 +
 .../sax/test/trailing-non-whitespace.js            |   18 +
 .../xml2js/node_modules/sax/test/unclosed-root.js  |   11 +
 .../xml2js/node_modules/sax/test/unquoted.js       |   18 +
 .../xml2js/node_modules/sax/test/xmlns-issue-41.js |   68 +
 .../node_modules/sax/test/xmlns-rebinding.js       |   63 +
 .../xml2js/node_modules/sax/test/xmlns-strict.js   |   74 +
 .../xml2js/node_modules/sax/test/xmlns-unbound.js  |   15 +
 .../node_modules/sax/test/xmlns-xml-default-ns.js  |   31 +
 .../sax/test/xmlns-xml-default-prefix-attribute.js |   36 +
 .../sax/test/xmlns-xml-default-prefix.js           |   21 +
 .../sax/test/xmlns-xml-default-redefine.js         |   41 +
 .../blackberry10/node_modules/xml2js/package.json  |   89 +
 .../node_modules/xml2js/src/xml2js.coffee          |  142 +
 .../node_modules/xml2js/test/fixtures/sample.xml   |   34 +
 .../node_modules/xml2js/test/xml2js.test.coffee    |  154 +
 .../blackberry10/node_modules/zip/CHANGES.md       |   25 +
 .../blackberry10/node_modules/zip/LICENSE          |   19 +
 .../blackberry10/node_modules/zip/README.md        |   14 +
 .../blackberry10/node_modules/zip/inflate.js       |  754 +
 .../zip/node_modules/q-io-buffer/LICENSE           |   19 +
 .../zip/node_modules/q-io-buffer/README            |    1 +
 .../zip/node_modules/q-io-buffer/package.json      |   36 +
 .../zip/node_modules/q-io-buffer/q-io-buffer.js    |   61 +
 .../node_modules/zip/node_modules/q-io/CHANGES     |   26 +
 .../node_modules/zip/node_modules/q-io/LICENSE     |   19 +
 .../node_modules/zip/node_modules/q-io/README      |    4 +
 .../zip/node_modules/q-io/package.json             |   36 +
 .../node_modules/zip/node_modules/q-io/q-io.js     |  208 +
 .../zip/node_modules/q-io/test/issues/1.js         |   24 +
 .../node_modules/zip/node_modules/q/.npmignore     |    3 +
 .../node_modules/zip/node_modules/q/CHANGES.md     |  319 +
 .../node_modules/zip/node_modules/q/LICENSE        |   19 +
 .../node_modules/zip/node_modules/q/README.md      |  789 +
 .../node_modules/zip/node_modules/q/TODO           |    1 +
 .../zip/node_modules/q/design/README.js            | 1026 +
 .../node_modules/zip/node_modules/q/design/q0.js   |   22 +
 .../node_modules/zip/node_modules/q/design/q1.js   |   26 +
 .../node_modules/zip/node_modules/q/design/q2.js   |   33 +
 .../node_modules/zip/node_modules/q/design/q3.js   |   30 +
 .../node_modules/zip/node_modules/q/design/q4.js   |   48 +
 .../node_modules/zip/node_modules/q/design/q5.js   |   56 +
 .../node_modules/zip/node_modules/q/design/q6.js   |   64 +
 .../node_modules/zip/node_modules/q/design/q7.js   |  126 +
 .../q/examples/async-generators/0.html             |   43 +
 .../q/examples/async-generators/1-return.html      |   36 +
 .../async-generators/2-error-propagation.html      |   37 +
 .../async-generators/3-wishful-thinking.html       |   36 +
 .../q/examples/async-generators/README.md          |   66 +
 .../zip/node_modules/q/examples/delay.js           |   13 +
 .../zip/node_modules/q/examples/join.js            |   14 +
 .../zip/node_modules/q/examples/shallow-deep.js    |   43 +
 .../zip/node_modules/q/examples/step1.js           |   16 +
 .../zip/node_modules/q/examples/step2.js           |   17 +
 .../zip/node_modules/q/examples/step3.js           |   22 +
 .../zip/node_modules/q/examples/then1.js           |   11 +
 .../zip/node_modules/q/examples/then2.js           |   12 +
 .../zip/node_modules/q/examples/then3.js           |   18 +
 .../zip/node_modules/q/examples/view1.js           |   15 +
 .../zip/node_modules/q/examples/view2.js           |   17 +
 .../zip/node_modules/q/examples/view3.js           |   25 +
 .../node_modules/zip/node_modules/q/markm-mzero.js |  217 +
 .../q/node_modules/event-queue/.event-loop.js.un~  |  Bin 0 -> 9550 bytes
 .../q/node_modules/event-queue/.event-queue.js.un~ |  Bin 0 -> 102648 bytes
 .../q/node_modules/event-queue/.package.json.un~   |  Bin 0 -> 87260 bytes
 .../q/node_modules/event-queue/.readme.md.un~      |  Bin 0 -> 25614 bytes
 .../q/node_modules/event-queue/.system.js.un~      |  Bin 0 -> 18136 bytes
 .../q/node_modules/event-queue/event-queue.js      |   97 +
 .../q/node_modules/event-queue/package.json        |   37 +
 .../q/node_modules/event-queue/readme.md           |    5 +
 .../node_modules/zip/node_modules/q/package.json   |   67 +
 .../node_modules/zip/node_modules/q/q.js           |  811 +
 .../node_modules/zip/node_modules/q/q.min.js       |   11 +
 .../node_modules/zip/node_modules/q/ref_send.md    |   26 +
 .../node_modules/zip/node_modules/q/test.js        |   32 +
 .../node_modules/zip/node_modules/q/test/all.js    |   16 +
 .../zip/node_modules/q/test/issue/22.js            |   16 +
 .../zip/node_modules/q/test/issue/9.js             |   13 +
 .../node_modules/zip/node_modules/q/test/join.js   |   10 +
 .../zip/node_modules/q/test/methods.js             |  155 +
 .../zip/node_modules/q/test/multiple-listeners.js  |   60 +
 .../zip/node_modules/q/test/promised-chains.js     |  131 +
 .../node_modules/zip/node_modules/q/test/reject.js |   50 +
 .../zip/node_modules/q/test/resolve-reject.js      |  114 +
 .../zip/node_modules/q/test/thenable.js            |   73 +
 .../zip/node_modules/q/test/value-of.js            |   36 +
 .../blackberry10/node_modules/zip/package.json     |   54 +
 .../blackberry10/node_modules/zip/test.js          |    5 +
 .../blackberry10/node_modules/zip/zip.js           |  385 +
 .../blackberry10/node_modules/zip/zip.zip          |  Bin 0 -> 1522 bytes
 lib/cordova-blackberry/blackberry10/package.json   |   29 +
 .../blackberry10/scripts/lib/conf.js               |   21 +
 .../blackberry10/scripts/lib/utils.js              |  127 +
 .../blackberry10/scripts/test.js                   |   58 +
 lib/cordova-blackberry/build.xml                   |  342 -
 .../framework/ext-air/Cordova_Network/library.xml  |   40 -
 .../src/org/apache/cordova/network/Network.as      |   88 -
 .../framework/ext-qnx/org.apache.cordova/client.js |   16 -
 .../framework/ext-qnx/org.apache.cordova/index.js  |   34 -
 .../ext-qnx/org.apache.cordova/manifest.json       |    5 -
 lib/cordova-blackberry/framework/ext-qnx/readme.md |    1 -
 lib/cordova-blackberry/framework/ext/.classpath    |    7 -
 lib/cordova-blackberry/framework/ext/.project      |   29 -
 .../net.rim.browser.tools.debug.widget.prefs       |    3 -
 .../ext/.settings/org.eclipse.jdt.core.prefs       |   12 -
 .../framework/ext/BlackBerry_App_Descriptor.xml    |   36 -
 .../framework/ext/src/library.xml                  |   35 -
 .../src/org/apache/cordova/CordovaExtension.java   |  208 -
 .../cordova/accelerometer/Accelerometer.java       |  228 -
 .../ext/src/org/apache/cordova/api/IPlugin.java    |   71 -
 .../ext/src/org/apache/cordova/api/Plugin.java     |  114 -
 .../src/org/apache/cordova/api/PluginManager.java  |  168 -
 .../apache/cordova/api/PluginManagerFunction.java  |  240 -
 .../src/org/apache/cordova/api/PluginResult.java   |  152 -
 .../ext/src/org/apache/cordova/app/App.java        |  147 -
 .../src/org/apache/cordova/battery/Battery.java    |  210 -
 .../ext/src/org/apache/cordova/camera/Camera.java  |  470 -
 .../org/apache/cordova/camera/CameraOptions.java   |  193 -
 .../org/apache/cordova/camera/PhotoListener.java   |  107 -
 .../cordova/capture/AudioCaptureListener.java      |   80 -
 .../cordova/capture/AudioCaptureOperation.java     |  173 -
 .../org/apache/cordova/capture/AudioControl.java   |   75 -
 .../org/apache/cordova/capture/CameraControl.java  |   87 -
 .../org/apache/cordova/capture/CaptureControl.java |  169 -
 .../org/apache/cordova/capture/CaptureMode.java    |   87 -
 .../apache/cordova/capture/CaptureOperation.java   |  202 -
 .../cordova/capture/ImageCaptureListener.java      |   84 -
 .../cordova/capture/ImageCaptureOperation.java     |  161 -
 .../org/apache/cordova/capture/MediaCapture.java   |  502 -
 .../src/org/apache/cordova/capture/MediaQueue.java |   44 -
 .../cordova/capture/VideoCaptureListener.java      |  107 -
 .../cordova/capture/VideoCaptureOperation.java     |  124 -
 .../ext/src/org/apache/cordova/device/Device.java  |   70 -
 .../ext/src/org/apache/cordova/file/Entry.java     |   66 -
 .../ext/src/org/apache/cordova/file/File.java      |   84 -
 .../src/org/apache/cordova/file/FileManager.java   | 1051 -
 .../apache/cordova/geolocation/Geolocation.java    |  372 -
 .../cordova/geolocation/GeolocationListener.java   |  133 -
 .../cordova/geolocation/GeolocationResult.java     |   73 -
 .../cordova/geolocation/GeolocationStatus.java     |   36 -
 .../org/apache/cordova/geolocation/Position.java   |  133 -
 .../cordova/geolocation/PositionOptions.java       |   42 -
 .../cordova/globalization/Globalization.java       |  558 -
 .../cordova/globalization/GlobalizationError.java  |  115 -
 .../apache/cordova/globalization/Resources.java    |   99 -
 .../src/org/apache/cordova/globalization/Util.java |  721 -
 .../src/org/apache/cordova/http/FileTransfer.java  |  473 -
 .../org/apache/cordova/http/FileUploadResult.java  |   63 -
 .../src/org/apache/cordova/http/FileUploader.java  |  280 -
 .../ext/src/org/apache/cordova/http/HttpUtils.java |   66 -
 .../ext/src/org/apache/cordova/json4j/JSON.java    |  208 -
 .../src/org/apache/cordova/json4j/JSONArray.java   | 1123 -
 .../org/apache/cordova/json4j/JSONArtifact.java    |  118 -
 .../org/apache/cordova/json4j/JSONException.java   |   55 -
 .../src/org/apache/cordova/json4j/JSONObject.java  | 1367 -
 .../src/org/apache/cordova/json4j/JSONString.java  |   32 -
 .../org/apache/cordova/json4j/JSONStringer.java    |   58 -
 .../src/org/apache/cordova/json4j/JSONWriter.java  |  586 -
 .../cordova/json4j/internal/JSON4JNumber.java      |   22 -
 .../cordova/json4j/internal/JSON4JPBackReader.java |   47 -
 .../json4j/internal/JSON4JStringReader.java        |   54 -
 .../json4j/internal/JSON4JStringWriter.java        |   68 -
 .../apache/cordova/json4j/internal/NumberUtil.java |  109 -
 .../org/apache/cordova/json4j/internal/Parser.java |  338 -
 .../apache/cordova/json4j/internal/Serializer.java |  353 -
 .../cordova/json4j/internal/SerializerVerbose.java |  102 -
 .../org/apache/cordova/json4j/internal/Token.java  |  115 -
 .../apache/cordova/json4j/internal/Tokenizer.java  |  619 -
 .../src/org/apache/cordova/media/AudioPlayer.java  |  654 -
 .../ext/src/org/apache/cordova/media/Media.java    |  344 -
 .../cordova/network/ConnectionInfoAction.java      |  355 -
 .../src/org/apache/cordova/network/Network.java    |   66 -
 .../cordova/notification/ActivityDialog.java       |  146 -
 .../apache/cordova/notification/AlertAction.java   |   83 -
 .../apache/cordova/notification/AlertDialog.java   |   68 -
 .../apache/cordova/notification/BeepAction.java    |  160 -
 .../apache/cordova/notification/ConfirmAction.java |   85 -
 .../apache/cordova/notification/ConfirmDialog.java |  100 -
 .../apache/cordova/notification/Notification.java  |  135 -
 .../cordova/notification/ProgressDialog.java       |  182 -
 .../apache/cordova/notification/VibrateAction.java |   64 -
 .../ext/src/org/apache/cordova/pim/Contact.java    |  430 -
 .../ext/src/org/apache/cordova/ui/SpacerField.java |   71 -
 .../org/apache/cordova/util/ApplicationUtils.java  |  108 -
 .../ext/src/org/apache/cordova/util/FileUtils.java |  730 -
 .../ext/src/org/apache/cordova/util/Log.java       |   83 -
 .../src/org/apache/cordova/util/LogFunction.java   |   41 -
 .../ext/src/org/apache/cordova/util/Logger.java    |  155 -
 .../src/org/apache/cordova/util/StringUtils.java   |  103 -
 .../javascript/cordova.blackberry.js               |10857 -
 platforms.js                                       |    2 +-
 spec/compile.spec.js                               |   24 +-
 spec/emulate.spec.js                               |   30 +-
 spec/metadata/blackberry10_parser.spec.js          |  235 +
 spec/metadata/blackberry_parser.spec.js            |  249 -
 spec/platform.spec.js                              |   79 +-
 spec/plugin.spec.js                                |    4 +-
 spec/prepare.spec.js                               |   10 +-
 spec/serve.spec.js                                 |    5 +-
 src/compile.js                                     |   12 +-
 src/emulate.js                                     |   42 +-
 src/metadata/blackberry10_parser.js                |  119 +
 src/metadata/blackberry_parser.js                  |  200 -
 src/platform.js                                    |   41 +-
 src/plugin_loader.js                               |   26 +-
 src/prepare.js                                     |   32 +-
 src/serve.js                                       |   19 +-
 2166 files changed, 608386 insertions(+), 37179 deletions(-)
----------------------------------------------------------------------



[24/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_HK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_HK.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_HK.js.gz
new file mode 100644
index 0000000..cda0352
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_HK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE.js.gz
new file mode 100644
index 0000000..91efb10
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz
new file mode 100644
index 0000000..8933e3d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IN.js.gz
new file mode 100644
index 0000000..db66e86
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_MT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_MT.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_MT.js.gz
new file mode 100644
index 0000000..ea0a479
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_MT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz
new file mode 100644
index 0000000..720baad
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_PH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_PH.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_PH.js.gz
new file mode 100644
index 0000000..7e860ff
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_PH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_SG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_SG.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_SG.js.gz
new file mode 100644
index 0000000..5ffc7ba
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_SG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_US.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_US.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_US.js.gz
new file mode 100644
index 0000000..5e7ed2f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_US.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz
new file mode 100644
index 0000000..c1221b5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es.js.gz
new file mode 100644
index 0000000..f233e90
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_AR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_AR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_AR.js.gz
new file mode 100644
index 0000000..0ca8ffa
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_AR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_BO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_BO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_BO.js.gz
new file mode 100644
index 0000000..1b3c306
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_BO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CL.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CL.js.gz
new file mode 100644
index 0000000..92a324a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CO.js.gz
new file mode 100644
index 0000000..362232d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CR.js.gz
new file mode 100644
index 0000000..53e9e23
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_CR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_DO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_DO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_DO.js.gz
new file mode 100644
index 0000000..26c6fff
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_DO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_EC.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_EC.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_EC.js.gz
new file mode 100644
index 0000000..559db9e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_EC.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES.js.gz
new file mode 100644
index 0000000..819e45d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz
new file mode 100644
index 0000000..589d775
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_GT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_GT.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_GT.js.gz
new file mode 100644
index 0000000..e1aba86
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_GT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_HN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_HN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_HN.js.gz
new file mode 100644
index 0000000..43ce67a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_HN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_MX.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_MX.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_MX.js.gz
new file mode 100644
index 0000000..76a40da
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_MX.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_NI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_NI.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_NI.js.gz
new file mode 100644
index 0000000..86302a5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_NI.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PA.js.gz
new file mode 100644
index 0000000..5f3a6d2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PE.js.gz
new file mode 100644
index 0000000..44a20ec
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PR.js.gz
new file mode 100644
index 0000000..3d60ce9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PY.js.gz
new file mode 100644
index 0000000..c928b88
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_PY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_SV.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_SV.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_SV.js.gz
new file mode 100644
index 0000000..0d3800a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_SV.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_US.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_US.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_US.js.gz
new file mode 100644
index 0000000..2243584
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_US.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_UY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_UY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_UY.js.gz
new file mode 100644
index 0000000..db5ce23
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_UY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_VE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_VE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_VE.js.gz
new file mode 100644
index 0000000..b57e2e1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/es_VE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et.js.gz
new file mode 100644
index 0000000..e685c40
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE.js.gz
new file mode 100644
index 0000000..8ceff8f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz
new file mode 100644
index 0000000..9b4617d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz
new file mode 100644
index 0000000..b45e6fe
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi.js.gz
new file mode 100644
index 0000000..fff6196
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz
new file mode 100644
index 0000000..08c6e67
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz
new file mode 100644
index 0000000..54e241a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr.js.gz
new file mode 100644
index 0000000..9912df3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz
new file mode 100644
index 0000000..af1052d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz
new file mode 100644
index 0000000..35870dc
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz
new file mode 100644
index 0000000..3c3a9b4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz
new file mode 100644
index 0000000..a2136b7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz
new file mode 100644
index 0000000..aa47e36
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz
new file mode 100644
index 0000000..ffb547d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz
new file mode 100644
index 0000000..c664df2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz
new file mode 100644
index 0000000..6b9d6b5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga.js.gz
new file mode 100644
index 0000000..d7d24e7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz
new file mode 100644
index 0000000..7d3c880
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu.js.gz
new file mode 100644
index 0000000..66416b2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz
new file mode 100644
index 0000000..4d0608c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz
new file mode 100644
index 0000000..6b07571
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr.js.gz
new file mode 100644
index 0000000..cbfb8a6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz
new file mode 100644
index 0000000..61c88c4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu.js.gz
new file mode 100644
index 0000000..61e3c8c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz
new file mode 100644
index 0000000..cabecb1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz
new file mode 100644
index 0000000..4d3edc6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz
new file mode 100644
index 0000000..4c914db
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in.js.gz
new file mode 100644
index 0000000..5005d70
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in_ID.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in_ID.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in_ID.js.gz
new file mode 100644
index 0000000..3f982c4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/in_ID.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is.js.gz
new file mode 100644
index 0000000..903b3f2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is_IS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is_IS.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is_IS.js.gz
new file mode 100644
index 0000000..5a7a4cf
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/is_IS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it.js.gz
new file mode 100644
index 0000000..f9ffdb8
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_CH.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_CH.js.gz
new file mode 100644
index 0000000..0c474dd
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_CH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT.js.gz
new file mode 100644
index 0000000..fc88b58
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz
new file mode 100644
index 0000000..ef6be7a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw.js.gz
new file mode 100644
index 0000000..956a656
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz
new file mode 100644
index 0000000..e51daa1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja.js.gz
new file mode 100644
index 0000000..5d604b3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz
new file mode 100644
index 0000000..ef1956f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz
new file mode 100644
index 0000000..358b709
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk.js.gz
new file mode 100644
index 0000000..d1bc61a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz
new file mode 100644
index 0000000..40a1732
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn.js.gz
new file mode 100644
index 0000000..4a668ab
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz
new file mode 100644
index 0000000..f813453
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko.js.gz
new file mode 100644
index 0000000..a3752b4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz
new file mode 100644
index 0000000..a1d6b83
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt.js.gz
new file mode 100644
index 0000000..959e78f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz
new file mode 100644
index 0000000..d981980
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz
new file mode 100644
index 0000000..cf11515
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz
new file mode 100644
index 0000000..c438a65
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv.js.gz
new file mode 100644
index 0000000..a768a43
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz
new file mode 100644
index 0000000..b877f68
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz
new file mode 100644
index 0000000..9a4fa57
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz
new file mode 100644
index 0000000..757c861
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk.js.gz
new file mode 100644
index 0000000..b437e2b
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz
new file mode 100644
index 0000000..9dba801
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz
new file mode 100644
index 0000000..f0553f1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr.js.gz
new file mode 100644
index 0000000..3f00081
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz
new file mode 100644
index 0000000..3f4e42f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms.js.gz
new file mode 100644
index 0000000..47b15ab
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz
new file mode 100644
index 0000000..d4b42f4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt.js.gz
new file mode 100644
index 0000000..f46acdf
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz
new file mode 100644
index 0000000..65bd5d4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz
new file mode 100644
index 0000000..c371c5a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz
new file mode 100644
index 0000000..272ed07
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz
new file mode 100644
index 0000000..953b051
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl.js.gz
new file mode 100644
index 0000000..1fc0521
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz
new file mode 100644
index 0000000..4ea4bd5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz
new file mode 100644
index 0000000..b69f55a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz
new file mode 100644
index 0000000..f10c527
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz
new file mode 100644
index 0000000..a36a696
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no.js.gz
new file mode 100644
index 0000000..2828495
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO.js.gz
new file mode 100644
index 0000000..f027493
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz
new file mode 100644
index 0000000..71e5b02
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/or_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/or_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/or_IN.js.gz
new file mode 100644
index 0000000..fcec744
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/or_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa.js.gz
new file mode 100644
index 0000000..a818414
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz
new file mode 100644
index 0000000..e86fc9d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl.js.gz
new file mode 100644
index 0000000..92a36df
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz
new file mode 100644
index 0000000..be45a80
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz
new file mode 100644
index 0000000..ad0dd65
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz
new file mode 100644
index 0000000..a0c6116
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt.js.gz
new file mode 100644
index 0000000..1a02bc1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz
new file mode 100644
index 0000000..89adc5e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz
new file mode 100644
index 0000000..9f38787
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz
new file mode 100644
index 0000000..5adb184
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro.js.gz
new file mode 100644
index 0000000..3e04e6e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz
new file mode 100644
index 0000000..1ef6e7d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru.js.gz
new file mode 100644
index 0000000..664de07
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz
new file mode 100644
index 0000000..49bc219
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh.js.gz
new file mode 100644
index 0000000..3db9b20
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz
new file mode 100644
index 0000000..0f62a17
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk.js.gz
new file mode 100644
index 0000000..8636208
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz
new file mode 100644
index 0000000..dfb2908
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz
new file mode 100644
index 0000000..baddfcf
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz
new file mode 100644
index 0000000..e1cc9e0
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl.js.gz
new file mode 100644
index 0000000..ac93f3e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz
new file mode 100644
index 0000000..7286da1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz
new file mode 100644
index 0000000..1eabc09
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq.js.gz
new file mode 100644
index 0000000..0a5f716
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz
new file mode 100644
index 0000000..2969ca7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr.js.gz
new file mode 100644
index 0000000..45a8f4b
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz
new file mode 100644
index 0000000..89f8484
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz
new file mode 100644
index 0000000..9d3d758
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz
new file mode 100644
index 0000000..d50466e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz
new file mode 100644
index 0000000..66e041f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz
new file mode 100644
index 0000000..9cc15d6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz
new file mode 100644
index 0000000..a3a9a93
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sr_RS_Latn.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv.js.gz
new file mode 100644
index 0000000..eec6524
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz
new file mode 100644
index 0000000..ec4b9a7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz
new file mode 100644
index 0000000..2f860b9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz
new file mode 100644
index 0000000..1bfce15
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/sv_SE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta.js.gz
new file mode 100644
index 0000000..d7581ea
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz
new file mode 100644
index 0000000..d94fe66
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ta_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te.js.gz
new file mode 100644
index 0000000..c69b725
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te_IN.js.gz
new file mode 100644
index 0000000..2f21145
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/te_IN.js.gz differ


[45/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/README.md b/lib/cordova-blackberry/blackberry/README.md
new file mode 100644
index 0000000..6bac643
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/README.md
@@ -0,0 +1,183 @@
+Cordova BlackBerry WebWorks
+============================
+
+[Cordova framework](http://incubator.apache.org/cordova/) for __BlackBerry Tablet OS, Smartphones and BlackBerry 10 devices__. The framework is implemented using the [BlackBerry WebWorks SDK](http://us.blackberry.com/developers/tablet/webworks.jsp).
+
+Directory Structure
+-------------------
+
+    framework/ ... BlackBerry WebWorks JavaScript Extension (Cordova native code)
+    javascript/ .. Cordova JavaScript (concatenated, non-minified)
+    bin/ ......... Scripts for project creation
+
+Introduction
+------------
+
+BlackBerry WebWorks is a framework for developing web-based applications for BlackBerry SmartPhones (BlackBerry OS 5.0 and higher) and the TabletOS.  Creating a web application is one of the easiest ways to have an application that runs on both platforms.
+
+The WebWorks framework allows developers to create applications using web content and resources (HTML/CSS/JavaScript) that are able to access device features through the [BlackBerry WebWorks API](http://www.blackberry.com/developers/docs/widgetapi/).  In addition, the framework allows developers to create their own WebWorks JavaScript Extensions to expose additional device capabilities through JavaScript APIs.  These extensions are written using either the BlackBerry Java API for SmartPhones, or Adobe AIR for the Tablet OS.
+
+The cordova-blackberry-webworks platform allows web developers to develop applications targeting BlackBerry 5.0 and higher devices using the common [Cordova API](http://docs.cordova.io).  When possible, Cordova makes use of the WebWorks JavaScript API; however, most Cordova features are implemented in the native Java or AIR environment as a WebWorks JavaScript Extension.
+
+
+Getting Started
+===============
+
+Several guides are available on the [Cordova Documentation site](http://docs.cordova.io/) (Getting Started Guides - on the left side near the bottom) to help you get started developing for the cordova-blackberry-webworks platform.  This guide will help you install and configure the BlackBerry WebWorks development environment, and the cordova-blackberry-webworks platform.  It will also step you through the process of creating a Cordova project.
+
+[Getting Started with Cordova BlackBerry WebWorks](http://docs.cordova.io/guide_getting-started_blackberry_index.md.html)
+
+This guide is for advanced developers who wish to develop their own cordova-blackberry-webworks plugin.
+
+[How To Create a Cordova Plugin for Cordova BlackBerry WebWorks](http://docs.cordova.io/guide_plugin-development_blackberry_index.md.html)
+
+
+Installing the cordova-blackberry-webworks Framework
+=====================================================
+
+Cloning the cordova-blackberry-webworks repository always provides you with the latest (EDGE) version of the Cordova code.  To clone the repository, do the following:
+
+    $ cd C:\some\path\
+    $ git clone git://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks.git
+
+Cordova BlackBerry Developer Tools
+---
+
+The Cordova developer tooling is split between general tooling and project level tooling. If you are on Windows, please run the equivalent .bat files instead of the shell scripts :)
+
+### General Commands
+
+    ./bin/create [path appname packagename] ............ creates a sample app with the specified application name, to the specified path
+
+Please note that once you `create` a Cordova BlackBerry project, you
+will need to edit the `project.properties` file that resides inside your
+generated application directory to set up your environment properly. You
+will need to specify things like the location of the BlackBerry Widget
+Packager(s), device and signing key passwords, simulator executables,
+and device IPs (if applicable).
+
+The ./bin/create command is also required to be called in order to automatically download
+the bin/template/project/lib/ant-contrib.jar file. Please be aware that without running
+this command first, your project will not have this important file! Once that ant-contrib.jar
+file is downloaded, there is no need to update that file or download again.
+
+#### Running the Example Project
+
+Create the example project and build it to the first device:
+
+    ./bin/create
+    cd example
+    ./cordova/run blackberry
+
+#### Creating a new Cordova BlackBerry Project
+
+    ./bin/create ~/Desktop/myapp MyAppName MyAppPackageName
+
+### Project Commands
+
+These commands live in a generated Cordova BlackBerry project. As per
+the note above, please make sure you edit the `project.properties` file
+inside your application directory appropriately otherwise these commands
+will not work!
+
+    ./cordova/run ............................ install to a connected device or simulator
+    ./cordova/build .......................... build project, but do not deploy to simulator or device
+
+
+(Legacy) Creating a New Cordova Project
+-------------------------------
+
+The (legacy) Cordova ant build scripts enable you to create multiple, independent Cordova projects.
+
+(Note: The Cordova build script requires Apache ANT 1.8 or higher. Also, these scripts won't work without
+the bin/template/project/lib/ant-contrib.jar file so please run the ./bin/create command to automatically
+download that file or manually download it and place it in the bin/template/lib/ directory.
+
+The build script packages the Cordova source code and resources into each project you create.  This allows you to easily distribute the project to other BlackBerry WebWorks developers.  To create a Cordova project:
+
+    $ cd cordova-blackberry-webworks
+    $ ant help
+
+    $ ant create -Dproject.path="C:\development\my_new_project"
+
+    $ cd C:\development\my_new_project
+    $ ant help
+
+For each project, you need to tell ANT where you installed the BlackBerry WebWorks SDK, which packages and compiles your code into a deployable application.  You can specify the location of the BlackBerry WebWorks Packager (BBWP) by editing __project.properties__ in the project directory.
+
+    [edit project.properties]
+
+Building and Deploying a Project
+--------------------------------
+
+The Cordova build scripts automate common tasks, such as compiling your project, and deploying it to simulators or devices.  To see what options are available, use:
+
+    $ cd C:\development\my_new_project
+    $ ant help
+
+Every command is in the form `ant TARGET COMMAND [options]`, where
+target is either `blackberry` or `playbook`.
+
+To build your project into a deployable application (.cod/.jad) file:
+
+    $ ant TARGET build
+
+To build your project and load it in a BlackBerry simulator:
+
+    $ ant TARGET load-simulator
+
+To build your project and load it onto a USB-attached device:
+
+    $ ant TARGET load-device
+
+Updating the Cordova Framework
+-------------------------------
+
+As you develop your application, there may be updates made to the Cordova source code.  To incorporate Cordova changes into your project, use the build script as follows:
+
+    $ cd cordova-blackberry-webworks
+    $ git pull origin master
+
+    $ ant update -Dproject.path="C:\development\my_new_project"
+
+Customizing Cordova
+--------------------
+
+By default, Cordova gives access to all the core Cordova APIs as detailed at docs.cordova.io.
+If you want to remove some of those APIs you can do so by editing the plugins.xml document in your
+application root. You need to edit the plugins.xml file to add third-party plugins to your application
+as well.
+
+Creating a Distribution
+-----------------------
+
+### Update Version
+
+    $ ant version -Dvalue="1.0.0"
+
+    $ git diff
+    $ git commit -am "Update to version 1.0.0"
+    $ git tag 1.0.0
+
+### Create distribution
+
+    $ ant dist
+
+Troubleshooting
+===============
+
+__Q: I uploaded my application to the BlackBerry device, but it will not open or run.__
+
+__A:__ Try hard resetting the device by pressing and hold ALT + CAPS LOCK + DEL. You must press and hold each key in sequence and not all at once.  Some devices require _either_ the right or left CAPS LOCK key to be pressed.  Some devices also require this combination to be pressed twice.
+
+__Q: My simulator screen is not refreshing and I see blocks on a clicked position.__
+
+__A:__ Windows 7 and the simulator's graphics acceleration do not mix. On the simulator, set View -> Graphics Acceleration to Off.
+
+__Q: When I use the Cordova [Camera.getPicture API](http://docs.cordova.io/cordova_camera_camera.md.html#camera.getPicture) on my device, the camera never returns to my application.  Why does this happen?__
+
+__A:__ Cordova uses a JavaScript Extension to invoke the native camera application so the user can take a picture.  When the picture is taken, Cordova will close the native camera application by emulating a key injection (pressing the back/escape button).  On a physical device, users will have to set permissions to allow the application to simulate key injections.  Setting application permissions is device-specific.  On a Storm2 (9550), for example, select the BlackBerry button from the Home screen to get to All Applications screen, then Options > Applications > Your Application.  Then select Edit Default Permissions > Interactions > Input Simulation and set it to 'Allow'.  Save your changes.
+
+__Q: None of the Cordova APIs are working, why is that?__
+
+__A:__ You probably need to update your plugins.xml file in the root of your application.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/VERSION b/lib/cordova-blackberry/blackberry/VERSION
new file mode 100644
index 0000000..f47de85
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/VERSION
@@ -0,0 +1 @@
+2.6.0rc1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/create
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/create b/lib/cordova-blackberry/blackberry/bin/create
new file mode 100755
index 0000000..54903b8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/create
@@ -0,0 +1,108 @@
+#! /bin/sh
+#       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.
+#
+# create a cordova/blackberry project
+# 
+# USAGE
+#   ./create [path package appname]
+#
+set -e
+
+if [ -n "$1" ] && [ "$1" == "-h" ]
+then
+  echo "Usage: $0 <path_to_new_project> <package_name> <project_name>"
+  echo "    <path_to_new_project>: Path to your new Cordova iOS project"
+  echo "    <package_name>: Package name, following reverse-domain style convention (ignored on BlackBerry platforms)"
+  echo "    <project_name>: Project name"
+  echo 'After you have created your application, make sure to customize the project.properties file inside your app directory with your environment specifics!'
+  exit 0;
+fi
+
+
+BUILD_PATH="$( cd "$( dirname "$0" )/.." && pwd )"
+VERSION=$(cat "$BUILD_PATH/VERSION")
+
+PROJECT_PATH="${1:-"./example"}"
+PACKAGE=${2:-"org.apache.cordova.example"}
+NAME=${3:-"cordovaExample"}
+
+# clobber any existing example
+if [ -d "$PROJECT_PATH" ]
+then
+    echo "Project already exists! Delete and recreate"
+    exit 1
+fi
+
+# cleanup after exit and/or on error
+function on_exit {
+    echo "Cleaning up ..."
+    [ -d "$BUILD_PATH/build" ] && rm -rf "$BUILD_PATH/build"
+    echo "Remember to update the project.properties file inside your application directory!"
+}
+
+function on_error {
+    echo "An error occured. Deleting project..."
+    [ -d "$PROJECT_PATH" ] && rm -rf "$PROJECT_PATH"
+}
+
+function replace {
+    local pattern=$1
+    local filename=$2
+    # Mac OS X requires -i argument
+    if [[ "$OSTYPE" =~ "darwin" ]]
+    then
+        /usr/bin/sed -i '' -e $pattern "$filename"
+    elif [[ "$OSTYPE" =~ "linux" ]]
+    then
+        /bin/sed -i -e $pattern "$filename"
+    fi
+}
+
+# we do not want the script to silently fail
+trap on_error ERR
+trap on_exit EXIT
+
+ANT="$(which ant)"
+
+MANIFEST_PATH="$PROJECT_PATH/www/config.xml"
+
+# compile cordova.js and cordova.jar if in source, ignore if in distribution
+if [ ! -e "$BUILD_PATH/www/ext/cordova-$VERSION.jar" ] && [ -d "$BUILD_PATH/framework" ]
+then
+    if [ ! -e "$BUILD_PATH"/bin/templates/project/lib/ant-contrib/ant-contrib-1.0b3.jar ]; then
+        echo "Downloading ant-contrib"
+        # Use curl to get the jar
+        curl -OL http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar &> /dev/null
+        mkdir -p "$BUILD_PATH"/bin/templates/project/lib/ant-contrib
+        mv ant-contrib-1.0b3.jar "$BUILD_PATH"/bin/templates/project/lib/ant-contrib
+    fi
+    
+	echo "Creating BlackBerry project..."
+	(cd "$BUILD_PATH" && "$ANT" create -Dproject.path="$PROJECT_PATH" &> /dev/null )
+    # interpolate the activity and package into config.xml
+    echo "Updating config.xml ..."
+    replace "s/__NAME__/${NAME}/g" "$MANIFEST_PATH"
+    replace "s/__PACKAGE__/${PACKAGE}/g" "$MANIFEST_PATH"
+else
+	# copy project template if in distribution
+	echo "Copying assets and resources ..."
+	cp -r "$BUILD_PATH/sample/." "$PROJECT_PATH"
+    echo "Updating config.xml ..."
+    replace "s/cordovaExample/${NAME}/g" "$MANIFEST_PATH"
+    replace "s/org.apache.cordova.example/${PACKAGE}/g" "$MANIFEST_PATH"
+fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/create.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/create.bat b/lib/cordova-blackberry/blackberry/bin/create.bat
new file mode 100644
index 0000000..ecb039a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/create.bat
@@ -0,0 +1,33 @@
+@ECHO OFF
+goto comment
+       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.
+:comment
+
+IF NOT DEFINED JAVA_HOME GOTO MISSING
+FOR %%X in (ant.bat) do (
+    SET FOUND=%%~$PATH:X
+    IF NOT DEFINED FOUND GOTO MISSING
+)
+cscript %~dp0\create.js %*
+GOTO END
+:MISSING
+ECHO Missing one of the following:
+ECHO JDK: http://java.oracle.com
+ECHO Apache ant: http://ant.apache.org
+EXIT /B 1
+:END

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/create.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/create.js b/lib/cordova-blackberry/blackberry/bin/create.js
new file mode 100644
index 0000000..ac4b083
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/create.js
@@ -0,0 +1,129 @@
+/*
+       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.
+*/
+
+/*
+ * create a cordova/blackberry project
+ *
+ * USAGE
+ *  ./create [path package appname]
+ */
+
+var fso = WScript.CreateObject('Scripting.FileSystemObject');
+
+function read(filename) {
+    var fso=WScript.CreateObject("Scripting.FileSystemObject");
+    var f=fso.OpenTextFile(filename, 1);
+    var s=f.ReadAll();
+    f.Close();
+    return s;
+}
+function write(filename, contents) {
+    var fso=WScript.CreateObject("Scripting.FileSystemObject");
+    var f=fso.OpenTextFile(filename, 2, true);
+    f.Write(contents);
+    f.Close();
+}
+function replaceInFile(filename, regexp, replacement) {
+    write(filename, read(filename).replace(regexp, replacement));
+}
+function downloadAntContrib(){
+    if (!fso.FileExists(ROOT + '\\bin\\templates\\project\\lib\\ant-contrib\\ant-contrib-1.0b3.jar')) {
+      // We need the .jar
+      var url = 'http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar';
+      var libsPath = ROOT + '\\bin\\templates\\project\\lib\\ant-contrib';
+      var savePath = libsPath + '\\ant-contrib-1.0b3.jar';
+      if (!fso.FileExists(savePath)) {
+        if(!fso.FolderExists(libsPath)) {
+            fso.CreateFolder(libsPath);
+        }
+        // We need the zip to get the jar
+        var xhr = WScript.CreateObject('MSXML2.XMLHTTP');
+        xhr.open('GET', url, false);
+        xhr.send();
+        if (xhr.status == 200) {
+          var stream = WScript.CreateObject('ADODB.Stream');
+          stream.Open();
+          stream.Type = 1;
+          stream.Write(xhr.ResponseBody);
+          stream.Position = 0;
+          stream.SaveToFile(savePath);
+          stream.Close();
+        } else {
+          WScript.Echo('Could not retrieve the antcontrib. Please download it yourself and put into the bin/templates/project/lib directory. This process may fail now. Sorry.');
+        }
+      }
+      var app = WScript.CreateObject('Shell.Application');
+      var source = app.NameSpace(savePath).Items();
+      var target = app.NameSpace(libsPath);
+      target.CopyHere(source, 256);
+    }
+}
+function exec(s, output) {
+    var o=shell.Exec(s);
+    while (o.Status == 0) {
+        WScript.Sleep(100);
+    }
+    //WScript.Echo("Command exited with code " + o.Status);
+}
+
+function cleanup() {
+    // Cleanup
+    if(fso.FolderExists(ROOT + '\\dist')) {
+        fso.DeleteFolder(ROOT + '\\dist', true);
+    }
+    if(fso.FolderExists(ROOT + '\\build')) {
+        fso.DeleteFolder(ROOT + '\\build');
+    }
+}
+
+var args = WScript.Arguments, PROJECT_PATH="example", 
+    PACKAGE="org.apache.cordova.example",
+    NAME="cordovaExample",
+    shell=WScript.CreateObject("WScript.Shell");
+    
+// working dir
+var ROOT = WScript.ScriptFullName.split('\\bin\\create.js').join('');
+
+if (args.Count() == 3) {
+    PROJECT_PATH=args(0);
+    PACKAGE=args(1);
+    NAME=args(2);
+}
+
+if(fso.FolderExists(PROJECT_PATH)) {
+    WScript.Echo("Project directory already exists! Please remove it first.");
+    WScript.Quit(1);
+}
+
+var MANIFEST_PATH=PROJECT_PATH+'\\www\\config.xml';
+var VERSION=read(ROOT+'\\VERSION').replace(/\r\n/,'').replace(/\n/,'');
+
+if(fso.FolderExists(ROOT+'\\framework')){
+    downloadAntContrib();
+    exec('ant.bat -f '+ ROOT +'\\build.xml create -Dproject.path="' + PROJECT_PATH + '"');
+    replaceInFile(MANIFEST_PATH, /__PACKAGE__/, PACKAGE);
+    replaceInFile(MANIFEST_PATH, /__ACTIVITY__/, NAME);
+}else{
+    // copy in the project template
+    exec('cmd /c xcopy '+ ROOT + '\\sample\\* '+PROJECT_PATH+' /I /S /Y');    
+    replaceInFile(MANIFEST_PATH, /org.apache.cordova.example/, PACKAGE);
+    replaceInFile(MANIFEST_PATH, /cordovaExample/, NAME);
+}
+
+cleanup();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/blackberry.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/blackberry.xml b/lib/cordova-blackberry/blackberry/bin/templates/project/blackberry.xml
new file mode 100644
index 0000000..ce3099f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/blackberry.xml
@@ -0,0 +1,456 @@
+<project default="help">
+<!-- 
+       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.
+-->    
+    <!-- LOAD PROPERTIES -->
+    
+    <property prefix="properties" file="project.properties" />
+    <property name="build.dir"    location="build" />
+    <property name="widget.dir"   location="${build.dir}/widget" />
+    <property name="code.sign"    value="false" />
+    <property name="generate.ext" value="cod" />
+    <property name="globalization" value="false" />
+    
+    <!-- BlackBerry WebWorks Packager directory is required. -->
+    <fail unless="properties.blackberry.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'blackberry.bbwp.dir' in your 'project.properties' file." />
+
+    <!-- OS identification -->
+    <condition property="isMacOSX" else="false">
+        <and>
+            <os family="mac" />
+            <os family="unix" />
+        </and>
+    </condition>
+
+    <condition property="javaloader" value="${properties.blackberry.bbwp.dir}/bin/javaloader" else="${properties.blackberry.bbwp.dir}/bin/JavaLoader.exe">
+        <equals arg1="${isMacOSX}" arg2="true" />
+    </condition>
+
+    <condition property="bbwp" value="${properties.blackberry.bbwp.dir}/bbwp" else="${properties.blackberry.bbwp.dir}/bbwp.exe">
+        <equals arg1="${isMacOSX}" arg2="true" />
+    </condition>
+
+
+    <!-- LOAD DEVICE -->
+    
+    <target name="load-device" depends="package-app">
+        <bbwp code-sign="true" />
+        <exec executable="${javaloader}" dir="." failonerror="true">
+            <arg value="-u" />
+            <arg value="-w${properties.blackberry.sim.password}" />
+            <arg value="load" />
+            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
+        </exec>
+    </target>
+
+    <!-- DEBUG-LOAD DEVICE -->
+    
+    <target name="debug-device" depends="package-app">
+        <bbwp code-sign="true" debug="true" />
+        <exec executable="${javaloader}" dir="." failonerror="true">
+            <arg value="-u" />
+            <arg value="-w${properties.blackberry.sim.password}" />
+            <arg value="load" />
+            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
+        </exec>
+    </target>
+
+    <!-- LOAD SIMULATOR -->
+    
+    <target name="load-simulator" depends="build">
+    
+        <!-- Find the simulator directory -->
+        <set-simulator-dir />
+
+        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
+        <path id="bbwp.sim.path">
+            <first>
+                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
+                    <include name="**/handhelds.manifest.txt" />
+                </fileset>
+            </first>
+        </path>
+        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
+
+        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
+             Otherwise, use bbwp simulator directory. -->
+        <condition 
+            property="simulator.dir" 
+            value="${properties.blackberry.sim.dir}" 
+            else="${bbwp.sim.dir}">
+                <available file="${properties.blackberry.sim.dir}" type="dir" />
+        </condition>
+        <echo message="Simulator directory=${simulator.dir}" />
+
+        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
+             or try setting to 'defaultSimulator.bat' in simulator directory. -->
+        <condition 
+            property="sim.bin" 
+            value="${properties.blackberry.sim.bin}" 
+            else="defaultSimulator.bat">
+                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
+        </condition>
+
+        <!-- If simulator executable does not exist, use the first device listed 
+             in the 'handhelds.manifest.txt' file in the simulator directory. -->
+        <loadfile 
+            property="device.list"
+            srcFile="${simulator.dir}/handhelds.manifest.txt">
+            <filterchain>
+                <tokenFilter>
+                    <stringtokenizer/>
+                </tokenFilter>
+            </filterchain>
+        </loadfile>
+
+        <propertyregex property="device"
+            input="${device.list}"
+            regexp="^\d{4}"
+            select="\0"
+            override="true" />
+        <property name="device.bin" value="${device}.bat" />
+
+        <condition
+            property="simulator.bin" 
+            value="${sim.bin}"
+            else="${device.bin}">
+                <available file="${simulator.dir}/${sim.bin}" />
+        </condition>
+        
+        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
+
+        <!-- Close running simulators -->
+        <echo message="Closing all running simulators..." />
+        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
+            <arg value="/execute=kill" />
+        </exec>
+
+        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
+             Otherwise, use bbwp MDS directory. -->
+        <condition 
+            property="mds.dir" 
+            value="${properties.blackberry.mds.dir}" 
+            else="${properties.blackberry.bbwp.dir}/mds">
+                <available file="${properties.blackberry.mds.dir}" type="dir" />
+        </condition>
+        <echo message="MDS directory=${mds.dir}" />
+        
+        <copy todir="${simulator.dir}">
+            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
+        </copy>
+        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
+        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
+
+        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
+             WebWorks SDK do not include it. -->
+        <if>
+            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
+            <then>
+                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
+            </then>
+        </if>
+    </target>
+
+    <target name="debug-simulator" depends="package-app">
+        <bbwp code-sign="false" debug="true" />
+    
+        <!-- Find the simulator directory -->
+        <set-simulator-dir />
+
+        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
+        <path id="bbwp.sim.path">
+            <first>
+                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
+                    <include name="**/handhelds.manifest.txt" />
+                </fileset>
+            </first>
+        </path>
+        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
+
+        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
+             Otherwise, use bbwp simulator directory. -->
+        <condition 
+            property="simulator.dir" 
+            value="${properties.blackberry.sim.dir}" 
+            else="${bbwp.sim.dir}">
+                <available file="${properties.blackberry.sim.dir}" type="dir" />
+        </condition>
+        <echo message="Simulator directory=${simulator.dir}" />
+
+        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
+             or try setting to 'defaultSimulator.bat' in simulator directory. -->
+        <condition 
+            property="sim.bin" 
+            value="${properties.blackberry.sim.bin}" 
+            else="defaultSimulator.bat">
+                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
+        </condition>
+
+        <!-- If simulator executable does not exist, use the first device listed 
+             in the 'handhelds.manifest.txt' file in the simulator directory. -->
+        <loadfile 
+            property="device.list"
+            srcFile="${simulator.dir}/handhelds.manifest.txt">
+            <filterchain>
+                <tokenFilter>
+                    <stringtokenizer/>
+                </tokenFilter>
+            </filterchain>
+        </loadfile>
+
+        <propertyregex property="device"
+            input="${device.list}"
+            regexp="^\d{4}"
+            select="\0"
+            override="true" />
+        <property name="device.bin" value="${device}.bat" />
+
+        <condition
+            property="simulator.bin" 
+            value="${sim.bin}"
+            else="${device.bin}">
+                <available file="${simulator.dir}/${sim.bin}" />
+        </condition>
+        
+        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
+
+        <!-- Close running simulators -->
+        <echo message="Closing all running simulators..." />
+        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
+            <arg value="/execute=kill" />
+        </exec>
+
+        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
+             Otherwise, use bbwp MDS directory. -->
+        <condition 
+            property="mds.dir" 
+            value="${properties.blackberry.mds.dir}" 
+            else="${properties.blackberry.bbwp.dir}/mds">
+                <available file="${properties.blackberry.mds.dir}" type="dir" />
+        </condition>
+        <echo message="MDS directory=${mds.dir}" />
+        
+        <copy todir="${simulator.dir}">
+            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
+        </copy>
+        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
+        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
+
+        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
+             WebWorks SDK do not include it. -->
+        <if>
+            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
+            <then>
+                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
+            </then>
+        </if>
+    </target>
+    
+    <!-- PACKAGE-APP -->
+    
+    <target name="package-app" depends="generate-cod-name, clean">
+        <!-- Copy the WebWorks application -->
+        <mkdir dir="${widget.dir}" />
+        <copy todir="${widget.dir}" overwrite="true">
+            <fileset dir="www" >
+                <exclude name="ext-air/**"/>
+                <exclude name="ext-qnx/**"/>
+                <exclude name="res/resourceBundles/**" unless="${globalization}"/>
+            </fileset>
+        </copy>
+        
+        <!-- Package the WebWorks app by zipping the widget dir. -->
+        <mkdir dir="${build.dir}" />
+        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
+    </target>
+    
+    <!-- BUILD -->
+
+    <target name="build" depends="package-app">
+        <bbwp code-sign="${code.sign}" />
+    </target>
+
+    <!-- BBWP MACRO -->
+
+    <macrodef name="bbwp">
+        <attribute name="code-sign" default="false" />
+        <attribute name="debug" default="false" />
+        <sequential>
+            <!-- check if debug flag was passed in and set an appropriate flag for CLI exec of bbwp -->
+            <if>
+                <equals arg1="@{debug}" arg2="true" />
+                <then>
+                    <property name="debug.flag" value="/d" />
+                </then>
+                <else>
+                    <property name="debug.flag" value="" />
+                </else>
+            </if>
+
+            <!-- Ensure bbwp executable exists. -->
+            <property name="properties.blackberry.bbwp.bin" location="${bbwp}" /> 
+            <available file="${properties.blackberry.bbwp.bin}" property="properties.blackberry.bbwp.exists" />
+            <fail unless="properties.blackberry.bbwp.exists" message="Cannot find ${properties.blackberry.bbwp.bin}. Please edit 'blackberry.bbwp.dir' in your 'project.properties' file." />
+
+            <if>
+                <equals arg1="@{code-sign}" arg2="true" />
+                <then>
+                    <exec executable="${properties.blackberry.bbwp.bin}">
+                        <arg file="${build.dir}/${cod.name}.zip" />
+                        <arg value="/g" />
+                        <arg value="${properties.blackberry.sigtool.password}" />
+                        <arg line="${debug.flag} /o" />
+                        <arg file="${build.dir}" />
+                    </exec>
+                </then>
+                <else>
+                    <exec executable="${properties.blackberry.bbwp.bin}">
+                        <arg file="${build.dir}/${cod.name}.zip" />
+                        <arg line="${debug.flag} /o" />
+                        <arg file="${build.dir}" />
+                    </exec>
+                </else>
+            </if>
+        </sequential>
+    </macrodef>
+
+    <!-- CLEAN -->
+    
+    <target name="clean">
+        <delete dir="${build.dir}" />
+        <delete dir="${widget.dir}" />
+    </target>
+    
+    <!-- CLEAN DEVICE -->
+    
+    <target name="clean-device" depends="generate-cod-name">
+        <exec executable="${javaloader}">
+            <arg value="-usb" />
+            <arg value="erase" />
+            <arg value="-f" />
+            <arg value="${cod.name}.cod" />
+        </exec>
+    </target>
+    
+    <!-- CLEAN SIMULATOR -->
+    
+    <target name="clean-simulator">
+        <!-- Find the simulator directory -->
+        <set-simulator-dir />
+        
+        <exec executable="${simulator.dir}/clean.bat" dir="${simulator.dir}" />
+        
+        <delete>
+            <fileset dir="${simulator.dir}" includes="*.cod,*.csl,*.cso,*.debug,*.jar" />
+        </delete>
+    </target>
+    
+        <!-- HELPER TASKS -->
+    
+    <target name="generate-cod-name">
+        <xmlproperty file="www/config.xml" prefix="config.xml" />
+        <propertyregex property="cod.name"
+                       input="${config.xml.widget.name}"
+                       regexp="(\W+)"
+                       replace=""
+                       casesensitive="false"
+                       global="true"
+                       defaultValue="${config.xml.widget.name}" />
+        <echo message="Generated name: ${cod.name}.cod" />
+    </target>
+    
+        <!-- MACRO: SET SIMULATOR DIRECTORY -->
+    
+    <macrodef name="set-simulator-dir">
+        <sequential>
+            <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
+            <path id="bbwp.sim.path">
+                <first>
+                    <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
+                        <include name="**/handhelds.manifest.txt" />
+                    </fileset>
+                </first>
+            </path>
+            <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
+
+            <!-- Simulator directory: Use sim.dir property if set in project.properties file.
+                 Otherwise, use bbwp simulator directory. -->
+            <condition
+                property="simulator.dir"
+                value="${properties.blackberry.sim.dir}"
+                else="${bbwp.sim.dir}">
+                    <available file="${properties.blackberry.sim.dir}" type="dir" />
+            </condition>
+            <echo message="Simulator directory=${simulator.dir}" />
+        </sequential>
+    </macrodef>
+	
+	    <!-- HELP -->
+    
+    <target name="help">
+        <echo>
+NAME
+  ${ant.project.name}
+
+SYNOPSIS
+  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
+
+DESCRIPTION
+  You can build and deploy your project to a device or simulator.
+  
+TARGETS
+  blackberry ........ Builds a cod file and deploys to a device or simulator
+ 
+  playbook .......... Builds a bar file and deploys to a device or simulator
+
+COMMANDS
+  help .............. Show this help menu.
+                        ant, ant help
+
+  load-device ....... Builds and deploys project to a connected USB device.
+                        ant load-device
+
+  load-simulator .... Builds and deploys project to default simulator.
+                        ant load-simulator
+
+  build ............. Compiles and packages the project for deployment.
+                        ant build
+                                              
+  clean ............. Remove all files from the build/ directory.
+                        ant clean
+
+  clean-device ...... Remove this project from the connected USB device.
+                        ant clean-device
+
+  clean-simulator ... Remove this project from the simulator (takes a while).
+                        ant clean-simulator
+
+GETTING STARTED
+  1. Edit project.properties
+
+  2. &lt;ant load-simulator&gt; to run the project on the simulator
+
+  3. Customize your project by editing www/config.xml
+
+  4. To run the project on a BlackBerry device, you will need to obtain
+     code signing keys from RIM. Once you have the key, a project is
+     installed by connecting a BlackBerry via USB and running
+     &lt;ant load-device&gt;.
+        </echo>
+    </target>
+</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/build.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/build.xml b/lib/cordova-blackberry/blackberry/bin/templates/project/build.xml
new file mode 100644
index 0000000..de9e56f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/build.xml
@@ -0,0 +1,154 @@
+<project name="Build and Deploy a Cordova BlackBerry WebWorks Project" default="help">
+<!--
+       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.
+-->
+    <!-- LOAD ANT-CONTRIB LIBRARY -->
+
+    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
+      <classpath>
+        <pathelement location="./lib/ant-contrib/ant-contrib-1.0b3.jar" />
+      </classpath>
+    </taskdef>
+
+    <!-- LOAD PROPERTIES -->
+
+    <property prefix="properties" file="project.properties" />
+    <property name="build.dir"    location="build" />
+    <property name="widget.dir"   location="${build.dir}/widget" />
+    <property name="code.sign"    value="false" />
+    <property name="globalization" value="false" />
+
+    <target name="blackberry" >
+        <property name="subant.file"  value="blackberry.xml" />
+    </target>
+
+    <target name="playbook" >
+        <property name="subant.file"  value="playbook.xml" />
+    </target>
+
+    <target name="load-device">
+        <subant target="load-device">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="load-simulator">
+        <subant target="load-simulator">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="debug-simulator">
+        <subant target="debug-simulator">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="debug-device">
+        <subant target="debug-device">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="build">
+        <subant target="build">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="clean">
+        <subant target="clean">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="clean-device">
+        <subant target="clean-device">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="package-app">
+        <subant target="package-app">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <target name="clean-simulator">
+        <subant target="clean-simulator">
+            <fileset dir="." includes="${subant.file}"/>
+        </subant>
+    </target>
+
+    <!-- HELP -->
+
+    <target name="help">
+        <echo>
+NAME
+  ${ant.project.name}
+
+SYNOPSIS
+  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
+
+DESCRIPTION
+  You can build and deploy your project to a device or simulator.
+
+TARGETS
+  blackberry ........ Builds a cod file and deploys to a device or simulator
+
+  playbook .......... Builds a bar file and deploys to a device or simulator
+
+COMMANDS
+  help .............. Show this help menu.
+                        ant, ant help
+
+  load-device ....... Builds and deploys project to a connected USB device.
+                        ant TARGET load-device
+
+  load-simulator .... Builds and deploys project to default simulator.
+                        ant TARGET load-simulator
+
+  build ............. Compiles and packages the project for deployment.
+                        ant TARGET build
+
+  package-app ....... Packages the app into a WebWorks-compatible .zip file.
+                        ant TARGET package-app
+
+  clean ............. Remove all files from the build/ directory.
+                        ant TARGET clean
+
+  clean-device ...... Remove this project from the connected USB device.
+                        ant TARGET clean-device
+
+  clean-simulator ... Remove this project from the simulator (takes a while).
+                        ant TARGET clean-simulator
+
+GETTING STARTED
+  1. Edit project.properties
+
+  2. &lt;ant load-simulator&gt; to run the project on the simulator
+
+  3. Customize your project by editing www/config.xml
+
+  4. To run the project on a BlackBerry device, you will need to obtain
+     code signing keys from RIM. Once you have the key, a project is
+     installed by connecting a BlackBerry via USB and running
+     &lt;ant load-device&gt;.
+        </echo>
+    </target>
+</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/build
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/build b/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/build
new file mode 100755
index 0000000..9c44240
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/build
@@ -0,0 +1,34 @@
+#! /bin/sh
+#       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.
+
+ANT=$(which ant)
+
+if [ -z "$1" ]
+then
+  echo 'usage: build <platform>'
+  echo 'where <platform> can be one of "blackberry" or "playbook"'
+  echo 'NOTE: please customize the project.properties file first before using this command!'
+  exit 0
+fi
+
+if [ "$1" == "blackberry" -o "$1" == "playbook" ]
+then
+  $ANT $1 build
+else
+  echo 'Platform not recognized! Please use one of "blackberry" or "playbook" for the platform parameter.'
+fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/run b/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/run
new file mode 100755
index 0000000..fcff58f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/cordova/run
@@ -0,0 +1,41 @@
+#! /bin/sh
+#       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.
+
+ANT=$(which ant)
+
+if [ -z "$1" ]
+then
+  echo 'usage: run <platform>'
+  echo 'where <platform> can be one of "blackberry" or "playbook"'
+  echo 'NOTE: please customize the project.properties file first before using this command!'
+  exit 0
+fi
+
+if [ "$1" == "blackberry" -o "$1" == "playbook" ]
+then
+  echo 'Do you have a BlackBerry device connected to your computer? (y/n)'
+  read DEVICE
+  if [ $DEVICE == "y" ]
+  then
+    $ANT $1 debug-device
+  else
+    $ANT $1 load-simulator
+  fi
+else
+  echo 'Platform not recognized! Please use one of "blackberry" or "playbook" for the platform parameter.'
+fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/playbook.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/playbook.xml b/lib/cordova-blackberry/blackberry/bin/templates/project/playbook.xml
new file mode 100644
index 0000000..7250cbc
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/playbook.xml
@@ -0,0 +1,338 @@
+<project default="help">
+<!-- 
+       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.
+-->    
+    <!-- LOAD PROPERTIES -->
+    
+    <property prefix="properties" file="project.properties" />
+    <property name="build.dir"    location="build" />
+    <property name="widget.dir"   location="${build.dir}/widget" />
+    <property name="code.sign"    value="false" />
+    <property name="generate.ext"   value="cod" />
+    <property name="build.num.file" value="buildId.txt" />
+    
+    <!-- BlackBerry WebWorks Packager for Tablets directory is required. -->
+    <fail unless="properties.playbook.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'playbook.bbwp.dir' in your 'project.properties' file." />
+
+    <!-- OS identification -->
+    <condition property="isMacOSX" else="false">
+        <and>
+            <os family="mac" />
+            <os family="unix" />
+        </and>
+    </condition>
+
+    <condition property="bbwp" value="${properties.playbook.bbwp.dir}/bbwp" else="${properties.playbook.bbwp.dir}/bbwp.exe">
+        <equals arg1="${isMacOSX}" arg2="true" />
+    </condition>
+
+    <condition property="blackberry-deploy" value="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-deploy" else="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-deploy.bat">
+        <equals arg1="${isMacOSX}" arg2="true" />
+    </condition>
+
+    <condition property="blackberry-debugtokenrequest" value="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-debugtokenrequest" else="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-debugtokenrequest.bat">
+        <equals arg1="${isMacOSX}" arg2="true" />
+    </condition>
+
+    <!-- LOAD DEVICE -->
+    
+    <target name="load-device" depends="package-app">
+        <bbwp code-sign="true" />
+
+        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
+            <arg value="-installApp" />
+            <arg value="-launchApp" />
+            <arg value="-device" />
+            <arg value="${properties.playbook.device.ip}" />
+            <arg value="-password" />
+            <arg value="${properties.playbook.device.password}" />
+            <arg value="-package" />
+            <arg file="${build.dir}/${cod.name}.bar" />
+        </exec>
+    </target>
+    
+    <!-- DEBUG-LOAD DEVICE -->
+    
+    <target name="debug-device" depends="package-app">
+        <if>
+            <equals arg1="${properties.playbook.device.pin}" arg2="" />
+            <then>
+                <echo>
+                    If you fill in the playbook.device.pin value you can use debug tokens!
+                    This means you won't have to worry about having a unique version in config.xml every time.
+                </echo>
+                <bbwp code-sign="true" debug="true" />
+            </then>
+            <else>
+                <generate-debug-token />
+                <bbwp code-sign="false" debug="true" />
+            </else>
+        </if>
+
+        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
+            <arg value="-installApp" />
+            <arg value="-launchApp" />
+            <arg value="-device" />
+            <arg value="${properties.playbook.device.ip}" />
+            <arg value="-password" />
+            <arg value="${properties.playbook.device.password}" />
+            <arg value="-package" />
+            <arg file="${build.dir}/${cod.name}.bar" />
+        </exec>
+    </target>
+    
+    <!-- LOAD SIMULATOR -->
+    
+    <target name="load-simulator" depends="build">
+
+        <echo>This tool will not open the simulator for you </echo>
+
+        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
+            <arg value="-installApp" />
+            <arg value="-launchApp" />
+            <arg value="-device" />
+            <arg value="${properties.playbook.sim.ip}" />
+            <arg value="-password" />
+            <arg value="${properties.playbook.sim.password}" />
+            <arg value="-package" />
+            <arg file="${build.dir}/${cod.name}.bar" />
+        </exec>
+    </target>
+    
+    <target name="debug-simulator" depends="package-app">
+        <bbwp code-sign="false" debug="true" />
+        <echo>This tool will not open the simulator for you </echo>
+
+        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
+            <arg value="-installApp" />
+            <arg value="-launchApp" />
+            <arg value="-device" />
+            <arg value="${properties.playbook.sim.ip}" />
+            <arg value="-password" />
+            <arg value="${properties.playbook.sim.password}" />
+            <arg value="-package" />
+            <arg file="${build.dir}/${cod.name}.bar" />
+        </exec>
+    </target>
+    <!-- PACKAGE-APP -->
+    
+    <target name="package-app" depends="generate-cod-name, clean">
+        <!-- Copy the WebWorks application -->
+        <mkdir dir="${widget.dir}" />
+        <copy todir="${widget.dir}" overwrite="true">
+            <fileset dir="www" >
+                <exclude name="ext/**"/>
+                <exclude name="ext-air/**"/>
+                <exclude name="res/resourceBundles/**"/>
+            </fileset>
+        </copy>
+        
+        <!-- Update WebWorks Packager with the AIR APIs -->
+        <copy todir="${properties.playbook.bbwp.dir}\ext" overwrite="true">
+            <fileset dir="www/ext-air" excludes="README.md" />
+        </copy>
+        
+        <!-- Package the WebWorks app by zipping the widget dir. -->
+        <mkdir dir="${build.dir}" />
+        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
+    </target>
+    
+    <!-- BUILD -->
+
+    <target name="build" depends="package-app">
+        <bbwp code-sign="${code.sign}" />
+    </target>
+
+    <!-- BBWP MACRO -->
+
+    <macrodef name="bbwp">
+        <attribute name="code-sign" default="false" />
+        <attribute name="debug" default="false" />
+        <sequential>
+            <!-- check if debug flag was passed in and set an appropriate flag for CLI exec of bbwp -->
+            <if>
+                <equals arg1="@{debug}" arg2="true" />
+                <then>
+                    <property name="debug.flag" value="-d" />
+                </then>
+                <else>
+                    <property name="debug.flag" value="" />
+                </else>
+            </if>
+            <buildnumber file="${build.num.file}" />
+            <if>
+                <equals arg1="@{code-sign}" arg2="true" />
+                <then>
+                    <exec executable="${bbwp}">
+                        <arg file="${build.dir}/${cod.name}.zip" />
+                        <arg value="-gcsk" />
+                        <arg value="${properties.playbook.sigtool.csk.password}" />
+                        <arg value="-gp12" />
+                        <arg value="${properties.playbook.sigtool.p12.password}" />
+                        <arg value="-o" />
+                        <arg file="${build.dir}" />
+                        <arg line="${debug.flag} -buildId" />
+                        <arg value="${build.number}" />
+                    </exec>
+                </then>
+                <else>
+                    <exec executable="${bbwp}">
+                        <arg file="${build.dir}/${cod.name}.zip" />
+                        <arg value="-o" />
+                        <arg file="${build.dir}" />
+                        <arg line="${debug.flag} -buildId" />
+                        <arg value="${build.number}" />
+                    </exec>
+                </else>
+            </if>
+        </sequential>
+    </macrodef>
+
+    <!-- install debug token" -->
+    <macrodef name="generate-debug-token">
+        <sequential>
+            <exec executable="${blackberry-debugtokenrequest}" dir="." failonerror="true">
+                <arg value="-storepass" />
+                <arg value="${properties.playbook.sigtool.csk.password}" />
+                <arg value="-deviceID" />
+                <arg value="0x${properties.playbook.device.pin}" />
+                <arg file="${properties.playbook.bbwp.dir}/debugtoken.bar" />
+            </exec>
+
+            <exec executable="${blackberry-deploy}" dir="." failonerror="true">
+                <arg value="-installApp" />
+                <arg value="-launchApp" />
+                <arg value="-device" />
+                <arg value="${properties.playbook.device.ip}" />
+                <arg value="-password" />
+                <arg value="${properties.playbook.device.password}" />
+                <arg value="-package" />
+                <arg file="${properties.playbook.bbwp.dir}/debugtoken.bar" />
+            </exec>
+
+            <replaceregexp 
+                file="${properties.playbook.bbwp.dir}/bin/bbwp.properties" 
+                match='&lt;debug_token&gt;.*&lt;\/debug_token&gt;'
+                replace='&lt;debug_token&gt;${properties.playbook.bbwp.dir}/debugtoken.bar&lt;/debug_token&gt;'
+                byline='true'/>
+        </sequential>
+    </macrodef>
+
+    <!-- CLEAN -->
+    
+    <target name="clean">
+        <delete dir="${build.dir}" />
+        <delete dir="${widget.dir}" />
+    </target>
+    
+    <!-- CLEAN DEVICE -->
+    
+    <target name="clean-device" depends="generate-cod-name">
+        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
+            <arg value="-uninstallApp" />
+            <arg value="-device" />
+            <arg value="${properties.playbook.device.ip}" />
+            <arg value="-password" />
+            <arg value="${properties.playbook.device.password}" />
+            <arg value="-package" />
+            <arg file="${build.dir}/${cod.name}.bar" />
+        </exec>
+    </target>
+    
+    <!-- CLEAN SIMULATOR -->
+    
+    <target name="clean-simulator" depends="generate-cod-name">
+        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
+            <arg value="-uninstallApp" />
+            <arg value="-device" />
+            <arg value="${properties.playbook.sim.ip}" />
+            <arg value="-password" />
+            <arg value="${properties.playbook.sim.password}" />
+            <arg value="-package" />
+            <arg file="${build.dir}/${cod.name}.bar" />
+        </exec>
+    </target>
+    
+        <!-- HELPER TASKS -->
+    
+    <target name="generate-cod-name">
+        <xmlproperty file="www/config.xml" prefix="config.xml" />
+        <propertyregex property="cod.name"
+                       input="${config.xml.widget.name}"
+                       regexp="(\W+)"
+                       replace=""
+                       casesensitive="false"
+                       global="true"
+                       defaultValue="${config.xml.widget.name}" />
+        <echo message="Generated name: ${cod.name}.bar" />
+    </target>
+
+    <!-- HELP -->
+
+    <target name="help">
+        <echo>
+NAME
+  ${ant.project.name}
+
+SYNOPSIS
+  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
+
+DESCRIPTION
+  You can build and deploy your project to a device or simulator.
+  
+TARGETS
+  blackberry ........ Builds a cod file and deploys to a device or simulator
+ 
+  playbook .......... Builds a bar file and deploys to a device or simulator
+
+COMMANDS
+  help .............. Show this help menu.
+                        ant, ant help
+
+  load-device ....... Builds and deploys project to a connected USB device.
+                        ant load-device
+
+  load-simulator .... Builds and deploys project to default simulator.
+                        ant load-simulator
+
+  build ............. Compiles and packages the project for deployment.
+                        ant build
+
+  clean ............. Remove all files from the build/ directory.
+                        ant clean
+
+  clean-device ...... Remove this project from the connected USB device.
+                        ant clean-device
+
+  clean-simulator ... Remove this project from the simulator (takes a while).
+                        ant clean-simulator
+
+GETTING STARTED
+  1. Edit project.properties
+
+  2. &lt;ant &lt;TARGET&gt; load-simulator&gt; to run the project on the simulator
+
+  3. Customize your project by editing www/config.xml
+
+  4. To run the project on a BlackBerry device, you will need to obtain
+     code signing keys from RIM. Once you have the key, a project is
+     installed by connecting a BlackBerry via USB and running
+     &lt;ant &lt;TARGET&gt; load-device&gt;.
+        </echo>
+    </target>
+</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/project.properties
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/project.properties b/lib/cordova-blackberry/blackberry/bin/templates/project/project.properties
new file mode 100644
index 0000000..31a28a0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/project.properties
@@ -0,0 +1,100 @@
+# BlackBerry WebWorks Packager Directory
+#
+#   The BlackBerry WebWorks Packager (bbwp) is required for compiling and packaging
+#   BlackBerry WebWorks applications for deployment to a BlackBerry device
+#   or simulator.  The bbwp utility is installed with the standalone BlackBerry
+#   WebWorks SDK, and as part of the BlackBerry Web Plugin for Eclipse.
+#
+#   Please specify the location of the BlackBerry WebWorks Packager in your
+#   environment.
+#
+#   Typical location of bbwp for standalone BlackBerry WebWorks SDK installation:
+#     C:\Program Files (x86)\Research In Motion\BlackBerry Widget Packager
+#
+#   Typical location of bbwp for BlackBerry Web Plugin for Eclipse installation:
+#     C:\Eclipse-3.5.2\plugins\net.rim.browser.tools.wcpc_1.0.0.201003191451-126\wcpc
+#
+#   The ANT script is brittle and requires you to escape the backslashes.
+#     e.g. C:\some\path must be C:\\some\\path
+#
+#   Please remember to:
+#     - Double escape your backslahses (i.e. \ must be \\)
+#     - Do not add a trailing slash (e.g. C:\some\path)
+#
+blackberry.bbwp.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks Packager
+playbook.bbwp.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks SDK for TabletOS 2.1.0.6\\bbwp
+
+# (Optional) Simulator Directory
+#
+#   If sim.dir is not specified, the build script will use the simulator directory
+#   within the BlackBerry WebWorks Packager.
+#
+blackberry.sim.dir=C:\\Program Files\\Research In Motion\BlackBerry WebWorks Packager\\simpack\\6.0.0.227
+
+# (Optional) Simulator Binary
+#
+#   If sim.bin is not specified, the build script will attempt to use the default
+#   simulator in the simulator directory.
+#
+#blackberry.sim.bin=9700.bat
+
+# (Optional) MDS Directory
+#
+#   If mds.dir is not specified, the build script will attempt to use the MDS that
+#   is installed with the BlackBerry WebWorks Packager.
+#
+blackberry.mds.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks Packager\\mds
+
+# BlackBerry Code Signing Password
+#
+#   If you leave this field blank, then
+#   the signing tool will prompt you each time
+#
+blackberry.sigtool.password=
+
+# Playbook Code Signing Password
+#
+#   If you leave these fields blank, then
+#   signing will fail
+#
+playbook.sigtool.csk.password=
+playbook.sigtool.p12.password=
+
+# BlackBerry Simulator Password
+#
+#   If you leave this field blank, then
+#   you cannot deploy to simulator
+#
+blackberry.sim.password=
+
+# Playbook Simulator IP
+#
+#   If you leave this field blank, then
+#   you cannot deploy to simulator
+#
+playbook.sim.ip=
+
+# Playbook Simulator Password
+#
+#   If you leave this field blank, then
+#   you cannot deploy to simulator
+#
+playbook.sim.password=
+
+# Playbook Device IP
+#
+#   If you leave this field blank, then
+#   you cannot deploy to device
+#
+playbook.device.ip=
+
+# Playbook Device Password
+#
+#   If you leave this field blank, then
+#   you cannot deploy to device
+#
+playbook.device.password=
+# PlayBook Device PIN
+#
+#   Fill this value in to use debug tokens when debuging on the device
+playbook.device.pin=

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/LICENSE b/lib/cordova-blackberry/blackberry/bin/templates/project/www/LICENSE
new file mode 100644
index 0000000..9f761f1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/LICENSE
@@ -0,0 +1,296 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+==============================================================
+This product also include the following software:
+==============================================================
+
+--------------------------------------------------------------
+jasmine from GitHub
+
+   https://github.com/pivotal/jasmine
+
+MIT-style license
+
+license available from:
+
+   https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE
+   
+-----------------------------
+
+Copyright (c) 2008-2011 Pivotal Labs
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------------------------------------------------------
+commonjs tests from the commonjs organization at GitHub
+
+   https://github.com/commonjs/commonjs
+
+MIT-style license
+
+license available from:
+
+   https://github.com/commonjs/commonjs/blob/master/docs/license.html.markdown
+
+contributor list available from:
+
+   https://github.com/commonjs/commonjs/blob/master/docs/contributors.html.markdown
+
+-----------------------------
+
+Copyright 2009 Kevin Dangoor
+Copyright 2009 Ihab Awad
+Copyright 2009 Ash Berlin
+Copyright 2009 Aristid Breitkreuz
+Copyright 2009 Kevin Dangoor
+Copyright 2009 Daniel Friesen
+Copyright 2009 Wes Garland
+Copyright 2009 Kris Kowal
+Copyright 2009 Dean Landolt
+Copyright 2009 Peter Michaux
+Copyright 2009 George Moschovitis
+Copyright 2009 Michael O'Brien
+Copyright 2009 Tom Robinson
+Copyright 2009 Hannes Wallnoefer
+Copyright 2009 Mike Wilson
+Copyright 2009 Ondrej Zara
+Copyright 2009 Chris Zumbrunn
+Copyright 2009 Kris Zyp
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/NOTICE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/NOTICE b/lib/cordova-blackberry/blackberry/bin/templates/project/www/NOTICE
new file mode 100644
index 0000000..4e02ca4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/NOTICE
@@ -0,0 +1,8 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org)
+
+This product includes software developed by
+Jasmine (https://github.com/pivotal/jasmine)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/README.md b/lib/cordova-blackberry/blackberry/bin/templates/project/www/README.md
new file mode 100644
index 0000000..61256fe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/README.md
@@ -0,0 +1,30 @@
+# Apache Cordova Hello World Application
+
+> Simple Hello World application and test suite.
+
+## Run Application
+
+    /www/index.html
+
+## Run Tests
+
+    /www/spec.html
+
+## Versions and Tags
+
+The Hello World's version is directly tied to an Apache Cordova release.
+
+For example, Hello World `2.0.0` is compatible with Apache Cordova `2.0.0`.
+
+## How to Update
+
+Update to Apache Cordova x.x.x by:
+
+1. `www/index.html`
+    - Update `<script type="text/javascript" src="cordova-x.x.x.js"></script>`
+2. `VERSION`
+    - Update the version
+3. Commit and Tag
+    - `git commit -am "[app] Version x.x.x"`
+    - `git tag x.x.x`
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/VERSION b/lib/cordova-blackberry/blackberry/bin/templates/project/www/VERSION
new file mode 100644
index 0000000..f47de85
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/VERSION
@@ -0,0 +1 @@
+2.6.0rc1


[31/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ProgressDialog.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ProgressDialog.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ProgressDialog.java
new file mode 100644
index 0000000..842b97a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ProgressDialog.java
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.ui.SpacerField;
+
+import net.rim.device.api.system.Characters;
+import net.rim.device.api.ui.UiApplication;
+import net.rim.device.api.ui.component.GaugeField;
+import net.rim.device.api.ui.component.LabelField;
+import net.rim.device.api.ui.component.SeparatorField;
+import net.rim.device.api.ui.container.PopupScreen;
+import net.rim.device.api.ui.container.VerticalFieldManager;
+
+/**
+ * A Popup progress dialog box with an optional title and message and a progress
+ * bar with a range from 0 to 100 (percent).
+ */
+public final class ProgressDialog extends PopupScreen {
+    private static ProgressDialog dialog = null;
+    private GaugeField gauge = null;
+
+    /**
+     * Construct a progress dialog, with customizable title and message.
+     *
+     * @param title
+     *            Title of the progress dialog
+     * @param message
+     *            Message to print in the body of the dialog
+     */
+    private ProgressDialog(String title, String message) {
+        super(new VerticalFieldManager());
+
+        if (title != null && title.length() > 0) {
+            add(new LabelField(title));
+            add(new SeparatorField(SeparatorField.LINE_HORIZONTAL));
+        }
+
+        if (message != null && message.length() > 0) {
+            add(new SpacerField(0, 20));
+            add(new LabelField(message, FIELD_HCENTER | FIELD_VCENTER));
+        }
+        add(new SpacerField(0, 20));
+
+        gauge = new GaugeField(null, 0, 100, 0, GaugeField.PERCENT
+                | GaugeField.FIELD_HCENTER);
+        add(gauge);
+        add(new SpacerField(0, 20));
+    }
+
+    /**
+     * Changes the value displayed in the dialogs GaugeField.
+     *
+     * @param args
+     *            JSONArray of arguments.
+     * @return a PluginResult indicating success or error.
+     */
+    static synchronized PluginResult setValue(JSONArray args) {
+        if (dialog != null) {
+            if (args.length() > 0 && !args.isNull(0)) {
+                int value = -1;
+                try {
+                    value = args.getInt(0);
+                } catch (JSONException e) {
+                    return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                            "JSONException: " + e.getMessage());
+                }
+
+                if (value >= 0 && value <= 100) {
+                    dialog.setValue(value);
+                }
+            }
+        }
+        return new PluginResult(PluginResult.Status.OK, "");
+    }
+
+    /**
+     * Creates and displays the progress dialog.
+     *
+     * @param args
+     *            JSONArray of arguments.
+     * @return a PluginResult indicating success or error.
+     */
+    static synchronized PluginResult start(JSONArray args) {
+        if (dialog == null) {
+            String message = null;
+            String title = null;
+
+            // Title and message are optional, grab the strings from the args
+            // if they are there.
+            if (args != null && args.length() > 0) {
+                try {
+                    if (!args.isNull(0)) {
+                        title = args.getString(0);
+                    }
+                    if (args.length() > 1 && !args.isNull(1)) {
+                        message = args.getString(1);
+                    }
+                } catch (JSONException e) {
+                    return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                            "JSONException: " + e.getMessage());
+                }
+            }
+
+            dialog = new ProgressDialog(title, message);
+            final UiApplication uiApp = UiApplication.getUiApplication();
+            uiApp.invokeLater(new Runnable() {
+                public void run() {
+                    uiApp.pushModalScreen(dialog);
+                }
+            });
+        }
+
+        return new PluginResult(PluginResult.Status.OK, "");
+    }
+
+    /**
+     * Closes the progress dialog.
+     *
+     * @return a PluginResult indicating success or error.
+     */
+    static synchronized PluginResult stop() {
+        if (dialog != null) {
+            final UiApplication uiApp = UiApplication.getUiApplication();
+            final ProgressDialog tmpDialog = dialog;
+            uiApp.invokeLater(new Runnable() {
+                public void run() {
+                    uiApp.popScreen(tmpDialog);
+                }
+            });
+            dialog = null;
+        }
+
+        return new PluginResult(PluginResult.Status.OK, "");
+    }
+
+    /**
+     * @see net.rim.device.api.ui.Screen#keyChar(char, int, int)
+     */
+    protected boolean keyChar(char key, int status, int time) {
+        // If the user clicks back key while progress dialog is displayed, close
+        // the progress dialog.
+        if (key == Characters.ESCAPE) {
+            stop();
+        }
+
+        return super.keyChar(key, status, time);
+    }
+
+    /**
+     * Changes the value displayed in the GaugeField.
+     *
+     * @param value
+     *            the value (percentage) to set in GaugeField.
+     */
+    private void setValue(final int value) {
+        UiApplication.getUiApplication().invokeLater(new Runnable() {
+            public void run() {
+                gauge.setValue(value);
+            }
+        });
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/VibrateAction.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/VibrateAction.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/VibrateAction.java
new file mode 100644
index 0000000..76a545f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/VibrateAction.java
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+
+import net.rim.device.api.system.Alert;
+
+/**
+ * Vibrate Action
+ *
+ * Vibrates the device for specified duration.
+ */
+public class VibrateAction {
+
+	private static final int DEFAULT_DURATION = 1000;
+
+	/**
+	 * Vibrates the device for a given amount of time.
+	 *
+	 * @param args JSONArray formatted as [ duration ]
+	 *             duration: specifies the vibration length in milliseconds (default: 1000).
+	 * @return A PluginResult object with the success or failure state for vibrating the device.
+	 */
+	public static PluginResult execute(JSONArray args) {
+		PluginResult result = null;
+
+		if (Alert.isVibrateSupported()) {
+			try {
+				int duration = (args.length() >= 1) ? args.getInt(0) : DEFAULT_DURATION;
+
+				Alert.startVibrate(duration);
+			}
+			catch (JSONException e) {
+				result = new PluginResult(PluginResult.Status.JSON_EXCEPTION, "JSONException: " + e.getMessage());
+			}
+
+			result = new PluginResult(PluginResult.Status.OK, "OK");
+		}
+		else {
+			result = new PluginResult(PluginResult.Status.ILLEGAL_ACCESS_EXCEPTION, "Vibrate not supported");
+		}
+
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/pim/Contact.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/pim/Contact.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/pim/Contact.java
new file mode 100644
index 0000000..3e8e6d7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/pim/Contact.java
@@ -0,0 +1,430 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.pim;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.HttpConnection;
+import javax.microedition.pim.PIM;
+import javax.microedition.pim.PIMException;
+import javax.microedition.pim.PIMItem;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.http.HttpUtils;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+import net.rim.blackberry.api.pdap.BlackBerryContact;
+import net.rim.blackberry.api.pdap.BlackBerryContactList;
+import net.rim.device.api.io.Base64InputStream;
+import net.rim.device.api.io.FileNotFoundException;
+import net.rim.device.api.io.IOUtilities;
+import net.rim.device.api.io.http.HttpProtocolConstants;
+import net.rim.device.api.math.Fixed32;
+import net.rim.device.api.system.Bitmap;
+import net.rim.device.api.system.EncodedImage;
+import net.rim.device.api.system.PNGEncodedImage;
+
+/**
+ * Performs operations on Contacts stored in the BlackBerry Contacts database.
+ */
+public class Contact extends Plugin {
+
+    /**
+     * Possible actions
+     */
+    public static final int ACTION_SET_PICTURE  = 0;
+    public static final int ACTION_GET_PICTURE  = 1;
+
+    /**
+     * Maximum object size is 64KB in contact database.  The raw image is Base64
+     * encoded before insertion.
+     * Base64 = (Bytes + 2 - ((Bytes + 2) MOD 3)) / 3 * 4
+     */
+    private static final long MAX_BYTES = 46080L;
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action        The action to execute.
+     * @param callbackId    The callback ID to be invoked upon action completion.
+     * @param args          JSONArry of arguments for the action.
+     * @return              A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+
+        PluginResult result = null;
+        int a = getAction(action);
+
+        // perform specified action
+        if (a == ACTION_SET_PICTURE) {
+            // get parameters
+            String uid;
+            String type;
+            String value;
+            try {
+                uid = args.isNull(0) ? null : args.getString(0);
+                type = args.isNull(1) ? null : args.getString(1).toLowerCase();
+                value = args.isNull(2) ? null : args.getString(2);
+            } catch (JSONException e) {
+                Logger.log(this.getClass().getName() + ": " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        "Invalid or missing photo parameters");
+            }
+
+            // get the raw image data
+            byte[] photo = null;
+            if ("base64".equals(type)) {
+                // decode the image string
+                try {
+                    photo = decodeBase64(value.getBytes());
+                }
+                catch (Exception e) {
+                    Logger.log(this.getClass().getName() + ": " + e);
+                    return new PluginResult(PluginResult.Status.ERROR, "Unable to decode image.");
+                }
+            }
+            else {
+                // retrieve the photo from URL
+                try {
+                    photo = getPhotoFromUrl(value);
+                }
+                catch (Exception e) {
+                    Logger.log(this.getClass().getName() + ": " + e);
+                    return new PluginResult(PluginResult.Status.ERROR, "Unable to retrieve image at " + value);
+                }
+            }
+
+            // set the contact picture
+            result = setPicture(uid, photo);
+        }
+        else if (a == ACTION_GET_PICTURE) {
+            // get required parameters
+            String uid = null;
+            try {
+                uid = args.getString(0);
+            } catch (JSONException e) {
+                Logger.log(this.getClass().getName() + ": " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        "Invalid or missing image URL");
+            }
+            result = getPictureURI(uid);
+        }
+        else {
+            // invalid action
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION,
+                    "Contact: invalid action " + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Decodes the base64 encoded data provided.
+     * @param data Base64 encoded data
+     * @return byte array containing decoded data
+     * @throws IllegalArgumentException if encodedData is null
+     * @throws IOException if there is an error decoding
+     */
+    protected byte[] decodeBase64(final byte[] encodedData) throws IllegalArgumentException, IOException {
+        if (encodedData == null) {
+            throw new IllegalArgumentException();
+        }
+        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(encodedData, 0, encodedData.length);
+        Base64InputStream base64InputStream = new Base64InputStream(byteArrayInputStream);
+        byte[] raw = null;
+        try {
+            raw = IOUtilities.streamToBytes(base64InputStream);
+        }
+        finally {
+            base64InputStream.close();
+        }
+        return raw;
+    }
+
+    /**
+     * Sets the photo of the specified contact to the picture at the specified URL.
+     * Local file-based (file:///) and web-based (http://) URLs are supported.
+     * The specified photo is retrieved and a scaled down copy is created and stored
+     * in the contacts database.
+     * @param uid   Unique identifier of contact
+     * @param url   URL of the photo to use for contact photo
+     * @return PluginResult providing status of operation
+     */
+    protected PluginResult setPicture(final String uid, final byte[] photo) {
+        Logger.log(this.getClass().getName() + ": setting picture for contact " + uid);
+
+        // We need to ensure the image encoding is supported, and resize the image
+        // so that it will fit in the persistent store.  Note: testing indicates
+        // that the max image size is 64KB, so we scale it down considerably.
+        byte[] thumbnail = null;
+        try {
+            thumbnail = resizeImage(photo);
+        }
+        catch (IllegalArgumentException e) {
+            // unsupported image format
+            Logger.log(this.getClass().getName() + ": " + e);
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "Unsupported image format.");
+        }
+
+        // lookup contact and save the photo
+        BlackBerryContactList contactList = null;
+        try {
+            // lookup the contact
+            contactList = (BlackBerryContactList) PIM.getInstance().openPIMList(
+                    PIM.CONTACT_LIST, PIM.READ_WRITE);
+            BlackBerryContact contact = contactList.getByUID(uid);
+            if (contact == null) {
+                return new PluginResult(PluginResult.Status.ERROR, "Contact " + uid + " not found.");
+            }
+
+            // save photo image
+            if(contact.countValues(javax.microedition.pim.Contact.PHOTO) > 0) {
+                contact.setBinary(javax.microedition.pim.Contact.PHOTO, 0,
+                        PIMItem.ATTR_NONE, thumbnail, 0, thumbnail.length);
+            }
+            else {
+                contact.addBinary(javax.microedition.pim.Contact.PHOTO,
+                        PIMItem.ATTR_NONE, thumbnail, 0, thumbnail.length);
+            }
+
+            // commit contact record to persistent store
+            contact.commit();
+        }
+        catch (Exception e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+            return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
+        }
+        finally {
+            // be sure to close the contact list to avoid locking it up
+            if (contactList != null) {
+                try { contactList.close(); } catch (PIMException ignored) { }
+            }
+        }
+
+        return new PluginResult(PluginResult.Status.OK);
+    }
+
+    /**
+     * Returns the URI of the contact photo.  The photo image is extracted from
+     * the Contacts database and saved to a temporary file system.  The URI of
+     * the saved photo is returned.
+     * @param uid unique Contact identifier
+     * @return PluginResult containing photo URI
+     */
+    protected PluginResult getPictureURI(final String uid) {
+        Logger.log(this.getClass().getName() + ": retrieving picture for contact " + uid);
+        String photoPath = null;
+
+        // lookup contact
+        BlackBerryContactList contactList = null;
+        try {
+            // lookup the contact
+            contactList = (BlackBerryContactList) PIM.getInstance().openPIMList(
+                    PIM.CONTACT_LIST, PIM.READ_WRITE);
+            BlackBerryContact contact = contactList.getByUID(uid);
+            if (contact == null) {
+                return new PluginResult(PluginResult.Status.ERROR, "Contact " + uid + " not found.");
+            }
+
+            // get photo
+            if(contact.countValues(javax.microedition.pim.Contact.PHOTO) > 0) {
+                // decode from base64
+                byte[] encPhoto = contact.getBinary(javax.microedition.pim.Contact.PHOTO, 0);
+                byte[] photo = Base64InputStream.decode(encPhoto, 0, encPhoto.length);
+
+                // save photo to file system and return file URI
+                saveImage(uid, photo);
+            }
+        }
+        catch (Exception e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+            return new PluginResult(PluginResult.Status.ERROR, e.getMessage());
+        }
+        finally {
+            // be sure to close the contact list to avoid locking it up
+            if (contactList != null) {
+                try { contactList.close(); } catch (PIMException ignored) { }
+            }
+        }
+
+        return new PluginResult(PluginResult.Status.OK, photoPath);
+    }
+
+    /**
+     * Retrieves the raw image data from the URL provided.
+     * @param url  URL of the image
+     * @return raw image data from the URL provided
+     * @throws FileNotFoundException - if file URL could not be found
+     * @throws IOException - if there was an error processing the image file
+     */
+    protected byte[] getPhotoFromUrl(final String url) throws FileNotFoundException, IOException {
+        byte[] photo = null;
+
+        // externally hosted image
+        if (url != null && url.startsWith("http")) {
+            // open connection
+            HttpConnection conn = HttpUtils.getHttpConnection(url);
+            if (conn == null) {
+                throw new IllegalArgumentException("Invalid URL: " + url);
+            }
+
+            // retrieve image
+            InputStream in = null;
+            try {
+                conn.setRequestMethod(HttpConnection.GET);
+                conn.setRequestProperty(
+                        HttpProtocolConstants.HEADER_USER_AGENT,
+                        System.getProperty("browser.useragent"));
+                conn.setRequestProperty(
+                        HttpProtocolConstants.HEADER_KEEP_ALIVE, "300");
+                conn.setRequestProperty(
+                        HttpProtocolConstants.HEADER_CONNECTION, "keep-alive");
+                conn.setRequestProperty(
+                        HttpProtocolConstants.HEADER_CONTENT_TYPE,
+                        HttpProtocolConstants.CONTENT_TYPE_IMAGE_STAR);
+
+                // send request and get response
+                int rc = conn.getResponseCode();
+                if (rc != HttpConnection.HTTP_OK) {
+                    throw new IOException("HTTP connection error: " + rc);
+                }
+                in = conn.openDataInputStream();
+                photo = IOUtilities.streamToBytes(in, 64*1024);
+                in.close();
+            }
+            finally {
+                conn.close();
+            }
+        }
+        // local image file
+        else {
+            photo = FileUtils.readFile(url, Connector.READ);
+        }
+        return photo;
+    }
+
+    /**
+     * Saves the contact image to a temporary directory.
+     * @param uid unique contact identifier
+     * @param photo encoded photo image data
+     * @throws IOException
+     */
+    protected void saveImage(final String uid, final byte[] photo) throws IOException {
+        // create a temporary directory to store the contacts photos
+        String contactsDir = "Contacts";
+        String tempDir = FileUtils.getApplicationTempDirPath() + contactsDir;
+        if (!FileUtils.exists(tempDir)) {
+            FileUtils.createTempDirectory(contactsDir);
+        }
+
+        // save the photo image to the temporary directory, overwriting if necessary
+        String photoPath = tempDir + FileUtils.FILE_SEPARATOR + uid + ".png";
+        if (FileUtils.exists(photoPath)) {
+            FileUtils.delete(photoPath);
+        }
+        FileUtils.writeFile(photoPath, photo, 0);
+    }
+
+    /**
+     * Creates a scaled copy of the specified image.
+     * @param photo  Raw image data
+     * @return a scaled-down copy of the image provided
+     * @throws IllegalArgumentException
+     */
+    protected byte[] resizeImage(byte[] data) throws IllegalArgumentException {
+        // create an EncodedImage to make sure the encoding is supported
+        EncodedImage image = EncodedImage.createEncodedImage(data, 0, data.length);
+
+        // we're limited to 64KB encoding size, do we need to scale?
+        if (data.length < MAX_BYTES) {
+            return data;
+        }
+
+        // if so, try to maintain aspect ratio of original image and set max resolution
+        int srcWidth = image.getWidth();
+        int srcHeight = image.getHeight();
+        int dstWidth, dstHeight;
+        int max_rez = 150;
+        if (srcWidth > srcHeight) {
+            dstWidth = max_rez;
+            dstHeight = (dstWidth * srcHeight)/srcWidth;
+        }
+        else if (srcWidth < srcHeight) {
+            dstHeight = max_rez;
+            dstWidth = (dstHeight * srcWidth)/srcHeight;
+        }
+        else {
+            dstWidth = max_rez;
+            dstHeight = max_rez;
+        }
+
+        // calculate scale factors
+        int currentWidthFixed32 = Fixed32.toFP(srcWidth);
+        int currentHeightFixed32 = Fixed32.toFP(srcHeight);
+        int requiredWidthFixed32 = Fixed32.toFP(dstWidth);
+        int requiredHeightFixed32 = Fixed32.toFP(dstHeight);
+        int scaleXFixed32 = Fixed32.div(currentWidthFixed32,
+                requiredWidthFixed32);
+        int scaleYFixed32 = Fixed32.div(currentHeightFixed32,
+                requiredHeightFixed32);
+
+        // scale image (must be redrawn)
+        EncodedImage thumbnail = image.scaleImage32(scaleXFixed32, scaleYFixed32);
+        Bitmap bitmap = thumbnail.getBitmap();
+
+        // convert back to bytes
+        PNGEncodedImage png = PNGEncodedImage.encode(bitmap);
+        byte[] thumbData = png.getData();
+        Logger.log(this.getClass().getName() + ": photo size reduced from " + data.length + " to " + thumbData.length);
+        return thumbData;
+    }
+
+    /**
+     * Returns action to perform.
+     * @param action action to perform
+     * @return action to perform
+     */
+    protected static int getAction(String action) {
+        if ("setPicture".equals(action)) return ACTION_SET_PICTURE;
+        if ("getPicture".equals(action)) return ACTION_GET_PICTURE;
+        return -1;
+    }
+
+    /**
+     * Identifies if action to be executed returns a value and should be run synchronously.
+     *
+     * @param action    The action to execute
+     * @return          T=returns value
+     */
+    public boolean isSynch(String action) {
+        if (getAction(action) == ACTION_GET_PICTURE) {
+            return true;
+        }
+        else {
+            return super.isSynch(action);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/ui/SpacerField.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/ui/SpacerField.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/ui/SpacerField.java
new file mode 100644
index 0000000..d739617
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/ui/SpacerField.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.ui;
+
+import net.rim.device.api.ui.Field;
+import net.rim.device.api.ui.Graphics;
+
+/**
+ * Provides an empty spacer field that can be used to provide custom spacing
+ * between UI fields within a UI screen.
+ */
+public class SpacerField extends Field {
+
+    int width;      // spacer width in pixels
+    int height;     // space height in pixels
+
+    /**
+     * Constructor.
+     * @param width Width of the spacer in pixels.
+     * @param height Height of the spacer in pixels.
+     */
+    public SpacerField(int width, int height) {
+        super(NON_FOCUSABLE);
+        this.width = width;
+        this.height = height;
+    }
+
+    /**
+     * Sets the extent to the custom width and height of this spacer.
+     */
+    protected void layout(int width, int height) {
+        this.setExtent(this.width, this.height);
+    }
+
+    /**
+     * Paints the field.
+     */
+    protected void paint(Graphics graphics) {
+        // supposed to be empty. don't paint anything.
+    }
+
+    /**
+     * Returns the custom width of this spacer as the preferred field width.
+     */
+    public int getPreferredWidth() {
+        return this.width;
+    }
+
+    /**
+     * Returns the custom height of this spacer as the preferred field height.
+     */
+    public int getPreferredHeight() {
+        return this.height;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/ApplicationUtils.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/ApplicationUtils.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/ApplicationUtils.java
new file mode 100644
index 0000000..e9ed784
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/ApplicationUtils.java
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.util;
+
+import org.apache.cordova.camera.Camera;
+
+import net.rim.device.api.system.ApplicationDescriptor;
+import net.rim.device.api.system.ApplicationManager;
+import net.rim.device.api.system.Characters;
+import net.rim.device.api.system.CodeModuleManager;
+import net.rim.device.api.system.ControlledAccessException;
+import net.rim.device.api.system.EventInjector;
+import net.rim.device.api.ui.UiApplication;
+
+public class ApplicationUtils {
+    /**
+     * Determines if the specified application is running in the foreground.
+     *
+     * @param handle
+     *            the name of the application handle (e.g., net_rim_bb_camera")
+     * @return <code>true</code> if the application is running and in the
+     *         foreground
+     */
+    public static boolean isApplicationInForeground(String handle) {
+        // determine if the specified application is running in the foreground
+        ApplicationManager manager = ApplicationManager.getApplicationManager();
+        int foregroundProcessId = manager.getForegroundProcessId();
+        ApplicationDescriptor descriptors[] = manager.getVisibleApplications();
+        for (int i = 0; i < descriptors.length; i++) {
+            if (descriptors[i].getModuleName().equals(handle)
+                    && manager.getProcessId(descriptors[i]) == foregroundProcessId) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Determines if the specified application is installed.
+     *
+     * @param handle
+     *            the name of the application handle (e.g., net_rim_bb_camera")
+     * @return <code>true</code> if the application is installed on the device
+     */
+    public static boolean isModuleInstalled(String handle) {
+        return (CodeModuleManager.getModuleHandle(handle) != 0);
+    }
+
+    /**
+     * Use this method when another native application has been launched by this
+     * application, and you would like the application to be closed.
+     * <p>
+     * Unfortunately, the only way to do this programmatically is to simulate
+     * the Escape (back) key being pressed. We do this by injecting key events,
+     * which means the application permissions must have the key injection
+     * permissions enabled for it to work.
+     * <p>
+     * An alternative to closing the applications would be to simply request
+     * that our application be brought to the foreground; however, this just
+     * pushes all the applications we've launched to the background, leaving a
+     * mess for the user to cleanup after this application has been closed.
+     *
+     * @param repeat
+     *            the number of times to press the Esc key
+     */
+    public static void injectEscKeyPress(final int repeat) {
+        // simulate escape characters (back button press)
+        Runnable escKeyPresser = new Runnable() {
+            public void run() {
+                try {
+                    EventInjector.KeyEvent inject = new EventInjector.KeyEvent(
+                            EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE,
+                            0);
+                    int count = 0;
+                    while (count < repeat) {
+                        inject.post();
+                        count++;
+                    }
+                }
+                catch (ControlledAccessException e) {
+                    // the application doesn't have key injection
+                    // permissions
+                    Logger.log(Camera.class.getName() + ": "
+                            + ApplicationDescriptor
+                                    .currentApplicationDescriptor().getName()
+                            + " does not have key injection permissions.");
+                }
+            }
+        };
+        UiApplication.getUiApplication().invokeLater(escKeyPresser);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/FileUtils.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/FileUtils.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/FileUtils.java
new file mode 100644
index 0000000..20ef492
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/FileUtils.java
@@ -0,0 +1,730 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.util;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
+import java.util.Random;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+import javax.microedition.io.file.FileSystemRegistry;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.file.File;
+
+import net.rim.device.api.io.FileNotFoundException;
+import net.rim.device.api.io.IOUtilities;
+import net.rim.device.api.io.MIMETypeAssociations;
+import net.rim.device.api.system.Application;
+import net.rim.device.api.system.ControlledAccessException;
+
+/**
+ * Contains file utility methods.
+ */
+public class FileUtils {
+
+    public static final String FILE_SEPARATOR = System.getProperty("file.separator");
+    public static final String LOCAL_PROTOCOL = "local://";
+    public static final String FILE_PROTOCOL = "file://";
+
+    private static final String APP_TMP_DIR;
+    
+    // init APP_TMP_DIR with a random value
+    static {
+        Random gen = new Random();
+        APP_TMP_DIR = "tmp" + Math.abs(gen.nextInt());
+    }
+
+    /**
+     * Reads file as byte array.
+     * @param filePath      Full path of the file to be read
+     * @param mode          One of Connector.READ, READ_WRITE, WRITE
+     * @return file content as a byte array
+     */
+    public static byte[] readFile(String filePath, int mode) throws FileNotFoundException, IOException {
+        byte[] blob = null;
+        DataInputStream dis = null;
+        try {
+            dis = openDataInputStream(filePath, mode);
+            blob = IOUtilities.streamToBytes(dis);
+        }
+        finally {
+            try {
+                if (dis != null) dis.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return blob;
+    }
+
+    /**
+     * Utility function to open a DataInputStream from a file path.
+     *
+     * A file can be referenced with the following protocols:
+     *  - System.getProperty("fileconn.dir.*")
+     *  - local:/// references files bundled with the application
+     *
+     * @param filePath The full path to the file to open
+     * @param mode     One of Connector.READ, READ_WRITE, WRITE
+     * @return Handle to the DataInputStream
+     */
+    private static DataInputStream openDataInputStream(final String filePath, int mode) throws FileNotFoundException, IOException {
+        FileConnection fconn = null;
+        DataInputStream dis = null;
+        try {
+            if (filePath.startsWith(LOCAL_PROTOCOL)) {
+                // Remove local:// from filePath but leave a leading /
+                dis = new DataInputStream(Application.class.getResourceAsStream(filePath.substring(8)));
+            }
+            else {
+                fconn = (FileConnection)Connector.open(filePath, mode);
+                if (!fconn.exists()) {
+                    throw new FileNotFoundException(filePath + " not found");
+                }
+                dis = fconn.openDataInputStream();
+            }
+
+            if (dis == null) {
+                throw new FileNotFoundException(filePath + " not found");
+            }
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+
+        return dis;
+    }
+
+    /**
+     * Writes data to the specified file.
+     *
+     * @param filePath
+     *            Full path of file to be written to
+     * @param data
+     *            Data to be written
+     * @param position
+     *            Position at which to begin writing
+     * @return length of data written to file
+     * @throws SecurityException
+     *             if the application does not have write access to the file
+     * @throws IOException
+     *             if directory structure does not exist or an unspecified error
+     *             occurs
+     */
+    public static int writeFile(String filePath, byte[] data, int position)
+            throws SecurityException, IOException {
+        FileConnection fconn = null;
+        OutputStream os = null;
+        try {
+            fconn = (FileConnection) Connector.open(filePath,
+                    Connector.READ_WRITE);
+            if (!fconn.exists()) {
+                fconn.create();
+            } else {
+                // Originally, this did an overwrite in place and did not
+                // truncate.  The truncate was added to match behavior on
+                // other platforms.
+                fconn.truncate(position);
+            }
+            os = fconn.openOutputStream(position);
+            os.write(data);
+        }
+        finally {
+            try {
+                if (os != null)
+                    os.close();
+                if (fconn != null)
+                    fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return data.length;
+    }
+
+    /**
+     * Deletes the specified file or directory from file system. If the
+     * specified path is a directory, the deletion is recursive.
+     *
+     * @param path
+     *            full path of file or directory to be deleted
+     * @throws IOException
+     */
+    public static void delete(String path) throws IOException {
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection)Connector.open(path, Connector.READ_WRITE);
+            if (fconn.exists()) {
+                // file
+                if (!fconn.isDirectory()) {
+                    fconn.delete();
+                    Logger.log(FileUtils.class.getName() + ":  " + path + " deleted");
+                }
+                // directory
+                else {
+                    if (!path.endsWith(FILE_SEPARATOR)) {
+                        path += FILE_SEPARATOR;
+                    }
+
+                    // recursively delete directory contents
+                    Enumeration contents = fconn.list("*", true);
+                    if (contents.hasMoreElements()) {
+                        fconn.close();
+                        while (contents.hasMoreElements()) {
+                            delete(path + contents.nextElement().toString());
+                        }
+                        fconn = (FileConnection)Connector.open(path, Connector.READ_WRITE);
+                    }
+                    // now delete this directory
+                    fconn.delete();
+                    Logger.log(FileUtils.class.getName() + ":  " + path + " deleted");
+                }
+            }
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+    }
+
+    /**
+     * Creates a directory. Directories in the specified path are not created
+     * recursively. If the directory already exists, no action is taken.
+     *
+     * @param dirPath
+     *            full path of directory to create
+     * @throws IOException
+     *             if the target file system is not accessible, or an
+     *             unspecified error occurs
+     */
+    public static void mkdir(String dirPath) throws IOException {
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection)Connector.open(dirPath);
+            if (fconn.isDirectory()) {
+                // nothing to do
+                return;
+            }
+            fconn.mkdir();
+        } catch (ControlledAccessException e) {
+            Logger.log("ControlledAccessException on dir " + dirPath + ", either directory conflict after reinstall of app, or device is connected via usb, see Cordova Docs File Blackberry Quirks");
+            Logger.log(e.toString());
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+    }
+
+    /**
+     * Determines the size of a file on the file system. Size always represents number of bytes contained in the file; never pre-allocated but empty space
+     * @return size in bytes of the selected file, or -1 if the file does not exist or is inaccessible
+     */
+    public static long fileSize(String path) throws IOException {
+        FileConnection fconn = null;
+        long fsize = -1;
+        try {
+            fconn = (FileConnection)Connector.open(path);
+            fsize = fconn.fileSize();
+        } catch (IOException e) {
+            Logger.log(FileUtils.class.getName() + " fileSize:  " + path + "not found or inaccessible");
+        } finally {
+            try {
+                if (fconn != null) fconn.close();
+            } catch (IOException ignored) {}
+        }
+       return fsize;
+    }
+
+    /**
+     * Copies a file or directory to a new location. If copying a directory, the
+     * entire contents of the directory are copied recursively.
+     *
+     * @param srcPath
+     *            the full path of the file or directory to be copied
+     * @param parent
+     *            the full path of the target directory to which the file or
+     *            directory should be copied
+     * @param newName
+     *            the new name of the file or directory
+     * @throws IllegalArgumentException
+     *             if an invalid source or destination path is provided
+     * @throws FileNotFoundException
+     *             if the source path cannot be found on the file system
+     * @throws SecurityException
+     *             if unable to create the new file or directory specified by
+     *             destination path
+     * @throws IOException
+     *             if an attempt is made to copy the contents of a directory
+     *             into itself, or if the source and destination paths are
+     *             identical, or if a general error occurs
+     */
+    public static void copy(String srcPath, String parent, String newName)
+            throws IllegalArgumentException, FileNotFoundException,
+            SecurityException, IOException {
+
+        FileConnection src = null;
+        FileConnection dst = null;
+        try {
+            src = (FileConnection)Connector.open(srcPath, Connector.READ_WRITE);
+
+            // ensure source exists
+            if (!src.exists()) {
+                throw new FileNotFoundException("Path not found: " + srcPath);
+            }
+
+            // ensure target parent directory exists
+            if (!isDirectory(parent)) {
+                throw new FileNotFoundException("Target directory not found: " + parent);
+            }
+
+            // form full destination path
+            if (!parent.endsWith(FileUtils.FILE_SEPARATOR)) {
+                parent += FileUtils.FILE_SEPARATOR;
+            }
+            String dstPath = parent + newName;
+
+            // source is a directory
+            if (src.isDirectory()) {
+                // target should also be directory; append file separator
+                if (!dstPath.endsWith(FILE_SEPARATOR)) {
+                    dstPath += FILE_SEPARATOR;
+                }
+
+                // can't copy directory into itself
+                // file:///SDCard/tmp/ --> file:///SDCard/tmp/tmp/ ==> NO!
+                // file:///SDCard/tmp/ --> file:///SDCard/tmp/ ==> NO!
+                // file:///SDCard/tmp/ --> file:///SDCard/tmp2/ ==> OK
+                String srcURL = src.getURL();
+                if (dstPath.startsWith(srcURL)) {
+                    throw new IOException("Cannot copy directory into itself.");
+                }
+
+                // create the destination directory
+                mkdir(dstPath);
+
+                // recursively copy directory contents
+                Enumeration contents = src.list("*", true);
+                if (contents.hasMoreElements()) {
+                    src.close();
+                    while (contents.hasMoreElements()) {
+                        String name = contents.nextElement().toString();
+                        copy(srcURL + name, dstPath, name);
+                    }
+                }
+            }
+            // source is a file
+            else {
+                // can't copy file onto itself
+                if (dstPath.equals(srcPath)) {
+                    throw new IOException("Cannot copy file onto itself.");
+                }
+
+                dst = (FileConnection) Connector.open(dstPath, Connector.READ_WRITE);
+
+                // replace existing file, but not directory
+                if (dst.exists()) {
+                    if (dst.isDirectory()) {
+                        throw new IOException(
+                                "Cannot overwrite existing directory.");
+                    }
+                    else {
+                        dst.delete();
+                    }
+                }
+                dst.create();
+
+                // copy the contents - wish there was a better way
+                InputStream is = null;
+                OutputStream os = null;
+                try {
+                    is = src.openInputStream();
+                    os = dst.openOutputStream();
+                    byte[] buf = new byte[1024];
+                    int len;
+                    while ((len = is.read(buf)) > 0) {
+                        os.write(buf, 0, len);
+                    }
+                }
+                finally {
+                    if (is != null) is.close();
+                    if (os != null) os.close();
+                }
+            }
+        }
+        finally {
+            try {
+                if (src != null) src.close();
+                if (dst != null) dst.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+    }
+
+    /**
+     * Creates an temporary directory for the application. The temporary
+     * directory is created in the following location:
+     * <code>&lt;root&gt;/tmpGUID/</code> where <code>&lt;root&gt;/</code>
+     * is the path of the writable directory on the file system (could be the SD
+     * card, if present, or the root file system on internal storage); and
+     * <code>tmpGUID/</code> is a application temporary directory that is
+     * created using the unique application GUID. If the application temporary
+     * directory does not exist, invoking this method will create it.
+     * <em>NOTE:</em> The <code>&lt;root&gt;/tmpGUID/</code> application
+     * temporary directory and all its contents are deleted upon application
+     * exit.
+     *
+     * @return full path name of the application temporary directory
+     * @throws IOException
+     *             if there are no file systems mounted, or an unspecified error
+     *             occurs
+     */
+    public static String createApplicationTempDirectory() throws IOException {
+        // <root>/tmpGUID/
+        String tmpDir = getApplicationTempDirPath();
+        mkdir(tmpDir);
+
+        return tmpDir;
+    }
+
+    /**
+     * Creates a temporary directory on the writable storage area of the file
+     * system. The temporary directory is created in the following location:
+     * <code>&lt;root&gt;/tmpGUID/dirName/</code> where
+     * <code>&lt;root&gt;/tmpGUID/</code> is an application temporary
+     * directory that is created using the unique application GUID; and
+     * <code>dirName/</code> is an optional directory name to create beneath the
+     * application temporary directory. If the application temporary directory
+     * does not exist, invoking this method will create it. <em>NOTE:</em> The
+     * <code>&lt;root&gt;/tmpGUID/</code> application temporary directory
+     * and all its contents are deleted upon application exit.
+     *
+     * @param dirName
+     *            name of directory to be created beneath the application
+     *            temporary directory
+     * @return full path name of the directory that was created
+     * @throws IOException
+     *             if there are no file systems mounted, or an unspecified error
+     *             occurs
+     */
+    public static String createTempDirectory(String dirName) throws IOException {
+        // create the application temp directory
+        String tmpDir = createApplicationTempDirectory();
+
+        // create specified sub-directory as "<root>/tmpGUID/dirName/"
+        dirName = (dirName == null) ? "" : dirName.trim();
+        if (dirName.length() > 0) {
+            if (!dirName.endsWith(FILE_SEPARATOR)) {
+                dirName += FILE_SEPARATOR;
+            }
+            tmpDir += dirName;
+            mkdir(tmpDir);
+        }
+        return tmpDir;
+    }
+
+    /**
+     * Attempts to delete the application temporary directory and all contents.
+     * The application temporary directory is:
+     * <code>&lt;root&gt;/tmpGUID/</code>, where <code>&lt;root&gt;</code> is
+     * the file system root (could be the SD card or internal storage); and
+     * <code>tmpGUID</code> is the application temporary directory that is
+     * created using the unique application GUID. <em>NOTE:</em> The
+     * <code>tmpGUID</code> application temporary directory and all
+     * sub-directories are deleted upon application exit.
+     *
+     * @throws IOException
+     *             if an unspecified error occurs
+     */
+    public synchronized static void deleteApplicationTempDirectory()
+            throws IOException {
+        String tmpDir = getApplicationTempDirPath();
+        delete(tmpDir);
+    }
+
+    /**
+     * Returns the full path of the application temporary directory. The path
+     * points to the following location: <code>&lt;root&gt;/tmpGUID/</code>
+     * where <code>&lt;root&gt;/</code> is the path of the writable directory on
+     * the file system (could be the SD card, if present, or the root file system
+     * on internal storage); and <code>tmpGUID/</code> is a application temporary
+     * directory that is created using the unique application GUID. The
+     * directory may not exist. Invoke
+     * <code>createApplicationTempDirectory</code> to create it.
+     *
+     * @return the full path name of the application temporary directory
+     */
+    public static String getApplicationTempDirPath() {
+        return getFileSystemRoot() + APP_TMP_DIR + FILE_SEPARATOR;
+    }
+
+    /**
+     * Returns the full path of a root file system. Will return the path of the
+     * SD card first, if it exists, or the root file system located on internal
+     * storage.
+     *
+     * @return full path that can be used to store files
+     */
+    public static String getFileSystemRoot() {
+        String root = null;
+        String sdcard = getSDCardPath();
+
+        // retrieve root list
+        Enumeration e = FileSystemRegistry.listRoots();
+        while (e.hasMoreElements()) {
+            root = "file:///" + (String) e.nextElement();
+            // system directory won't be writable
+            if (root.endsWith("system/")) {
+                continue;
+            }
+            // prefer the SDCard
+            else if (root.equals(sdcard)) {
+                break;
+            }
+        }
+        return root;
+    }
+
+    /**
+     * Returns the full path name to external storage (SD card, e.g.
+     * file:///SDCard/).
+     *
+     * @return full path name to the external storage (SD card)
+     */
+    public static String getSDCardPath() {
+        return System.getProperty("fileconn.dir.memorycard");
+    }
+
+    /**
+     * Returns the full path name of the user directory located on internal
+     * storage (e.g. file:///store/home/user/).
+     *
+     * @return full path name of the user directory
+     */
+    public static String getUserPath() {
+        // grab the music folder
+        String musicDir = System.getProperty("fileconn.dir.music");
+        // ignore trailing '/'
+        int i = musicDir.lastIndexOf('/', musicDir.length() - 2);
+        // strip off the last directory
+        return musicDir.substring(0, i + 1);
+    }
+
+    /**
+     * Returns the available size of the file system that the path resides on.
+     *
+     * @param path
+     *            full path of a file system entry
+     * @return available size, in bytes, of the root file system
+     * @throws IllegalArgumentException
+     *             if path is invalid
+     * @throws IOException
+     *             if an error occurs
+     */
+    public static long availableSize(String path)
+            throws IllegalArgumentException, IOException {
+        long availableSize = 0;
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection) Connector.open(path);
+            availableSize = fconn.availableSize();
+        }
+        finally {
+            try {
+                if (fconn != null)
+                    fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return availableSize;
+    }
+
+    /**
+     * Determines if the specified file system path exists.
+     * @param path full path of file or directory
+     * @return true if the file or directory exists
+     */
+    public static boolean exists(String path) {
+        boolean exists = false;
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection)Connector.open(path);
+            exists = fconn.exists();
+        }
+        catch (IllegalArgumentException e) {
+            Logger.log(FileUtils.class.getName() + ": " + e);
+        }
+        catch (IOException e) {
+            Logger.log(FileUtils.class.getName() + ": " + e);
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return exists;
+    }
+
+    /**
+     * Determines if the specified file system path refers to a directory.
+     * @param path full path of file or directory
+     * @return true if the file path exists, is accessible, and is a directory
+     */
+    public static boolean isDirectory(String path) {
+        boolean isDirectory = false;
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection)Connector.open(path);
+            isDirectory = fconn.isDirectory();
+        }
+        catch (IllegalArgumentException e) {
+            Logger.log(FileUtils.class.getName() + ": " + e);
+        }
+        catch (IOException e) {
+            Logger.log(FileUtils.class.getName() + ": " + e);
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return isDirectory;
+    }
+
+    /**
+     * Lists the contents of a directory. Lists both files and sub-directories.
+     *
+     * @param path
+     *            full path of the directory to list
+     * @return Enumeration containing names of files and sub-directories.
+     * @throws FileNotFoundException
+     *             if path is not found
+     * @throws IOException
+     *             if an error occurs
+     */
+    public static Enumeration listDirectory(String path)
+            throws FileNotFoundException, IOException {
+        FileConnection fconn = null;
+        Enumeration listing = null;
+        try {
+            fconn = (FileConnection) Connector.open(path);
+            if (!fconn.exists()) {
+                throw new FileNotFoundException(path + " does not exist.");
+            }
+            listing = fconn.list();
+        }
+        finally {
+            try {
+                if (fconn != null)
+                    fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return listing;
+    }
+
+    public static File getFileProperties(String filePath) throws FileNotFoundException {
+        File file = new File(stripSeparator(filePath));
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection)Connector.open(filePath);
+            if (!fconn.exists()) {
+                throw new FileNotFoundException();
+            }
+            file.setLastModifiedDate(fconn.lastModified());
+            file.setName(stripSeparator(fconn.getName()));
+            file.setType(MIMETypeAssociations.getMIMEType(filePath));
+            file.setSize(fconn.fileSize());
+        }
+        catch (IllegalArgumentException e) {
+            Logger.log(FileUtils.class.getName() + ": " + e);
+        }
+        catch (IOException e) {
+            Logger.log(FileUtils.class.getName() + ": " + e);
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return file;
+    }
+
+    /**
+     * Strips the trailing slash from path names.
+     *
+     * @param path
+     *            full or relative path name
+     * @return formatted path (without trailing slash)
+     */
+    public static String stripSeparator(String path) {
+        int len = FILE_SEPARATOR.length();
+        while (path.endsWith(FILE_SEPARATOR)) {
+            path = path.substring(0, path.length() - len);
+        }
+        return path;
+    }
+
+
+    /**
+     * If the specified file path does not have a URI prefix, prefix it with the
+     * file:/// prefix.
+     *
+     * @param filePath
+     * @return the prefixed URI.
+     */
+    public static String prefixFileURI(String filePath) {
+        if (!filePath.startsWith(LOCAL_PROTOCOL)
+                && !filePath.startsWith(FILE_PROTOCOL)
+                && !filePath.startsWith("http://")
+                && !filePath.startsWith("https://")) {
+            if (filePath.indexOf(FILE_SEPARATOR) != 0) {
+                filePath = FILE_PROTOCOL + FILE_SEPARATOR + filePath;
+            } else {
+                filePath = FILE_PROTOCOL + filePath;
+            }
+        }
+
+        return filePath;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Log.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Log.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Log.java
new file mode 100644
index 0000000..54396e7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Log.java
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.util;
+
+import net.rim.device.api.script.Scriptable;
+import net.rim.device.api.script.ScriptableFunction;
+
+/**
+ * Log provides a mechanism for JavaScript code to utilize the Event Log.
+ * Log represents an object in the script engine that can be accessed from the
+ * script environment using <code>cordova.Logger</code>.
+ *
+ * Log provides a function, <code>log(msg)</code>, that logs messages to the
+ * BlackBerry Event Log as well as to System.out.
+ *
+ * To use of the BlackBerry Event Log from JavaScript, you must first
+ * invoke the <code>enable()</code> method:
+ *
+ * <code>cordova.Logger.enable();</code>
+ * <code>cordova.Logger.log(msg);</code>
+ */
+public final class Log extends Scriptable {
+
+    /**
+     * Field used to log messages.
+     */
+    public static final String FIELD_LOG = "log";
+
+    /**
+     * Field used to enable message logging.
+     */
+    public static final String FIELD_ENABLE = "enable";
+
+    /**
+     * Logs messages to the BlackBerry Event Log and to <code>System.out</code>.
+     */
+    public final LogFunction logFunction; // logs to the Event Log
+
+    /**
+     * Constructor.
+     */
+    public Log() {
+        this.logFunction = new LogFunction();
+    }
+
+    /**
+     * The following fields are supported from the script environment:
+     *
+     *  <code>cordova.Logger.enable</code> - Enables message logging.
+     *  <code>cordova.Logger.log</code> - Logs the specified message.
+     */
+    public Object getField(String name) throws Exception {
+
+        if (name.equals(FIELD_LOG)) {
+            return this.logFunction;
+	    }
+        else if (name.equals(FIELD_ENABLE)) {
+            return new ScriptableFunction() {
+                public Object invoke(Object obj, Object[] oargs) throws Exception {
+                    Logger.enableLogging();
+                    return null;
+                }
+            };
+        }
+        return super.getField(name);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/LogFunction.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/LogFunction.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/LogFunction.java
new file mode 100644
index 0000000..918371d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/LogFunction.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.util;
+
+import net.rim.device.api.script.ScriptableFunction;
+
+/**
+ * LogFunction represents a function that can be invoked from the script
+ * environment of the widget framework.  Messages are logged to the BlackBerry
+ * Event Log.  From JavaScript, invoke
+ *
+ * <code>cordova.Logger.log(msg);</code>
+ */
+public class LogFunction extends ScriptableFunction {
+
+    public Object invoke(Object obj, Object[] oargs) throws Exception {
+
+        if (oargs != null) {
+            String message = (String)oargs[0];
+            Logger.log(message);
+        }
+
+        return null;
+      }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Logger.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Logger.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Logger.java
new file mode 100644
index 0000000..c5c21ad
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/Logger.java
@@ -0,0 +1,155 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.util;
+
+import java.util.Date;
+
+import org.apache.cordova.CordovaExtension;
+
+import net.rim.device.api.i18n.SimpleDateFormat;
+import net.rim.device.api.system.EventLogger;
+
+/**
+ * Logger provides a mechanism to log the the BlackBerry Event Log.  It uses
+ * the BlackBerry EventLogger class.
+ *
+ * The Event Log can be viewed on BlackBerry simulators using Tools > Show Event
+ * Log, or on physical devices by pressing the <code>Alt</code> key, followed by
+ * the <code>LGLG</code> key combination.
+ *
+ * To enable event logging, you must first call <code>enableLogging</code>.
+ *
+ * Logger also provides methods to write to <code>System.out</code> and
+ * <code>System.err</code>.
+ */
+public class Logger {
+
+    /**
+     * Application name
+     */
+    protected static String appName;
+
+    /**
+     *  Application GUID
+     */
+    protected static long appID;
+
+    /**
+     *  Used to format dates into a standard format
+     */
+    private static final SimpleDateFormat dateFormat =
+        new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+
+    /**
+     * Invoke this method to enable logging to the BlackBerry Event Log.
+     */
+    public static void enableLogging() {
+        appID = CordovaExtension.getAppID();
+        appName = CordovaExtension.getAppName();
+        if (EventLogger.register(appID, appName, EventLogger.VIEWER_STRING)) {
+            log("Logger enabled: " + "GUID=" + appID + ", name=" + appName);
+        }
+        else {
+            log("EventLogger registration failed.");
+        }
+    }
+
+    /**
+     * Sets the minimum logging level.
+     */
+    public static void setMinimumLoggingLevel(int level) {
+        EventLogger.setMinimumLevel(level);
+    }
+
+    /**
+     * Logs formatted message to Event Log with ALWAYS_LOG level.
+     */
+    public static void log(String msg) {
+        logEvent(msg, EventLogger.ALWAYS_LOG);
+    }
+
+    /**
+     * Logs formatted message to Event Log with DEBUG_INFO level.
+     */
+    public static void debug(String msg) {
+        logEvent(msg, EventLogger.DEBUG_INFO);
+    }
+
+    /**
+     * Logs formatted message to Event Log with INFORMATION level.
+     */
+    public static void info(String msg) {
+        logEvent(msg, EventLogger.INFORMATION);
+    }
+
+    /**
+     * Logs formatted message to Event Log with WARNING level.
+     */
+    public static void warn(String msg) {
+        logEvent(msg, EventLogger.WARNING);
+    }
+
+    /**
+     * Logs formatted message to Event Log with ERROR level.
+     */
+    public static void error(String msg) {
+        logEvent(msg, EventLogger.ERROR);
+    }
+
+    /**
+     * Logs formatted message to Event Log with SEVERE_ERROR level.
+     */
+    public static void severe(String msg) {
+        logEvent(msg, EventLogger.SEVERE_ERROR);
+    }
+
+    /**
+     * Prints unformatted message to System.out.
+     */
+    public static void out(String msg) {
+        System.out.println(msg);
+    }
+
+    /**
+     * Prints unformatted message to System.err.
+     */
+    public static void err(String msg, Throwable t) {
+        System.err.println(msg);
+        t.printStackTrace();
+    }
+
+    /**
+     * Logs formatted message to Event Log (if enabled) and System.out.
+     */
+    private static void logEvent(String msg, int level) {
+        String message = formatMessage(msg);
+        EventLogger.logEvent(appID, message.getBytes(), level);
+        out(message);
+    }
+
+    private static String formatMessage(String msg) {
+        StringBuffer sb = new StringBuffer();
+        sb.append(appName);
+        sb.append(" [");
+        sb.append(dateFormat.format(new Date()));
+        sb.append("]: ");
+        sb.append(msg);
+        return sb.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/StringUtils.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/StringUtils.java
new file mode 100644
index 0000000..0a4d45d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/util/StringUtils.java
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+/*
+ * Taken from Research in Motion knowledge base article:
+ *
+ * DB-00728: "How To - Implement a string splitter based on a given string delimiter", 24 March 2009.
+ * http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/832062/How_To_-_Implement_a_string_splitter_based_on_a_given_string_delimiter.html?nodeid=1498848&vernum=0
+ */
+package org.apache.cordova.util;
+
+/**
+ * Provides various string utility methods.
+ */
+public class StringUtils {
+
+    //Identifies the substrings in a given string that are delimited
+    //by one or more characters specified in an array, and then
+    //places the substrings into a String array.
+    public static String[] split(String strString, String strDelimiter) {
+        String[] strArray;
+        int iOccurrences = 0;
+        int iIndexOfInnerString = 0;
+        int iIndexOfDelimiter = 0;
+        int iCounter = 0;
+
+        //Check for null input strings.
+        if (strString == null) {
+            throw new IllegalArgumentException("Input string cannot be null.");
+        }
+        //Check for null or empty delimiter strings.
+        if (strDelimiter.length() <= 0 || strDelimiter == null) {
+            throw new IllegalArgumentException("Delimeter cannot be null or empty.");
+        }
+
+        //strString must be in this format: (without {} )
+        //"{str[0]}{delimiter}str[1]}{delimiter} ...
+        // {str[n-1]}{delimiter}{str[n]}{delimiter}"
+
+        //If strString begins with delimiter then remove it in order
+        //to comply with the desired format.
+
+        if (strString.startsWith(strDelimiter)) {
+            strString = strString.substring(strDelimiter.length());
+        }
+
+        //If strString does not end with the delimiter then add it
+        //to the string in order to comply with the desired format.
+        if (!strString.endsWith(strDelimiter)) {
+            strString += strDelimiter;
+        }
+
+        //Count occurrences of the delimiter in the string.
+        //Occurrences should be the same amount of inner strings.
+        while((iIndexOfDelimiter = strString.indexOf(strDelimiter,
+                iIndexOfInnerString)) != -1) {
+            iOccurrences += 1;
+            iIndexOfInnerString = iIndexOfDelimiter +
+            strDelimiter.length();
+        }
+
+        //Declare the array with the correct size.
+        strArray = new String[iOccurrences];
+
+        //Reset the indices.
+        iIndexOfInnerString = 0;
+        iIndexOfDelimiter = 0;
+
+        //Walk across the string again and this time add the
+        //strings to the array.
+        while((iIndexOfDelimiter = strString.indexOf(strDelimiter,
+                iIndexOfInnerString)) != -1) {
+
+            //Add string to array.
+            strArray[iCounter] = strString.substring(iIndexOfInnerString,iIndexOfDelimiter);
+
+            //Increment the index to the next character after
+            //the next delimiter.
+            iIndexOfInnerString = iIndexOfDelimiter +
+            strDelimiter.length();
+
+            //Inc the counter.
+            iCounter += 1;
+        }
+
+        return strArray;
+    }
+}


[27/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/run
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/run b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/run
new file mode 100755
index 0000000..9f47e10
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/run
@@ -0,0 +1,204 @@
+#!/usr/bin/env node
+
+/*
+ *  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.
+ */
+
+var childProcess = require("child_process"),
+    fs = require("fs"),
+    path = require("path"),
+    util = require("util"),
+    wrench = require("wrench"),
+    conf = require("./conf"),
+    localize = require("./localize"),
+    pkgrUtils = require("./packager-utils"),
+    properties = require('../../project.json'),
+    program = require('commander'),
+    xml2js = require('xml2js'),
+    target,
+    ip,
+    password,
+    workingdir,
+    barPath;
+
+function generateOptions(uninstall) {
+    var options = [];
+
+    workingdir = path.normalize(__dirname + "/.."),
+    barPath = path.normalize(__dirname + "/../../build/" + properties.targets[target].type + "/" + properties.barName + ".bar");
+
+    options.push("-device");
+    options.push(ip);
+
+    if (password) {
+        options.push("-password");
+        options.push(password);
+    }
+
+    options.push("-package");
+    options.push(barPath);
+
+    if (uninstall) {
+        options.push("-uninstallApp");
+        return options;
+    } else {
+
+        options.push("-installApp");
+
+        if (program.launch) {
+            options.push("-launchApp");
+        }
+
+        return options;
+    }
+}
+
+function execNativeDeploy(optionsArray, callback) {
+    var script = "/bin/blackberry-deploy",
+        nativeDeploy;
+        options = optionsArray.join(" ");
+
+    if (pkgrUtils.isWindows()) {
+        script += ".bat";
+    }
+
+    if (fs.existsSync(conf.DEPENDENCIES_TOOLS)) {
+        nativeDeploy = childProcess.exec(path.normalize(conf.DEPENDENCIES_TOOLS + script +" "+ options), {
+            "cwd": workingdir,
+            "env": process.env
+        });
+
+        nativeDeploy.stdout.on("data", pkgrUtils.handleProcessOutput);
+
+        nativeDeploy.stderr.on("data", pkgrUtils.handleProcessOutput);
+
+        nativeDeploy.on("exit", function (code) {
+            if (callback && typeof callback === "function") {
+                callback(code);
+            }
+        });
+    } else {
+        throw localize.translate("EXCEPTION_MISSING_TOOLS");
+    }
+}
+
+function checkTarget() {
+    if (!target) {
+        console.log("No target exists, to add that target please run target add <name> <ip> <type> [-p <password>] [--pin <devicepin>]\n");
+        return false;
+    }
+    if (!properties.targets[target]) {
+        console.log("The target \""+target+"\" does not exist, to add that target please run target add "+target+" <ip> <type> [-p <password>] [--pin <devicepin>]\n");
+        return false;
+    }
+    if (properties.targets[target].ip) {
+       ip = properties.targets[target].ip; 
+    } else {
+        console.log("IP is not defined in target \""+target+"\"\n");
+        return false;
+    }
+    if (properties.targets[target].password) {
+       password = properties.targets[target].password;
+    } 
+    return true;
+
+}
+
+function deployAll(keys) {
+    target = keys[0];
+
+    if (target) {
+        if (checkTarget()) {
+            var options = generateOptions();
+            if (program.uninstall) {
+                uninstall(
+                    function() {
+                        keys.shift();
+                        deployAll(keys);
+                });
+            } else {
+                execNativeDeploy(options,
+                    function() {
+                        deployAll(keys);
+                });
+            }
+        }
+    }
+}
+
+function uninstall(callback) {
+    var script = "/bin/blackberry-deploy",
+        nativeDeploy;
+
+    if (pkgrUtils.isWindows()) {
+        script += ".bat";
+    }
+
+    if (fs.existsSync(conf.DEPENDENCIES_TOOLS)) {
+        nativeDeploy = childProcess.exec(path.normalize(conf.DEPENDENCIES_TOOLS + script +" -listInstalledApps -device " +ip+ " -password " +password), {
+            "cwd": workingdir,
+            "env": process.env
+        }, function (error, stdout, stderr) {
+            var parser = new xml2js.Parser();
+            fs.readFile(path.join(__dirname + "/../../www/", "config.xml"), function(err, data) {
+                parser.parseString(data, function (err, result) {
+                    if (stdout.indexOf(result['@'].id) != -1) {
+                        var options = generateOptions(true);
+                        execNativeDeploy(options,
+                            function(){
+                                options = generateOptions(false);
+                                execNativeDeploy(options, callback);
+                        });
+                    } else {
+                        options = generateOptions(false);
+                        execNativeDeploy(options, callback);
+                    }
+                });
+            });
+        });
+    }
+}
+
+function exec(callback) {
+    program
+        .usage('command [<target>] [--no-launch] [--no-uninstall]')
+        .option('--no-uninstall', 'does not uninstall app from device')
+        .option('--no-launch', 'do not launch the app on device')
+
+    program
+        .command('all')
+        .usage('all [--no-launch] [--no-uninstall]')
+        .description('    Deploy the app on all targets')
+        .option('--no-uninstall', 'does not uninstall app from device')
+        .option('--no-launch', 'do not launch the app on device')
+    
+    program.parse(process.argv);
+    target = program.args[0] ? program.args[0] : properties.defaultTarget
+
+    if (target === "all") {
+        deployAll(Object.keys(properties.targets));
+    } else {
+        if (checkTarget()) {
+            if (program.uninstall) {
+                uninstall(callback);
+            } else {
+                options = generateOptions(false);
+                execNativeDeploy(options, callback)
+            }
+        }
+    }
+}
+
+exec(null);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/session.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/session.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/session.js
new file mode 100644
index 0000000..bb9fa06
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/session.js
@@ -0,0 +1,120 @@
+/*
+ *  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.
+ */
+
+var path = require("path"),
+    fs = require("fs"),
+    wrench = require("wrench"),
+    logger = require("./logger"),
+    signingHelper = require("./signing-helper"),
+    barConf = require("./bar-conf"),
+    localize = require("./localize"),
+    params;
+
+function getParams(cmdline, toolName) {
+    if (cmdline.params) {
+        if (!params) {
+            var paramsPath = path.resolve(cmdline.params);
+
+            if (fs.existsSync(paramsPath)) {
+                try {
+                    params = require(paramsPath);
+                } catch (e) {
+                    throw localize.translate("EXCEPTION_PARAMS_FILE_ERROR", paramsPath);
+                }
+            } else {
+                throw localize.translate("EXCEPTION_PARAMS_FILE_NOT_FOUND", paramsPath);
+            }
+        }
+
+        if (params) {
+            return params[toolName];
+        }
+    }
+
+    return null;
+}
+
+
+module.exports = {
+    initialize: function (cmdline) {
+        var sourceDir,
+            signingPassword,
+            outputDir = cmdline.output,
+            properties = require("../../project.json"),
+            archivePath = path.resolve(cmdline.args[0]),
+            archiveName = properties.barName ? properties.barName : path.basename(archivePath, '.zip'),
+            appdesc,
+            buildId = cmdline.buildId;
+
+        //If -o option was not provided, default output location is the same as .zip
+        outputDir = outputDir || path.dirname(archivePath);
+
+        //Only set signingPassword if it contains a value
+        if (cmdline.password && "string" === typeof cmdline.password) {
+            signingPassword = cmdline.password;
+        }
+
+        if (cmdline.appdesc && "string" === typeof cmdline.appdesc) {
+            appdesc = path.resolve(cmdline.appdesc);
+        }
+
+        //If -s [dir] is provided
+        if (cmdline.source && "string" === typeof cmdline.source) {
+            sourceDir = cmdline.source + "/src";
+        } else {
+            sourceDir = outputDir + "/src";
+        }
+
+        if (!fs.existsSync(sourceDir)) {
+            wrench.mkdirSyncRecursive(sourceDir, "0755");
+        }
+
+        logger.level(cmdline.loglevel || 'verbose');
+
+        return {
+            "conf": require("./conf"),
+            "keepSource": !!cmdline.source,
+            "sourceDir": path.resolve(sourceDir),
+            "sourcePaths": {
+                "ROOT": path.resolve(sourceDir),
+                "CHROME": path.normalize(path.resolve(sourceDir) + barConf.CHROME),
+                "LIB": path.normalize(path.resolve(sourceDir) + barConf.LIB),
+                "EXT": path.normalize(path.resolve(sourceDir) + barConf.EXT),
+                "UI": path.normalize(path.resolve(sourceDir) + barConf.UI),
+                "PLUGINS": path.normalize(path.resolve(sourceDir) + barConf.PLUGINS),
+                "JNEXT_PLUGINS": path.normalize(path.resolve(sourceDir) + barConf.JNEXT_PLUGINS)
+            },
+            "outputDir": path.resolve(outputDir),
+            "archivePath": archivePath,
+            "archiveName": archiveName,
+            "barPath": outputDir + "/%s/" + archiveName + ".bar",
+            "debug": !!cmdline.debug,
+            "keystore": signingHelper.getKeyStorePath(),
+            "keystoreCsk": signingHelper.getCskPath(),
+            "keystoreDb": signingHelper.getDbPath(),
+            "storepass": signingPassword,
+            "buildId": buildId,
+            "appdesc" : appdesc,
+            getParams: function (toolName) {
+                return getParams(cmdline, toolName);
+            },
+            isSigningRequired: function (config) {
+                return signingHelper.getKeyStorePath() && signingPassword && config.buildId;
+            },
+            "targets": ["simulator", "device"]
+        };
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/signing-helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/signing-helper.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/signing-helper.js
new file mode 100644
index 0000000..d0daafd
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/signing-helper.js
@@ -0,0 +1,127 @@
+/*
+ *  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.
+ */
+var path = require('path'),
+    fs = require("fs"),
+    os = require('os'),
+    childProcess = require("child_process"),
+    util = require("util"),
+    conf = require("./conf"),
+    pkgrUtils = require("./packager-utils"),
+    logger = require("./logger"),
+    AUTHOR_P12 = "author.p12",
+    CSK = "barsigner.csk",
+    DB = "barsigner.db",
+    _self;
+
+function getDefaultPath(file) {
+    // The default location where signing key files are stored will vary based on the OS:
+    // Windows XP: %HOMEPATH%\Local Settings\Application Data\Research In Motion
+    // Windows Vista and Windows 7: %HOMEPATH%\AppData\Local\Research In Motion
+    // Mac OS: ~/Library/Research In Motion
+    // UNIX or Linux: ~/.rim
+    var p = "";
+    if (os.type().toLowerCase().indexOf("windows") >= 0) {
+        // Try Windows XP location
+        p = process.env.HOMEDRIVE + process.env.HOMEPATH + "\\Local Settings\\Application Data\\Research In Motion\\" + file;
+        if (fs.existsSync(p)) {
+            return p;
+        }
+
+        // Try Windows Vista and Windows 7 location
+        p = process.env.HOMEDRIVE + process.env.HOMEPATH + "\\AppData\\Local\\Research In Motion\\" + file;
+        if (fs.existsSync(p)) {
+            return p;
+        }
+    } else if (os.type().toLowerCase().indexOf("darwin") >= 0) {
+        // Try Mac OS location
+        p = process.env.HOME + "/Library/Research In Motion/" + file;
+        if (fs.existsSync(p)) {
+            return p;
+        }
+    } else if (os.type().toLowerCase().indexOf("linux") >= 0) {
+        // Try Linux location
+        p = process.env.HOME + "/.rim/" + file;
+        if (fs.existsSync(p)) {
+            return p;
+        }
+    }
+}
+
+function execSigner(session, target, callback) {
+    var script = "blackberry-signer",
+        cwd = path.normalize(conf.DEPENDENCIES_TOOLS + "/bin/"),
+        signer,
+        params = session.getParams("blackberry-signer"),
+        args = [];
+
+    if (pkgrUtils.isWindows()) {
+        script += ".bat";
+    } else {
+        // add path to executable to work around issue with node
+        script = cwd + script;
+    }
+
+    args.push("-keystore");
+    args.push(session.keystore);
+    args.push("-storepass");
+    args.push(session.storepass);
+
+    if (params) {
+        Object.getOwnPropertyNames(params).forEach(function (p) {
+            args.push(p);
+
+            if (params[p]) {
+                args.push(params[p]);
+            }
+        });
+    }
+
+    args.push(path.resolve(util.format(session.barPath, target)));
+
+    signer = childProcess.spawn(script, args, {
+        "cwd": cwd,
+        "env": process.env
+    });
+
+    signer.stdout.on("data", pkgrUtils.handleProcessOutput);
+
+    signer.stderr.on("data", pkgrUtils.handleProcessOutput);
+
+    signer.on("exit", function (code) {
+        if (callback && typeof callback === "function") {
+            callback(code);
+        }
+    });
+}
+
+_self = {
+    getKeyStorePath : function () {
+        // Todo: decide where to put sigtool.p12 which is genereated and used in WebWorks SDK for Tablet OS
+        return getDefaultPath(AUTHOR_P12);
+    },
+
+    getCskPath : function () {
+        return getDefaultPath(CSK);
+    },
+
+    getDbPath : function () {
+        return getDefaultPath(DB);
+    },
+
+    execSigner: execSigner
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/target
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/target b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/target
new file mode 100644
index 0000000..61211d3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/target
@@ -0,0 +1,187 @@
+#!/usr/bin/env node
+/*
+ *  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.
+ */
+
+var propertiesFile = 'project.json',
+    properties = require('../../' + propertiesFile),
+    fs = require('fs'),
+    commander = require('commander'),
+    command,
+    name,
+    ip,
+    type,
+    password,
+    pin,
+    pinRegex = new RegExp("[0-9A-Fa-f]{8}");
+
+function writeProjectFile(contents, file) {
+    fs.writeFile(file, contents, 'utf-8', function (err) {
+        if (err) console.log("Error updating project.json :(\n" + err);
+        process.exit();
+    });
+}
+
+function isValidIp(ip) {
+    var num,
+        result = true,
+        ipArray;
+
+    if (typeof ip !== 'string') {
+        throw "IP is required";
+    } else {
+        ipArray = ip.split('.');
+        if (ipArray.length !== 4) {
+            result = false;
+        }
+        ipArray.forEach(function (quadrant) {
+            num = Number(quadrant);
+            if (isNaN(num) || (num < 0) || (num > 255)) {
+                result = false;
+            }
+        });
+    }
+    return result;
+}
+
+function isValidType(type) {
+    var result = true;
+
+    if (typeof type !== 'string') {
+        throw "target type is required";
+    }
+    else if (!(type === 'device' || type === 'simulator')) {
+        result = false;
+    }
+    return result;
+}
+
+function isValidPin(pin) {
+    var result = true;
+    if (typeof pin !== 'undefined' && !pinRegex.test(pin)) {
+        result = false;
+    }
+    return result;
+}
+
+commander
+    .usage('[command] [params]')
+    .option('-p, --password <password>', 'Specifies password for this target')
+    .option('--pin <devicepin>', 'Specifies PIN for this device');
+
+commander
+    .on('--help', function () {
+        console.log('   Synopsis:');
+        console.log('   $ target');
+        console.log('   $ target add <name> <ip> <type> [-p | --password <password>] [--pin <devicepin>]');
+        console.log('   $ target remove <name>');
+        console.log('   $ target default [name]');
+        console.log(' ');
+    });
+
+commander
+    .command('add')
+    .description("Add specified target")
+    .action(function () {
+        if (commander.args.length === 1) {
+            throw "Target details not specified";
+        }
+        name = commander.args[0];
+        ip = commander.args[1];
+        type = commander.args[2];
+        if (commander.password && typeof commander.password === 'string') {
+            password = commander.password;
+        }
+        if (commander.pin && typeof commander.pin === 'string') {
+            pin = commander.pin;
+        }
+        if (!isValidIp(ip)) {
+            throw "Invalid IP: " + ip;
+        }
+        if (!isValidType(type)) {
+            throw "Invalid target type: " + type;
+        }
+        if (!isValidPin(pin)) {
+            throw "Invalid PIN: " + pin;
+        }
+        if (properties.targets.hasOwnProperty(name)) {
+            console.log("Overwriting target: " + name);
+        }
+        properties.targets[name] = {"ip": ip, "type": type, "password": password, "pin": pin};
+    });
+
+commander
+    .command('remove')
+    .description("Remove specified target")
+    .action(function () {
+        if (commander.args.length === 1) {
+            throw 'No target specified';
+        }
+        name = commander.args[0];
+        if (!properties.targets.hasOwnProperty(name)) {
+            throw "Target: '" + name + "' not found";
+        }
+        if (name === properties.defaultTarget) {
+            console.log("Deleting default target, please set a new default target");
+            properties.defaultTarget = "";
+        }
+        delete properties.targets[name];
+    });
+
+commander
+    .command('default')
+    .description("Get or set default target")
+    .action(function () {
+        if (commander.args.length === 1) {
+            console.log(properties.defaultTarget);
+            process.exit();
+        }
+        name = commander.args[0];
+        if (properties.targets.hasOwnProperty(name)) {
+            properties.defaultTarget = name;
+        } else {
+            throw "Target '" + name + "' not found";
+        }
+    });
+
+commander
+    .command('*')
+    .action(function () {
+        throw 'Unrecognized command';
+    });
+
+
+try {
+    commander.parse(process.argv);
+
+    if (commander.args.length === 0) {
+        Object.keys(properties.targets).forEach(function (target) {
+            if (target === properties.defaultTarget) {
+                console.log('* ' + target);
+            } else {
+                console.log('  ' + target);
+            }
+        });
+        process.exit();
+    }
+    if (Object.keys(properties.targets).length === 1) {
+        properties.defaultTarget = Object.keys(properties.targets)[0];
+    }
+
+    writeProjectFile(JSON.stringify(properties, null, 4) + "\n", propertiesFile);
+} catch (e) {
+    console.log(e);
+    process.exit();
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin
new file mode 100755
index 0000000..fb7c467
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd $( dirname "$0")/../
+
+if [ "$1" = "add" ]
+    then
+        ./cordova/node_modules/plugman/plugman.js  --platform blackberry10 --project . --plugin $2
+fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin.bat b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin.bat
new file mode 100755
index 0000000..5406de4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/plugin.bat
@@ -0,0 +1,7 @@
+@ECHO OFF
+
+cd %~dp0..\
+
+if "%1" == "add" (
+    @node.exe ./cordova/node_modules/plugman/plugman.js --platform blackberry10 --project . --plugin %2
+)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run
new file mode 100755
index 0000000..6e089f9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run
@@ -0,0 +1,4 @@
+#cd into project dir
+cd $( dirname "$0")/../
+
+node ./cordova/lib/run "$@"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run.bat b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run.bat
new file mode 100755
index 0000000..64e6186
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/run.bat
@@ -0,0 +1,6 @@
+@ECHO OFF
+
+REM cd into project dir
+cd %~dp0\..\
+
+@node.exe ./cordova/lib/run %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target
new file mode 100755
index 0000000..624f835
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target
@@ -0,0 +1,5 @@
+#!/bin/sh
+# go to project root
+cd $( dirname "$0")/../
+
+node "cordova/lib/target" "$@"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target.bat b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target.bat
new file mode 100755
index 0000000..d9324c7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/target.bat
@@ -0,0 +1,24 @@
+@ECHO OFF
+goto comment
+       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.
+:comment
+
+REM cd into project dir
+cd %~dp0\..\
+
+@node.exe ./cordova/lib/target %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/data2xml/data2xml.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/data2xml/data2xml.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/data2xml/data2xml.js
new file mode 100644
index 0000000..8223d12
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/data2xml/data2xml.js
@@ -0,0 +1,86 @@
+// --------------------------------------------------------------------------------------------------------------------
+//
+// data2xml.js - A data to XML converter with a nice interface (for NodeJS).
+//
+// Copyright (c) 2011 AppsAttic Ltd - http://www.appsattic.com/
+// Written by Andrew Chilton <ch...@appsattic.com>
+//
+// License: http://opensource.org/licenses/MIT
+//
+// --------------------------------------------------------------------------------------------------------------------
+
+var xmlHeader = '<?xml version="1.0" encoding="utf-8"?>\n';
+
+function entitify(str) {
+    str = '' + str;
+    str = str
+        .replace(/&/g, '&amp;')
+        .replace(/</g,'&lt;')
+        .replace(/>/g,'&gt;')
+        .replace(/'/g, '&apos;')
+        .replace(/"/g, '&quot;');
+    return str;
+}
+
+function makeStartTag(name, attr) {
+    attr = attr || {};
+    var tag = '<' + name;
+    for(var a in attr) {
+        tag += ' ' + a + '="' + entitify(attr[a]) + '"';
+    }
+    tag += '>';
+    return tag;
+}
+
+function makeEndTag(name) {
+    return '</' + name + '>';
+}
+
+function makeElement(name, data) {
+    var element = '';
+    if ( Array.isArray(data) ) {
+        data.forEach(function(v) {
+            element += makeElement(name, v);
+        });
+        return element;
+    }
+    else if ( typeof data === 'object' ) {
+        element += makeStartTag(name, data._attr);
+        if ( data._value ) {
+            element += entitify(data._value);
+        }
+/************** MODIFICATION [always execute else condition] ***************/
+        for (var el in data) {
+            /**************** MODIFICATION {if condition altered} **********************/
+            if ( el === '_attr'  || el === '_value') {
+                continue;
+            }
+            element += makeElement(el, data[el]);
+        }
+        element += makeEndTag(name);
+        return element;
+/***************************** END MODIFICATION ***************************/
+    }
+    else {
+        // a piece of data on it's own can't have attributes
+        return makeStartTag(name) + entitify(data) + makeEndTag(name);
+    }
+    throw "Unknown data " + data;
+}
+
+var data2xml = function(name, data) {
+    var xml = xmlHeader;
+    xml += makeElement(name, data);
+    return xml;
+};
+
+// --------------------------------------------------------------------------------------------------------------------
+
+data2xml.entitify = entitify;
+data2xml.makeStartTag = makeStartTag;
+data2xml.makeEndTag = makeEndTag;
+data2xml.makeElement = makeElement;
+
+module.exports = data2xml;
+
+// --------------------------------------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/wrench/wrench.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/wrench/wrench.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/wrench/wrench.js
new file mode 100644
index 0000000..8c3d746
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/third_party/wrench/wrench.js
@@ -0,0 +1,78 @@
+/*  wrench.js
+ *
+ *  A collection of various utility functions I've found myself in need of
+ *  for use with Node.js (http://nodejs.org/). This includes things like:
+ *
+ *  - Recursively deleting directories in Node.js (Sync, not Async)
+ *  - Recursively copying directories in Node.js (Sync, not Async)
+ *  - Recursively chmoding a directory structure from Node.js (Sync, not Async)
+ *  - Other things that I'll add here as time goes on. Shhhh...
+ *
+ *  ~ Ryan McGrath (ryan [at] venodesigns.net)
+ */
+
+/* This file is originally licensed under https://raw.github.com/ryanmcgrath/wrench-js/master/LICENSE
+ * This code has been copied from https://raw.github.com/ryanmcgrath/wrench-js and modified
+ * add the functionality for a callback to the copyDirSyncRecursive method.
+ * Modifications have been clearly marked.
+ * The callback acts like a filter and you must return true/false from it to include/exclude a file
+ */
+
+var wrench = require('wrench'),
+    fs = require("fs"),
+    _path = require("path");
+/*  wrench.copyDirSyncRecursive("directory_to_copy", "new_directory_location", opts);
+ *
+ *  Recursively dives through a directory and moves all its files to a new location. This is a
+ *  Synchronous function, which blocks things until it's done. If you need/want to do this in
+ *  an Asynchronous manner, look at wrench.copyDirRecursively() below.
+ *
+ *  Note: Directories should be passed to this function without a trailing slash.
+ */
+wrench.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts, callback) {
+
+    /**************************Modification*****************************************/
+    if (typeof opts === "function") {
+        callback = opts;
+        opts = {};
+    }
+    /**************************Modification End*****************************************/
+
+    if (!opts || !opts.preserve) {
+        try {
+            if(fs.statSync(newDirLocation).isDirectory()) wrench.rmdirSyncRecursive(newDirLocation);
+        } catch(e) { }
+    }
+
+    /*  Create the directory where all our junk is moving to; read the mode of the source directory and mirror it */
+    var checkDir = fs.statSync(sourceDir);
+    try {
+        fs.mkdirSync(newDirLocation, checkDir.mode);
+    } catch (e) {
+        //if the directory already exists, that's okay
+        if (e.code !== 'EEXIST') throw e;
+    }
+
+    var files = fs.readdirSync(sourceDir);
+
+    for(var i = 0; i < files.length; i++) {
+        var currFile = fs.lstatSync(sourceDir + "/" + files[i]);
+        /**************************Modified to add if statement*****************************************/
+        if (callback && !callback(sourceDir + "/" + files[i], currFile)) {
+            continue;
+        }
+        if(currFile.isDirectory()) {
+            /*  recursion this thing right on back. */
+            wrench.copyDirSyncRecursive(sourceDir + "/" + files[i], newDirLocation + "/" + files[i], opts, callback);
+        } else if(currFile.isSymbolicLink()) {
+            var symlinkFull = fs.readlinkSync(sourceDir + "/" + files[i]);
+            fs.symlinkSync(symlinkFull, newDirLocation + "/" + files[i]);
+        } else {
+            /*  At this point, we've hit a file actually worth copying... so copy it on over. */
+            var contents = fs.readFileSync(sourceDir + "/" + files[i]);
+            fs.writeFileSync(newDirLocation + "/" + files[i], contents);
+        }
+    }
+};
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Accelerometer/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Accelerometer/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Accelerometer/index.js
new file mode 100644
index 0000000..47abe42
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Accelerometer/index.js
@@ -0,0 +1,45 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+var callback;
+
+module.exports = {
+    start: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        window.removeEventListener("devicemotion", callback);
+        callback = function (motion) {
+            var info = {
+                x: motion.accelerationIncludingGravity.x,
+                y: motion.accelerationIncludingGravity.y,
+                z: motion.accelerationIncludingGravity.z,
+                timestamp: motion.timestamp
+            };
+            result.callbackOk(info, true);
+        };
+        window.addEventListener("devicemotion", callback);
+        result.noResult(true);
+    },
+    stop: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        window.removeEventListener("devicemotion", callback);
+        result.ok("removed");
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Battery/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Battery/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Battery/index.js
new file mode 100644
index 0000000..fcac7b2
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Battery/index.js
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var SYSTEM_EVENTS = ["device.battery.statusChange",
+                     "device.battery.chargeLow",
+                     "device.battery.chargeCritical"],
+    clientListener;
+
+module.exports = {
+    start: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        if (!!clientListener) {
+            result.error("Battery listener already running");
+        } else {
+            clientListener = function (info) {
+                result.callbackOk(info, true);
+            };
+            SYSTEM_EVENTS.forEach(function (event) {
+                window.qnx.webplatform.device.addEventListener(event, clientListener);
+            });
+            result.noResult(true);
+        }
+    },
+    stop: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        if (!clientListener) {
+            result.error("Battery listener has not started");
+        } else {
+            SYSTEM_EVENTS.forEach(function (event) {
+                window.qnx.webplatform.device.removeEventListener(event, clientListener);
+            });
+            clientListener = null;
+            result.noResult(false);
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Camera/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Camera/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Camera/index.js
new file mode 100644
index 0000000..922f049
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Camera/index.js
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+var PictureSourceType = {
+        PHOTOLIBRARY : 0,    // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)
+        CAMERA : 1,          // Take picture from camera
+        SAVEDPHOTOALBUM : 2  // Choose image from picture library (same as PHOTOLIBRARY for Android)
+    },
+    DestinationType = {
+        DATA_URL: 0,         // Return base64 encoded string
+        FILE_URI: 1,         // Return file uri (content://media/external/images/media/2 for Android)
+        NATIVE_URI: 2        // Return native uri (eg. asset-library://... for iOS)
+    };
+
+function encodeBase64(filePath, callback) {
+    var sandbox = window.qnx.webplatform.getController().setFileSystemSandbox, // save original sandbox value
+        errorHandler = function (err) {
+            var msg = "An error occured: ";
+
+            switch (err.code) {
+            case FileError.NOT_FOUND_ERR:
+                msg += "File or directory not found";
+                break;
+
+            case FileError.NOT_READABLE_ERR:
+                msg += "File or directory not readable";
+                break;
+
+            case FileError.PATH_EXISTS_ERR:
+                msg += "File or directory already exists";
+                break;
+
+            case FileError.TYPE_MISMATCH_ERR:
+                msg += "Invalid file type";
+                break;
+
+            default:
+                msg += "Unknown Error";
+                break;
+            };
+
+            // set it back to original value
+            window.qnx.webplatform.getController().setFileSystemSandbox = sandbox;
+            callback(msg);
+        },
+        gotFile = function (fileEntry) {
+            fileEntry.file(function (file) {
+                var reader = new FileReader();
+
+                reader.onloadend = function (e) {
+                    // set it back to original value
+                    window.qnx.webplatform.getController().setFileSystemSandbox = sandbox;
+                    callback(this.result);
+                };
+
+                reader.readAsDataURL(file);
+            }, errorHandler);
+        },
+        onInitFs = function (fs) {
+            window.qnx.webplatform.getController().setFileSystemSandbox = false;
+            fs.root.getFile(filePath, {create: false}, gotFile, errorHandler);
+        };
+
+    window.webkitRequestFileSystem(window.TEMPORARY, 10 * 1024 * 1024, onInitFs, errorHandler); // set size to 10MB max
+}
+
+module.exports = {
+    takePicture: function (success, fail, args, env) {
+        var destinationType = JSON.parse(decodeURIComponent(args[1])),
+            sourceType = JSON.parse(decodeURIComponent(args[2])),
+            result = new PluginResult(args, env),
+            done = function (data) {
+                if (destinationType === DestinationType.FILE_URI) {
+                    data = "file://" + data;
+                    result.callbackOk(data, false);
+                } else {
+                    encodeBase64(data, function (data) {
+                        if (/^data:/.test(data)) {
+                            data = data.slice(data.indexOf(",") + 1);
+                            result.callbackOk(data, false);
+                        } else {
+                            result.callbackError(data, false);
+                        }
+                    });
+                }
+            },
+            cancel = function (reason) {
+                result.callbackError(reason, false);
+            },
+            invoked = function (error) {
+                if (error) {
+                    result.callbackError(error, false);
+                }
+            };
+
+        switch(sourceType) {
+        case PictureSourceType.CAMERA:
+            window.qnx.webplatform.getApplication().cards.camera.open("photo", done, cancel, invoked);
+            break;
+
+        case PictureSourceType.PHOTOLIBRARY:
+        case PictureSourceType.SAVEDPHOTOALBUM:
+            window.qnx.webplatform.getApplication().cards.filePicker.open({
+                mode: "Picker",
+                type: ["picture"]
+            }, done, cancel, invoked);
+            break;
+        }
+
+        result.noResult(true);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Device/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Device/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Device/index.js
new file mode 100644
index 0000000..f4849f5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Device/index.js
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2010-2011 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 getModelName () {
+    var modelName = window.qnx.webplatform.device.modelName;
+    //Pre 10.2 (meaning Z10 or Q10)
+    if (typeof modelName === "undefined") {
+        if (window.screen.height === 720 && window.screen.width === 720) {
+            modelName = "Q10";
+        } else if ((window.screen.height === 1280 && window.screen.width === 768) ||
+                   (window.screen.height === 768 && window.screen.width === 1280)) {
+            modelName = "Z10";
+        } else {
+            modelName = window.qnx.webplatform.deviceName;
+        }
+    }
+
+    return modelName;
+}
+
+function getUUID () {
+    var uuid = "";
+    try {
+        //Must surround by try catch because this will throw if the app is missing permissions
+        uuid = window.qnx.webplatform.device.devicePin;
+    } catch (e) {
+        //DO Nothing
+    }
+    return uuid;
+}
+
+module.exports = {
+    getDeviceInfo: function (success, fail, args, env) {
+        var result = new PluginResult(args, env),
+            modelName = getModelName(),
+            uuid = getUUID(),
+            info = {
+                platform: "blackberry10",
+                version: window.qnx.webplatform.device.scmBundle,
+                model: modelName,
+                name: modelName, // deprecated: please use device.model
+                uuid: uuid,
+                cordova: "2.5.0"
+            };
+        result.ok(info);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/Makefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/Makefile b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/Makefile
new file mode 100644
index 0000000..0cc5eae
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/Makefile
@@ -0,0 +1,8 @@
+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-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/common.mk
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/common.mk b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/common.mk
new file mode 100644
index 0000000..6cecca9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/common.mk
@@ -0,0 +1,34 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+NAME=jpps
+PLUGIN=yes
+UTILS=yes
+
+include ../../../../../../meta.mk
+
+override CCFLAGS := $(filter-out -Werror , $(CCFLAGS))
+
+EXTRA_SRCVPATH+=$(WEBWORKS_DIR)/plugin/com.blackberry.jpps/src/blackberry10/native/src/utils \
+				$(WEBWORKS_DIR)/plugin/com.blackberry.jpps/src/blackberry10/native/src/core \
+				$(WEBWORKS_DIR)/plugin/com.blackberry.jpps/src/blackberry10/native/src/plugin
+
+EXTRA_INCVPATH+=$(WEBWORKS_DIR)/plugin/com.blackberry.jpps/src/blackberry10/native/src/utils \
+				$(WEBWORKS_DIR)/plugin/com.blackberry.jpps/src/blackberry10/native/src/core \
+				$(WEBWORKS_DIR)/plugin/com.blackberry.jpps/src/blackberry10/native/src/plugin
+
+SRCS+=src/utils/Thread.cpp \
+      src/core/PPSInterface.cpp \
+      src/core/PPSNotifier.cpp \
+      src/core/PPSNotifyGroupManager.cpp \
+      src/plugin/JPPSPlugin.cpp \
+      src/plugin/PPSInterfaceGlue.cpp \
+      src/plugin/JPPSServerPlugin.cpp \
+      src/plugin/PPSServerGlue.cpp \
+      src/plugin/pluginManifest.cpp
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+LIBS+=pps

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

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

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSEvent.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSEvent.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSEvent.h
new file mode 100644
index 0000000..808e699
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSEvent.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PPSEVENT_H_
+#define PPSEVENT_H_
+
+#include <string>
+#include "PPSTypes.h"
+
+namespace jpps {
+
+/**
+ * A class representing a PPS event. Used to notify interested parties when something
+ * happens to a PPS object.
+ */
+class PPSEvent {
+
+public:
+
+	/**
+	 * The possible types of this event.
+	 */
+	enum PPSEventType {
+		/** The PPS object's first data read is complete. */
+		PPS_EVENT_FIRST_READ_COMPLETE,
+		/** The PPS object has new data. */
+		PPS_EVENT_NEW_DATA,
+		/** The PPS object was successfully opened. */
+		PPS_EVENT_OPENED,
+		/** A PPS object was closed. */
+		PPS_EVENT_CLOSED,
+		/** An attempt to open a PPS object failed. */
+		PPS_EVENT_OPEN_FAILED,
+		/** An attempt to read from a PPS object failed. */
+		PPS_EVENT_READ_FAILED,
+		/** An attempt to write to a PPS object failed. */
+		PPS_EVENT_WRITE_FAILED,
+	};
+
+	/**
+	 * Constructor.
+	 *
+	 * @param eventType The type of event this is.
+	 * @param data If eventType == PPS_EVENT_NEW_DATA, the new data.
+	 */
+	PPSEvent(PPSEventType eventType, const std::string& msg = "", const ppsObject& newData = ppsObject())
+	: m_eventType(eventType)
+	, m_message(msg)
+	, m_newData(newData)
+	{}
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~PPSEvent() {}
+
+	/**
+	 * Get the event type.
+	 */
+	inline PPSEventType getEventType() const { return m_eventType; }
+
+	/**
+	 * Get the message associated with this event.
+	 */
+	inline std::string getMessage() const { return m_message; }
+
+	/**
+	 * Get the new data. This value is only populated if the eventType is PPS_EVENT_NEW_DATA. This data
+	 * is what was parsed out of the PPS object.
+	 */
+	inline ppsObject getNewData() const { return m_newData; }
+
+private:
+
+	// Disable the default constructor.
+	PPSEvent();
+
+	/** The type of this event. */
+	PPSEventType m_eventType;
+
+	/** A message associated to the event. */
+	std::string m_message;
+
+	/** If m_eventType == PPS_EVENT_NEW_DATA, this contains the new data. Else m_newData is empty.
+	 * This data is the data that was read from the PPS object, un-massaged. */
+	ppsObject m_newData;
+};
+
+} /* namespace jpps */
+#endif /* PPSEVENT_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.cpp
new file mode 100644
index 0000000..dfb575b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.cpp
@@ -0,0 +1,632 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "PPSInterface.h"
+
+#include <sstream>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <ppsparse.h>
+#include <string.h>
+
+#include "PPSNotifyGroupManager.h"
+#include "PPSEvent.h"
+
+namespace jpps {
+
+// Const statics
+const char* PPSInterface::PPS_ROOT = "/pps/";
+const int PPSInterface::MaxPPSReadSize = (32 * 1024);
+
+// Static data members
+pthread_mutex_t PPSInterface::sm_mutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t PPSInterface::sm_cond;
+volatile bool PPSInterface::sm_firstInitDone = false;
+std::map<unsigned int, PPSInterface*> PPSInterface::sm_interfaceLookupTable;
+
+PPSInterface::PPSInterface()
+: m_pEventFunc(NULL)
+, m_pEventArg(NULL)
+, m_interfaceId(0)
+, m_fd(-1)
+, m_oflags(0)
+, m_firstRead(true)
+, m_cachedRead()
+, m_logger()
+{
+	// This is used to assign a unique ID to each PPSInterface object
+	static unsigned int interfaceIDs = 0;
+
+	::pthread_mutex_lock(&sm_mutex);
+
+	m_interfaceId = interfaceIDs;
+	interfaceIDs++; // Increment this so that the next object has a unique id.
+
+	// Add myself to the lookup table
+	sm_interfaceLookupTable.insert(std::pair<unsigned int, PPSInterface*>(m_interfaceId, this));
+
+	if (!sm_firstInitDone) {
+
+		// Initialize the condvar
+		pthread_condattr_t condAttr;
+		::pthread_condattr_init(&condAttr);
+		::pthread_condattr_setclock(&condAttr, CLOCK_MONOTONIC);
+		::pthread_cond_init(&sm_cond, &condAttr);
+		::pthread_condattr_destroy(&condAttr);
+
+		sm_firstInitDone = true;
+	}
+
+	::pthread_mutex_unlock(&sm_mutex);
+}
+
+PPSInterface::~PPSInterface()
+{
+	std::ostringstream ostream;
+	ostream << "PPSInterface::~PPSInterface() - Destruct fd:" << m_fd << ".";
+	m_logger.slog(Logger::debug, ostream.str());
+
+	// Close my open PPS object, if I have one
+	close();
+
+	// Remove myself from the lookup table
+	sm_interfaceLookupTable.erase(m_interfaceId);
+}
+
+void PPSInterface::setVerbose(unsigned short v)
+{
+	m_logger.setVerbosity(v);
+}
+
+void PPSInterface::setEventFunc(const PPSEventFunc* pEventFunc, void* pArg)
+{
+	m_pEventFunc = pEventFunc;
+	m_pEventArg = pArg;
+}
+
+bool PPSInterface::open(const std::string& path, int oflag, int mode, bool server)
+{
+	// If we've already got an open file, fail
+	if (m_fd != -1) {
+
+		m_logger.slog(Logger::warning, "PPSInterface::open() Failed - Attempted to open an object that is already open.");
+		sendEvent(PPSEvent(PPSEvent::PPS_EVENT_OPEN_FAILED, "Attempted to open an object that is already open."));
+		return false;
+	}
+
+	std::string errorMsg;
+	bool ok = false;
+
+	// Prepend PPS_ROOT to the path if it doesn't start with a '/'
+	std::string fullpath = (path[0] != '/' ? PPSInterface::PPS_ROOT : "") + path;
+
+	// This flag is used to prevent the notify thread from performing reads while the
+	// open() function is running and doing its first read.
+	::pthread_mutex_lock(&sm_mutex);
+	m_firstRead = true;
+	::pthread_mutex_unlock(&sm_mutex);
+
+	// Remove any options from the path otherwise lstat will fail
+	std::string pathNoOptions(fullpath);
+	std::size_t nPosOpts = fullpath.rfind('?');
+
+	if (nPosOpts != std::string::npos)
+		pathNoOptions = fullpath.substr(0, nPosOpts);
+
+	// There are a few complexities associated with symbolic links.  If
+	// the last component of the path is a symlink we have to resolve it
+	// since we won't be able to resolve the name when the options are
+	// added.  Also we need to get the path relative to the pps filesystem
+	// so we can locate the .notify file.  So, if the object already
+	// exists, resolve the path.  If it doesn't and O_CREAT is specified
+	// resolve the directory it's in, otherwise it's a failure.
+	std::string resolvedName;
+	char szResolvedName[PATH_MAX+128]; // buffer for use with the C functions
+
+	if (::realpath(pathNoOptions.c_str(), szResolvedName) != NULL) {
+
+		resolvedName = szResolvedName;
+		ok = true;
+	}
+	else if (oflag & O_CREAT) {
+
+		// Chop off the file name, so we can try to resolve the directory
+		size_t nPos = pathNoOptions.rfind('/');
+
+		// We found a '/'
+		if (nPos != std::string::npos) {
+
+			// Get the directory path
+			std::string dirPath = pathNoOptions.substr(0, nPos); // Don't include the '/'
+
+			if (::realpath(dirPath.c_str(), szResolvedName) != NULL) {
+
+				// Concatenate the file name to the resolved directory path
+				resolvedName = szResolvedName + pathNoOptions.substr(nPos); // include the '/' at the start
+				ok = true;
+			}
+		}
+	}
+
+	if (ok) {
+
+		struct stat info;
+		int result = ::lstat(resolvedName.c_str(), &info);
+
+		if (result != 0) {
+
+			// If we failed and we're not creating a non-existent file, it's an error.
+			if ((errno != ENOENT) && !(oflag & O_CREAT))
+				ok = false;
+		}
+		else if (S_ISDIR(info.st_mode))
+			ok = false;
+	}
+
+	if (ok) {
+
+		std::string options;
+
+		// Now lets work with the options to ensure we have a complete version
+		std::string pathOptions;
+		
+		// Get just the stuff after '?'
+		size_t nPos = fullpath.rfind('?');
+
+		if (nPos != std::string::npos) {
+			pathOptions = fullpath.substr(nPos);
+		}
+
+		if ((oflag & O_ACCMODE) != O_WRONLY) {
+
+			// This is used as the return object for the joinNotifyGroup() call
+			// It's only valid if joinNotifyGroup() returned true
+			std::string groupId;
+
+			PPSNotifyGroupManager::mutexLock();
+			PPSNotifyGroupManager& notifyManager = PPSNotifyGroupManager::getInstance();
+			bool groupJoined = notifyManager.joinNotifyGroup(resolvedName, groupId);
+			PPSNotifyGroupManager::mutexUnlock();
+
+			if (groupJoined) {
+
+				// If we're acting as a server, we use server as an option
+				// otherwise we have to specify delta mode.  PPS has a fit
+				// if we specify both delta and deltadir so check for this.
+				std::string modeExtra;
+
+				// Add in the options we need.  If both server and delta are specified, use only
+				// server (it kind of implies delta and at one point pps would not like both being
+				// present)
+				if (server) {
+					modeExtra = ",server";
+				}
+				// If we have no options or there's no 'deltadir' specified, use delta mode
+				else if (pathOptions.empty() || pathOptions.find("deltadir") == std::string::npos) {
+					modeExtra = ",delta";
+				}
+
+				// We embed the m_interfaceID as a unique identifier that will be passed on to the
+				// PPSNotifier. PPSNotifier will use this id in conjunction with getPPSInterface()
+				// in order to send this object notifications that content is ready for reading later.
+				std::ostringstream ostream;
+				ostream << "?" << (pathOptions.empty() ? "" : pathOptions.substr(1) + ",") << "notify="
+						<< groupId << ":" << m_interfaceId << modeExtra;
+				options = ostream.str();
+			}
+		}
+
+		if (!options.empty()) {
+
+			resolvedName += options;
+		}
+
+		// The big moment... Let's try to actually open the PPS object...
+		if (ok) {
+			m_fd = ::open(resolvedName.c_str(), oflag, mode);
+		}
+
+		// Error opening the PPS object
+		if (m_fd < 0) {
+
+			std::ostringstream ostream;
+			ostream << "PPSInterface::open() Failed - ::open("
+					<< (((oflag & O_ACCMODE) == O_WRONLY) ? "write" :
+					   ((oflag & O_ACCMODE) == O_RDONLY) ? "read" :
+					   ((oflag & O_ACCMODE) == O_RDWR) ? "r/w" : "???")
+					<< ((oflag & O_CREAT) ? ":create" : "")
+					<< ") " << resolvedName << " (" << errno << ": " << strerror(errno) << ")";
+			m_logger.slog(Logger::warning, ostream.str());
+			errorMsg = ostream.str();
+		}
+		else {
+			// Depending on our umask, the permissions might not have
+			// been as specified. So if O_CREAT was specified, re-set the
+			// permissions.  The object might already exist, but perhaps
+			// that's OK too.
+			if (oflag & O_CREAT) {
+				::fchmod(m_fd, mode);
+			}
+
+			m_oflags = oflag;
+
+			std::ostringstream ostream;
+			ostream << "PPSInterface::open() - ::open("
+					<< (((oflag & O_ACCMODE) == O_WRONLY) ? "write" :
+					   ((oflag & O_ACCMODE) == O_RDONLY) ? "read" :
+					   ((oflag & O_ACCMODE) == O_RDWR) ? "r/w" : "???")
+					<< ((oflag & O_CREAT) ? ":create" : "")
+					<< ") " << resolvedName;
+			m_logger.slog(Logger::debug, ostream.str());
+		}
+	}
+	// For whatever reason, the path to the PPS object was not valid
+	else {
+		std::ostringstream ostream;
+		ostream << "PPSInterface::open() Failed - ::open("
+				<< (((oflag & O_ACCMODE) == O_WRONLY) ? "write" :
+				   ((oflag & O_ACCMODE) == O_RDONLY) ? "read" :
+				   ((oflag & O_ACCMODE) == O_RDWR) ? "r/w" : "???")
+				<< ((oflag & O_CREAT) ? ":create" : "")
+				<< ") " << path << " The PPS object could not be resolved properly.";
+		m_logger.slog(Logger::warning, ostream.str());
+		errorMsg = ostream.str();
+	}
+
+	sendEvent(PPSEvent(m_fd >= 0 ? PPSEvent::PPS_EVENT_OPENED : PPSEvent::PPS_EVENT_OPEN_FAILED, errorMsg));
+
+	if (m_fd >= 0 && (oflag & O_ACCMODE) != O_WRONLY) {
+
+		// Perform the initial read
+		readFromObject();
+	}
+
+	// Tell the other thread we are done with the first read
+	::pthread_mutex_lock(&sm_mutex);
+	m_firstRead = false;
+	::pthread_cond_broadcast(&sm_cond);
+	::pthread_mutex_unlock(&sm_mutex);
+
+	return m_fd >= 0;
+}
+
+void PPSInterface::write(const std::string& data)
+{
+	// We're trying to write to an unopened PPS object
+	if (m_fd == -1) {
+
+		std::string msg("PPSInterface::write() Failed - Attempting to write to a file that isn't open.");
+		m_logger.slog(Logger::warning, msg);
+		sendEvent(PPSEvent(PPSEvent::PPS_EVENT_WRITE_FAILED, msg));
+	}
+
+	ssize_t ret = ::write(m_fd, data.c_str(), data.length());
+
+	// Debug slog the write call if it was successful
+	if (ret >= 0) {
+
+		std::ostringstream ostream;
+		ostream << "PPSInterface::write() - fd:" << m_fd << " : \n" << data;
+		m_logger.slog(Logger::debug, ostream.str());
+	}
+
+	// There was an error writing
+	if (ret == -1) {
+
+		std::ostringstream ostream;
+		ostream << "PPSInterface::write() Failed - Error writing to fd:" << m_fd << " (" << errno << ": " << strerror(errno) << ")";
+		m_logger.slog(Logger::warning, ostream.str());
+		sendEvent(PPSEvent(PPSEvent::PPS_EVENT_WRITE_FAILED, ostream.str()));
+	}
+
+	// If we wrote successfully and the file is open in read/write mode, then we need to manually update the
+	// read cache. When in O_RDWR mode, we do NOT receive notifications of our own write() operations.
+	// This means that the cache of read data becomes stale - it is missing the data that we have written
+	// to the object ourselves. In this case, we will manually update the cache.
+	// NOTE: this seems fraught with peril, but unfortunately there don't seem to be any good solutions to
+	// fixing the problem of read/write mode and read() integrity.
+	if (ret >= 0 && (m_oflags & O_RDWR)) {
+
+		// We're going to try to fool the ppsparse() method into parsing the data we write.
+		char* pWriteData = new char[data.length() + 1];
+
+		// The later call to ppsparse() moves the pWriteData pointer forward, and we need the original pointer
+		// in order to properly delete the object later, so let's cache it here
+		char* pWriteDataCopy = pWriteData;
+
+		std::strcpy(pWriteData, data.c_str()); // strcpy null terminates for us
+
+		// Parse the write buffer - this should give us a ppsObject with only attributes
+		ppsObject parsedData = parsePPSData(pWriteData);
+
+		// The data being written does not include the object name other object properties (duh)
+		// So parsedData contains only attribute info. We want to preserve the object name
+		// and properties, so lets just copy the ones in the cache into our parsedData struct
+		// so that the call to updateCachedReadData() will preserve them (i.e. copy them back)
+		parsedData.name = m_cachedRead.name;
+		parsedData.flags = m_cachedRead.flags;
+		parsedData.options = m_cachedRead.options;
+		parsedData.optionMask = m_cachedRead.optionMask;
+
+		// Update the cache
+		updateCachedReadData(parsedData);
+
+		// Cleanup our allocated memory
+		if (pWriteDataCopy) {
+
+			delete[] pWriteDataCopy;
+		}
+	}
+}
+
+void PPSInterface::sync()
+{
+	if (m_fd >= 0)
+		::fsync(m_fd);
+}
+
+void PPSInterface::close()
+{
+	if (m_fd >= 0) {
+
+		::close(m_fd);
+		m_fd = -1;
+		m_cachedRead = ppsObject();
+		m_oflags = 0;
+
+		sendEvent(PPSEvent(PPSEvent::PPS_EVENT_CLOSED));
+	}
+}
+
+void PPSInterface::onNotify(NotifyType event)
+{
+	// We only handle read notifications
+	if (event != PPS_READ) {
+		return;
+	}
+
+	if (m_firstRead) {
+		::pthread_mutex_lock(&sm_mutex);
+		while (m_firstRead) {
+			::pthread_cond_wait(&sm_cond, &sm_mutex);
+		}
+		::pthread_mutex_unlock(&sm_mutex);
+	}
+
+	readFromObject();
+}
+
+void PPSInterface::readFromObject()
+{
+	bool sendFirstReadEvent = m_firstRead;
+
+	// This was a uint8_t - was there a reason?
+	char szBuffer[MaxPPSReadSize + 1];
+	int bufferLen;
+
+	// Read from the actual PPS file - this call is not blocking
+	while ((bufferLen = ::read(m_fd, szBuffer, MaxPPSReadSize)) > 0) {
+
+		if (bufferLen <= MaxPPSReadSize) {
+
+			// Make sure the buffer is null terminated.
+			szBuffer[bufferLen] = '\0';
+
+			std::string buf(szBuffer, bufferLen);
+			std::ostringstream ostream;
+			ostream << "PPSInterface::readFromObject() - fd:" << m_fd << " len:" << bufferLen << "\n" << buf;
+			m_logger.slog(Logger::debug, ostream.str());
+
+			// Parse the PPS data
+			ppsObject parsedPPS = parsePPSData(szBuffer);
+
+			// Update the cache with the data we just read
+			updateCachedReadData(parsedPPS);
+
+			// If this is the first read, then send the first read event.
+			if (sendFirstReadEvent) {
+
+				sendEvent(PPSEvent(PPSEvent::PPS_EVENT_FIRST_READ_COMPLETE, "", parsedPPS));
+				sendFirstReadEvent = false;
+			}
+			else {
+
+				sendEvent(PPSEvent(PPSEvent::PPS_EVENT_NEW_DATA, "", parsedPPS));
+			}
+		}
+		else {
+
+			std::ostringstream ostream;
+			ostream << "PPSInterface::readFromObject() Failed - fd:" << m_fd << " oversized message len:" << bufferLen << ".";
+			m_logger.slog(Logger::warning, ostream.str());
+		}
+	}
+
+	if (bufferLen == -1) {
+
+		std::ostringstream ostream;
+		ostream << "PPSInterface::readFromObject() Failed - Error reading from fd:" << m_fd << " (" << errno << ": " << strerror(errno) << ")";
+		m_logger.slog(Logger::warning, ostream.str());
+		sendEvent(PPSEvent(PPSEvent::PPS_EVENT_READ_FAILED, ostream.str()));
+	}
+
+	// It's possible that we won't go into the while() loop above (sometimes the first read is legitimately empty)
+	// in which case, we still need to send a first read complete event
+	if (sendFirstReadEvent) {
+
+		// Send an empty first read object
+		sendEvent(PPSEvent(PPSEvent::PPS_EVENT_FIRST_READ_COMPLETE, "", ppsObject()));
+		sendFirstReadEvent = false;
+	}
+}
+
+void PPSInterface::sendEvent(const PPSEvent& event) const
+{
+	if (m_pEventFunc) {
+		m_pEventFunc(m_pEventArg, event);
+	}
+}
+
+PPSInterface* const PPSInterface::getPPSInterface(const unsigned int id)
+{
+	::pthread_mutex_lock(&sm_mutex);
+
+	std::map<unsigned int, PPSInterface*>::iterator it = sm_interfaceLookupTable.find(id);
+
+	if (it != sm_interfaceLookupTable.end()) {
+
+		::pthread_mutex_unlock(&sm_mutex);
+		return (*it).second;
+	}
+
+	::pthread_mutex_unlock(&sm_mutex);
+	return NULL;
+}
+
+ppsObject PPSInterface::parsePPSData(char* data) const
+{
+	// This is the structure that will contain parsed data for each line of the PPS object
+	// It needs to be initialized to NULL
+	pps_attrib_t info;
+	std::memset(&info, 0, sizeof(info));
+
+	// The return code for each PPS line that gets parsed
+	pps_status_t rc;
+	ppsObject ppsObj;
+
+	while ((rc = ::ppsparse(&data, NULL, NULL, &info, 0)) != PPS_END) {
+
+		if (rc == -1) {
+
+			std::ostringstream ostream;
+			ostream << "PPSInterface::parsePPSData() Failed - Error calling ppsparse() fd:" << m_fd << " (" << errno << ": " << strerror(errno) << ")";
+			m_logger.slog(Logger::warning, ostream.str());
+			sendEvent(PPSEvent(PPSEvent::PPS_EVENT_READ_FAILED, ostream.str()));
+		}
+
+		if (info.flags & PPS_INCOMPLETE) {
+			m_logger.slog(Logger::debug, "PPSInterface::parsePPSData - PPS data incomplete.");
+		}
+
+		switch (rc) {
+
+			// When the object has been modified, update the object settings
+			case PPS_OBJECT:
+			case PPS_OBJECT_CREATED:
+			case PPS_OBJECT_DELETED:
+			case PPS_OBJECT_TRUNCATED:
+			{
+				ppsObj.name = info.obj_name;
+				ppsObj.flags = info.flags;
+				ppsObj.options = info.options;
+				ppsObj.optionMask = info.option_mask;
+				break;
+			}
+
+			// An attribute has been updated
+			case PPS_ATTRIBUTE:
+			case PPS_ATTRIBUTE_DELETED:
+			{
+				ppsAttribute ppsAttrib;
+				ppsAttrib.name = info.attr_name;
+
+				// Value and encoding aren't valid if rc == PPS_ATTRIBUTE_DELETED
+				if (rc == PPS_ATTRIBUTE) {
+
+					ppsAttrib.value = info.value;
+					ppsAttrib.encoding = info.encoding;
+				}
+
+				ppsAttrib.flags = info.flags;
+				ppsAttrib.options = info.options;
+				ppsAttrib.optionMask = info.option_mask;
+
+				ppsObj.attributes.insert(ppsAttrPair(ppsAttrib.name, ppsAttrib));
+				break;
+			}
+
+			case PPS_ERROR:
+			{
+				std::string msg("PPSInterface::parsePPSData() Failed - Error parsing PPS data.");
+				m_logger.slog(Logger::warning, msg);
+				sendEvent(PPSEvent(PPSEvent::PPS_EVENT_READ_FAILED, msg));
+				break;
+			}
+
+			case PPS_END:
+			default:
+				break;
+		}
+
+	}
+
+	return ppsObj;
+}
+
+void PPSInterface::updateCachedReadData(const ppsObject& newData)
+{
+	::pthread_mutex_lock(&sm_mutex);
+
+	// Update the object
+	m_cachedRead.name = newData.name;
+	m_cachedRead.flags = newData.flags;
+	m_cachedRead.options = newData.options;
+	m_cachedRead.optionMask = newData.optionMask;
+
+	::pthread_mutex_unlock(&sm_mutex);
+
+	// Update the attributes
+	for (const_ppsAttrIter it = newData.attributes.begin(); it != newData.attributes.end(); it++) {
+
+		ppsAttribute attr = (*it).second;
+
+		// An attribute is being deleted
+		if (attr.flags & PPS_DELETED) {
+
+			::pthread_mutex_lock(&sm_mutex);
+
+			// Look for this attribute in the cache and remove it
+			ppsAttrIter findIt = m_cachedRead.attributes.find(attr.name);
+
+			if (findIt != m_cachedRead.attributes.end()) {
+				m_cachedRead.attributes.erase(findIt);
+			}
+
+			::pthread_mutex_unlock(&sm_mutex);
+		}
+		// We're adding a new attribute - don't search for it
+		else if (attr.flags & PPS_CREATED){
+
+			::pthread_mutex_lock(&sm_mutex);
+			m_cachedRead.attributes.insert(ppsAttrPair(attr.name, attr));
+			::pthread_mutex_unlock(&sm_mutex);
+		}
+		else {
+
+			::pthread_mutex_lock(&sm_mutex);
+
+			// Look for this attribute in the cache
+			ppsAttrIter findIt = m_cachedRead.attributes.find(attr.name);
+
+			// If we find it, update the attribute values
+			if (findIt != m_cachedRead.attributes.end()) {
+
+				(*findIt).second.name = attr.name;
+				(*findIt).second.encoding = attr.encoding;
+				(*findIt).second.value = attr.value;
+				(*findIt).second.flags = attr.flags;
+				(*findIt).second.options = attr.options;
+				(*findIt).second.optionMask = attr.optionMask;
+			}
+			// If we don't find it, insert it
+			else {
+				m_cachedRead.attributes.insert(ppsAttrPair(attr.name, attr));
+			}
+			::pthread_mutex_unlock(&sm_mutex);
+		}
+	}
+}
+
+} /* namespace jpps */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.h
new file mode 100644
index 0000000..0fde80c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSInterface.h
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PPS_H_
+#define PPS_H_
+
+#include <string>
+#include <map>
+
+#include <sys/types.h>
+
+#include "PPSTypes.h"
+#include "PPSEvent.h"
+#include "../utils/Logger.h"
+
+namespace jpps {
+
+/**
+ * This class augments standard PPS functionality by providing events for when PPS objects are opened,
+ * closed, have new data, etc.
+ *
+ * When a PPS object is opened using PPSInterface::open(), the object is opened as part of a notification group
+ * managed by PPSNotifyGroupManager. The notification group monitors the PPS object and notifies PPSInterface
+ * whenever there is new data available in the PPS object.
+ *
+ * PPSInterface should be used in order to simplify PPS object monitoring (i.e. watching for new data in a PPS
+ * object.) PPSInterface takes over management of watching for new data and uses a notification callback mechanism
+ * with a defined set of possible events to inform the client of changes to the PPS object.
+ */
+class PPSInterface {
+
+public:
+
+	/**
+	 * Used with onNotify to allow the PPSNotifier to tell us what type of notification
+	 * message it is sending.
+	 */
+	enum NotifyType {
+		/** The .notify object received a notification that data is ready to be read. */
+		PPS_READ = 0,
+		/** The .notify object received a notification that a file being watched is closing. */
+		PPS_CLOSE = 1 };
+
+	/**
+	 * Constructor.
+	 */
+	PPSInterface();
+
+	/**
+	 * Destructor.
+	 */
+	~PPSInterface();
+
+	/**
+	 * Set up a function to call to be notified about PPS events.
+	 *
+	 * @param pEventFunc The function to call whenever an event happens in PPSInterface.
+	 * @param pArg An optional parameter that will be passed back to pEventFunc every time it
+	 * is called. PPSInterface will not modify pArg.
+	 */
+	void setEventFunc(const PPSEventFunc* pEventFunc, void* pArg = NULL);
+
+	/**
+	 * Enable verbose mode. Increase the number of �v�s to increase verbosity.
+	 *
+	 * @param v The level of verbosity. A value of 0 is off, 1 shows info messages, 2 shows
+	 * debug messages.
+	 */
+	void setVerbose(unsigned short v);
+
+	/**
+	 * Open a PPS object. If the open() call is successful, a PPS_EVENT_OPENED event will be sent.
+	 * The PPS object will be read as part of the open operation and the PPS_EVENT_FIRST_READ_COMPLETE
+	 * will be sent when the first read is complete. Note that there may be a PPS_EVENT_NEW_DATA
+	 * event *before* the PPS_EVENT_FIRST_READ_COMPLETE event, or there may not be.
+	 * PPS_EVENT_FIRST_READ_COMPLETE only guarantees that at least one read has been performed, not
+	 * that it will be the first read event to fire.
+	 *
+	 * If the open operation fails, the function returns false and a PPS_EVENT_OPEN_FAILED will be sent.
+	 *
+	 * @param path The PPS file/directory path.
+	 * @param oflags Flags passed to ::open.
+	 * @param mode Mode passed to ::open.
+	 * @param serverMode If true, open the object in server mode as the server.
+	 * @return True if the open was successful, false otherwise.
+	 */
+	bool open(const std::string& path, int oflags, int mode, bool serverMode);
+
+	/**
+	 * Check if this PPS object is open.
+	 * @return True if the file is open, false otherwise.
+	 */
+	inline bool isOpen() const { return m_fd >= 0; }
+
+	/**
+	 * Write data to a PPS object.
+	 * @param data The data to write to the PPS object.
+	 */
+	void write(const std::string& data);
+
+	/**
+	 * Read PPS data. Note that this reads cached data from the last read performed when a
+	 * new data available notification was received.
+	 *
+	 * @return A structured representation of the PPS object, culled from a call to ppsparse()
+	 * a function found in ppsparse.h.
+	 */
+
+	inline ppsObject read() const { return m_cachedRead; }
+
+	/**
+	 * Close this PPS object.
+	 */
+	void close();
+
+	/**
+	 * Forces all queued I/O operations for this object to finish, synchronizing the file's state.
+	 * The function blocks until this is finished.
+	 */
+	void sync();
+
+	/**
+	 * Called to notify us that there is data ready to be read.
+	 *
+	 * @param event The type of event we're being notified about.
+	 */
+	void onNotify(NotifyType event);
+
+	/**
+	 * Given a unique id, return the PPSInterface* matching that id.
+	 *
+	 * Every PPSInterface object is assigned a unique identifier at construction. This
+	 * unique identifier can be used to get a pointer to a PPSInterface at runtime.
+	 *
+	 * In particular, the PPSNotifier gets notifications with this number embedded in them.
+	 * Using this id, the PPSNotifier can callback into the correct PPSInterface instance.
+	 *
+	 * @param id An id that uniquely identifies a PPSInterface object.
+	 * @return a PPSInterface* or NULL if no object matches the given id.
+	 */
+	static PPSInterface* const getPPSInterface(const unsigned int id);
+
+private:
+
+	/**
+	 * Read from the PPS object. Generally this function is called by onNotify() when
+	 * the notifier thread is notified that there is data to be read. This function
+	 * performs a read() of the PPS object that is non-blocking.
+	 */
+	void readFromObject();
+
+	/**
+	 * Given data from a PPS read, parse the PPS data.
+	 */
+	ppsObject parsePPSData(char* data) const;
+
+	/**
+	 * Given new PPS data, update the cached read value.
+	 */
+	void updateCachedReadData(const ppsObject& newData);
+
+	/**
+	 * Call the function set in setEventFunc() with the given event.
+	 *
+	 * @param event The event to send.
+	 */
+	void sendEvent(const PPSEvent& event) const;
+
+	/** The default PPS location. */
+	static const char* PPS_ROOT;
+
+	/** The maximum amount of data that can be read from a PPS object. */
+	static const int MaxPPSReadSize;
+
+	/** The function to call to notify about PPS events. */
+	PPSEventFunc* m_pEventFunc;
+
+	/** An argument that goes with m_pEventFunc. PPSInterface does not modify or use
+	 * this parameter - we simply send it back with every m_pEventFunc call. */
+	void* m_pEventArg;
+
+	/** An identifier that uniquely identifies this PPSInterface object. This is used to look up
+	 * this object in a global table. */
+	unsigned int m_interfaceId;
+
+	/** The file descriptor of the PPS object being opened. */
+	int m_fd;
+
+	/** The open mode flags used when this object was opened. */
+	int m_oflags;
+
+	/** If true, main thread is performing initial open/read of PPS object. This is shared
+	 * across threads and needs to be mutexed when accessed.*/
+	volatile bool m_firstRead;
+
+	/** The data from the last read performed. */
+	ppsObject m_cachedRead;
+
+	/** The logger used to log error messages */
+	Logger m_logger;
+
+	/** Mutex used to prevent threads from clobbering each other. */
+	static pthread_mutex_t sm_mutex;
+
+	/** Condvar used for multi-thread signaling. */
+	static pthread_cond_t sm_cond;
+
+	/** Used to ensure that initialization of statics happens only once. This is shared
+	 * across threads and needs to be mutexed when accessed.*/
+	static volatile bool sm_firstInitDone;
+
+	/** The PPSNotifier needs a way to transform an id that uniquely identifies a PPSInterface object
+	 * into an actual PPSInterface*. When we construct a new PPSInterface, we will assign it a unique id
+	 * and we will put the id and the pointer to the object into this table. The table can then be used
+	 * to lookup this object from its unique id. */
+	static std::map<unsigned int, PPSInterface*> sm_interfaceLookupTable;
+};
+
+} /* namespace jpps */
+#endif /* PPS_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.cpp
new file mode 100644
index 0000000..7869a56
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "PPSNotifier.h"
+
+#include <sstream>
+
+#include <fcntl.h>
+
+#include "PPSInterface.h"
+#include "../utils/Logger.h"
+
+namespace jpps {
+
+PPSNotifier::PPSNotifier()
+: m_notifyObjPath("")
+, m_notifyObjFd(-1)
+, m_notifyGroupId("")
+, m_thread()
+{
+
+}
+
+PPSNotifier::~PPSNotifier()
+{
+	// Stop the thread
+	m_thread.stop();
+
+	// Close the .notify file
+	if (m_notifyObjFd >= 0) {
+		::close(m_notifyObjFd);
+	}
+}
+
+void PPSNotifier::startNotifyLoop()
+{
+	m_thread.start(_notifyLoop, this, "plugin_jPPS_PPSNotifier(" + m_notifyObjPath + "/.notify)");
+}
+
+
+void* PPSNotifier::_notifyLoop(void* pArg)
+{
+	// Something is messed up
+	if (pArg == NULL)
+		return NULL;
+
+	PPSNotifier* pNotifier = static_cast<PPSNotifier*> (pArg);
+
+	// pArg is supposed to be a PPSNotifier object...
+	if (pNotifier == NULL)
+		return NULL;
+
+	pNotifier->notifyLoop();
+
+	return NULL;
+}
+
+void PPSNotifier::notifyLoop()
+{
+	// Buffer for read() operation
+	char szData[256];
+	int dataLen;
+
+	// This is a blocking read call: this will wait in this loop forever
+	while ((dataLen = ::read(m_notifyObjFd, szData, sizeof(szData)-1)) > 0) {
+
+                szData[dataLen] = '\0';
+		std::string data(szData);
+
+		if ((unsigned int)dataLen > sizeof(szData)-1) {
+
+			std::ostringstream ostream;
+			ostream << "PPSNotifier::notifyLoop() - Notify read overflow " << dataLen << ".";
+			Logger logger;
+			logger.slog(Logger::error, ostream.str());
+		}
+
+		std::size_t nPos = data.find('\n');
+
+		// While we find linefeeds
+		while(nPos != std::string::npos) {
+
+			// Read the first char
+			PPSInterface::NotifyType event = data[0] == '-' ? PPSInterface::PPS_CLOSE : PPSInterface::PPS_READ;
+			std::size_t nAddrPos = data.find(':');
+
+			if (nAddrPos != std::string::npos) {
+
+				std::string sAddress = data.substr(nAddrPos+1);
+				std::size_t nAddrEnd = sAddress.find('\n');
+
+				if (nAddrEnd != std::string::npos) {
+
+					sAddress = sAddress.substr(0, nAddrEnd);
+
+					unsigned int interfaceId = 0;
+
+					std::stringstream ss;
+					ss << sAddress;
+					ss >> interfaceId;
+
+					PPSInterface* const pPPS = PPSInterface::getPPSInterface(interfaceId);
+
+					if (pPPS) {
+						pPPS->onNotify(event);
+					}
+				}
+			}
+
+			// Don't go off the end of the string
+			if (++nPos < data.length()) {
+
+				// Remove the stuff up to the first '\n' and look for the next '\n'
+				data = data.substr(nPos);
+				nPos = data.find('\n');
+			}
+			else {
+
+				nPos = std::string::npos;
+			}
+		}
+	}
+}
+
+} /* namespace jpps */


[02/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js
new file mode 100644
index 0000000..d3f83be
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js
@@ -0,0 +1,3145 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, CodeFragment, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, last, locationDataToString, merge, multident, some, starts, throwSyntaxError, unfoldSoak, utility, _ref, _ref1, _ref2, _ref3,
+    __hasProp = {}.hasOwnProperty,
+    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+    __slice = [].slice;
+
+  Error.stackTraceLimit = Infinity;
+
+  Scope = require('./scope').Scope;
+
+  _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED;
+
+  _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
+
+  exports.extend = extend;
+
+  exports.addLocationDataFn = addLocationDataFn;
+
+  YES = function() {
+    return true;
+  };
+
+  NO = function() {
+    return false;
+  };
+
+  THIS = function() {
+    return this;
+  };
+
+  NEGATE = function() {
+    this.negated = !this.negated;
+    return this;
+  };
+
+  exports.CodeFragment = CodeFragment = (function() {
+    function CodeFragment(parent, code) {
+      var _ref2;
+
+      this.code = "" + code;
+      this.locationData = parent != null ? parent.locationData : void 0;
+      this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown';
+    }
+
+    CodeFragment.prototype.toString = function() {
+      return "" + this.code + [this.locationData ? ": " + locationDataToString(this.locationData) : void 0];
+    };
+
+    return CodeFragment;
+
+  })();
+
+  fragmentsToText = function(fragments) {
+    var fragment;
+
+    return ((function() {
+      var _i, _len, _results;
+
+      _results = [];
+      for (_i = 0, _len = fragments.length; _i < _len; _i++) {
+        fragment = fragments[_i];
+        _results.push(fragment.code);
+      }
+      return _results;
+    })()).join('');
+  };
+
+  exports.Base = Base = (function() {
+    function Base() {}
+
+    Base.prototype.compile = function(o, lvl) {
+      return fragmentsToText(this.compileToFragments(o, lvl));
+    };
+
+    Base.prototype.compileToFragments = function(o, lvl) {
+      var node;
+
+      o = extend({}, o);
+      if (lvl) {
+        o.level = lvl;
+      }
+      node = this.unfoldSoak(o) || this;
+      node.tab = o.indent;
+      if (o.level === LEVEL_TOP || !node.isStatement(o)) {
+        return node.compileNode(o);
+      } else {
+        return node.compileClosure(o);
+      }
+    };
+
+    Base.prototype.compileClosure = function(o) {
+      var jumpNode;
+
+      if (jumpNode = this.jumps()) {
+        jumpNode.error('cannot use a pure statement in an expression');
+      }
+      o.sharedScope = true;
+      return Closure.wrap(this).compileNode(o);
+    };
+
+    Base.prototype.cache = function(o, level, reused) {
+      var ref, sub;
+
+      if (!this.isComplex()) {
+        ref = level ? this.compileToFragments(o, level) : this;
+        return [ref, ref];
+      } else {
+        ref = new Literal(reused || o.scope.freeVariable('ref'));
+        sub = new Assign(ref, this);
+        if (level) {
+          return [sub.compileToFragments(o, level), [this.makeCode(ref.value)]];
+        } else {
+          return [sub, ref];
+        }
+      }
+    };
+
+    Base.prototype.cacheToCodeFragments = function(cacheValues) {
+      return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])];
+    };
+
+    Base.prototype.makeReturn = function(res) {
+      var me;
+
+      me = this.unwrapAll();
+      if (res) {
+        return new Call(new Literal("" + res + ".push"), [me]);
+      } else {
+        return new Return(me);
+      }
+    };
+
+    Base.prototype.contains = function(pred) {
+      var node;
+
+      node = void 0;
+      this.traverseChildren(false, function(n) {
+        if (pred(n)) {
+          node = n;
+          return false;
+        }
+      });
+      return node;
+    };
+
+    Base.prototype.lastNonComment = function(list) {
+      var i;
+
+      i = list.length;
+      while (i--) {
+        if (!(list[i] instanceof Comment)) {
+          return list[i];
+        }
+      }
+      return null;
+    };
+
+    Base.prototype.toString = function(idt, name) {
+      var tree;
+
+      if (idt == null) {
+        idt = '';
+      }
+      if (name == null) {
+        name = this.constructor.name;
+      }
+      tree = '\n' + idt + name;
+      if (this.soak) {
+        tree += '?';
+      }
+      this.eachChild(function(node) {
+        return tree += node.toString(idt + TAB);
+      });
+      return tree;
+    };
+
+    Base.prototype.eachChild = function(func) {
+      var attr, child, _i, _j, _len, _len1, _ref2, _ref3;
+
+      if (!this.children) {
+        return this;
+      }
+      _ref2 = this.children;
+      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+        attr = _ref2[_i];
+        if (this[attr]) {
+          _ref3 = flatten([this[attr]]);
+          for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
+            child = _ref3[_j];
+            if (func(child) === false) {
+              return this;
+            }
+          }
+        }
+      }
+      return this;
+    };
+
+    Base.prototype.traverseChildren = function(crossScope, func) {
+      return this.eachChild(function(child) {
+        if (func(child) === false) {
+          return false;
+        }
+        return child.traverseChildren(crossScope, func);
+      });
+    };
+
+    Base.prototype.invert = function() {
+      return new Op('!', this);
+    };
+
+    Base.prototype.unwrapAll = function() {
+      var node;
+
+      node = this;
+      while (node !== (node = node.unwrap())) {
+        continue;
+      }
+      return node;
+    };
+
+    Base.prototype.children = [];
+
+    Base.prototype.isStatement = NO;
+
+    Base.prototype.jumps = NO;
+
+    Base.prototype.isComplex = YES;
+
+    Base.prototype.isChainable = NO;
+
+    Base.prototype.isAssignable = NO;
+
+    Base.prototype.unwrap = THIS;
+
+    Base.prototype.unfoldSoak = NO;
+
+    Base.prototype.assigns = NO;
+
+    Base.prototype.updateLocationDataIfMissing = function(locationData) {
+      this.locationData || (this.locationData = locationData);
+      return this.eachChild(function(child) {
+        return child.updateLocationDataIfMissing(locationData);
+      });
+    };
+
+    Base.prototype.error = function(message) {
+      return throwSyntaxError(message, this.locationData);
+    };
+
+    Base.prototype.makeCode = function(code) {
+      return new CodeFragment(this, code);
+    };
+
+    Base.prototype.wrapInBraces = function(fragments) {
+      return [].concat(this.makeCode('('), fragments, this.makeCode(')'));
+    };
+
+    Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) {
+      var answer, fragments, i, _i, _len;
+
+      answer = [];
+      for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) {
+        fragments = fragmentsList[i];
+        if (i) {
+          answer.push(this.makeCode(joinStr));
+        }
+        answer = answer.concat(fragments);
+      }
+      return answer;
+    };
+
+    return Base;
+
+  })();
+
+  exports.Block = Block = (function(_super) {
+    __extends(Block, _super);
+
+    function Block(nodes) {
+      this.expressions = compact(flatten(nodes || []));
+    }
+
+    Block.prototype.children = ['expressions'];
+
+    Block.prototype.push = function(node) {
+      this.expressions.push(node);
+      return this;
+    };
+
+    Block.prototype.pop = function() {
+      return this.expressions.pop();
+    };
+
+    Block.prototype.unshift = function(node) {
+      this.expressions.unshift(node);
+      return this;
+    };
+
+    Block.prototype.unwrap = function() {
+      if (this.expressions.length === 1) {
+        return this.expressions[0];
+      } else {
+        return this;
+      }
+    };
+
+    Block.prototype.isEmpty = function() {
+      return !this.expressions.length;
+    };
+
+    Block.prototype.isStatement = function(o) {
+      var exp, _i, _len, _ref2;
+
+      _ref2 = this.expressions;
+      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+        exp = _ref2[_i];
+        if (exp.isStatement(o)) {
+          return true;
+        }
+      }
+      return false;
+    };
+
+    Block.prototype.jumps = function(o) {
+      var exp, _i, _len, _ref2;
+
+      _ref2 = this.expressions;
+      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+        exp = _ref2[_i];
+        if (exp.jumps(o)) {
+          return exp;
+        }
+      }
+    };
+
+    Block.prototype.makeReturn = function(res) {
+      var expr, len;
+
+      len = this.expressions.length;
+      while (len--) {
+        expr = this.expressions[len];
+        if (!(expr instanceof Comment)) {
+          this.expressions[len] = expr.makeReturn(res);
+          if (expr instanceof Return && !expr.expression) {
+            this.expressions.splice(len, 1);
+          }
+          break;
+        }
+      }
+      return this;
+    };
+
+    Block.prototype.compileToFragments = function(o, level) {
+      if (o == null) {
+        o = {};
+      }
+      if (o.scope) {
+        return Block.__super__.compileToFragments.call(this, o, level);
+      } else {
+        return this.compileRoot(o);
+      }
+    };
+
+    Block.prototype.compileNode = function(o) {
+      var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2;
+
+      this.tab = o.indent;
+      top = o.level === LEVEL_TOP;
+      compiledNodes = [];
+      _ref2 = this.expressions;
+      for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) {
+        node = _ref2[index];
+        node = node.unwrapAll();
+        node = node.unfoldSoak(o) || node;
+        if (node instanceof Block) {
+          compiledNodes.push(node.compileNode(o));
+        } else if (top) {
+          node.front = true;
+          fragments = node.compileToFragments(o);
+          if (!node.isStatement(o)) {
+            fragments.unshift(this.makeCode("" + this.tab));
+            fragments.push(this.makeCode(";"));
+          }
+          compiledNodes.push(fragments);
+        } else {
+          compiledNodes.push(node.compileToFragments(o, LEVEL_LIST));
+        }
+      }
+      if (top) {
+        if (this.spaced) {
+          return [].concat(this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n"));
+        } else {
+          return this.joinFragmentArrays(compiledNodes, '\n');
+        }
+      }
+      if (compiledNodes.length) {
+        answer = this.joinFragmentArrays(compiledNodes, ', ');
+      } else {
+        answer = [this.makeCode("void 0")];
+      }
+      if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) {
+        return this.wrapInBraces(answer);
+      } else {
+        return answer;
+      }
+    };
+
+    Block.prototype.compileRoot = function(o) {
+      var exp, fragments, i, name, prelude, preludeExps, rest, _i, _len, _ref2;
+
+      o.indent = o.bare ? '' : TAB;
+      o.level = LEVEL_TOP;
+      this.spaced = true;
+      o.scope = new Scope(null, this, null);
+      _ref2 = o.locals || [];
+      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+        name = _ref2[_i];
+        o.scope.parameter(name);
+      }
+      prelude = [];
+      if (!o.bare) {
+        preludeExps = (function() {
+          var _j, _len1, _ref3, _results;
+
+          _ref3 = this.expressions;
+          _results = [];
+          for (i = _j = 0, _len1 = _ref3.length; _j < _len1; i = ++_j) {
+            exp = _ref3[i];
+            if (!(exp.unwrap() instanceof Comment)) {
+              break;
+            }
+            _results.push(exp);
+          }
+          return _results;
+        }).call(this);
+        rest = this.expressions.slice(preludeExps.length);
+        this.expressions = preludeExps;
+        if (preludeExps.length) {
+          prelude = this.compileNode(merge(o, {
+            indent: ''
+          }));
+          prelude.push(this.makeCode("\n"));
+        }
+        this.expressions = rest;
+      }
+      fragments = this.compileWithDeclarations(o);
+      if (o.bare) {
+        return fragments;
+      }
+      return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n"));
+    };
+
+    Block.prototype.compileWithDeclarations = function(o) {
+      var assigns, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
+
+      fragments = [];
+      post = [];
+      _ref2 = this.expressions;
+      for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
+        exp = _ref2[i];
+        exp = exp.unwrap();
+        if (!(exp instanceof Comment || exp instanceof Literal)) {
+          break;
+        }
+      }
+      o = merge(o, {
+        level: LEVEL_TOP
+      });
+      if (i) {
+        rest = this.expressions.splice(i, 9e9);
+        _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1];
+        _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1];
+        this.expressions = rest;
+      }
+      post = this.compileNode(o);
+      scope = o.scope;
+      if (scope.expressions === this) {
+        declars = o.scope.hasDeclarations();
+        assigns = scope.hasAssignments;
+        if (declars || assigns) {
+          if (i) {
+            fragments.push(this.makeCode('\n'));
+          }
+          fragments.push(this.makeCode("" + this.tab + "var "));
+          if (declars) {
+            fragments.push(this.makeCode(scope.declaredVariables().join(', ')));
+          }
+          if (assigns) {
+            if (declars) {
+              fragments.push(this.makeCode(",\n" + (this.tab + TAB)));
+            }
+            fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB))));
+          }
+          fragments.push(this.makeCode(';\n\n'));
+        }
+      }
+      return fragments.concat(post);
+    };
+
+    Block.wrap = function(nodes) {
+      if (nodes.length === 1 && nodes[0] instanceof Block) {
+        return nodes[0];
+      }
+      return new Block(nodes);
+    };
+
+    return Block;
+
+  })(Base);
+
+  exports.Literal = Literal = (function(_super) {
+    __extends(Literal, _super);
+
+    function Literal(value) {
+      this.value = value;
+    }
+
+    Literal.prototype.makeReturn = function() {
+      if (this.isStatement()) {
+        return this;
+      } else {
+        return Literal.__super__.makeReturn.apply(this, arguments);
+      }
+    };
+
+    Literal.prototype.isAssignable = function() {
+      return IDENTIFIER.test(this.value);
+    };
+
+    Literal.prototype.isStatement = function() {
+      var _ref2;
+
+      return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger';
+    };
+
+    Literal.prototype.isComplex = NO;
+
+    Literal.prototype.assigns = function(name) {
+      return name === this.value;
+    };
+
+    Literal.prototype.jumps = function(o) {
+      if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) {
+        return this;
+      }
+      if (this.value === 'continue' && !(o != null ? o.loop : void 0)) {
+        return this;
+      }
+    };
+
+    Literal.prototype.compileNode = function(o) {
+      var answer, code, _ref2;
+
+      code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value;
+      answer = this.isStatement() ? "" + this.tab + code + ";" : code;
+      return [this.makeCode(answer)];
+    };
+
+    Literal.prototype.toString = function() {
+      return ' "' + this.value + '"';
+    };
+
+    return Literal;
+
+  })(Base);
+
+  exports.Undefined = (function(_super) {
+    __extends(Undefined, _super);
+
+    function Undefined() {
+      _ref2 = Undefined.__super__.constructor.apply(this, arguments);
+      return _ref2;
+    }
+
+    Undefined.prototype.isAssignable = NO;
+
+    Undefined.prototype.isComplex = NO;
+
+    Undefined.prototype.compileNode = function(o) {
+      return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')];
+    };
+
+    return Undefined;
+
+  })(Base);
+
+  exports.Null = (function(_super) {
+    __extends(Null, _super);
+
+    function Null() {
+      _ref3 = Null.__super__.constructor.apply(this, arguments);
+      return _ref3;
+    }
+
+    Null.prototype.isAssignable = NO;
+
+    Null.prototype.isComplex = NO;
+
+    Null.prototype.compileNode = function() {
+      return [this.makeCode("null")];
+    };
+
+    return Null;
+
+  })(Base);
+
+  exports.Bool = (function(_super) {
+    __extends(Bool, _super);
+
+    Bool.prototype.isAssignable = NO;
+
+    Bool.prototype.isComplex = NO;
+
+    Bool.prototype.compileNode = function() {
+      return [this.makeCode(this.val)];
+    };
+
+    function Bool(val) {
+      this.val = val;
+    }
+
+    return Bool;
+
+  })(Base);
+
+  exports.Return = Return = (function(_super) {
+    __extends(Return, _super);
+
+    function Return(expr) {
+      if (expr && !expr.unwrap().isUndefined) {
+        this.expression = expr;
+      }
+    }
+
+    Return.prototype.children = ['expression'];
+
+    Return.prototype.isStatement = YES;
+
+    Return.prototype.makeReturn = THIS;
+
+    Return.prototype.jumps = THIS;
+
+    Return.prototype.compileToFragments = function(o, level) {
+      var expr, _ref4;
+
+      expr = (_ref4 = this.expression) != null ? _ref4.makeReturn() : void 0;
+      if (expr && !(expr instanceof Return)) {
+        return expr.compileToFragments(o, level);
+      } else {
+        return Return.__super__.compileToFragments.call(this, o, level);
+      }
+    };
+
+    Return.prototype.compileNode = function(o) {
+      var answer;
+
+      answer = [];
+      answer.push(this.makeCode(this.tab + ("return" + [this.expression ? " " : void 0])));
+      if (this.expression) {
+        answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN));
+      }
+      answer.push(this.makeCode(";"));
+      return answer;
+    };
+
+    return Return;
+
+  })(Base);
+
+  exports.Value = Value = (function(_super) {
+    __extends(Value, _super);
+
+    function Value(base, props, tag) {
+      if (!props && base instanceof Value) {
+        return base;
+      }
+      this.base = base;
+      this.properties = props || [];
+      if (tag) {
+        this[tag] = true;
+      }
+      return this;
+    }
+
+    Value.prototype.children = ['base', 'properties'];
+
+    Value.prototype.add = function(props) {
+      this.properties = this.properties.concat(props);
+      return this;
+    };
+
+    Value.prototype.hasProperties = function() {
+      return !!this.properties.length;
+    };
+
+    Value.prototype.isArray = function() {
+      return !this.properties.length && this.base instanceof Arr;
+    };
+
+    Value.prototype.isComplex = function() {
+      return this.hasProperties() || this.base.isComplex();
+    };
+
+    Value.prototype.isAssignable = function() {
+      return this.hasProperties() || this.base.isAssignable();
+    };
+
+    Value.prototype.isSimpleNumber = function() {
+      return this.base instanceof Literal && SIMPLENUM.test(this.base.value);
+    };
+
+    Value.prototype.isString = function() {
+      return this.base instanceof Literal && IS_STRING.test(this.base.value);
+    };
+
+    Value.prototype.isAtomic = function() {
+      var node, _i, _len, _ref4;
+
+      _ref4 = this.properties.concat(this.base);
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        node = _ref4[_i];
+        if (node.soak || node instanceof Call) {
+          return false;
+        }
+      }
+      return true;
+    };
+
+    Value.prototype.isStatement = function(o) {
+      return !this.properties.length && this.base.isStatement(o);
+    };
+
+    Value.prototype.assigns = function(name) {
+      return !this.properties.length && this.base.assigns(name);
+    };
+
+    Value.prototype.jumps = function(o) {
+      return !this.properties.length && this.base.jumps(o);
+    };
+
+    Value.prototype.isObject = function(onlyGenerated) {
+      if (this.properties.length) {
+        return false;
+      }
+      return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated);
+    };
+
+    Value.prototype.isSplice = function() {
+      return last(this.properties) instanceof Slice;
+    };
+
+    Value.prototype.unwrap = function() {
+      if (this.properties.length) {
+        return this;
+      } else {
+        return this.base;
+      }
+    };
+
+    Value.prototype.cacheReference = function(o) {
+      var base, bref, name, nref;
+
+      name = last(this.properties);
+      if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) {
+        return [this, this];
+      }
+      base = new Value(this.base, this.properties.slice(0, -1));
+      if (base.isComplex()) {
+        bref = new Literal(o.scope.freeVariable('base'));
+        base = new Value(new Parens(new Assign(bref, base)));
+      }
+      if (!name) {
+        return [base, bref];
+      }
+      if (name.isComplex()) {
+        nref = new Literal(o.scope.freeVariable('name'));
+        name = new Index(new Assign(nref, name.index));
+        nref = new Index(nref);
+      }
+      return [base.add(name), new Value(bref || base.base, [nref || name])];
+    };
+
+    Value.prototype.compileNode = function(o) {
+      var fragments, prop, props, _i, _len;
+
+      this.base.front = this.front;
+      props = this.properties;
+      fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null));
+      if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) {
+        fragments.push(this.makeCode('.'));
+      }
+      for (_i = 0, _len = props.length; _i < _len; _i++) {
+        prop = props[_i];
+        fragments.push.apply(fragments, prop.compileToFragments(o));
+      }
+      return fragments;
+    };
+
+    Value.prototype.unfoldSoak = function(o) {
+      var _ref4,
+        _this = this;
+
+      return (_ref4 = this.unfoldedSoak) != null ? _ref4 : this.unfoldedSoak = (function() {
+        var fst, i, ifn, prop, ref, snd, _i, _len, _ref5, _ref6;
+
+        if (ifn = _this.base.unfoldSoak(o)) {
+          (_ref5 = ifn.body.properties).push.apply(_ref5, _this.properties);
+          return ifn;
+        }
+        _ref6 = _this.properties;
+        for (i = _i = 0, _len = _ref6.length; _i < _len; i = ++_i) {
+          prop = _ref6[i];
+          if (!prop.soak) {
+            continue;
+          }
+          prop.soak = false;
+          fst = new Value(_this.base, _this.properties.slice(0, i));
+          snd = new Value(_this.base, _this.properties.slice(i));
+          if (fst.isComplex()) {
+            ref = new Literal(o.scope.freeVariable('ref'));
+            fst = new Parens(new Assign(ref, fst));
+            snd.base = ref;
+          }
+          return new If(new Existence(fst), snd, {
+            soak: true
+          });
+        }
+        return false;
+      })();
+    };
+
+    return Value;
+
+  })(Base);
+
+  exports.Comment = Comment = (function(_super) {
+    __extends(Comment, _super);
+
+    function Comment(comment) {
+      this.comment = comment;
+    }
+
+    Comment.prototype.isStatement = YES;
+
+    Comment.prototype.makeReturn = THIS;
+
+    Comment.prototype.compileNode = function(o, level) {
+      var code;
+
+      code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
+      if ((level || o.level) === LEVEL_TOP) {
+        code = o.indent + code;
+      }
+      return [this.makeCode(code)];
+    };
+
+    return Comment;
+
+  })(Base);
+
+  exports.Call = Call = (function(_super) {
+    __extends(Call, _super);
+
+    function Call(variable, args, soak) {
+      this.args = args != null ? args : [];
+      this.soak = soak;
+      this.isNew = false;
+      this.isSuper = variable === 'super';
+      this.variable = this.isSuper ? null : variable;
+    }
+
+    Call.prototype.children = ['variable', 'args'];
+
+    Call.prototype.newInstance = function() {
+      var base, _ref4;
+
+      base = ((_ref4 = this.variable) != null ? _ref4.base : void 0) || this.variable;
+      if (base instanceof Call && !base.isNew) {
+        base.newInstance();
+      } else {
+        this.isNew = true;
+      }
+      return this;
+    };
+
+    Call.prototype.superReference = function(o) {
+      var accesses, method;
+
+      method = o.scope.namedMethod();
+      if (method != null ? method.klass : void 0) {
+        accesses = [new Access(new Literal('__super__'))];
+        if (method["static"]) {
+          accesses.push(new Access(new Literal('constructor')));
+        }
+        accesses.push(new Access(new Literal(method.name)));
+        return (new Value(new Literal(method.klass), accesses)).compile(o);
+      } else if (method != null ? method.ctor : void 0) {
+        return "" + method.name + ".__super__.constructor";
+      } else {
+        return this.error('cannot call super outside of an instance method.');
+      }
+    };
+
+    Call.prototype.superThis = function(o) {
+      var method;
+
+      method = o.scope.method;
+      return (method && !method.klass && method.context) || "this";
+    };
+
+    Call.prototype.unfoldSoak = function(o) {
+      var call, ifn, left, list, rite, _i, _len, _ref4, _ref5;
+
+      if (this.soak) {
+        if (this.variable) {
+          if (ifn = unfoldSoak(o, this, 'variable')) {
+            return ifn;
+          }
+          _ref4 = new Value(this.variable).cacheReference(o), left = _ref4[0], rite = _ref4[1];
+        } else {
+          left = new Literal(this.superReference(o));
+          rite = new Value(left);
+        }
+        rite = new Call(rite, this.args);
+        rite.isNew = this.isNew;
+        left = new Literal("typeof " + (left.compile(o)) + " === \"function\"");
+        return new If(left, new Value(rite), {
+          soak: true
+        });
+      }
+      call = this;
+      list = [];
+      while (true) {
+        if (call.variable instanceof Call) {
+          list.push(call);
+          call = call.variable;
+          continue;
+        }
+        if (!(call.variable instanceof Value)) {
+          break;
+        }
+        list.push(call);
+        if (!((call = call.variable.base) instanceof Call)) {
+          break;
+        }
+      }
+      _ref5 = list.reverse();
+      for (_i = 0, _len = _ref5.length; _i < _len; _i++) {
+        call = _ref5[_i];
+        if (ifn) {
+          if (call.variable instanceof Call) {
+            call.variable = ifn;
+          } else {
+            call.variable.base = ifn;
+          }
+        }
+        ifn = unfoldSoak(o, call, 'variable');
+      }
+      return ifn;
+    };
+
+    Call.prototype.compileNode = function(o) {
+      var arg, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref4, _ref5;
+
+      if ((_ref4 = this.variable) != null) {
+        _ref4.front = this.front;
+      }
+      compiledArray = Splat.compileSplattedArray(o, this.args, true);
+      if (compiledArray.length) {
+        return this.compileSplat(o, compiledArray);
+      }
+      compiledArgs = [];
+      _ref5 = this.args;
+      for (argIndex = _i = 0, _len = _ref5.length; _i < _len; argIndex = ++_i) {
+        arg = _ref5[argIndex];
+        if (argIndex) {
+          compiledArgs.push(this.makeCode(", "));
+        }
+        compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST));
+      }
+      fragments = [];
+      if (this.isSuper) {
+        preface = this.superReference(o) + (".call(" + (this.superThis(o)));
+        if (compiledArgs.length) {
+          preface += ", ";
+        }
+        fragments.push(this.makeCode(preface));
+      } else {
+        if (this.isNew) {
+          fragments.push(this.makeCode('new '));
+        }
+        fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS));
+        fragments.push(this.makeCode("("));
+      }
+      fragments.push.apply(fragments, compiledArgs);
+      fragments.push(this.makeCode(")"));
+      return fragments;
+    };
+
+    Call.prototype.compileSplat = function(o, splatArgs) {
+      var answer, base, fun, idt, name, ref;
+
+      if (this.isSuper) {
+        return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")"));
+      }
+      if (this.isNew) {
+        idt = this.tab + TAB;
+        return [].concat(this.makeCode("(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})("), this.variable.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})"));
+      }
+      answer = [];
+      base = new Value(this.variable);
+      if ((name = base.properties.pop()) && base.isComplex()) {
+        ref = o.scope.freeVariable('ref');
+        answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o));
+      } else {
+        fun = base.compileToFragments(o, LEVEL_ACCESS);
+        if (SIMPLENUM.test(fragmentsToText(fun))) {
+          fun = this.wrapInBraces(fun);
+        }
+        if (name) {
+          ref = fragmentsToText(fun);
+          fun.push.apply(fun, name.compileToFragments(o));
+        } else {
+          ref = 'null';
+        }
+        answer = answer.concat(fun);
+      }
+      return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")"));
+    };
+
+    return Call;
+
+  })(Base);
+
+  exports.Extends = Extends = (function(_super) {
+    __extends(Extends, _super);
+
+    function Extends(child, parent) {
+      this.child = child;
+      this.parent = parent;
+    }
+
+    Extends.prototype.children = ['child', 'parent'];
+
+    Extends.prototype.compileToFragments = function(o) {
+      return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o);
+    };
+
+    return Extends;
+
+  })(Base);
+
+  exports.Access = Access = (function(_super) {
+    __extends(Access, _super);
+
+    function Access(name, tag) {
+      this.name = name;
+      this.name.asKey = true;
+      this.soak = tag === 'soak';
+    }
+
+    Access.prototype.children = ['name'];
+
+    Access.prototype.compileToFragments = function(o) {
+      var name;
+
+      name = this.name.compileToFragments(o);
+      if (IDENTIFIER.test(fragmentsToText(name))) {
+        name.unshift(this.makeCode("."));
+      } else {
+        name.unshift(this.makeCode("["));
+        name.push(this.makeCode("]"));
+      }
+      return name;
+    };
+
+    Access.prototype.isComplex = NO;
+
+    return Access;
+
+  })(Base);
+
+  exports.Index = Index = (function(_super) {
+    __extends(Index, _super);
+
+    function Index(index) {
+      this.index = index;
+    }
+
+    Index.prototype.children = ['index'];
+
+    Index.prototype.compileToFragments = function(o) {
+      return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]"));
+    };
+
+    Index.prototype.isComplex = function() {
+      return this.index.isComplex();
+    };
+
+    return Index;
+
+  })(Base);
+
+  exports.Range = Range = (function(_super) {
+    __extends(Range, _super);
+
+    Range.prototype.children = ['from', 'to'];
+
+    function Range(from, to, tag) {
+      this.from = from;
+      this.to = to;
+      this.exclusive = tag === 'exclusive';
+      this.equals = this.exclusive ? '' : '=';
+    }
+
+    Range.prototype.compileVariables = function(o) {
+      var step, _ref4, _ref5, _ref6, _ref7;
+
+      o = merge(o, {
+        top: true
+      });
+      _ref4 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref4[0], this.fromVar = _ref4[1];
+      _ref5 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref5[0], this.toVar = _ref5[1];
+      if (step = del(o, 'step')) {
+        _ref6 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref6[0], this.stepVar = _ref6[1];
+      }
+      _ref7 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref7[0], this.toNum = _ref7[1];
+      if (this.stepVar) {
+        return this.stepNum = this.stepVar.match(SIMPLENUM);
+      }
+    };
+
+    Range.prototype.compileNode = function(o) {
+      var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref4, _ref5;
+
+      if (!this.fromVar) {
+        this.compileVariables(o);
+      }
+      if (!o.index) {
+        return this.compileArray(o);
+      }
+      known = this.fromNum && this.toNum;
+      idx = del(o, 'index');
+      idxName = del(o, 'name');
+      namedIndex = idxName && idxName !== idx;
+      varPart = "" + idx + " = " + this.fromC;
+      if (this.toC !== this.toVar) {
+        varPart += ", " + this.toC;
+      }
+      if (this.step !== this.stepVar) {
+        varPart += ", " + this.step;
+      }
+      _ref4 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref4[0], gt = _ref4[1];
+      condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref5 = [+this.fromNum, +this.toNum], from = _ref5[0], to = _ref5[1], _ref5), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
+      stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--";
+      if (namedIndex) {
+        varPart = "" + idxName + " = " + varPart;
+      }
+      if (namedIndex) {
+        stepPart = "" + idxName + " = " + stepPart;
+      }
+      return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)];
+    };
+
+    Range.prototype.compileArray = function(o) {
+      var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref4, _ref5, _results;
+
+      if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) {
+        range = (function() {
+          _results = [];
+          for (var _i = _ref4 = +this.fromNum, _ref5 = +this.toNum; _ref4 <= _ref5 ? _i <= _ref5 : _i >= _ref5; _ref4 <= _ref5 ? _i++ : _i--){ _results.push(_i); }
+          return _results;
+        }).apply(this);
+        if (this.exclusive) {
+          range.pop();
+        }
+        return [this.makeCode("[" + (range.join(', ')) + "]")];
+      }
+      idt = this.tab + TAB;
+      i = o.scope.freeVariable('i');
+      result = o.scope.freeVariable('results');
+      pre = "\n" + idt + result + " = [];";
+      if (this.fromNum && this.toNum) {
+        o.index = i;
+        body = fragmentsToText(this.compileNode(o));
+      } else {
+        vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : '');
+        cond = "" + this.fromVar + " <= " + this.toVar;
+        body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--";
+      }
+      post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent;
+      hasArgs = function(node) {
+        return node != null ? node.contains(function(n) {
+          return n instanceof Literal && n.value === 'arguments' && !n.asKey;
+        }) : void 0;
+      };
+      if (hasArgs(this.from) || hasArgs(this.to)) {
+        args = ', arguments';
+      }
+      return [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")];
+    };
+
+    return Range;
+
+  })(Base);
+
+  exports.Slice = Slice = (function(_super) {
+    __extends(Slice, _super);
+
+    Slice.prototype.children = ['range'];
+
+    function Slice(range) {
+      this.range = range;
+      Slice.__super__.constructor.call(this);
+    }
+
+    Slice.prototype.compileNode = function(o) {
+      var compiled, compiledText, from, fromCompiled, to, toStr, _ref4;
+
+      _ref4 = this.range, to = _ref4.to, from = _ref4.from;
+      fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')];
+      if (to) {
+        compiled = to.compileToFragments(o, LEVEL_PAREN);
+        compiledText = fragmentsToText(compiled);
+        if (!(!this.range.exclusive && +compiledText === -1)) {
+          toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9"));
+        }
+      }
+      return [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")];
+    };
+
+    return Slice;
+
+  })(Base);
+
+  exports.Obj = Obj = (function(_super) {
+    __extends(Obj, _super);
+
+    function Obj(props, generated) {
+      this.generated = generated != null ? generated : false;
+      this.objects = this.properties = props || [];
+    }
+
+    Obj.prototype.children = ['properties'];
+
+    Obj.prototype.compileNode = function(o) {
+      var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1;
+
+      props = this.properties;
+      if (!props.length) {
+        return [this.makeCode(this.front ? '({})' : '{}')];
+      }
+      if (this.generated) {
+        for (_i = 0, _len = props.length; _i < _len; _i++) {
+          node = props[_i];
+          if (node instanceof Value) {
+            node.error('cannot have an implicit value in an implicit object');
+          }
+        }
+      }
+      idt = o.indent += TAB;
+      lastNoncom = this.lastNonComment(this.properties);
+      answer = [];
+      for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) {
+        prop = props[i];
+        join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
+        indent = prop instanceof Comment ? '' : idt;
+        if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) {
+          throw new SyntaxError('Invalid object key');
+        }
+        if (prop instanceof Value && prop["this"]) {
+          prop = new Assign(prop.properties[0].name, prop, 'object');
+        }
+        if (!(prop instanceof Comment)) {
+          if (!(prop instanceof Assign)) {
+            prop = new Assign(prop, prop, 'object');
+          }
+          (prop.variable.base || prop.variable).asKey = true;
+        }
+        if (indent) {
+          answer.push(this.makeCode(indent));
+        }
+        answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP));
+        if (join) {
+          answer.push(this.makeCode(join));
+        }
+      }
+      answer.unshift(this.makeCode("{" + (props.length && '\n')));
+      answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}"));
+      if (this.front) {
+        return this.wrapInBraces(answer);
+      } else {
+        return answer;
+      }
+    };
+
+    Obj.prototype.assigns = function(name) {
+      var prop, _i, _len, _ref4;
+
+      _ref4 = this.properties;
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        prop = _ref4[_i];
+        if (prop.assigns(name)) {
+          return true;
+        }
+      }
+      return false;
+    };
+
+    return Obj;
+
+  })(Base);
+
+  exports.Arr = Arr = (function(_super) {
+    __extends(Arr, _super);
+
+    function Arr(objs) {
+      this.objects = objs || [];
+    }
+
+    Arr.prototype.children = ['objects'];
+
+    Arr.prototype.compileNode = function(o) {
+      var answer, compiledObjs, fragments, index, obj, _i, _len;
+
+      if (!this.objects.length) {
+        return [this.makeCode('[]')];
+      }
+      o.indent += TAB;
+      answer = Splat.compileSplattedArray(o, this.objects);
+      if (answer.length) {
+        return answer;
+      }
+      answer = [];
+      compiledObjs = (function() {
+        var _i, _len, _ref4, _results;
+
+        _ref4 = this.objects;
+        _results = [];
+        for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+          obj = _ref4[_i];
+          _results.push(obj.compileToFragments(o, LEVEL_LIST));
+        }
+        return _results;
+      }).call(this);
+      for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) {
+        fragments = compiledObjs[index];
+        if (index) {
+          answer.push(this.makeCode(", "));
+        }
+        answer.push.apply(answer, fragments);
+      }
+      if ((fragmentsToText(answer)).indexOf('\n') >= 0) {
+        answer.unshift(this.makeCode("[\n" + o.indent));
+        answer.push(this.makeCode("\n" + this.tab + "]"));
+      } else {
+        answer.unshift(this.makeCode("["));
+        answer.push(this.makeCode("]"));
+      }
+      return answer;
+    };
+
+    Arr.prototype.assigns = function(name) {
+      var obj, _i, _len, _ref4;
+
+      _ref4 = this.objects;
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        obj = _ref4[_i];
+        if (obj.assigns(name)) {
+          return true;
+        }
+      }
+      return false;
+    };
+
+    return Arr;
+
+  })(Base);
+
+  exports.Class = Class = (function(_super) {
+    __extends(Class, _super);
+
+    function Class(variable, parent, body) {
+      this.variable = variable;
+      this.parent = parent;
+      this.body = body != null ? body : new Block;
+      this.boundFuncs = [];
+      this.body.classBody = true;
+    }
+
+    Class.prototype.children = ['variable', 'parent', 'body'];
+
+    Class.prototype.determineName = function() {
+      var decl, tail;
+
+      if (!this.variable) {
+        return null;
+      }
+      decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value;
+      if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) {
+        this.variable.error("class variable name may not be " + decl);
+      }
+      return decl && (decl = IDENTIFIER.test(decl) && decl);
+    };
+
+    Class.prototype.setContext = function(name) {
+      return this.body.traverseChildren(false, function(node) {
+        if (node.classBody) {
+          return false;
+        }
+        if (node instanceof Literal && node.value === 'this') {
+          return node.value = name;
+        } else if (node instanceof Code) {
+          node.klass = name;
+          if (node.bound) {
+            return node.context = name;
+          }
+        }
+      });
+    };
+
+    Class.prototype.addBoundFunctions = function(o) {
+      var bvar, lhs, _i, _len, _ref4;
+
+      _ref4 = this.boundFuncs;
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        bvar = _ref4[_i];
+        lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
+        this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)"));
+      }
+    };
+
+    Class.prototype.addProperties = function(node, name, o) {
+      var assign, base, exprs, func, props;
+
+      props = node.base.properties.slice(0);
+      exprs = (function() {
+        var _results;
+
+        _results = [];
+        while (assign = props.shift()) {
+          if (assign instanceof Assign) {
+            base = assign.variable.base;
+            delete assign.context;
+            func = assign.value;
+            if (base.value === 'constructor') {
+              if (this.ctor) {
+                assign.error('cannot define more than one constructor in a class');
+              }
+              if (func.bound) {
+                assign.error('cannot define a constructor as a bound function');
+              }
+              if (func instanceof Code) {
+                assign = this.ctor = func;
+              } else {
+                this.externalCtor = o.scope.freeVariable('class');
+                assign = new Assign(new Literal(this.externalCtor), func);
+              }
+            } else {
+              if (assign.variable["this"]) {
+                func["static"] = true;
+                if (func.bound) {
+                  func.context = name;
+                }
+              } else {
+                assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]);
+                if (func instanceof Code && func.bound) {
+                  this.boundFuncs.push(base);
+                  func.bound = false;
+                }
+              }
+            }
+          }
+          _results.push(assign);
+        }
+        return _results;
+      }).call(this);
+      return compact(exprs);
+    };
+
+    Class.prototype.walkBody = function(name, o) {
+      var _this = this;
+
+      return this.traverseChildren(false, function(child) {
+        var cont, exps, i, node, _i, _len, _ref4;
+
+        cont = true;
+        if (child instanceof Class) {
+          return false;
+        }
+        if (child instanceof Block) {
+          _ref4 = exps = child.expressions;
+          for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) {
+            node = _ref4[i];
+            if (node instanceof Value && node.isObject(true)) {
+              cont = false;
+              exps[i] = _this.addProperties(node, name, o);
+            }
+          }
+          child.expressions = exps = flatten(exps);
+        }
+        return cont && !(child instanceof Class);
+      });
+    };
+
+    Class.prototype.hoistDirectivePrologue = function() {
+      var expressions, index, node;
+
+      index = 0;
+      expressions = this.body.expressions;
+      while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) {
+        ++index;
+      }
+      return this.directives = expressions.splice(0, index);
+    };
+
+    Class.prototype.ensureConstructor = function(name, o) {
+      var missing, ref, superCall;
+
+      missing = !this.ctor;
+      this.ctor || (this.ctor = new Code);
+      this.ctor.ctor = this.ctor.name = name;
+      this.ctor.klass = null;
+      this.ctor.noReturn = true;
+      if (missing) {
+        if (this.parent) {
+          superCall = new Literal("" + name + ".__super__.constructor.apply(this, arguments)");
+        }
+        if (this.externalCtor) {
+          superCall = new Literal("" + this.externalCtor + ".apply(this, arguments)");
+        }
+        if (superCall) {
+          ref = new Literal(o.scope.freeVariable('ref'));
+          this.ctor.body.unshift(new Assign(ref, superCall));
+        }
+        this.addBoundFunctions(o);
+        if (superCall) {
+          this.ctor.body.push(ref);
+          this.ctor.body.makeReturn();
+        }
+        return this.body.expressions.unshift(this.ctor);
+      } else {
+        return this.addBoundFunctions(o);
+      }
+    };
+
+    Class.prototype.compileNode = function(o) {
+      var call, decl, klass, lname, name, params, _ref4;
+
+      decl = this.determineName();
+      name = decl || '_Class';
+      if (name.reserved) {
+        name = "_" + name;
+      }
+      lname = new Literal(name);
+      this.hoistDirectivePrologue();
+      this.setContext(name);
+      this.walkBody(name, o);
+      this.ensureConstructor(name, o);
+      this.body.spaced = true;
+      if (!(this.ctor instanceof Code)) {
+        this.body.expressions.unshift(this.ctor);
+      }
+      this.body.expressions.push(lname);
+      (_ref4 = this.body.expressions).unshift.apply(_ref4, this.directives);
+      call = Closure.wrap(this.body);
+      if (this.parent) {
+        this.superClass = new Literal(o.scope.freeVariable('super', false));
+        this.body.expressions.unshift(new Extends(lname, this.superClass));
+        call.args.push(this.parent);
+        params = call.variable.params || call.variable.base.params;
+        params.push(new Param(this.superClass));
+      }
+      klass = new Parens(call, true);
+      if (this.variable) {
+        klass = new Assign(this.variable, klass);
+      }
+      return klass.compileToFragments(o);
+    };
+
+    return Class;
+
+  })(Base);
+
+  exports.Assign = Assign = (function(_super) {
+    __extends(Assign, _super);
+
+    function Assign(variable, value, context, options) {
+      var forbidden, name, _ref4;
+
+      this.variable = variable;
+      this.value = value;
+      this.context = context;
+      this.param = options && options.param;
+      this.subpattern = options && options.subpattern;
+      forbidden = (_ref4 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref4) >= 0);
+      if (forbidden && this.context !== 'object') {
+        this.variable.error("variable name may not be \"" + name + "\"");
+      }
+    }
+
+    Assign.prototype.children = ['variable', 'value'];
+
+    Assign.prototype.isStatement = function(o) {
+      return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0;
+    };
+
+    Assign.prototype.assigns = function(name) {
+      return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
+    };
+
+    Assign.prototype.unfoldSoak = function(o) {
+      return unfoldSoak(o, this, 'variable');
+    };
+
+    Assign.prototype.compileNode = function(o) {
+      var answer, compiledName, isValue, match, name, val, varBase, _ref4, _ref5, _ref6, _ref7;
+
+      if (isValue = this.variable instanceof Value) {
+        if (this.variable.isArray() || this.variable.isObject()) {
+          return this.compilePatternMatch(o);
+        }
+        if (this.variable.isSplice()) {
+          return this.compileSplice(o);
+        }
+        if ((_ref4 = this.context) === '||=' || _ref4 === '&&=' || _ref4 === '?=') {
+          return this.compileConditional(o);
+        }
+      }
+      compiledName = this.variable.compileToFragments(o, LEVEL_LIST);
+      name = fragmentsToText(compiledName);
+      if (!this.context) {
+        varBase = this.variable.unwrapAll();
+        if (!varBase.isAssignable()) {
+          this.variable.error("\"" + (this.variable.compile(o)) + "\" cannot be assigned");
+        }
+        if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) {
+          if (this.param) {
+            o.scope.add(name, 'var');
+          } else {
+            o.scope.find(name);
+          }
+        }
+      }
+      if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) {
+        if (match[1]) {
+          this.value.klass = match[1];
+        }
+        this.value.name = (_ref5 = (_ref6 = (_ref7 = match[2]) != null ? _ref7 : match[3]) != null ? _ref6 : match[4]) != null ? _ref5 : match[5];
+      }
+      val = this.value.compileToFragments(o, LEVEL_LIST);
+      if (this.context === 'object') {
+        return compiledName.concat(this.makeCode(": "), val);
+      }
+      answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val);
+      if (o.level <= LEVEL_LIST) {
+        return answer;
+      } else {
+        return this.wrapInBraces(answer);
+      }
+    };
+
+    Assign.prototype.compilePatternMatch = function(o) {
+      var acc, assigns, code, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, vvarText, _i, _len, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
+
+      top = o.level === LEVEL_TOP;
+      value = this.value;
+      objects = this.variable.base.objects;
+      if (!(olen = objects.length)) {
+        code = value.compileToFragments(o);
+        if (o.level >= LEVEL_OP) {
+          return this.wrapInBraces(code);
+        } else {
+          return code;
+        }
+      }
+      isObject = this.variable.isObject();
+      if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) {
+        if (obj instanceof Assign) {
+          _ref4 = obj, (_ref5 = _ref4.variable, idx = _ref5.base), obj = _ref4.value;
+        } else {
+          idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
+        }
+        acc = IDENTIFIER.test(idx.unwrap().value || 0);
+        value = new Value(value);
+        value.properties.push(new (acc ? Access : Index)(idx));
+        if (_ref6 = obj.unwrap().value, __indexOf.call(RESERVED, _ref6) >= 0) {
+          obj.error("assignment to a reserved word: " + (obj.compile(o)));
+        }
+        return new Assign(obj, value, null, {
+          param: this.param
+        }).compileToFragments(o, LEVEL_TOP);
+      }
+      vvar = value.compileToFragments(o, LEVEL_LIST);
+      vvarText = fragmentsToText(vvar);
+      assigns = [];
+      splat = false;
+      if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) {
+        assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar)));
+        vvar = [this.makeCode(ref)];
+        vvarText = ref;
+      }
+      for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) {
+        obj = objects[i];
+        idx = i;
+        if (isObject) {
+          if (obj instanceof Assign) {
+            _ref7 = obj, (_ref8 = _ref7.variable, idx = _ref8.base), obj = _ref7.value;
+          } else {
+            if (obj.base instanceof Parens) {
+              _ref9 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref9[0], idx = _ref9[1];
+            } else {
+              idx = obj["this"] ? obj.properties[0].name : obj;
+            }
+          }
+        }
+        if (!splat && obj instanceof Splat) {
+          name = obj.name.unwrap().value;
+          obj = obj.unwrap();
+          val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i;
+          if (rest = olen - i - 1) {
+            ivar = o.scope.freeVariable('i');
+            val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
+          } else {
+            val += ") : []";
+          }
+          val = new Literal(val);
+          splat = "" + ivar + "++";
+        } else {
+          name = obj.unwrap().value;
+          if (obj instanceof Splat) {
+            obj.error("multiple splats are disallowed in an assignment");
+          }
+          if (typeof idx === 'number') {
+            idx = new Literal(splat || idx);
+            acc = false;
+          } else {
+            acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0);
+          }
+          val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]);
+        }
+        if ((name != null) && __indexOf.call(RESERVED, name) >= 0) {
+          obj.error("assignment to a reserved word: " + (obj.compile(o)));
+        }
+        assigns.push(new Assign(obj, val, null, {
+          param: this.param,
+          subpattern: true
+        }).compileToFragments(o, LEVEL_LIST));
+      }
+      if (!(top || this.subpattern)) {
+        assigns.push(vvar);
+      }
+      fragments = this.joinFragmentArrays(assigns, ', ');
+      if (o.level < LEVEL_LIST) {
+        return fragments;
+      } else {
+        return this.wrapInBraces(fragments);
+      }
+    };
+
+    Assign.prototype.compileConditional = function(o) {
+      var left, right, _ref4;
+
+      _ref4 = this.variable.cacheReference(o), left = _ref4[0], right = _ref4[1];
+      if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) {
+        this.variable.error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been declared before");
+      }
+      if (__indexOf.call(this.context, "?") >= 0) {
+        o.isExistentialEquals = true;
+      }
+      return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o);
+    };
+
+    Assign.prototype.compileSplice = function(o) {
+      var answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref4, _ref5, _ref6;
+
+      _ref4 = this.variable.properties.pop().range, from = _ref4.from, to = _ref4.to, exclusive = _ref4.exclusive;
+      name = this.variable.compile(o);
+      if (from) {
+        _ref5 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref5[0], fromRef = _ref5[1];
+      } else {
+        fromDecl = fromRef = '0';
+      }
+      if (to) {
+        if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) {
+          to = +to.compile(o) - +fromRef;
+          if (!exclusive) {
+            to += 1;
+          }
+        } else {
+          to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef;
+          if (!exclusive) {
+            to += ' + 1';
+          }
+        }
+      } else {
+        to = "9e9";
+      }
+      _ref6 = this.value.cache(o, LEVEL_LIST), valDef = _ref6[0], valRef = _ref6[1];
+      answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef);
+      if (o.level > LEVEL_TOP) {
+        return this.wrapInBraces(answer);
+      } else {
+        return answer;
+      }
+    };
+
+    return Assign;
+
+  })(Base);
+
+  exports.Code = Code = (function(_super) {
+    __extends(Code, _super);
+
+    function Code(params, body, tag) {
+      this.params = params || [];
+      this.body = body || new Block;
+      this.bound = tag === 'boundfunc';
+      if (this.bound) {
+        this.context = '_this';
+      }
+    }
+
+    Code.prototype.children = ['params', 'body'];
+
+    Code.prototype.isStatement = function() {
+      return !!this.ctor;
+    };
+
+    Code.prototype.jumps = NO;
+
+    Code.prototype.compileNode = function(o) {
+      var answer, code, exprs, i, idt, lit, p, param, params, ref, splats, uniqs, val, wasEmpty, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref4, _ref5, _ref6, _ref7, _ref8;
+
+      o.scope = new Scope(o.scope, this.body, this);
+      o.scope.shared = del(o, 'sharedScope');
+      o.indent += TAB;
+      delete o.bare;
+      delete o.isExistentialEquals;
+      params = [];
+      exprs = [];
+      this.eachParamName(function(name) {
+        if (!o.scope.check(name)) {
+          return o.scope.parameter(name);
+        }
+      });
+      _ref4 = this.params;
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        param = _ref4[_i];
+        if (!param.splat) {
+          continue;
+        }
+        _ref5 = this.params;
+        for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) {
+          p = _ref5[_j].name;
+          if (p["this"]) {
+            p = p.properties[0].name;
+          }
+          if (p.value) {
+            o.scope.add(p.value, 'var', true);
+          }
+        }
+        splats = new Assign(new Value(new Arr((function() {
+          var _k, _len2, _ref6, _results;
+
+          _ref6 = this.params;
+          _results = [];
+          for (_k = 0, _len2 = _ref6.length; _k < _len2; _k++) {
+            p = _ref6[_k];
+            _results.push(p.asReference(o));
+          }
+          return _results;
+        }).call(this))), new Value(new Literal('arguments')));
+        break;
+      }
+      _ref6 = this.params;
+      for (_k = 0, _len2 = _ref6.length; _k < _len2; _k++) {
+        param = _ref6[_k];
+        if (param.isComplex()) {
+          val = ref = param.asReference(o);
+          if (param.value) {
+            val = new Op('?', ref, param.value);
+          }
+          exprs.push(new Assign(new Value(param.name), val, '=', {
+            param: true
+          }));
+        } else {
+          ref = param;
+          if (param.value) {
+            lit = new Literal(ref.name.value + ' == null');
+            val = new Assign(new Value(param.name), param.value, '=');
+            exprs.push(new If(lit, val));
+          }
+        }
+        if (!splats) {
+          params.push(ref);
+        }
+      }
+      wasEmpty = this.body.isEmpty();
+      if (splats) {
+        exprs.unshift(splats);
+      }
+      if (exprs.length) {
+        (_ref7 = this.body.expressions).unshift.apply(_ref7, exprs);
+      }
+      for (i = _l = 0, _len3 = params.length; _l < _len3; i = ++_l) {
+        p = params[i];
+        params[i] = p.compileToFragments(o);
+        o.scope.parameter(fragmentsToText(params[i]));
+      }
+      uniqs = [];
+      this.eachParamName(function(name, node) {
+        if (__indexOf.call(uniqs, name) >= 0) {
+          node.error("multiple parameters named '" + name + "'");
+        }
+        return uniqs.push(name);
+      });
+      if (!(wasEmpty || this.noReturn)) {
+        this.body.makeReturn();
+      }
+      if (this.bound) {
+        if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) {
+          this.bound = this.context = o.scope.parent.method.context;
+        } else if (!this["static"]) {
+          o.scope.parent.assign('_this', 'this');
+        }
+      }
+      idt = o.indent;
+      code = 'function';
+      if (this.ctor) {
+        code += ' ' + this.name;
+      }
+      code += '(';
+      answer = [this.makeCode(code)];
+      for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) {
+        p = params[i];
+        if (i) {
+          answer.push(this.makeCode(", "));
+        }
+        answer.push.apply(answer, p);
+      }
+      answer.push(this.makeCode(') {'));
+      if (!this.body.isEmpty()) {
+        answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab));
+      }
+      answer.push(this.makeCode('}'));
+      if (this.ctor) {
+        return [this.makeCode(this.tab)].concat(__slice.call(answer));
+      }
+      if (this.front || (o.level >= LEVEL_ACCESS)) {
+        return this.wrapInBraces(answer);
+      } else {
+        return answer;
+      }
+    };
+
+    Code.prototype.eachParamName = function(iterator) {
+      var param, _i, _len, _ref4, _results;
+
+      _ref4 = this.params;
+      _results = [];
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        param = _ref4[_i];
+        _results.push(param.eachName(iterator));
+      }
+      return _results;
+    };
+
+    Code.prototype.traverseChildren = function(crossScope, func) {
+      if (crossScope) {
+        return Code.__super__.traverseChildren.call(this, crossScope, func);
+      }
+    };
+
+    return Code;
+
+  })(Base);
+
+  exports.Param = Param = (function(_super) {
+    __extends(Param, _super);
+
+    function Param(name, value, splat) {
+      var _ref4;
+
+      this.name = name;
+      this.value = value;
+      this.splat = splat;
+      if (_ref4 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref4) >= 0) {
+        this.name.error("parameter name \"" + name + "\" is not allowed");
+      }
+    }
+
+    Param.prototype.children = ['name', 'value'];
+
+    Param.prototype.compileToFragments = function(o) {
+      return this.name.compileToFragments(o, LEVEL_LIST);
+    };
+
+    Param.prototype.asReference = function(o) {
+      var node;
+
+      if (this.reference) {
+        return this.reference;
+      }
+      node = this.name;
+      if (node["this"]) {
+        node = node.properties[0].name;
+        if (node.value.reserved) {
+          node = new Literal(o.scope.freeVariable(node.value));
+        }
+      } else if (node.isComplex()) {
+        node = new Literal(o.scope.freeVariable('arg'));
+      }
+      node = new Value(node);
+      if (this.splat) {
+        node = new Splat(node);
+      }
+      return this.reference = node;
+    };
+
+    Param.prototype.isComplex = function() {
+      return this.name.isComplex();
+    };
+
+    Param.prototype.eachName = function(iterator, name) {
+      var atParam, node, obj, _i, _len, _ref4;
+
+      if (name == null) {
+        name = this.name;
+      }
+      atParam = function(obj) {
+        var node;
+
+        node = obj.properties[0].name;
+        if (!node.value.reserved) {
+          return iterator(node.value, node);
+        }
+      };
+      if (name instanceof Literal) {
+        return iterator(name.value, name);
+      }
+      if (name instanceof Value) {
+        return atParam(name);
+      }
+      _ref4 = name.objects;
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        obj = _ref4[_i];
+        if (obj instanceof Assign) {
+          this.eachName(iterator, obj.value.unwrap());
+        } else if (obj instanceof Splat) {
+          node = obj.name.unwrap();
+          iterator(node.value, node);
+        } else if (obj instanceof Value) {
+          if (obj.isArray() || obj.isObject()) {
+            this.eachName(iterator, obj.base);
+          } else if (obj["this"]) {
+            atParam(obj);
+          } else {
+            iterator(obj.base.value, obj.base);
+          }
+        } else {
+          obj.error("illegal parameter " + (obj.compile()));
+        }
+      }
+    };
+
+    return Param;
+
+  })(Base);
+
+  exports.Splat = Splat = (function(_super) {
+    __extends(Splat, _super);
+
+    Splat.prototype.children = ['name'];
+
+    Splat.prototype.isAssignable = YES;
+
+    function Splat(name) {
+      this.name = name.compile ? name : new Literal(name);
+    }
+
+    Splat.prototype.assigns = function(name) {
+      return this.name.assigns(name);
+    };
+
+    Splat.prototype.compileToFragments = function(o) {
+      return this.name.compileToFragments(o);
+    };
+
+    Splat.prototype.unwrap = function() {
+      return this.name;
+    };
+
+    Splat.compileSplattedArray = function(o, list, apply) {
+      var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len;
+
+      index = -1;
+      while ((node = list[++index]) && !(node instanceof Splat)) {
+        continue;
+      }
+      if (index >= list.length) {
+        return [];
+      }
+      if (list.length === 1) {
+        node = list[0];
+        fragments = node.compileToFragments(o, LEVEL_LIST);
+        if (apply) {
+          return fragments;
+        }
+        return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")"));
+      }
+      args = list.slice(index);
+      for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
+        node = args[i];
+        compiledNode = node.compileToFragments(o, LEVEL_LIST);
+        args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]"));
+      }
+      if (index === 0) {
+        node = list[0];
+        concatPart = node.joinFragmentArrays(args.slice(1), ', ');
+        return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")"));
+      }
+      base = (function() {
+        var _j, _len1, _ref4, _results;
+
+        _ref4 = list.slice(0, index);
+        _results = [];
+        for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
+          node = _ref4[_j];
+          _results.push(node.compileToFragments(o, LEVEL_LIST));
+        }
+        return _results;
+      })();
+      base = list[0].joinFragmentArrays(base, ', ');
+      concatPart = list[index].joinFragmentArrays(args, ', ');
+      return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")"));
+    };
+
+    return Splat;
+
+  })(Base);
+
+  exports.While = While = (function(_super) {
+    __extends(While, _super);
+
+    function While(condition, options) {
+      this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition;
+      this.guard = options != null ? options.guard : void 0;
+    }
+
+    While.prototype.children = ['condition', 'guard', 'body'];
+
+    While.prototype.isStatement = YES;
+
+    While.prototype.makeReturn = function(res) {
+      if (res) {
+        return While.__super__.makeReturn.apply(this, arguments);
+      } else {
+        this.returns = !this.jumps({
+          loop: true
+        });
+        return this;
+      }
+    };
+
+    While.prototype.addBody = function(body) {
+      this.body = body;
+      return this;
+    };
+
+    While.prototype.jumps = function() {
+      var expressions, node, _i, _len;
+
+      expressions = this.body.expressions;
+      if (!expressions.length) {
+        return false;
+      }
+      for (_i = 0, _len = expressions.length; _i < _len; _i++) {
+        node = expressions[_i];
+        if (node.jumps({
+          loop: true
+        })) {
+          return node;
+        }
+      }
+      return false;
+    };
+
+    While.prototype.compileNode = function(o) {
+      var answer, body, rvar, set;
+
+      o.indent += TAB;
+      set = '';
+      body = this.body;
+      if (body.isEmpty()) {
+        body = '';
+      } else {
+        if (this.returns) {
+          body.makeReturn(rvar = o.scope.freeVariable('results'));
+          set = "" + this.tab + rvar + " = [];\n";
+        }
+        if (this.guard) {
+          if (body.expressions.length > 1) {
+            body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue")));
+          } else {
+            if (this.guard) {
+              body = Block.wrap([new If(this.guard, body)]);
+            }
+          }
+        }
+        body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab));
+      }
+      answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}"));
+      if (this.returns) {
+        answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";"));
+      }
+      return answer;
+    };
+
+    return While;
+
+  })(Base);
+
+  exports.Op = Op = (function(_super) {
+    var CONVERSIONS, INVERSIONS;
+
+    __extends(Op, _super);
+
+    function Op(op, first, second, flip) {
+      if (op === 'in') {
+        return new In(first, second);
+      }
+      if (op === 'do') {
+        return this.generateDo(first);
+      }
+      if (op === 'new') {
+        if (first instanceof Call && !first["do"] && !first.isNew) {
+          return first.newInstance();
+        }
+        if (first instanceof Code && first.bound || first["do"]) {
+          first = new Parens(first);
+        }
+      }
+      this.operator = CONVERSIONS[op] || op;
+      this.first = first;
+      this.second = second;
+      this.flip = !!flip;
+      return this;
+    }
+
+    CONVERSIONS = {
+      '==': '===',
+      '!=': '!==',
+      'of': 'in'
+    };
+
+    INVERSIONS = {
+      '!==': '===',
+      '===': '!=='
+    };
+
+    Op.prototype.children = ['first', 'second'];
+
+    Op.prototype.isSimpleNumber = NO;
+
+    Op.prototype.isUnary = function() {
+      return !this.second;
+    };
+
+    Op.prototype.isComplex = function() {
+      var _ref4;
+
+      return !(this.isUnary() && ((_ref4 = this.operator) === '+' || _ref4 === '-')) || this.first.isComplex();
+    };
+
+    Op.prototype.isChainable = function() {
+      var _ref4;
+
+      return (_ref4 = this.operator) === '<' || _ref4 === '>' || _ref4 === '>=' || _ref4 === '<=' || _ref4 === '===' || _ref4 === '!==';
+    };
+
+    Op.prototype.invert = function() {
+      var allInvertable, curr, fst, op, _ref4;
+
+      if (this.isChainable() && this.first.isChainable()) {
+        allInvertable = true;
+        curr = this;
+        while (curr && curr.operator) {
+          allInvertable && (allInvertable = curr.operator in INVERSIONS);
+          curr = curr.first;
+        }
+        if (!allInvertable) {
+          return new Parens(this).invert();
+        }
+        curr = this;
+        while (curr && curr.operator) {
+          curr.invert = !curr.invert;
+          curr.operator = INVERSIONS[curr.operator];
+          curr = curr.first;
+        }
+        return this;
+      } else if (op = INVERSIONS[this.operator]) {
+        this.operator = op;
+        if (this.first.unwrap() instanceof Op) {
+          this.first.invert();
+        }
+        return this;
+      } else if (this.second) {
+        return new Parens(this).invert();
+      } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref4 = fst.operator) === '!' || _ref4 === 'in' || _ref4 === 'instanceof')) {
+        return fst;
+      } else {
+        return new Op('!', this);
+      }
+    };
+
+    Op.prototype.unfoldSoak = function(o) {
+      var _ref4;
+
+      return ((_ref4 = this.operator) === '++' || _ref4 === '--' || _ref4 === 'delete') && unfoldSoak(o, this, 'first');
+    };
+
+    Op.prototype.generateDo = function(exp) {
+      var call, func, param, passedParams, ref, _i, _len, _ref4;
+
+      passedParams = [];
+      func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp;
+      _ref4 = func.params || [];
+      for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+        param = _ref4[_i];
+        if (param.value) {
+          passedParams.push(param.value);
+          delete param.value;
+        } else {
+          passedParams.push(param);
+        }
+      }
+      call = new Call(exp, passedParams);
+      call["do"] = true;
+      return call;
+    };
+
+    Op.prototype.compileNode = function(o) {
+      var answer, isChain, _ref4, _ref5;
+
+      isChain = this.isChainable() && this.first.isChainable();
+      if (!isChain) {
+        this.first.front = this.front;
+      }
+      if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) {
+        this.error('delete operand may not be argument or var');
+      }
+      if (((_ref4 = this.operator) === '--' || _ref4 === '++') && (_ref5 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref5) >= 0)) {
+        this.error("cannot increment/decrement \"" + (this.first.unwrapAll().value) + "\"");
+      }
+      if (this.isUnary()) {
+        return this.compileUnary(o);
+      }
+      if (isChain) {
+        return this.compileChain(o);
+      }
+      if (this.operator === '?') {
+        return this.compileExistence(o);
+      }
+      answer = [].concat(this.first.compileToFragments(o, LEVEL_OP), this.makeCode(' ' + this.operator + ' '), this.second.compileToFragments(o, LEVEL_OP));
+      if (o.level <= LEVEL_OP) {
+        return answer;
+      } else {
+        return this.wrapInBraces(answer);
+      }
+    };
+
+    Op.prototype.compileChain = function(o) {
+      var fragments, fst, shared, _ref4;
+
+      _ref4 = this.first.second.cache(o), this.first.second = _ref4[0], shared = _ref4[1];
+      fst = this.first.compileToFragments(o, LEVEL_OP);
+      fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP));
+      return this.wrapInBraces(fragments);
+    };
+
+    Op.prototype.compileExistence = function(o) {
+      var fst, ref;
+
+      if (this.first.isComplex()) {
+        ref = new Literal(o.scope.freeVariable('ref'));
+        fst = new Parens(new Assign(ref, this.first));
+      } else {
+        fst = this.first;
+        ref = fst;
+      }
+      return new If(new Existence(fst), ref, {
+        type: 'if'
+      }).addElse(this.second).compileToFragments(o);
+    };
+
+    Op.prototype.compileUnary = function(o) {
+      var op, parts, plusMinus;
+
+      parts = [];
+      op = this.operator;
+      parts.push([this.makeCode(op)]);
+      if (op === '!' && this.first instanceof Existence) {
+        this.first.negated = !this.first.negated;
+        return this.first.compileToFragments(o);
+      }
+      if (o.level >= LEVEL_ACCESS) {
+        return (new Parens(this)).compileToFragments(o);
+      }
+      plusMinus = op === '+' || op === '-';
+      if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
+        parts.push([this.makeCode(' ')]);
+      }
+      if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) {
+        this.first = new Parens(this.first);
+      }
+      parts.push(this.first.compileToFragments(o, LEVEL_OP));
+      if (this.flip) {
+        parts.reverse();
+      }
+      return this.joinFragmentArrays(parts, '');
+    };
+
+    Op.prototype.toString = function(idt) {
+      return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator);
+    };
+
+    return Op;
+
+  })(Base);
+
+  exports.In = In = (function(_super) {
+    __extends(In, _super);
+
+    function In(object, array) {
+      this.object = object;
+      this.array = array;
+    }
+
+    In.prototype.children = ['object', 'array'];
+
+    In.prototype.invert = NEGATE;
+
+    In.prototype.compileNode = function(o) {
+      var hasSplat, obj, _i, _len, _ref4;
+
+      if (this.array instanceof Value && this.array.isArray()) {
+        _ref4 = this.array.base.objects;
+        for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+          obj = _ref4[_i];
+          if (!(obj instanceof Splat)) {
+            continue;
+          }
+          hasSplat = true;
+          break;
+        }
+        if (!hasSplat) {
+          return this.compileOrTest(o);
+        }
+      }
+      return this.compileLoopTest(o);
+    };
+
+    In.prototype.compileOrTest = function(o) {
+      var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref4, _ref5, _ref6;
+
+      if (this.array.base.objects.length === 0) {
+        return [this.makeCode("" + (!!this.negated))];
+      }
+      _ref4 = this.object.cache(o, LEVEL_OP), sub = _ref4[0], ref = _ref4[1];
+      _ref5 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref5[0], cnj = _ref5[1];
+      tests = [];
+      _ref6 = this.array.base.objects;
+      for (i = _i = 0, _len = _ref6.length; _i < _len; i = ++_i) {
+        item = _ref6[i];
+        if (i) {
+          tests.push(this.makeCode(cnj));
+        }
+        tests = tests.concat((i ? ref : sub), this.makeCode(cmp), item.compileToFragments(o, LEVEL_ACCESS));
+      }
+      if (o.level < LEVEL_OP) {
+        return tests;
+      } else {
+        return this.wrapInBraces(tests);
+      }
+    };
+
+    In.prototype.compileLoopTest = function(o) {
+      var fragments, ref, sub, _ref4;
+
+      _ref4 = this.object.cache(o, LEVEL_LIST), sub = _ref4[0], ref = _ref4[1];
+      fragments = [].concat(this.makeCode(utility('indexOf') + ".call("), this.array.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), ref, this.makeCode(") " + (this.negated ? '< 0' : '>= 0')));
+      if ((fragmentsToText(sub)) === (fragmentsToText(ref))) {
+        return fragments;
+      }
+      fragments = sub.concat(this.makeCode(', '), fragments);
+      if (o.level < LEVEL_LIST) {
+        return fragments;
+      } else {
+        return this.wrapInBraces(fragments);
+      }
+    };
+
+    In.prototype.toString = function(idt) {
+      return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : ''));
+    };
+
+    return In;
+
+  })(Base);
+
+  exports.Try = Try = (function(_super) {
+    __extends(Try, _super);
+
+    function Try(attempt, errorVariable, recovery, ensure) {
+      this.attempt = attempt;
+      this.errorVariable = errorVariable;
+      this.recovery = recovery;
+      this.ensure = ensure;
+    }
+
+    Try.prototype.children = ['attempt', 'recovery', 'ensure'];
+
+    Try.prototype.isStatement = YES;
+
+    Try.prototype.jumps = function(o) {
+      var _ref4;
+
+      return this.attempt.jumps(o) || ((_ref4 = this.recovery) != null ? _ref4.jumps(o) : void 0);
+    };
+
+    Try.prototype.makeReturn = function(res) {
+      if (this.attempt) {
+        this.attempt = this.attempt.makeReturn(res);
+      }
+      if (this.recovery) {
+        this.recovery = this.recovery.makeReturn(res);
+      }
+      return this;
+    };
+
+    Try.prototype.compileNode = function(o) {
+      var catchPart, ensurePart, placeholder, tryPart, _ref4;
+
+      o.indent += TAB;
+      tryPart = this.attempt.compileToFragments(o, LEVEL_TOP);
+      catchPart = this.recovery ? (placeholder = new Literal('_error'), this.recovery.unshift(new Assign(this.errorVariable, placeholder)), this.errorVariable = placeholder, (_ref4 = this.errorVariable.value, __indexOf.call(STRICT_PROSCRIBED, _ref4) >= 0) ? this.errorVariable.error("catch variable may not be \"" + this.errorVariable.value + "\"") : void 0, [].concat(this.makeCode(" catch ("), this.errorVariable.compileToFragments(o), this.makeCode(") {\n"), this.recovery.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}"))) : !(this.ensure || this.recovery) ? [this.makeCode(' catch (_error) {}')] : [];
+      ensurePart = this.ensure ? [].concat(this.makeCode(" finally {\n"), this.ensure.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")) : [];
+      return [].concat(this.makeCode("" + this.tab + "try {\n"), tryPart, this.makeCode("\n" + this.tab + "}"), catchPart, ensurePart);
+    };
+
+    return Try;
+
+  })(Base);
+
+  exports.Throw = Throw = (function(_super) {
+    __extends(Throw, _super);
+
+    function Throw(expression) {
+      this.expression = expression;
+    }
+
+    Throw.prototype.children = ['expression'];
+
+    Throw.prototype.isStatement = YES;
+
+    Throw.prototype.jumps = NO;
+
+    Throw.prototype.makeReturn = THIS;
+
+    Throw.prototype.compileNode = function(o) {
+      return [].concat(this.makeCode(this.tab + "throw "), this.expression.compileToFragments(o), this.makeCode(";"));
+    };
+
+    return Throw;
+
+  })(Base);
+
+  exports.Existence = Existence = (function(_super) {
+    __extends(Existence, _super);
+
+    function Existence(expression) {
+      this.expression = expression;
+    }
+
+    Existence.prototype.children = ['expression'];
+
+    Existence.prototype.invert = NEGATE;
+
+    Existence.prototype.compileNode = function(o) {
+      var cmp, cnj, code, _ref4;
+
+      this.expression.front = this.front;
+      code = this.expression.compile(o, LEVEL_OP);
+      if (IDENTIFIER.test(code) && !o.scope.check(code)) {
+        _ref4 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref4[0], cnj = _ref4[1];
+        code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null";
+      } else {
+        code = "" + code + " " + (this.negated ? '==' : '!=') + " null";
+      }
+      return [this.makeCode(o.level <= LEVEL_COND ? code : "(" + code + ")")];
+    };
+
+    return Existence;
+
+  })(Base);
+
+  exports.Parens = Parens = (function(_super) {
+    __extends(Parens, _super);
+
+    function Parens(body) {
+      this.body = body;
+    }
+
+    Parens.prototype.children = ['body'];
+
+    Parens.prototype.unwrap = function() {
+      return this.body;
+    };
+
+    Parens.prototype.isComplex = function() {
+      return this.body.isComplex();
+    };
+
+    Parens.prototype.compileNode = function(o) {
+      var bare, expr, fragments;
+
+      expr = this.body.unwrap();
+      if (expr instanceof Value && expr.isAtomic()) {
+        expr.front = this.front;
+        return expr.compileToFragments(o);
+      }
+      fragments = expr.compileToFragments(o, LEVEL_PAREN);
+      bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns));
+      if (bare) {
+        return fragments;
+      } else {
+        return this.wrapInBraces(fragments);
+      }
+    };
+
+    return Parens;
+
+  })(Base);
+
+  exports.For = For = (function(_super) {
+    __extends(For, _super);
+
+    function For(body, source) {
+      var _ref4;
+
+      this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index;
+      this.body = Block.wrap([body]);
+      this.own = !!source.own;
+      this.object = !!source.object;
+      if (this.object) {
+        _ref4 = [this.index, this.name], this.name = _ref4[0], this.index = _ref4[1];
+      }
+      if (this.index instanceof Value) {
+        this.index.error('index cannot be a pattern matching expression');
+      }
+      this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length;
+      this.pattern = this.name instanceof Value;
+      if (this.range && this.index) {
+        this.index.error('indexes do not apply to range loops');
+      }
+      if (this.range && this.pattern) {
+        this.name.error('cannot pattern match over range loops');
+      }
+      this.returns = false;
+    }
+
+    For.prototype.children = ['body', 'source', 'guard', 'step'];
+
+    For.prototype.compileNode = function(o) {
+      var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart, _ref4, _ref5;
+
+      body = Block.wrap([this.body]);
+      lastJumps = (_ref4 = last(body.expressions)) != null ? _ref4.jumps() : void 0;
+      if (lastJumps && lastJumps instanceof Return) {
+        this.returns = false;
+      }
+      source = this.range ? this.source.base : this.source;
+      scope = o.scope;
+      name = this.name && (this.name.compile(o, LEVEL_LIST));
+      index = this.index && (this.index.compile(o, LEVEL_LIST));
+      if (name && !this.pattern) {
+        scope.find(name);
+      }
+      if (index) {
+        scope.find(index);
+      }
+      if (this.returns) {
+        rvar = scope.freeVariable('results');
+      }
+      ivar = (this.object && index) || scope.freeVariable('i');
+      kvar = (this.range && name) || index || ivar;
+      kvarAssign = kvar !== ivar ? "" + kvar + " = " : "";
+      if (this.step && !this.range) {
+        _ref5 = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST)), step = _ref5[0], stepVar = _ref5[1];
+        stepNum = stepVar.match(SIMPLENUM);
+      }
+      if (this.pattern) {
+        name = ivar;
+      }
+      varPart = '';
+      guardPart = '';
+      defPart = '';
+      idt1 = this.tab + TAB;
+      if (this.range) {
+        forPartFragments = source.compileToFragments(merge(o, {
+          index: ivar,
+          name: name,
+          step: this.step
+        }));
+      } else {
+        svar = this.source.compile(o, LEVEL_LIST);
+        if ((name || this.own) && !IDENTIFIER.test(svar)) {
+          defPart += "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n";
+          svar = ref;
+        }
+        if (name && !this.pattern) {
+          namePart = "" + name + " = " + svar + "[" + kvar + "]";
+        }
+        if (!this.object) {

<TRUNCATED>

[26/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.h
new file mode 100644
index 0000000..143f052
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifier.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PPSNOTIFIER_H_
+#define PPSNOTIFIER_H_
+
+#include <string>
+
+#include "../utils/Thread.h"
+
+namespace jpps {
+
+/**
+ * PPSNotifier is an encapsulation of an open PPS .notify object. PPSNotifier has a
+ * blocking thread dedicated to reading from its .notify object. The thread constantly
+ * waits for new notifications in the .notify object.
+ *
+ * The way the PPS notify mechanism works is that on the first open/read of a .notify object,
+ * PPS provides a notify group id. This group id can be used when opening any PPS object to make
+ * the PPS object join the notify group.
+ *
+ * For example, you open a .notify file and the group id returned is "2a3".
+ * You subsequently open a PPS object and make it join that notify group:
+ *
+ * ::open("/pps/myppsobj?notify=2a3:someUniqueValueIDecide");
+ *
+ * Now, every time myppsobj changes, the .notify file will be updated in the following manner:
+ *
+ * <code>Notify 2a3:someUniqueValueIDecide</code>
+ *
+ * For a change to the file. And
+ *
+ * <code>-2a3:someUniqueValueIDecide</code>
+ *
+ * if myppsobj is closed.
+ *
+ * When PPSNotifier reads a notification, the unique value is actually a unique identifier for a
+ * PPSInterface object that can be looked up in a global PPSInterface lookup table. Getting the
+ * PPSInterface object designated by the unique identifier, PPSNotifier calls PPSInterface::onNotify()
+ * to inform the PPSInterface object that there is new data pending or that the file has closed.
+ * It is then up to the PPSInterface to decide how to proceed to get that data from myppsobj.
+ */
+class PPSNotifier {
+
+public:
+
+	/**
+	 * Constructor.
+	 */
+	PPSNotifier();
+
+	/**
+	 * Destructor. Note that this destructor will attempt to close the .notify
+	 * object's file.
+	 */
+	virtual ~PPSNotifier();
+
+	/**
+	 * Start the notify thread.
+	 */
+	void startNotifyLoop();
+
+	/**
+	 * Get the .notify object's path.
+	 *
+	 * @return The path to the .notify object.
+	 */
+	inline std::string getNotifyObjPath() const { return m_notifyObjPath; }
+
+	/**
+	 * Set the .notify object's path.
+	 *
+	 * @param path The path of the .notify object (note that this should not include the
+	 * .notify object name).
+	 */
+	inline void setNotifyOjbPath(const std::string& path) { m_notifyObjPath = path; }
+
+	/**
+	 * Get the .notify object's file descriptor.
+	 *
+	 * @return The file descriptor for the open .notify object.
+	 */
+	inline int getObjFd() const { return m_notifyObjFd; }
+
+	/**
+	 * Set the .notify object's file descriptor.
+	 *
+	 * @param The file descriptor for the open .notify object.
+	 */
+	inline void setObjFd(const int fd) { m_notifyObjFd = fd; }
+
+	/**
+	 * Set this notifier's .notify group ID (assigned by PPS).
+	 *
+	 * @param The .notify object's group ID, which is returned by PPS on the first read
+	 * of the .notify object.
+	 */
+	inline std::string getNotifyGroupId() const { return m_notifyGroupId; }
+
+	/**
+	 * Get this notifier's .notify group ID (assigned by PPS).
+	 *
+	 * @return The .notify object's group ID.
+	 */
+	inline void setNotifyGroupId(const std::string& id) { m_notifyGroupId = id; }
+
+private:
+
+	// Disable the copy constructor
+	PPSNotifier(const PPSNotifier& manager);
+
+	// Disable the assignment operator
+	PPSNotifier& operator=(const PPSNotifier& rhs);
+
+	/**
+	 * Function used to start the thread. Pass this into the Thread::start() function.
+	 *
+	 * @param pArg A pointer to a PPSNotifier.
+	 */
+	static void* _notifyLoop(void* pArg);
+
+	/**
+	 * The main thread loop. Blocks on reading the .notify file.
+	 */
+	void notifyLoop();
+
+	/** The path of the .notify file we're monitoring to know when to get data. */
+	std::string m_notifyObjPath;
+
+	/** The file descriptor of the .notify file we're monitoring to know when to get data. */
+	int m_notifyObjFd;
+
+	/** The .notify group ID assigned by PPS when the group was created. */
+	std::string m_notifyGroupId;
+
+	/** The thread I'm running on. */
+	Thread m_thread;
+};
+
+} /* namespace jpps */
+#endif /* PPSNOTIFIER_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.cpp
new file mode 100644
index 0000000..5392ca8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.cpp
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "PPSNotifyGroupManager.h"
+
+#include <fcntl.h>
+
+#include "PPSNotifier.h"
+
+namespace jpps {
+
+typedef std::map<std::string, PPSNotifier*>::iterator groupIter;
+typedef std::map<std::string, PPSNotifier*>::const_iterator const_groupIter;
+typedef std::pair<std::string, PPSNotifier*> groupValue;
+
+pthread_mutex_t PPSNotifyGroupManager::sm_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+PPSNotifyGroupManager::PPSNotifyGroupManager()
+{
+
+}
+
+PPSNotifyGroupManager::~PPSNotifyGroupManager()
+{
+	// Delete the allocated memory for all the PPSNotifiers
+	for (groupIter it = m_notifyGroups.begin(); it != m_notifyGroups.end(); it++) {
+
+		if ((*it).second != NULL) {
+
+			delete (*it).second;
+			(*it).second = NULL;
+		}
+	}
+}
+
+PPSNotifyGroupManager& PPSNotifyGroupManager::getInstance()
+{
+	// The one and only PPSNotifyGroupManager
+	static PPSNotifyGroupManager manager;
+	return manager;
+}
+
+bool PPSNotifyGroupManager::joinNotifyGroup(const std::string& path, std::string& groupId)
+{
+	std::string notifyFile;
+	std::string notifyPath(path);
+	std::size_t nPos = notifyPath.rfind('/');
+
+	// Search through the directories in the string until we find a valid .notify object
+	while (nPos != std::string::npos) {
+
+		// Chop off everything after the last '/' to get the path without the PPS object name
+		notifyPath = notifyPath.substr(0, nPos);
+
+		// Do we already have a notify group for this path?
+		const_groupIter it = m_notifyGroups.find(notifyPath);
+
+		// We found a match!
+		if (it != m_notifyGroups.end() && (*it).second != NULL) {
+
+			groupId = (*it).second->getNotifyGroupId();
+			return true;
+		}
+
+		// Add ".notify?wait" to the notify path, to make it a real file
+		notifyFile = notifyPath + "/.notify?wait";
+
+		// Try to open this .notify object
+		int fd = ::open(notifyFile.c_str(), O_RDONLY);
+
+		// This is the .notify object to use
+		if (fd >= 0) {
+
+			char data[20];
+			int len = ::read(fd, data, sizeof(data) - 1);
+			// Terminate string to remove the newline char
+			data[len > 0 ? len - 1 : 0] = '\0';
+
+			PPSNotifier* pNotifier = new PPSNotifier();
+			pNotifier->setNotifyGroupId(std::string(data));
+			pNotifier->setNotifyOjbPath(notifyPath);
+			pNotifier->setObjFd(::dup(fd));
+                        ::close(fd);
+
+			// Add this badboy to our cache of notify groups
+			m_notifyGroups.insert(groupValue(notifyPath, pNotifier));
+
+			// Start the notify reading thread
+			pNotifier->startNotifyLoop();
+
+			groupId = pNotifier->getNotifyGroupId();
+			return true;
+		}
+		// Keep looking
+		else {
+
+			nPos = notifyPath.rfind('/');
+		}
+	}
+
+	// We didn't find a notify group
+	groupId = "";
+	return false;
+}
+
+} /* namespace jpps */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.h
new file mode 100644
index 0000000..03b0e3e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSNotifyGroupManager.h
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PPSNOTIFYGROUPMANAGER_H_
+#define PPSNOTIFYGROUPMANAGER_H_
+
+#include <map>
+#include <string>
+#include <pthread.h>
+
+namespace jpps {
+
+// Forward declaration
+class PPSNotifier;
+
+
+/**
+ * The PPSNotifyGroupManager is used to manage a global pool of .notify objects. PPS has a mechanism
+ * where every folder can contain a special PPS object ".notify". Opening the .notify object will return
+ * a group id on the first read of the .notify object. The group id is used to open the real PPS object
+ * for which we desire to receive notifications. Once this is done, the .notify object is the one that will
+ * receive change notifications for the real PPS object. In this model, the real PPS object DOES NOT
+ * open in blocking read or ionotify/select mode. The .notify object is the one responsible for blocking
+ * on read and tracking data publishing.
+ *
+ * This object is a global singleton - any access to it needs to be wrapped in a mutex to prevent
+ * concurrency problems. Two functions mutex_lock() and mutex_unlock() are provided for this purpose.
+ */
+class PPSNotifyGroupManager
+{
+public:
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~PPSNotifyGroupManager();
+
+	/**
+	 * Get the one and only instance of the PPSNotifier.Always wrap calls to getInstance() in a call to
+	 * PPSNotifyGroupManager::mutexLock()/mutexUnlock().
+	 */
+	static PPSNotifyGroupManager& getInstance();
+
+	/**
+	 * Use this function to get the notify group id of the "closest" .notify object in the /pps hierarchy
+	 * that contains path.
+	 *
+	 * The function will go backwards through the directories in path looking for a .notify object. It will return
+	 * the group id of the first .notify object it finds on this path. It is the responsibility of the caller
+	 * to have the PPS object in path join the notify group by opening the object with the "notify=groupId:val"
+	 * option set.
+	 *
+	 * PPSNotifyGroupManager maintains a pool of opened .notify objects. It is possible for a single .notify object
+	 * to have a very disparate (and numerous) set of PPS objects that it monitors. In order to tweak performance
+	 * it is advisable that .notify object be created in strategic directories in the /pps directory hierarchy, in
+	 * order to spread the load of notification monitoring. Each .notify object opened will spawn a thread that blocks
+	 * on reading from the .notify object. Having several .notify objects means having several threads that read
+	 * notifications.
+	 *
+	 * Note that joinNotifyGroup() will NOT create any .notify PPS objects. The /pps/.notify object always exists,
+	 * and if the /pps directory hierarchy contains no other .notify objects, /pps/.notify will end up being the
+	 * notification group that all objects join.
+	 *
+	 * Always wrap calls to joinNotifyGroup() in a call to PPSNotifyGroupManager::mutexLock()/mutexUnlock().
+	 *
+	 * @param The PPS object that wants to join the notify group.
+	 * @param groupId The id of the notify group joined. This is an output parameter.
+	 * @return True if a notify group was successfully joined, false otherwise. If true, then the groupId
+	 * variable will be set.
+	 */
+	bool joinNotifyGroup(const std::string& path, std::string& groupId);
+
+	/**
+	 * Returns how many notification groups the manager is managing.
+	 *
+	 * @return The number of notification groups (i.e. open .notify objects) in use.
+	 */
+	inline std::size_t getNumGroups() const { return m_notifyGroups.size(); }
+
+	/**
+	 * Should be used to wrap all calls to PPSNotifyGroupManager APIs. Because this is a singleton global
+	 * object, multiple threads may try to access this object at one time. It is therefore important to
+	 * mutex lock all access to this object.
+	 */
+	static inline void mutexLock() { pthread_mutex_lock(&sm_mutex); }
+
+	/**
+	 * Should be used to wrap all calls to PPSNotifyGroupManager APIs. Because this is a singleton global
+	 * object, multiple threads may try to access this object at one time. It is therefore important to
+	 * mutex lock all access to this object.
+	 */
+	static inline void mutexUnlock() { pthread_mutex_unlock(&sm_mutex); }
+
+private:
+
+	/**
+	 * Constructor. Private as part of the singleton pattern of this object.
+	 */
+	PPSNotifyGroupManager();
+
+	// Disable the copy constructor.
+	PPSNotifyGroupManager(const PPSNotifyGroupManager& manager);
+
+	// Disable the assignment operator.
+	PPSNotifyGroupManager& operator=(const PPSNotifyGroupManager& rhs);
+
+	/** This is a cache of all the .notify objects. */
+	std::map<std::string, PPSNotifier*> m_notifyGroups;
+
+	/** Mutex used to prevent threads from clobbering each other. */
+	static pthread_mutex_t sm_mutex;
+};
+
+} /* namespace jpps */
+#endif /* PPSNOTIFYGROUPMANAGER_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSTypes.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSTypes.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSTypes.h
new file mode 100644
index 0000000..362d236
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/core/PPSTypes.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PPSTYPES_H_
+#define PPSTYPES_H_
+
+#include <map>
+
+namespace jpps {
+
+class PPSEvent;
+
+/**
+ * A struct representing an attribute of a PPS object.
+ */
+struct ppsAttribute {
+
+	/** The attribute name. */
+	std::string name;
+	/** The attribute value. */
+	std::string value;
+	/** The attribute encoding. */
+	std::string encoding;
+	/** Flags associated to the attribute. */
+	int flags;
+	/** Attribute options. */
+	int options;
+	/** The attribute options mask. */
+	int optionMask;
+};
+
+/**
+ * A struct representing a PPS object.
+ */
+struct ppsObject {
+
+	/** The PPS object name. */
+	std::string name;
+	/** The PPS object flags. */
+	int flags;
+	/** The PPS object options. */
+	int options;
+	/** The PPS object option mask. */
+	int optionMask;
+	/** The attributes of this PPS object. */
+	std::map<std::string, ppsAttribute> attributes;
+};
+
+/**
+ * Typedef for ppsAttribute iterator.
+ */
+typedef std::map<std::string, ppsAttribute>::iterator ppsAttrIter;
+
+/**
+ * Typedef for ppsAttribute const iterator.
+ */
+typedef std::map<std::string, ppsAttribute>::const_iterator const_ppsAttrIter;
+
+/**
+ * A pair used to insert attributes into the map.
+ */
+typedef std::pair<std::string, ppsAttribute> ppsAttrPair;
+
+/**
+ * This is the definition of the notify function clients of PPSInterface use in order
+ * to be informed of events the PPSInterface generates.
+ *
+ * @param pArg A user defined parameter. This value can be passed in to PPSInterface::setEventFunc()
+ * and will be passed back with the event handler every time it is called. PPSInterface will not
+ * modify this value.
+ *
+ * @aparam event The PPS event being broadcast.
+ */
+typedef void (PPSEventFunc)(void* pArg, const PPSEvent& event);
+
+};
+
+#endif /* PPSTYPES_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.cpp
new file mode 100644
index 0000000..9b5d711
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.cpp
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "JPPSPlugin.h"
+
+#include <string>
+#include <sstream>
+
+namespace jpps {
+
+const char* JPPSPlugin::CLASS_NAME = "PPS";
+const std::string JPPSPlugin::METHOD_OPEN = "Open";
+const std::string JPPSPlugin::METHOD_CLOSE = "Close";
+const std::string JPPSPlugin::METHOD_WRITE = "Write";
+const std::string JPPSPlugin::METHOD_READ = "Read";
+const std::string JPPSPlugin::METHOD_SET_VERBOSE = "SetVerbose";
+
+JPPSPlugin::JPPSPlugin(const std::string& jnextObjectId)
+: m_jnextObjId(jnextObjectId)
+, m_ppsInterface()
+{
+	// We only have one event handler, we'll use it for all events
+	m_ppsInterface.callbackInit(this,
+								onEvent,
+								onEvent,
+								onEvent,
+								onEvent,
+								onEvent,
+								onEvent,
+								onEvent);
+}
+
+JPPSPlugin::~JPPSPlugin()
+{
+
+}
+
+std::string JPPSPlugin::InvokeMethod(const std::string& strCommand)
+{
+	// Parameter sanity check
+	if (strCommand == "")
+		return std::string(szERROR) + " JPPSPlugin::InvokeMethod() called with no method to invoke.";
+
+	// Tokenize the stream of input information
+	std::stringstream args(strCommand);
+	std::string method;
+	args >> method;
+
+	// Invoke the method requested
+	if (method == JPPSPlugin::METHOD_WRITE) {
+		return write(args);
+	}
+	else if (method == JPPSPlugin::METHOD_READ) {
+		return read();
+	}
+	else if (method == JPPSPlugin::METHOD_OPEN) {
+		return open(args);
+	}
+	else if (method == JPPSPlugin::METHOD_CLOSE) {
+		return close();
+	}
+	else if (method == JPPSPlugin::METHOD_SET_VERBOSE) {
+		return setVerbose(args);
+	}
+
+	return std::string(szERROR) + m_jnextObjId + " JPPSPlugin::InvokeMethod() - unknown method \"" + method + "\"";
+}
+
+std::string JPPSPlugin::open(std::stringstream& args)
+{
+	// We don't have enough args
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSPlugin::open() - invalid number of arguments.";
+
+	// Get the arguments
+	// 1st arg, the path
+	std::string path;
+	args >> path;
+
+	// Missing argument
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSPlugin::open() - invalid number of arguments.";
+
+	// 2nd arg, the open flags (i.e. O_RDONLY O_CREAT, etc.)
+	int oflags = 0;
+	args >> oflags;
+
+	bool bRet = m_ppsInterface.open(path, oflags);
+
+	return bRet ? std::string(szOK) + m_jnextObjId : std::string(szERROR) + m_jnextObjId + " JPPSPlugin::open() - failed to open \"" + path + "\".";
+}
+
+std::string JPPSPlugin::close()
+{
+	m_ppsInterface.close();
+	return szOK + m_jnextObjId;
+}
+
+std::string JPPSPlugin::write(std::stringstream& args)
+{
+	// We don't have enough args
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSPlugin::write() - invalid number of arguments.";
+
+	// This truncates the buffer from the current position onwards (if you don't do this, you keep
+	// the method name that's at the beginning of the args stream)
+	args.seekg(1, std::ios_base::cur); 	// Skip the initial whitespace that was between the method name and the parameter
+	std::stringstream tmp;
+	tmp << args.rdbuf();
+
+	m_ppsInterface.write(tmp.str());
+	return szOK + m_jnextObjId;
+}
+
+std::string JPPSPlugin::read() const
+{
+	return std::string(szOK) + m_ppsInterface.read();
+}
+
+std::string JPPSPlugin::setVerbose(std::stringstream& args)
+{
+	unsigned short verbosity = 0;
+
+	// If no param was passed, default to 0, else read the value
+	if (!args.eof())
+		args >> verbosity;
+
+	m_ppsInterface.setVerbose(verbosity);
+	return szOK;
+}
+
+void JPPSPlugin::onEvent(const std::string& sEvent) const
+{
+	// We have to add our object Id to the event
+	std::string pluginEvent = m_jnextObjId + " " + sEvent;
+	SendPluginEvent(pluginEvent.c_str(), m_pContext);
+}
+
+void JPPSPlugin::onEvent(void* pArg, const std::string& sEvent)
+{
+	// Cast pArg back to JPPSPlugin and invoke onEvent()
+	JPPSPlugin* pPlugin = static_cast<JPPSPlugin*>(pArg);
+
+	if (pPlugin != NULL)
+		pPlugin->onEvent(sEvent);
+}
+
+} /* namespace jpps */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.h
new file mode 100644
index 0000000..1a56ab2
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSPlugin.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef JPPSPLUGIN_H_
+#define JPPSPLUGIN_H_
+
+#include "../common/plugin.h"
+#include "PPSInterfaceGlue.h"
+
+namespace jpps {
+
+/**
+ * JPPSPlugin is a JNext extension which provides PPS support to JavaScript.
+ * This class is merely a wrapper for PPSInterfaceGlue, providing the necessary
+ * JNext interface and performing string-parameter encoding and decoding.
+ *
+ * The intention is that this class will be replaced with a different plug-in framework.
+ */
+class JPPSPlugin : public JSExt {
+
+public:
+
+	// Constants
+
+	/** The only class supported by this plugin. */
+	static const char* CLASS_NAME;
+
+	// List of object methods supported by this extension
+
+	/** Open a PPS object/directory. */
+	static const std::string METHOD_OPEN;
+	/** Close a PPS object/directory. */
+	static const std::string METHOD_CLOSE;
+	/** Write a PPS object. */
+	static const std::string METHOD_WRITE;
+	/** Read a PPS object. */
+	static const std::string METHOD_READ;
+	/** Adjust output verbosity. */
+	static const std::string METHOD_SET_VERBOSE;
+
+	/**
+	 * Constructor.
+	 */
+	JPPSPlugin(const std::string& jnextObjectId);
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~JPPSPlugin();
+
+	// Inherited from JSExt
+	virtual std::string InvokeMethod(const std::string& strCommand);
+	virtual inline bool CanDelete(void) { return true; }
+
+	/**
+	 *  Static callback method, changes pArg back into a JPPSPlugin and invokes
+	 *  the non-static version of onEvent().
+	 */
+	static void onEvent(void* pArg, const std::string& sEvent);
+
+private:
+
+	// Disable the default constructor
+	JPPSPlugin();
+
+	/**
+	 * The non-static version of onEvent. Handler for the PPSInterfaceGlue class' events.
+	 */
+	void onEvent(const std::string& sEvent) const;
+
+	/**
+	 * Open a PPS object.
+	 */
+	std::string open(std::stringstream& args);
+
+	/**
+	 * Close the PPS object.
+	 */
+	std::string close();
+
+	/**
+	 * Write data to the PPS object.
+	 */
+	std::string write(std::stringstream& args);
+
+	/**
+	 * Read the cached PPS data from the last read.
+	 */
+	std::string read() const;
+
+	/**
+	 * Set the verbosity level for logging to slog.
+	 */
+	std::string setVerbose(std::stringstream& args);
+
+	/** A unique JNext id for this object */
+	std::string m_jnextObjId;
+
+	/** The PPS object. */
+	PPSInterfaceGlue m_ppsInterface;
+};
+
+} /* namespace jpps */
+#endif /* JPPSPLUGIN_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.cpp
new file mode 100644
index 0000000..6c3bc2d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.cpp
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "JPPSServerPlugin.h"
+
+#include <sstream>
+
+namespace jpps {
+
+const char* JPPSServerPlugin::CLASS_NAME = "PPSServer";
+
+const std::string JPPSServerPlugin::METHOD_OPEN = "Open";
+const std::string JPPSServerPlugin::METHOD_CLOSE = "Close";
+const std::string JPPSServerPlugin::METHOD_SET_VERBOSE = "SetVerbose";
+const std::string JPPSServerPlugin::METHOD_SEND_MESSAGE = "SendMessage";
+const std::string JPPSServerPlugin::METHOD_BROADCAST_MESSAGE = "BroadcastMessage";
+
+JPPSServerPlugin::JPPSServerPlugin(const std::string& jnextObjectId)
+: m_jnextObjId(jnextObjectId)
+, m_ppsServer()
+{
+	m_ppsServer.callbackInit(this,
+							 onEvent,
+							 onEvent,
+							 onEvent,
+							 onEvent,
+							 onEvent,
+							 onEvent,
+							 onEvent,
+							 onEvent);
+}
+
+JPPSServerPlugin::~JPPSServerPlugin()
+{
+}
+
+std::string JPPSServerPlugin::InvokeMethod(const std::string& strCommand)
+{
+	// Parameter sanity check
+	if (strCommand == "")
+		return std::string(szERROR) + " JPPSServerPlugin::InvokeMethod() called with no method to invoke.";
+
+	// Tokenize the stream of input information
+	std::stringstream args(strCommand);
+	std::string method;
+	args >> method;
+
+	// Invoke the method requested
+	if (method == JPPSServerPlugin::METHOD_OPEN) {
+		return open(args);
+	}
+	else if (method == JPPSServerPlugin::METHOD_CLOSE) {
+		return close();
+	}
+	else if (method == JPPSServerPlugin::METHOD_SET_VERBOSE) {
+		return setVerbose(args);
+	}
+	else if (method == JPPSServerPlugin::METHOD_SEND_MESSAGE) {
+		return sendMessage(args);
+	}
+	else if (method == JPPSServerPlugin::METHOD_BROADCAST_MESSAGE) {
+		return broadcastMessage(args);
+	}
+
+	return std::string(szERROR) + m_jnextObjId + " JPPSServerPlugin::InvokeMethod() - unknown method \"" + method + "\"";
+}
+
+std::string JPPSServerPlugin::open(std::stringstream& args)
+{
+	// We don't have enough args
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSServerPlugin::open() - invalid number of arguments.";
+
+	// Get the arguments
+	// 1st arg, the path
+	std::string path;
+	args >> path;
+
+	// Missing argument
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSServerPlugin::open() - invalid number of arguments.";
+
+	// 2nd arg, the open flags (i.e. O_RDONLY O_CREAT, etc.)
+	int oflags = 0;
+	args >> oflags;
+
+	bool bRet = m_ppsServer.open(path, oflags);
+
+	return bRet ? std::string(szOK) + m_jnextObjId : std::string(szERROR) + m_jnextObjId + " JPPSServerPlugin::open() - failed to open \"" + path + "\".";
+}
+
+std::string JPPSServerPlugin::close()
+{
+	m_ppsServer.close();
+	return szOK + m_jnextObjId;
+}
+
+std::string JPPSServerPlugin::setVerbose(std::stringstream& args)
+{
+	unsigned short verbosity = 0;
+
+	// If no param was passed, default to 0, else read the value
+	if (!args.eof())
+		args >> verbosity;
+
+	m_ppsServer.setVerbose(verbosity);
+	return szOK + m_jnextObjId;
+}
+
+std::string JPPSServerPlugin::sendMessage(std::stringstream& args)
+{
+	// We don't have enough args
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSServerPlugin::sendMessage() - invalid number of arguments.";
+
+	// Get the arguments
+	// 1st arg, the clientId
+	std::string clientId;
+	args >> clientId;
+
+	// We don't have enough args
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSServerPlugin::sendMessage() - invalid number of arguments.";
+
+	// This truncates the buffer from the current position onwards (if you don't do this, you keep
+	// the method name that's at the beginning of the args stream)
+	args.seekg(1, std::ios_base::cur); 	// Skip the whitespace that was between the clientID and the message
+	std::stringstream tmp;
+	tmp << args.rdbuf();
+
+	m_ppsServer.sendMessage(clientId, tmp.str());
+	return szOK + m_jnextObjId;
+}
+
+std::string JPPSServerPlugin::broadcastMessage(std::stringstream& args)
+{
+	// We don't have enough args
+	if (args.eof())
+		return std::string(szERROR) + m_jnextObjId + " JPPSServerPlugin::broadcastMessage() - invalid number of arguments.";
+
+	// This truncates the buffer from the current position onwards (if you don't do this, you keep
+	// the method name that's at the beginning of the args stream)
+	args.seekg(1, std::ios_base::cur); 	// Skip the whitespace that was between the method name and the message
+	std::stringstream tmp;
+	tmp << args.rdbuf();
+
+	m_ppsServer.broadcastMessage(tmp.str());
+	return szOK + m_jnextObjId;
+}
+
+void JPPSServerPlugin::onEvent(const std::string& sEvent) const
+{
+	// We have to add our object Id to the event
+	std::string pluginEvent = m_jnextObjId + " " + sEvent;
+	SendPluginEvent(pluginEvent.c_str(), m_pContext);
+}
+
+void JPPSServerPlugin::onEvent(void* pArg, const std::string& sEvent)
+{
+	// Cast pArg back to JPPSPlugin and invoke onEvent()
+	JPPSServerPlugin* pPlugin = static_cast<JPPSServerPlugin*>(pArg);
+
+	if (pPlugin != NULL)
+		pPlugin->onEvent(sEvent);
+}
+
+} /* namespace jpps */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.h
new file mode 100644
index 0000000..ea5b18f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/JPPSServerPlugin.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef JPPSSERVERPLUGIN_H_
+#define JPPSSERVERPLUGIN_H_
+
+#include "../common/plugin.h"
+#include "PPSServerGlue.h"
+
+namespace jpps {
+
+class JPPSServerPlugin: public JSExt {
+
+public:
+
+	// Constants
+
+	/** The only class supported by this plugin. */
+	static const char* CLASS_NAME;
+
+	// List of object methods supported by this extension
+
+	/** Open a PPS object/directory. */
+	static const std::string METHOD_OPEN;
+	/** Close a PPS object/directory. */
+	static const std::string METHOD_CLOSE;
+	/** Adjust output verbosity. */
+	static const std::string METHOD_SET_VERBOSE;
+	/** Send a message to a particular client. */
+	static const std::string METHOD_SEND_MESSAGE;
+	/** Send a message to all clients. */
+	static const std::string METHOD_BROADCAST_MESSAGE;
+
+	/**
+	 * Constructor.
+	 */
+	JPPSServerPlugin(const std::string& jnextObjectId);
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~JPPSServerPlugin();
+
+	// Inherited from JSExt
+	virtual std::string InvokeMethod(const std::string& strCommand);
+	virtual inline bool CanDelete(void) { return true; }
+
+	/**
+	 *  Static callback method, changes pArg back into a JPPSServerPlugin and invokes
+	 *  the non-static version of onEvent().
+	 */
+	static void onEvent(void* pArg, const std::string& sEvent);
+
+private:
+
+	// Disable default constructor.
+	JPPSServerPlugin();
+
+	/**
+	 * The non-static version of onEvent. Handler for the PPSServerGlue class' events.
+	 */
+	void onEvent(const std::string& sEvent) const;
+
+	/**
+	 * Open a PPS object.
+	 */
+	std::string open(std::stringstream& args);
+
+	/**
+	 * Close the PPS object.
+	 */
+	std::string close();
+
+	/**
+	 * Set the verbosity level for logging to slog.
+	 */
+	std::string setVerbose(std::stringstream& args);
+
+	/**
+	 * Send a message to a particular client.
+	 */
+	std::string sendMessage(std::stringstream& args);
+
+	/**
+	 * Send a message to all clients.
+	 */
+	std::string broadcastMessage(std::stringstream& args);
+
+	/** A unique JNext id for this object */
+	std::string m_jnextObjId;
+
+	/** The PPS object. */
+	PPSServerGlue m_ppsServer;
+};
+
+} /* namespace jpps */
+#endif /* JPPSSERVERPLUGIN_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.cpp
new file mode 100644
index 0000000..83616b8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.cpp
@@ -0,0 +1,355 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "PPSInterfaceGlue.h"
+
+#include <json/value.h>
+#include <json/writer.h>
+#include <json/reader.h>
+
+#include <vector>
+#include <sstream>
+
+#include <ppsparse.h>
+
+#include "../core/PPSEvent.h"
+
+namespace jpps {
+
+const std::string PPSInterfaceGlue::EVENT_OPEN = "ppsOpened";
+const std::string PPSInterfaceGlue::EVENT_OPEN_FAILED = "ppsOpenFailed";
+const std::string PPSInterfaceGlue::EVENT_FIRST_READ = "ppsFirstRead";
+const std::string PPSInterfaceGlue::EVENT_NEW_DATA = "OnChange";//"ppsNewData";
+const std::string PPSInterfaceGlue::EVENT_CLOSE = "ppsClosed";
+const std::string PPSInterfaceGlue::EVENT_WRITE_FAILED = "ppsWriteFailed";
+const std::string PPSInterfaceGlue::EVENT_READ_FAILED = "ppsReadFailed";
+
+const std::string PPSInterfaceGlue::ENCODING_N = "n";
+const std::string PPSInterfaceGlue::ENCODING_B = "b";
+const std::string PPSInterfaceGlue::ENCODING_JSON = "json";
+
+const Json::StaticString PPSInterfaceGlue::JSON_REMOVE("remove");
+const Json::StaticString PPSInterfaceGlue::JSON_CHANGED("changed");
+const Json::StaticString PPSInterfaceGlue::JSON_DATA("data");
+const Json::StaticString PPSInterfaceGlue::JSON_OBJNAME("objName");
+const Json::StaticString PPSInterfaceGlue::JSON_CHANGE_DATA("changeData");
+const Json::StaticString PPSInterfaceGlue::JSON_ALL_DATA("allData");
+
+
+PPSInterfaceGlue::PPSInterfaceGlue()
+: m_interface()
+, m_pArg(NULL)
+, m_handleOpen(NULL)
+, m_handleFirstRead(NULL)
+, m_handleNewData(NULL)
+, m_handleClose(NULL)
+, m_handleOpenFailed(NULL)
+, m_handleWriteFailed(NULL)
+, m_handleReadFailed(NULL)
+{
+	m_interface.setEventFunc(onEvent, this);
+}
+
+PPSInterfaceGlue::~PPSInterfaceGlue()
+{
+	m_interface.setEventFunc(NULL);
+}
+
+void PPSInterfaceGlue::callbackInit(void* pArg,
+								    callback* handleOpen,
+								    callback* handleFirstRead,
+								    callback* handleNewData,
+								    callback* handleClose,
+								    callback* handleOpenFailed,
+								    callback* handleWriteFailed,
+								    callback* handleReadFailed)
+{
+	m_pArg = pArg;
+	m_handleOpen = handleOpen;
+	m_handleFirstRead = handleFirstRead;
+	m_handleNewData = handleNewData;
+	m_handleClose = handleClose;
+	m_handleOpenFailed = handleOpenFailed;
+	m_handleWriteFailed = handleWriteFailed;
+	m_handleReadFailed = handleReadFailed;
+}
+
+void PPSInterfaceGlue::setVerbose(unsigned short v)
+{
+	m_interface.setVerbose(v);
+}
+
+bool PPSInterfaceGlue::open(const std::string& path, int oflags)
+{
+	// We don't expose the "mode" to the JS layer - always create in 0666 mode
+	return m_interface.open(path, oflags, 0666, false);
+}
+
+void PPSInterfaceGlue::close()
+{
+	m_interface.close();
+}
+
+void PPSInterfaceGlue::sync()
+{
+	m_interface.sync();
+}
+
+void PPSInterfaceGlue::onEvent(void* pArg, const PPSEvent& event)
+{
+	PPSInterfaceGlue* pGlue = static_cast<PPSInterfaceGlue*>(pArg);
+
+	if (pGlue != NULL)
+		pGlue->onEvent(event);
+}
+
+void PPSInterfaceGlue::onEvent(const PPSEvent& event)
+{
+	callback* pFunc = NULL;
+	std::string sArg;
+
+	switch (event.getEventType()) {
+
+	case PPSEvent::PPS_EVENT_OPENED:
+		pFunc = m_handleOpen;
+		sArg = EVENT_OPEN;
+		break;
+
+	case PPSEvent::PPS_EVENT_FIRST_READ_COMPLETE:
+		pFunc = m_handleFirstRead;
+		sArg = EVENT_FIRST_READ + " " + handleNewData(event.getNewData());
+		break;
+
+	case PPSEvent::PPS_EVENT_NEW_DATA:
+		pFunc = m_handleNewData;
+		sArg = EVENT_NEW_DATA + " " + handleNewData(event.getNewData());
+		break;
+
+	case PPSEvent::PPS_EVENT_CLOSED:
+		pFunc = m_handleClose;
+		sArg = EVENT_CLOSE;
+		break;
+
+	case PPSEvent::PPS_EVENT_OPEN_FAILED:
+		pFunc = m_handleOpenFailed;
+		sArg = EVENT_OPEN_FAILED + " " + event.getMessage();
+		break;
+
+	case PPSEvent::PPS_EVENT_WRITE_FAILED:
+		pFunc = m_handleWriteFailed;
+		sArg = EVENT_WRITE_FAILED + " " + event.getMessage();
+		break;
+
+	case PPSEvent::PPS_EVENT_READ_FAILED:
+		pFunc = m_handleReadFailed;
+		sArg = EVENT_READ_FAILED + " " + event.getMessage();
+		break;
+	}
+
+	if (pFunc != NULL)
+		pFunc(m_pArg, sArg);
+}
+
+std::string PPSInterfaceGlue::handleNewData(const ppsObject& newData)
+{
+	Json::Value data(Json::nullValue);
+	data[JSON_CHANGE_DATA] = JSONEncodeNewData(newData);
+	data[JSON_ALL_DATA] = JSONEncodeRead(m_interface.read());
+
+	Json::FastWriter writer;
+	return writer.write(data);
+}
+
+std::string PPSInterfaceGlue::read() const
+{
+	Json::Value data = JSONEncodeRead(m_interface.read());
+	Json::FastWriter writer;
+	return writer.write(data);
+}
+
+Json::Value PPSInterfaceGlue::JSONEncodeRead(const ppsObject& ppsObj) const
+{
+	// If the ppsObj is empty, we can't encode it
+	if (ppsObj.name.empty())
+		return "";
+
+	Json::Value readData(Json::nullValue);
+
+	for (const_ppsAttrIter it = ppsObj.attributes.begin(); it != ppsObj.attributes.end(); it++) {
+
+		ppsAttribute ppsAttrib = (*it).second;
+
+		// An attribute was deleted: update the JSON data structure and the event data
+		if (ppsAttrib.flags & PPS_DELETED) {
+
+			readData.removeMember(ppsAttrib.name);
+		}
+		else {
+
+			// The value is a number
+			if (ppsAttrib.encoding == ENCODING_N) {
+
+				// Convert the value to floating point
+				// istringstream is locale aware - we shouldn't need to perform any special
+				// processing in order to properly convert the data to a floating point
+				// TODO: test that the istringstream conversion works with a locale
+				//       that uses alternate floating point number encoding
+				std::istringstream stream(ppsAttrib.value);
+				double doubleValue;
+
+				// Try to convert the value to a floating point
+				if (!(stream >> doubleValue)) {
+
+					std::string err = EVENT_READ_FAILED + " Failed to convert the string \"" + ppsAttrib.value + "\" to a real number.";
+					m_handleReadFailed(m_pArg, err);
+					return "";
+				}
+
+				readData[ppsAttrib.name] = doubleValue;
+			}
+			// The value is a boolean
+			else if (ppsAttrib.encoding == ENCODING_B) {
+
+				readData[ppsAttrib.name] = (ppsAttrib.value == "true");
+			}
+			// The value is JSON data
+			else if (ppsAttrib.encoding == ENCODING_JSON) {
+
+				Json::Reader reader;
+				reader.parse(ppsAttrib.value, readData[ppsAttrib.name]);
+			}
+			// Just pass the value through as a straight string
+			else {
+
+				readData[ppsAttrib.name] = ppsAttrib.value;
+			}
+		}
+	}
+
+	return readData;
+}
+
+Json::Value PPSInterfaceGlue::JSONEncodeNewData(const ppsObject& ppsObj) const
+{
+	// If the ppsObj is empty, we can't encode it
+	if (ppsObj.name.empty())
+		return "";
+
+	Json::Value eventData(Json::nullValue);
+
+	// Set the PPS object name
+	eventData[JSON_OBJNAME] = ppsObj.name.substr(1); // PR 159829 : Remove the pre-pending '@' symbol
+
+	for (const_ppsAttrIter it = ppsObj.attributes.begin(); it != ppsObj.attributes.end(); it++) {
+
+		ppsAttribute ppsAttrib = (*it).second;
+
+		// An attribute was deleted: update the JSON data structure and the event data
+		if (ppsAttrib.flags & PPS_DELETED) {
+
+			eventData[JSON_REMOVE][ppsAttrib.name] = true;
+		}
+		else {
+
+			eventData[JSON_CHANGED][ppsAttrib.name] = true;
+
+			// The value is a number
+			if (ppsAttrib.encoding == ENCODING_N) {
+
+				// Convert the value to floating point
+				// istringstream is locale aware - we shouldn't need to perform any special
+				// processing in order to properly convert the data to a floating point
+				// TODO: test that the istringstream conversion works with a locale
+				//       that uses alternate floating point number encoding
+				std::istringstream stream(ppsAttrib.value);
+				double doubleValue;
+
+				// Try to convert the value to a floating point
+				if (!(stream >> doubleValue)) {
+
+					std::string err = EVENT_READ_FAILED + " Failed to convert the string \"" + ppsAttrib.value + "\" to a real number.";
+					m_handleReadFailed(m_pArg, err);
+					return "";
+				}
+
+				eventData[JSON_DATA][ppsAttrib.name] = doubleValue;
+			}
+			// The value is a boolean
+			else if (ppsAttrib.encoding == ENCODING_B) {
+
+				eventData[JSON_DATA][ppsAttrib.name] = (ppsAttrib.value == "true");
+			}
+			// The value is JSON data
+			else if (ppsAttrib.encoding == ENCODING_JSON) {
+
+				Json::Reader reader;
+				reader.parse(ppsAttrib.value, eventData[JSON_DATA][ppsAttrib.name]);
+			}
+			// Just pass the value through as a straight string
+			else {
+
+				eventData[JSON_DATA][ppsAttrib.name] = ppsAttrib.value;
+			}
+		}
+	}
+
+	return eventData;
+}
+
+void PPSInterfaceGlue::write(const std::string& data)
+{
+    Json::Reader reader;
+    Json::Value root;
+
+	bool parsingSuccessful = reader.parse(data, root);
+
+    // If parsing the JSON string fails, return a write error
+    if (!parsingSuccessful) {
+
+    	std::string err = EVENT_WRITE_FAILED + " JSON failed to parse the string (\"" + data + "\") to be written. (" + reader.getFormatedErrorMessages() + ")";
+        m_handleWriteFailed(m_pArg, err);
+        return;
+    }
+
+	Json::Value::Members memberNames = root.getMemberNames();
+
+	std::ostringstream output;
+	output.precision(15);
+
+	Json::Value member;
+
+	for (unsigned int i = 0; i < memberNames.size(); i++) {
+
+		output << memberNames[i] << ":";
+		member = root[memberNames[i]];
+
+		if (member.isObject() || member.isArray()) {
+
+			Json::FastWriter writer;
+			output << ENCODING_JSON << ":" << writer.write(member); // write() adds an \n
+		}
+		else if (member.isBool()) {
+
+			output << ENCODING_B << ":" << member.asString() << std::endl;
+		}
+		else if (member.isNumeric()) {
+
+			output << ENCODING_N << ":" << member.asDouble() << std::endl;
+		}
+		else if (member.isString()) {
+
+			output << ":" << member.asString() << std::endl;
+		}
+		else {
+
+			std::string err = EVENT_WRITE_FAILED + " The string passed in (\"" + data + "\") contains an invalid JSON type.";
+			m_handleWriteFailed(m_pArg, err);
+			return;
+		}
+	}
+
+	m_interface.write(output.str());
+}
+
+} /* namespace jpps */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.h
new file mode 100644
index 0000000..fafbacd
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSInterfaceGlue.h
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PPSINTERFACEGLUE_H_
+#define PPSINTERFACEGLUE_H_
+
+#include "../core/PPSInterface.h"
+#include "PluginTypes.h"
+
+#include <json/value.h>
+
+#include <string>
+
+namespace jpps {
+class PPSEvent;
+struct ppsObject;
+}
+
+namespace jpps {
+
+/**
+ * This class bridges JavaScript and the native PPSInterface code.
+ */
+class PPSInterfaceGlue {
+
+public:
+
+	/**
+	 * Constructor.
+	 */
+	PPSInterfaceGlue();
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~PPSInterfaceGlue();
+
+	/**
+	 * The browser plugin should set these handlers.
+	 *
+	 * @param pArg pArg will be passed back to each callback function when it is called.
+	 */
+	void callbackInit(void* pArg,
+					  callback* handleOpen,
+					  callback* handleFirstRead,
+					  callback* handleNewData,
+					  callback* handleClose,
+					  callback* handleOpenFailed,
+					  callback* handleWriteFailed,
+					  callback* handleReadFailed);
+
+	/**
+	 * Set the verbosity of logging to the slog.
+	 */
+	void setVerbose(unsigned short v);
+
+	/**
+	 * Open a PPS object.
+	 */
+	bool open(const std::string& path, int oflags);
+
+	/**
+	 * Write to a PPS object.
+	 */
+	void write(const std::string& data);
+
+	/**
+	 * Read from the PPS object. This actually returns the cached value of the last
+	 * onNewData event from PPSInteraface, then encodes it as JSON.
+	 */
+	std::string read() const;
+
+	/**
+	 * Close this PPS object.
+	 */
+	void close();
+
+	/**
+	 * Forces all queued I/O operations for this object to finish, synchronizing the file's state.
+	 * The function blocks until this is finished.
+	 */
+	void sync();
+
+	/**
+	 * The function that the PPSInterface will call when an event happens.
+	 * This is the static function that is used as a function pointer for
+	 * PPSInterface::setEventFunc().
+	 *
+	 * @param event The event PPSInterface is sending.
+	 * @param pArg A pointer to a PPSInterfaceGlue object, passed in during
+	 * object construction.
+	 */
+	static void onEvent(void* pArg, const PPSEvent& event);
+
+private:
+
+	/**
+	 * The static PPSInterfaceGlue::onEvent() calls this onEvent to do the actual work.
+	 */
+	void onEvent(const PPSEvent& event);
+
+	/**
+	 * Handle a new data event.
+	 */
+	std::string handleNewData(const ppsObject& newData);
+
+	/**
+	 * Take a ppsObject and turn it into a JSON string to send back to the JavaScript
+	 * with a new data event. This structures the JSON with changed properties and the
+	 * data that has changed.
+	 */
+	Json::Value JSONEncodeNewData(const ppsObject& ppsObj) const;
+
+	/**
+	 * Take a ppsObject and turn it into a JSON string to send back to the JavaScript
+	 * when a call to read() is made.
+	 */
+	Json::Value JSONEncodeRead(const ppsObject& ppsObj) const;
+
+	// String names for the various events
+	static const std::string EVENT_OPEN;
+	static const std::string EVENT_OPEN_FAILED;
+	static const std::string EVENT_FIRST_READ;
+	static const std::string EVENT_NEW_DATA;
+	static const std::string EVENT_CLOSE;
+	static const std::string EVENT_READ_FAILED;
+	static const std::string EVENT_WRITE_FAILED;
+
+	/** Custom PPS encoding value: an "n" means a real number. */
+	static const std::string ENCODING_N;
+	/** Custom PPS encoding value: a "b" means a boolean value. */
+	static const std::string ENCODING_B;
+	/** Custom PPS encoding value: the data is encoded using JSON. */
+	static const std::string ENCODING_JSON;
+
+	// JSON constants
+	static const Json::StaticString JSON_REMOVE;
+	static const Json::StaticString JSON_CHANGED;
+	static const Json::StaticString JSON_DATA;
+	static const Json::StaticString JSON_OBJNAME;
+	static const Json::StaticString JSON_CHANGE_DATA;
+	static const Json::StaticString JSON_ALL_DATA;
+
+	/** The interface this object wraps. */
+	PPSInterface m_interface;
+
+	// Handlers for various events
+	void* m_pArg;
+	callback* m_handleOpen;
+	callback* m_handleFirstRead;
+	callback* m_handleNewData;
+	callback* m_handleClose;
+	callback* m_handleOpenFailed;
+	callback* m_handleWriteFailed;
+	callback* m_handleReadFailed;
+};
+
+} /* namespace jpps */
+#endif /* PPSINTERFACEGLUE_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.cpp
new file mode 100644
index 0000000..2eb4552
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.cpp
@@ -0,0 +1,300 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "PPSServerGlue.h"
+
+#include <json/value.h>
+#include <json/writer.h>
+#include <json/reader.h>
+
+#include <sstream>
+
+#include <ppsparse.h>
+#include <fcntl.h>
+
+namespace jpps {
+
+const std::string PPSServerGlue::EVENT_OPEN = "onOpen";
+const std::string PPSServerGlue::EVENT_CLOSE = "onClose";
+const std::string PPSServerGlue::EVENT_CLIENT_CONNECT = "onClientConnect";
+const std::string PPSServerGlue::EVENT_CLIENT_DISCONNECT = "onClientDisconnect";
+const std::string PPSServerGlue::EVENT_MESSAGE = "onMessage";
+const std::string PPSServerGlue::EVENT_OPEN_FAILED = "onOpenFailed";
+const std::string PPSServerGlue::EVENT_SEND_MESSAGE_FAILED = "onSendMessageFailed";
+const std::string PPSServerGlue::EVENT_RECEIVE_MESSAGE_FAILED = "onReceiveMessageFailed";
+
+const std::string PPSServerGlue::ENCODING_N = "n";
+const std::string PPSServerGlue::ENCODING_B = "b";
+const std::string PPSServerGlue::ENCODING_JSON = "json";
+
+const Json::StaticString PPSServerGlue::JSON_DATA("data");
+const Json::StaticString PPSServerGlue::JSON_CONNECTION_ID("clientId");
+
+PPSServerGlue::PPSServerGlue()
+: m_interface()
+, m_pArg(NULL)
+, m_handleOpen(NULL)
+, m_handleClose(NULL)
+, m_handleClientConnect(NULL)
+, m_handleClientDisconnect(NULL)
+, m_handleMessage(NULL)
+, m_handleOpenFailed(NULL)
+, m_handleSendMessageFailed(NULL)
+, m_handleReceiveMessageFailed(NULL)
+{
+	m_interface.setEventFunc(onEvent, this);
+}
+
+PPSServerGlue::~PPSServerGlue()
+{
+	m_interface.setEventFunc(NULL);
+}
+
+void PPSServerGlue::callbackInit(void* pArg,
+					  callback* handleOpen,
+					  callback* handleClose,
+					  callback* handleClientConnect,
+					  callback* handleClientDisconnect,
+					  callback* handleMessage,
+					  callback* handleOpenFailed,
+					  callback* handleSendMessageFailed,
+					  callback* handleReceiveMessageFailed)
+{
+	m_pArg = pArg;
+	m_handleOpen = handleOpen;
+	m_handleClose = handleClose;
+	m_handleClientConnect = handleClientConnect;
+	m_handleClientDisconnect = handleClientDisconnect;
+	m_handleMessage = handleMessage;
+	m_handleOpenFailed = handleOpenFailed;
+	m_handleSendMessageFailed = handleSendMessageFailed;
+	m_handleReceiveMessageFailed = handleReceiveMessageFailed;
+}
+
+
+void PPSServerGlue::setVerbose(unsigned short v)
+{
+	m_interface.setVerbose(v);
+}
+
+bool PPSServerGlue::open(const std::string& path, int oflags)
+{
+	// Make sure we're creating the server, if it doesn't exist
+	if (!(oflags & O_CREAT))
+		oflags &= O_CREAT;
+
+	// We don't expose the "mode" to the JS layer - always create in 0666 mode
+	return m_interface.open(path, oflags, 0666, true);
+}
+
+void PPSServerGlue::close()
+{
+	m_interface.close();
+}
+
+void PPSServerGlue::sendMessage(const std::string& clientID, const std::string& msg)
+{
+	std::string decodedMsg = JSONDecodeData(msg);
+	std::string message(clientID + "\n" + decodedMsg);
+	m_interface.write(message);
+}
+
+void PPSServerGlue::broadcastMessage(const std::string& msg)
+{
+	m_interface.write(JSONDecodeData(msg));
+}
+
+void PPSServerGlue::onEvent(void* pArg, const PPSEvent& event)
+{
+	PPSServerGlue* pGlue = static_cast<PPSServerGlue*>(pArg);
+
+	if (pGlue != NULL)
+		pGlue->onEvent(event);
+}
+
+void PPSServerGlue::onEvent(const PPSEvent& event)
+{
+	callback* pFunc = NULL;
+	std::string sArg;
+
+	switch (event.getEventType()) {
+
+	case PPSEvent::PPS_EVENT_OPENED:
+		pFunc = m_handleOpen;
+		sArg = EVENT_OPEN;
+		break;
+
+	// The server doesn't do anything with this event
+	case PPSEvent::PPS_EVENT_FIRST_READ_COMPLETE:
+		break;
+
+	case PPSEvent::PPS_EVENT_NEW_DATA:
+	{
+		ppsObject data(event.getNewData());
+
+		// This means a new connection
+		if (data.flags & PPS_CREATED) {
+			sArg = EVENT_CLIENT_CONNECT;
+			pFunc = m_handleClientConnect;
+		}
+		// This means a connection is closed
+		else if (data.flags & PPS_DELETED) {
+			sArg = EVENT_CLIENT_DISCONNECT;
+			pFunc = m_handleClientDisconnect;
+		}
+		// We're getting data from the connection
+		else {
+			sArg = EVENT_MESSAGE;
+			pFunc = m_handleMessage;
+		}
+
+		sArg += " " + JSONEncodeData(data);
+
+		break;
+	}
+
+	case PPSEvent::PPS_EVENT_CLOSED:
+		pFunc = m_handleClose;
+		sArg = EVENT_CLOSE;
+		break;
+
+	case PPSEvent::PPS_EVENT_OPEN_FAILED:
+		pFunc = m_handleOpenFailed;
+		sArg = EVENT_OPEN_FAILED + " " + event.getMessage();
+		break;
+
+	case PPSEvent::PPS_EVENT_WRITE_FAILED:
+		pFunc = m_handleSendMessageFailed;
+		sArg = EVENT_SEND_MESSAGE_FAILED + " " + event.getMessage();
+		break;
+
+	case PPSEvent::PPS_EVENT_READ_FAILED:
+		pFunc = m_handleReceiveMessageFailed;
+		sArg = EVENT_RECEIVE_MESSAGE_FAILED + event.getMessage();
+		break;
+	}
+
+	if (pFunc != NULL)
+		pFunc(m_pArg, sArg);
+
+}
+
+std::string PPSServerGlue::JSONEncodeData(const ppsObject& ppsObj) const
+{
+	// If the ppsObj is empty, we can't encode it
+	if (ppsObj.name.empty())
+		return "";
+
+	Json::Value eventData(Json::nullValue);
+
+	// Set the client id
+	// Chop off the '+' or '-' if it's there
+	eventData[JSON_CONNECTION_ID] = ppsObj.name;
+
+	for (const_ppsAttrIter it = ppsObj.attributes.begin(); it != ppsObj.attributes.end(); it++) {
+
+		ppsAttribute ppsAttrib = (*it).second;
+
+		// The value is a number
+		if (ppsAttrib.encoding == ENCODING_N) {
+
+			// Convert the value to floating point
+			// istringstream is locale aware - we shouldn't need to perform any special
+			// processing in order to properly convert the data to a floating point
+			// TODO: test that the istringstream conversion works with a locale
+			//       that uses alternate floating point number encoding
+			std::istringstream stream(ppsAttrib.value);
+			double doubleValue;
+
+			// Try to convert the value to a floating point
+			if (!(stream >> doubleValue)) {
+
+				std::string err = EVENT_RECEIVE_MESSAGE_FAILED + " Failed to convert the string \"" + ppsAttrib.value + "\" to a real number.";
+				m_handleReceiveMessageFailed(m_pArg, err);
+				return "";
+			}
+
+			eventData[JSON_DATA][ppsAttrib.name] = doubleValue;
+		}
+		// The value is a boolean
+		else if (ppsAttrib.encoding == ENCODING_B) {
+
+			eventData[JSON_DATA][ppsAttrib.name] = (ppsAttrib.value == "true");
+		}
+		// The value is JSON data
+		else if (ppsAttrib.encoding == ENCODING_JSON) {
+
+			Json::Reader reader;
+			reader.parse(ppsAttrib.value, eventData[JSON_DATA][ppsAttrib.name]);
+		}
+		// Just pass the value through as a straight string
+		else {
+
+			eventData[JSON_DATA][ppsAttrib.name] = ppsAttrib.value;
+		}
+	}
+
+	Json::FastWriter writer;
+	return writer.write(eventData);
+}
+
+std::string PPSServerGlue::JSONDecodeData(const std::string& data) const
+{
+	 Json::Reader reader;
+	Json::Value root;
+
+	bool parsingSuccessful = reader.parse(data, root);
+
+	// If parsing the JSON string fails, return a write error
+	if (!parsingSuccessful) {
+
+		std::string err = EVENT_SEND_MESSAGE_FAILED + " JSON failed to parse the string (\"" + data + "\") to be written. (" + reader.getFormatedErrorMessages() + ")";
+		m_handleSendMessageFailed(m_pArg, err);
+		return "";
+	}
+
+	Json::Value::Members memberNames = root.getMemberNames();
+
+	std::ostringstream output;
+	output.precision(15);
+
+	Json::Value member;
+
+	for (unsigned int i = 0; i < memberNames.size(); i++) {
+
+		output << memberNames[i] << ":";
+		member = root[memberNames[i]];
+
+		if (member.isObject() || member.isArray()) {
+
+			Json::FastWriter writer;
+			output << ENCODING_JSON << ":" << writer.write(member);
+		}
+		else if (member.isBool()) {
+
+			output << ENCODING_B << ":" << member.asString();
+		}
+		else if (member.isNumeric()) {
+
+			output << ENCODING_N << ":" << member.asDouble();
+		}
+		else if (member.isString()) {
+
+			output << ":" << member.asString();
+		}
+		else {
+
+			std::string err = EVENT_SEND_MESSAGE_FAILED + " The string passed in (\"" + data + "\") contains an invalid JSON type.";
+			m_handleSendMessageFailed(m_pArg, err);
+			return "";
+		}
+
+		// Make sure we terminate the line
+		output << std::endl;
+	}
+
+	return output.str();
+}
+
+} /* namespace jpps */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.h
new file mode 100644
index 0000000..8891829
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PPSServerGlue.h
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PPSSERVERGLUE_H_
+#define PPSSERVERGLUE_H_
+
+#include "../core/PPSInterface.h"
+#include "PluginTypes.h"
+
+// Forward declaration
+namespace Json {
+class StaticString;
+}
+namespace jpps {
+class PPSEvent;
+struct ppsObject;
+}
+
+namespace jpps {
+
+/**
+ * Act as glue between jpps Server class an the PPSInterface.
+ * This class encapsulates a PPS object as a PPS server.
+ * TODO: write a better comment
+ */
+class PPSServerGlue {
+
+public:
+
+	/**
+	 * Constructor.
+	 */
+	PPSServerGlue();
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~PPSServerGlue();
+
+	/**
+	 * The browser plugin should set these handlers.
+	 *
+	 * @param pArg pArg will be passed back to each callback function when it is called.
+	 */
+	void callbackInit(void* pArg,
+					  callback* handleOpen,
+					  callback* handleClose,
+					  callback* handleClientConnect,
+					  callback* handleClientDisconnect,
+					  callback* handleMessage,
+					  callback* handleOpenFailed,
+					  callback* handleSendMessageFailed,
+					  callback* handleReceiveMessageFailed);
+
+	/**
+	 * Set the verbosity of logging to the slog.
+	 */
+	void setVerbose(unsigned short v);
+
+	/**
+	 * Open a PPS server object.
+	 */
+	bool open(const std::string& path, int oflags);
+
+	/**
+	 * Close this PPS server object.
+	 */
+	void close();
+
+	/**
+	 * Send a message to a particular client.
+	 */
+	void sendMessage(const std::string& clientID, const std::string& msg);
+
+	/**
+	 * Send a message to all clients.
+	 */
+	void broadcastMessage(const std::string& msg);
+
+	/**
+	 * The function that the PPSInterface will call when an event happens.
+	 * This is the static function that is used as a function pointer for
+	 * PPSInterface::setEventFunc().
+	 *
+	 * @param event The event PPSInterface is sending.
+	 * @param pArg A pointer to a PPSInterfaceGlue object, passed in during
+	 * object construction.
+	 */
+	static void onEvent(void* pArg, const PPSEvent& event);
+
+private:
+
+	/**
+	 * The static PPSInterfaceGlue::onEvent() calls this onEvent to do the actual work.
+	 */
+	void onEvent(const PPSEvent& event);
+
+	/**
+	 * Take a ppsObject and turn it into a JSON string to send back to the JavaScript
+	 * with a onMessage event.
+	 */
+	std::string JSONEncodeData(const ppsObject& ppsObj) const;
+
+	/**
+	 * Take a JSON string and change it into a PPS consumable string.
+	 */
+	std::string JSONDecodeData(const std::string& data) const;
+
+	// String names for the various events
+	static const std::string EVENT_OPEN;
+	static const std::string EVENT_CLOSE;
+	static const std::string EVENT_CLIENT_CONNECT;
+	static const std::string EVENT_CLIENT_DISCONNECT;
+	static const std::string EVENT_MESSAGE;
+	static const std::string EVENT_OPEN_FAILED;
+	static const std::string EVENT_SEND_MESSAGE_FAILED;
+	static const std::string EVENT_RECEIVE_MESSAGE_FAILED;
+
+	/** Custom PPS encoding value: an "n" means a real number. */
+	static const std::string ENCODING_N;
+	/** Custom PPS encoding value: a "b" means a boolean value. */
+	static const std::string ENCODING_B;
+	/** Custom PPS encoding value: the data is encoded using JSON. */
+	static const std::string ENCODING_JSON;
+
+	// JSON constants
+	static const Json::StaticString JSON_DATA;
+	static const Json::StaticString JSON_CONNECTION_ID;
+
+	/** The interface this object wraps. */
+	PPSInterface m_interface;
+
+	// Handlers for various events
+	void* m_pArg;
+	callback* m_handleOpen;
+	callback* m_handleClose;
+	callback* m_handleClientConnect;
+	callback* m_handleClientDisconnect;
+	callback* m_handleMessage;
+	callback* m_handleOpenFailed;
+	callback* m_handleSendMessageFailed;
+	callback* m_handleReceiveMessageFailed;
+
+};
+
+} /* namespace jpps */
+#endif /* PPSSERVERGLUE_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PluginTypes.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PluginTypes.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PluginTypes.h
new file mode 100644
index 0000000..9ce6b32
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/PluginTypes.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef PLUGINTYPES_H_
+#define PLUGINTYPES_H_
+
+namespace jpps {
+
+/**
+ * Function type for setting handles between JNext plug-in and glue classes.
+ */
+typedef void (callback)(void* pArg, const std::string&);
+
+}
+
+
+#endif /* PLUGINTYPES_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/pluginManifest.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/pluginManifest.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/pluginManifest.cpp
new file mode 100644
index 0000000..e06ad4c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/plugin/pluginManifest.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#include "JPPSPlugin.h"
+#include "JPPSServerPlugin.h"
+
+#include <string>
+
+/**
+ * This callback must be implemented by all JSExt objects. It is invoked from
+ * plugin.cpp.
+ *
+ * @return A comma separated list of classes supported by this JNEXT extension
+ */
+char* onGetObjList(void)
+{
+	static char* ppsclasses = NULL;
+
+	if (ppsclasses == NULL) {
+
+		// Get the length of all the strings, +1 for the ',' +1 for the \0
+		int size = std::strlen(jpps::JPPSPlugin::CLASS_NAME) + std::strlen(jpps::JPPSServerPlugin::CLASS_NAME) + 1 + 1;
+		ppsclasses = new char[size];
+		std::strcpy(ppsclasses, jpps::JPPSPlugin::CLASS_NAME);
+		std::strcat(ppsclasses, ",");
+		std::strcat(ppsclasses, jpps::JPPSServerPlugin::CLASS_NAME);
+		ppsclasses[size] = '\0';
+	}
+    // Return a comma separated list of classes known to this plugin
+    return ppsclasses;
+}
+
+/**
+ * This callback must be implemented by all JSExt objects. It is invoked from
+ * plugin.cpp.
+ *
+ * @param strClassName Name of the class requested to be created Valid named are those
+ * that are returned in onGetObjList
+ *
+ * @param strObjId The unique object id for the class
+ *
+ * @return A pointer to the created extension object
+ */
+JSExt* onCreateObject(const std::string& strClassName, const std::string& strObjId)
+{
+    // Given a class name and identifier, create the relevant object.
+    if (strClassName == jpps::JPPSPlugin::CLASS_NAME) {
+        return new jpps::JPPSPlugin(strObjId);;
+    }
+    else if (strClassName == jpps::JPPSServerPlugin::CLASS_NAME) {
+    	return new jpps::JPPSServerPlugin(strObjId);
+    }
+
+    // Any other name is invalid
+    return NULL;
+}
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Logger.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Logger.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Logger.h
new file mode 100644
index 0000000..37a9d17
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Logger.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef LOGGER_H_
+#define LOGGER_H_
+
+#include <string>
+
+#include <sys/slog.h>
+#include <sys/slogcodes.h>
+
+namespace jpps {
+
+/**
+ * The Logger class writes messages to the system log. It has a verbosity setting
+ * in order to prevent cluttering the slog during normal operation.
+ */
+class Logger {
+
+public:
+
+	enum slogType {
+		info = _SLOG_INFO,
+		warning = _SLOG_WARNING,
+		error = _SLOG_ERROR,
+		critical = _SLOG_CRITICAL,
+		debug = _SLOG_DEBUG1
+	};
+
+	/**
+	 * Default constructor. Sets the verbosity to 0;
+	 */
+	Logger() : m_verbosity(0) {}
+
+	/**
+	 * Destructor.
+	 */
+	~Logger() {}
+
+	/**
+	 * Set the desired level of verbosity. A value of 0 means that only warning,
+	 * error and critical messages will appear in the slog. A verbosity of 1 adds
+	 * info messages. A verbosity of 2 adds debug messages.
+	 */
+	inline void setVerbosity(unsigned short value) { m_verbosity = value; }
+
+	/**
+	 * Get the current level of verbosity.
+	 */
+	inline unsigned short getVerbosity() const { return m_verbosity; }
+
+	/**
+	 * Used to send messages to the system log (slog).
+	 *
+	 * @param type The type of slog message.
+	 * @param message The message to put in the slog.
+	 */
+	void slog(const slogType& type, const std::string& message) const {
+
+		// Don't display info or debug when verbosity is set to 0
+		if (m_verbosity == 0 && (type == info || type == debug)) return;
+		// Don't display debug when verbosity is set to 1
+		if (m_verbosity == 1 && type == debug) return;
+
+		::slogf(_SLOG_SETCODE(_SLOGC_GRAPHICS, 300), type, "%s", message.c_str());
+	}
+
+private:
+
+	/** The verbosity level.  */
+	unsigned short m_verbosity;
+};
+
+}
+
+#endif /* LOGGER_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.cpp
new file mode 100644
index 0000000..82ab5d1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+#include "Thread.h"
+#include <pthread.h>
+#include "Logger.h"
+#include <sstream>
+#include <string.h>
+#include <errno.h>
+
+namespace jpps {
+
+Thread::Thread()
+: m_threadID(-1)
+{
+	// Init the thread with all defaults
+	pthread_attr_init(&m_attrib);
+}
+
+Thread::~Thread()
+{
+	// Dispose of the thread attributes
+	pthread_attr_destroy(&m_attrib);
+}
+
+void Thread::start(void* (*start_routine)(void*), void* arg, const std::string& thread_name)
+{
+	// If this thread is already started, you can't start a new one
+	if (m_threadID != -1) {
+		return;
+	}
+
+	// Create a new thread
+	if (pthread_create(&m_threadID, &m_attrib, start_routine, arg) != 0) {
+
+		std::ostringstream ostream;
+		ostream << "Thread::start() Failed - Failed to create a new thread. "
+				<< " (" << errno << ": " << strerror(errno) << ")";
+
+		Logger logger;
+		logger.slog(Logger::warning, ostream.str());
+	}
+
+	if (!thread_name.empty())
+		pthread_setname_np(m_threadID, thread_name.c_str());
+}
+
+void Thread::stop()
+{
+	// If the thread wasn't running, we can't stop it
+	if (m_threadID == -1) {
+		return;
+	}
+
+	// Cancel the thread
+	if (pthread_cancel(m_threadID) != 0) {
+
+		std::ostringstream ostream;
+		ostream << "Thread::stop() Failed - Failed to cancel thread " << m_threadID << "."
+				<< " (" << errno << ": " << strerror(errno) << ")";
+
+		Logger logger;
+		logger.slog(Logger::warning, ostream.str());
+	}
+
+	// Reset the thread ID
+	m_threadID = -1;
+}
+
+} /* namespace jpps */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.h
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.h b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.h
new file mode 100644
index 0000000..79cc62a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/JPPS/native/src/utils/Thread.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
+ */
+
+/*
+ * $QNXLicenseC:
+ * Copyright 2009, QNX Software Systems. All Rights Reserved.
+ *
+ * You must obtain a written license from and pay applicable license fees to QNX
+ * Software Systems before you may reproduce, modify or distribute this software,
+ * or any work that includes all or part of this software.   Free development
+ * licenses are available for evaluation and non-commercial purposes.  For more
+ * information visit http://licensing.qnx.com or email licensing@qnx.com.
+ *
+ * This file may contain contributions from others.  Please review this entire
+ * file for other proprietary rights or license notices, as well as the QNX
+ * Development Suite License Guide at http://licensing.qnx.com/license-guide/
+ * for other information.
+ * $
+ */
+
+#ifndef THREAD_H_
+#define THREAD_H_
+
+#include <sys/types.h>
+#include <string>
+
+namespace jpps {
+
+/**
+ * Simple wrapper to simplify thread management.
+ */
+class Thread {
+
+public:
+
+	/**
+	 * Constructor.
+	 */
+	Thread();
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~Thread();
+
+	/**
+	 * Start a thread with the given function. If the thread is already running and has not
+	 * been stopped, this does nothing.
+	 */
+	void start(void* (*start_routine)(void*), void* arg, const std::string& thread_name = "");
+
+	/**
+	 * Stop the thread. If the thread isn't running, this does nothing.
+	 */
+	void stop();
+
+	/**
+	 * Is the thread running?
+	 */
+	inline bool isRunning() const { return (m_threadID >= 0); }
+
+private:
+
+	/** The id of this thread. */
+	pthread_t m_threadID;
+
+	/** The attributes of this thread. */
+	pthread_attr_t m_attrib;
+};
+
+} /* namespace jpps */
+#endif /* THREAD_H_ */

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Logger/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Logger/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Logger/index.js
new file mode 100644
index 0000000..497f477
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Logger/index.js
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2010-2011 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 = {
+    logLevel: function (success, fail, args, env) {
+        var result = new PluginResult(args, env),
+            level = JSON.parse(decodeURIComponent(args[0])),
+            message = JSON.parse(decodeURIComponent(args[1]));
+        console.log(level + ": " + message);
+        result.noResult(false);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/NetworkStatus/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/NetworkStatus/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/NetworkStatus/index.js
new file mode 100644
index 0000000..5a991fe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/NetworkStatus/index.js
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+//map from BB10 to cordova connection types:
+//https://github.com/apache/cordova-js/blob/master/lib/common/plugin/Connection.js
+function mapConnectionType(con) {
+    switch (con.type) {
+    case 'wired':
+        return 'ethernet';
+    case 'wifi':
+        return 'wifi';
+    case 'none':
+        return 'none';
+    case 'cellular':
+        switch (con.technology) {
+        case 'edge':
+        case 'gsm':
+            return '2g';
+        case 'evdo':
+            return '3g';
+        case 'umts':
+            return '3g';
+        case 'lte':
+            return '4g';
+        }
+        return "cellular";
+    }
+    return 'unknown';
+}
+
+function currentConnectionType() {
+    try {
+        //possible for webplatform to throw pps exception
+        return mapConnectionType(window.qnx.webplatform.device.activeConnection || { type : 'none' });
+    }
+    catch (e) {
+        return 'unknown';
+    }
+}
+
+module.exports = {
+    getConnectionInfo: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        result.ok(currentConnectionType());
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Notification/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Notification/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Notification/index.js
new file mode 100644
index 0000000..497170b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Notification/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) : null
+            }, 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-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/SplashScreen/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/SplashScreen/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/SplashScreen/index.js
new file mode 100644
index 0000000..bd7e48c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/SplashScreen/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-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/Makefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/Makefile b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/Makefile
new file mode 100644
index 0000000..0cc5eae
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)


[36/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Util.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Util.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Util.java
new file mode 100644
index 0000000..340876e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Util.java
@@ -0,0 +1,721 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.globalization;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.TimeZone;
+
+import net.rim.device.api.i18n.DateFormat;
+import net.rim.device.api.i18n.Locale;
+import net.rim.device.api.i18n.SimpleDateFormat;
+import net.rim.device.api.system.NonPersistableObjectException;
+import net.rim.device.api.system.PersistentObject;
+import net.rim.device.api.system.PersistentStore;
+import net.rim.device.api.util.StringMatch;
+import net.rim.device.api.util.StringUtilities;
+import net.rim.device.api.compress.GZIPInputStream;
+
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.json4j.internal.Parser;
+import org.apache.cordova.util.StringUtils;
+import org.apache.cordova.util.Logger;
+
+public class Util {
+
+    /**
+     * Provides manual date string parsing
+     *
+     * @param d
+     *            Date string
+     * @param p
+     *            Pattern string
+     * @return Calendar
+     */
+    public static Calendar dateParserBB(String d, String p) {
+        String time = "";
+        String date = d;
+        String delimiter = Resources.DATEDELIMITER; // "-"
+        try {
+            // replace '/' with '-' (to compensate for delimiters '/' and '-' in
+            // string)
+            date = date.replace('/', '-');
+
+            // extract time first
+            if (date.indexOf(':') > 0) {
+                time = date.substring(date.indexOf(':') - 2, date.length())
+                        .trim();
+                date = date.substring(0, date.indexOf(':') - 2).trim();
+            }
+
+            // determine string delimiter
+            if (date.indexOf(delimiter) == -1) { // is not in short format
+                delimiter = Resources.SPACE; // " "
+            }
+
+            // split date into sections
+            JSONArray str = Util.split(date, delimiter);
+            if (str == null) {
+                throw new Exception(); // incorrect format
+            }
+
+            // remove day of week and other unwanted characters -- will
+            // automatically be set in calendar object
+            str = Util.removeDayOfWeek(str);
+
+            // convert month string into integer: if applicable
+            str = Util.convertMonthString(str);
+
+            // use pattern to determine order of dd, mm, yyyy. If no pattern
+            // will use Locale Default order
+            Hashtable patternFmt = Util.getDatePattern(p);
+
+            // create calendar object
+            Calendar c = Calendar.getInstance(TimeZone.getDefault());
+
+            // set calendar instance:
+            c.set(Calendar.YEAR, Integer.parseInt(removeSymbols(str
+                    .getString(Integer.parseInt(patternFmt.get("year")
+                            .toString())))));
+            c.set(Calendar.MONTH, Integer.parseInt(removeSymbols(str
+                    .getString(Integer.parseInt(patternFmt.get("month")
+                            .toString())))));
+            c.set(Calendar.DAY_OF_MONTH, Integer.parseInt(removeSymbols(str
+                    .getString(Integer.parseInt(patternFmt.get("day")
+                            .toString())))));
+
+            // set time if applicable
+            if (time.length() > 0) {
+                JSONArray t = Util.split(time, Resources.TIMEDELIMITER);
+                // determine if 12hour or 24hour clock
+                int am_pm = getAmPm(t.getString(t.length() - 1).toString());
+                if (!t.isNull(0)) {
+                    c.set(Calendar.HOUR,
+                            Integer.parseInt(removeSymbols(t.getString(0))));
+                }
+                if (!t.isNull(1)) {
+                    c.set(Calendar.MINUTE,
+                            Integer.parseInt(removeSymbols(t.getString(1))));
+                }
+                if (!t.isNull(2)) {
+                    c.set(Calendar.SECOND,
+                            Integer.parseInt(removeSymbols(t.getString(2))));
+                }
+                if (am_pm != -1) {
+                    c.set(Calendar.AM_PM, am_pm);
+                }
+            }
+            return c;
+        } catch (Exception e) {
+        }
+        return null;
+    }
+
+    /**
+     * Returns a pattern string for formatting and parsing dates according to
+     * the client's user preferences.
+     *
+     * @param options
+     *            JSONArray options (user pattern)
+     *
+     * @return String (String}: The date and time pattern for formatting and
+     *         parsing dates. The patterns follow Unicode Technical Standard #35
+     *         http://unicode.org/reports/tr35/tr35-4.html
+     *
+     * @throws GlobalizationError
+     */
+    public static String getBlackBerryDatePattern(JSONArray options)
+            throws GlobalizationError {
+
+        try {
+            // default user preference for date
+            String fmtDate = ((SimpleDateFormat) DateFormat
+                    .getInstance(DateFormat.DATE_SHORT)).toPattern();
+            // default user preference for time
+            String fmtTime = ((SimpleDateFormat) DateFormat
+                    .getInstance(DateFormat.TIME_SHORT)).toPattern();
+            // default SHORT date/time format. ex. dd/MM/yyyy h:mma
+            String fmt = fmtDate + Resources.SPACE + fmtTime;
+
+            // get Date value + options (if available)
+            if (options.getJSONObject(0).length() > 1) {
+                // options were included. get formatLength option
+                if (!((JSONObject) options.getJSONObject(0).get(
+                        Resources.OPTIONS)).isNull(Resources.FORMATLENGTH)) {
+                    String fmtOpt = (String) ((JSONObject) options
+                            .getJSONObject(0).get(Resources.OPTIONS))
+                            .get(Resources.FORMATLENGTH);
+                    // medium
+                    if (fmtOpt.equalsIgnoreCase(Resources.MEDIUM)) {
+                        // default user preference for date
+                        fmtDate = ((SimpleDateFormat) DateFormat
+                                .getInstance(DateFormat.DATE_MEDIUM))
+                                .toPattern();
+                        // default user preference for time
+                        fmtTime = ((SimpleDateFormat) DateFormat
+                                .getInstance(DateFormat.TIME_MEDIUM))
+                                .toPattern();
+                    } else if (fmtOpt.equalsIgnoreCase(Resources.LONG)) { // long/full
+                        // default user preference for date
+                        fmtDate = ((SimpleDateFormat) DateFormat
+                                .getInstance(DateFormat.DATE_LONG)).toPattern();
+                        // default user preference for time
+                        fmtTime = ((SimpleDateFormat) DateFormat
+                                .getInstance(DateFormat.TIME_LONG)).toPattern();
+                    } else if (fmtOpt.equalsIgnoreCase(Resources.FULL)) { // long/full
+                        // default user preference for date
+                        fmtDate = ((SimpleDateFormat) DateFormat
+                                .getInstance(DateFormat.DATE_FULL)).toPattern();
+                        // default user preference for time
+                        fmtTime = ((SimpleDateFormat) DateFormat
+                                .getInstance(DateFormat.TIME_FULL)).toPattern();
+                    }
+                }
+
+                // return pattern type
+                fmt = fmtDate + Resources.SPACE + fmtTime;
+                if (!((JSONObject) options.getJSONObject(0).get(
+                        Resources.OPTIONS)).isNull(Resources.SELECTOR)) {
+                    String selOpt = (String) ((JSONObject) options
+                            .getJSONObject(0).get(Resources.OPTIONS))
+                            .get(Resources.SELECTOR);
+                    if (selOpt.equalsIgnoreCase(Resources.DATE)) {
+                        fmt = fmtDate;
+                    } else if (selOpt.equalsIgnoreCase(Resources.TIME)) {
+                        fmt = fmtTime;
+                    }
+                }
+            }
+            return fmt;
+        } catch (Exception ge) {
+        }
+        return null;
+    }
+
+    /**
+     * Returns a JSONArray of either the names of the months or days of the week
+     * according to the client's user preferences and calendar. Note: Months
+     * will be in order from Jan - Dec, while days of week will begin on random
+     * day due to Locale time differences of defined long date values
+     *
+     * @param item
+     *            String item (days of week or months)
+     * @param pattern
+     *            String pattern (pattern to parse item)
+     * @return JSONArray The array of names starting from either the first month
+     *         in the year or the first day of the week.
+     */
+    public static JSONArray getDateNameString(String item, String pattern) {
+        JSONArray value = new JSONArray();
+
+        // multipliers
+        long day = 1000 * 60 * 60 * 24; // 86,400,000
+        long startDay = day * 3; // starting three days in to avoid locale
+                                 // differences
+        long month = day * 31; // 2,678,400,000
+
+        SimpleDateFormat fmt = new SimpleDateFormat(pattern,
+                Locale.getDefault());
+        Date d = new Date();
+        try {
+            if (item.equalsIgnoreCase(Resources.MONTHS)) {
+                for (int x = 0; x < 13; x++) {
+                    d = new Date(startDay + (month * x));
+                    // testing short Month first
+                    if (!value.contains(fmt.format(d).toString())
+                            && !value.isEmpty()) {
+                        // add day into array
+                        value.put(fmt.format(d).toString());
+                    } else if (value.isEmpty()) {
+                        // Initialize array
+                        value.put(fmt.format(d).toString());
+                    }
+                }
+            } else { // Days
+                for (int x = 3; x < 11; x++) {
+                    d = new Date(day * x);
+                    // testing short day first
+                    if (!value.contains(fmt.format(d).toString())
+                            && !value.isEmpty()) {
+                        // add day into array
+                        value.put(fmt.format(d).toString());
+                    } else if (value.isEmpty()) {
+                        // Initialize array
+                        value.put(fmt.format(d).toString());
+                    }
+                }
+            }
+            return value;
+        } catch (Exception e) {
+        }
+        return null;
+    }
+
+    /**
+     * Parses a String formatted as a percent or currency removing the symbol
+     * returns the corresponding number.
+     *
+     * @return String Corresponding number
+     *
+     * @throws Exception
+     */
+    public static String removeSymbols(String s) throws Exception {
+        StringBuffer sb = new StringBuffer(s.trim());
+        try {
+            // begin removing all characters before string
+            for (int x = 0; x < sb.length(); x++) {
+                if (Character.isDigit(sb.charAt(x))) {
+                    x = sb.length() - 1; // end loop
+                } else {
+                    sb.deleteCharAt(x);
+                }
+            }
+            // begin removing all characters after string
+            for (int x = sb.length() - 1; x > -1; x--) {
+                if (Character.isDigit(sb.charAt(x))) {
+                    x = 0; // end loop
+                } else {
+                    sb.deleteCharAt(x);
+                }
+            }
+            return sb.toString().trim();
+        } catch (Exception e) {
+        }
+        return null;
+    }
+
+    /**
+     * Splits string into a JSONArray Note: Other options are to use
+     * org.apache.cordova.util.StringUtils.split(String strString, String
+     * strDelimiter)
+     *
+     * @param s
+     *            String s (String to split)
+     * @param delimiter
+     *            String delimiter (String used to split s)
+     * @return JSONArray: String objects
+     */
+    public static JSONArray split(String s, String delimiter) {
+        JSONArray result = new JSONArray();
+        String str = s;
+        try {
+            int p = s.indexOf(delimiter);
+            if (p != -1) {
+                while (p != -1) {
+                    result.put(str.substring(0, p).trim());
+                    if (p + 1 <= str.length()) {
+                        str = str.substring(p + 1);
+                    } else {
+                        // delimiter is the last character in the string
+                        str = "";
+                        break;
+                    }
+                    p = str.indexOf(delimiter);
+                }
+                // add remaining characters if any
+                if (str.length() > 0) {
+                    result.put(str);
+                }
+                return result;
+            }
+            return null; // incorrect delimiter
+        } catch (Exception e) {
+        }
+        return null; // error thrown
+    }
+
+    /**
+     * If applicable; removes day of week and other unwanted characters from
+     * JSONArray
+     *
+     * @param s
+     *            JSONArray s (List of date properties)
+     *
+     * @return JSONArray:
+     *          [key: day], [int: position]
+     *          [key: month], [int: position]
+     *          [key: year], [int: position]
+     */
+    public static JSONArray removeDayOfWeek(JSONArray s) {
+        JSONArray str = s;
+        JSONArray list;
+        try {
+            // get week names in short format //$NON-NLS-1$
+            list = getDateNameString(Resources.DAYS, "EEE");
+
+            // remove day of week from JSONArray
+            for (int x = 0; x < str.length(); x++) {
+                // do manual checking due to short or long version of week
+                // validate entry is not already an int
+                if (!Character.isDigit(str.getString(x).charAt(0))) {
+                    // run though short weeks to get match and remove
+                    StringMatch sm;
+                    for (int y = 0; y < list.length(); y++) {
+                        sm = new StringMatch(list.getString(y));
+                        if (sm.indexOf(str.getString(x)) != -1) {// week found
+                            str.removeElementAt(x); // remove day of week
+                            return str;
+                        }
+                        // if end of list reached, load long version of names
+                        // and rerun loop
+                        if (y == list.length() - 1) {
+                            y = -1;
+                            // get week names in long format//$NON-NLS-1$
+                            list = getDateNameString(Resources.DAYS, "EEEE");
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+        }// exception caught, return initial JSONArray
+        return s;
+    }
+
+    /**
+     * If applicable; converts Month String into number
+     *
+     * @param s
+     *            JSONArray s (List of date properties)
+     *
+     * @return JSONArray:
+     *          [key: day], [int: position]
+     *          [key: month], [int: position]
+     *          [key: year], [int: position]
+     */
+    public static JSONArray convertMonthString(JSONArray s) {
+        JSONArray str = s;
+        JSONArray list;
+        try {
+            // get month names in short format
+            list = getDateNameString(Resources.MONTHS, "MMM");
+
+            // convert month string into integer if applicable
+            for (int x = 0; x < str.length(); x++) {
+                // do manual checking due to short or long version of months
+                // validate entry is not already an int
+                if (!Character.isDigit(str.getString(x).charAt(0))) {
+                    // run though short format months to get index number
+                    StringMatch sm;
+                    for (int y = 0; y < list.length(); y++) {
+                        sm = new StringMatch(list.getString(y));
+                        if (sm.indexOf(str.getString(x)) != -1) {// month found
+                            // replace string with integer
+                            str.setElementAt(String.valueOf(y), x);
+                            return str;
+                        }
+                        // if end of list reached load long version of names and
+                        // rerun loop
+                        if (y == list.length() - 1) {
+                            y = -1;
+                            // get month names in long format
+                            list = getDateNameString(Resources.MONTHS, "MMMM");
+                        }
+                    }
+                }
+            }
+            return str;
+        } catch (Exception e) {
+        }// exception caught, return initial JSONArray
+        return s;
+    }
+
+    /**
+     * Determine if am_pm present and return value. if not return -1
+     *
+     * @param time
+     *            String time (time string of date object)
+     *
+     * @return int
+     *          -1 = am_pm not present
+     *           0 = am
+     *           1 = pm
+     */
+    public static int getAmPm(String time) {
+        // multipliers
+        long am_pm = 0; // pm
+        long am_pm_12 = 43200000; // am
+        int value = 1;
+        boolean reloop = true;
+
+        Date d = new Date(am_pm);
+
+        for (int x = 0; x < Resources.AM_PMFORMATS.length; x++) {
+            SimpleDateFormat fmt = new SimpleDateFormat(
+                    Resources.AM_PMFORMATS[x], Locale.getDefault());
+
+            StringMatch sm = new StringMatch(fmt.format(d).toString());
+
+            if (sm.indexOf(time) != -1) {
+                return value;
+            }
+
+            if (x == Resources.AM_PMFORMATS.length - 1 && reloop) {
+                d = new Date(am_pm_12);
+                value = 0;
+                x = -1;
+                reloop = false;
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Returns Hashtable indicating position of dd, MM, and yyyy in string.
+     * Position will either be 0, 1, or 2
+     *
+     * @param p
+     *            String pattern
+     *
+     * @return Hashtable:
+     *          [key: day], [int: position]
+     *          [key: month], [int: position]
+     *          [key: year], [int: position]
+     *
+     * @throws Exception
+     */
+    public static Hashtable getDatePattern(String p) {
+        Hashtable result = new Hashtable();
+
+        if (p.length() <= 0) {
+            // default device preference for date
+            p = ((SimpleDateFormat) DateFormat
+                    .getInstance(DateFormat.DATE_SHORT)).toPattern();
+        }
+
+        // get positions
+        int day = p.indexOf('d'); //$NON-NLS-1$
+        int month = p.indexOf('M'); //$NON-NLS-1$
+        int year = p.indexOf('y'); //$NON-NLS-1$
+        // int weekDay = p.indexOf('E'); //removed in removeDayOfWeek()
+
+        if (year < day && day < month) { // yyyy/dd/mmmm
+            year = 0;
+            day = 1;
+            month = 2;
+        } else if (day < month && month < year) { // dd/mm/yyyy
+            year = 2;
+            day = 0;
+            month = 1;
+        } else if (year < month && month < day) {// yyyy/mm/dd
+            year = 0;
+            day = 2;
+            month = 1;
+        } else if (month < day && day < year) { // mm/dd/yyyy
+            year = 2;
+            day = 1;
+            month = 0;
+        } else if (month < year && year < day) { // mm/yyyy/dd
+            year = 1;
+            day = 2;
+            month = 0;
+        } else if (day < year && year < month) { // dd/yyyy/mm
+            year = 1;
+            day = 0;
+            month = 2;
+        } else {
+            return null; // an error has occurred
+        }
+        result.put("day", String.valueOf(day)); //$NON-NLS-1$
+        result.put("month", String.valueOf(month)); //$NON-NLS-1$
+        result.put("year", String.valueOf(year)); //$NON-NLS-1$
+        return result;
+    }
+
+    /**
+     * Returns JSONObject of returnType('currency')
+     *
+     * @param _locale
+     *            String _locale (user supplied Locale.toString())
+     * @param code
+     *            String code (The ISO 4217 currency code)
+     *
+     * @return JSONObject: 'currency':
+     *              [key: currencyCodes], [String]
+     *              [key: currencyPattern], [String]
+     *              [key: currencyDecimal], [String]
+     *              [key: currencyFraction], [String]
+     *              [key: currencyGrouping], [String]
+     *              [key: currencyRounding], [String]
+     *
+     * @throws: Exception
+     */
+    public static JSONObject getCurrencyData(String _locale, String code) {
+        JSONObject result = null;
+        try {
+            JSONArray jsonArray;
+            result = getPersistentResourceBundle(_locale);
+            if (result == null) {
+                jsonArray = getResourceBundle(_locale).getJSONArray(
+                        Resources.JSON_CURRENCY);
+            } else {
+                jsonArray = result.getJSONArray(Resources.JSON_CURRENCY);
+            }
+
+            for (int x = 0; x < jsonArray.length(); x++) {
+                JSONObject temp = jsonArray.getJSONObject(x);
+                if (temp.get(Resources.CURRENCYCODE).toString()
+                        .equalsIgnoreCase(code)) {
+                    result = temp;
+                }
+            }
+        } catch (Exception e) {
+
+        }
+        return result;
+    }
+
+    /**
+     * Returns JSONObject of returnType('locale')
+     *
+     * @param _locale
+     *            String _locale (user supplied Locale.toString())
+     *
+     * @return JSONObject: 'locale':
+     *              [key: displayName], [String]
+     *              [key: firstDayOfWeek], [String]
+     *              [key: pattern], [String]
+     *              [key: decimalSymbol], [String]
+     *              [key: currencySymbol], [String]
+     *              [key: percentSymbol], [String]
+     *
+     * @throws Exception
+     */
+    public static JSONObject getLocaleData(String _locale) {
+        JSONObject result = null;
+        try {
+            result = getPersistentResourceBundle(_locale);
+            if (result == null) {
+                result = getResourceBundle(_locale).getJSONObject(
+                        Resources.JSON_LOCALE);
+            } else {
+                result = result.getJSONObject(Resources.JSON_LOCALE);
+            }
+        } catch (Exception e) {
+        }
+        return result;
+    }
+
+    /**
+     * Returns resourceBundle JSONObject cached in PersistentStore
+     *
+     * Note: Recursively searches JSONObject from persistentStore using
+     * Resources.PERSISTENTSTORE_ID for locale by removing sub-parts (separated
+     * by '_')
+     *
+     * @param _locale
+     *            String _locale (user supplied Locale.toString())
+     *
+     * @return JSONObject
+     */
+    private static JSONObject getPersistentResourceBundle(String _locale) {
+        JSONObject result = null;
+        try {
+            // load object
+            result = (JSONObject) PersistentStore.getPersistentObject(
+                    Resources.PERSISTENTSTORE_ID).getContents();
+        } catch (Exception e) {
+            if (StringUtilities.indexOf(_locale, '_', 0, _locale.length()) > 0) {
+                result = getPersistentResourceBundle(removeSubPart(StringUtils
+                        .split(_locale, "_"))); //$NON-NLS-1$
+            } else {
+                result = null;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Returns resourceBundle File as JSONObject from
+     * /resource/resourceBundles/<Locale.toString()>.js.gz
+     *
+     * Note: Recursively searches for locale by removing sub-parts (separated by
+     * '_')
+     *
+     * @param _locale
+     *            String _locale (user supplied Locale.toString())
+     *
+     * @return JSONObject
+     */
+    private static JSONObject getResourceBundle(String _locale) {
+        JSONObject result = null;
+
+        try {
+            if (_locale == null || _locale.length() <= 0) {
+                return null;
+            }
+
+            InputStream is = Util.class.getClass().getResourceAsStream(
+                    Resources.LOCALEINFOPATH + _locale
+                            + Resources.LOCALEINFOPATHEND);
+            Parser parser = new Parser(new InputStreamReader(
+                    new GZIPInputStream(is), "UTF-8"));
+            result = parser.parse();
+
+            // cache resourceBundle as JSONOBJECT
+            // store new object
+            PersistentObject persist = PersistentStore
+                    .getPersistentObject(Resources.PERSISTENTSTORE_ID);
+            // Synchronize on the PersistentObject so that no other object can
+            // acquire the lock before we finish our commit operation.
+            synchronized (persist) {
+                persist.setContents((Hashtable) result);
+                persist.commit();
+            }
+        } catch (NonPersistableObjectException npoe) {
+            Logger.log("Globalization: Failed to persist locale: "
+                    + npoe.getMessage());
+        } catch (Exception e) {
+            // if resourceBundle not found, recursively search for file by
+            // removing substrings from name
+            if (StringUtilities.indexOf(_locale, '_', 0, _locale.length()) > 0) {
+                result = getResourceBundle(removeSubPart(StringUtils.split(
+                        _locale, "_"))); //$NON-NLS-1$
+            } else {
+                result = null;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Returns substring of resourceBundle with the last section removed. Ex.
+     * cs_CZ_PREEURO -> cs_CZ
+     *
+     * @param s
+     *            String[] s (Array of locale split by '_')
+     *
+     * @return JSONObject
+     */
+    private static String removeSubPart(String[] s) {
+        String result = "";
+        for (int x = 0; x < s.length - 1; x++) {
+            result += s[x];
+            if (x != s.length - 2) {// length - 2 to account for starting at
+                                    // zero
+                result += "_"; //$NON-NLS-1$
+            }
+        }
+        return result;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileTransfer.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileTransfer.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileTransfer.java
new file mode 100644
index 0000000..b0f089c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileTransfer.java
@@ -0,0 +1,473 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.http;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.HttpConnection;
+import javax.microedition.io.file.FileConnection;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.file.Entry;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.io.FileNotFoundException;
+import net.rim.device.api.io.http.HttpProtocolConstants;
+
+/**
+ * The FileTransfer plugin can be used to transfer files between the device and
+ * a remote server. The following actions are supported:
+ *
+ *      download - Download a file from a server to the device.
+ *      upload   - Upload a file from the device to a server.
+ */
+public class FileTransfer extends Plugin {
+    private static final String LOG_TAG = "FileTransfer: ";
+
+    /**
+     * Error codes
+     */
+    static int FILE_NOT_FOUND_ERR = 1;
+    static int INVALID_URL_ERR = 2;
+    static int CONNECTION_ERR = 3;
+
+    /**
+     * Possible actions
+     */
+    private static final String ACTION_DOWNLOAD = "download";
+    private static final String ACTION_UPLOAD = "upload";
+
+    private static final char SEPARATOR = '/';
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action
+     *            The action to execute.
+     * @param callbackId
+     *            The callback ID to be invoked upon action completion.
+     * @param args
+     *            JSONArry of arguments for the action.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+        String source = null;
+        String target = null;
+        PluginResult result = null;
+
+        try {
+            // Retrieve the source and target locations from the argument array.
+            source = args.isNull(0) ? null : args.getString(0).trim();
+            target = args.isNull(1) ? null : args.getString(1).trim();
+
+            if (source == null || source.length() == 0 || target == null
+                    || target.length() == 0) {
+                Logger.log(LOG_TAG + "Missing source or target");
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        "Missing source or target");
+            }
+        } catch (JSONException e) {
+            Logger.log(LOG_TAG + e.getMessage());
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                    "Invalid or missing parameter");
+        }
+
+        if (ACTION_UPLOAD.equals(action)) {
+            // Source needs to follow the file URI protocol so add "file:///"
+            // prefix if it doesn't exist.
+            if (!source.startsWith("file:///")) {
+                if (source.indexOf(SEPARATOR) != 0) {
+                    source = "file://" + SEPARATOR + source;
+                } else {
+                    source = "file://" + source;
+                }
+            }
+
+            FileUploader uploader = null;
+            try {
+                // Setup the options
+                String fileKey = getArgument(args, 2, "file");
+                String fileName = getArgument(args, 3, "image.jpg");
+                String mimeType = getArgument(args, 4, null);
+                JSONObject params = null;
+                JSONObject headers = null;
+                
+                if (args.length() > 5 && !args.isNull(5)) {
+                    params = args.getJSONObject(5);
+                }
+
+                if(args.length() > 8 && !args.isNull(8)){
+                    headers = args.getJSONObject(8);
+                }
+                uploader = new FileUploader();
+                FileUploadResult r = uploader.upload(source, target, fileKey,
+                        fileName, mimeType, params, headers);
+
+                int status = r.getResponseCode();
+                if (status < 200 || status > 399) {
+                    Logger.log(LOG_TAG + "HTTP Status " + status);
+                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, new Integer(status));
+                    return new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
+                }
+
+                result = new PluginResult(PluginResult.Status.OK,
+                        r.toJSONObject());
+            } catch (FileNotFoundException e) {
+                Logger.log(LOG_TAG + e.getMessage());
+                JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR,
+                        source, target, uploader);
+                result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                        error);
+            } catch (IllegalArgumentException e) {
+                Logger.log(LOG_TAG + e.getMessage());
+                JSONObject error = createFileTransferError(INVALID_URL_ERR,
+                        source, target, uploader);
+                result = new PluginResult(
+                        PluginResult.Status.MALFORMED_URL_EXCEPTION, error);
+            } catch (IOException e) {
+                Logger.log(LOG_TAG + e.getMessage());
+                JSONObject error = createFileTransferError(CONNECTION_ERR,
+                        source, target, uploader);
+                result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                        error);
+            } catch (JSONException e) {
+                Logger.log(LOG_TAG + e.getMessage());
+                result = new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        "Invalid or missing parameter");
+            }
+        } else if (ACTION_DOWNLOAD.equals(action)) {
+            result = download(source, target);
+        } else {
+            // invalid action
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION,
+                    LOG_TAG + "invalid action " + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Create an error object based on the passed in errorCode
+     *
+     * @param errorCode
+     *            the error
+     * @return JSONObject containing the error
+     */
+    private JSONObject createFileTransferError(int errorCode, String source,
+            String target) {
+        return createFileTransferError(errorCode, source, target,
+                (Integer) null);
+    }
+
+    /**
+     * Create an error object based on the passed in errorCode
+     *
+     * @param errorCode
+     *            the error
+     * @return JSONObject containing the error
+     */
+    private JSONObject createFileTransferError(int errorCode, String source,
+            String target, FileUploader fileUploader) {
+
+        Integer httpStatus = null;
+
+        if (fileUploader != null) {
+            httpStatus = fileUploader.getResponseCode();
+        }
+        return createFileTransferError(errorCode, source, target, httpStatus);
+    }
+
+    /**
+     * Create an error object based on the passed in errorCode
+     *
+     * @param errorCode
+     *            the error
+     * @return JSONObject containing the error
+     */
+    private JSONObject createFileTransferError(int errorCode, String source,
+            String target, HttpConnection connection) {
+
+        Integer httpStatus = null;
+
+        if (connection != null) {
+            try {
+                httpStatus = new Integer(connection.getResponseCode());
+            } catch (IOException e) {
+                Logger.log(LOG_TAG + " exception getting http response code "
+                        + e.toString());
+            }
+        }
+
+        return createFileTransferError(errorCode, source, target, httpStatus);
+    }
+
+    /**
+     * Create an error object based on the passed in errorCode
+     *
+     * @param errorCode
+     *            the error
+     * @return JSONObject containing the error
+     */
+    private JSONObject createFileTransferError(int errorCode, String source,
+            String target, Integer httpStatus) {
+        JSONObject error = null;
+        try {
+            error = new JSONObject();
+            error.put("code", errorCode);
+            error.put("source", source);
+            error.put("target", target);
+            if (httpStatus != null) {
+                error.put("http_status", httpStatus);
+            }
+        } catch (JSONException e) {
+            Logger.log(LOG_TAG + e.getMessage());
+        }
+        return error;
+    }
+
+    /**
+     * Recurse through a specified path and create any directories that do not
+     * already exist.
+     *
+     * @param path
+     *            directory path to recurse
+     * @throws IOException
+     */
+    private void createSubDirs(String path) throws IOException {
+        FileConnection outputStream = null;
+
+        try {
+            outputStream = (FileConnection) Connector.open(path,
+                    Connector.READ_WRITE);
+            if (!outputStream.exists()) {
+                int dirIndex = path.lastIndexOf(SEPARATOR, path.length() - 2);
+                // This code assumes file protocol is specified so stop
+                // recursion once "file:///" is hit.
+                if (dirIndex != -1 && dirIndex > 7) {
+                    createSubDirs(path.substring(0, dirIndex + 1));
+                }
+                outputStream.mkdir();
+            }
+        } finally {
+            try {
+                if (outputStream != null) {
+                    outputStream.close();
+                }
+            } catch (IOException e) {
+                Logger.log(LOG_TAG + e.getMessage());
+            }
+        }
+    }
+
+    /**
+     * Download a file from a given URL and save it to the specified location.
+     *
+     * @param source
+     *            URL of the server to receive the file
+     * @param target
+     *            Full path of the file on the file system
+     * @return JSONObject a file entry object in JSON form describing the
+     *         downloaded file.
+     */
+    private PluginResult download(String source, String target) {
+        HttpConnection httpConn = null;
+        FileConnection fileConn = null;
+        OutputStream outputStream = null;
+        String filename = null;
+        String path = null;
+
+        Logger.debug(LOG_TAG + "downloading " + source + " to " + target);
+
+        // Target needs to follow the file URI protocol so add "file:///"
+        // prefix if it doesn't exist.
+        if (!target.startsWith("file:///")) {
+            if (target.indexOf(SEPARATOR) != 0) {
+                target = "file://" + SEPARATOR + target;
+            } else {
+                target = "file://" + target;
+            }
+        }
+
+        // Parse the target filename and directory path. If the target does not
+        // specify a file name (only directory), try to get the file name from
+        // the source.
+        int dirIndex = target.lastIndexOf(SEPARATOR);
+        if (dirIndex == (target.length() - 1)) {
+            int srcdirIndex = source.lastIndexOf(SEPARATOR);
+            if (srcdirIndex != (source.length() - 1)) {
+                path = target;
+                filename = source.substring(srcdirIndex + 1);
+                target = path + filename;
+            }
+        } else if (dirIndex != -1) {
+            filename = target.substring(dirIndex + 1);
+            path = target.substring(0, dirIndex + 1);
+        }
+
+        // If no filename or path could be determined for the target, error out.
+        if (filename == null || path == null) {
+            Logger.log(LOG_TAG + "Target filename could not be determined.");
+            JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR,
+                    source, target);
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION, error);
+        }
+
+        try {
+            try {
+                // Create any directories in the path that do not already exist.
+                createSubDirs(path);
+
+                // Open connection to the target file.
+                fileConn = (FileConnection) Connector.open(target,
+                    Connector.READ_WRITE);
+            } catch (IOException e) {
+                Logger.log(LOG_TAG + "Failed to open target file: " + target);
+                JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source,
+                        target, httpConn);
+                return new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
+            }
+
+            // Create the target file if it doesn't exist, otherwise truncate.
+            if (!fileConn.exists()) {
+                fileConn.create();
+            } else {
+                fileConn.truncate(0);
+            }
+
+            // Open the http connection to the server.
+            try {
+                httpConn = HttpUtils.getHttpConnection(source);
+            } catch (IllegalArgumentException e) {
+                JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, httpConn);
+                return new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, error);
+            }
+            if (httpConn == null) {
+                Logger.log(LOG_TAG + "Failed to create http connection.");
+                // TODO separate malformed url from actual connection error
+                JSONObject error = createFileTransferError(CONNECTION_ERR,
+                        source, target);
+                return new PluginResult(
+                        PluginResult.Status.IO_EXCEPTION, error);
+            }
+
+            // Set the request headers
+            httpConn.setRequestMethod(HttpConnection.GET);
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_USER_AGENT,
+                    System.getProperty("browser.useragent"));
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_KEEP_ALIVE, "300");
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_CONNECTION, "keep-alive");
+
+            // Set the cookie
+            String cookie = HttpUtils.getCookie(source);
+            if (cookie != null) {
+                httpConn.setRequestProperty(
+                        HttpProtocolConstants.HEADER_COOKIE, cookie);
+            }
+
+            InputStream inputStream = httpConn.openInputStream();
+            int status = httpConn.getResponseCode();
+            if (status < 200 || status > 399) {
+                Logger.log(LOG_TAG + "HTTP Status " + status);
+                JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, httpConn);
+                return new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
+            }
+
+            outputStream = fileConn.openOutputStream();
+
+            // Read from the connection and write bytes to the file.
+            byte[] buffer = new byte[1024];
+            int bytesRead = 0;
+            while ((bytesRead = inputStream.read(buffer)) > 0) {
+                outputStream.write(buffer, 0, bytesRead);
+            }
+        } catch (IOException e) {
+            Logger.log(LOG_TAG + e.getMessage());
+            JSONObject error = createFileTransferError(CONNECTION_ERR, source,
+                    target, httpConn);
+            return new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
+        } catch (ClassCastException e) {
+            // in case something really funky gets passed in
+            Logger.log(LOG_TAG + e.getMessage());
+            JSONObject error = createFileTransferError(INVALID_URL_ERR, source,
+                    target, httpConn);
+            return new PluginResult(
+                    PluginResult.Status.MALFORMED_URL_EXCEPTION, error);
+        } catch (Throwable t) {
+            Logger.log(LOG_TAG + t.toString());
+            JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, httpConn);
+            return new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
+        } finally {
+            try {
+                if (httpConn != null) {
+                    httpConn.close();
+                }
+                if (outputStream != null) {
+                    outputStream.close();
+                }
+                if (fileConn != null) {
+                    fileConn.close();
+                }
+            } catch (IOException e) {
+                Logger.log(LOG_TAG + "IOException in finally: "
+                        + e.getMessage());
+            }
+        }
+
+        // create a new Entry
+        Entry entry = new Entry();
+        entry.setDirectory(false);
+        entry.setName(filename);
+        entry.setFullPath(target);
+
+        return new PluginResult(PluginResult.Status.OK, entry.toJSONObject());
+    }
+
+    /**
+     * Convenience method to read a parameter from the list of JSON args.
+     *
+     * @param args
+     *            the args passed to the Plugin
+     * @param position
+     *            the position to retrieve the arg from
+     * @param defaultString
+     *            the default to be used if the arg does not exist
+     * @return String with the retrieved value
+     */
+    private String getArgument(JSONArray args, int position,
+            String defaultString) {
+        String arg = defaultString;
+        if (args.length() >= position) {
+            arg = args.optString(position);
+            if (arg == null || "null".equals(arg)) {
+                arg = defaultString;
+            }
+        }
+        return arg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploadResult.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploadResult.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploadResult.java
new file mode 100644
index 0000000..4b00159
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploadResult.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.http;
+
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+/**
+ * Encapsulates the result and/or status of uploading a file to a remote server.
+ */
+public class FileUploadResult {
+
+    private long bytesSent = 0;         // bytes sent
+    private int responseCode = -1;      // HTTP response code
+    private String response = null;     // HTTP response
+
+    public long getBytesSent() {
+        return bytesSent;
+    }
+
+    public void setBytesSent(long bytes) {
+        this.bytesSent = bytes;
+    }
+
+    public int getResponseCode() {
+        return responseCode;
+    }
+
+    public void setResponseCode(int responseCode) {
+        this.responseCode = responseCode;
+    }
+
+    public String getResponse() {
+        return response;
+    }
+
+    public void setResponse(String response) {
+        this.response = response;
+    }
+
+    public JSONObject toJSONObject() throws JSONException {
+        return new JSONObject(
+                "{bytesSent:" + bytesSent +
+                ",responseCode:" + responseCode +
+                ",response:" + JSONObject.quote(response) + "}");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploader.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploader.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploader.java
new file mode 100644
index 0000000..75645c7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/FileUploader.java
@@ -0,0 +1,280 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.http;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.HttpConnection;
+import javax.microedition.io.file.FileConnection;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.io.FileNotFoundException;
+import net.rim.device.api.io.IOUtilities;
+import net.rim.device.api.io.MIMETypeAssociations;
+import net.rim.device.api.io.http.HttpProtocolConstants;
+import net.rim.device.api.ui.UiApplication;
+
+/**
+ * The FileUploader uses an HTTP multipart request to upload files on the
+ * device to a remote server.  It currently supports a single file per HTTP
+ * request.
+ */
+public class FileUploader {
+
+    /**
+     * Constants
+     */
+    private static final String BOUNDARY = "----0x2fc1b3ef7cecbf14L";
+    private static final String LINE_END = "\r\n";
+    private static final String TD = "--";
+
+    private Integer responseCode = null;
+
+    /**
+     * Uploads the specified file to the server URL provided using an HTTP
+     * multipart request.
+     * @param filePath      Full path of the file on the file system
+     * @param server        URL of the server to receive the file
+     * @param fileKey       Name of file request parameter
+     * @param fileName      File name to be used on server
+     * @param mimeType      Describes file content type
+     * @param params        key:value pairs of user-defined parameters
+     * @return FileUploadResult containing result of upload request
+     */
+    public FileUploadResult upload(String filePath, String server, String fileKey,
+            String fileName, String mimeType, JSONObject params, JSONObject headers)
+    throws FileNotFoundException, IllegalArgumentException, IOException {
+
+        Logger.log(this.getClass().getName() + ": uploading " + filePath + " to " + server);
+        FileUploadResult result = new FileUploadResult();
+
+        InputStream in = null;
+        OutputStream out = null;
+        FileConnection fconn = null;
+        HttpConnection httpConn = null;
+        try {
+            // open connection to the file
+            try {
+                fconn = (FileConnection)Connector.open(filePath, Connector.READ);
+            } catch (ClassCastException e) {
+                // in case something really funky gets passed in
+                throw new IllegalArgumentException("Invalid file path");
+            } catch (IOException e) {
+                throw new FileNotFoundException("Failed to open source file: " + filePath);
+            }
+            if (!fconn.exists()) {
+                throw new FileNotFoundException(filePath + " not found");
+            }
+
+            // determine mime type by
+            //     1) user-provided type
+            //     2) retrieve from file system
+            //     3) default to JPEG
+            if (mimeType == null) {
+                mimeType = MIMETypeAssociations.getMIMEType(filePath);
+                if (mimeType == null) {
+                    mimeType = HttpProtocolConstants.CONTENT_TYPE_IMAGE_JPEG;
+                }
+            }
+
+            // boundary messages
+            String boundaryMsg = getBoundaryMessage(fileKey, fileName, mimeType);
+            String lastBoundary = getEndBoundary();
+
+            // user-defined request parameters
+            String customParams = (params != null) ? getParameterContent(params) : "";
+            Logger.log(this.getClass().getName() + ": params=" + customParams);
+
+            // determine content length
+            long fileSize = fconn.fileSize();
+            Logger.log(this.getClass().getName() + ": " + filePath + " size=" + fileSize + " bytes");
+            long contentLength = fileSize +
+                (long)boundaryMsg.length() +
+                (long)lastBoundary.length() +
+                (long)customParams.length();
+
+            // get HttpConnection
+            httpConn = HttpUtils.getHttpConnection(server);
+            if (httpConn == null) {
+                throw new IOException("Failed to connect to " + server);
+            }
+            Logger.log(this.getClass().getName() + ": server URL=" + httpConn.getURL());
+
+            // set request headers
+            httpConn.setRequestMethod(HttpConnection.POST);
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_USER_AGENT,
+                    System.getProperty("browser.useragent"));
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_KEEP_ALIVE, "300");
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_CONNECTION, "keep-alive");
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_CONTENT_TYPE,
+                    HttpProtocolConstants.CONTENT_TYPE_MULTIPART_FORM_DATA + "; boundary=" + BOUNDARY);
+            httpConn.setRequestProperty(
+                    HttpProtocolConstants.HEADER_CONTENT_LENGTH,
+                    Long.toString(contentLength));
+
+            if(headers != null){
+                for(Enumeration e = headers.keys(); e.hasMoreElements();){
+                    String key = e.nextElement().toString();
+                    String value = headers.optString(key);
+                    Logger.log(this.getClass().getName() + ": key=" + key + " value=" + value);
+                    httpConn.setRequestProperty(key, value);
+                }    
+            }
+            
+            // set cookie
+            String cookie = HttpUtils.getCookie(server);
+            if (cookie != null) {
+                httpConn.setRequestProperty(HttpProtocolConstants.HEADER_COOKIE, cookie);
+                Logger.log(this.getClass().getName() + ": cookie=" + cookie);
+            }
+
+            // write...
+            out = httpConn.openDataOutputStream();
+
+            // parameters
+            out.write(customParams.getBytes());
+
+            // boundary
+            out.write(boundaryMsg.getBytes());
+
+            // file data
+            in = fconn.openInputStream();
+            byte[] data = IOUtilities.streamToBytes(in);
+            out.write(data);
+            in.close();
+
+            // end boundary
+            out.write(lastBoundary.getBytes());
+
+            // send request and get response
+            in = httpConn.openDataInputStream();
+            //int rc = httpConn.getResponseCode();
+            result.setResponse(new String(IOUtilities.streamToBytes(in)));
+            //result.setResponseCode(rc);
+            result.setBytesSent(contentLength);
+            Logger.log(this.getClass().getName() + ": sent " + contentLength + " bytes");
+        }
+        finally {
+
+            if (httpConn != null) {
+                result.setResponseCode(httpConn.getResponseCode());
+                responseCode = new Integer(httpConn.getResponseCode());
+            }
+
+            try {
+                if (fconn != null) fconn.close();
+                if (in != null) in.close();
+                if (out != null) out.close();
+                if (httpConn != null) httpConn.close();
+            }
+            catch (IOException e) {
+                Logger.log(this.getClass().getName() + ": " + e);
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * Sends an upload progress notification back to JavaScript engine.
+     * @param result        FileUploadResult containing bytes sent of total
+     * @param callbackId    identifier of callback function to invoke
+     */
+    protected void sendProgress(FileUploadResult result, final String callbackId) {
+        JSONObject o = null;
+        try {
+            o = result.toJSONObject();
+        }
+        catch (JSONException e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+            return;
+        }
+
+        // send a progress result
+        final PluginResult r = new PluginResult(PluginResult.Status.OK, o);
+        r.setKeepCallback(true);
+        UiApplication.getUiApplication().invokeAndWait(
+            new Runnable() {
+                public void run() {
+                    CordovaExtension.invokeSuccessCallback(callbackId, r);
+                }
+            }
+        );
+    }
+
+    /**
+     * Returns the boundary string that represents the beginning of a file
+     * in a multipart HTTP request.
+     * @param fileKey       Name of file request parameter
+     * @param fileName      File name to be used on server
+     * @param mimeType      Describes file content type
+     * @return string representing the boundary message in a multipart HTTP request
+     */
+    protected String getBoundaryMessage(String fileKey, String fileName, String mimeType) {
+        return (new StringBuffer())
+            .append(TD).append(BOUNDARY).append(LINE_END)
+            .append("Content-Disposition: form-data; name=\"").append(fileKey)
+            .append("\"; filename=\"").append(fileName).append("\"").append(LINE_END)
+            .append("Content-Type: ").append(mimeType).append(LINE_END)
+            .append(LINE_END)
+            .toString();
+    }
+
+    /**
+     * Returns the boundary string that represents the end of a file in a
+     * multipart HTTP request.
+     * @return string representing the end boundary message in a multipart HTTP request
+     */
+    protected String getEndBoundary() {
+        return LINE_END + TD + BOUNDARY + TD + LINE_END;
+    }
+
+    /**
+     * Returns HTTP form content containing specified parameters.
+     */
+    protected String getParameterContent(JSONObject params) {
+        StringBuffer buf = new StringBuffer();
+        for (Enumeration e = params.keys(); e.hasMoreElements();) {
+            String key = e.nextElement().toString();
+            String value = params.optString(key);
+            buf.append(TD).append(BOUNDARY).append(LINE_END)
+                .append("Content-Disposition: form-data; name=\"").append(key).append("\"")
+                .append(LINE_END).append(LINE_END)
+                .append(value).append(LINE_END);
+        }
+        return buf.toString();
+    }
+
+    Integer getResponseCode() {
+        return responseCode;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/HttpUtils.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/HttpUtils.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/HttpUtils.java
new file mode 100644
index 0000000..af6ada6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/http/HttpUtils.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.http;
+
+import javax.microedition.io.HttpConnection;
+
+import org.apache.cordova.CordovaExtension;
+
+import net.rim.device.api.io.transport.ConnectionDescriptor;
+import net.rim.device.api.io.transport.ConnectionFactory;
+
+/**
+ * BlackBerry devices can connect to the network using a variety of transport
+ * types, such as: WI-FI, BES/MDS, BIS, WAP (cellular).  A connection URL must
+ * have the appropriate suffix to match the transport type.  This class contains
+ * utility methods to retrieve the correct URL for the appropriate transport.
+ */
+public class HttpUtils
+{
+    /**
+     * This method will open an HTTP connection over the best available transport type.
+     * @param url   Connection URL
+     */
+    public static HttpConnection getHttpConnection(String url)
+    {
+        HttpConnection httpConn = null;
+
+        // Create ConnectionFactory
+        ConnectionFactory factory = new ConnectionFactory();
+
+        // use the factory to get a connection
+        ConnectionDescriptor conDescriptor = factory.getConnection(url);
+
+        if (conDescriptor != null) {
+           // using the connection
+           httpConn = (HttpConnection) conDescriptor.getConnection();
+        }
+
+        return httpConn;
+    }
+
+    /**
+     * Retrieves the cookie from the application browser instance for the specified URL.
+     * @param url   Connection URL
+     */
+    public static String getCookie(String url)
+    {
+        return CordovaExtension.getBrowserField().getCookieManager().getCookie(url);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSON.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSON.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSON.java
new file mode 100644
index 0000000..adbe514
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSON.java
@@ -0,0 +1,208 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+import org.apache.cordova.json4j.internal.JSON4JPBackReader;
+
+/**
+ * Helper class that does generic parsing of a JSON stream and returns the appropriate
+ * JSON structure (JSONArray or JSONObject).  Note that it is slightly more efficient to directly
+ * parse with the appropriate object than to use this class to do a generalized parse.
+ */
+public class JSON {
+
+    /**
+     * A constant for representing null.
+     * In this case, it is just null.
+     */
+    public static final Object NULL = null;
+
+    /**
+     * Parse a Reader of JSON text into a JSONArtifact.
+     * @param reader The character reader to read the JSON data from.
+     * @param order Boolean flag indicating if the order of the JSON data should be preserved.  This parameter only has an effect if the stream is JSON Object { ... } formatted data.
+     * Note:  The provided reader is not closed on completion of read; that is left to the caller.
+     * Note:  This is the same as calling parse(reader, order, false);
+     *
+     * @return Returns an instance of JSONArtifact (JSONObject, OrderedJSONObject, or JSONArray), corrisponding to if the input stream was Object or Array notation.
+     *
+     * @throws JSONException Thrown on errors during parse.
+     * @throws NullPointerException Thrown if reader is null
+     */
+    public static JSONArtifact parse(Reader reader, boolean order) throws JSONException, NullPointerException {
+        return parse(reader,order,false);
+    }
+
+    /**
+     * Parse a Reader of JSON text into a JSONArtifact.
+     * @param reader The character reader to read the JSON data from.
+     * @param order Boolean flag indicating if the order of the JSON data should be preserved.  This parameter only has an effect if the stream is JSON Object { ... } formatted data.
+     * @param strict Boolean flag to indicate if the content should be parsed in strict mode or not, meaning comments and unquoted strings are not allowed.
+     * Note:  The provided reader is not closed on completion of read; that is left to the caller.
+     *
+     * @return Returns an instance of JSONArtifact (JSONObject, OrderedJSONObject, or JSONArray), corrisponding to if the input stream was Object or Array notation.
+     *
+     * @throws JSONException Thrown on errors during parse.
+     * @throws NullPointerException Thrown if reader is null
+     */
+    public static JSONArtifact parse(Reader reader, boolean order, boolean strict) throws JSONException, NullPointerException {
+
+        try {
+            if (reader != null) {
+
+                JSON4JPBackReader pReader = null;
+
+                //Determine if we should buffer-wrap the reader before passing it on
+                //to the appropriate parser.
+                //boolean bufferIt = false;
+
+                Class readerClass = reader.getClass();
+
+               /* if (!StringReader.class.isAssignableFrom(readerClass) &&
+                    !CharArrayReader.class.isAssignableFrom(readerClass) &&
+                    !PushbackReader.class.isAssignableFrom(readerClass) &&
+                    !BufferedReader.class.isAssignableFrom(readerClass)) {
+                    bufferIt = true;
+                } */
+
+                //MSN IMPLEMENT PUSHBACKREADER!!
+                if (JSON4JPBackReader.class.isAssignableFrom(readerClass)) {
+                    pReader = (JSON4JPBackReader) reader;
+                } else {
+                    pReader = new JSON4JPBackReader(reader);
+                }
+
+                Reader rdr = pReader;
+                int ch = pReader.read();
+                while (ch != -1) {
+                    switch (ch) {
+                        case '{':
+                            pReader.unread(ch);
+                           /* if (bufferIt) {
+                                rdr = new BufferedReader(pReader);
+                            } */
+                            return new JSONObject(rdr,strict);
+                        case '[':
+                            pReader.unread(ch);
+                            /*if (bufferIt) {
+                                rdr = new BufferedReader(pReader);
+                            } */
+                            return new JSONArray(rdr, strict);
+                        case ' ':
+                        case '\t':
+                        case '\f':
+                        case '\r':
+                        case '\n':
+                        case '\b':
+                            ch = pReader.read();
+                            break;
+                        default:
+                            throw new JSONException("Unexpected character: [" + (char)ch + "] while scanning JSON String for JSON type.  Invalid JSON.");
+                    }
+                }
+                throw new JSONException("Encountered end of stream before JSON data was read.  Invalid JSON");
+            } else {
+                throw new NullPointerException("reader cannot be null.");
+            }
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+    }
+
+    /**
+     * Parse a Reader of JSON text into a JSONArtifact.
+     * This call is the same as JSON.parse(reader, false, false).
+     * Note that the provided reader is not closed on completion of read; that is left to the caller.
+     * @param reader The character reader to read the JSON data from.
+     *
+     * @return Returns an instance of JSONArtifact (JSONObject, OrderedJSONObject, or JSONArray), corrisponding to if the input stream was Object or Array notation.
+     *
+     * @throws JSONException Thrown on errors during parse.
+     * @throws NullPointerException Thrown if reader is null
+     */
+    public static JSONArtifact parse(Reader reader) throws JSONException, NullPointerException {
+        return parse(reader,false, false);
+    }
+
+    /**
+     * Parse a InputStream of JSON text into a JSONArtifact.
+     * Note:  The provided InputStream is not closed on completion of read; that is left to the caller.
+     * @param is The input stream to read from.  The content is assumed to be UTF-8 encoded and handled as such.
+     * @param order Boolean flag indicating if the order of the JSON data should be preserved.  This parameter only has an effect if the stream is JSON Object { ... } formatted data.
+     *
+     * @return Returns an instance of JSONArtifact (JSONObject or JSONArray), corrisponding to if the input stream was Object or Array notation.
+     *
+     * @throws JSONException Thrown on errors during parse.
+     * @throws NullPointerException Thrown if reader is null
+     */
+    public static JSONArtifact parse(InputStream is, boolean order) throws JSONException, NullPointerException {
+        return parse(is,order, false);
+    }
+
+    /**
+     * Parse a InputStream of JSON text into a JSONArtifact.
+     * Note that the provided InputStream is not closed on completion of read; that is left to the caller.
+     * @param is The input stream to read from.  The content is assumed to be UTF-8 encoded and handled as such.
+     * @param order Boolean flag indicating if the order of the JSON data should be preserved.  This parameter only has an effect if the stream is JSON Object { ... } formatted data.
+     * @param strict Boolean flag to indicate if the content should be parsed in strict mode or not, meaning comments and unquoted strings are not allowed.
+     *
+     * @return Returns an instance of JSONArtifact (JSONObject or JSONArray), corrisponding to if the input stream was Object or Array notation.
+     *
+     * @throws JSONException Thrown on errors during parse.
+     * @throws NullPointerException Thrown if reader is null
+     */
+    public static JSONArtifact parse(InputStream is, boolean order, boolean strict) throws JSONException, NullPointerException {
+        if (is != null) {
+            //BufferedReader reader = null;
+            InputStreamReader reader = null;
+            try {
+                reader = new InputStreamReader(is, "UTF-8");
+            } catch (Exception ex) {
+                JSONException iox = new JSONException("Could not construct UTF-8 character reader for the InputStream");
+                iox.setCause(ex);
+                throw iox;
+            }
+            return parse(reader,order);
+        } else {
+            throw new NullPointerException("is cannot be null");
+        }
+    }
+
+    /**
+     * Parse an InputStream of JSON text into a JSONArtifact.
+     * This call is the same as JSON.parse(is, false, false).
+     * Note that the provided InputStream is not closed on completion of read; that is left to the caller.
+     * @param is The input stream to read from.  The content is assumed to be UTF-8 encoded and handled as such.
+     *
+     * @return Returns an instance of JSONArtifact (JSONObject, OrderedJSONObject, or JSONArray), corrisponding to if the input stream was Object or Array notation.
+     *
+     * @throws JSONException Thrown on errors during parse.
+     * @throws NullPointerException Thrown if reader is null
+     */
+    public static JSONArtifact parse(InputStream is) throws JSONException, NullPointerException {
+        return parse(is,false, false);
+    }
+}


[29/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/.gitignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/.gitignore b/lib/cordova-blackberry/blackberry10/.gitignore
new file mode 100644
index 0000000..f2802d1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/.gitignore
@@ -0,0 +1,27 @@
+# OS X
+
+.DS_Store
+
+# Eclipse
+
+deliverables/
+.preprocessed/
+
+# Text Editor Tmp
+
+._*
+
+# Generated libraries
+
+build/
+dist/
+bin/node_modules
+bin/templates/project/lib
+example/
+node_modules/
+
+# OS X
+
+.DS_Store
+
+tags

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/.jshint
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/.jshint b/lib/cordova-blackberry/blackberry10/.jshint
new file mode 100644
index 0000000..9f5611b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/.jshint
@@ -0,0 +1,3 @@
+{
+    "es5" : true
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/.jshintignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/.jshintignore b/lib/cordova-blackberry/blackberry10/.jshintignore
new file mode 100644
index 0000000..6bb2b92
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/.jshintignore
@@ -0,0 +1 @@
+bin/test/cordova/unit/params-bad.json

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/.npmignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/.npmignore b/lib/cordova-blackberry/blackberry10/.npmignore
new file mode 100644
index 0000000..db4145c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/.npmignore
@@ -0,0 +1,2 @@
+.gitignore
+.gitkeep

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/Jakefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/Jakefile b/lib/cordova-blackberry/blackberry10/Jakefile
new file mode 100644
index 0000000..81b2f6f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/Jakefile
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF
+ * or more contributor license agreements.  See th
+ * distributed with this work for additional infor
+ * regarding copyright ownership.  The ASF license
+ * to you under the Apache License, Version 2.0 (t
+ * "License"); you may not use this file except in
+ * with the License.  You may obtain a copy of the
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to
+ * software distributed under the License is distr
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * KIND, either express or implied.  See the Licen
+ * specific language governing permissions and lim
+ * under the License.
+ */
+
+var DESC_NEW_LINE = "\n\t\t      #";
+
+var util         = require('util'),
+    fs           = require('fs'),
+    childProcess = require('child_process'),
+    path         = require("path"),
+    rexp_minified = new RegExp("\\.min\\.js$"),
+    rexp_src = new RegExp('\\.js$');
+
+// HELPERS
+// Iterates over a directory
+function forEachFile(root, cbFile, cbDone) {
+    var count = 0;
+
+    function scan(name) {
+        ++count;
+
+        fs.stat(name, function (err, stats) {
+            if (err) cbFile(err);
+
+            if (stats.isDirectory()) {
+                fs.readdir(name, function (err, files) {
+                    if (err) cbFile(err);
+
+                    files.forEach(function (file) {
+                        scan(path.join(name, file));
+                    });
+                    done();
+                });
+            } else if (stats.isFile()) {
+                cbFile(null, name, stats, done);
+            } else {
+                done();
+            }
+        });
+    }
+
+    function done() {
+        --count;
+        if (count === 0 && cbDone) cbDone();
+    }
+
+    scan(root);
+}
+
+desc("runs test");
+task('default', ['hint','test'], function () {});
+
+desc("run all tests in node - jake test [path]");
+task('test', [], function () {
+    require('./scripts/test')(null, process.argv.length >= 4 ? process.argv[3] : null);
+});
+
+desc('check sources with JSHint');
+task('hint', ['complainwhitespace'], function () {
+    var knownWarnings = [
+        "Redefinition of 'FileReader'",
+        "Redefinition of 'require'",
+        "Read only",
+        "Redefinition of 'console'"
+    ];
+    var filterKnownWarnings = function(el, index, array) {
+        var wut = true;
+        // filter out the known warnings listed out above
+        knownWarnings.forEach(function(e) {
+            wut = wut && (el.indexOf(e) == -1);
+        });
+        wut = wut && (!el.match(/\d+ errors/));
+        return wut;
+    };
+
+    childProcess.exec("jshint framework/lib bin/lib bin/test bin/templates/project/cordova bin/templates/project/project.json --config .jshint --extra-ext .json",function(err,stdout,stderr) {
+        var exs = stdout.split('\n');
+        console.log(exs.filter(filterKnownWarnings).join('\n'));
+        complete();
+    });
+}, true);
+
+var complainedAboutWhitespace = false
+
+desc('complain about what fixwhitespace would fix');
+task('complainwhitespace', function() {
+    processWhiteSpace(function(file, newSource) {
+        if (!complainedAboutWhitespace) {
+            console.log("files with whitespace issues: (to fix: `jake fixwhitespace`)")
+            complainedAboutWhitespace = true
+        }
+
+        console.log("   " + file)
+    })
+}, true);
+
+desc('converts tabs to four spaces, eliminates trailing white space, converts newlines to proper form - enforcing style guide ftw!');
+task('fixwhitespace', function() {
+    processWhiteSpace(function(file, newSource) {
+        if (!complainedAboutWhitespace) {
+            console.log("fixed whitespace issues in:")
+            complainedAboutWhitespace = true
+        }
+
+        fs.writeFileSync(file, newSource, 'utf8');
+        console.log("   " + file)
+    })
+}, true);
+
+function processWhiteSpace(processor) {
+    forEachFile('framework', function(err, file, stats, cbDone) {
+        //if (err) throw err;
+        if (rexp_minified.test(file) || !rexp_src.test(file)) {
+            cbDone();
+        } else {
+            var origsrc = src = fs.readFileSync(file, 'utf8');
+
+            // tabs -> four spaces
+            if (src.indexOf('\t') >= 0) {
+                src = src.split('\t').join('    ');
+            }
+
+            // eliminate trailing white space
+            src = src.replace(/ +\n/g, '\n');
+
+            if (origsrc !== src) {
+                // write it out yo
+                processor(file, src);
+            }
+            cbDone();
+        }
+    }, complete);
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/LICENSE b/lib/cordova-blackberry/blackberry10/LICENSE
new file mode 100644
index 0000000..ee6a935
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/LICENSE
@@ -0,0 +1,268 @@
+
+                               Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+For the template/project/lib/ant-contrib/ant-contrib-1.0b3.jar component:
+
+   The Apache Software License, Version 1.1
+
+   Copyright (c) 2001-2003 Ant-Contrib project.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+   3. The end-user documentation included with the redistribution, if
+      any, must include the following acknowlegement:
+         "This product includes software developed by the
+          Ant-Contrib project (http://sourceforge.net/projects/ant-contrib)."
+      Alternately, this acknowlegement may appear in the software itself,
+      if and wherever such third-party acknowlegements normally appear.
+
+   4. The name Ant-Contrib must not be used to endorse or promote products
+      derived from this software without prior written permission. For
+      written permission, please contact
+      ant-contrib-developers@lists.sourceforge.net.
+
+   5. Products derived from this software may not be called "Ant-Contrib"
+      nor may "Ant-Contrib" appear in their names without prior written
+      permission of the Ant-Contrib project.
+
+   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED.  IN NO EVENT SHALL THE ANT-CONTRIB PROJECT OR ITS
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+   SUCH DAMAGE.
+   ====================================================================
+
+For the template/project/www/json2.js component:
+
+    http://www.JSON.org/json2.js
+    2010-03-20
+
+    Public Domain.
+
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+    See http://www.JSON.org/js.html
+
+
+    This code should be minified before deployment.
+    See http://javascript.crockford.com/jsmin.html
+
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+    NOT CONTROL.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/NOTICE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/NOTICE b/lib/cordova-blackberry/blackberry10/NOTICE
new file mode 100644
index 0000000..23360ce
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/NOTICE
@@ -0,0 +1,8 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org)
+
+This product includes software developed by
+Ant-Contrib project (http://sourceforge.net/projects/ant-contrib).

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/README.md b/lib/cordova-blackberry/blackberry10/README.md
new file mode 100644
index 0000000..8aaf204
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/README.md
@@ -0,0 +1,7 @@
+Cordova BlackBerry
+
+This repo contains cordova projects for the BlackBerry platforms:
+
+blackberry - BBOS 5+ and Tablet OS
+
+blackberry10 - BB10

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/VERSION b/lib/cordova-blackberry/blackberry10/VERSION
new file mode 100644
index 0000000..edf28ac
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/VERSION
@@ -0,0 +1 @@
+2.4.0rc1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/check_reqs
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/check_reqs b/lib/cordova-blackberry/blackberry10/bin/check_reqs
new file mode 100755
index 0000000..9a8e9ee
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/check_reqs
@@ -0,0 +1,28 @@
+#!/usr/bin/env node
+
+/**
+ * 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.
+ */
+
+var qnxHost = process.env.QNX_HOST;
+
+if (typeof qnxHost !== "undefined" && typeof process.env.QNX_TARGET !== "undefined" && process.env.PATH.indexOf(qnxHost) !== -1) {
+    process.exit(0);
+} else {
+    process.exit(-1);
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/check_reqs.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/check_reqs.bat b/lib/cordova-blackberry/blackberry10/bin/check_reqs.bat
new file mode 100755
index 0000000..9c8986e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/check_reqs.bat
@@ -0,0 +1,21 @@
+@ECHO OFF
+goto comment
+       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.
+:comment
+
+@node.exe %~dp0\check_reqs

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/create
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/create b/lib/cordova-blackberry/blackberry10/bin/create
new file mode 100755
index 0000000..87ce4c3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/create
@@ -0,0 +1,25 @@
+#! /bin/sh
+#       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.
+#
+# create a cordova/blackberry project
+#
+# USAGE
+#   ./create [path package appname]
+#
+#!/bin/sh
+node $( dirname "$0" )"/create.js" "$@"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/create.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/create.bat b/lib/cordova-blackberry/blackberry10/bin/create.bat
new file mode 100644
index 0000000..7b15594
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/create.bat
@@ -0,0 +1,21 @@
+@ECHO OFF
+goto comment
+       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.
+:comment
+
+node.exe %~dp0\create.js %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/create.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/create.js b/lib/cordova-blackberry/blackberry10/bin/create.js
new file mode 100644
index 0000000..1253dad
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/create.js
@@ -0,0 +1,168 @@
+/*
+ * 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.
+ */
+
+/*
+ * create a cordova/blackberry project
+ *
+ * USAGE
+ *  ./create [path package appname]
+ */
+
+var build,
+    path = require("path"),
+    fs = require("fs"),
+    wrench = require("wrench"),
+    jWorkflow = require("jWorkflow"),
+    utils = require(path.join(__dirname, 'lib/utils')),
+    version = getVersion(),
+    project_path = process.argv[2],
+    app_id = process.argv[3],
+    bar_name = process.argv[4],
+    template_project_dir = path.join(__dirname, "templates", "project"),
+    modules_project_dir = path.join(__dirname, "..", "node_modules"),
+    framework_project_dir = path.join(__dirname, "..", "framework"),
+    build_dir = path.join(__dirname, "build"),
+    update_dir = path.join(project_path, "lib", "cordova." + version),
+    js_src = path.join(__dirname, "..", "javascript"),
+    js_path = "javascript",
+    js_basename = "cordova-" + version + ".js";
+
+    function getVersion() {
+        var version = fs.readFileSync(__dirname + "/../VERSION");
+        if (version) {
+            return version.toString();
+        }
+    }
+
+    function validate() {
+        if (!project_path) {
+            throw "You must give a project PATH";
+        }
+        if (fs.existsSync(project_path)) {
+            throw "The project path must be an empty directory";
+        }
+        if (!validPackageName(app_id)) {
+            throw "App ID must be sequence of alpha-numeric (optionally seperated by '.') characters, no longer than 50 characters";
+        }
+        if (!validBarName(bar_name)) {
+            throw "BAR filename can only contain alpha-numeric, '.', '-' and '_' characters";
+        }
+    }
+
+    function validPackageName(packageName) {
+        var domainRegex = /^[a-zA-Z]([a-zA-Z0-9])*(\.[a-zA-Z]([a-zA-Z0-9])*)*$/;
+        if (typeof packageName !== "undefined") {
+            if ((packageName.length > 50) || !domainRegex.test(packageName)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    function validBarName(barName) {
+        var barNameRegex = /^[a-zA-Z0-9._-]+$/;
+        return (typeof barName === "undefined") || barNameRegex.test(barName);
+    }
+
+    function clean() {
+        if (fs.existsSync(build_dir)) {
+            wrench.rmdirSyncRecursive(build_dir);
+        }
+    }
+
+    function copyJavascript() {
+        wrench.mkdirSyncRecursive(build_dir + "/" + js_path, 0777);
+        utils.copyFile(path.join(js_src, "cordova.blackberry10.js"), path.join(build_dir, js_path));
+
+        //rename copied cordova.blackberry10.js file
+        fs.renameSync(path.join(build_dir, js_path, "cordova.blackberry10.js"), path.join(build_dir, js_path, js_basename));
+    }
+
+    function copyFilesToProject() {
+        // create project using template directory
+        wrench.mkdirSyncRecursive(project_path, 0777);
+        wrench.copyDirSyncRecursive(template_project_dir, project_path);
+
+        // change file permission for cordova scripts because ant copy doesn't preserve file permissions
+        wrench.chmodSyncRecursive(project_path + "/cordova", 0700);
+
+        //copy cordova-*version*.js to www
+        utils.copyFile(path.join(build_dir, js_path, js_basename), path.join(project_path, "www"));
+
+        //copy node modules to cordova build directory
+        wrench.mkdirSyncRecursive(project_path + "/cordova/node_modules", 0777);
+        wrench.copyDirSyncRecursive(modules_project_dir, path.join(project_path, "cordova", "node_modules"));
+        fs.chmodSync(project_path + "/cordova/node_modules/plugman/plugman.js", 0755);
+
+        //copy framework
+        wrench.copyDirSyncRecursive(framework_project_dir, path.join(project_path, "cordova", "framework"));
+
+        // save release
+        wrench.mkdirSyncRecursive(update_dir, 0777);
+        wrench.copyDirSyncRecursive(build_dir, update_dir);
+    }
+
+    function updateProject() {
+        var projectJson,
+            xmlString,
+            configXMLPath = path.resolve(project_path + "/www/config.xml");
+
+        if (typeof app_id !== "undefined") {
+            xmlString = fs.readFileSync(configXMLPath, "utf-8");
+            fs.writeFileSync(configXMLPath, xmlString.replace("default.app.id", app_id), "utf-8");
+        }
+
+        if (typeof bar_name !== "undefined") {
+            projectJson = require(path.resolve(project_path + "/project.json"));
+            projectJson.barName = bar_name;
+            fs.writeFileSync(path.join(project_path, "project.json"), JSON.stringify(projectJson, null, 4) + "\n", "utf-8");
+        }
+    }
+
+    function done(error) {
+        if (error) {
+            console.log("Project creation failed!\n" + "Error: " + error);
+            process.exit(1);
+        }
+        else {
+            process.exit();
+        }
+    }
+
+    if ( process.argv[2] === "-h" || process.argv[2] === "--help" ) {
+        console.log("\nUsage: create <project path> [package name [BAR filename]] \n");
+        console.log("Options: \n");
+        console.log("   -h, --help      output usage information \n");
+    } else {
+        try {
+            build = jWorkflow.order(validate)
+                .andThen(clean)
+                .andThen(copyJavascript)
+                .andThen(copyFilesToProject)
+                .andThen(updateProject)
+                .andThen(clean);
+
+            build.start(function (error) {
+                done(error);
+            });
+        } catch (ex) {
+            console.log(ex);
+        }
+    }
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/lib/localize.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/lib/localize.js b/lib/cordova-blackberry/blackberry10/bin/lib/localize.js
new file mode 100644
index 0000000..66bddfa
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/lib/localize.js
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+
+var Localize = require("localize"),
+    loc = new Localize({
+        "SOME_WARNING": {
+            "en": "You have disabled all web security in this WebWorks application"
+        }
+    }, "", ""); // TODO maybe a bug in localize, must set default locale to "" in order get it to work
+
+loc.setLocale("en");
+
+module.exports = loc;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/lib/utils.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/lib/utils.js b/lib/cordova-blackberry/blackberry10/bin/lib/utils.js
new file mode 100644
index 0000000..88dc619
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/lib/utils.js
@@ -0,0 +1,167 @@
+/*
+ *  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.
+ */
+
+var fs = require('fs'),
+    path = require('path'),
+    wrench = require('wrench'),
+    localize = require("./localize"),
+    os = require('os'),
+    _self;
+
+function swapBytes(buffer) {
+    var l = buffer.length,
+        i,
+        a;
+
+    if (l % 2 === 0x01) {
+        throw localize.translate("EXCEPTION_BUFFER_ERROR");
+    }
+
+    for (i = 0; i < l; i += 2) {
+        a = buffer[i];
+        buffer[i] = buffer[i + 1];
+        buffer[i + 1] = a;
+    }
+
+    return buffer;
+}
+
+_self = {
+    writeFile: function (fileLocation, fileName, fileData) {
+        //If directory does not exist, create it.
+        if (!fs.existsSync(fileLocation)) {
+            wrench.mkdirSyncRecursive(fileLocation, "0755");
+        }
+
+        fs.writeFile(path.join(fileLocation, fileName), fileData, function (err) {
+            if (err) throw err;
+        });
+    },
+
+    copyFile: function (srcFile, destDir, baseDir) {
+        var filename = path.basename(srcFile),
+            fileBuffer = fs.readFileSync(srcFile),
+            fileLocation;
+
+        //if a base directory was provided, determine
+        //folder structure from the relative path of the base folder
+        if (baseDir && srcFile.indexOf(baseDir) === 0) {
+            fileLocation = srcFile.replace(baseDir, destDir);
+            wrench.mkdirSyncRecursive(path.dirname(fileLocation), "0755");
+            fs.writeFileSync(fileLocation, fileBuffer);
+        } else {
+            if (!fs.existsSync(destDir)) {
+                wrench.mkdirSyncRecursive(destDir, "0755");
+            }
+
+            fs.writeFileSync(path.join(destDir, filename), fileBuffer);
+        }
+    },
+
+    listFiles: function (directory, filter) {
+        var files = wrench.readdirSyncRecursive(directory),
+            filteredFiles = [];
+
+        files.forEach(function (file) {
+            //On mac wrench.readdirSyncRecursive does not return absolute paths, so resolve one.
+            file = path.resolve(directory, file);
+
+            if (filter(file)) {
+                filteredFiles.push(file);
+            }
+        });
+
+        return filteredFiles;
+    },
+
+    isWindows: function () {
+        return os.type().toLowerCase().indexOf("windows") >= 0;
+    },
+
+    isArray: function (obj) {
+        return obj.constructor.toString().indexOf("Array") !== -1;
+    },
+
+    isEmpty : function (obj) {
+        for (var prop in obj) {
+            if (obj.hasOwnProperty(prop))
+                return false;
+        }
+        return true;
+    },
+
+    toBoolean: function (myString, defaultVal) {
+        // if defaultVal is not passed, default value is undefined
+        return myString === "true" ? true : myString === "false" ? false : defaultVal;
+    },
+
+    parseUri : function (str) {
+        var i, uri = {},
+            key = [ "source", "scheme", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor" ],
+            matcher = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(str);
+
+        for (i = key.length - 1; i >= 0; i--) {
+            uri[key[i]] = matcher[i] || "";
+        }
+
+        return uri;
+    },
+
+    // uri - output from parseUri
+    isAbsoluteURI : function (uri) {
+        if (uri && uri.source) {
+            return uri.relative !== uri.source;
+        }
+
+        return false;
+    },
+
+    isLocalURI : function (uri) {
+        return uri && uri.scheme && uri.scheme.toLowerCase() === "local";
+    },
+
+    // Convert node.js Buffer data (encoded) to String
+    bufferToString : function (data) {
+        var s = "";
+        if (Buffer.isBuffer(data)) {
+            if (data.length >= 2 && data[0] === 0xFF && data[1] === 0xFE) {
+                s = data.toString("ucs2", 2);
+            } else if (data.length >= 2 && data[0] === 0xFE && data[1] === 0xFF) {
+                swapBytes(data);
+                s = data.toString("ucs2", 2);
+            } else if (data.length >= 3 && data[0] === 0xEF && data[1] === 0xBB && data[2] === 0xBF) {
+                s = data.toString("utf8", 3);
+            } else {
+                s = data.toString("ascii");
+            }
+        }
+
+        return s;
+    },
+
+    // Wrap object property in an Array if the property is defined and it is not an Array
+    wrapPropertyInArray : function (obj, property) {
+        if (obj && obj[property] && !(obj[property] instanceof Array)) {
+            obj[property] = [ obj[property] ];
+        }
+    },
+
+    loadModule: function (path) {
+        return require(path);
+    }
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build
new file mode 100755
index 0000000..e0207e4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build
@@ -0,0 +1,6 @@
+#cd into project dir
+cd $( dirname "$0")/../
+
+#package app
+node ./cordova/lib/build "$@"
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build.bat b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build.bat
new file mode 100755
index 0000000..571bae6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/build.bat
@@ -0,0 +1,8 @@
+@ECHO OFF
+
+REM cd into project dir
+cd %~dp0\..\
+
+REM package app
+@node.exe ./cordova/lib/build %*
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean
new file mode 100755
index 0000000..0d29bd7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean
@@ -0,0 +1,4 @@
+#cd into project dir
+cd $( dirname "$0")/../
+
+node ./cordova/lib/clean

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean.bat b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean.bat
new file mode 100644
index 0000000..eb5738c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/clean.bat
@@ -0,0 +1,6 @@
+@ECHO OFF
+
+REM cd into project dir
+cd %~dp0\..\
+
+@node.exe ./cordova/lib/clean

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-builder.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-builder.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-builder.js
new file mode 100644
index 0000000..e1be25c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-builder.js
@@ -0,0 +1,100 @@
+/*
+ *  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.
+ */
+
+var jWorkflow = require("jWorkflow"),
+    wrench = require("wrench"),
+    nativePkgr = require("./native-packager"),
+    fileManager = require("./file-manager"),
+    localize = require("./localize"),
+    logger = require("./logger"),
+    signingHelper = require("./signing-helper"),
+    targetIdx = 0;
+
+function buildTarget(previous, baton) {
+    baton.take();
+
+    var target = this.session.targets[targetIdx++],
+        session = this.session,
+        config = this.config;
+
+    //Create output folder
+    wrench.mkdirSyncRecursive(session.outputDir + "/" + target);
+
+    //Copy target dependent files
+    fileManager.copyWWE(this.session, target);
+    fileManager.copyWebplatform(this.session, target);
+
+    if (config.packageCordovaJs) {
+        //Package cordova.js to chrome folder
+        fileManager.copyWebworks(this.session);
+    }
+
+    fileManager.copyJnextDependencies(this.session);
+    fileManager.copyExtensions(this.session, target);
+
+    //Generate frameworkModules.js (this needs to be done AFTER all files have been copied)
+    fileManager.generateFrameworkModulesJS(session);
+
+    //Call native-packager module for target
+    nativePkgr.exec(session, target, config, function (code) {
+        if (code !== 0) {
+            logger.error(localize.translate("EXCEPTION_NATIVEPACKAGER"));
+            baton.pass(code);
+        } else {
+            if (target === "device" && session.isSigningRequired(config)) {
+                signingHelper.execSigner(session, target, function (code) {
+                    baton.pass(code);
+                });
+            } else {
+                baton.pass(code);
+            }
+        }
+    });
+}
+
+function buildWorkflow(session, context) {
+    if (session.targets && session.targets.length > 0) {
+        var order;
+
+        session.targets.forEach(function (target, idx) {
+            if (idx === 0) {
+                order = jWorkflow.order(buildTarget, context);
+            } else {
+                order = order.andThen(buildTarget, context);
+            }
+        });
+
+        return order;
+    } else {
+        logger.debug("NOTHING TO BUILD, NO TARGETS");
+    }
+}
+
+module.exports = {
+    build: function (session, config, callback) {
+        var context = {
+                session: session,
+                config: config,
+            },
+            workflow = buildWorkflow(session, context);
+
+        if (workflow) {
+            workflow.start({
+                "callback": callback
+            });
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-conf.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-conf.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-conf.js
new file mode 100644
index 0000000..857875b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bar-conf.js
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+
+var self = {};
+
+self.ROOT = "";
+self.CHROME = self.ROOT + "/chrome";
+self.LIB = self.CHROME + "/lib";
+self.EXT = self.CHROME + "/plugin";
+self.UI = self.ROOT + "/ui-resources";
+self.PLUGINS = self.ROOT + "/plugins";
+self.JNEXT_PLUGINS = self.ROOT + "/plugins/jnext";
+
+module.exports = self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bbwpignore.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bbwpignore.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bbwpignore.js
new file mode 100755
index 0000000..29c6399
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/bbwpignore.js
@@ -0,0 +1,129 @@
+/*
+ *  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.
+ */
+
+var fs = require("fs"),
+    path = require("path"),
+    BBWPignore;
+
+function getDirectory(file) {
+    if (file.match("/$")) {
+        return file;
+    } else if (file.indexOf("/") === -1) {
+        return "";
+    } else {
+        return file.substring(0, file.lastIndexOf("/"));
+    }
+}
+
+function trim(str) {
+    return str.replace(/^\s+|\s+$/g, "");
+}
+
+BBWPignore = function (bbwpIgnoreFile, filesToMatch) {
+    var comments = [],
+        directories = [],
+        wildcardEntries = [],
+        files = [],
+        split,
+        matched = [],
+        i,
+        temparr,
+        tempFiles = [];
+    temparr = fs.readFileSync(bbwpIgnoreFile, "utf-8").split('\n');
+
+    //switch all the paths to relative, so if someone has passed absolute paths convert them to relative to .bbwpignore
+    filesToMatch.forEach(function (file) {
+        if (file === path.resolve(file)) { //if path is absolute
+            tempFiles.push(path.relative(path.dirname(bbwpIgnoreFile), file));
+        } else {
+            tempFiles.push(file);
+        }
+    });
+    filesToMatch = tempFiles;
+
+    //run through all the patterns in the bbwpignore and put them in appropriate arrays
+    for (i = 0; i < temparr.length; i++) {
+        temparr[i] = trim(temparr[i]);
+        if (temparr[i] !== "") {
+            if (temparr[i].match("^#")) {
+                comments.push(temparr[i]);
+            } else if (temparr[i].match("^/") && temparr[i].match("/$")) {
+                directories.push(temparr[i]);
+            } else if (temparr[i].indexOf("*") !== -1) {
+                split = temparr[i].split("/");
+                if (split[split.length - 1].indexOf("*") !== -1) { // only wildcards in the file name are supported, not in directory names
+                    wildcardEntries.push(temparr[i]);
+                } else {
+                    files.push(temparr[i]);
+                }
+            } else {
+                files.push(temparr[i]);
+            }
+        }
+    }
+
+    //run through all the files and check it against each of the patterns collected earlier
+    filesToMatch.forEach(function (fileToMatch) {
+        var directory,
+            dirOrig = getDirectory(fileToMatch),
+            isMatch = false;
+        //match directories
+        directory = "/" + dirOrig + "/";
+        if (directories.indexOf(directory) !== -1) {
+            matched.push(fileToMatch);
+            //add the directory to the list as well but only check
+            if (matched.indexOf("/" + dirOrig) === -1) {
+                matched.push("/" + dirOrig);
+            }
+            isMatch = true;
+        } else {
+            //handle special case when match patterns begin with /
+            //match wildCards
+            wildcardEntries.forEach(function (wildcard) {
+                if (wildcard.match("^/")) { // special case looking for exact match
+                    wildcard = "^" + wildcard.replace("*", "[^\/]*");
+                    if (("/" + fileToMatch).match(wildcard)) {
+                        matched.push(fileToMatch);
+                        isMatch = true;
+                    }
+                } else {
+                    wildcard = wildcard.replace("*", "[^\/]*");
+                    if (fileToMatch.match(wildcard)) {
+                        matched.push(fileToMatch);
+                        isMatch = true;
+                    }
+                }
+            });
+            if (!isMatch) { //must be a file
+                files.forEach(function (file) {
+                    if (file.match("^/")) { // special case looking for exact match
+                        if (file === ("/" + fileToMatch)) {
+                            matched.push(fileToMatch);
+                            isMatch = true;
+                        }
+                    } else if (fileToMatch.match(file)) {
+                        matched.push(fileToMatch);
+                        isMatch = true;
+                    }
+                });
+
+            }
+        }
+    });
+    this.matchedFiles = matched;
+};
+
+module.exports = BBWPignore;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/build
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/build b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/build
new file mode 100644
index 0000000..81e7dd6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/build
@@ -0,0 +1,173 @@
+#!/usr/bin/env node
+
+/*
+ *  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.
+ */
+
+var path = require("path"),
+    command = require("commander"),
+    jWorkflow = require("jWorkflow"),
+    localize = require("./localize"),
+    logger = require("./logger"),
+    projectProperties = require("../../project.json"),
+    debugTokenHelper = require("./debugtoken-helper"),
+    bbwpArgv = [
+        process.argv[0],
+        process.argv[1],
+        "./www",
+        "-o",
+        "./build"
+    ],
+    built = false,
+    debugtoken = false;
+
+function getTarget() {
+    return typeof command.args[0] === "string" ? command.args[0] : undefined;
+}
+
+function copyArgIfExists(arg) {
+    if (command[arg]) {
+        bbwpArgv.push("--" + arg);
+        bbwpArgv.push(command[arg]);
+    }
+}
+
+function createDebugtoken(previous, baton) {
+    baton.take();
+    logger.info(localize.translate("PROGRESS_WILL_CREATE_DEBUG_TOKEN"));
+    debugTokenHelper.createToken(projectProperties, getTarget(), function (code) {
+        if (code === 0) {
+            debugtoken = true;
+        }
+
+        baton.pass();
+    });
+}
+
+function deployDebugToken(previous, baton) {
+    baton.take();
+
+    // If in debug build and debug token was created, deploy the debug token and wait until the deployment is finished
+    if (debugtoken) {
+        logger.info(localize.translate("PROGRESS_WILL_DEPLOY_DEBUG_TOKEN"));
+        debugTokenHelper.deployToken(projectProperties, getTarget(), function () {
+            baton.pass();
+        });
+    } else {
+        baton.pass();
+    }
+}
+
+function doDebugBuild() {
+    built = true;
+
+    //build in debug mode by default
+    bbwpArgv.push("-d");
+
+    // In debug build, it needs to create debug token first
+    jWorkflow.order(createDebugtoken)
+             .andThen(deployDebugToken)
+             .andThen(build)
+             .start();
+}
+
+function doReleaseBuild() {
+    built = true;
+
+    //Note: Packager refers to signing password as "password" not "keystorepass"
+    if (command["keystorepass"]) {
+        bbwpArgv.push("--password");
+        bbwpArgv.push(command["keystorepass"]);
+    } else if (projectProperties.keystorepass) {
+        bbwpArgv.push("--password");
+        bbwpArgv.push( projectProperties.keystorepass);
+    } else {
+        throw "No signing password provided. Please use --keystorepass via command-line or enter a value for keystorepass in project.json";
+    }
+
+    copyArgIfExists("buildId");
+
+    build();
+}
+
+function build() {
+    copyArgIfExists("params");
+    copyArgIfExists("loglevel");
+
+    //Overrite process.argv, before calling packager
+    process.argv = bbwpArgv;
+
+    //Delete cached commander object. It will conflict with the packagers commander
+    delete require.cache[require.resolve("commander")];
+    delete require.cache[require.resolve("commander/lib/commander")];
+
+    //Package app. If successfull call run
+    require("./packager").start(run);
+}
+
+function run() {
+    var target = getTarget();
+
+    //Overrite process.argv, before calling run
+    process.argv = [
+        process.argv[0],
+        process.argv[1],
+    ];
+
+    if (target) {
+        process.argv.push(target);
+    }
+
+    //deploy app
+    require("./run");
+}
+
+command
+    .usage('command [<target>] [-k | --keystorepass] [-b | --buildId <number>] [-p | --params <json>] [-ll | --loglevel <level>]')
+    .option('-k, --keystorepass <password>', 'Signing key password')
+    .option('-b, --buildId <num>', 'Specifies the build number for signing (typically incremented from previous signing).')
+    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
+    .option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)');
+
+command
+    .command('release')
+    .usage('[<target>] [-k | --keystorepass] [-b | --buildId <number>] [-p | --params <json>] [-ll | --loglevel <level>]')
+    .description('    Build in release mode. This will sign the resulting bar.')
+    .option('-k, --keystorepass <password>', 'Signing key password')
+    .option('-b, --buildId <num>', 'Specifies the build number for signing (typically incremented from previous signing).')
+    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
+    .option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)')
+    .action(doReleaseBuild);
+
+command
+    .command('debug')
+    .usage('[<target>] [-p | --params <json>] [-ll | --loglevel <level>]')
+    .description('    Build in debug mode.')
+    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
+    .option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)')
+    .action(doDebugBuild);
+
+try {
+    command.parse(process.argv);
+
+    //if we get here and haven't built yet then no mode was provided [debug, release], default to debug mode
+    if (!built) {
+        doDebugBuild();
+    }
+} catch (e) {
+    console.log(e);
+    process.exit();
+}
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/clean
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/clean b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/clean
new file mode 100644
index 0000000..46391d3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/clean
@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+
+/*
+ *  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.
+ */
+
+var wrench = require('wrench'),
+    path = require("path"),
+    buildPath = path.normalize(__dirname + "/../../build/");
+
+   wrench.rmdirSyncRecursive(buildPath, true);
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/cmdline.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/cmdline.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/cmdline.js
new file mode 100644
index 0000000..14eb172
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/cmdline.js
@@ -0,0 +1,67 @@
+/*
+ *  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.
+ */
+
+var command = require("commander"),
+    logger = require("./logger"),
+    localize = require("./localize");
+
+command
+    .version('1.0.0.0')
+    .usage('[drive:][path]archive [-s [dir]] [[ -g genpassword] [-buildId num]] [-o dir] [-d] [-p paramsjsonfile]')
+    .option('-s, --source [dir]', 'Save source. The default behaviour is to not save the source files. If dir is specified then creates dir\\src\\ directory structure. If no dir specified then the path of archive is assumed')
+    .option('-g, --password <password>', 'Signing key password')
+    .option('-buildId <num>', '[deprecated] Use --buildId.')
+    .option('-b, --buildId <num>', 'Specifies the build number for signing (typically incremented from previous signing).')
+    .option('-o, --output <dir>', 'Redirects output file location to dir. If both -o and dir are not specified then the path of archive is assumed')
+    .option('-d, --debug', 'Allows use of not signed build on device by utilizing debug token and enables Web Inspector.')
+    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
+    .option('--appdesc <filepath>', 'Optionally specifies the path to the bar descriptor file (bar-descriptor.xml). For internal use only.')
+    .option('-v, --verbose', 'Turn on verbose messages')
+	.option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)');
+
+function parseArgs(args) {
+    var option,
+        i;
+    if (!args[2]) {
+        //no args passed into [node bbwp.js], show the help information
+        args.push("-h");
+    }
+
+    //Handle deprecated option -buildId
+    for (i = 0; i < args.length; i++) {
+        if (args[i] === "-buildId") {
+            args[i] = "--buildId";
+        }
+    }
+    
+    command.parse(args);
+
+    //Check for any invalid command line args
+    for (i = 0; i < args.length; i++) {
+        //Remove leading dashes if any
+        option = args[i].substring(2);
+        if (args[i].indexOf("--") === 0 && !command[option]) {
+            throw localize.translate("EXCEPTION_CMDLINE_ARG_INVALID", args[i]);
+        }
+    }
+
+    return this;
+}
+
+module.exports = {
+    "commander": command,
+    "parse": parseArgs
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/conf.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/conf.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/conf.js
new file mode 100644
index 0000000..75c47a8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/conf.js
@@ -0,0 +1,45 @@
+/*
+ *  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.
+ */
+
+var path = require("path"),
+    fs = require("fs");
+
+function getToolsDir() {
+    if (process.env && process.env.QNX_HOST) {
+        var bbndkDir = path.join(process.env.QNX_HOST, "usr");
+        if (fs.existsSync(bbndkDir)) {
+            //BBNDK exists on path, use its tools
+            return bbndkDir;
+        }
+    }
+}
+
+module.exports = {
+    ROOT: path.normalize(__dirname + "/../framework"),
+    PROJECT_ROOT: path.normalize(__dirname + "/../../"),
+    BIN: path.normalize(__dirname + "/../framework/bin"),
+    LIB: path.normalize(__dirname + "/../framework/lib"),
+    EXT: path.normalize(__dirname + "/../../plugins"),
+    UI: path.normalize(__dirname + "/../framework/ui-resources"),
+    DEPENDENCIES: path.normalize(__dirname + "/../framework/dependencies"),
+    DEPENDENCIES_BOOTSTRAP: path.normalize(__dirname + "/../framework/bootstrap"),
+    DEPENDENCIES_TOOLS: getToolsDir(),
+    DEPENDENCIES_WWE: path.normalize(__dirname + "/../dependencies/%s-wwe"),
+    DEBUG_TOKEN: path.normalize(__dirname + "/../debugtoken.bar"),
+    DEFAULT_ICON: path.normalize(__dirname + "/../default-icon.png"),
+    BAR_DESCRIPTOR: "bar-descriptor.xml",
+    BBWP_IGNORE_FILENAME: ".bbwpignore"
+};


[20/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/config-parser.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/config-parser.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/config-parser.js
new file mode 100644
index 0000000..41775f4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/config-parser.js
@@ -0,0 +1,1411 @@
+/*jshint sub:true*/
+
+var testData = require("./test-data"),
+    configParser = require(testData.libPath + "/config-parser"),
+    packagerUtils = require(testData.libPath + "/packager-utils"),
+    fileManager = require(testData.libPath + "/file-manager"),
+    logger = require(testData.libPath + "./logger"),
+    testUtilities = require("./test-utilities"),
+    xml2js = require('xml2js'),
+    localize = require(testData.libPath + "/localize"),
+    path = require("path"),
+    fs = require("fs"),
+    session = testData.session,
+    configPath = path.resolve("bin/test/cordova/unit/config.xml"),
+    configBadPath = path.resolve("test2/config.xml"),
+    configBareMinimumPath = path.resolve("bin/test/cordova/unit/config-bare-minimum.xml"),
+    mockParsing = testUtilities.mockParsing;
+
+describe("config parser", function () {
+    beforeEach(function () {
+        spyOn(logger, "warn");
+        spyOn(packagerUtils, "copyFile");
+    });
+
+    it("tries to open a config.xml file that doesn't exist", function () {
+        expect(function () {
+            configParser.parse(configBadPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_CONFIG_NOT_FOUND"));
+    });
+
+    it("parses standard elements in a config.xml", function () {
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.content).toEqual("local:///startPage.html");
+            expect(configObj.id).toEqual("My WidgetId");
+            expect(configObj.customHeaders).toEqual({ 'RIM-Widget' : 'rim/widget'});
+            expect(configObj.version).toEqual("1.0.0");
+            expect(configObj.license).toEqual("My License");
+            expect(configObj.licenseURL).toEqual("http://www.apache.org/licenses/LICENSE-2.0");
+            expect(configObj.icon).toEqual(["test.png"]);
+            expect(configObj.configXML).toEqual("config.xml");
+            expect(configObj.author).toEqual("Research In Motion Ltd.");
+            expect(configObj.authorURL).toEqual("http://www.rim.com/");
+            expect(configObj.copyright).toEqual("No Copyright");
+            expect(configObj.authorEmail).toEqual("author@rim.com");
+            expect(configObj.name).toEqual({ default : 'Demo' });
+            expect(configObj.description).toEqual({ default : 'This app does everything.' });
+            expect(configObj.permissions).toContain('access_shared');
+            expect(configObj.permissions).toContain('read_geolocation');
+            expect(configObj.permissions).toContain('use_camera');
+            expect(configObj.enableChildWebView).toBe(false);
+            expect(configObj.enableChildWebView).toBe(false);
+        });
+    });
+
+    it("parses Feature elements in a config.xml", function () {
+        var localAccessList,
+            accessListFeature;
+
+        configParser.parse(configPath, session, function (configObj) {
+            //validate WIDGET_LOCAL accessList
+            localAccessList = testUtilities.getAccessListForUri(configObj.accessList, "WIDGET_LOCAL");
+            expect(localAccessList).toBeDefined();
+            expect(localAccessList.uri).toEqual("WIDGET_LOCAL");
+            expect(localAccessList.allowSubDomain).toEqual(true);
+        });
+    });
+
+    it("parses Access elements a config.xml", function () {
+        var customAccessList,
+            accessListFeature;
+
+        configParser.parse(configPath, session, function (configObj) {
+            //validate http://www.somedomain1.com accessList
+            customAccessList = testUtilities.getAccessListForUri(configObj.accessList, "http://www.somedomain1.com");
+            expect(customAccessList).toBeDefined();
+            expect(customAccessList.uri).toEqual("http://www.somedomain1.com");
+            expect(customAccessList.allowSubDomain).toEqual(true);
+        });
+    });
+
+    it("parses a bare minimum config.xml without error", function () {
+        var bareMinimumConfigPath = path.resolve("bin/test/cordova/unit/config-bare-minimum.xml");
+
+        configParser.parse(bareMinimumConfigPath, session, function (configObj) {
+            expect(configObj.content).toEqual("local:///startPage.html");
+            expect(configObj.version).toEqual("1.0.0");
+        });
+    });
+
+    it("license url is set even if license body is empty", function () {
+        var licenseConfigPath = path.resolve("bin/test/cordova/unit/config-license.xml");
+
+        configParser.parse(licenseConfigPath, session, function (configObj) {
+            expect(configObj.license).toEqual("");
+            expect(configObj.licenseURL).toEqual("http://www.apache.org/licenses/LICENSE-2.0");
+        });
+    });
+
+    it("fails when id is undefined", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["@"].id = undefined;
+
+        mockParsing(data);
+
+        //Should throw an EXCEPTION_INVALID_ID error
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_ID"));
+    });
+
+    it("fails when id is empty", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["@"].id = "";
+
+        mockParsing(data);
+
+        //Should throw an EXCEPTION_INVALID_ID error
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_ID"));
+    });
+
+    it("Fails when no name was provided - single element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = "";
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_NAME"));
+    });
+
+    it("Fails when no name was provided - multiple elements", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = ["",
+            { '#': 'API Smoke Test-FR', '@': { 'xml:lang': 'fr' } },
+        ];
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_NAME"));
+    });
+
+    it("Fails when localized name was provided but empty", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = ["API Smoke Test",
+            { '#': '', '@': { 'xml:lang': 'fr' } },
+        ];
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_NAME"));
+    });
+
+    it("Parses a name element - single element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = "API Smoke Test";
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.name).toEqual({"default": "API Smoke Test"});
+        });
+    });
+
+    it("Parses a name element with xml:lang - single element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = { '#': 'EN VALUE', '@': { 'xml:lang': 'en' } };
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.name).toEqual({"en": "EN VALUE"});
+        });
+    });
+
+    it("Parses a name element that is not case sensitive", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = { '#': 'EN VALUE', '@': { 'xml:lang': 'eN' } };
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.name).toEqual({"en": "EN VALUE"});
+        });
+    });
+
+    it("Parses a name element with xml:lang - multi element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = ['API Smoke Test',
+            { '#': 'EN VALUE', '@': { 'xml:lang': 'en' } },
+            { '#': 'FR VALUE', '@': { 'xml:lang': 'fr' } }
+
+        ];
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.name).toEqual({"default": "API Smoke Test", "en": "EN VALUE", "fr": "FR VALUE"});
+        });
+    });
+
+    it("Fails when localized name was provided but empty", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.name = ['API Smoke Test',
+            { '#': '', '@': { 'xml:lang': 'fr' } },
+        ];
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_NAME"));
+    });
+
+    it("Parses a description element - single element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.description = "This is my app";
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.description).toEqual({"default": "This is my app"});
+        });
+    });
+
+    it("Parses a description element with xml:lang - single element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.description = { '#': 'EN VALUE', '@': { 'xml:lang': 'en' } };
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.description).toEqual({"en": "EN VALUE"});
+        });
+    });
+
+    it("Parses a description element that is not case sensitive", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.description = { '#': 'EN VALUE', '@': { 'xml:lang': 'eN' } };
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.description).toEqual({"en": "EN VALUE"});
+        });
+    });
+
+    it("Parses a description element with xml:lang - multi element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.description = ['This is my app',
+            { '#': 'EN VALUE', '@': { 'xml:lang': 'en' } },
+            { '#': 'FR VALUE', '@': { 'xml:lang': 'fr' } }
+
+        ];
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.description).toEqual({"default": "This is my app", "en": "EN VALUE", "fr": "FR VALUE"});
+        });
+    });
+
+    it("Fails when missing content error is not shown", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.content = "";
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_CONTENT"));
+    });
+
+    it("adds local:/// protocol to urls", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.content["@"].src = "localFile.html";
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.content).toEqual("local:///localFile.html");
+        });
+    });
+
+    it("cleans source folder on error", function () {
+        mockParsing({}, "ERROR");
+
+        spyOn(logger, "error");
+        spyOn(fileManager, "cleanSource");
+
+        configParser.parse(configPath, session, function () {});
+
+        expect(fileManager.cleanSource).toHaveBeenCalled();
+    });
+
+    it("parses a single permission (comes in as string)", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['rim:permissions'] = {};
+        data['rim:permissions']['rim:permit'] = 'onePermissionNoAttribs';
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.permissions).toContain('onePermissionNoAttribs');
+        });
+    });
+
+    it("parses a single permission with attribs (comes in as object)", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['rim:permissions'] = {};
+        data['rim:permissions']['rim:permit'] = { '#': 'systemPerm', '@': { system: 'true' } };
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.permissions).toContain({ '#': 'systemPerm', '@': { system: 'true' } });
+        });
+    });
+
+    it("parses multiple permissions with no attribs (comes in as array)", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['rim:permissions'] = {};
+        data['rim:permissions']['rim:permit'] = [ 'access_shared', 'read_geolocation', 'use_camera' ];
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.permissions).toContain('access_shared');
+            expect(configObj.permissions).toContain('read_geolocation');
+            expect(configObj.permissions).toContain('use_camera');
+        });
+    });
+
+    it("parses multiple permissions with attribs (comes in as array)", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['rim:permissions'] = {};
+        data['rim:permissions']['rim:permit'] = [
+            { '#': 'systemPerm', '@': { system: 'true' } },
+            { '#': 'nonSystemPerm', '@': { system: 'false' } }
+        ];
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.permissions).toContain({ '#': 'systemPerm', '@': { system: 'true' } });
+            expect(configObj.permissions).toContain({ '#': 'nonSystemPerm', '@': { system: 'false' } });
+        });
+    });
+
+    it("parses a config with no permissions set", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        delete data['rim:permissions']; //No permissions set in config
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.permissions).toEqual([]);
+        });
+    });
+
+    it("enables the enable-flash feature when specified", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //Add the enable-flash feature element
+        data['feature'] = {'@': {id: 'enable-flash'}};
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.enableFlash).toEqual(true);
+        });
+    });
+
+    it("does not enable the enable-flash feature when specified in an access element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //Add the enable-flash to an access element
+        data['access'] = {"@" : {"uri" : "http://somewebsite.com"}, "feature" : {"@": {id: 'enable-flash'}}};
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.enableFlash).toEqual(false);
+        });
+    });
+
+    it("disables the enable-flash feature by default", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['feature'] = undefined;//no features
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.enableFlash).toEqual(false);
+        });
+    });
+
+    it("sets autoDeferNetworkingAndJavaScript to false when the blackberry.push feature is specified", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //Add the blackberry.push feature element
+        data["rim:permissions"] = {}; // ensure no run_when_backgrounded permission exists
+        data['feature'] = {'@': {id: 'blackberry.push'}};
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.autoDeferNetworkingAndJavaScript).toEqual(false);
+        });
+    });
+
+    it("sets autoDeferNetworkingAndJavaScript to false when the run_when_backgrounded permission is specified", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //Add the run_when_backgrounded permission
+        data['feature'] = undefined; // no features
+        data["rim:permissions"] = {
+            "rim:permit" : [ 'read_geolocation', 'run_when_backgrounded', 'access_internet' ]
+        };
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.permissions).toContain('run_when_backgrounded');
+            expect(configObj.autoDeferNetworkingAndJavaScript).toEqual(false);
+        });
+    });
+
+    it("sets autoDeferNetworkingAndJavaScript to true by default", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        data['feature'] = undefined; // no features
+        data["rim:permissions"] = {}; // ensure no run_when_backgrounded permission exists
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.autoDeferNetworkingAndJavaScript).toEqual(true);
+        });
+    });
+
+    it("does not throw an exception with empty permit tags", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['rim:permit'] = ['read_geolocation', {}, 'access_internet' ];
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).not.toThrow();
+    });
+
+    it("multi access should be false if no access", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            //hasMultiAccess was set to false
+            expect(configObj.hasMultiAccess).toEqual(false);
+            expect(configObj.accessList).toEqual([ {
+                uri : 'WIDGET_LOCAL',
+                allowSubDomain : true
+            } ]);
+        });
+    });
+
+    it("multi access should be false if no uri is equal to *", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['access'] = {"@" : {"uri" : "http://www.somedomain1.com"}};
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            //hasMultiAccess was set to false
+            expect(configObj.hasMultiAccess).toEqual(false);
+            expect(configObj.accessList).toEqual([ {
+                uri : 'WIDGET_LOCAL',
+                allowSubDomain : true
+            }, {
+                "uri" : "http://www.somedomain1.com"
+            } ]);
+        });
+    });
+
+    it("multi access should be true with the uri being equal to *", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['access'] = {"@" : {"uri" : "*"}};
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            //hasMultiAccess was set to true
+            expect(configObj.hasMultiAccess).toEqual(true);
+            expect(configObj.accessList).toEqual([ {
+                uri : 'WIDGET_LOCAL',
+                allowSubDomain : true
+            } ]);
+        });
+    });
+
+    it("multi access should be true with one uri being equal to *", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['access'] = [{"@" : {"uri" : "*"}}, {"@" : {"uri" : "http://www.somedomain1.com"}}];
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            //hasMultiAccess was set to true
+            expect(configObj.hasMultiAccess).toEqual(true);
+            expect(configObj.accessList).toEqual([ {
+                uri : 'WIDGET_LOCAL',
+                allowSubDomain : true
+            }, {
+                "uri" : "http://www.somedomain1.com"
+            } ]);
+        });
+    });
+
+    it("should fail when feature is defined with the uri being equal to *", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['access'] = {"@" : {"uri" : "*"}, "feature" : {"@": {"id": "blackberry.app"}}};
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_FEATURE_DEFINED_WITH_WILDCARD_ACCESS_URI"));
+    });
+
+    it("should fail when multi features are defined with the uri being equal to *", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data['access'] = {"@" : {"uri" : "*"}, "feature" : [{"@": {"id": "blackberry.app"}}, {"@": {"id": "blackberry.system"}}, {"@": {"id": "blackberry.invoke"}}]};
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_FEATURE_DEFINED_WITH_WILDCARD_ACCESS_URI"));
+    });
+
+    it("should fail when the access uri attribute does not specify a protocol", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //Add an access element with one feature
+        data['access'] = {
+            '@': {
+                uri: 'rim.net',
+                subdomains: 'true'
+            },
+            feature: {
+                '@': { id: 'blackberry.system' }
+            }
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_ACCESS_URI_NO_PROTOCOL", data['access']['@'].uri));
+    });
+
+    it("should fail when the access uri attribute does not specify a URN", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //Add an access element with one feature
+        data['access'] = {
+            '@': {
+                uri: 'http://',
+                subdomains: 'true'
+            },
+            feature: {
+                '@': { id: 'blackberry.system' }
+            }
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_ACCESS_URI_NO_URN", data['access']['@'].uri));
+    });
+
+    it("does not fail when there is a single feature element in the access list", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //Add an access element with one feature
+        data['access'] = {
+            '@': {
+                uri: 'http://rim.net',
+                subdomains: 'true'
+            },
+            feature: {
+                '@': { id: 'blackberry.system' }
+            }
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).not.toThrow();
+    });
+
+    it("supports 4 digit version [build id]", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["@"].version = "1.0.0.50";
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.version).toEqual("1.0.0");
+            expect(configObj.buildId).toEqual("50");
+        });
+    });
+
+    it("uses --buildId when set", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+        //--buildId 100
+        session.buildId = "100";
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.buildId).toEqual("100");
+        });
+    });
+
+    it("overides the build id specified in version with --buildId flag", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["@"].version = "1.0.0.50";
+
+        //--buildId 100
+        session.buildId = "100";
+
+        mockParsing(data);
+
+        configParser.parse(configPath, session, function (configObj) {
+            expect(configObj.version).toEqual("1.0.0");
+            expect(configObj.buildId).toEqual("100");
+        });
+    });
+
+    it("throws a proper error when author tag is empty", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data.author = {};
+
+        mockParsing(data);
+
+        //Should throw an EXCEPTION_INVALID_AUTHOR error
+        expect(function () {
+            configParser.parse(configPath, session, {});
+        }).toThrow(localize.translate("EXCEPTION_INVALID_AUTHOR"));
+    });
+
+    it("can parse a standard rim:invoke-target element", function () {
+
+        configParser.parse(configPath, session, function (configObj) {
+            var invokeTarget = configObj["invoke-target"][0];
+
+            expect(invokeTarget).toBeDefined();
+            expect(invokeTarget["@"]).toBeDefined();
+            expect(invokeTarget["@"]["id"]).toBeDefined();
+            expect(invokeTarget["@"]["id"]).toEqual("com.domain.subdomain.appname.app1");
+            expect(invokeTarget.type).toBeDefined();
+            expect(invokeTarget.type).toEqual("APPLICATION");
+            expect(invokeTarget["require-source-permissions"]).toBeDefined();
+            expect(invokeTarget["require-source-permissions"]).toEqual("invoke_accross_perimeters,access_shared");
+            expect(invokeTarget.filter).toBeDefined();
+            expect(invokeTarget.filter[0].action).toBeDefined();
+            expect(invokeTarget.filter[0].action).toContain("bb.action.VIEW");
+            expect(invokeTarget.filter[0].action).toContain("bb.action.SET");
+            expect(invokeTarget.filter[0].action).toContain("bb.action.OPEN");
+            expect(invokeTarget.filter[0]["mime-type"]).toBeDefined();
+            expect(invokeTarget.filter[0]["mime-type"]).toContain("image/*");
+            expect(invokeTarget.filter[0]["mime-type"]).toContain("text/*");
+            expect(invokeTarget.filter[0].property).toBeDefined();
+
+            invokeTarget.filter[0].property.forEach(function (property) {
+                expect(property["@"]).toBeDefined();
+                expect(property["@"]["var"]).toBeDefined();
+                expect(property["@"]["var"]).toMatch("^(exts|uris)$");
+                if (property["@"]["var"] === "uris") {
+                    expect(property["@"]["value"]).toMatch("^(ftp|http|https):\/\/$");
+                } else if (property["@"]["var"] === "exts") {
+                    expect(property["@"]["value"]).toMatch("^(jpg|png|txt|doc)$");
+                }
+            });
+        });
+    });
+
+    it("can parse multiple filters in one element", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["rim:invoke-target"] = {
+            "@": {
+                "id": "com.domain.subdomain.appName.app"
+            },
+            "type": "application",
+            "filter":  [{
+                "action":  "bb.action.OPEN",
+                "mime-type": ["text/*", "image/*"]
+            }, {
+                "action": "bb.action.SET",
+                "mime-type": "image/*"
+            }]
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).not.toThrow();
+    });
+
+    it("can parse multiple invoke targets", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["rim:invoke-target"] = [{
+            "@": {
+                "id": "com.domain.subdomain.appName.app"
+            },
+            "type": "application"
+        }, {
+            "@": {
+                "id": "com.domain.subdomain.appName.viewer"
+            },
+            "type": "viewer"
+        }];
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).not.toThrow();
+
+    });
+
+    it("throws an error when an invoke target doesn't specify an invocation id", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["rim:invoke-target"] = {
+            type: "APPLICATION"
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_INVOKE_TARGET_INVALID_ID"));
+    });
+
+    it("throws and error when an invoke target xml doesn't specify an invocation type", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["rim:invoke-target"] = {
+            "@": {
+                "id": "com.domain.subdomain.appName.app"
+            },
+            type: {}
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_INVOKE_TARGET_INVALID_TYPE"));
+    });
+
+    it("throws an error when an invoke target doesn't specify an invocation type", function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["rim:invoke-target"] = {
+            "@": {
+                "id": "com.domain.subdomain.appName.app"
+            }
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_INVOKE_TARGET_INVALID_TYPE"));
+    });
+
+    it("throws an error when an invoke target filter doesn't contain an action",  function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["rim:invoke-target"] = {
+            "@": {
+                "id": "com.domain.subdomain.appName.app"
+            },
+            "type": "APPLICATION",
+            "filter": {
+                "mime-type": "text/*",
+                "property": [{
+                    "@": {
+                        "var": "uris",
+                        "value": "https://"
+                    }
+                }, {
+                    "@": {
+                        "var": "exts",
+                        "value": "html"
+                    }
+                }, {
+                    "@": {
+                        "var": "exts",
+                        "value": "htm"
+                    }
+                }]
+            }
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_INVOKE_TARGET_ACTION_INVALID"));
+    });
+
+    it("throws an error when a filter doesn't contain a mime-type",  function () {
+        var data = testUtilities.cloneObj(testData.xml2jsConfig);
+        data["rim:invoke-target"] = {
+            "@": {
+                "id": "com.domain.subdomain.appName.app"
+            },
+            "type": "application",
+            "filter": {
+                "action": "bb.action.OPEN",
+                "property": [{
+                    "@": {
+                        "var": "uris",
+                        "value": "https://"
+                    }
+                }, {
+                    "@": {
+                        "var": "exts",
+                        "value": "html"
+                    }
+                }]
+            }
+        };
+
+        mockParsing(data);
+
+        expect(function () {
+            configParser.parse(configPath, session, function (configObj) {});
+        }).toThrow(localize.translate("EXCEPTION_INVOKE_TARGET_MIME_TYPE_INVALID"));
+    });
+
+    describe("splash screen", function () {
+        it("throws error when rim:splash element does not contain src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["rim:splash"] = {};
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_SPLASH_SRC"));
+        });
+
+        it("throws error when rim:splash element contains empty src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["rim:splash"] = {
+                "@": {
+                    "src": ""
+                }
+            };
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_SPLASH_SRC"));
+        });
+
+        it("throws error when one of many rim:splash elements does not contain attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["rim:splash"] = [{
+                "@": {
+                    "src": "a.jpg"
+                }
+            }, {
+                "#": "blah"
+            }];
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_SPLASH_SRC"));
+        });
+
+        it("allow one rim:splash element that contains non-empty src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["rim:splash"] = {
+                "@": {
+                    "src": "a.jpg"
+                }
+            };
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).not.toThrow();
+        });
+
+        it("allow multiple rim:splash elements that contain non-empty src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["rim:splash"] = [{
+                "@": {
+                    "src": "a.jpg"
+                }
+            }, {
+                "@": {
+                    "src": "b.jpg"
+                }
+            }];
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).not.toThrow();
+        });
+
+        it("throws error when rim:splash src starts with 'locales' subfolder", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["rim:splash"] = [{
+                "@": {
+                    "src": "a.jpg"
+                }
+            }, {
+                "@": {
+                    "src": "locales/en/b.jpg"
+                }
+            }];
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_SPLASH_SRC_LOCALES"));
+        });
+    });
+
+    describe("icon", function () {
+        it("throws error when icon element does not contain src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["icon"] = {};
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_ICON_SRC"));
+        });
+
+        it("throws error when icon element contains empty src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["icon"] = {
+                "@": {
+                    "src": ""
+                }
+            };
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_ICON_SRC"));
+        });
+
+        it("throws error when one of many icon elements does not contain attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["icon"] = [{
+                "@": {
+                    "src": "a.jpg"
+                }
+            }, {
+                "#": "blah"
+            }];
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_ICON_SRC"));
+        });
+
+        it("allow one icon element that contains non-empty src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["icon"] = {
+                "@": {
+                    "src": "a.jpg"
+                }
+            };
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).not.toThrow();
+        });
+
+        it("allow multiple icon elements that contain non-empty src attribute", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["icon"] = [{
+                "@": {
+                    "src": "a.jpg"
+                }
+            }, {
+                "@": {
+                    "src": "b.jpg"
+                }
+            }];
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).not.toThrow();
+        });
+
+        it("throws error when icon src starts with 'locales' subfolder", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["icon"] = [{
+                "@": {
+                    "src": "a.jpg"
+                }
+            }, {
+                "@": {
+                    "src": "locales/en/b.jpg"
+                }
+            }];
+
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_ICON_SRC_LOCALES"));
+        });
+
+        it("should copy the default icon to the src dir when no icon specified", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            mockParsing(data);
+
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).not.toThrow();
+
+            expect(packagerUtils.copyFile).toHaveBeenCalled();
+        });
+
+        it("should use the default icon config when no icon is specified", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+            mockParsing(data);
+
+            configParser.parse(configBareMinimumPath, session, function (configObj) {
+                expect(configObj.icon).toEqual(["default-icon.png"]);
+            });
+        });
+
+        it("should not use the default icon config when icon is specified", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["icon"] = {
+                "@": {
+                    "src": "test.png"
+                }
+            };
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.icon).toEqual(["test.png"]);
+                expect(configObj.icon).not.toEqual(["default-icon.png"]);
+                expect(configObj.icon).not.toContain("default-icon.png");
+            });
+        });
+
+        it("sets orientation to landscape when specified", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data['feature'] = { '@': { id: 'blackberry.app', required: true },
+                param: { '@': { name: 'orientation', value: 'landscape' } } };
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.orientation).toEqual("landscape");
+                expect(configObj.autoOrientation).toEqual(false);
+            });
+        });
+
+        it("sets orientation to portrait when specified", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data['feature'] = { '@': { id: 'blackberry.app', required: true },
+                param: { '@': { name: 'orientation', value: 'portrait' } } };
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.orientation).toEqual("portrait");
+                expect(configObj.autoOrientation).toEqual(false);
+            });
+        });
+
+        it("sets auto orientation to true by default", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            delete data["feature"];//Remove any orientation data
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.autoOrientation).toEqual(true);
+            });
+        });
+
+        it("throws a warning when blackberry.app.orientation exists", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data['feature'] = { '@': { id: 'blackberry.app.orientation', required: true },
+                param: { '@': { name: 'mode', value: 'portrait' } } };
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {});
+            expect(logger.warn).toHaveBeenCalled();
+        });
+
+        it("throws an error when blackberry.app orientation exists with an invalid mode param", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data['feature'] = { '@': { id: 'blackberry.app', required: true },
+                param: { '@': { name: 'orientation', value: 'notAValidMode' } } };
+
+            mockParsing(data);
+
+            //Should throw an EXCEPTION_INVALID_ORIENTATION_MODE error
+            expect(function () {
+                configParser.parse(configPath, session, function (configObj) {});
+            }).toThrow(localize.translate("EXCEPTION_INVALID_ORIENTATION_MODE", "notAValidMode"));
+        });
+
+        it("sets backgroundColor when specified via blackberry.app namespace", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data['feature'] = { '@': { id: 'blackberry.app', required: true },
+                param: { '@': { name: 'backgroundColor', value: '0xffffff' } } };
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.backgroundColor).toEqual(16777215);//Decimal value of 0xffffff
+            });
+        });
+
+        it("throws an error when blackberry.app backgroundColor param is not a number", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data['feature'] = { '@': { id: 'blackberry.app', required: true },
+                param: { '@': { name: 'backgroundColor', value: '$UI*@@$' } } };
+
+            mockParsing(data);
+
+            //Should throw an EXCEPTION_BGCOLOR_INVALID error
+            expect(function () {
+                configParser.parse(configPath, session, {});
+            }).toThrow(localize.translate("EXCEPTION_BGCOLOR_INVALID", "$UI*@@$"));
+        });
+
+        it("can properly parse the custom RIM-Wiget:rim/wiget element", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.customHeaders).toEqual({ 'RIM-Widget' : 'rim/widget'});
+            });
+        });
+
+        it("can properly parse the custom attributes but ignores improper headers", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["@"] = {
+                "xmlns": " http://www.w3.org/ns/widgets",
+                "xmlns:rim": "http://www.blackberry.com/ns/widgets",
+                "version": "1.0.0",
+                "id": "myID"
+            };
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.id).toEqual("myID");
+                expect(configObj.customHeaders).toEqual(undefined);
+            });
+        });
+
+        it("can properly parse the custom attributes but ignores improper headers", function () {
+            var data = testUtilities.cloneObj(testData.xml2jsConfig);
+            data["@"] = {
+                "xmlns": " http://www.w3.org/ns/widgets",
+                "xmlns:rim": "http://www.blackberry.com/ns/widgets",
+                "version": "1.0.0",
+                "id": "myID",
+                "rim:userAgent" : "A Test-User-Agent/(Blackberry-Agent)"
+            };
+
+            mockParsing(data);
+
+            configParser.parse(configPath, session, function (configObj) {
+                expect(configObj.id).toEqual("myID");
+                expect(configObj.userAgent).toEqual("A Test-User-Agent/(Blackberry-Agent)");
+            });
+        });
+
+        describe('disabling childBrowser (childWebView)', function () {
+
+            // { '@': { id: 'blackberry.app', required: true, version: '1.0.0.0' },
+            //   param: { '@': { name: 'childBrowser', value: 'disable' } } }
+
+
+            it("sets enableChildWebView to true when childBrowser value is enable", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data['feature'] = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'childBrowser', value: 'enable' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enableChildWebView).toBe(true);
+                });
+            });
+
+            it("sets enableChildWebView to false when value is disable", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data['feature'] = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'childBrowser', value: 'disable' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enableChildWebView).toBe(false);
+                });
+            });
+        });
+
+        describe('disabling formcontrol', function () {
+
+            it("sets enableFormControl to true when formControl value is enable", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data['feature'] = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'formControl', value: 'enable' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enableFormControl).toBe(true);
+                });
+            });
+
+            it("sets enableFormControl to false when value is disable", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data['feature'] = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'formControl', value: 'disable' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enableFormControl).toBe(false);
+                });
+            });
+        });
+
+        describe('setting theme for some core ui elements', function () {
+            function testTheme(themeInConfig, themeParsed) {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+
+                if (themeInConfig) {
+                    data['feature'] = { '@': { id: 'blackberry.app' },
+                        param: { '@': { name: 'theme', value: themeInConfig } } };
+
+                    mockParsing(data);
+                }
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.theme).toBe(themeParsed);
+                });
+            }
+
+            it("sets theme to dark when config has theme with dark", function () {
+                testTheme("dark", "dark");
+            });
+
+            it("sets theme to bright when config has theme with bright", function () {
+                testTheme("bright", "bright");
+            });
+
+            it("sets theme to inherit when config has theme with inherit", function () {
+                testTheme("inherit", "inherit");
+            });
+
+            it("sets theme to default when config has theme with default", function () {
+                testTheme("default", "default");
+            });
+
+            it("sets theme to default when config has unsupported theme", function () {
+                testTheme("unsupportedthemename", "default");
+            });
+
+            it("sets theme to default when config has no theme provided", function () {
+                testTheme(undefined, "default");
+            });
+
+            it("sets theme to dark when config has theme with case insensitive dark", function () {
+                testTheme("dArK", "dark");
+            });
+
+            it("sets theme to bright when config has theme with case insensitive bright", function () {
+                testTheme("BriGht", "bright");
+            });
+
+            it("sets theme to inherit when config has theme with case insensitive inherit", function () {
+                testTheme("inHerIt", "inherit");
+            });
+
+            it("sets theme to inherit when config has theme with case insensitive inherit", function () {
+                testTheme("DefAulT", "default");
+            });
+
+            it("sets theme to default when config has NO theme tag provided", function () {
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.theme).toBe("default");
+                });
+            });
+        });
+
+        describe('disabling WebSecurity', function () {
+
+            // { '@': { id: 'blackberry.app', required: true, version: '1.0.0.0' },
+            //   param: { '@': { name: 'childBrowser', value: 'disable' } } }
+
+
+            it("doesn't set enableWebSecurity to anything when param value is anything but disable", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data.feature = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'websecurity', value: (new Date()).toString() } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enableWebSecurity).toBe(undefined);
+                    expect(logger.warn).not.toHaveBeenCalledWith(localize.translate("WARNING_WEBSECURITY_DISABLED"));
+                });
+            });
+
+            it("sets enableWebSecurity to false when value is disable", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data.feature = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'websecurity', value: 'disable' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enableWebSecurity).toBe(false);
+                    expect(logger.warn).toHaveBeenCalledWith(localize.translate("WARNING_WEBSECURITY_DISABLED"));
+                });
+            });
+
+            it("sets enableWebSecurity to false when value is disable case insensitive", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data.feature = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'websecurity', value: 'DisAble' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enableWebSecurity).toBe(false);
+                    expect(logger.warn).toHaveBeenCalledWith(localize.translate("WARNING_WEBSECURITY_DISABLED"));
+                });
+            });
+        });
+
+        describe('enabling popupBlocker', function () {
+
+            // { '@': { id: 'blackberry.app', required: true, version: '1.0.0.0' },
+            //   param: { '@': { name: 'childBrowser', value: 'disable' } } }
+
+            it("sets enableWebSecurity to false when value is disable", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data.feature = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'popupBlocker', value: 'enable' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enablePopupBlocker).toBe(true);
+                });
+            });
+
+            it("sets enableWebSecurity to false when value is disable case insensitive", function () {
+                var data = testUtilities.cloneObj(testData.xml2jsConfig);
+                data.feature = { '@': { id: 'blackberry.app' },
+                    param: { '@': { name: 'popupBlocker', value: 'EnAbLe' } } };
+
+                mockParsing(data);
+
+                configParser.parse(configPath, session, function (configObj) {
+                    expect(configObj.enablePopupBlocker).toBe(true);
+                });
+            });
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/file-manager.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/file-manager.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/file-manager.js
new file mode 100644
index 0000000..363d625
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/file-manager.js
@@ -0,0 +1,178 @@
+var srcPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    barconf = require(srcPath + "bar-conf.js"),
+    fs = require("fs"),
+    path = require("path"),
+    util = require("util"),
+    packager_utils = require(srcPath + "packager-utils"),
+    localize = require(srcPath + "localize"),
+    wrench = require("wrench"),
+    logger = require(srcPath + "logger"),
+    conf = require(srcPath + "conf"),
+    fileMgr = require(srcPath + "file-manager"),
+    testData = require("./test-data"),
+    testUtilities = require("./test-utilities"),
+    session = testData.session,
+    extManager = {
+        getAllExtensionsToCopy: function (accessList) {
+            return ["app"];
+        },
+        getFeatureIdByExtensionBasename: function (extBasename) {
+            return "blackberry." + extBasename;
+        }
+    };
+
+describe("File manager", function () {
+
+    afterEach(function () {
+        //cleanup packager-tests temp folder
+        wrench.rmdirSyncRecursive(testData.session.outputDir);
+    });
+
+    it("prepareOutputFiles() should copy files and unzip archive", function () {
+        spyOn(wrench, "copyDirSyncRecursive");
+        fileMgr.prepareOutputFiles(session);
+
+        expect(fs.existsSync(session.sourcePaths.CHROME)).toBeTruthy();
+        expect(wrench.copyDirSyncRecursive).toHaveBeenCalledWith(session.conf.DEPENDENCIES_BOOTSTRAP, session.sourcePaths.CHROME);
+        expect(fs.existsSync(session.sourcePaths.LIB)).toBeTruthy();
+    });
+
+
+    it("copyWWE() should copy wwe of the specified target", function () {
+        //Create packager-tests source folder
+        wrench.mkdirSyncRecursive(session.sourceDir);
+
+        spyOn(packager_utils, "copyFile");
+        fileMgr.copyWWE(session, "simulator");
+
+        expect(packager_utils.copyFile).toHaveBeenCalledWith(path.normalize(session.conf.DEPENDENCIES_BOOTSTRAP + "/wwe"), path.normalize(session.sourceDir));
+    });
+
+    it("copyExtensions() should copy all .js files required by features listed in config.xml", function () {
+        var session = testData.session,
+            featureId = "Device",
+            toDir = path.join(session.sourcePaths.EXT, featureId),
+            apiDir = path.resolve(session.conf.EXT, featureId),
+
+            //extension javascript files
+            indexJS = path.join(apiDir, "index.js"),
+            clientJS = path.join(apiDir, "client.js"),
+            subfolderJS = path.join(apiDir, "/subfolder/myjs.js");//Sub folder js file
+
+        //Create packager-tests source folder
+        wrench.mkdirSyncRecursive(session.sourceDir);
+
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "mkdirSyncRecursive");
+        spyOn(packager_utils, "copyFile");
+
+        //Mock the extension directory
+        spyOn(wrench, "readdirSyncRecursive").andCallFake(function (directory) {
+            return [
+                indexJS,
+                clientJS,
+                subfolderJS,
+            ];
+        });
+
+        fileMgr.copyExtensions(session, session.targets[0]);
+
+        //Extension directory is created
+        expect(wrench.mkdirSyncRecursive).toHaveBeenCalledWith(toDir, "0755");
+
+        //Javascript files are copied
+        expect(packager_utils.copyFile).toHaveBeenCalledWith(indexJS, toDir, apiDir);
+        expect(packager_utils.copyFile).toHaveBeenCalledWith(clientJS, toDir, apiDir);
+        expect(packager_utils.copyFile).toHaveBeenCalledWith(subfolderJS, toDir, apiDir);
+    });
+
+    it("copyExtensions() should copy .so files required by features listed in config.xml", function () {
+        var session = testData.session,
+            extBasename = "app",
+            apiDir = path.resolve(session.conf.EXT, extBasename),
+            soDest = session.sourcePaths.JNEXT_PLUGINS,
+
+            //extension .so files
+            simulatorSO = path.join(apiDir, "/simulator/myso.so"),//simulator so file
+            deviceSO = path.join(apiDir, "/device/myso.so");//device so file
+
+        //Create packager-tests source folder
+        wrench.mkdirSyncRecursive(session.sourceDir);
+
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "mkdirSyncRecursive");
+        spyOn(packager_utils, "copyFile");
+
+        //Mock the extension directory
+        spyOn(wrench, "readdirSyncRecursive").andCallFake(function (directory) {
+            return [
+                simulatorSO,
+                deviceSO
+            ];
+        });
+
+        fileMgr.copyExtensions(session, session.targets[0]);
+
+        //plugins/jnext output directory is created
+        expect(wrench.mkdirSyncRecursive).toHaveBeenCalledWith(session.sourcePaths.JNEXT_PLUGINS, "0755");
+
+        //The .so files are copied
+        expect(packager_utils.copyFile).toHaveBeenCalledWith(simulatorSO, soDest);
+        expect(packager_utils.copyFile).toHaveBeenCalledWith(deviceSO, soDest);
+    });
+
+    it("unzip() should extract 'from' zip file to 'to' directory", function () {
+        var from = session.archivePath,
+            to = session.sourceDir;
+
+        fileMgr.unzip(from, to);
+
+        expect(fs.statSync(session.sourceDir + "/a").isDirectory()).toBeTruthy();
+        expect(fs.statSync(session.sourceDir + "/a/dummy.txt").isFile()).toBeTruthy();
+        expect(fs.statSync(session.sourceDir + "/a/b").isDirectory()).toBeTruthy();
+        expect(fs.statSync(session.sourceDir + "/a/b/dummy2.txt").isFile()).toBeTruthy();
+        expect(fs.statSync(session.sourceDir + "/startPage.html").isFile()).toBeTruthy();
+        expect(fs.statSync(session.sourceDir + "/config.xml").isFile()).toBeTruthy();
+        expect(fs.statSync(session.sourceDir + "/test.png").isFile()).toBeTruthy();
+    });
+
+    it("cleanSource() should delete source folder", function () {
+        //Create packager-tests source folder
+        wrench.mkdirSyncRecursive(session.sourceDir);
+
+        fileMgr.cleanSource(session);
+        expect(fs.existsSync(session.sourceDir)).toBeFalsy();
+    });
+
+    it("prepareOutputFiles() should copy files if a folder is sent in", function () {
+        spyOn(wrench, "copyDirSyncRecursive");
+        fileMgr.prepareOutputFiles(session);
+
+        expect(fs.existsSync(session.sourcePaths.CHROME)).toBeTruthy();
+        expect(wrench.copyDirSyncRecursive).toHaveBeenCalledWith(session.conf.DEPENDENCIES_BOOTSTRAP, session.sourcePaths.CHROME);
+        expect(fs.existsSync(session.sourcePaths.LIB)).toBeTruthy();
+    });
+
+    it("prepareOutputFiles() should copy files if a folder is sent in without .bbwpignore", function () {
+        var oldPathExistsSync = fs.existsSync;
+        spyOn(fs, "existsSync").andCallFake(function (ipath) {
+            return path.basename(ipath) === conf.BBWP_IGNORE_FILENAME ? false : oldPathExistsSync(ipath);
+        });
+        spyOn(wrench, "copyDirSyncRecursive");
+        fileMgr.prepareOutputFiles(session);
+
+        expect(fs.existsSync(session.sourcePaths.CHROME)).toBeTruthy();
+        expect(wrench.copyDirSyncRecursive).toHaveBeenCalledWith(session.conf.DEPENDENCIES_BOOTSTRAP, session.sourcePaths.CHROME);
+        expect(fs.existsSync(session.sourcePaths.LIB)).toBeTruthy();
+    });
+
+    it("prepareOutputFiles() should throw an error if the archive path doesn't exist", function () {
+        spyOn(wrench, "copyDirSyncRecursive");
+        var tempSession = testUtilities.cloneObj(session);
+        tempSession.archivePath = path.resolve("test/non-existant.zip");
+        expect(function () {
+            fileMgr.prepareOutputFiles(tempSession);
+        }).toThrow(localize.translate("EXCEPTION_INVALID_ARCHIVE_PATH", tempSession.archivePath));
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/i18n-manager.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/i18n-manager.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/i18n-manager.js
new file mode 100644
index 0000000..50d7225
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/i18n-manager.js
@@ -0,0 +1,298 @@
+/*
+ *  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.
+ */
+var testData = require("./test-data"),
+    i18nMgr = require(testData.libPath + "/i18n-manager"),
+    session = testData.session,
+    fs = require("fs"),
+    wrench = require("wrench"),
+    pkgrUtils = require(testData.libPath + "/packager-utils");
+
+function mockOSReturnFiles(files) {
+    if (pkgrUtils.isWindows()) {
+        var newFiles = [];
+        files.forEach(function (f) {
+            newFiles.push(session.sourceDir + "\\locales\\" + f.split("/").join("\\"));
+        });
+        return newFiles;
+    } else {
+        return files;
+    }
+}
+
+describe("i18n manager", function () {
+    it("generate correct metadata for icon", function () {
+        var config = {
+                icon: ["logo.png"]
+            },
+            xmlObject = {};
+
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "readdirSyncRecursive").andReturn(mockOSReturnFiles([
+            'fr',
+            'fr/logo.png'
+        ]));
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "icon");
+
+        expect(xmlObject.icon).toBeDefined();
+        expect(xmlObject.icon.image).toBeDefined();
+        expect(xmlObject.icon.image.length).toBe(2);
+        expect(xmlObject.icon.image).toContain({
+            _value: "logo.png"
+        });
+        expect(xmlObject.icon.image).toContain({
+            text: {
+                _attr: {
+                    "xml:lang": "fr"
+                },
+                _value: "locales/fr/logo.png"
+            }
+        });
+    });
+
+    it("generate correct metadata for icon when locales folder does not exist", function () {
+        var config = {
+                icon: ["logo.png"]
+            },
+            xmlObject = {};
+
+        spyOn(fs, "existsSync").andReturn(false);
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "icon");
+
+        expect(xmlObject.icon).toBeDefined();
+        expect(xmlObject.icon.image).toBeDefined();
+        expect(xmlObject.icon.image.length).toBe(1);
+        expect(xmlObject.icon.image).toContain({
+            _value: "logo.png"
+        });
+    });
+
+    it("generate correct metadata for icon when locale folder does not contain matching image", function () {
+        var config = {
+                icon: ["logo.png"]
+            },
+            xmlObject = {};
+
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "readdirSyncRecursive").andReturn(mockOSReturnFiles([
+            'fr',
+            'fr/logo-mismatch.png'
+        ]));
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "icon");
+
+        expect(xmlObject.icon).toBeDefined();
+        expect(xmlObject.icon.image).toBeDefined();
+        expect(xmlObject.icon.image.length).toBe(1);
+        expect(xmlObject.icon.image).toContain({
+            _value: "logo.png"
+        });
+    });
+
+    it("generate correct metadata for icon when image is in subfolder", function () {
+        var config = {
+                icon: ["assets\\images\\logo.png"]
+            },
+            xmlObject = {};
+
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "readdirSyncRecursive").andReturn(mockOSReturnFiles([
+            'fr',
+            'fr/assets/images/logo.png'
+        ]));
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "icon");
+
+        expect(xmlObject.icon).toBeDefined();
+        expect(xmlObject.icon.image).toBeDefined();
+        expect(xmlObject.icon.image.length).toBe(2);
+        expect(xmlObject.icon.image).toContain({
+            _value: "assets/images/logo.png"
+        });
+        expect(xmlObject.icon.image).toContain({
+            text: {
+                _attr: {
+                    "xml:lang": "fr"
+                },
+                _value: "locales/fr/assets/images/logo.png"
+            }
+        });
+    });
+
+    it("generate correct metadata for icon when image is in subfolder and OS is windows", function () {
+        var config = {
+                icon: ["assets\\images\\logo.png"]
+            },
+            xmlObject = {};
+
+        spyOn(pkgrUtils, 'isWindows').andReturn(true);
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "readdirSyncRecursive").andReturn(mockOSReturnFiles([
+            'fr',
+            'fr\\assets\\images\\logo.png'
+        ]));
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "icon");
+
+        expect(xmlObject.icon).toBeDefined();
+        expect(xmlObject.icon.image).toBeDefined();
+        expect(xmlObject.icon.image.length).toBe(1);
+        expect(xmlObject.icon.image).toContain({
+            _value: "assets/images/logo.png"
+        });
+    });
+
+    it("generate correct metadata for splash and OS is *nx", function () {
+        var config = {
+                "rim:splash": ["splash-1280x768.jpg", "splash-768x1280.jpg"]
+            },
+            xmlObject = {};
+
+        spyOn(pkgrUtils, 'isWindows').andReturn(false);
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "readdirSyncRecursive").andReturn(mockOSReturnFiles([
+            'fr',
+            'fr/splash-1280x768.jpg',
+            'fr/splash-768x1280.jpg'
+        ]));
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "rim:splash");
+
+        expect(xmlObject.splashScreens).toBeDefined();
+        expect(xmlObject.splashScreens.image).toBeDefined();
+        expect(xmlObject.splashScreens.image.length).toBe(4);
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "splash-1280x768.jpg"
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "splash-768x1280.jpg"
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            text: {
+                _attr: {
+                    "xml:lang": "fr"
+                },
+                _value: "locales/fr/splash-1280x768.jpg"
+            }
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            text: {
+                _attr: {
+                    "xml:lang": "fr"
+                },
+                _value: "locales/fr/splash-768x1280.jpg"
+            }
+        });
+    });
+
+    it("generate correct metadata for splash when locales folder does not exist", function () {
+        var config = {
+                "rim:splash": ["splash-1280x768.jpg", "splash-768x1280.jpg"]
+            },
+            xmlObject = {};
+
+        spyOn(fs, "existsSync").andReturn(false);
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "rim:splash");
+
+        expect(xmlObject.splashScreens).toBeDefined();
+        expect(xmlObject.splashScreens.image).toBeDefined();
+        expect(xmlObject.splashScreens.image.length).toBe(2);
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "splash-1280x768.jpg"
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "splash-768x1280.jpg"
+        });
+    });
+
+    it("generate correct metadata for splash when locale folder does not contain matching image", function () {
+        var config = {
+                "rim:splash": ["splash-1280x768.jpg", "splash-768x1280.jpg"]
+            },
+            xmlObject = {};
+
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "readdirSyncRecursive").andReturn(mockOSReturnFiles([
+            'fr',
+            'fr/splash-1280x768-mismatch.jpg',
+            'fr/splash-768x1280.jpg'
+        ]));
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "rim:splash");
+
+        expect(xmlObject.splashScreens).toBeDefined();
+        expect(xmlObject.splashScreens.image).toBeDefined();
+        expect(xmlObject.splashScreens.image.length).toBe(3);
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "splash-1280x768.jpg"
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "splash-768x1280.jpg"
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            text: {
+                _attr: {
+                    "xml:lang": "fr"
+                },
+                _value: "locales/fr/splash-768x1280.jpg"
+            }
+        });
+    });
+
+    it("generate correct metadata for splash when image is in subfolder", function () {
+        var config = {
+                "rim:splash": ["assets\\images\\splash-1280x768.jpg", "assets\\images\\splash-768x1280.jpg"]
+            },
+            xmlObject = {};
+
+        spyOn(fs, "existsSync").andReturn(true);
+        spyOn(wrench, "readdirSyncRecursive").andReturn(mockOSReturnFiles([
+            'fr',
+            'fr/assets/images/splash-1280x768.jpg',
+            'fr/assets/images/splash-768x1280.jpg'
+        ]));
+
+        i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "rim:splash");
+
+        expect(xmlObject.splashScreens).toBeDefined();
+        expect(xmlObject.splashScreens.image).toBeDefined();
+        expect(xmlObject.splashScreens.image.length).toBe(4);
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "assets/images/splash-1280x768.jpg"
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            _value: "assets/images/splash-768x1280.jpg"
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            text: {
+                _attr: {
+                    "xml:lang": "fr"
+                },
+                _value: "locales/fr/assets/images/splash-1280x768.jpg"
+            }
+        });
+        expect(xmlObject.splashScreens.image).toContain({
+            text: {
+                _attr: {
+                    "xml:lang": "fr"
+                },
+                _value: "locales/fr/assets/images/splash-768x1280.jpg"
+            }
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/logger.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/logger.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/logger.js
new file mode 100644
index 0000000..c8aadb9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/logger.js
@@ -0,0 +1,101 @@
+/*
+ *  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.
+ */
+
+var srcPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    logger = require(srcPath + "logger");
+
+describe("logger", function () {
+    describe("when the log level is verbose", function () {
+        beforeEach(function () {
+            spyOn(console, "log");
+            logger.level('verbose');
+        });
+
+        it("logs info messages", function () {
+            logger.info("cheese is made from milk");
+            expect(console.log).toHaveBeenCalledWith("[INFO]    cheese is made from milk");
+        });
+
+        it("logs error messages", function () {
+            logger.error("PC LOAD LETTER");
+            expect(console.log).toHaveBeenCalledWith("[ERROR]   PC LOAD LETTER");
+        });
+
+        it("logs warning messages", function () {
+            logger.warn("beware the ides of march");
+            expect(console.log).toHaveBeenCalledWith("[WARN]    beware the ides of march");
+        });
+
+        it("logs messages", function () {
+            logger.log("Hulk Smash!");
+            expect(console.log).toHaveBeenCalledWith("[BUILD]   Hulk Smash!");
+        });
+    });
+
+    describe("when the log level is warn", function () {
+        beforeEach(function () {
+            spyOn(console, "log");
+            logger.level('warn');
+        });
+
+        it("doesn't log info messages", function () {
+            logger.info("cheese is made from milk");
+            expect(console.log).not.toHaveBeenCalledWith("[INFO]    cheese is made from milk");
+        });
+
+        it("logs error messages", function () {
+            logger.error("PC LOAD LETTER");
+            expect(console.log).toHaveBeenCalledWith("[ERROR]   PC LOAD LETTER");
+        });
+
+        it("logs warning messages", function () {
+            logger.warn("beware the ides of march");
+            expect(console.log).toHaveBeenCalledWith("[WARN]    beware the ides of march");
+        });
+
+        it("logs messages", function () {
+            logger.log("Hulk Smash!");
+            expect(console.log).toHaveBeenCalledWith("[BUILD]   Hulk Smash!");
+        });
+    });
+
+    describe("when the log level is error", function () {
+        beforeEach(function () {
+            spyOn(console, "log");
+            logger.level('error');
+        });
+
+        it("doesn't log info messages", function () {
+            logger.info("cheese is made from milk");
+            expect(console.log).not.toHaveBeenCalledWith("[INFO]    cheese is made from milk");
+        });
+
+        it("logs error messages", function () {
+            logger.error("PC LOAD LETTER");
+            expect(console.log).toHaveBeenCalledWith("[ERROR]   PC LOAD LETTER");
+        });
+
+        it("doesn't log warning messages", function () {
+            logger.warn("beware the ides of march");
+            expect(console.log).not.toHaveBeenCalledWith("[WARN]    beware the ides of march");
+        });
+
+        it("logs messages", function () {
+            logger.log("Hulk Smash!");
+            expect(console.log).toHaveBeenCalledWith("[BUILD]   Hulk Smash!");
+        });
+    });
+});


[22/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
new file mode 100644
index 0000000..03bf89a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
@@ -0,0 +1,2529 @@
+var isCommonJS = typeof window == "undefined";
+
+/**
+ * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
+ *
+ * @namespace
+ */
+var jasmine = {};
+if (isCommonJS) exports.jasmine = jasmine;
+/**
+ * @private
+ */
+jasmine.unimplementedMethod_ = function() {
+  throw new Error("unimplemented method");
+};
+
+/**
+ * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
+ * a plain old variable and may be redefined by somebody else.
+ *
+ * @private
+ */
+jasmine.undefined = jasmine.___undefined___;
+
+/**
+ * Show diagnostic messages in the console if set to true
+ *
+ */
+jasmine.VERBOSE = false;
+
+/**
+ * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
+ *
+ */
+jasmine.DEFAULT_UPDATE_INTERVAL = 250;
+
+/**
+ * Default timeout interval in milliseconds for waitsFor() blocks.
+ */
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
+
+jasmine.getGlobal = function() {
+  function getGlobal() {
+    return this;
+  }
+
+  return getGlobal();
+};
+
+/**
+ * Allows for bound functions to be compared.  Internal use only.
+ *
+ * @ignore
+ * @private
+ * @param base {Object} bound 'this' for the function
+ * @param name {Function} function to find
+ */
+jasmine.bindOriginal_ = function(base, name) {
+  var original = base[name];
+  if (original.apply) {
+    return function() {
+      return original.apply(base, arguments);
+    };
+  } else {
+    // IE support
+    return jasmine.getGlobal()[name];
+  }
+};
+
+jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
+jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
+jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
+jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
+
+jasmine.MessageResult = function(values) {
+  this.type = 'log';
+  this.values = values;
+  this.trace = new Error(); // todo: test better
+};
+
+jasmine.MessageResult.prototype.toString = function() {
+  var text = "";
+  for (var i = 0; i < this.values.length; i++) {
+    if (i > 0) text += " ";
+    if (jasmine.isString_(this.values[i])) {
+      text += this.values[i];
+    } else {
+      text += jasmine.pp(this.values[i]);
+    }
+  }
+  return text;
+};
+
+jasmine.ExpectationResult = function(params) {
+  this.type = 'expect';
+  this.matcherName = params.matcherName;
+  this.passed_ = params.passed;
+  this.expected = params.expected;
+  this.actual = params.actual;
+  this.message = this.passed_ ? 'Passed.' : params.message;
+
+  var trace = (params.trace || new Error(this.message));
+  this.trace = this.passed_ ? '' : trace;
+};
+
+jasmine.ExpectationResult.prototype.toString = function () {
+  return this.message;
+};
+
+jasmine.ExpectationResult.prototype.passed = function () {
+  return this.passed_;
+};
+
+/**
+ * Getter for the Jasmine environment. Ensures one gets created
+ */
+jasmine.getEnv = function() {
+  var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
+  return env;
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isArray_ = function(value) {
+  return jasmine.isA_("Array", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isString_ = function(value) {
+  return jasmine.isA_("String", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isNumber_ = function(value) {
+  return jasmine.isA_("Number", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param {String} typeName
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isA_ = function(typeName, value) {
+  return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
+};
+
+/**
+ * Pretty printer for expecations.  Takes any object and turns it into a human-readable string.
+ *
+ * @param value {Object} an object to be outputted
+ * @returns {String}
+ */
+jasmine.pp = function(value) {
+  var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
+  stringPrettyPrinter.format(value);
+  return stringPrettyPrinter.string;
+};
+
+/**
+ * Returns true if the object is a DOM Node.
+ *
+ * @param {Object} obj object to check
+ * @returns {Boolean}
+ */
+jasmine.isDomNode = function(obj) {
+  return obj.nodeType > 0;
+};
+
+/**
+ * Returns a matchable 'generic' object of the class type.  For use in expecations of type when values don't matter.
+ *
+ * @example
+ * // don't care about which function is passed in, as long as it's a function
+ * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
+ *
+ * @param {Class} clazz
+ * @returns matchable object of the type clazz
+ */
+jasmine.any = function(clazz) {
+  return new jasmine.Matchers.Any(clazz);
+};
+
+/**
+ * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the
+ * attributes on the object.
+ *
+ * @example
+ * // don't care about any other attributes than foo.
+ * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"});
+ *
+ * @param sample {Object} sample
+ * @returns matchable object for the sample
+ */
+jasmine.objectContaining = function (sample) {
+    return new jasmine.Matchers.ObjectContaining(sample);
+};
+
+/**
+ * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
+ *
+ * Spies should be created in test setup, before expectations.  They can then be checked, using the standard Jasmine
+ * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
+ *
+ * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
+ *
+ * Spies are torn down at the end of every spec.
+ *
+ * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
+ *
+ * @example
+ * // a stub
+ * var myStub = jasmine.createSpy('myStub');  // can be used anywhere
+ *
+ * // spy example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ *
+ * // actual foo.not will not be called, execution stops
+ * spyOn(foo, 'not');
+
+ // foo.not spied upon, execution will continue to implementation
+ * spyOn(foo, 'not').andCallThrough();
+ *
+ * // fake example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ *
+ * // foo.not(val) will return val
+ * spyOn(foo, 'not').andCallFake(function(value) {return value;});
+ *
+ * // mock example
+ * foo.not(7 == 7);
+ * expect(foo.not).toHaveBeenCalled();
+ * expect(foo.not).toHaveBeenCalledWith(true);
+ *
+ * @constructor
+ * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
+ * @param {String} name
+ */
+jasmine.Spy = function(name) {
+  /**
+   * The name of the spy, if provided.
+   */
+  this.identity = name || 'unknown';
+  /**
+   *  Is this Object a spy?
+   */
+  this.isSpy = true;
+  /**
+   * The actual function this spy stubs.
+   */
+  this.plan = function() {
+  };
+  /**
+   * Tracking of the most recent call to the spy.
+   * @example
+   * var mySpy = jasmine.createSpy('foo');
+   * mySpy(1, 2);
+   * mySpy.mostRecentCall.args = [1, 2];
+   */
+  this.mostRecentCall = {};
+
+  /**
+   * Holds arguments for each call to the spy, indexed by call count
+   * @example
+   * var mySpy = jasmine.createSpy('foo');
+   * mySpy(1, 2);
+   * mySpy(7, 8);
+   * mySpy.mostRecentCall.args = [7, 8];
+   * mySpy.argsForCall[0] = [1, 2];
+   * mySpy.argsForCall[1] = [7, 8];
+   */
+  this.argsForCall = [];
+  this.calls = [];
+};
+
+/**
+ * Tells a spy to call through to the actual implemenatation.
+ *
+ * @example
+ * var foo = {
+ *   bar: function() { // do some stuff }
+ * }
+ *
+ * // defining a spy on an existing property: foo.bar
+ * spyOn(foo, 'bar').andCallThrough();
+ */
+jasmine.Spy.prototype.andCallThrough = function() {
+  this.plan = this.originalValue;
+  return this;
+};
+
+/**
+ * For setting the return value of a spy.
+ *
+ * @example
+ * // defining a spy from scratch: foo() returns 'baz'
+ * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
+ *
+ * // defining a spy on an existing property: foo.bar() returns 'baz'
+ * spyOn(foo, 'bar').andReturn('baz');
+ *
+ * @param {Object} value
+ */
+jasmine.Spy.prototype.andReturn = function(value) {
+  this.plan = function() {
+    return value;
+  };
+  return this;
+};
+
+/**
+ * For throwing an exception when a spy is called.
+ *
+ * @example
+ * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
+ * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
+ *
+ * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
+ * spyOn(foo, 'bar').andThrow('baz');
+ *
+ * @param {String} exceptionMsg
+ */
+jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
+  this.plan = function() {
+    throw exceptionMsg;
+  };
+  return this;
+};
+
+/**
+ * Calls an alternate implementation when a spy is called.
+ *
+ * @example
+ * var baz = function() {
+ *   // do some stuff, return something
+ * }
+ * // defining a spy from scratch: foo() calls the function baz
+ * var foo = jasmine.createSpy('spy on foo').andCall(baz);
+ *
+ * // defining a spy on an existing property: foo.bar() calls an anonymnous function
+ * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
+ *
+ * @param {Function} fakeFunc
+ */
+jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
+  this.plan = fakeFunc;
+  return this;
+};
+
+/**
+ * Resets all of a spy's the tracking variables so that it can be used again.
+ *
+ * @example
+ * spyOn(foo, 'bar');
+ *
+ * foo.bar();
+ *
+ * expect(foo.bar.callCount).toEqual(1);
+ *
+ * foo.bar.reset();
+ *
+ * expect(foo.bar.callCount).toEqual(0);
+ */
+jasmine.Spy.prototype.reset = function() {
+  this.wasCalled = false;
+  this.callCount = 0;
+  this.argsForCall = [];
+  this.calls = [];
+  this.mostRecentCall = {};
+};
+
+jasmine.createSpy = function(name) {
+
+  var spyObj = function() {
+    spyObj.wasCalled = true;
+    spyObj.callCount++;
+    var args = jasmine.util.argsToArray(arguments);
+    spyObj.mostRecentCall.object = this;
+    spyObj.mostRecentCall.args = args;
+    spyObj.argsForCall.push(args);
+    spyObj.calls.push({object: this, args: args});
+    return spyObj.plan.apply(this, arguments);
+  };
+
+  var spy = new jasmine.Spy(name);
+
+  for (var prop in spy) {
+    spyObj[prop] = spy[prop];
+  }
+
+  spyObj.reset();
+
+  return spyObj;
+};
+
+/**
+ * Determines whether an object is a spy.
+ *
+ * @param {jasmine.Spy|Object} putativeSpy
+ * @returns {Boolean}
+ */
+jasmine.isSpy = function(putativeSpy) {
+  return putativeSpy && putativeSpy.isSpy;
+};
+
+/**
+ * Creates a more complicated spy: an Object that has every property a function that is a spy.  Used for stubbing something
+ * large in one call.
+ *
+ * @param {String} baseName name of spy class
+ * @param {Array} methodNames array of names of methods to make spies
+ */
+jasmine.createSpyObj = function(baseName, methodNames) {
+  if (!jasmine.isArray_(methodNames) || methodNames.length === 0) {
+    throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
+  }
+  var obj = {};
+  for (var i = 0; i < methodNames.length; i++) {
+    obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
+  }
+  return obj;
+};
+
+/**
+ * All parameters are pretty-printed and concatenated together, then written to the current spec's output.
+ *
+ * Be careful not to leave calls to <code>jasmine.log</code> in production code.
+ */
+jasmine.log = function() {
+  var spec = jasmine.getEnv().currentSpec;
+  spec.log.apply(spec, arguments);
+};
+
+/**
+ * Function that installs a spy on an existing object's method name.  Used within a Spec to create a spy.
+ *
+ * @example
+ * // spy example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
+ *
+ * @see jasmine.createSpy
+ * @param obj
+ * @param methodName
+ * @returns a Jasmine spy that can be chained with all spy methods
+ */
+var spyOn = function(obj, methodName) {
+  return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
+};
+if (isCommonJS) exports.spyOn = spyOn;
+
+/**
+ * Creates a Jasmine spec that will be added to the current suite.
+ *
+ * // TODO: pending tests
+ *
+ * @example
+ * it('should be true', function() {
+ *   expect(true).toEqual(true);
+ * });
+ *
+ * @param {String} desc description of this specification
+ * @param {Function} func defines the preconditions and expectations of the spec
+ */
+var it = function(desc, func) {
+  return jasmine.getEnv().it(desc, func);
+};
+if (isCommonJS) exports.it = it;
+
+/**
+ * Creates a <em>disabled</em> Jasmine spec.
+ *
+ * A convenience method that allows existing specs to be disabled temporarily during development.
+ *
+ * @param {String} desc description of this specification
+ * @param {Function} func defines the preconditions and expectations of the spec
+ */
+var xit = function(desc, func) {
+  return jasmine.getEnv().xit(desc, func);
+};
+if (isCommonJS) exports.xit = xit;
+
+/**
+ * Starts a chain for a Jasmine expectation.
+ *
+ * It is passed an Object that is the actual value and should chain to one of the many
+ * jasmine.Matchers functions.
+ *
+ * @param {Object} actual Actual value to test against and expected value
+ */
+var expect = function(actual) {
+  return jasmine.getEnv().currentSpec.expect(actual);
+};
+if (isCommonJS) exports.expect = expect;
+
+/**
+ * Defines part of a jasmine spec.  Used in cominbination with waits or waitsFor in asynchrnous specs.
+ *
+ * @param {Function} func Function that defines part of a jasmine spec.
+ */
+var runs = function(func) {
+  jasmine.getEnv().currentSpec.runs(func);
+};
+if (isCommonJS) exports.runs = runs;
+
+/**
+ * Waits a fixed time period before moving to the next block.
+ *
+ * @deprecated Use waitsFor() instead
+ * @param {Number} timeout milliseconds to wait
+ */
+var waits = function(timeout) {
+  jasmine.getEnv().currentSpec.waits(timeout);
+};
+if (isCommonJS) exports.waits = waits;
+
+/**
+ * Waits for the latchFunction to return true before proceeding to the next block.
+ *
+ * @param {Function} latchFunction
+ * @param {String} optional_timeoutMessage
+ * @param {Number} optional_timeout
+ */
+var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
+  jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
+};
+if (isCommonJS) exports.waitsFor = waitsFor;
+
+/**
+ * A function that is called before each spec in a suite.
+ *
+ * Used for spec setup, including validating assumptions.
+ *
+ * @param {Function} beforeEachFunction
+ */
+var beforeEach = function(beforeEachFunction) {
+  jasmine.getEnv().beforeEach(beforeEachFunction);
+};
+if (isCommonJS) exports.beforeEach = beforeEach;
+
+/**
+ * A function that is called after each spec in a suite.
+ *
+ * Used for restoring any state that is hijacked during spec execution.
+ *
+ * @param {Function} afterEachFunction
+ */
+var afterEach = function(afterEachFunction) {
+  jasmine.getEnv().afterEach(afterEachFunction);
+};
+if (isCommonJS) exports.afterEach = afterEach;
+
+/**
+ * Defines a suite of specifications.
+ *
+ * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
+ * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
+ * of setup in some tests.
+ *
+ * @example
+ * // TODO: a simple suite
+ *
+ * // TODO: a simple suite with a nested describe block
+ *
+ * @param {String} description A string, usually the class under test.
+ * @param {Function} specDefinitions function that defines several specs.
+ */
+var describe = function(description, specDefinitions) {
+  return jasmine.getEnv().describe(description, specDefinitions);
+};
+if (isCommonJS) exports.describe = describe;
+
+/**
+ * Disables a suite of specifications.  Used to disable some suites in a file, or files, temporarily during development.
+ *
+ * @param {String} description A string, usually the class under test.
+ * @param {Function} specDefinitions function that defines several specs.
+ */
+var xdescribe = function(description, specDefinitions) {
+  return jasmine.getEnv().xdescribe(description, specDefinitions);
+};
+if (isCommonJS) exports.xdescribe = xdescribe;
+
+
+// Provide the XMLHttpRequest class for IE 5.x-6.x:
+jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
+  function tryIt(f) {
+    try {
+      return f();
+    } catch(e) {
+    }
+    return null;
+  }
+
+  var xhr = tryIt(function() {
+    return new ActiveXObject("Msxml2.XMLHTTP.6.0");
+  }) ||
+    tryIt(function() {
+      return new ActiveXObject("Msxml2.XMLHTTP.3.0");
+    }) ||
+    tryIt(function() {
+      return new ActiveXObject("Msxml2.XMLHTTP");
+    }) ||
+    tryIt(function() {
+      return new ActiveXObject("Microsoft.XMLHTTP");
+    });
+
+  if (!xhr) throw new Error("This browser does not support XMLHttpRequest.");
+
+  return xhr;
+} : XMLHttpRequest;
+/**
+ * @namespace
+ */
+jasmine.util = {};
+
+/**
+ * Declare that a child class inherit it's prototype from the parent class.
+ *
+ * @private
+ * @param {Function} childClass
+ * @param {Function} parentClass
+ */
+jasmine.util.inherit = function(childClass, parentClass) {
+  /**
+   * @private
+   */
+  var subclass = function() {
+  };
+  subclass.prototype = parentClass.prototype;
+  childClass.prototype = new subclass();
+};
+
+jasmine.util.formatException = function(e) {
+  var lineNumber;
+  if (e.line) {
+    lineNumber = e.line;
+  }
+  else if (e.lineNumber) {
+    lineNumber = e.lineNumber;
+  }
+
+  var file;
+
+  if (e.sourceURL) {
+    file = e.sourceURL;
+  }
+  else if (e.fileName) {
+    file = e.fileName;
+  }
+
+  var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
+
+  if (file && lineNumber) {
+    message += ' in ' + file + ' (line ' + lineNumber + ')';
+  }
+
+  return message;
+};
+
+jasmine.util.htmlEscape = function(str) {
+  if (!str) return str;
+  return str.replace(/&/g, '&amp;')
+    .replace(/</g, '&lt;')
+    .replace(/>/g, '&gt;');
+};
+
+jasmine.util.argsToArray = function(args) {
+  var arrayOfArgs = [];
+  for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
+  return arrayOfArgs;
+};
+
+jasmine.util.extend = function(destination, source) {
+  for (var property in source) destination[property] = source[property];
+  return destination;
+};
+
+/**
+ * Environment for Jasmine
+ *
+ * @constructor
+ */
+jasmine.Env = function() {
+  this.currentSpec = null;
+  this.currentSuite = null;
+  this.currentRunner_ = new jasmine.Runner(this);
+
+  this.reporter = new jasmine.MultiReporter();
+
+  this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
+  this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
+  this.lastUpdate = 0;
+  this.specFilter = function() {
+    return true;
+  };
+
+  this.nextSpecId_ = 0;
+  this.nextSuiteId_ = 0;
+  this.equalityTesters_ = [];
+
+  // wrap matchers
+  this.matchersClass = function() {
+    jasmine.Matchers.apply(this, arguments);
+  };
+  jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
+
+  jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
+};
+
+
+jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
+jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
+jasmine.Env.prototype.setInterval = jasmine.setInterval;
+jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
+
+/**
+ * @returns an object containing jasmine version build info, if set.
+ */
+jasmine.Env.prototype.version = function () {
+  if (jasmine.version_) {
+    return jasmine.version_;
+  } else {
+    throw new Error('Version not set');
+  }
+};
+
+/**
+ * @returns string containing jasmine version build info, if set.
+ */
+jasmine.Env.prototype.versionString = function() {
+  if (!jasmine.version_) {
+    return "version unknown";
+  }
+
+  var version = this.version();
+  var versionString = version.major + "." + version.minor + "." + version.build;
+  if (version.release_candidate) {
+    versionString += ".rc" + version.release_candidate;
+  }
+  versionString += " revision " + version.revision;
+  return versionString;
+};
+
+/**
+ * @returns a sequential integer starting at 0
+ */
+jasmine.Env.prototype.nextSpecId = function () {
+  return this.nextSpecId_++;
+};
+
+/**
+ * @returns a sequential integer starting at 0
+ */
+jasmine.Env.prototype.nextSuiteId = function () {
+  return this.nextSuiteId_++;
+};
+
+/**
+ * Register a reporter to receive status updates from Jasmine.
+ * @param {jasmine.Reporter} reporter An object which will receive status updates.
+ */
+jasmine.Env.prototype.addReporter = function(reporter) {
+  this.reporter.addReporter(reporter);
+};
+
+jasmine.Env.prototype.execute = function() {
+  this.currentRunner_.execute();
+};
+
+jasmine.Env.prototype.describe = function(description, specDefinitions) {
+  var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
+
+  var parentSuite = this.currentSuite;
+  if (parentSuite) {
+    parentSuite.add(suite);
+  } else {
+    this.currentRunner_.add(suite);
+  }
+
+  this.currentSuite = suite;
+
+  var declarationError = null;
+  try {
+    specDefinitions.call(suite);
+  } catch(e) {
+    declarationError = e;
+  }
+
+  if (declarationError) {
+    this.it("encountered a declaration exception", function() {
+      throw declarationError;
+    });
+  }
+
+  this.currentSuite = parentSuite;
+
+  return suite;
+};
+
+jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
+  if (this.currentSuite) {
+    this.currentSuite.beforeEach(beforeEachFunction);
+  } else {
+    this.currentRunner_.beforeEach(beforeEachFunction);
+  }
+};
+
+jasmine.Env.prototype.currentRunner = function () {
+  return this.currentRunner_;
+};
+
+jasmine.Env.prototype.afterEach = function(afterEachFunction) {
+  if (this.currentSuite) {
+    this.currentSuite.afterEach(afterEachFunction);
+  } else {
+    this.currentRunner_.afterEach(afterEachFunction);
+  }
+
+};
+
+jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
+  return {
+    execute: function() {
+    }
+  };
+};
+
+jasmine.Env.prototype.it = function(description, func) {
+  var spec = new jasmine.Spec(this, this.currentSuite, description);
+  this.currentSuite.add(spec);
+  this.currentSpec = spec;
+
+  if (func) {
+    spec.runs(func);
+  }
+
+  return spec;
+};
+
+jasmine.Env.prototype.xit = function(desc, func) {
+  return {
+    id: this.nextSpecId(),
+    runs: function() {
+    }
+  };
+};
+
+jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
+  if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
+    return true;
+  }
+
+  a.__Jasmine_been_here_before__ = b;
+  b.__Jasmine_been_here_before__ = a;
+
+  var hasKey = function(obj, keyName) {
+    return obj !== null && obj[keyName] !== jasmine.undefined;
+  };
+
+  for (var property in b) {
+    if (!hasKey(a, property) && hasKey(b, property)) {
+      mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
+    }
+  }
+  for (property in a) {
+    if (!hasKey(b, property) && hasKey(a, property)) {
+      mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
+    }
+  }
+  for (property in b) {
+    if (property == '__Jasmine_been_here_before__') continue;
+    if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
+      mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
+    }
+  }
+
+  if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
+    mismatchValues.push("arrays were not the same length");
+  }
+
+  delete a.__Jasmine_been_here_before__;
+  delete b.__Jasmine_been_here_before__;
+  return (mismatchKeys.length === 0 && mismatchValues.length === 0);
+};
+
+jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
+  mismatchKeys = mismatchKeys || [];
+  mismatchValues = mismatchValues || [];
+
+  for (var i = 0; i < this.equalityTesters_.length; i++) {
+    var equalityTester = this.equalityTesters_[i];
+    var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
+    if (result !== jasmine.undefined) return result;
+  }
+
+  if (a === b) return true;
+
+  if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
+    return (a == jasmine.undefined && b == jasmine.undefined);
+  }
+
+  if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
+    return a === b;
+  }
+
+  if (a instanceof Date && b instanceof Date) {
+    return a.getTime() == b.getTime();
+  }
+
+  if (a.jasmineMatches) {
+    return a.jasmineMatches(b);
+  }
+
+  if (b.jasmineMatches) {
+    return b.jasmineMatches(a);
+  }
+
+  if (a instanceof jasmine.Matchers.ObjectContaining) {
+    return a.matches(b);
+  }
+
+  if (b instanceof jasmine.Matchers.ObjectContaining) {
+    return b.matches(a);
+  }
+
+  if (jasmine.isString_(a) && jasmine.isString_(b)) {
+    return (a == b);
+  }
+
+  if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
+    return (a == b);
+  }
+
+  if (typeof a === "object" && typeof b === "object") {
+    return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
+  }
+
+  //Straight check
+  return (a === b);
+};
+
+jasmine.Env.prototype.contains_ = function(haystack, needle) {
+  if (jasmine.isArray_(haystack)) {
+    for (var i = 0; i < haystack.length; i++) {
+      if (this.equals_(haystack[i], needle)) return true;
+    }
+    return false;
+  }
+  return haystack.indexOf(needle) >= 0;
+};
+
+jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
+  this.equalityTesters_.push(equalityTester);
+};
+/** No-op base class for Jasmine reporters.
+ *
+ * @constructor
+ */
+jasmine.Reporter = function() {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSpecResults = function(spec) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.log = function(str) {
+};
+
+/**
+ * Blocks are functions with executable code that make up a spec.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {Function} func
+ * @param {jasmine.Spec} spec
+ */
+jasmine.Block = function(env, func, spec) {
+  this.env = env;
+  this.func = func;
+  this.spec = spec;
+};
+
+jasmine.Block.prototype.execute = function(onComplete) {  
+  try {
+    this.func.apply(this.spec);
+  } catch (e) {
+    this.spec.fail(e);
+  }
+  onComplete();
+};
+/** JavaScript API reporter.
+ *
+ * @constructor
+ */
+jasmine.JsApiReporter = function() {
+  this.started = false;
+  this.finished = false;
+  this.suites_ = [];
+  this.results_ = {};
+};
+
+jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
+  this.started = true;
+  var suites = runner.topLevelSuites();
+  for (var i = 0; i < suites.length; i++) {
+    var suite = suites[i];
+    this.suites_.push(this.summarize_(suite));
+  }
+};
+
+jasmine.JsApiReporter.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
+  var isSuite = suiteOrSpec instanceof jasmine.Suite;
+  var summary = {
+    id: suiteOrSpec.id,
+    name: suiteOrSpec.description,
+    type: isSuite ? 'suite' : 'spec',
+    children: []
+  };
+  
+  if (isSuite) {
+    var children = suiteOrSpec.children();
+    for (var i = 0; i < children.length; i++) {
+      summary.children.push(this.summarize_(children[i]));
+    }
+  }
+  return summary;
+};
+
+jasmine.JsApiReporter.prototype.results = function() {
+  return this.results_;
+};
+
+jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
+  return this.results_[specId];
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
+  this.finished = true;
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
+  this.results_[spec.id] = {
+    messages: spec.results().getItems(),
+    result: spec.results().failedCount > 0 ? "failed" : "passed"
+  };
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.log = function(str) {
+};
+
+jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
+  var results = {};
+  for (var i = 0; i < specIds.length; i++) {
+    var specId = specIds[i];
+    results[specId] = this.summarizeResult_(this.results_[specId]);
+  }
+  return results;
+};
+
+jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
+  var summaryMessages = [];
+  var messagesLength = result.messages.length;
+  for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
+    var resultMessage = result.messages[messageIndex];
+    summaryMessages.push({
+      text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
+      passed: resultMessage.passed ? resultMessage.passed() : true,
+      type: resultMessage.type,
+      message: resultMessage.message,
+      trace: {
+        stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
+      }
+    });
+  }
+
+  return {
+    result : result.result,
+    messages : summaryMessages
+  };
+};
+
+/**
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param actual
+ * @param {jasmine.Spec} spec
+ */
+jasmine.Matchers = function(env, actual, spec, opt_isNot) {
+  this.env = env;
+  this.actual = actual;
+  this.spec = spec;
+  this.isNot = opt_isNot || false;
+  this.reportWasCalled_ = false;
+};
+
+// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
+jasmine.Matchers.pp = function(str) {
+  throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
+};
+
+// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
+jasmine.Matchers.prototype.report = function(result, failing_message, details) {
+  throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
+};
+
+jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
+  for (var methodName in prototype) {
+    if (methodName == 'report') continue;
+    var orig = prototype[methodName];
+    matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
+  }
+};
+
+jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
+  return function() {
+    var matcherArgs = jasmine.util.argsToArray(arguments);
+    var result = matcherFunction.apply(this, arguments);
+
+    if (this.isNot) {
+      result = !result;
+    }
+
+    if (this.reportWasCalled_) return result;
+
+    var message;
+    if (!result) {
+      if (this.message) {
+        message = this.message.apply(this, arguments);
+        if (jasmine.isArray_(message)) {
+          message = message[this.isNot ? 1 : 0];
+        }
+      } else {
+        var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
+        message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
+        if (matcherArgs.length > 0) {
+          for (var i = 0; i < matcherArgs.length; i++) {
+            if (i > 0) message += ",";
+            message += " " + jasmine.pp(matcherArgs[i]);
+          }
+        }
+        message += ".";
+      }
+    }
+    var expectationResult = new jasmine.ExpectationResult({
+      matcherName: matcherName,
+      passed: result,
+      expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
+      actual: this.actual,
+      message: message
+    });
+    this.spec.addMatcherResult(expectationResult);
+    return jasmine.undefined;
+  };
+};
+
+
+
+
+/**
+ * toBe: compares the actual to the expected using ===
+ * @param expected
+ */
+jasmine.Matchers.prototype.toBe = function(expected) {
+  return this.actual === expected;
+};
+
+/**
+ * toNotBe: compares the actual to the expected using !==
+ * @param expected
+ * @deprecated as of 1.0. Use not.toBe() instead.
+ */
+jasmine.Matchers.prototype.toNotBe = function(expected) {
+  return this.actual !== expected;
+};
+
+/**
+ * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
+ *
+ * @param expected
+ */
+jasmine.Matchers.prototype.toEqual = function(expected) {
+  return this.env.equals_(this.actual, expected);
+};
+
+/**
+ * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
+ * @param expected
+ * @deprecated as of 1.0. Use not.toEqual() instead.
+ */
+jasmine.Matchers.prototype.toNotEqual = function(expected) {
+  return !this.env.equals_(this.actual, expected);
+};
+
+/**
+ * Matcher that compares the actual to the expected using a regular expression.  Constructs a RegExp, so takes
+ * a pattern or a String.
+ *
+ * @param expected
+ */
+jasmine.Matchers.prototype.toMatch = function(expected) {
+  return new RegExp(expected).test(this.actual);
+};
+
+/**
+ * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
+ * @param expected
+ * @deprecated as of 1.0. Use not.toMatch() instead.
+ */
+jasmine.Matchers.prototype.toNotMatch = function(expected) {
+  return !(new RegExp(expected).test(this.actual));
+};
+
+/**
+ * Matcher that compares the actual to jasmine.undefined.
+ */
+jasmine.Matchers.prototype.toBeDefined = function() {
+  return (this.actual !== jasmine.undefined);
+};
+
+/**
+ * Matcher that compares the actual to jasmine.undefined.
+ */
+jasmine.Matchers.prototype.toBeUndefined = function() {
+  return (this.actual === jasmine.undefined);
+};
+
+/**
+ * Matcher that compares the actual to null.
+ */
+jasmine.Matchers.prototype.toBeNull = function() {
+  return (this.actual === null);
+};
+
+/**
+ * Matcher that boolean not-nots the actual.
+ */
+jasmine.Matchers.prototype.toBeTruthy = function() {
+  return !!this.actual;
+};
+
+
+/**
+ * Matcher that boolean nots the actual.
+ */
+jasmine.Matchers.prototype.toBeFalsy = function() {
+  return !this.actual;
+};
+
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was called.
+ */
+jasmine.Matchers.prototype.toHaveBeenCalled = function() {
+  if (arguments.length > 0) {
+    throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
+  }
+
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy " + this.actual.identity + " to have been called.",
+      "Expected spy " + this.actual.identity + " not to have been called."
+    ];
+  };
+
+  return this.actual.wasCalled;
+};
+
+/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
+jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was not called.
+ *
+ * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
+ */
+jasmine.Matchers.prototype.wasNotCalled = function() {
+  if (arguments.length > 0) {
+    throw new Error('wasNotCalled does not take arguments');
+  }
+
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy " + this.actual.identity + " to not have been called.",
+      "Expected spy " + this.actual.identity + " to have been called."
+    ];
+  };
+
+  return !this.actual.wasCalled;
+};
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
+ *
+ * @example
+ *
+ */
+jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
+  var expectedArgs = jasmine.util.argsToArray(arguments);
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+  this.message = function() {
+    if (this.actual.callCount === 0) {
+      // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
+      return [
+        "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
+        "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
+      ];
+    } else {
+      return [
+        "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
+        "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
+      ];
+    }
+  };
+
+  return this.env.contains_(this.actual.argsForCall, expectedArgs);
+};
+
+/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
+jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
+
+/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
+jasmine.Matchers.prototype.wasNotCalledWith = function() {
+  var expectedArgs = jasmine.util.argsToArray(arguments);
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
+      "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
+    ];
+  };
+
+  return !this.env.contains_(this.actual.argsForCall, expectedArgs);
+};
+
+/**
+ * Matcher that checks that the expected item is an element in the actual Array.
+ *
+ * @param {Object} expected
+ */
+jasmine.Matchers.prototype.toContain = function(expected) {
+  return this.env.contains_(this.actual, expected);
+};
+
+/**
+ * Matcher that checks that the expected item is NOT an element in the actual Array.
+ *
+ * @param {Object} expected
+ * @deprecated as of 1.0. Use not.toContain() instead.
+ */
+jasmine.Matchers.prototype.toNotContain = function(expected) {
+  return !this.env.contains_(this.actual, expected);
+};
+
+jasmine.Matchers.prototype.toBeLessThan = function(expected) {
+  return this.actual < expected;
+};
+
+jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
+  return this.actual > expected;
+};
+
+/**
+ * Matcher that checks that the expected item is equal to the actual item
+ * up to a given level of decimal precision (default 2).
+ *
+ * @param {Number} expected
+ * @param {Number} precision
+ */
+jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {
+  if (!(precision === 0)) {
+    precision = precision || 2;
+  }
+  var multiplier = Math.pow(10, precision);
+  var actual = Math.round(this.actual * multiplier);
+  expected = Math.round(expected * multiplier);
+  return expected == actual;
+};
+
+/**
+ * Matcher that checks that the expected exception was thrown by the actual.
+ *
+ * @param {String} expected
+ */
+jasmine.Matchers.prototype.toThrow = function(expected) {
+  var result = false;
+  var exception;
+  if (typeof this.actual != 'function') {
+    throw new Error('Actual is not a function');
+  }
+  try {
+    this.actual();
+  } catch (e) {
+    exception = e;
+  }
+  if (exception) {
+    result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
+  }
+
+  var not = this.isNot ? "not " : "";
+
+  this.message = function() {
+    if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
+      return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' ');
+    } else {
+      return "Expected function to throw an exception.";
+    }
+  };
+
+  return result;
+};
+
+jasmine.Matchers.Any = function(expectedClass) {
+  this.expectedClass = expectedClass;
+};
+
+jasmine.Matchers.Any.prototype.jasmineMatches = function(other) {
+  if (this.expectedClass == String) {
+    return typeof other == 'string' || other instanceof String;
+  }
+
+  if (this.expectedClass == Number) {
+    return typeof other == 'number' || other instanceof Number;
+  }
+
+  if (this.expectedClass == Function) {
+    return typeof other == 'function' || other instanceof Function;
+  }
+
+  if (this.expectedClass == Object) {
+    return typeof other == 'object';
+  }
+
+  return other instanceof this.expectedClass;
+};
+
+jasmine.Matchers.Any.prototype.jasmineToString = function() {
+  return '<jasmine.any(' + this.expectedClass + ')>';
+};
+
+jasmine.Matchers.ObjectContaining = function (sample) {
+  this.sample = sample;
+};
+
+jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
+  mismatchKeys = mismatchKeys || [];
+  mismatchValues = mismatchValues || [];
+
+  var env = jasmine.getEnv();
+
+  var hasKey = function(obj, keyName) {
+    return obj != null && obj[keyName] !== jasmine.undefined;
+  };
+
+  for (var property in this.sample) {
+    if (!hasKey(other, property) && hasKey(this.sample, property)) {
+      mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
+    }
+    else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
+      mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual.");
+    }
+  }
+
+  return (mismatchKeys.length === 0 && mismatchValues.length === 0);
+};
+
+jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () {
+  return "<jasmine.objectContaining(" + jasmine.pp(this.sample) + ")>";
+};
+// Mock setTimeout, clearTimeout
+// Contributed by Pivotal Computer Systems, www.pivotalsf.com
+
+jasmine.FakeTimer = function() {
+  this.reset();
+
+  var self = this;
+  self.setTimeout = function(funcToCall, millis) {
+    self.timeoutsMade++;
+    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
+    return self.timeoutsMade;
+  };
+
+  self.setInterval = function(funcToCall, millis) {
+    self.timeoutsMade++;
+    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
+    return self.timeoutsMade;
+  };
+
+  self.clearTimeout = function(timeoutKey) {
+    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
+  };
+
+  self.clearInterval = function(timeoutKey) {
+    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
+  };
+
+};
+
+jasmine.FakeTimer.prototype.reset = function() {
+  this.timeoutsMade = 0;
+  this.scheduledFunctions = {};
+  this.nowMillis = 0;
+};
+
+jasmine.FakeTimer.prototype.tick = function(millis) {
+  var oldMillis = this.nowMillis;
+  var newMillis = oldMillis + millis;
+  this.runFunctionsWithinRange(oldMillis, newMillis);
+  this.nowMillis = newMillis;
+};
+
+jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
+  var scheduledFunc;
+  var funcsToRun = [];
+  for (var timeoutKey in this.scheduledFunctions) {
+    scheduledFunc = this.scheduledFunctions[timeoutKey];
+    if (scheduledFunc != jasmine.undefined &&
+        scheduledFunc.runAtMillis >= oldMillis &&
+        scheduledFunc.runAtMillis <= nowMillis) {
+      funcsToRun.push(scheduledFunc);
+      this.scheduledFunctions[timeoutKey] = jasmine.undefined;
+    }
+  }
+
+  if (funcsToRun.length > 0) {
+    funcsToRun.sort(function(a, b) {
+      return a.runAtMillis - b.runAtMillis;
+    });
+    for (var i = 0; i < funcsToRun.length; ++i) {
+      try {
+        var funcToRun = funcsToRun[i];
+        this.nowMillis = funcToRun.runAtMillis;
+        funcToRun.funcToCall();
+        if (funcToRun.recurring) {
+          this.scheduleFunction(funcToRun.timeoutKey,
+              funcToRun.funcToCall,
+              funcToRun.millis,
+              true);
+        }
+      } catch(e) {
+      }
+    }
+    this.runFunctionsWithinRange(oldMillis, nowMillis);
+  }
+};
+
+jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
+  this.scheduledFunctions[timeoutKey] = {
+    runAtMillis: this.nowMillis + millis,
+    funcToCall: funcToCall,
+    recurring: recurring,
+    timeoutKey: timeoutKey,
+    millis: millis
+  };
+};
+
+/**
+ * @namespace
+ */
+jasmine.Clock = {
+  defaultFakeTimer: new jasmine.FakeTimer(),
+
+  reset: function() {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.defaultFakeTimer.reset();
+  },
+
+  tick: function(millis) {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.defaultFakeTimer.tick(millis);
+  },
+
+  runFunctionsWithinRange: function(oldMillis, nowMillis) {
+    jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
+  },
+
+  scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
+    jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
+  },
+
+  useMock: function() {
+    if (!jasmine.Clock.isInstalled()) {
+      var spec = jasmine.getEnv().currentSpec;
+      spec.after(jasmine.Clock.uninstallMock);
+
+      jasmine.Clock.installMock();
+    }
+  },
+
+  installMock: function() {
+    jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
+  },
+
+  uninstallMock: function() {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.installed = jasmine.Clock.real;
+  },
+
+  real: {
+    setTimeout: jasmine.getGlobal().setTimeout,
+    clearTimeout: jasmine.getGlobal().clearTimeout,
+    setInterval: jasmine.getGlobal().setInterval,
+    clearInterval: jasmine.getGlobal().clearInterval
+  },
+
+  assertInstalled: function() {
+    if (!jasmine.Clock.isInstalled()) {
+      throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
+    }
+  },
+
+  isInstalled: function() {
+    return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
+  },
+
+  installed: null
+};
+jasmine.Clock.installed = jasmine.Clock.real;
+
+//else for IE support
+jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
+  if (jasmine.Clock.installed.setTimeout.apply) {
+    return jasmine.Clock.installed.setTimeout.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.setTimeout(funcToCall, millis);
+  }
+};
+
+jasmine.getGlobal().setInterval = function(funcToCall, millis) {
+  if (jasmine.Clock.installed.setInterval.apply) {
+    return jasmine.Clock.installed.setInterval.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.setInterval(funcToCall, millis);
+  }
+};
+
+jasmine.getGlobal().clearTimeout = function(timeoutKey) {
+  if (jasmine.Clock.installed.clearTimeout.apply) {
+    return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.clearTimeout(timeoutKey);
+  }
+};
+
+jasmine.getGlobal().clearInterval = function(timeoutKey) {
+  if (jasmine.Clock.installed.clearTimeout.apply) {
+    return jasmine.Clock.installed.clearInterval.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.clearInterval(timeoutKey);
+  }
+};
+
+/**
+ * @constructor
+ */
+jasmine.MultiReporter = function() {
+  this.subReporters_ = [];
+};
+jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
+
+jasmine.MultiReporter.prototype.addReporter = function(reporter) {
+  this.subReporters_.push(reporter);
+};
+
+(function() {
+  var functionNames = [
+    "reportRunnerStarting",
+    "reportRunnerResults",
+    "reportSuiteResults",
+    "reportSpecStarting",
+    "reportSpecResults",
+    "log"
+  ];
+  for (var i = 0; i < functionNames.length; i++) {
+    var functionName = functionNames[i];
+    jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
+      return function() {
+        for (var j = 0; j < this.subReporters_.length; j++) {
+          var subReporter = this.subReporters_[j];
+          if (subReporter[functionName]) {
+            subReporter[functionName].apply(subReporter, arguments);
+          }
+        }
+      };
+    })(functionName);
+  }
+})();
+/**
+ * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
+ *
+ * @constructor
+ */
+jasmine.NestedResults = function() {
+  /**
+   * The total count of results
+   */
+  this.totalCount = 0;
+  /**
+   * Number of passed results
+   */
+  this.passedCount = 0;
+  /**
+   * Number of failed results
+   */
+  this.failedCount = 0;
+  /**
+   * Was this suite/spec skipped?
+   */
+  this.skipped = false;
+  /**
+   * @ignore
+   */
+  this.items_ = [];
+};
+
+/**
+ * Roll up the result counts.
+ *
+ * @param result
+ */
+jasmine.NestedResults.prototype.rollupCounts = function(result) {
+  this.totalCount += result.totalCount;
+  this.passedCount += result.passedCount;
+  this.failedCount += result.failedCount;
+};
+
+/**
+ * Adds a log message.
+ * @param values Array of message parts which will be concatenated later.
+ */
+jasmine.NestedResults.prototype.log = function(values) {
+  this.items_.push(new jasmine.MessageResult(values));
+};
+
+/**
+ * Getter for the results: message & results.
+ */
+jasmine.NestedResults.prototype.getItems = function() {
+  return this.items_;
+};
+
+/**
+ * Adds a result, tracking counts (total, passed, & failed)
+ * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
+ */
+jasmine.NestedResults.prototype.addResult = function(result) {
+  if (result.type != 'log') {
+    if (result.items_) {
+      this.rollupCounts(result);
+    } else {
+      this.totalCount++;
+      if (result.passed()) {
+        this.passedCount++;
+      } else {
+        this.failedCount++;
+      }
+    }
+  }
+  this.items_.push(result);
+};
+
+/**
+ * @returns {Boolean} True if <b>everything</b> below passed
+ */
+jasmine.NestedResults.prototype.passed = function() {
+  return this.passedCount === this.totalCount;
+};
+/**
+ * Base class for pretty printing for expectation results.
+ */
+jasmine.PrettyPrinter = function() {
+  this.ppNestLevel_ = 0;
+};
+
+/**
+ * Formats a value in a nice, human-readable string.
+ *
+ * @param value
+ */
+jasmine.PrettyPrinter.prototype.format = function(value) {
+  if (this.ppNestLevel_ > 40) {
+    throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
+  }
+
+  this.ppNestLevel_++;
+  try {
+    if (value === jasmine.undefined) {
+      this.emitScalar('undefined');
+    } else if (value === null) {
+      this.emitScalar('null');
+    } else if (value === jasmine.getGlobal()) {
+      this.emitScalar('<global>');
+    } else if (value.jasmineToString) {
+      this.emitScalar(value.jasmineToString());
+    } else if (typeof value === 'string') {
+      this.emitString(value);
+    } else if (jasmine.isSpy(value)) {
+      this.emitScalar("spy on " + value.identity);
+    } else if (value instanceof RegExp) {
+      this.emitScalar(value.toString());
+    } else if (typeof value === 'function') {
+      this.emitScalar('Function');
+    } else if (typeof value.nodeType === 'number') {
+      this.emitScalar('HTMLNode');
+    } else if (value instanceof Date) {
+      this.emitScalar('Date(' + value + ')');
+    } else if (value.__Jasmine_been_here_before__) {
+      this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
+    } else if (jasmine.isArray_(value) || typeof value == 'object') {
+      value.__Jasmine_been_here_before__ = true;
+      if (jasmine.isArray_(value)) {
+        this.emitArray(value);
+      } else {
+        this.emitObject(value);
+      }
+      delete value.__Jasmine_been_here_before__;
+    } else {
+      this.emitScalar(value.toString());
+    }
+  } finally {
+    this.ppNestLevel_--;
+  }
+};
+
+jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
+  for (var property in obj) {
+    if (property == '__Jasmine_been_here_before__') continue;
+    fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && 
+                                         obj.__lookupGetter__(property) !== null) : false);
+  }
+};
+
+jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
+
+jasmine.StringPrettyPrinter = function() {
+  jasmine.PrettyPrinter.call(this);
+
+  this.string = '';
+};
+jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
+
+jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
+  this.append(value);
+};
+
+jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
+  this.append("'" + value + "'");
+};
+
+jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
+  this.append('[ ');
+  for (var i = 0; i < array.length; i++) {
+    if (i > 0) {
+      this.append(', ');
+    }
+    this.format(array[i]);
+  }
+  this.append(' ]');
+};
+
+jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
+  var self = this;
+  this.append('{ ');
+  var first = true;
+
+  this.iterateObject(obj, function(property, isGetter) {
+    if (first) {
+      first = false;
+    } else {
+      self.append(', ');
+    }
+
+    self.append(property);
+    self.append(' : ');
+    if (isGetter) {
+      self.append('<getter>');
+    } else {
+      self.format(obj[property]);
+    }
+  });
+
+  this.append(' }');
+};
+
+jasmine.StringPrettyPrinter.prototype.append = function(value) {
+  this.string += value;
+};
+jasmine.Queue = function(env) {
+  this.env = env;
+  this.blocks = [];
+  this.running = false;
+  this.index = 0;
+  this.offset = 0;
+  this.abort = false;
+};
+
+jasmine.Queue.prototype.addBefore = function(block) {
+  this.blocks.unshift(block);
+};
+
+jasmine.Queue.prototype.add = function(block) {
+  this.blocks.push(block);
+};
+
+jasmine.Queue.prototype.insertNext = function(block) {
+  this.blocks.splice((this.index + this.offset + 1), 0, block);
+  this.offset++;
+};
+
+jasmine.Queue.prototype.start = function(onComplete) {
+  this.running = true;
+  this.onComplete = onComplete;
+  this.next_();
+};
+
+jasmine.Queue.prototype.isRunning = function() {
+  return this.running;
+};
+
+jasmine.Queue.LOOP_DONT_RECURSE = true;
+
+jasmine.Queue.prototype.next_ = function() {
+  var self = this;
+  var goAgain = true;
+
+  while (goAgain) {
+    goAgain = false;
+    
+    if (self.index < self.blocks.length && !this.abort) {
+      var calledSynchronously = true;
+      var completedSynchronously = false;
+
+      var onComplete = function () {
+        if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
+          completedSynchronously = true;
+          return;
+        }
+
+        if (self.blocks[self.index].abort) {
+          self.abort = true;
+        }
+
+        self.offset = 0;
+        self.index++;
+
+        var now = new Date().getTime();
+        if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
+          self.env.lastUpdate = now;
+          self.env.setTimeout(function() {
+            self.next_();
+          }, 0);
+        } else {
+          if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
+            goAgain = true;
+          } else {
+            self.next_();
+          }
+        }
+      };
+      self.blocks[self.index].execute(onComplete);
+
+      calledSynchronously = false;
+      if (completedSynchronously) {
+        onComplete();
+      }
+      
+    } else {
+      self.running = false;
+      if (self.onComplete) {
+        self.onComplete();
+      }
+    }
+  }
+};
+
+jasmine.Queue.prototype.results = function() {
+  var results = new jasmine.NestedResults();
+  for (var i = 0; i < this.blocks.length; i++) {
+    if (this.blocks[i].results) {
+      results.addResult(this.blocks[i].results());
+    }
+  }
+  return results;
+};
+
+
+/**
+ * Runner
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ */
+jasmine.Runner = function(env) {
+  var self = this;
+  self.env = env;
+  self.queue = new jasmine.Queue(env);
+  self.before_ = [];
+  self.after_ = [];
+  self.suites_ = [];
+};
+
+jasmine.Runner.prototype.execute = function() {
+  var self = this;
+  if (self.env.reporter.reportRunnerStarting) {
+    self.env.reporter.reportRunnerStarting(this);
+  }
+  self.queue.start(function () {
+    self.finishCallback();
+  });
+};
+
+jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
+  beforeEachFunction.typeName = 'beforeEach';
+  this.before_.splice(0,0,beforeEachFunction);
+};
+
+jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
+  afterEachFunction.typeName = 'afterEach';
+  this.after_.splice(0,0,afterEachFunction);
+};
+
+
+jasmine.Runner.prototype.finishCallback = function() {
+  this.env.reporter.reportRunnerResults(this);
+};
+
+jasmine.Runner.prototype.addSuite = function(suite) {
+  this.suites_.push(suite);
+};
+
+jasmine.Runner.prototype.add = function(block) {
+  if (block instanceof jasmine.Suite) {
+    this.addSuite(block);
+  }
+  this.queue.add(block);
+};
+
+jasmine.Runner.prototype.specs = function () {
+  var suites = this.suites();
+  var specs = [];
+  for (var i = 0; i < suites.length; i++) {
+    specs = specs.concat(suites[i].specs());
+  }
+  return specs;
+};
+
+jasmine.Runner.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.Runner.prototype.topLevelSuites = function() {
+  var topLevelSuites = [];
+  for (var i = 0; i < this.suites_.length; i++) {
+    if (!this.suites_[i].parentSuite) {
+      topLevelSuites.push(this.suites_[i]);
+    }
+  }
+  return topLevelSuites;
+};
+
+jasmine.Runner.prototype.results = function() {
+  return this.queue.results();
+};
+/**
+ * Internal representation of a Jasmine specification, or test.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {jasmine.Suite} suite
+ * @param {String} description
+ */
+jasmine.Spec = function(env, suite, description) {
+  if (!env) {
+    throw new Error('jasmine.Env() required');
+  }
+  if (!suite) {
+    throw new Error('jasmine.Suite() required');
+  }
+  var spec = this;
+  spec.id = env.nextSpecId ? env.nextSpecId() : null;
+  spec.env = env;
+  spec.suite = suite;
+  spec.description = description;
+  spec.queue = new jasmine.Queue(env);
+
+  spec.afterCallbacks = [];
+  spec.spies_ = [];
+
+  spec.results_ = new jasmine.NestedResults();
+  spec.results_.description = description;
+  spec.matchersClass = null;
+};
+
+jasmine.Spec.prototype.getFullName = function() {
+  return this.suite.getFullName() + ' ' + this.description + '.';
+};
+
+
+jasmine.Spec.prototype.results = function() {
+  return this.results_;
+};
+
+/**
+ * All parameters are pretty-printed and concatenated together, then written to the spec's output.
+ *
+ * Be careful not to leave calls to <code>jasmine.log</code> in production code.
+ */
+jasmine.Spec.prototype.log = function() {
+  return this.results_.log(arguments);
+};
+
+jasmine.Spec.prototype.runs = function (func) {
+  var block = new jasmine.Block(this.env, func, this);
+  this.addToQueue(block);
+  return this;
+};
+
+jasmine.Spec.prototype.addToQueue = function (block) {
+  if (this.queue.isRunning()) {
+    this.queue.insertNext(block);
+  } else {
+    this.queue.add(block);
+  }
+};
+
+/**
+ * @param {jasmine.ExpectationResult} result
+ */
+jasmine.Spec.prototype.addMatcherResult = function(result) {
+  this.results_.addResult(result);
+};
+
+jasmine.Spec.prototype.expect = function(actual) {
+  var positive = new (this.getMatchersClass_())(this.env, actual, this);
+  positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
+  return positive;
+};
+
+/**
+ * Waits a fixed time period before moving to the next block.
+ *
+ * @deprecated Use waitsFor() instead
+ * @param {Number} timeout milliseconds to wait
+ */
+jasmine.Spec.prototype.waits = function(timeout) {
+  var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
+  this.addToQueue(waitsFunc);
+  return this;
+};
+
+/**
+ * Waits for the latchFunction to return true before proceeding to the next block.
+ *
+ * @param {Function} latchFunction
+ * @param {String} optional_timeoutMessage
+ * @param {Number} optional_timeout
+ */
+jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
+  var latchFunction_ = null;
+  var optional_timeoutMessage_ = null;
+  var optional_timeout_ = null;
+
+  for (var i = 0; i < arguments.length; i++) {
+    var arg = arguments[i];
+    switch (typeof arg) {
+      case 'function':
+        latchFunction_ = arg;
+        break;
+      case 'string':
+        optional_timeoutMessage_ = arg;
+        break;
+      case 'number':
+        optional_timeout_ = arg;
+        break;
+    }
+  }
+
+  var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
+  this.addToQueue(waitsForFunc);
+  return this;
+};
+
+jasmine.Spec.prototype.fail = function (e) {
+  var expectationResult = new jasmine.ExpectationResult({
+    passed: false,
+    message: e ? jasmine.util.formatException(e) : 'Exception',
+    trace: { stack: e.stack }
+  });
+  this.results_.addResult(expectationResult);
+};
+
+jasmine.Spec.prototype.getMatchersClass_ = function() {
+  return this.matchersClass || this.env.matchersClass;
+};
+
+jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
+  var parent = this.getMatchersClass_();
+  var newMatchersClass = function() {
+    parent.apply(this, arguments);
+  };
+  jasmine.util.inherit(newMatchersClass, parent);
+  jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
+  this.matchersClass = newMatchersClass;
+};
+
+jasmine.Spec.prototype.finishCallback = function() {
+  this.env.reporter.reportSpecResults(this);
+};
+
+jasmine.Spec.prototype.finish = function(onComplete) {
+  this.removeAllSpies();
+  this.finishCallback();
+  if (onComplete) {
+    onComplete();
+  }
+};
+
+jasmine.Spec.prototype.after = function(doAfter) {
+  if (this.queue.isRunning()) {
+    this.queue.add(new jasmine.Block(this.env, doAfter, this));
+  } else {
+    this.afterCallbacks.unshift(doAfter);
+  }
+};
+
+jasmine.Spec.prototype.execute = function(onComplete) {
+  var spec = this;
+  if (!spec.env.specFilter(spec)) {
+    spec.results_.skipped = true;
+    spec.finish(onComplete);
+    return;
+  }
+
+  this.env.reporter.reportSpecStarting(this);
+
+  spec.env.currentSpec = spec;
+
+  spec.addBeforesAndAftersToQueue();
+
+  spec.queue.start(function () {
+    spec.finish(onComplete);
+  });
+};
+
+jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
+  var runner = this.env.currentRunner();
+  var i;
+
+  for (var suite = this.suite; suite; suite = suite.parentSuite) {
+    for (i = 0; i < suite.before_.length; i++) {
+      this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
+    }
+  }
+  for (i = 0; i < runner.before_.length; i++) {
+    this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
+  }
+  for (i = 0; i < this.afterCallbacks.length; i++) {
+    this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
+  }
+  for (suite = this.suite; suite; suite = suite.parentSuite) {
+    for (i = 0; i < suite.after_.length; i++) {
+      this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
+    }
+  }
+  for (i = 0; i < runner.after_.length; i++) {
+    this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
+  }
+};
+
+jasmine.Spec.prototype.explodes = function() {
+  throw 'explodes function should not have been called';
+};
+
+jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
+  if (obj == jasmine.undefined) {
+    throw "spyOn could not find an object to spy upon for " + methodName + "()";
+  }
+
+  if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
+    throw methodName + '() method does not exist';
+  }
+
+  if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
+    throw new Error(methodName + ' has already been spied upon');
+  }
+
+  var spyObj = jasmine.createSpy(methodName);
+
+  this.spies_.push(spyObj);
+  spyObj.baseObj = obj;
+  spyObj.methodName = methodName;
+  spyObj.originalValue = obj[methodName];
+
+  obj[methodName] = spyObj;
+
+  return spyObj;
+};
+
+jasmine.Spec.prototype.removeAllSpies = function() {
+  for (var i = 0; i < this.spies_.length; i++) {
+    var spy = this.spies_[i];
+    spy.baseObj[spy.methodName] = spy.originalValue;
+  }
+  this.spies_ = [];
+};
+
+/**
+ * Internal representation of a Jasmine suite.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {String} description
+ * @param {Function} specDefinitions
+ * @param {jasmine.Suite} parentSuite
+ */
+jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
+  var self = this;
+  self.id = env.nextSuiteId ? env.nextSuiteId() : null;
+  self.description = description;
+  self.queue = new jasmine.Queue(env);
+  self.parentSuite = parentSuite;
+  self.env = env;
+  self.before_ = [];
+  self.after_ = [];
+  self.children_ = [];
+  self.suites_ = [];
+  self.specs_ = [];
+};
+
+jasmine.Suite.prototype.getFullName = function() {
+  var fullName = this.description;
+  for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
+    fullName = parentSuite.description + ' ' + fullName;
+  }
+  return fullName;
+};
+
+jasmine.Suite.prototype.finish = function(onComplete) {
+  this.env.reporter.reportSuiteResults(this);
+  this.finished = true;
+  if (typeof(onComplete) == 'function') {
+    onComplete();
+  }
+};
+
+jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
+  beforeEachFunction.typeName = 'beforeEach';
+  this.before_.unshift(beforeEachFunction);
+};
+
+jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
+  afterEachFunction.typeName = 'afterEach';
+  this.after_.unshift(afterEachFunction);
+};
+
+jasmine.Suite.prototype.results = function() {
+  return this.queue.results();
+};
+
+jasmine.Suite.prototype.add = function(suiteOrSpec) {
+  this.children_.push(suiteOrSpec);
+  if (suiteOrSpec instanceof jasmine.Suite) {
+    this.suites_.push(suiteOrSpec);
+    this.env.currentRunner().addSuite(suiteOrSpec);
+  } else {
+    this.specs_.push(suiteOrSpec);
+  }
+  this.queue.add(suiteOrSpec);
+};
+
+jasmine.Suite.prototype.specs = function() {
+  return this.specs_;
+};
+
+jasmine.Suite.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.Suite.prototype.children = function() {
+  return this.children_;
+};
+
+jasmine.Suite.prototype.execute = function(onComplete) {
+  var self = this;
+  this.queue.start(function () {
+    self.finish(onComplete);
+  });
+};
+jasmine.WaitsBlock = function(env, timeout, spec) {
+  this.timeout = timeout;
+  jasmine.Block.call(this, env, null, spec);
+};
+
+jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
+
+jasmine.WaitsBlock.prototype.execute = function (onComplete) {
+  if (jasmine.VERBOSE) {
+    this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
+  }
+  this.env.setTimeout(function () {
+    onComplete();
+  }, this.timeout);
+};
+/**
+ * A block which waits for some condition to become true, with timeout.
+ *
+ * @constructor
+ * @extends jasmine.Block
+ * @param {jasmine.Env} env The Jasmine environment.
+ * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
+ * @param {Function} latchFunction A function which returns true when the desired condition has been met.
+ * @param {String} message The message to display if the desired condition hasn't been met within the given time period.
+ * @param {jasmine.Spec} spec The Jasmine spec.
+ */
+jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
+  this.timeout = timeout || env.defaultTimeoutInterval;
+  this.latchFunction = latchFunction;
+  this.message = message;
+  this.totalTimeSpentWaitingForLatch = 0;
+  jasmine.Block.call(this, env, null, spec);
+};
+jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
+
+jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
+
+jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
+  if (jasmine.VERBOSE) {
+    this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
+  }
+  var latchFunctionResult;
+  try {
+    latchFunctionResult = this.latchFunction.apply(this.spec);
+  } catch (e) {
+    this.spec.fail(e);
+    onComplete();
+    return;
+  }
+
+  if (latchFunctionResult) {
+    onComplete();
+  } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
+    var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
+    this.spec.fail({
+      name: 'timeout',
+      message: message
+    });
+
+    this.abort = true;
+    onComplete();
+  } else {
+    this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
+    var self = this;
+    this.env.setTimeout(function() {
+      self.execute(onComplete);
+    }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
+  }
+};
+
+jasmine.version_= {
+  "major": 1,
+  "minor": 2,
+  "build": 0,
+  "revision": 1337005947
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/functional/debugtoken-helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/functional/debugtoken-helper.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/functional/debugtoken-helper.js
new file mode 100644
index 0000000..cbf28d9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/functional/debugtoken-helper.js
@@ -0,0 +1,377 @@
+/**
+    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.
+*/
+
+var childProcess = require('child_process'),
+    debugTokenHelper = require("../../templates/project/cordova/lib/debugtoken-helper"),
+    wrench = require('wrench'),
+    fs = require('fs'),
+    properties,
+    flag;
+
+function testCreateDebugtoken(target) {
+    debugTokenHelper.createToken(properties, target, function (code) {
+        if (code === 0) {
+            console.log("Debug token is created successfully!");
+        } else {
+            console.log("Debug token is not created successfully!");
+        }
+
+        flag = true;
+    });
+}
+
+function testDeployDebugtoken() {
+    debugTokenHelper.deployToken(properties, "", function () {
+        console.log("Deploy callback is invoked!");
+        flag = true;
+    });
+}
+
+function testDeployDebugtokenAll() {
+    debugTokenHelper.deployToken(properties, "all", function () {
+        console.log("Deploy callback is invoked!");
+        flag = true;
+    });
+}
+
+function testDeployDebugtokenSingle() {
+    debugTokenHelper.deployToken(properties, "d1", function () {
+        console.log("Deploy callback is invoked!");
+        flag = true;
+    });
+}
+
+describe("cordova/lib/debugtoken-helper tests", function () {
+    beforeEach(function () {
+        flag = false;
+    });
+
+    it("should create a debugtoken for target all", function () {
+        testCreateDebugtoken("all");
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            expect(fs.existsSync("debugtoken.bar"));
+        });
+    });
+
+    it("should create a debugtoken for single target", function () {
+        testCreateDebugtoken("d1");
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            expect(fs.existsSync("debugtoken.bar"));
+        });
+    });
+
+    it("should create a debugtoken for default target", function () {
+        testCreateDebugtoken("");
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            expect(fs.existsSync("debugtoken.bar"));
+        });
+    });
+
+    it("cannot create a debugtoken without keystorepass", function () {
+        testCreateDebugtoken("all");
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                //"keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            expect(!fs.existsSync("debugtoken.bar"));
+        });
+    });
+
+    it("cannot create a debugtoken without any device PINs", function () {
+        testCreateDebugtoken("all");
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        //"pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            expect(!fs.existsSync("debugtoken.bar"));
+        });
+    });
+
+    it("should deploy a debugtoken to default target", function () {
+        debugTokenHelper.createToken(properties, "", testDeployDebugtoken);
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+
+            window.alert("Make sure you connect the device " + "2A54F454" + " to " + "169.254.0.1");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            var confirm = window.confirm("Was the debug token deployed to device?");
+            expect(confirm).toEqual(true);
+        });
+    });
+
+    it("should deploy a debugtoken to all targets", function () {
+        debugTokenHelper.createToken(properties, "all", testDeployDebugtokenAll);
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+
+            window.alert("Make sure you connect the device " + "2A54F454" + " to " + "169.254.0.1");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            var confirm = window.confirm("Was the debug token deployed to device?");
+            expect(confirm).toEqual(true);
+        });
+    });
+
+    it("should deploy a debugtoken to a single target", function () {
+        debugTokenHelper.createToken(properties, "d1", testDeployDebugtokenSingle);
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+
+            window.alert("Make sure you connect the device " + "2A54F454" + " to " + "169.254.0.1");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            var confirm = window.confirm("Was the debug token deployed to device?");
+            expect(confirm).toEqual(true);
+        });
+    });
+
+    it("cannot deploy a debugtoken when the target is not connected", function () {
+        debugTokenHelper.createToken(properties, "all", testDeployDebugtoken);
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+
+            window.alert("Disconnect the target from 169.254.0.1");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            var confirm = window.confirm("Was the debug token deployed to device?");
+            expect(confirm).toEqual(false);
+        });
+    });
+
+    it("cannot deploy a debugtoken if no debugtoken", function () {
+        testDeployDebugtoken();
+
+        beforeEach(function () {
+            properties = {
+                "barName": "cordova-BB10-app",
+                "keystorepass": "qaqa1234",
+                "defaultTarget": "d1",
+                "targets": {
+                    "d1": {
+                        "ip": "169.254.0.1",
+                        "type": "device",
+                        "pin": "2A54F454",
+                        "password" : "qaqa123"
+                    }
+                }
+            };
+
+            fs.unlinkSync("debugtoken.bar");
+        });
+
+        waitsFor(function () {
+            return flag;
+        });
+
+        runs(function () {
+            var confirm = window.confirm("Was the debug token deployed to device?");
+            expect(confirm).toEqual(false);
+        });
+    });
+});


[04/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE
new file mode 100644
index 0000000..a396eae
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2009-2013 Jeremy Ashkenas
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README
new file mode 100644
index 0000000..69ee6f4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/README
@@ -0,0 +1,51 @@
+
+            {
+         }   }   {
+        {   {  }  }
+         }   }{  {
+        {  }{  }  }                    _____       __  __
+       ( }{ }{  { )                   / ____|     / _|/ _|
+     .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___
+    (  ( } { } { } }  )              | |    / _ \|  _|  _/ _ \/ _ \
+    |`-..________ ..-'|              | |___| (_) | | | ||  __/  __/
+    |                 |               \_____\___/|_| |_| \___|\___|
+    |                 ;--.
+    |                (__  \            _____           _       _
+    |                 | )  )          / ____|         (_)     | |
+    |                 |/  /          | (___   ___ _ __ _ _ __ | |_
+    |                 (  /            \___ \ / __| '__| | '_ \| __|
+    |                 |/              ____) | (__| |  | | |_) | |_
+    |                 |              |_____/ \___|_|  |_| .__/ \__|
+     `-.._________..-'                                  | |
+                                                        |_|
+
+
+  CoffeeScript is a little language that compiles into JavaScript.
+
+  Install Node.js, and then the CoffeeScript compiler:
+  sudo bin/cake install
+
+  Or, if you have the Node Package Manager installed:
+  npm install -g coffee-script
+  (Leave off the -g if you don't wish to install globally.)
+
+  Execute a script:
+  coffee /path/to/script.coffee
+
+  Compile a script:
+  coffee -c /path/to/script.coffee
+
+  For documentation, usage, and examples, see:
+  http://coffeescript.org/
+
+  To suggest a feature, report a bug, or general discussion:
+  http://github.com/jashkenas/coffee-script/issues/
+
+  If you'd like to chat, drop by #coffeescript on Freenode IRC,
+  or on webchat.freenode.net.
+
+  The source repository:
+  git://github.com/jashkenas/coffee-script.git
+
+  All contributors are listed here:
+  http://github.com/jashkenas/coffee-script/contributors

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile
new file mode 100644
index 0000000..d90cce3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/Rakefile
@@ -0,0 +1,79 @@
+require 'rubygems'
+require 'erb'
+require 'fileutils'
+require 'rake/testtask'
+require 'json'
+
+desc "Build the documentation page"
+task :doc do
+  source = 'documentation/index.html.erb'
+  child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" }
+  at_exit { Process.kill("INT", child) }
+  Signal.trap("INT") { exit }
+  loop do
+    mtime = File.stat(source).mtime
+    if !@mtime || mtime > @mtime
+      rendered = ERB.new(File.read(source)).result(binding)
+      File.open('index.html', 'w+') {|f| f.write(rendered) }
+    end
+    @mtime = mtime
+    sleep 1
+  end
+end
+
+desc "Build coffee-script-source gem"
+task :gem do
+  require 'rubygems'
+  require 'rubygems/package'
+
+  gemspec = Gem::Specification.new do |s|
+    s.name      = 'coffee-script-source'
+    s.version   = JSON.parse(File.read('package.json'))["version"]
+    s.date      = Time.now.strftime("%Y-%m-%d")
+
+    s.homepage    = "http://jashkenas.github.com/coffee-script/"
+    s.summary     = "The CoffeeScript Compiler"
+    s.description = <<-EOS
+      CoffeeScript is a little language that compiles into JavaScript.
+      Underneath all of those embarrassing braces and semicolons,
+      JavaScript has always had a gorgeous object model at its heart.
+      CoffeeScript is an attempt to expose the good parts of JavaScript
+      in a simple way.
+    EOS
+
+    s.files = [
+      'lib/coffee_script/coffee-script.js',
+      'lib/coffee_script/source.rb'
+    ]
+
+    s.authors           = ['Jeremy Ashkenas']
+    s.email             = 'jashkenas@gmail.com'
+    s.rubyforge_project = 'coffee-script-source'
+    s.license           = "MIT"
+  end
+
+  file = File.open("coffee-script-source.gem", "w")
+  Gem::Package.open(file, 'w') do |pkg|
+    pkg.metadata = gemspec.to_yaml
+
+    path = "lib/coffee_script/source.rb"
+    contents = <<-ERUBY
+module CoffeeScript
+  module Source
+    def self.bundled_path
+      File.expand_path("../coffee-script.js", __FILE__)
+    end
+  end
+end
+    ERUBY
+    pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
+      tar_io.write(contents)
+    end
+
+    contents = File.read("extras/coffee-script.js")
+    path = "lib/coffee_script/coffee-script.js"
+    pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
+      tar_io.write(contents)
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake
new file mode 100755
index 0000000..5965f4e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/cake
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var fs   = require('fs');
+var lib  = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
+
+require(lib + '/coffee-script/cake').run();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee
new file mode 100755
index 0000000..3d1d71c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var fs   = require('fs');
+var lib  = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
+
+require(lib + '/coffee-script/command').run();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf
new file mode 100644
index 0000000..1190da5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf
@@ -0,0 +1,44 @@
+# JavaScriptLint configuration file for CoffeeScript.
+
++no_return_value              # function {0} does not always return a value
++duplicate_formal             # duplicate formal argument {0}
+-equal_as_assign              # test for equality (==) mistyped as assignment (=)?{0}
++var_hides_arg                # variable {0} hides argument
++redeclared_var               # redeclaration of {0} {1}
+-anon_no_return_value         # anonymous function does not always return a value
++missing_semicolon            # missing semicolon
++meaningless_block            # meaningless block; curly braces have no impact
+-comma_separated_stmts        # multiple statements separated by commas (use semicolons?)
++unreachable_code             # unreachable code
++missing_break                # missing break statement
+-missing_break_for_last_case  # missing break statement for last case in switch
+-comparison_type_conv         # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
+-inc_dec_within_stmt          # increment (++) and decrement (--) operators used as part of greater statement
+-useless_void                 # use of the void type may be unnecessary (void is always undefined)
++multiple_plus_minus          # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
++use_of_label                 # use of label
+-block_without_braces         # block statement without curly braces
++leading_decimal_point        # leading decimal point may indicate a number or an object member
++trailing_decimal_point       # trailing decimal point may indicate a number or an object member
++octal_number                 # leading zeros make an octal number
++nested_comment               # nested comment
++misplaced_regex              # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
++ambiguous_newline            # unexpected end of line; it is ambiguous whether these lines are part of the same statement
++empty_statement              # empty statement or extra semicolon
+-missing_option_explicit      # the "option explicit" control comment is missing
++partial_option_explicit      # the "option explicit" control comment, if used, must be in the first script tag
++dup_option_explicit          # duplicate "option explicit" control comment
++useless_assign               # useless assignment
++ambiguous_nested_stmt        # block statements containing block statements should use curly braces to resolve ambiguity
++ambiguous_else_stmt          # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
+-missing_default_case         # missing default case in switch statement
++duplicate_case_in_switch     # duplicate case in switch statements
++default_not_at_end           # the default case is not at the end of the switch statement
++legacy_cc_not_understood     # couldn't understand control comment using /*@keyword@*/ syntax
++jsl_cc_not_understood        # couldn't understand control comment using /*jsl:keyword*/ syntax
++useless_comparison           # useless comparison; comparing identical expressions
++with_statement               # with statement hides undeclared variables; use temporary variable instead
++trailing_comma_in_array      # extra comma is not recommended in array initializers
++assign_to_function_call      # assignment to a function call
++parseint_missing_radix       # parseInt missing radix parameter
++lambda_assign_requires_semicolon

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js
new file mode 100644
index 0000000..50706b5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js
@@ -0,0 +1,125 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var CoffeeScript, compile, runScripts,
+    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+  CoffeeScript = require('./coffee-script');
+
+  CoffeeScript.require = require;
+
+  compile = CoffeeScript.compile;
+
+  CoffeeScript["eval"] = function(code, options) {
+    var _ref;
+
+    if (options == null) {
+      options = {};
+    }
+    if ((_ref = options.bare) == null) {
+      options.bare = true;
+    }
+    return eval(compile(code, options));
+  };
+
+  CoffeeScript.run = function(code, options) {
+    if (options == null) {
+      options = {};
+    }
+    options.bare = true;
+    return Function(compile(code, options))();
+  };
+
+  if (typeof window === "undefined" || window === null) {
+    return;
+  }
+
+  if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null)) {
+    compile = function(code, options) {
+      var js, v3SourceMap, _ref;
+
+      if (options == null) {
+        options = {};
+      }
+      options.sourceMap = true;
+      options.inline = true;
+      _ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
+      return "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + (btoa(v3SourceMap)) + "\n//@ sourceURL=coffeescript";
+    };
+  }
+
+  CoffeeScript.load = function(url, callback, options) {
+    var xhr;
+
+    if (options == null) {
+      options = {};
+    }
+    options.sourceFiles = [url];
+    xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
+    xhr.open('GET', url, true);
+    if ('overrideMimeType' in xhr) {
+      xhr.overrideMimeType('text/plain');
+    }
+    xhr.onreadystatechange = function() {
+      var _ref;
+
+      if (xhr.readyState === 4) {
+        if ((_ref = xhr.status) === 0 || _ref === 200) {
+          CoffeeScript.run(xhr.responseText, options);
+        } else {
+          throw new Error("Could not load " + url);
+        }
+        if (callback) {
+          return callback();
+        }
+      }
+    };
+    return xhr.send(null);
+  };
+
+  runScripts = function() {
+    var coffees, coffeetypes, execute, index, length, s, scripts;
+
+    scripts = document.getElementsByTagName('script');
+    coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];
+    coffees = (function() {
+      var _i, _len, _ref, _results;
+
+      _results = [];
+      for (_i = 0, _len = scripts.length; _i < _len; _i++) {
+        s = scripts[_i];
+        if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) {
+          _results.push(s);
+        }
+      }
+      return _results;
+    })();
+    index = 0;
+    length = coffees.length;
+    (execute = function() {
+      var mediatype, options, script;
+
+      script = coffees[index++];
+      mediatype = script != null ? script.type : void 0;
+      if (__indexOf.call(coffeetypes, mediatype) >= 0) {
+        options = {
+          literate: mediatype === 'text/literate-coffeescript'
+        };
+        if (script.src) {
+          return CoffeeScript.load(script.src, execute, options);
+        } else {
+          options.sourceFiles = ['embedded'];
+          CoffeeScript.run(script.innerHTML, options);
+          return execute();
+        }
+      }
+    })();
+    return null;
+  };
+
+  if (window.addEventListener) {
+    addEventListener('DOMContentLoaded', runScripts, false);
+  } else {
+    attachEvent('onload', runScripts);
+  }
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js
new file mode 100644
index 0000000..12d4675
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js
@@ -0,0 +1,118 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var CoffeeScript, cakefileDirectory, existsSync, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
+
+  fs = require('fs');
+
+  path = require('path');
+
+  helpers = require('./helpers');
+
+  optparse = require('./optparse');
+
+  CoffeeScript = require('./coffee-script');
+
+  existsSync = fs.existsSync || path.existsSync;
+
+  tasks = {};
+
+  options = {};
+
+  switches = [];
+
+  oparse = null;
+
+  helpers.extend(global, {
+    task: function(name, description, action) {
+      var _ref;
+
+      if (!action) {
+        _ref = [description, action], action = _ref[0], description = _ref[1];
+      }
+      return tasks[name] = {
+        name: name,
+        description: description,
+        action: action
+      };
+    },
+    option: function(letter, flag, description) {
+      return switches.push([letter, flag, description]);
+    },
+    invoke: function(name) {
+      if (!tasks[name]) {
+        missingTask(name);
+      }
+      return tasks[name].action(options);
+    }
+  });
+
+  exports.run = function() {
+    var arg, args, e, _i, _len, _ref, _results;
+
+    global.__originalDirname = fs.realpathSync('.');
+    process.chdir(cakefileDirectory(__originalDirname));
+    args = process.argv.slice(2);
+    CoffeeScript.run(fs.readFileSync('Cakefile').toString(), {
+      filename: 'Cakefile'
+    });
+    oparse = new optparse.OptionParser(switches);
+    if (!args.length) {
+      return printTasks();
+    }
+    try {
+      options = oparse.parse(args);
+    } catch (_error) {
+      e = _error;
+      return fatalError("" + e);
+    }
+    _ref = options["arguments"];
+    _results = [];
+    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+      arg = _ref[_i];
+      _results.push(invoke(arg));
+    }
+    return _results;
+  };
+
+  printTasks = function() {
+    var cakefilePath, desc, name, relative, spaces, task;
+
+    relative = path.relative || path.resolve;
+    cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile');
+    console.log("" + cakefilePath + " defines the following tasks:\n");
+    for (name in tasks) {
+      task = tasks[name];
+      spaces = 20 - name.length;
+      spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
+      desc = task.description ? "# " + task.description : '';
+      console.log("cake " + name + spaces + " " + desc);
+    }
+    if (switches.length) {
+      return console.log(oparse.help());
+    }
+  };
+
+  fatalError = function(message) {
+    console.error(message + '\n');
+    console.log('To see a list of all tasks/options, run "cake"');
+    return process.exit(1);
+  };
+
+  missingTask = function(task) {
+    return fatalError("No such task: " + task);
+  };
+
+  cakefileDirectory = function(dir) {
+    var parent;
+
+    if (existsSync(path.join(dir, 'Cakefile'))) {
+      return dir;
+    }
+    parent = path.normalize(path.join(dir, '..'));
+    if (parent !== dir) {
+      return cakefileDirectory(parent);
+    }
+    throw new Error("Cakefile not found in " + (process.cwd()));
+  };
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js
new file mode 100644
index 0000000..ef2733d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js
@@ -0,0 +1,342 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var Lexer, child_process, compile, ext, fork, formatSourcePosition, fs, helpers, lexer, loadFile, parser, patchStackTrace, patched, path, sourcemap, vm, _i, _len, _ref,
+    __hasProp = {}.hasOwnProperty;
+
+  fs = require('fs');
+
+  vm = require('vm');
+
+  path = require('path');
+
+  child_process = require('child_process');
+
+  Lexer = require('./lexer').Lexer;
+
+  parser = require('./parser').parser;
+
+  helpers = require('./helpers');
+
+  sourcemap = require('./sourcemap');
+
+  exports.VERSION = '1.6.2';
+
+  exports.helpers = helpers;
+
+  exports.compile = compile = function(code, options) {
+    var answer, currentColumn, currentLine, fragment, fragments, header, js, merge, newLines, sourceMap, _i, _len;
+
+    if (options == null) {
+      options = {};
+    }
+    merge = exports.helpers.merge;
+    if (options.sourceMap) {
+      sourceMap = new sourcemap.SourceMap();
+    }
+    fragments = (parser.parse(lexer.tokenize(code, options))).compileToFragments(options);
+    currentLine = 0;
+    if (options.header || options.inline) {
+      currentLine += 1;
+    }
+    currentColumn = 0;
+    js = "";
+    for (_i = 0, _len = fragments.length; _i < _len; _i++) {
+      fragment = fragments[_i];
+      if (sourceMap) {
+        if (fragment.locationData) {
+          sourceMap.addMapping([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], {
+            noReplace: true
+          });
+        }
+        newLines = helpers.count(fragment.code, "\n");
+        currentLine += newLines;
+        currentColumn = fragment.code.length - (newLines ? fragment.code.lastIndexOf("\n") : 0);
+      }
+      js += fragment.code;
+    }
+    if (options.header) {
+      header = "Generated by CoffeeScript " + this.VERSION;
+      js = "// " + header + "\n" + js;
+    }
+    if (options.sourceMap) {
+      answer = {
+        js: js
+      };
+      if (sourceMap) {
+        answer.sourceMap = sourceMap;
+        answer.v3SourceMap = sourcemap.generateV3SourceMap(sourceMap, options, code);
+      }
+      return answer;
+    } else {
+      return js;
+    }
+  };
+
+  exports.tokens = function(code, options) {
+    return lexer.tokenize(code, options);
+  };
+
+  exports.nodes = function(source, options) {
+    if (typeof source === 'string') {
+      return parser.parse(lexer.tokenize(source, options));
+    } else {
+      return parser.parse(source);
+    }
+  };
+
+  exports.run = function(code, options) {
+    var answer, mainModule, _ref;
+
+    if (options == null) {
+      options = {};
+    }
+    mainModule = require.main;
+    if ((_ref = options.sourceMap) == null) {
+      options.sourceMap = true;
+    }
+    mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
+    mainModule.moduleCache && (mainModule.moduleCache = {});
+    mainModule.paths = require('module')._nodeModulePaths(path.dirname(fs.realpathSync(options.filename || '.')));
+    if (!helpers.isCoffee(mainModule.filename) || require.extensions) {
+      answer = compile(code, options);
+      patchStackTrace();
+      mainModule._sourceMaps[mainModule.filename] = answer.sourceMap;
+      return mainModule._compile(answer.js, mainModule.filename);
+    } else {
+      return mainModule._compile(code, mainModule.filename);
+    }
+  };
+
+  exports["eval"] = function(code, options) {
+    var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref, _ref1, _require;
+
+    if (options == null) {
+      options = {};
+    }
+    if (!(code = code.trim())) {
+      return;
+    }
+    Script = vm.Script;
+    if (Script) {
+      if (options.sandbox != null) {
+        if (options.sandbox instanceof Script.createContext().constructor) {
+          sandbox = options.sandbox;
+        } else {
+          sandbox = Script.createContext();
+          _ref = options.sandbox;
+          for (k in _ref) {
+            if (!__hasProp.call(_ref, k)) continue;
+            v = _ref[k];
+            sandbox[k] = v;
+          }
+        }
+        sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox;
+      } else {
+        sandbox = global;
+      }
+      sandbox.__filename = options.filename || 'eval';
+      sandbox.__dirname = path.dirname(sandbox.__filename);
+      if (!(sandbox !== global || sandbox.module || sandbox.require)) {
+        Module = require('module');
+        sandbox.module = _module = new Module(options.modulename || 'eval');
+        sandbox.require = _require = function(path) {
+          return Module._load(path, _module, true);
+        };
+        _module.filename = sandbox.__filename;
+        _ref1 = Object.getOwnPropertyNames(require);
+        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+          r = _ref1[_i];
+          if (r !== 'paths') {
+            _require[r] = require[r];
+          }
+        }
+        _require.paths = _module.paths = Module._nodeModulePaths(process.cwd());
+        _require.resolve = function(request) {
+          return Module._resolveFilename(request, _module);
+        };
+      }
+    }
+    o = {};
+    for (k in options) {
+      if (!__hasProp.call(options, k)) continue;
+      v = options[k];
+      o[k] = v;
+    }
+    o.bare = true;
+    js = compile(code, o);
+    if (sandbox === global) {
+      return vm.runInThisContext(js);
+    } else {
+      return vm.runInContext(js, sandbox);
+    }
+  };
+
+  loadFile = function(module, filename) {
+    var raw, stripped;
+
+    raw = fs.readFileSync(filename, 'utf8');
+    stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw;
+    return module._compile(compile(stripped, {
+      filename: filename,
+      literate: helpers.isLiterate(filename)
+    }), filename);
+  };
+
+  if (require.extensions) {
+    _ref = ['.coffee', '.litcoffee', '.coffee.md'];
+    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+      ext = _ref[_i];
+      require.extensions[ext] = loadFile;
+    }
+  }
+
+  if (child_process) {
+    fork = child_process.fork;
+    child_process.fork = function(path, args, options) {
+      var execPath;
+
+      if (args == null) {
+        args = [];
+      }
+      if (options == null) {
+        options = {};
+      }
+      execPath = helpers.isCoffee(path) ? 'coffee' : null;
+      if (!Array.isArray(args)) {
+        args = [];
+        options = args || {};
+      }
+      options.execPath || (options.execPath = execPath);
+      return fork(path, args, options);
+    };
+  }
+
+  lexer = new Lexer;
+
+  parser.lexer = {
+    lex: function() {
+      var tag, token;
+
+      token = this.tokens[this.pos++];
+      if (token) {
+        tag = token[0], this.yytext = token[1], this.yylloc = token[2];
+        this.yylineno = this.yylloc.first_line;
+      } else {
+        tag = '';
+      }
+      return tag;
+    },
+    setInput: function(tokens) {
+      this.tokens = tokens;
+      return this.pos = 0;
+    },
+    upcomingInput: function() {
+      return "";
+    }
+  };
+
+  parser.yy = require('./nodes');
+
+  parser.yy.parseError = function(message, _arg) {
+    var token;
+
+    token = _arg.token;
+    message = "unexpected " + (token === 1 ? 'end of input' : token);
+    return helpers.throwSyntaxError(message, parser.lexer.yylloc);
+  };
+
+  patched = false;
+
+  patchStackTrace = function() {
+    var mainModule;
+
+    if (patched) {
+      return;
+    }
+    patched = true;
+    mainModule = require.main;
+    mainModule._sourceMaps = {};
+    return Error.prepareStackTrace = function(err, stack) {
+      var frame, frames, getSourceMapping, sourceFiles, _ref1;
+
+      sourceFiles = {};
+      getSourceMapping = function(filename, line, column) {
+        var answer, sourceMap;
+
+        sourceMap = mainModule._sourceMaps[filename];
+        if (sourceMap) {
+          answer = sourceMap.getSourcePosition([line - 1, column - 1]);
+        }
+        if (answer) {
+          return [answer[0] + 1, answer[1] + 1];
+        } else {
+          return null;
+        }
+      };
+      frames = (function() {
+        var _j, _len1, _results;
+
+        _results = [];
+        for (_j = 0, _len1 = stack.length; _j < _len1; _j++) {
+          frame = stack[_j];
+          if (frame.getFunction() === exports.run) {
+            break;
+          }
+          _results.push("  at " + (formatSourcePosition(frame, getSourceMapping)));
+        }
+        return _results;
+      })();
+      return "" + err.name + ": " + ((_ref1 = err.message) != null ? _ref1 : '') + "\n" + (frames.join('\n')) + "\n";
+    };
+  };
+
+  formatSourcePosition = function(frame, getSourceMapping) {
+    var as, column, fileLocation, fileName, functionName, isConstructor, isMethodCall, line, methodName, source, tp, typeName;
+
+    fileName = void 0;
+    fileLocation = '';
+    if (frame.isNative()) {
+      fileLocation = "native";
+    } else {
+      if (frame.isEval()) {
+        fileName = frame.getScriptNameOrSourceURL();
+        if (!fileName) {
+          fileLocation = "" + (frame.getEvalOrigin()) + ", ";
+        }
+      } else {
+        fileName = frame.getFileName();
+      }
+      fileName || (fileName = "<anonymous>");
+      line = frame.getLineNumber();
+      column = frame.getColumnNumber();
+      source = getSourceMapping(fileName, line, column);
+      fileLocation = source ? "" + fileName + ":" + source[0] + ":" + source[1] + ", <js>:" + line + ":" + column : "" + fileName + ":" + line + ":" + column;
+    }
+    functionName = frame.getFunctionName();
+    isConstructor = frame.isConstructor();
+    isMethodCall = !(frame.isToplevel() || isConstructor);
+    if (isMethodCall) {
+      methodName = frame.getMethodName();
+      typeName = frame.getTypeName();
+      if (functionName) {
+        tp = as = '';
+        if (typeName && functionName.indexOf(typeName)) {
+          tp = "" + typeName + ".";
+        }
+        if (methodName && functionName.indexOf("." + methodName) !== functionName.length - methodName.length - 1) {
+          as = " [as " + methodName + "]";
+        }
+        return "" + tp + functionName + as + " (" + fileLocation + ")";
+      } else {
+        return "" + typeName + "." + (methodName || '<anonymous>') + " (" + fileLocation + ")";
+      }
+    } else if (isConstructor) {
+      return "new " + (functionName || '<anonymous>') + " (" + fileLocation + ")";
+    } else if (functionName) {
+      return "" + functionName + " (" + fileLocation + ")";
+    } else {
+      return fileLocation;
+    }
+  };
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js
new file mode 100644
index 0000000..047d21c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js
@@ -0,0 +1,558 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, lint, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref;
+
+  fs = require('fs');
+
+  path = require('path');
+
+  helpers = require('./helpers');
+
+  optparse = require('./optparse');
+
+  CoffeeScript = require('./coffee-script');
+
+  _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec;
+
+  EventEmitter = require('events').EventEmitter;
+
+  exists = fs.exists || path.exists;
+
+  helpers.extend(CoffeeScript, new EventEmitter);
+
+  printLine = function(line) {
+    return process.stdout.write(line + '\n');
+  };
+
+  printWarn = function(line) {
+    return process.stderr.write(line + '\n');
+  };
+
+  hidden = function(file) {
+    return /^\.|~$/.test(file);
+  };
+
+  BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.';
+
+  SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-l', '--lint', 'pipe the compiled JavaScript through JavaScript Lint'], ['-m', '--map', 'generate source map and save as .map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version
  number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
+
+  opts = {};
+
+  sources = [];
+
+  sourceCode = [];
+
+  notSources = {};
+
+  watchers = {};
+
+  optionParser = null;
+
+  exports.run = function() {
+    var literals, source, _i, _len, _results;
+
+    parseOptions();
+    if (opts.nodejs) {
+      return forkNode();
+    }
+    if (opts.help) {
+      return usage();
+    }
+    if (opts.version) {
+      return version();
+    }
+    if (opts.interactive) {
+      return require('./repl').start();
+    }
+    if (opts.watch && !fs.watch) {
+      return printWarn("The --watch feature depends on Node v0.6.0+. You are running " + process.version + ".");
+    }
+    if (opts.stdio) {
+      return compileStdio();
+    }
+    if (opts["eval"]) {
+      return compileScript(null, sources[0]);
+    }
+    if (!sources.length) {
+      return require('./repl').start();
+    }
+    literals = opts.run ? sources.splice(1) : [];
+    process.argv = process.argv.slice(0, 2).concat(literals);
+    process.argv[0] = 'coffee';
+    _results = [];
+    for (_i = 0, _len = sources.length; _i < _len; _i++) {
+      source = sources[_i];
+      _results.push(compilePath(source, true, path.normalize(source)));
+    }
+    return _results;
+  };
+
+  compilePath = function(source, topLevel, base) {
+    return fs.stat(source, function(err, stats) {
+      if (err && err.code !== 'ENOENT') {
+        throw err;
+      }
+      if ((err != null ? err.code : void 0) === 'ENOENT') {
+        console.error("File not found: " + source);
+        process.exit(1);
+      }
+      if (stats.isDirectory() && path.dirname(source) !== 'node_modules') {
+        if (opts.watch) {
+          watchDir(source, base);
+        }
+        return fs.readdir(source, function(err, files) {
+          var file, index, _ref1, _ref2;
+
+          if (err && err.code !== 'ENOENT') {
+            throw err;
+          }
+          if ((err != null ? err.code : void 0) === 'ENOENT') {
+            return;
+          }
+          index = sources.indexOf(source);
+          files = files.filter(function(file) {
+            return !hidden(file);
+          });
+          [].splice.apply(sources, [index, index - index + 1].concat(_ref1 = (function() {
+            var _i, _len, _results;
+
+            _results = [];
+            for (_i = 0, _len = files.length; _i < _len; _i++) {
+              file = files[_i];
+              _results.push(path.join(source, file));
+            }
+            return _results;
+          })())), _ref1;
+          [].splice.apply(sourceCode, [index, index - index + 1].concat(_ref2 = files.map(function() {
+            return null;
+          }))), _ref2;
+          return files.forEach(function(file) {
+            return compilePath(path.join(source, file), false, base);
+          });
+        });
+      } else if (topLevel || helpers.isCoffee(source)) {
+        if (opts.watch) {
+          watch(source, base);
+        }
+        return fs.readFile(source, function(err, code) {
+          if (err && err.code !== 'ENOENT') {
+            throw err;
+          }
+          if ((err != null ? err.code : void 0) === 'ENOENT') {
+            return;
+          }
+          return compileScript(source, code.toString(), base);
+        });
+      } else {
+        notSources[source] = true;
+        return removeSource(source, base);
+      }
+    });
+  };
+
+  compileScript = function(file, input, base) {
+    var compiled, err, message, o, options, t, task, useColors;
+
+    if (base == null) {
+      base = null;
+    }
+    o = opts;
+    options = compileOptions(file, base);
+    try {
+      t = task = {
+        file: file,
+        input: input,
+        options: options
+      };
+      CoffeeScript.emit('compile', task);
+      if (o.tokens) {
+        return printTokens(CoffeeScript.tokens(t.input, t.options));
+      } else if (o.nodes) {
+        return printLine(CoffeeScript.nodes(t.input, t.options).toString().trim());
+      } else if (o.run) {
+        return CoffeeScript.run(t.input, t.options);
+      } else if (o.join && t.file !== o.join) {
+        if (helpers.isLiterate(file)) {
+          t.input = helpers.invertLiterate(t.input);
+        }
+        sourceCode[sources.indexOf(t.file)] = t.input;
+        return compileJoin();
+      } else {
+        compiled = CoffeeScript.compile(t.input, t.options);
+        t.output = compiled;
+        if (o.map) {
+          t.output = compiled.js;
+          t.sourceMap = compiled.v3SourceMap;
+        }
+        CoffeeScript.emit('success', task);
+        if (o.print) {
+          return printLine(t.output.trim());
+        } else if (o.compile || o.map) {
+          return writeJs(base, t.file, t.output, options.jsPath, t.sourceMap);
+        } else if (o.lint) {
+          return lint(t.file, t.output);
+        }
+      }
+    } catch (_error) {
+      err = _error;
+      CoffeeScript.emit('failure', err, task);
+      if (CoffeeScript.listeners('failure').length) {
+        return;
+      }
+      useColors = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS;
+      message = helpers.prettyErrorMessage(err, file || '[stdin]', input, useColors);
+      if (o.watch) {
+        return printLine(message + '\x07');
+      } else {
+        printWarn(message);
+        return process.exit(1);
+      }
+    }
+  };
+
+  compileStdio = function() {
+    var code, stdin;
+
+    code = '';
+    stdin = process.openStdin();
+    stdin.on('data', function(buffer) {
+      if (buffer) {
+        return code += buffer.toString();
+      }
+    });
+    return stdin.on('end', function() {
+      return compileScript(null, code);
+    });
+  };
+
+  joinTimeout = null;
+
+  compileJoin = function() {
+    if (!opts.join) {
+      return;
+    }
+    if (!sourceCode.some(function(code) {
+      return code === null;
+    })) {
+      clearTimeout(joinTimeout);
+      return joinTimeout = wait(100, function() {
+        return compileScript(opts.join, sourceCode.join('\n'), opts.join);
+      });
+    }
+  };
+
+  watch = function(source, base) {
+    var compile, compileTimeout, e, prevStats, rewatch, watchErr, watcher;
+
+    prevStats = null;
+    compileTimeout = null;
+    watchErr = function(e) {
+      if (e.code === 'ENOENT') {
+        if (sources.indexOf(source) === -1) {
+          return;
+        }
+        try {
+          rewatch();
+          return compile();
+        } catch (_error) {
+          e = _error;
+          removeSource(source, base, true);
+          return compileJoin();
+        }
+      } else {
+        throw e;
+      }
+    };
+    compile = function() {
+      clearTimeout(compileTimeout);
+      return compileTimeout = wait(25, function() {
+        return fs.stat(source, function(err, stats) {
+          if (err) {
+            return watchErr(err);
+          }
+          if (prevStats && stats.size === prevStats.size && stats.mtime.getTime() === prevStats.mtime.getTime()) {
+            return rewatch();
+          }
+          prevStats = stats;
+          return fs.readFile(source, function(err, code) {
+            if (err) {
+              return watchErr(err);
+            }
+            compileScript(source, code.toString(), base);
+            return rewatch();
+          });
+        });
+      });
+    };
+    try {
+      watcher = fs.watch(source, compile);
+    } catch (_error) {
+      e = _error;
+      watchErr(e);
+    }
+    return rewatch = function() {
+      if (watcher != null) {
+        watcher.close();
+      }
+      return watcher = fs.watch(source, compile);
+    };
+  };
+
+  watchDir = function(source, base) {
+    var e, readdirTimeout, watcher;
+
+    readdirTimeout = null;
+    try {
+      return watcher = fs.watch(source, function() {
+        clearTimeout(readdirTimeout);
+        return readdirTimeout = wait(25, function() {
+          return fs.readdir(source, function(err, files) {
+            var file, _i, _len, _results;
+
+            if (err) {
+              if (err.code !== 'ENOENT') {
+                throw err;
+              }
+              watcher.close();
+              return unwatchDir(source, base);
+            }
+            _results = [];
+            for (_i = 0, _len = files.length; _i < _len; _i++) {
+              file = files[_i];
+              if (!(!hidden(file) && !notSources[file])) {
+                continue;
+              }
+              file = path.join(source, file);
+              if (sources.some(function(s) {
+                return s.indexOf(file) >= 0;
+              })) {
+                continue;
+              }
+              sources.push(file);
+              sourceCode.push(null);
+              _results.push(compilePath(file, false, base));
+            }
+            return _results;
+          });
+        });
+      });
+    } catch (_error) {
+      e = _error;
+      if (e.code !== 'ENOENT') {
+        throw e;
+      }
+    }
+  };
+
+  unwatchDir = function(source, base) {
+    var file, prevSources, toRemove, _i, _len;
+
+    prevSources = sources.slice(0);
+    toRemove = (function() {
+      var _i, _len, _results;
+
+      _results = [];
+      for (_i = 0, _len = sources.length; _i < _len; _i++) {
+        file = sources[_i];
+        if (file.indexOf(source) >= 0) {
+          _results.push(file);
+        }
+      }
+      return _results;
+    })();
+    for (_i = 0, _len = toRemove.length; _i < _len; _i++) {
+      file = toRemove[_i];
+      removeSource(file, base, true);
+    }
+    if (!sources.some(function(s, i) {
+      return prevSources[i] !== s;
+    })) {
+      return;
+    }
+    return compileJoin();
+  };
+
+  removeSource = function(source, base, removeJs) {
+    var index, jsPath;
+
+    index = sources.indexOf(source);
+    sources.splice(index, 1);
+    sourceCode.splice(index, 1);
+    if (removeJs && !opts.join) {
+      jsPath = outputPath(source, base);
+      return exists(jsPath, function(itExists) {
+        if (itExists) {
+          return fs.unlink(jsPath, function(err) {
+            if (err && err.code !== 'ENOENT') {
+              throw err;
+            }
+            return timeLog("removed " + source);
+          });
+        }
+      });
+    }
+  };
+
+  outputPath = function(source, base, extension) {
+    var baseDir, basename, dir, srcDir;
+
+    if (extension == null) {
+      extension = ".js";
+    }
+    basename = helpers.baseFileName(source, true, path.sep);
+    srcDir = path.dirname(source);
+    baseDir = base === '.' ? srcDir : srcDir.substring(base.length);
+    dir = opts.output ? path.join(opts.output, baseDir) : srcDir;
+    return path.join(dir, basename + extension);
+  };
+
+  writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap) {
+    var compile, jsDir, sourceMapPath;
+
+    if (generatedSourceMap == null) {
+      generatedSourceMap = null;
+    }
+    sourceMapPath = outputPath(sourcePath, base, ".map");
+    jsDir = path.dirname(jsPath);
+    compile = function() {
+      if (opts.compile) {
+        if (js.length <= 0) {
+          js = ' ';
+        }
+        if (generatedSourceMap) {
+          js = "" + js + "\n/*\n//@ sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, path.sep)) + "\n*/\n";
+        }
+        fs.writeFile(jsPath, js, function(err) {
+          if (err) {
+            return printLine(err.message);
+          } else if (opts.compile && opts.watch) {
+            return timeLog("compiled " + sourcePath);
+          }
+        });
+      }
+      if (generatedSourceMap) {
+        return fs.writeFile(sourceMapPath, generatedSourceMap, function(err) {
+          if (err) {
+            return printLine("Could not write source map: " + err.message);
+          }
+        });
+      }
+    };
+    return exists(jsDir, function(itExists) {
+      if (itExists) {
+        return compile();
+      } else {
+        return exec("mkdir -p " + jsDir, compile);
+      }
+    });
+  };
+
+  wait = function(milliseconds, func) {
+    return setTimeout(func, milliseconds);
+  };
+
+  timeLog = function(message) {
+    return console.log("" + ((new Date).toLocaleTimeString()) + " - " + message);
+  };
+
+  lint = function(file, js) {
+    var conf, jsl, printIt;
+
+    printIt = function(buffer) {
+      return printLine(file + ':\t' + buffer.toString().trim());
+    };
+    conf = __dirname + '/../../extras/jsl.conf';
+    jsl = spawn('jsl', ['-nologo', '-stdin', '-conf', conf]);
+    jsl.stdout.on('data', printIt);
+    jsl.stderr.on('data', printIt);
+    jsl.stdin.write(js);
+    return jsl.stdin.end();
+  };
+
+  printTokens = function(tokens) {
+    var strings, tag, token, value;
+
+    strings = (function() {
+      var _i, _len, _results;
+
+      _results = [];
+      for (_i = 0, _len = tokens.length; _i < _len; _i++) {
+        token = tokens[_i];
+        tag = token[0];
+        value = token[1].toString().replace(/\n/, '\\n');
+        _results.push("[" + tag + " " + value + "]");
+      }
+      return _results;
+    })();
+    return printLine(strings.join(' '));
+  };
+
+  parseOptions = function() {
+    var i, o, source, _i, _len;
+
+    optionParser = new optparse.OptionParser(SWITCHES, BANNER);
+    o = opts = optionParser.parse(process.argv.slice(2));
+    o.compile || (o.compile = !!o.output);
+    o.run = !(o.compile || o.print || o.lint || o.map);
+    o.print = !!(o.print || (o["eval"] || o.stdio && o.compile));
+    sources = o["arguments"];
+    for (i = _i = 0, _len = sources.length; _i < _len; i = ++_i) {
+      source = sources[i];
+      sourceCode[i] = null;
+    }
+  };
+
+  compileOptions = function(filename, base) {
+    var answer, cwd, jsDir, jsPath;
+
+    answer = {
+      filename: filename,
+      literate: helpers.isLiterate(filename),
+      bare: opts.bare,
+      header: opts.compile,
+      sourceMap: opts.map
+    };
+    if (filename) {
+      if (base) {
+        cwd = process.cwd();
+        jsPath = outputPath(filename, base);
+        jsDir = path.dirname(jsPath);
+        answer = helpers.merge(answer, {
+          jsPath: jsPath,
+          sourceRoot: path.relative(jsDir, cwd),
+          sourceFiles: [path.relative(cwd, filename)],
+          generatedFile: helpers.baseFileName(jsPath, false, path.sep)
+        });
+      } else {
+        answer = helpers.merge(answer, {
+          sourceRoot: "",
+          sourceFiles: [helpers.baseFileName(filename, false, path.sep)],
+          generatedFile: helpers.baseFileName(filename, true, path.sep) + ".js"
+        });
+      }
+    }
+    return answer;
+  };
+
+  forkNode = function() {
+    var args, nodeArgs;
+
+    nodeArgs = opts.nodejs.split(/\s+/);
+    args = process.argv.slice(1);
+    args.splice(args.indexOf('--nodejs'), 2);
+    return spawn(process.execPath, nodeArgs.concat(args), {
+      cwd: process.cwd(),
+      env: process.env,
+      customFds: [0, 1, 2]
+    });
+  };
+
+  usage = function() {
+    return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help());
+  };
+
+  version = function() {
+    return printLine("CoffeeScript version " + CoffeeScript.VERSION);
+  };
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js
new file mode 100644
index 0000000..b57cb74
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js
@@ -0,0 +1,625 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
+
+  Parser = require('jison').Parser;
+
+  unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/;
+
+  o = function(patternString, action, options) {
+    var addLocationDataFn, match, patternCount;
+
+    patternString = patternString.replace(/\s{2,}/g, ' ');
+    patternCount = patternString.split(' ').length;
+    if (!action) {
+      return [patternString, '$$ = $1;', options];
+    }
+    action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())";
+    action = action.replace(/\bnew /g, '$&yy.');
+    action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&');
+    addLocationDataFn = function(first, last) {
+      if (!last) {
+        return "yy.addLocationDataFn(@" + first + ")";
+      } else {
+        return "yy.addLocationDataFn(@" + first + ", @" + last + ")";
+      }
+    };
+    action = action.replace(/LOC\(([0-9]*)\)/g, addLocationDataFn('$1'));
+    action = action.replace(/LOC\(([0-9]*),\s*([0-9]*)\)/g, addLocationDataFn('$1', '$2'));
+    return [patternString, "$$ = " + (addLocationDataFn(1, patternCount)) + "(" + action + ");", options];
+  };
+
+  grammar = {
+    Root: [
+      o('', function() {
+        return new Block;
+      }), o('Body'), o('Block TERMINATOR')
+    ],
+    Body: [
+      o('Line', function() {
+        return Block.wrap([$1]);
+      }), o('Body TERMINATOR Line', function() {
+        return $1.push($3);
+      }), o('Body TERMINATOR')
+    ],
+    Line: [o('Expression'), o('Statement')],
+    Statement: [
+      o('Return'), o('Comment'), o('STATEMENT', function() {
+        return new Literal($1);
+      })
+    ],
+    Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class'), o('Throw')],
+    Block: [
+      o('INDENT OUTDENT', function() {
+        return new Block;
+      }), o('INDENT Body OUTDENT', function() {
+        return $2;
+      })
+    ],
+    Identifier: [
+      o('IDENTIFIER', function() {
+        return new Literal($1);
+      })
+    ],
+    AlphaNumeric: [
+      o('NUMBER', function() {
+        return new Literal($1);
+      }), o('STRING', function() {
+        return new Literal($1);
+      })
+    ],
+    Literal: [
+      o('AlphaNumeric'), o('JS', function() {
+        return new Literal($1);
+      }), o('REGEX', function() {
+        return new Literal($1);
+      }), o('DEBUGGER', function() {
+        return new Literal($1);
+      }), o('UNDEFINED', function() {
+        return new Undefined;
+      }), o('NULL', function() {
+        return new Null;
+      }), o('BOOL', function() {
+        return new Bool($1);
+      })
+    ],
+    Assign: [
+      o('Assignable = Expression', function() {
+        return new Assign($1, $3);
+      }), o('Assignable = TERMINATOR Expression', function() {
+        return new Assign($1, $4);
+      }), o('Assignable = INDENT Expression OUTDENT', function() {
+        return new Assign($1, $4);
+      })
+    ],
+    AssignObj: [
+      o('ObjAssignable', function() {
+        return new Value($1);
+      }), o('ObjAssignable : Expression', function() {
+        return new Assign(LOC(1)(new Value($1)), $3, 'object');
+      }), o('ObjAssignable :\
+       INDENT Expression OUTDENT', function() {
+        return new Assign(LOC(1)(new Value($1)), $4, 'object');
+      }), o('Comment')
+    ],
+    ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')],
+    Return: [
+      o('RETURN Expression', function() {
+        return new Return($2);
+      }), o('RETURN', function() {
+        return new Return;
+      })
+    ],
+    Comment: [
+      o('HERECOMMENT', function() {
+        return new Comment($1);
+      })
+    ],
+    Code: [
+      o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() {
+        return new Code($2, $5, $4);
+      }), o('FuncGlyph Block', function() {
+        return new Code([], $2, $1);
+      })
+    ],
+    FuncGlyph: [
+      o('->', function() {
+        return 'func';
+      }), o('=>', function() {
+        return 'boundfunc';
+      })
+    ],
+    OptComma: [o(''), o(',')],
+    ParamList: [
+      o('', function() {
+        return [];
+      }), o('Param', function() {
+        return [$1];
+      }), o('ParamList , Param', function() {
+        return $1.concat($3);
+      }), o('ParamList OptComma TERMINATOR Param', function() {
+        return $1.concat($4);
+      }), o('ParamList OptComma INDENT ParamList OptComma OUTDENT', function() {
+        return $1.concat($4);
+      })
+    ],
+    Param: [
+      o('ParamVar', function() {
+        return new Param($1);
+      }), o('ParamVar ...', function() {
+        return new Param($1, null, true);
+      }), o('ParamVar = Expression', function() {
+        return new Param($1, $3);
+      })
+    ],
+    ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')],
+    Splat: [
+      o('Expression ...', function() {
+        return new Splat($1);
+      })
+    ],
+    SimpleAssignable: [
+      o('Identifier', function() {
+        return new Value($1);
+      }), o('Value Accessor', function() {
+        return $1.add($2);
+      }), o('Invocation Accessor', function() {
+        return new Value($1, [].concat($2));
+      }), o('ThisProperty')
+    ],
+    Assignable: [
+      o('SimpleAssignable'), o('Array', function() {
+        return new Value($1);
+      }), o('Object', function() {
+        return new Value($1);
+      })
+    ],
+    Value: [
+      o('Assignable'), o('Literal', function() {
+        return new Value($1);
+      }), o('Parenthetical', function() {
+        return new Value($1);
+      }), o('Range', function() {
+        return new Value($1);
+      }), o('This')
+    ],
+    Accessor: [
+      o('.  Identifier', function() {
+        return new Access($2);
+      }), o('?. Identifier', function() {
+        return new Access($2, 'soak');
+      }), o(':: Identifier', function() {
+        return [LOC(1)(new Access(new Literal('prototype'))), LOC(2)(new Access($2))];
+      }), o('?:: Identifier', function() {
+        return [LOC(1)(new Access(new Literal('prototype'), 'soak')), LOC(2)(new Access($2))];
+      }), o('::', function() {
+        return new Access(new Literal('prototype'));
+      }), o('Index')
+    ],
+    Index: [
+      o('INDEX_START IndexValue INDEX_END', function() {
+        return $2;
+      }), o('INDEX_SOAK  Index', function() {
+        return extend($2, {
+          soak: true
+        });
+      })
+    ],
+    IndexValue: [
+      o('Expression', function() {
+        return new Index($1);
+      }), o('Slice', function() {
+        return new Slice($1);
+      })
+    ],
+    Object: [
+      o('{ AssignList OptComma }', function() {
+        return new Obj($2, $1.generated);
+      })
+    ],
+    AssignList: [
+      o('', function() {
+        return [];
+      }), o('AssignObj', function() {
+        return [$1];
+      }), o('AssignList , AssignObj', function() {
+        return $1.concat($3);
+      }), o('AssignList OptComma TERMINATOR AssignObj', function() {
+        return $1.concat($4);
+      }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() {
+        return $1.concat($4);
+      })
+    ],
+    Class: [
+      o('CLASS', function() {
+        return new Class;
+      }), o('CLASS Block', function() {
+        return new Class(null, null, $2);
+      }), o('CLASS EXTENDS Expression', function() {
+        return new Class(null, $3);
+      }), o('CLASS EXTENDS Expression Block', function() {
+        return new Class(null, $3, $4);
+      }), o('CLASS SimpleAssignable', function() {
+        return new Class($2);
+      }), o('CLASS SimpleAssignable Block', function() {
+        return new Class($2, null, $3);
+      }), o('CLASS SimpleAssignable EXTENDS Expression', function() {
+        return new Class($2, $4);
+      }), o('CLASS SimpleAssignable EXTENDS Expression Block', function() {
+        return new Class($2, $4, $5);
+      })
+    ],
+    Invocation: [
+      o('Value OptFuncExist Arguments', function() {
+        return new Call($1, $3, $2);
+      }), o('Invocation OptFuncExist Arguments', function() {
+        return new Call($1, $3, $2);
+      }), o('SUPER', function() {
+        return new Call('super', [new Splat(new Literal('arguments'))]);
+      }), o('SUPER Arguments', function() {
+        return new Call('super', $2);
+      })
+    ],
+    OptFuncExist: [
+      o('', function() {
+        return false;
+      }), o('FUNC_EXIST', function() {
+        return true;
+      })
+    ],
+    Arguments: [
+      o('CALL_START CALL_END', function() {
+        return [];
+      }), o('CALL_START ArgList OptComma CALL_END', function() {
+        return $2;
+      })
+    ],
+    This: [
+      o('THIS', function() {
+        return new Value(new Literal('this'));
+      }), o('@', function() {
+        return new Value(new Literal('this'));
+      })
+    ],
+    ThisProperty: [
+      o('@ Identifier', function() {
+        return new Value(LOC(1)(new Literal('this')), [LOC(2)(new Access($2))], 'this');
+      })
+    ],
+    Array: [
+      o('[ ]', function() {
+        return new Arr([]);
+      }), o('[ ArgList OptComma ]', function() {
+        return new Arr($2);
+      })
+    ],
+    RangeDots: [
+      o('..', function() {
+        return 'inclusive';
+      }), o('...', function() {
+        return 'exclusive';
+      })
+    ],
+    Range: [
+      o('[ Expression RangeDots Expression ]', function() {
+        return new Range($2, $4, $3);
+      })
+    ],
+    Slice: [
+      o('Expression RangeDots Expression', function() {
+        return new Range($1, $3, $2);
+      }), o('Expression RangeDots', function() {
+        return new Range($1, null, $2);
+      }), o('RangeDots Expression', function() {
+        return new Range(null, $2, $1);
+      }), o('RangeDots', function() {
+        return new Range(null, null, $1);
+      })
+    ],
+    ArgList: [
+      o('Arg', function() {
+        return [$1];
+      }), o('ArgList , Arg', function() {
+        return $1.concat($3);
+      }), o('ArgList OptComma TERMINATOR Arg', function() {
+        return $1.concat($4);
+      }), o('INDENT ArgList OptComma OUTDENT', function() {
+        return $2;
+      }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() {
+        return $1.concat($4);
+      })
+    ],
+    Arg: [o('Expression'), o('Splat')],
+    SimpleArgs: [
+      o('Expression'), o('SimpleArgs , Expression', function() {
+        return [].concat($1, $3);
+      })
+    ],
+    Try: [
+      o('TRY Block', function() {
+        return new Try($2);
+      }), o('TRY Block Catch', function() {
+        return new Try($2, $3[0], $3[1]);
+      }), o('TRY Block FINALLY Block', function() {
+        return new Try($2, null, null, $4);
+      }), o('TRY Block Catch FINALLY Block', function() {
+        return new Try($2, $3[0], $3[1], $5);
+      })
+    ],
+    Catch: [
+      o('CATCH Identifier Block', function() {
+        return [$2, $3];
+      }), o('CATCH Object Block', function() {
+        return [LOC(2)(new Value($2)), $3];
+      })
+    ],
+    Throw: [
+      o('THROW Expression', function() {
+        return new Throw($2);
+      })
+    ],
+    Parenthetical: [
+      o('( Body )', function() {
+        return new Parens($2);
+      }), o('( INDENT Body OUTDENT )', function() {
+        return new Parens($3);
+      })
+    ],
+    WhileSource: [
+      o('WHILE Expression', function() {
+        return new While($2);
+      }), o('WHILE Expression WHEN Expression', function() {
+        return new While($2, {
+          guard: $4
+        });
+      }), o('UNTIL Expression', function() {
+        return new While($2, {
+          invert: true
+        });
+      }), o('UNTIL Expression WHEN Expression', function() {
+        return new While($2, {
+          invert: true,
+          guard: $4
+        });
+      })
+    ],
+    While: [
+      o('WhileSource Block', function() {
+        return $1.addBody($2);
+      }), o('Statement  WhileSource', function() {
+        return $2.addBody(LOC(1)(Block.wrap([$1])));
+      }), o('Expression WhileSource', function() {
+        return $2.addBody(LOC(1)(Block.wrap([$1])));
+      }), o('Loop', function() {
+        return $1;
+      })
+    ],
+    Loop: [
+      o('LOOP Block', function() {
+        return new While(LOC(1)(new Literal('true'))).addBody($2);
+      }), o('LOOP Expression', function() {
+        return new While(LOC(1)(new Literal('true'))).addBody(LOC(2)(Block.wrap([$2])));
+      })
+    ],
+    For: [
+      o('Statement  ForBody', function() {
+        return new For($1, $2);
+      }), o('Expression ForBody', function() {
+        return new For($1, $2);
+      }), o('ForBody    Block', function() {
+        return new For($2, $1);
+      })
+    ],
+    ForBody: [
+      o('FOR Range', function() {
+        return {
+          source: LOC(2)(new Value($2))
+        };
+      }), o('ForStart ForSource', function() {
+        $2.own = $1.own;
+        $2.name = $1[0];
+        $2.index = $1[1];
+        return $2;
+      })
+    ],
+    ForStart: [
+      o('FOR ForVariables', function() {
+        return $2;
+      }), o('FOR OWN ForVariables', function() {
+        $3.own = true;
+        return $3;
+      })
+    ],
+    ForValue: [
+      o('Identifier'), o('ThisProperty'), o('Array', function() {
+        return new Value($1);
+      }), o('Object', function() {
+        return new Value($1);
+      })
+    ],
+    ForVariables: [
+      o('ForValue', function() {
+        return [$1];
+      }), o('ForValue , ForValue', function() {
+        return [$1, $3];
+      })
+    ],
+    ForSource: [
+      o('FORIN Expression', function() {
+        return {
+          source: $2
+        };
+      }), o('FOROF Expression', function() {
+        return {
+          source: $2,
+          object: true
+        };
+      }), o('FORIN Expression WHEN Expression', function() {
+        return {
+          source: $2,
+          guard: $4
+        };
+      }), o('FOROF Expression WHEN Expression', function() {
+        return {
+          source: $2,
+          guard: $4,
+          object: true
+        };
+      }), o('FORIN Expression BY Expression', function() {
+        return {
+          source: $2,
+          step: $4
+        };
+      }), o('FORIN Expression WHEN Expression BY Expression', function() {
+        return {
+          source: $2,
+          guard: $4,
+          step: $6
+        };
+      }), o('FORIN Expression BY Expression WHEN Expression', function() {
+        return {
+          source: $2,
+          step: $4,
+          guard: $6
+        };
+      })
+    ],
+    Switch: [
+      o('SWITCH Expression INDENT Whens OUTDENT', function() {
+        return new Switch($2, $4);
+      }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() {
+        return new Switch($2, $4, $6);
+      }), o('SWITCH INDENT Whens OUTDENT', function() {
+        return new Switch(null, $3);
+      }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() {
+        return new Switch(null, $3, $5);
+      })
+    ],
+    Whens: [
+      o('When'), o('Whens When', function() {
+        return $1.concat($2);
+      })
+    ],
+    When: [
+      o('LEADING_WHEN SimpleArgs Block', function() {
+        return [[$2, $3]];
+      }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() {
+        return [[$2, $3]];
+      })
+    ],
+    IfBlock: [
+      o('IF Expression Block', function() {
+        return new If($2, $3, {
+          type: $1
+        });
+      }), o('IfBlock ELSE IF Expression Block', function() {
+        return $1.addElse(new If($4, $5, {
+          type: $3
+        }));
+      })
+    ],
+    If: [
+      o('IfBlock'), o('IfBlock ELSE Block', function() {
+        return $1.addElse($3);
+      }), o('Statement  POST_IF Expression', function() {
+        return new If($3, LOC(1)(Block.wrap([$1])), {
+          type: $2,
+          statement: true
+        });
+      }), o('Expression POST_IF Expression', function() {
+        return new If($3, LOC(1)(Block.wrap([$1])), {
+          type: $2,
+          statement: true
+        });
+      })
+    ],
+    Operation: [
+      o('UNARY Expression', function() {
+        return new Op($1, $2);
+      }), o('-     Expression', (function() {
+        return new Op('-', $2);
+      }), {
+        prec: 'UNARY'
+      }), o('+     Expression', (function() {
+        return new Op('+', $2);
+      }), {
+        prec: 'UNARY'
+      }), o('-- SimpleAssignable', function() {
+        return new Op('--', $2);
+      }), o('++ SimpleAssignable', function() {
+        return new Op('++', $2);
+      }), o('SimpleAssignable --', function() {
+        return new Op('--', $1, null, true);
+      }), o('SimpleAssignable ++', function() {
+        return new Op('++', $1, null, true);
+      }), o('Expression ?', function() {
+        return new Existence($1);
+      }), o('Expression +  Expression', function() {
+        return new Op('+', $1, $3);
+      }), o('Expression -  Expression', function() {
+        return new Op('-', $1, $3);
+      }), o('Expression MATH     Expression', function() {
+        return new Op($2, $1, $3);
+      }), o('Expression SHIFT    Expression', function() {
+        return new Op($2, $1, $3);
+      }), o('Expression COMPARE  Expression', function() {
+        return new Op($2, $1, $3);
+      }), o('Expression LOGIC    Expression', function() {
+        return new Op($2, $1, $3);
+      }), o('Expression RELATION Expression', function() {
+        if ($2.charAt(0) === '!') {
+          return new Op($2.slice(1), $1, $3).invert();
+        } else {
+          return new Op($2, $1, $3);
+        }
+      }), o('SimpleAssignable COMPOUND_ASSIGN\
+       Expression', function() {
+        return new Assign($1, $3, $2);
+      }), o('SimpleAssignable COMPOUND_ASSIGN\
+       INDENT Expression OUTDENT', function() {
+        return new Assign($1, $4, $2);
+      }), o('SimpleAssignable COMPOUND_ASSIGN TERMINATOR\
+       Expression', function() {
+        return new Assign($1, $4, $2);
+      }), o('SimpleAssignable EXTENDS Expression', function() {
+        return new Extends($1, $3);
+      })
+    ]
+  };
+
+  operators = [['left', '.', '?.', '::', '?::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']];
+
+  tokens = [];
+
+  for (name in grammar) {
+    alternatives = grammar[name];
+    grammar[name] = (function() {
+      var _i, _j, _len, _len1, _ref, _results;
+
+      _results = [];
+      for (_i = 0, _len = alternatives.length; _i < _len; _i++) {
+        alt = alternatives[_i];
+        _ref = alt[0].split(' ');
+        for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
+          token = _ref[_j];
+          if (!grammar[token]) {
+            tokens.push(token);
+          }
+        }
+        if (name === 'Root') {
+          alt[1] = "return " + alt[1];
+        }
+        _results.push(alt);
+      }
+      return _results;
+    })();
+  }
+
+  exports.parser = new Parser({
+    tokens: tokens.join(' '),
+    bnf: grammar,
+    operators: operators.reverse(),
+    startSymbol: 'Root'
+  });
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js
new file mode 100644
index 0000000..c396f64
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js
@@ -0,0 +1,236 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var buildLocationData, extend, flatten, last, repeat, _ref;
+
+  exports.starts = function(string, literal, start) {
+    return literal === string.substr(start, literal.length);
+  };
+
+  exports.ends = function(string, literal, back) {
+    var len;
+
+    len = literal.length;
+    return literal === string.substr(string.length - len - (back || 0), len);
+  };
+
+  exports.repeat = repeat = function(str, n) {
+    var res;
+
+    res = '';
+    while (n > 0) {
+      if (n & 1) {
+        res += str;
+      }
+      n >>>= 1;
+      str += str;
+    }
+    return res;
+  };
+
+  exports.compact = function(array) {
+    var item, _i, _len, _results;
+
+    _results = [];
+    for (_i = 0, _len = array.length; _i < _len; _i++) {
+      item = array[_i];
+      if (item) {
+        _results.push(item);
+      }
+    }
+    return _results;
+  };
+
+  exports.count = function(string, substr) {
+    var num, pos;
+
+    num = pos = 0;
+    if (!substr.length) {
+      return 1 / 0;
+    }
+    while (pos = 1 + string.indexOf(substr, pos)) {
+      num++;
+    }
+    return num;
+  };
+
+  exports.merge = function(options, overrides) {
+    return extend(extend({}, options), overrides);
+  };
+
+  extend = exports.extend = function(object, properties) {
+    var key, val;
+
+    for (key in properties) {
+      val = properties[key];
+      object[key] = val;
+    }
+    return object;
+  };
+
+  exports.flatten = flatten = function(array) {
+    var element, flattened, _i, _len;
+
+    flattened = [];
+    for (_i = 0, _len = array.length; _i < _len; _i++) {
+      element = array[_i];
+      if (element instanceof Array) {
+        flattened = flattened.concat(flatten(element));
+      } else {
+        flattened.push(element);
+      }
+    }
+    return flattened;
+  };
+
+  exports.del = function(obj, key) {
+    var val;
+
+    val = obj[key];
+    delete obj[key];
+    return val;
+  };
+
+  exports.last = last = function(array, back) {
+    return array[array.length - (back || 0) - 1];
+  };
+
+  exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) {
+    var e, _i, _len;
+
+    for (_i = 0, _len = this.length; _i < _len; _i++) {
+      e = this[_i];
+      if (fn(e)) {
+        return true;
+      }
+    }
+    return false;
+  };
+
+  exports.invertLiterate = function(code) {
+    var line, lines, maybe_code;
+
+    maybe_code = true;
+    lines = (function() {
+      var _i, _len, _ref1, _results;
+
+      _ref1 = code.split('\n');
+      _results = [];
+      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+        line = _ref1[_i];
+        if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) {
+          _results.push(line);
+        } else if (maybe_code = /^\s*$/.test(line)) {
+          _results.push(line);
+        } else {
+          _results.push('# ' + line);
+        }
+      }
+      return _results;
+    })();
+    return lines.join('\n');
+  };
+
+  buildLocationData = function(first, last) {
+    if (!last) {
+      return first;
+    } else {
+      return {
+        first_line: first.first_line,
+        first_column: first.first_column,
+        last_line: last.last_line,
+        last_column: last.last_column
+      };
+    }
+  };
+
+  exports.addLocationDataFn = function(first, last) {
+    return function(obj) {
+      if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) {
+        obj.updateLocationDataIfMissing(buildLocationData(first, last));
+      }
+      return obj;
+    };
+  };
+
+  exports.locationDataToString = function(obj) {
+    var locationData;
+
+    if (("2" in obj) && ("first_line" in obj[2])) {
+      locationData = obj[2];
+    } else if ("first_line" in obj) {
+      locationData = obj;
+    }
+    if (locationData) {
+      return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1));
+    } else {
+      return "No location data";
+    }
+  };
+
+  exports.baseFileName = function(file, stripExt, pathSep) {
+    var parts;
+
+    if (stripExt == null) {
+      stripExt = false;
+    }
+    if (pathSep == null) {
+      pathSep = '/';
+    }
+    parts = file.split(pathSep);
+    file = parts[parts.length - 1];
+    if (!stripExt) {
+      return file;
+    }
+    parts = file.split('.');
+    parts.pop();
+    if (parts[parts.length - 1] === 'coffee' && parts.length > 1) {
+      parts.pop();
+    }
+    return parts.join('.');
+  };
+
+  exports.isCoffee = function(file) {
+    return /\.((lit)?coffee|coffee\.md)$/.test(file);
+  };
+
+  exports.isLiterate = function(file) {
+    return /\.(litcoffee|coffee\.md)$/.test(file);
+  };
+
+  exports.throwSyntaxError = function(message, location) {
+    var error, _ref1, _ref2;
+
+    if ((_ref1 = location.last_line) == null) {
+      location.last_line = location.first_line;
+    }
+    if ((_ref2 = location.last_column) == null) {
+      location.last_column = location.first_column;
+    }
+    error = new SyntaxError(message);
+    error.location = location;
+    throw error;
+  };
+
+  exports.prettyErrorMessage = function(error, fileName, code, useColors) {
+    var codeLine, colorize, end, first_column, first_line, last_column, last_line, marker, message, start, _ref1;
+
+    if (!error.location) {
+      return error.stack || ("" + error);
+    }
+    _ref1 = error.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column;
+    codeLine = code.split('\n')[first_line];
+    start = first_column;
+    end = first_line === last_line ? last_column + 1 : codeLine.length;
+    marker = repeat(' ', start) + repeat('^', end - start);
+    if (useColors) {
+      colorize = function(str) {
+        return "\x1B[1;31m" + str + "\x1B[0m";
+      };
+      codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end);
+      marker = colorize(marker);
+    }
+    message = "" + fileName + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + error.message + "\n" + codeLine + "\n" + marker;
+    return message;
+  };
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js
new file mode 100644
index 0000000..ced6dac
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js
@@ -0,0 +1,11 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var key, val, _ref;
+
+  _ref = require('./coffee-script');
+  for (key in _ref) {
+    val = _ref[key];
+    exports[key] = val;
+  }
+
+}).call(this);


[38/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaCapture.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaCapture.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaCapture.java
new file mode 100644
index 0000000..76b0eac
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaCapture.java
@@ -0,0 +1,502 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.microedition.media.Manager;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.file.File;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+import org.apache.cordova.util.StringUtils;
+
+/**
+ * This plugin provides the ability to capture media from the native media
+ * applications. The appropriate media application is launched, and a capture
+ * operation is started in the background to identify captured media files and
+ * return the file info back to the caller.
+ */
+public class MediaCapture extends Plugin {
+
+    public static String PROTOCOL_CAPTURE = "capture";
+
+    private static final String LOG_TAG = "MediaCapture: ";
+
+    /**
+     * Error codes.
+     */
+    // Camera or microphone failed to capture image or sound.
+    private static final int CAPTURE_INTERNAL_ERR = 0;
+    // Camera application or audio capture application is currently serving other capture request.
+    private static final int CAPTURE_APPLICATION_BUSY = 1;
+    // Invalid use of the API (e.g. limit parameter has value less than one).
+    private static final int CAPTURE_INVALID_ARGUMENT = 2;
+    // User exited camera application or audio capture application before capturing anything.
+    private static final int CAPTURE_NO_MEDIA_FILES = 3;
+    // The requested capture operation is not supported.
+    private static final int CAPTURE_NOT_SUPPORTED = 20;
+
+    /**
+     * Possible actions.
+     */
+    protected static final String ACTION_GET_SUPPORTED_MODES = "captureModes";
+    protected static final String ACTION_CAPTURE_AUDIO = "captureAudio";
+    protected static final String ACTION_CAPTURE_IMAGE = "captureImage";
+    protected static final String ACTION_CAPTURE_VIDEO = "captureVideo";
+    protected static final String ACTION_CANCEL_CAPTURES = "stopCaptures";
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action
+     *            The action to execute.
+     * @param callbackId
+     *            The callback ID to be invoked upon action completion
+     * @param args
+     *            JSONArry of arguments for the action.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+        PluginResult result = null;
+
+        if (ACTION_GET_SUPPORTED_MODES.equals(action)) {
+            result = getCaptureModes();
+        } else if (ACTION_CAPTURE_AUDIO.equals(action)) {
+            result = captureAudio(args, callbackId);
+        } else if (ACTION_CAPTURE_IMAGE.equals(action)) {
+            result = captureImage(args, callbackId);
+        } else if (ACTION_CAPTURE_VIDEO.equals(action)) {
+            result = captureVideo(args, callbackId);
+        } else if (ACTION_CANCEL_CAPTURES.equals(action)) {
+            CaptureControl.getCaptureControl().stopPendingOperations(true);
+            result =  new PluginResult(PluginResult.Status.OK);
+        } else {
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION,
+                "MediaCapture: invalid action " + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Determines if audio capture is supported.
+     * @return <code>true</code> if audio capture is supported
+     */
+    protected boolean isAudioCaptureSupported() {
+        return (System.getProperty("supports.audio.capture").equals(Boolean.TRUE.toString())
+                && AudioControl.hasAudioRecorderApplication());
+    }
+
+    /**
+     * Determines if video capture is supported.
+     * @return <code>true</code> if video capture is supported
+     */
+    protected boolean isVideoCaptureSupported() {
+        return (System.getProperty("supports.video.capture").equals(Boolean.TRUE.toString()));
+    }
+
+    /**
+     * Return the supported capture modes for audio, image and video.
+     * @return supported capture modes.
+     */
+    private PluginResult getCaptureModes() {
+        JSONArray audioModes = new JSONArray();
+        JSONArray imageModes = new JSONArray();
+        boolean audioSupported = isAudioCaptureSupported();
+
+        // need to get the recording dimensions from supported image encodings
+        String imageEncodings = System.getProperty("video.snapshot.encodings");
+        Logger.log(this.getClass().getName() + ": video.snapshot.encodings="
+                + imageEncodings);
+        String[] encodings = StringUtils.split(imageEncodings, "encoding=");
+        CaptureMode mode = null;
+        Vector list = new Vector();
+
+        // get all supported capture content types for audio and image
+        String[] contentTypes = getCaptureContentTypes();
+        for (int i = 0; i < contentTypes.length; i++) {
+            if (audioSupported
+                    && contentTypes[i]
+                            .startsWith(AudioCaptureOperation.CONTENT_TYPE)) {
+                audioModes.add(new CaptureMode(contentTypes[i]).toJSONObject());
+            } else if (contentTypes[i]
+                    .startsWith(ImageCaptureOperation.CONTENT_TYPE)) {
+                String type = contentTypes[i]
+                        .substring(ImageCaptureOperation.CONTENT_TYPE.length());
+                for (int j = 0; j < encodings.length; j++) {
+                    // format: "jpeg&width=2592&height=1944 "
+                    String enc = encodings[j];
+                    if (enc.startsWith(type)) {
+                        Hashtable parms = parseEncodingString(enc);
+                        // "width="
+                        String w = (String)parms.get("width");
+                        long width = (w == null) ? 0 : Long.parseLong(w);
+                        // "height="
+                        String h = (String)parms.get("height");
+                        long height = (h == null) ? 0 : Long.parseLong(h);
+                        // new capture mode
+                        mode = new CaptureMode(contentTypes[i], width, height);
+                        // don't want duplicates
+                        if (!list.contains(mode)) {
+                            list.addElement(mode);
+                            imageModes.add(mode.toJSONObject());
+                        }
+                    }
+                }
+            }
+        }
+
+        JSONObject captureModes = new JSONObject();
+        try {
+            captureModes.put("supportedAudioModes", audioModes.toString());
+            captureModes.put("supportedImageModes", imageModes.toString());
+            captureModes.put("supportedVideoModes", getVideoCaptureModes().toString());
+        } catch (JSONException e) {
+            Logger.error("JSONException: " + e.getMessage());
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                    "Failed to build supported capture modes.");
+        }
+
+        return new PluginResult(PluginResult.Status.OK, captureModes);
+    }
+
+    /**
+     * Retrieves supported video capture modes (content type, width and height).
+     * @return supported video capture modes
+     */
+    protected JSONArray getVideoCaptureModes() {
+        JSONArray videoModes = new JSONArray();
+
+        if (!isVideoCaptureSupported()) {
+            // if the device does not support video capture, return an empty
+            // array of capture modes
+            Logger.log(this.getClass().getName() + ": video capture not supported");
+            return videoModes;
+        }
+
+        /**
+         * DOH! Even if video capture is supported, BlackBerry's API
+         * does not provide any 'video/' content types for the 'capture'
+         * protocol.  So if we looked at only capture content types,
+         * it wouldn't return any results...
+         *
+         * // get all supported capture content types
+         * String[] contentTypes = getCaptureContentTypes();
+         *
+         * A better alternative, and probably not too inaccurate, would be to
+         * send back all supported video modes (not just capture).  This will
+         * at least give the developer an idea of the capabilities.
+         */
+
+        // retrieve ALL supported video encodings
+        String videoEncodings = System.getProperty("video.encodings");
+        Logger.log(this.getClass().getName() + ": video.encodings=" + videoEncodings);
+        String[] encodings = StringUtils.split(videoEncodings, "encoding=");
+
+        // parse them into CaptureModes
+        String enc = null;
+        CaptureMode mode = null;
+        Vector list = new Vector();
+        for (int i = 0; i < encodings.length; i++) {
+            enc = encodings[i];
+            // format: "video/3gpp&width=640&height=480&video_codec=MPEG-4&audio_codec=AAC "
+            if (enc.startsWith(VideoCaptureOperation.CONTENT_TYPE)) {
+                Hashtable parms = parseEncodingString(enc);
+                // type "video/3gpp"
+                String t = (String)parms.get("type");
+                // "width="
+                String w = (String)parms.get("width");
+                long width = (w == null) ? 0 : Long.parseLong(w);
+                // "height="
+                String h = (String)parms.get("height");
+                long height = (h == null) ? 0 : Long.parseLong(h);
+                // new capture mode
+                mode = new CaptureMode(t, width, height);
+                // don't want duplicates
+                if (!list.contains(mode)) {
+                    list.addElement(mode);
+                    videoModes.add(mode.toJSONObject());
+                }
+            }
+        }
+
+        return videoModes;
+    }
+
+    /**
+     * Utility method to parse encoding strings.
+     *
+     * @param encodingString
+     *            encoding string
+     * @return Hashtable containing key:value pairs
+     */
+    protected Hashtable parseEncodingString(final String encodingString) {
+        // format: "video/3gpp&width=640&height=480&video_codec=MPEG-4&audio_codec=AAC "
+        Hashtable props = new Hashtable();
+        String[] parms = StringUtils.split(encodingString, "&");
+        props.put("type", parms[0]);
+        for (int i = 0; i < parms.length; i++) {
+            String parameter = parms[i];
+            if (parameter.indexOf('=') != -1) {
+                String[] pair = StringUtils.split(parameter, "=");
+                props.put(pair[0].trim(), pair[1].trim());
+            }
+        }
+        return props;
+    }
+
+    /**
+     * Returns the content types supported for the <code>capture://</code>
+     * protocol.
+     *
+     * @return list of supported capture content types
+     */
+    protected static String[] getCaptureContentTypes() {
+        // retrieve list of all content types supported for capture protocol
+        return Manager.getSupportedContentTypes(PROTOCOL_CAPTURE);
+    }
+
+    /**
+     * Starts an audio capture operation using the native voice notes recorder
+     * application. If the native voice notes recorder application is already
+     * running, the <code>CAPTURE_APPLICATION_BUSY</code> error is returned.
+     *
+     * @param args
+     *            capture options (e.g., limit)
+     * @param callbackId
+     *            the callback to be invoked with the capture results
+     * @return PluginResult containing captured media file properties
+     */
+    protected PluginResult captureAudio(final JSONArray args, final String callbackId) {
+        PluginResult result = null;
+
+        // if audio is not being recorded, start audio capture
+        if (!AudioControl.hasAudioRecorderApplication()) {
+            result = errorResult(CAPTURE_NOT_SUPPORTED,
+                    "Audio recorder application is not installed.");
+        } else if (AudioControl.isAudioRecorderActive()) {
+            result = errorResult(CAPTURE_APPLICATION_BUSY,
+                    "Audio recorder application is busy.");
+        }
+        else {
+            // optional parameters
+            long limit = 1;
+            double duration = 0.0f;
+
+            try {
+                JSONObject options = args.getJSONObject(0);
+                if (options != null) {
+                    limit = options.optLong("limit", 1);
+                    duration = options.optDouble("duration", 0.0f);
+                }
+            } catch (JSONException e) {
+                // Eat it and use default value of 1.
+                Logger.log(this.getClass().getName()
+                        + ": Invalid captureAudio options format. " + e.getMessage());
+            }
+
+            // start audio capture
+            // start capture operation in the background
+            CaptureControl.getCaptureControl().startAudioCaptureOperation(
+                    limit, duration, callbackId);
+
+            // return NO_RESULT and allow callbacks to be invoked later
+            result = new PluginResult(PluginResult.Status.NO_RESULT);
+            result.setKeepCallback(true);
+        }
+
+        return result;
+    }
+
+    /**
+     * Starts an image capture operation using the native camera application. If
+     * the native camera application is already running, the
+     * <code>CAPTURE_APPLICATION_BUSY</code> error is returned.
+     *
+     * @param args
+     *            capture options (e.g., limit)
+     * @param callbackId
+     *            the callback to be invoked with the capture results
+     * @return PluginResult containing captured media file properties
+     */
+    protected PluginResult captureImage(final JSONArray args,
+            final String callbackId) {
+        PluginResult result = null;
+
+        if (CameraControl.isCameraActive()) {
+            result = errorResult(CAPTURE_APPLICATION_BUSY,
+                    "Camera application is busy.");
+        }
+        else {
+            // optional parameters
+            long limit = 1;
+
+            try {
+                JSONObject options = args.getJSONObject(0);
+                if (options != null) {
+                    limit = options.optLong("limit", 1);
+                }
+            } catch (JSONException e) {
+                // Eat it and use default value of 1.
+                Logger.log(this.getClass().getName()
+                        + ": Invalid captureImage options format. " + e.getMessage());
+            }
+
+            // start capture operation in the background
+            CaptureControl.getCaptureControl().startImageCaptureOperation(
+                    limit, callbackId);
+
+            // return NO_RESULT and allow callbacks to be invoked later
+            result = new PluginResult(PluginResult.Status.NO_RESULT);
+            result.setKeepCallback(true);
+        }
+
+        return result;
+    }
+
+    /**
+     * Starts an video capture operation using the native video recorder
+     * application. If the native video recorder application is already running,
+     * the <code>CAPTURE_APPLICATION_BUSY</code> error is returned.
+     *
+     * @param args
+     *            capture options (e.g., limit)
+     * @param callbackId
+     *            the callback to be invoked with the capture results
+     * @return PluginResult containing captured media file properties
+     */
+    protected PluginResult captureVideo(final JSONArray args,
+            final String callbackId) {
+        PluginResult result = null;
+
+        if (!isVideoCaptureSupported()) {
+            result = errorResult(CAPTURE_NOT_SUPPORTED,
+                    "Video capture is not supported.");
+        } else if (CameraControl.isVideoRecorderActive()) {
+            result = errorResult(CAPTURE_APPLICATION_BUSY,
+                    "Video recorder application is busy.");
+        }
+        else {
+            // optional parameters
+            long limit = 1;
+
+            try {
+                JSONObject options = args.getJSONObject(0);
+                if (options != null) {
+                    limit = options.optLong("limit", 1);
+                }
+            } catch (JSONException e) {
+                // Eat it and use default value of 1.
+                Logger.log(this.getClass().getName()
+                        + ": Invalid captureVideo options format. " + e.getMessage());
+            }
+
+            // start capture operation in the background
+            CaptureControl.getCaptureControl().startVideoCaptureOperation(
+                    limit, callbackId);
+
+            // return NO_RESULT and allow callbacks to be invoked later
+            result = new PluginResult(PluginResult.Status.NO_RESULT);
+            result.setKeepCallback(true);
+        }
+
+        return result;
+    }
+
+    /**
+     * Sends media capture result back to JavaScript.
+     *
+     * @param mediaFiles
+     *            list of File objects describing captured media files
+     * @param callbackId
+     *            the callback to receive the file descriptions
+     */
+    public static void captureSuccess(Vector mediaFiles, String callbackId) {
+        PluginResult result = null;
+        File file = null;
+
+        JSONArray array = new JSONArray();
+        for (Enumeration e = mediaFiles.elements(); e.hasMoreElements();) {
+            file = (File) e.nextElement();
+            array.add(file.toJSONObject());
+        }
+
+        // invoke the appropriate callback
+        result = new PluginResult(PluginResult.Status.OK, array);
+        success(result, callbackId);
+    }
+
+    /**
+     * Sends error back to JavaScript.
+     *
+     * @param callbackId
+     *            the callback to receive the error
+     */
+    public static void captureError(String callbackId) {
+        error(errorResult(CAPTURE_NO_MEDIA_FILES, ""), callbackId);
+    }
+
+    /**
+     * Called when application is resumed.
+     */
+    public void onResume() {
+        // We launch the native media applications for capture operations, which
+        // puts this application in the background.  This application will come
+        // to the foreground when the user closes the native media application.
+        // So we close any running capture operations any time we resume.
+        //
+        // It would be nice if we could catch the EVT_APP_FOREGROUND event that
+        // is supposed to be triggered when the application comes to the
+        // foreground, but have not seen a way to do that on the Java side.
+        // Unfortunately, we have to get notification from the JavaScript side,
+        // which does get the event.  (Argh! Only BlackBerry.)
+        //
+        // In this case, we're just stopping the capture operations, not
+        // canceling them.
+        CaptureControl.getCaptureControl().stopPendingOperations(false);
+    }
+
+    /**
+     * Invoked when this application terminates.
+     */
+    public void onDestroy() {
+        CaptureControl.getCaptureControl().stopPendingOperations(true);
+    }
+
+    private static PluginResult errorResult(int code, String message) {
+        Logger.log(LOG_TAG + message);
+
+        JSONObject obj = new JSONObject();
+        try {
+            obj.put("code", code);
+            obj.put("message", message);
+        } catch (JSONException e) {
+            // This will never happen
+        }
+
+        return new PluginResult(PluginResult.Status.ERROR, obj);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaQueue.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaQueue.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaQueue.java
new file mode 100644
index 0000000..56ffff5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/MediaQueue.java
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import java.util.Vector;
+
+/**
+ * Acts as a container for captured media files.  The media applications will
+ * add to the queue when a media file is captured.
+ */
+class MediaQueue {
+    private Vector queue = new Vector();
+
+    synchronized void add(final String filePath) {
+        queue.addElement(filePath);
+        notifyAll();
+    }
+
+    synchronized String remove() throws InterruptedException {
+        while (queue.size() == 0) {
+            wait();
+        }
+        String filePath = (String) queue.firstElement();
+        queue.removeElement(filePath);
+        notifyAll();
+        return filePath;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureListener.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureListener.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureListener.java
new file mode 100644
index 0000000..361b7ee
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureListener.java
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import net.rim.device.api.io.file.FileSystemJournal;
+import net.rim.device.api.io.file.FileSystemJournalEntry;
+import net.rim.device.api.io.file.FileSystemJournalListener;
+
+/**
+ * Listens for video recording files that are added to file system.
+ * <p>
+ * Video recordings are added to the file system in a multi-step process. The
+ * video recorder application records the video on a background thread. While
+ * the recording is in progress, it is added to the file system with a '.lock'
+ * extension. When the user stops the recording, the file is renamed to the
+ * video recorder extension (e.g. .3GP). Therefore, we listen for the
+ * <code>FileSystemJournalEntry.FILE_RENAMED</code> event, capturing when the
+ * new path name ends in the video recording file extension.
+ * <p>
+ * The file system notifications will arrive on the application event thread.
+ * When it receives a notification, it adds the image file path to a MediaQueue
+ * so that the capture thread can process the file.
+ */
+class VideoCaptureListener implements FileSystemJournalListener {
+
+    /**
+     * Used to track file system changes.
+     */
+    private long lastUSN = 0;
+
+    /**
+     * Queue to send media files to for processing.
+     */
+    private MediaQueue queue = null;
+
+    /**
+     * Newly added video recording.
+     */
+    private String newFilePath = null;
+
+    /**
+     * Constructor.
+     */
+    VideoCaptureListener(MediaQueue queue) {
+        this.queue = queue;
+    }
+
+    public void fileJournalChanged() {
+        // next sequence number file system will use
+        long USN = FileSystemJournal.getNextUSN();
+
+        for (long i = USN - 1; i >= lastUSN && i < USN; --i)
+        {
+            FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);
+            if (entry == null)
+            {
+                break;
+            }
+
+            String path = entry.getPath();
+            if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED
+                    && newFilePath == null) {
+                // a new file has been added to the file system
+                // if it has a video recording extension, store it until
+                // it is renamed, indicating it has finished being written to
+                int index = path.indexOf(".3GP");
+                if (index == -1) {
+                    index = path.indexOf(".MP4");
+                }
+                if (index != -1) {
+                    newFilePath = path.substring(0, index + 4);
+                }
+            }
+            else if (entry.getEvent() == FileSystemJournalEntry.FILE_RENAMED) {
+                if (path != null && path.equals(newFilePath))
+                {
+                    // add file path to the capture queue
+                    queue.add("file://" + path);
+
+                    // get ready for next file
+                    newFilePath = null;
+                    break;
+                }
+            }
+        }
+
+        // remember the file journal change number,
+        // so we don't search the same events again and again
+        lastUSN = USN;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureOperation.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureOperation.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureOperation.java
new file mode 100644
index 0000000..589bc68
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/VideoCaptureOperation.java
@@ -0,0 +1,124 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import java.io.IOException;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+
+import org.apache.cordova.file.File;
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.io.MIMETypeAssociations;
+import net.rim.device.api.ui.UiApplication;
+
+public class VideoCaptureOperation extends CaptureOperation {
+
+    // content type
+    public static String CONTENT_TYPE = "video/";
+
+    // file system listener
+    private VideoCaptureListener listener = null;
+
+    /**
+     * Creates and starts an image capture operation.
+     *
+     * @param limit
+     *            maximum number of media files to capture
+     * @param callbackId
+     *            the callback to receive the files
+     * @param queue
+     *            the queue from which to retrieve captured media files
+     */
+    public VideoCaptureOperation(long limit, String callbackId, MediaQueue queue) {
+        super(limit, callbackId, queue);
+
+        // listener to capture image files added to file system
+        this.listener = new VideoCaptureListener(queue);
+
+        start();
+    }
+
+    /**
+     * Registers file system listener and launches native video recorder
+     * application.
+     */
+    protected void setup() {
+        // register listener for files being written
+        synchronized(UiApplication.getEventLock()) {
+            UiApplication.getUiApplication().addFileSystemJournalListener(listener);
+        }
+
+        // launch the native video recorder application
+        CameraControl.launchVideoRecorder();
+    }
+
+    /**
+     * Unregisters file system listener and closes native video recorder
+     * application.
+     */
+    protected void teardown() {
+        // remove file system listener
+        synchronized(UiApplication.getEventLock()) {
+            UiApplication.getUiApplication().removeFileSystemJournalListener(listener);
+        }
+
+        // close the native video recorder application
+        CameraControl.closeVideoRecorder();
+    }
+
+    /**
+     * Retrieves the file properties for the captured video recording.
+     *
+     * @param filePath
+     *            full path of the video recording file
+     */
+    protected void processFile(String filePath) {
+        Logger.log(this.getClass().getName() + ": processing file: " + filePath);
+
+        File file = new File(FileUtils.stripSeparator(filePath));
+
+        // grab file properties
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection) Connector.open(filePath, Connector.READ);
+            if (fconn.exists()) {
+                long size = fconn.fileSize();
+                Logger.log(this.getClass().getName() + ": " + filePath + " size="
+                        + Long.toString(size) + " bytes");
+                file.setLastModifiedDate(fconn.lastModified());
+                file.setName(FileUtils.stripSeparator(fconn.getName()));
+                file.setSize(size);
+                file.setType(MIMETypeAssociations.getMIMEType(filePath));
+            }
+        }
+        catch (IOException e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            } catch (IOException ignored) {}
+        }
+
+        addCaptureFile(file);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/device/Device.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/device/Device.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/device/Device.java
new file mode 100644
index 0000000..7b67a8b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/device/Device.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ *
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+package org.apache.cordova.device;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+import net.rim.device.api.system.DeviceInfo;
+
+/**
+ * Provides device information, including:
+ *
+ * - Device platform version (e.g. 2.13.0.95). Not to be confused with BlackBerry OS version.
+ * - Unique device identifier (UUID).
+ * - Cordova software version.
+ */
+public final class Device extends Plugin {
+
+	public static final String FIELD_PLATFORM 	= "platform";
+	public static final String FIELD_UUID     	= "uuid";
+	public static final String FIELD_CORDOVA	= "cordova";
+	public static final String FIELD_MODEL 		= "model";
+	public static final String FIELD_NAME 		= "name";
+	public static final String FIELD_VERSION 	= "version";
+
+	public static final String ACTION_GET_DEVICE_INFO = "getDeviceInfo";
+
+	public PluginResult execute(String action, JSONArray args, String callbackId) {
+		PluginResult result = new PluginResult(PluginResult.Status.INVALID_ACTION, "Device: Invalid action:" + action);
+
+		if(action.equals(ACTION_GET_DEVICE_INFO)){
+			try {
+				JSONObject device = new JSONObject();
+				device.put( FIELD_PLATFORM, "BlackBerry");
+				device.put( FIELD_UUID, new Integer( DeviceInfo.getDeviceId()) );
+				device.put( FIELD_CORDOVA, "2.6.0rc1" );
+				device.put( FIELD_MODEL, new String(DeviceInfo.getDeviceName()) );
+				device.put( FIELD_NAME, new String(DeviceInfo.getDeviceName()) );
+				device.put( FIELD_VERSION, new String(DeviceInfo.getSoftwareVersion()) );
+				result = new PluginResult(PluginResult.Status.OK, device);
+			} catch (JSONException e) {
+				result = new PluginResult(PluginResult.Status.JSON_EXCEPTION, e.getMessage());
+			}
+		}
+
+		return result;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/Entry.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/Entry.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/Entry.java
new file mode 100644
index 0000000..66fb59b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/Entry.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.file;
+
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+public class Entry {
+
+    private boolean isDirectory = false;
+    private String name = null;
+    private String fullPath = null;
+
+    public boolean isDirectory() {
+        return isDirectory;
+    }
+
+    public void setDirectory(boolean isDirectory) {
+        this.isDirectory = isDirectory;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getFullPath() {
+        return fullPath;
+    }
+
+    public void setFullPath(String fullPath) {
+        this.fullPath = fullPath;
+    }
+
+    public JSONObject toJSONObject() {
+        JSONObject o = new JSONObject();
+        try {
+            o.put("isDirectory", isDirectory);
+            o.put("isFile", !isDirectory);
+            o.put("name", name);
+            o.put("fullPath", fullPath);
+        }
+        catch (JSONException ignored) {
+        }
+        return o;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/File.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/File.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/File.java
new file mode 100644
index 0000000..3d04041
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/File.java
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.file;
+
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+public class File {
+    private String name = null;
+    private String fullPath = null;
+    private String type = null;
+    private long lastModifiedDate;
+    private long size = 0;
+
+    public File(String filePath) {
+        this.fullPath = filePath;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public long getLastModifiedDate() {
+        return lastModifiedDate;
+    }
+
+    public void setLastModifiedDate(long lastModifiedDate) {
+        this.lastModifiedDate = lastModifiedDate;
+    }
+
+    public long getSize() {
+        return size;
+    }
+
+    public void setSize(long size) {
+        this.size = size;
+    }
+
+    public String getFullPath() {
+        return fullPath;
+    }
+
+    public JSONObject toJSONObject() {
+        JSONObject o = new JSONObject();
+        try {
+            o.put("fullPath", fullPath);
+            o.put("type", type);
+            o.put("name", name);
+            o.put("lastModifiedDate", lastModifiedDate);
+            o.put("size", size);
+        }
+        catch (JSONException ignored) {
+        }
+        return o;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/FileManager.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/FileManager.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/FileManager.java
new file mode 100644
index 0000000..55ea436
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/file/FileManager.java
@@ -0,0 +1,1051 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.file;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Enumeration;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+import javax.microedition.io.file.FileSystemRegistry;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.io.Base64OutputStream;
+import net.rim.device.api.io.FileNotFoundException;
+import net.rim.device.api.io.MIMETypeAssociations;
+import net.rim.device.api.system.Application;
+
+public class FileManager extends Plugin {
+
+    /**
+     * File related errors.
+     */
+    public static int NOT_FOUND_ERR = 1;
+    public static int SECURITY_ERR = 2;
+    public static int ABORT_ERR = 3;
+    public static int NOT_READABLE_ERR = 4;
+    public static int ENCODING_ERR = 5;
+    public static int NO_MODIFICATION_ALLOWED_ERR = 6;
+    public static int INVALID_STATE_ERR = 7;
+    public static int SYNTAX_ERR = 8;
+    public static int INVALID_MODIFICATION_ERR = 9;
+    public static int QUOTA_EXCEEDED_ERR = 10;
+    public static int TYPE_MISMATCH_ERR = 11;
+    public static int PATH_EXISTS_ERR = 12;
+
+    /**
+     * File system for storing information on a temporary basis (no guaranteed persistence).
+     */
+    public static final short FS_TEMPORARY = 0;
+
+    /**
+     * File system for storing information on a permanent basis.
+     */
+    public static final short FS_PERSISTENT = 1;
+
+    /**
+     * Possible actions.
+     */
+    protected static String ACTION_READ_AS_TEXT = "readAsText";
+    protected static String ACTION_READ_AS_DATA_URL = "readAsDataURL";
+    protected static String ACTION_WRITE = "write";
+    protected static String ACTION_TRUNCATE = "truncate";
+    protected static String ACTION_REQUEST_FILE_SYSTEM = "requestFileSystem";
+    protected static String ACTION_RESOLVE_FILE_SYSTEM_URI = "resolveLocalFileSystemURI";
+    protected static String ACTION_GET_METADATA = "getMetadata";
+    protected static String ACTION_GET_FILE_METADATA = "getFileMetadata";
+    protected static String ACTION_LIST_DIRECTORY = "readEntries";
+    protected static String ACTION_COPY_TO = "copyTo";
+    protected static String ACTION_MOVE_TO = "moveTo";
+    protected static String ACTION_IS_FILE_SYSTEM_ROOT = "isFileSystemRoot";
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action
+     *            The action to execute.
+     * @param callbackId
+     *            The callback ID to be invoked upon action completion
+     * @param args
+     *            JSONArry of arguments for the action.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+        // perform specified action
+        if (ACTION_READ_AS_TEXT.equals(action)) {
+            // get file path
+            String filePath = null;
+            try {
+                filePath = args.getString(0);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing path: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return readAsText(filePath, args.optString(1));
+        }
+        else if (ACTION_READ_AS_DATA_URL.equals(action)) {
+            // get file path
+            String filePath = null;
+            try {
+                filePath = args.getString(0);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing path: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return readAsDataURL(filePath);
+        }
+        else if (ACTION_WRITE.equals(action)) {
+            // file path
+            String filePath = null;
+            try {
+                filePath = args.getString(0);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing path: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+
+            // file data
+            String data = null;
+            try {
+                data = args.getString(1);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Unable to parse file data: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+
+            // position
+            int position = 0;
+            try {
+                position = Integer.parseInt(args.optString(2));
+            }
+            catch (NumberFormatException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid position parameter: " + e);
+                return new PluginResult(
+                        PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return writeFile(filePath, data, position);
+        }
+        else if (ACTION_TRUNCATE.equals(action)) {
+            // file path
+            String filePath = null;
+            try {
+                filePath = args.getString(0);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing path: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+
+            // file size
+            long fileSize = 0;
+            try {
+                // retrieve new file size
+                fileSize = Long.parseLong(args.getString(1));
+            }
+            catch (Exception e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid file size parameter: " + e);
+                return new PluginResult(
+                        PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return truncateFile(filePath, fileSize);
+        }
+        else if (ACTION_REQUEST_FILE_SYSTEM.equals(action)) {
+            int fileSystemType = -1;
+            long fileSystemSize = 0;
+            try {
+                fileSystemType = args.getInt(0);
+                fileSystemSize = (args.isNull(1) == true) ? 0 : args.getLong(1);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid file system type: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return requestFileSystem(fileSystemType, fileSystemSize);
+        }
+        else if (ACTION_RESOLVE_FILE_SYSTEM_URI.equals(action)) {
+            String uri = null;
+            try {
+                uri = args.getString(0);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing file URI: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return resolveFileSystemURI(uri);
+        }
+        else if (ACTION_GET_METADATA.equals(action) || ACTION_GET_FILE_METADATA.equals(action)) {
+            String path = null;
+            try {
+                path = args.getString(0);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing file URI: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return getMetadata(path, ACTION_GET_FILE_METADATA.equals(action));
+        }
+        else if (ACTION_LIST_DIRECTORY.equals(action)) {
+            String path = null;
+            try {
+                path = args.getString(0);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing path: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return listDirectory(path);
+        }
+        else if (ACTION_COPY_TO.equals(action)) {
+            String srcPath = null;
+            String parent = null;
+            String newName = null;
+            try {
+                srcPath = args.getString(0);
+                parent = args.getString(1);
+                newName = args.getString(2);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing path: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return copyTo(srcPath, parent, newName);
+        }
+        else if (ACTION_MOVE_TO.equals(action)) {
+            String srcPath = null;
+            String parent = null;
+            String newName = null;
+            try {
+                srcPath = args.getString(0);
+                parent = args.getString(1);
+                newName = args.getString(2);
+            }
+            catch (JSONException e) {
+                Logger.log(this.getClass().getName()
+                        + ": Invalid or missing path: " + e);
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                        SYNTAX_ERR);
+            }
+            return moveTo(srcPath, parent, newName);
+        }
+        else if (ACTION_IS_FILE_SYSTEM_ROOT.equals(action)) {
+            return new PluginResult(PluginResult.Status.OK,
+                    isFileSystemRoot(args.optString(0)));
+        }
+
+        // invalid action
+        return new PluginResult(PluginResult.Status.INVALID_ACTION,
+                "File: invalid action " + action);
+    }
+
+    /**
+     * Reads a file and encodes the contents using the specified encoding.
+     *
+     * @param filePath
+     *            Full path of the file to be read
+     * @param encoding
+     *            Encoding to use for the file contents
+     * @return PluginResult containing encoded file contents or error code if
+     *         unable to read or encode file
+     */
+    protected static PluginResult readAsText(String filePath, String encoding) {
+        PluginResult result = null;
+        String logMsg = ": encoding file contents using " + encoding;
+
+        // read the file
+        try {
+            // return encoded file contents
+            byte[] blob = FileUtils.readFile(filePath, Connector.READ);
+            result = new PluginResult(PluginResult.Status.OK,
+                    new String(blob, encoding));
+        }
+        catch (FileNotFoundException e) {
+            logMsg = e.toString();
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_FOUND_ERR);
+        }
+        catch (UnsupportedEncodingException e) {
+            logMsg = e.toString();
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    ENCODING_ERR);
+        }
+        catch (IOException e) {
+            logMsg = e.toString();
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_READABLE_ERR);
+        }
+        finally {
+            Logger.log(FileManager.class.getName() + ": " + logMsg);
+        }
+
+        return result;
+    }
+
+    /**
+     * Read file and return data as a base64 encoded data url. A data url is of
+     * the form: data:[<mediatype>][;base64],<data>
+     *
+     * @param filePath
+     *            Full path of the file to be read
+     * @return PluginResult containing the encoded file contents or an error
+     *         code if unable to read the file
+     */
+    protected static PluginResult readAsDataURL(String filePath) {
+        String data = null;
+        try {
+            // read file
+            byte[] blob = FileUtils.readFile(filePath, Connector.READ);
+
+            // encode file contents using BASE64 encoding
+            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+            Base64OutputStream base64OutputStream = new Base64OutputStream(
+                    byteArrayOutputStream);
+            base64OutputStream.write(blob);
+            base64OutputStream.flush();
+            base64OutputStream.close();
+            data = byteArrayOutputStream.toString();
+        }
+        catch (FileNotFoundException e) {
+            Logger.log(FileManager.class.getName() + ": " + e);
+            return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_FOUND_ERR);
+        }
+        catch (IOException e) {
+            Logger.log(FileManager.class.getName() + ": " + e);
+            return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_READABLE_ERR);
+        }
+
+        // put result in proper form
+        String mediaType = MIMETypeAssociations.getMIMEType(filePath);
+        if (mediaType == null) {
+            mediaType = "";
+        }
+        data = "data:" + mediaType + ";base64," + data;
+
+        return new PluginResult(PluginResult.Status.OK, data);
+    }
+
+    /**
+     * Writes data to the specified file.
+     *
+     * @param filePath
+     *            Full path of file to be written to
+     * @param data
+     *            Data to be written
+     * @param position
+     *            Position at which to begin writing
+     * @return PluginResult containing the number of bytes written or error code
+     *         if unable to write file
+     */
+    protected static PluginResult writeFile(String filePath, String data, int position) {
+        PluginResult result = null;
+        int bytesWritten = 0;
+        try {
+            // write file data
+            // The default String encoding on BB is ISO-8859-1 which causes
+            // issues with extended characters.  Force to UTF-8 to provide
+            // greater character support and match other platforms.
+            bytesWritten = FileUtils.writeFile(filePath, data.getBytes("UTF-8"), position);
+            result = new PluginResult(PluginResult.Status.OK, bytesWritten);
+        }
+        catch (SecurityException e) {
+            Logger.log(FileManager.class.getName() + ": " + e);
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NO_MODIFICATION_ALLOWED_ERR);
+        }
+        catch (IOException e) {
+            // it's not a security issue, so the directory path is either
+            // not fully created or a general error occurred
+            Logger.log(FileManager.class.getName() + ": " + e);
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_FOUND_ERR);
+        }
+
+        return result;
+    }
+
+    /**
+     * Changes the length of the specified file. If shortening, data beyond new
+     * length is discarded.
+     *
+     * @param fileName
+     *            The full path of the file to truncate
+     * @param size
+     *            The size to which the length of the file is to be adjusted
+     * @return PluginResult containing new file size or an error code if an
+     *         error occurred
+     */
+    protected static PluginResult truncateFile(String filePath, long size) {
+        long fileSize = 0;
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection) Connector.open(filePath,
+                    Connector.READ_WRITE);
+            if (!fconn.exists()) {
+                Logger.log(FileManager.class.getName() + ": path not found "
+                        + filePath);
+                return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                        NOT_FOUND_ERR);
+            }
+            if (size >= 0) {
+                fconn.truncate(size);
+            }
+            fileSize = fconn.fileSize();
+        }
+        catch (IOException e) {
+            Logger.log(FileManager.class.getName() + ": " + e);
+            return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NO_MODIFICATION_ALLOWED_ERR);
+        }
+        finally {
+            try {
+                if (fconn != null)
+                    fconn.close();
+            }
+            catch (IOException e) {
+                Logger.log(FileManager.class.getName() + ": " + e);
+            }
+        }
+        return new PluginResult(PluginResult.Status.OK, fileSize);
+    }
+
+    /**
+     * Returns a directory entry that represents the specified file system. The
+     * directory entry does not represent the root of the file system, but a
+     * directory within the file system that is writable. Users must provide the
+     * file system type, which can be one of FS_TEMPORARY or FS_PERSISTENT.
+     *
+     * @param type
+     *            The type of file system desired.
+     * @param size
+     *            The minimum size, in bytes, of space required
+     * @return a PluginResult containing a file system object for the specified
+     *         file system
+     */
+    protected static PluginResult requestFileSystem(int type, long size) {
+        if (!isValidFileSystemType(type)) {
+            Logger.log(FileManager.class.getName()
+                    + ": Invalid file system type: " + Integer.toString(type));
+            return new PluginResult(
+                    PluginResult.Status.JSON_EXCEPTION,
+                    SYNTAX_ERR);
+        }
+
+        PluginResult result = null;
+        String filePath = null;
+        switch (type) {
+        case FS_TEMPORARY:
+            // create application-specific temp directory
+            try {
+                filePath = FileUtils.createApplicationTempDirectory();
+            }
+            catch (IOException e) {
+                Logger.log(FileManager.class.getName() + ": " + e);
+                return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                        NO_MODIFICATION_ALLOWED_ERR);
+            }
+            break;
+        case FS_PERSISTENT:
+            // get a path to SD card (if present) or user directory (internal)
+            filePath = FileUtils.getFileSystemRoot();
+            break;
+        }
+
+        // create a file system entry from the path
+        Entry entry = null;
+        try {
+            // check the file system size
+            if (size > FileUtils.availableSize(filePath)) {
+                return new PluginResult(
+                        PluginResult.Status.IO_EXCEPTION,
+                        QUOTA_EXCEEDED_ERR);
+            }
+
+            entry = getEntryFromURI(filePath);
+        }
+        catch (Exception e) {
+            // bad path (not likely)
+            return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    ENCODING_ERR);
+        }
+
+        try {
+            JSONObject fileSystem = new JSONObject();
+            fileSystem.put("name", getFileSystemName(type));
+            fileSystem.put("root", entry.toJSONObject());
+            result = new PluginResult(PluginResult.Status.OK, fileSystem);
+        }
+        catch (JSONException e) {
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                    "File system entry JSON conversion failed.");
+        }
+
+        return result;
+    }
+
+    /**
+     * Creates a file system entry object from the specified file system URI.
+     *
+     * @param uri
+     *            the full path to the file or directory on the file system
+     * @return a PluginResult containing the file system entry
+     */
+    protected static PluginResult resolveFileSystemURI(String uri) {
+        PluginResult result = null;
+        Entry entry = null;
+        try {
+            entry = getEntryFromURI(uri);
+        }
+        catch (IllegalArgumentException e) {
+            Logger.log(e.toString());
+            return new PluginResult(
+                    PluginResult.Status.JSON_EXCEPTION,
+                    ENCODING_ERR);
+        }
+
+        if (entry == null) {
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_FOUND_ERR);
+        }
+        else {
+            result = new PluginResult(PluginResult.Status.OK,
+                    entry.toJSONObject());
+        }
+
+        return result;
+    }
+
+    /**
+     * Retrieve metadata for file or directory specified by path.
+     *
+     * @param path
+     *            full path name of the file or directory
+     * @param full
+     *            return full or partial meta data.
+     * @return PluginResult containing metadata for file system entry or an
+     *         error code if unable to retrieve metadata
+     */
+    protected static PluginResult getMetadata(String path, boolean full) {
+        PluginResult result = null;
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection)Connector.open(path);
+            if (fconn.exists()) {
+                if (full) {
+                    JSONObject metadata = new JSONObject();
+                    metadata.put("size", fconn.fileSize());
+                    metadata.put("type",
+                            MIMETypeAssociations.getMIMEType(fconn.getURL()));
+                    metadata.put("name", fconn.getName());
+                    metadata.put("fullPath", fconn.getURL());
+                    metadata.put("lastModifiedDate", fconn.lastModified());
+                    result = new PluginResult(PluginResult.Status.OK, metadata);
+                } else {
+                    result = new PluginResult(PluginResult.Status.OK,
+                            fconn.lastModified());
+                }
+            }
+            else {
+                result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                        NOT_FOUND_ERR);
+            }
+        }
+        catch (IllegalArgumentException e) {
+            // bad path
+            Logger.log(FileUtils.class.getName() + ": " + e);
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_FOUND_ERR);
+        }
+        catch (IOException e) {
+            Logger.log(FileUtils.class.getName() + ": " + e);
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_READABLE_ERR);
+        }
+        catch (JSONException e) {
+            result = new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                    "File system entry JSON conversion failed.");
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+        return result;
+    }
+
+    private static JSONObject buildEntry(String dirPath, String filePath) throws JSONException {
+        JSONObject entry = new JSONObject();
+        boolean isDir = filePath.endsWith(FileUtils.FILE_SEPARATOR);
+
+        entry.put("isFile", !isDir);
+        entry.put("isDirectory", isDir);
+        entry.put("name", isDir ? filePath.substring(0, filePath.length()-1) : filePath);
+        entry.put("fullPath", dirPath + filePath);
+
+        return entry;
+    }
+
+    /**
+     * Returns a listing of the specified directory contents. Names of both
+     * files and directories are returned.
+     *
+     * @param path
+     *            full path name of directory
+     * @return PluginResult containing list of file and directory names
+     *         corresponding to directory contents
+     */
+    protected static PluginResult listDirectory(String path) {
+        Enumeration listing = null;
+        try {
+            listing = FileUtils.listDirectory(path);
+        }
+        catch (Exception e) {
+            // bad path
+            Logger.log(FileUtils.class.getName() + ": " + e);
+            return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                    NOT_FOUND_ERR);
+        }
+
+        try {
+            // pass directory contents back as an array of JSONObjects (entries)
+            JSONArray array = new JSONArray();
+            while (listing.hasMoreElements()) {
+                array.add(buildEntry(path, (String) listing.nextElement()));
+            }
+
+            return new PluginResult(PluginResult.Status.OK, array);
+        } catch (JSONException e) {
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                    "File system entry JSON conversion failed.");
+        }
+    }
+
+    /**
+     * Copies a file or directory to a new location. If copying a directory, the
+     * entire contents of the directory are copied recursively.
+     *
+     * @param srcPath
+     *            the full path of the file or directory to be copied
+     * @param parent
+     *            the full path of the target directory to which the file or
+     *            directory should be copied
+     * @param newName
+     *            the new name of the file or directory
+     * @return PluginResult containing an Entry object representing the new
+     *         entry, or an error code if an error occurs
+     */
+    protected static PluginResult copyTo(String srcPath, String parent, String newName) {
+        try {
+            FileUtils.copy(srcPath, parent, newName);
+        }
+        catch (IllegalArgumentException e) {
+            Logger.log(FileManager.class.getName() + ": " + e.getMessage());
+            return new PluginResult(
+                    PluginResult.Status.JSON_EXCEPTION, ENCODING_ERR);
+        }
+        catch (FileNotFoundException e) {
+            Logger.log(FileManager.class.getName() + ": " + e.getMessage());
+            return new PluginResult(
+                    PluginResult.Status.IO_EXCEPTION, NOT_FOUND_ERR);
+        }
+        catch (SecurityException e) {
+            Logger.log(FileManager.class.getName() + ": " + e.getMessage());
+            return new PluginResult(
+                    PluginResult.Status.IO_EXCEPTION, SECURITY_ERR);
+        }
+        catch (IOException e) {
+            Logger.log(FileManager.class.getName() + ": " + e.getMessage());
+            return new PluginResult(
+                    PluginResult.Status.IO_EXCEPTION, INVALID_MODIFICATION_ERR);
+        }
+
+        return resolveFileSystemURI(getFullPath(parent, newName));
+    }
+
+    /**
+     * Moves a file or directory to a new location. If moving a directory, the
+     * entire contents of the directory are moved recursively.
+     * <p>
+     * It is an error to try to: move a directory inside itself; move a
+     * directory into its parent unless the name has changed; move a file to a
+     * path occupied by a directory; move a directory to a path occupied by a
+     * file; move any element to a path occupied by a directory that is not
+     * empty.
+     * </p>
+     * <p>
+     * A move of a file on top of an existing file must attempt to delete and
+     * replace that file. A move of a directory on top of an existing empty
+     * directory must attempt to delete and replace that directory.
+     * </p>
+     *
+     * @param srcPath
+     *            the full path of the file or directory to be moved
+     * @param parent
+     *            the full path of the target directory to which the file or
+     *            directory should be copied
+     * @param newName
+     *            the new name of the file or directory
+     * @return PluginResult containing an Entry object representing the new
+     *         entry, or an error code if an error occurs
+     */
+    protected static PluginResult moveTo(String srcPath, String parent, String newName) {
+
+        // check paths
+        if (parent == null || newName == null) {
+            Logger.log(FileManager.class.getName() + ": Parameter cannot be null.");
+            return new PluginResult(
+                    PluginResult.Status.IO_EXCEPTION, NOT_FOUND_ERR);
+        }
+        else if (!parent.endsWith(FileUtils.FILE_SEPARATOR)) {
+            parent += FileUtils.FILE_SEPARATOR;
+        }
+
+        // Rules:
+        // 1 - file replace existing file ==> OK
+        // 2 - directory replace existing EMPTY directory ==> OK
+        // 3 - file replace existing directory ==> NO!
+        // 4 - directory replace existing file ==> NO!
+        // 5 - ANYTHING replace non-empty directory ==> NO!
+        //
+        // The file-to-directory and directory-to-file checks are performed in
+        // the copy operation (below). In addition, we check the destination
+        // path to see if it is a directory that is not empty. Also, if the
+        // source and target paths have the same parent directory, it is far
+        // more efficient to rename the source.
+        //
+        FileConnection src = null;
+        FileConnection dst = null;
+        try {
+            src = (FileConnection)Connector.open(srcPath, Connector.READ_WRITE);
+            if (!src.exists()) {
+                Logger.log(FileManager.class.getName() + ": Path not found: " + srcPath);
+                return new PluginResult(
+                        PluginResult.Status.IO_EXCEPTION, NOT_FOUND_ERR);
+            }
+
+            if (src.isDirectory() && !srcPath.endsWith(FileUtils.FILE_SEPARATOR)) {
+                // Rename of a directory on OS 7+ is quirky in that it requires
+                // the opened file path to have a trailing slash.
+                src.close();
+                src = (FileConnection)Connector.open(srcPath + '/', Connector.READ_WRITE);
+            }
+
+            // cannot delete the destination path if it is a directory that is
+            // not empty
+            dst = (FileConnection) Connector.open(parent + newName, Connector.READ_WRITE);
+            if (dst.isDirectory() && dst.list("*", true).hasMoreElements()) {
+                return new PluginResult(
+                        PluginResult.Status.IO_EXCEPTION, INVALID_MODIFICATION_ERR);
+            }
+
+            // simply rename if source path and parent are same directory
+            String srcURL = src.getURL();
+            String srcName = src.getName();
+            String srcDir = srcURL.substring(0, srcURL.length() - srcName.length());
+            if (srcDir.equals(parent)) {
+                // rename to itself is an error
+                if (FileUtils.stripSeparator(srcName).equals(
+                        FileUtils.stripSeparator(newName))) {
+                    return new PluginResult(PluginResult.Status.IO_EXCEPTION,
+                            INVALID_MODIFICATION_ERR);
+                }
+
+                // file replace file || directory replace directory ==> OK
+                // delete the existing entry
+                if (dst.exists() &&
+                        ( (src.isDirectory() && dst.isDirectory()) ||
+                          (!src.isDirectory() && !dst.isDirectory()) )) {
+                    dst.delete();
+                }
+
+                // rename
+                src.rename(newName);
+                Entry entry = getEntryFromURI(parent + newName);
+                return new PluginResult(PluginResult.Status.OK, entry.toJSONObject());
+            }
+        }
+        catch (IllegalArgumentException e) {
+            Logger.log(FileManager.class.getName() + ": " + e);
+            return new PluginResult(
+                    PluginResult.Status.JSON_EXCEPTION,
+                    ENCODING_ERR);
+        }
+        catch (IOException e) {
+            // rename failed
+            Logger.log(FileManager.class.getName() + ": " + e);
+            return new PluginResult(
+                    PluginResult.Status.IO_EXCEPTION,
+                    INVALID_MODIFICATION_ERR);
+        }
+        finally {
+            try {
+                if (src != null) src.close();
+                if (dst != null) dst.close();
+            }
+            catch (IOException ignored) {
+            }
+        }
+
+        // There is no FileConnection API to move files and directories, so
+        // the move is a copy operation from source to destination, followed by
+        // a delete operation of the source.
+        //
+        // The following checks are made in the copy operation:
+        //   * moving a directory into itself,
+        //   * moving a file to an existing directory, and
+        //   * moving a directory to an existing file
+        //
+        // copy source to destination
+        PluginResult result = copyTo(srcPath, parent, newName);
+
+        // if copy succeeded, delete source
+        if (result.getStatus() == PluginResult.Status.OK.ordinal()) {
+            try {
+                FileUtils.delete(srcPath);
+            }
+            catch (IOException e) {
+                // FIXME: half of move failed, but deleting either source or
+                // destination to compensate seems risky
+                Logger.log(FileManager.class.getName()
+                        + ": Failed to delete source directory during move operation.");
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Creates a file system entry for the file or directory located at the
+     * specified path.
+     *
+     * @param filePath
+     *            full path name of an entry on the file system
+     * @return a file system entry corresponding to the file path, or
+     *         <code>null</code> if the path is invalid or does not exist on the
+     *         file system
+     * @throws IllegalArgumentException
+     *             is the file path is invalid
+     * @throws IOException
+     */
+    protected static Entry getEntryFromURI(String filePath)
+            throws IllegalArgumentException {
+        // check for bogus path
+        String path = (filePath == null) ? null : filePath.trim();
+        if (path == null || path.length() < 1) {
+            throw new IllegalArgumentException("Invalid URI.");
+        }
+
+        //check for query string
+        int queryIndex = filePath.indexOf('?');
+        if (queryIndex > 0) {
+            path = filePath.substring(0, queryIndex); // discard the query string
+            Logger.log(FileManager.class.getName() + ": found query string when resolving URI = " + filePath.substring(queryIndex));
+        }
+
+        // create a file system entry
+        Entry entry = null;
+        if (path.startsWith(FileUtils.LOCAL_PROTOCOL)) {
+            entry = getEntryFromLocalURI(filePath);
+        }
+        else {
+            FileConnection fconn = null;
+            try {
+                fconn = (FileConnection) Connector.open(path);
+                if (fconn.exists()) {
+                    // create a new Entry
+                    entry = new Entry();
+                    entry.setDirectory(fconn.isDirectory());
+                    entry.setName(FileUtils.stripSeparator(fconn.getName()));
+                    entry.setFullPath(FileUtils.stripSeparator(path));
+                }
+            }
+            catch (IOException e) {
+                Logger.log(FileManager.class.getName() + ": " + e.getMessage());
+            }
+            finally {
+                try {
+                    if (fconn != null) fconn.close();
+                }
+                catch (IOException ignored) {
+                }
+            }
+        }
+
+        return entry;
+    }
+
+    /**
+     * Creates a file system entry for a resource contained in the packaged
+     * application. Use this method if the specified path begins with
+     * <code>local:///</code> protocol.
+     *
+     * @param localPath
+     *            the path of the application resource
+     * @return a file system entry corresponding to the local path, or
+     *         <code>null</code> if a resource does not exist at the specified
+     *         path
+     */
+    private static Entry getEntryFromLocalURI(String localPath) {
+        // Remove local:// from filePath but leave a leading /
+        String path = localPath.substring(8);
+        Entry entry = null;
+        if (FileUtils.FILE_SEPARATOR.equals(path)
+                || Application.class.getResourceAsStream(path) != null) {
+            entry = new Entry();
+            entry.setName(path.substring(1));
+            entry.setFullPath(localPath);
+        }
+        return entry;
+    }
+
+    /**
+     * Tests whether the specified file system type is valid.
+     *
+     * @param type
+     *            file system type
+     * @return true if file system type is valid
+     */
+    protected static boolean isValidFileSystemType(int type) {
+        return (type == FS_TEMPORARY || type == FS_PERSISTENT);
+    }
+
+    /**
+     * Determines if the specified path is the root path of a file system.
+     *
+     * @param path
+     *            full path
+     * @return true if the path is the root path of a file system
+     */
+    protected static boolean isFileSystemRoot(String path) {
+        if (path == null) {
+            return false;
+        }
+
+        if (!path.endsWith(FileUtils.FILE_SEPARATOR)) {
+            path += FileUtils.FILE_SEPARATOR;
+        }
+
+        boolean isRoot = false;
+        Enumeration e = FileSystemRegistry.listRoots();
+        while (e.hasMoreElements()) {
+            String root = "file:///" + (String) e.nextElement();
+            if (root.equals(path)) {
+                isRoot = true;
+                break;
+            }
+        }
+
+        return (isRoot || path.equals(FileUtils.getApplicationTempDirPath()));
+    }
+
+    /**
+     * Retrieves the name for the specified file system type.
+     *
+     * @param type
+     *            file system type
+     * @return file system name
+     */
+    protected static String getFileSystemName(int type) {
+        String name = null;
+        switch (type) {
+        case FS_TEMPORARY:
+            name = "temporary";
+            break;
+        case FS_PERSISTENT:
+            name = "persistent";
+            break;
+        }
+        return name;
+    }
+
+    /**
+     * Returns full path from the directory and name specified.
+     *
+     * @param parent
+     *            full path of the parent directory
+     * @param name
+     *            name of the directory entry (can be <code>null</code>)
+     * @return full path of the file system entry
+     * @throws IllegalArgumentException
+     *             if <code>parent</code> is <code>null</code>
+     */
+    public static String getFullPath(String parent, String name)
+            throws IllegalArgumentException {
+        if (parent == null) {
+            throw new IllegalArgumentException("Directory cannot be null.");
+        }
+
+        if (!parent.endsWith(FileUtils.FILE_SEPARATOR)) {
+            parent += FileUtils.FILE_SEPARATOR;
+        }
+        return (name == null) ? parent : parent + name;
+    }
+
+    /**
+     * Determines if the specified action should be run synchronously.
+     *
+     * @param action
+     *            the action to perform
+     * @return true if the action should be synchronous
+     */
+    public boolean isSynch(String action) {
+        if (ACTION_IS_FILE_SYSTEM_ROOT.equals(action)) {
+            return true;
+        }
+        return super.isSynch(action);
+    }
+}


[09/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/basic.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/basic.js
new file mode 100644
index 0000000..70f3f8b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/basic.js
@@ -0,0 +1,329 @@
+var test = require("tap").test
+  , LRU = require("../")
+
+test("basic", function (t) {
+  var cache = new LRU({max: 10})
+  cache.set("key", "value")
+  t.equal(cache.get("key"), "value")
+  t.equal(cache.get("nada"), undefined)
+  t.equal(cache.length, 1)
+  t.equal(cache.max, 10)
+  t.end()
+})
+
+test("least recently set", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  cache.set("c", "C")
+  t.equal(cache.get("c"), "C")
+  t.equal(cache.get("b"), "B")
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})
+
+test("lru recently gotten", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  cache.get("a")
+  cache.set("c", "C")
+  t.equal(cache.get("c"), "C")
+  t.equal(cache.get("b"), undefined)
+  t.equal(cache.get("a"), "A")
+  t.end()
+})
+
+test("del", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.del("a")
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})
+
+test("max", function (t) {
+  var cache = new LRU(3)
+
+  // test changing the max, verify that the LRU items get dropped.
+  cache.max = 100
+  for (var i = 0; i < 100; i ++) cache.set(i, i)
+  t.equal(cache.length, 100)
+  for (var i = 0; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+  cache.max = 3
+  t.equal(cache.length, 3)
+  for (var i = 0; i < 97; i ++) {
+    t.equal(cache.get(i), undefined)
+  }
+  for (var i = 98; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+
+  // now remove the max restriction, and try again.
+  cache.max = "hello"
+  for (var i = 0; i < 100; i ++) cache.set(i, i)
+  t.equal(cache.length, 100)
+  for (var i = 0; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+  // should trigger an immediate resize
+  cache.max = 3
+  t.equal(cache.length, 3)
+  for (var i = 0; i < 97; i ++) {
+    t.equal(cache.get(i), undefined)
+  }
+  for (var i = 98; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+  t.end()
+})
+
+test("reset", function (t) {
+  var cache = new LRU(10)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  cache.reset()
+  t.equal(cache.length, 0)
+  t.equal(cache.max, 10)
+  t.equal(cache.get("a"), undefined)
+  t.equal(cache.get("b"), undefined)
+  t.end()
+})
+
+
+// Note: `<cache>.dump()` is a debugging tool only. No guarantees are made
+// about the format/layout of the response.
+test("dump", function (t) {
+  var cache = new LRU(10)
+  var d = cache.dump();
+  t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache")
+  cache.set("a", "A")
+  var d = cache.dump()  // { a: { key: "a", value: "A", lu: 0 } }
+  t.ok(d.a)
+  t.equal(d.a.key, "a")
+  t.equal(d.a.value, "A")
+  t.equal(d.a.lu, 0)
+
+  cache.set("b", "B")
+  cache.get("b")
+  d = cache.dump()
+  t.ok(d.b)
+  t.equal(d.b.key, "b")
+  t.equal(d.b.value, "B")
+  t.equal(d.b.lu, 2)
+
+  t.end()
+})
+
+
+test("basic with weighed length", function (t) {
+  var cache = new LRU({
+    max: 100,
+    length: function (item) { return item.size }
+  })
+  cache.set("key", {val: "value", size: 50})
+  t.equal(cache.get("key").val, "value")
+  t.equal(cache.get("nada"), undefined)
+  t.equal(cache.lengthCalculator(cache.get("key")), 50)
+  t.equal(cache.length, 50)
+  t.equal(cache.max, 100)
+  t.end()
+})
+
+
+test("weighed length item too large", function (t) {
+  var cache = new LRU({
+    max: 10,
+    length: function (item) { return item.size }
+  })
+  t.equal(cache.max, 10)
+
+  // should fall out immediately
+  cache.set("key", {val: "value", size: 50})
+
+  t.equal(cache.length, 0)
+  t.equal(cache.get("key"), undefined)
+  t.end()
+})
+
+test("least recently set with weighed length", function (t) {
+  var cache = new LRU({
+    max:8,
+    length: function (item) { return item.length }
+  })
+  cache.set("a", "A")
+  cache.set("b", "BB")
+  cache.set("c", "CCC")
+  cache.set("d", "DDDD")
+  t.equal(cache.get("d"), "DDDD")
+  t.equal(cache.get("c"), "CCC")
+  t.equal(cache.get("b"), undefined)
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})
+
+test("lru recently gotten with weighed length", function (t) {
+  var cache = new LRU({
+    max: 8,
+    length: function (item) { return item.length }
+  })
+  cache.set("a", "A")
+  cache.set("b", "BB")
+  cache.set("c", "CCC")
+  cache.get("a")
+  cache.get("b")
+  cache.set("d", "DDDD")
+  t.equal(cache.get("c"), undefined)
+  t.equal(cache.get("d"), "DDDD")
+  t.equal(cache.get("b"), "BB")
+  t.equal(cache.get("a"), "A")
+  t.end()
+})
+
+test("set returns proper booleans", function(t) {
+  var cache = new LRU({
+    max: 5,
+    length: function (item) { return item.length }
+  })
+
+  t.equal(cache.set("a", "A"), true)
+
+  // should return false for max exceeded
+  t.equal(cache.set("b", "donuts"), false)
+
+  t.equal(cache.set("b", "B"), true)
+  t.equal(cache.set("c", "CCCC"), true)
+  t.end()
+})
+
+test("drop the old items", function(t) {
+  var cache = new LRU({
+    max: 5,
+    maxAge: 50
+  })
+
+  cache.set("a", "A")
+
+  setTimeout(function () {
+    cache.set("b", "b")
+    t.equal(cache.get("a"), "A")
+  }, 25)
+
+  setTimeout(function () {
+    cache.set("c", "C")
+    // timed out
+    t.notOk(cache.get("a"))
+  }, 60)
+
+  setTimeout(function () {
+    t.notOk(cache.get("b"))
+    t.equal(cache.get("c"), "C")
+  }, 90)
+
+  setTimeout(function () {
+    t.notOk(cache.get("c"))
+    t.end()
+  }, 155)
+})
+
+test("disposal function", function(t) {
+  var disposed = false
+  var cache = new LRU({
+    max: 1,
+    dispose: function (k, n) {
+      disposed = n
+    }
+  })
+
+  cache.set(1, 1)
+  cache.set(2, 2)
+  t.equal(disposed, 1)
+  cache.set(3, 3)
+  t.equal(disposed, 2)
+  cache.reset()
+  t.equal(disposed, 3)
+  t.end()
+})
+
+test("disposal function on too big of item", function(t) {
+  var disposed = false
+  var cache = new LRU({
+    max: 1,
+    length: function (k) {
+      return k.length
+    },
+    dispose: function (k, n) {
+      disposed = n
+    }
+  })
+  var obj = [ 1, 2 ]
+
+  t.equal(disposed, false)
+  cache.set("obj", obj)
+  t.equal(disposed, obj)
+  t.end()
+})
+
+test("has()", function(t) {
+  var cache = new LRU({
+    max: 1,
+    maxAge: 10
+  })
+
+  cache.set('foo', 'bar')
+  t.equal(cache.has('foo'), true)
+  cache.set('blu', 'baz')
+  t.equal(cache.has('foo'), false)
+  t.equal(cache.has('blu'), true)
+  setTimeout(function() {
+    t.equal(cache.has('blu'), false)
+    t.end()
+  }, 15)
+})
+
+test("stale", function(t) {
+  var cache = new LRU({
+    maxAge: 10,
+    stale: true
+  })
+
+  cache.set('foo', 'bar')
+  t.equal(cache.get('foo'), 'bar')
+  t.equal(cache.has('foo'), true)
+  setTimeout(function() {
+    t.equal(cache.has('foo'), false)
+    t.equal(cache.get('foo'), 'bar')
+    t.equal(cache.get('foo'), undefined)
+    t.end()
+  }, 15)
+})
+
+test("lru update via set", function(t) {
+  var cache = LRU({ max: 2 });
+
+  cache.set('foo', 1);
+  cache.set('bar', 2);
+  cache.del('bar');
+  cache.set('baz', 3);
+  cache.set('qux', 4);
+
+  t.equal(cache.get('foo'), undefined)
+  t.equal(cache.get('bar'), undefined)
+  t.equal(cache.get('baz'), 3)
+  t.equal(cache.get('qux'), 4)
+  t.end()
+})
+
+test("least recently set w/ peek", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  t.equal(cache.peek("a"), "A")
+  cache.set("c", "C")
+  t.equal(cache.get("c"), "C")
+  t.equal(cache.get("b"), "B")
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/foreach.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/foreach.js
new file mode 100644
index 0000000..eefb80d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/foreach.js
@@ -0,0 +1,52 @@
+var test = require('tap').test
+var LRU = require('../')
+
+test('forEach', function (t) {
+  var l = new LRU(5)
+  for (var i = 0; i < 10; i ++) {
+    l.set(i.toString(), i.toString(2))
+  }
+
+  var i = 9
+  l.forEach(function (val, key, cache) {
+    t.equal(cache, l)
+    t.equal(key, i.toString())
+    t.equal(val, i.toString(2))
+    i -= 1
+  })
+
+  // get in order of most recently used
+  l.get(6)
+  l.get(8)
+
+  var order = [ 8, 6, 9, 7, 5 ]
+  var i = 0
+
+  l.forEach(function (val, key, cache) {
+    var j = order[i ++]
+    t.equal(cache, l)
+    t.equal(key, j.toString())
+    t.equal(val, j.toString(2))
+  })
+
+  t.end()
+})
+
+test('keys() and values()', function (t) {
+  var l = new LRU(5)
+  for (var i = 0; i < 10; i ++) {
+    l.set(i.toString(), i.toString(2))
+  }
+
+  t.similar(l.keys(), ['9', '8', '7', '6', '5'])
+  t.similar(l.values(), ['1001', '1000', '111', '110', '101'])
+
+  // get in order of most recently used
+  l.get(6)
+  l.get(8)
+
+  t.similar(l.keys(), ['8', '6', '9', '7', '5'])
+  t.similar(l.values(), ['1000', '110', '1001', '111', '101'])
+
+  t.end()
+})

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js
new file mode 100644
index 0000000..7af45b0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js
@@ -0,0 +1,50 @@
+#!/usr/bin/env node --expose_gc
+
+var weak = require('weak');
+var test = require('tap').test
+var LRU = require('../')
+var l = new LRU({ max: 10 })
+var refs = 0
+function X() {
+  refs ++
+  weak(this, deref)
+}
+
+function deref() {
+  refs --
+}
+
+test('no leaks', function (t) {
+  // fill up the cache
+  for (var i = 0; i < 100; i++) {
+    l.set(i, new X);
+    // throw some gets in there, too.
+    if (i % 2 === 0)
+      l.get(i / 2)
+  }
+
+  gc()
+
+  var start = process.memoryUsage()
+
+  // capture the memory
+  var startRefs = refs
+
+  // do it again, but more
+  for (var i = 0; i < 10000; i++) {
+    l.set(i, new X);
+    // throw some gets in there, too.
+    if (i % 2 === 0)
+      l.get(i / 2)
+  }
+
+  gc()
+
+  var end = process.memoryUsage()
+  t.equal(refs, startRefs, 'no leaky refs')
+
+  console.error('start: %j\n' +
+                'end:   %j', start, end);
+  t.pass();
+  t.end();
+})

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/LICENSE b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/LICENSE
new file mode 100644
index 0000000..0c44ae7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/README.md b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/README.md
new file mode 100644
index 0000000..7e36512
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/README.md
@@ -0,0 +1,53 @@
+# sigmund
+
+Quick and dirty signatures for Objects.
+
+This is like a much faster `deepEquals` comparison, which returns a
+string key suitable for caches and the like.
+
+## Usage
+
+```javascript
+function doSomething (someObj) {
+  var key = sigmund(someObj, maxDepth) // max depth defaults to 10
+  var cached = cache.get(key)
+  if (cached) return cached)
+
+  var result = expensiveCalculation(someObj)
+  cache.set(key, result)
+  return result
+}
+```
+
+The resulting key will be as unique and reproducible as calling
+`JSON.stringify` or `util.inspect` on the object, but is much faster.
+In order to achieve this speed, some differences are glossed over.
+For example, the object `{0:'foo'}` will be treated identically to the
+array `['foo']`.
+
+Also, just as there is no way to summon the soul from the scribblings
+of a cocain-addled psychoanalyst, there is no way to revive the object
+from the signature string that sigmund gives you.  In fact, it's
+barely even readable.
+
+As with `sys.inspect` and `JSON.stringify`, larger objects will
+produce larger signature strings.
+
+Because sigmund is a bit less strict than the more thorough
+alternatives, the strings will be shorter, and also there is a
+slightly higher chance for collisions.  For example, these objects
+have the same signature:
+
+    var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}
+    var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}
+
+Like a good Freudian, sigmund is most effective when you already have
+some understanding of what you're looking for.  It can help you help
+yourself, but you must be willing to do some work as well.
+
+Cycles are handled, and cyclical objects are silently omitted (though
+the key is included in the signature output.)
+
+The second argument is the maximum depth, which defaults to 10,
+because that is the maximum object traversal depth covered by most
+insurance carriers.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/bench.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/bench.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/bench.js
new file mode 100644
index 0000000..5acfd6d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/bench.js
@@ -0,0 +1,283 @@
+// different ways to id objects
+// use a req/res pair, since it's crazy deep and cyclical
+
+// sparseFE10 and sigmund are usually pretty close, which is to be expected,
+// since they are essentially the same algorithm, except that sigmund handles
+// regular expression objects properly.
+
+
+var http = require('http')
+var util = require('util')
+var sigmund = require('./sigmund.js')
+var sreq, sres, creq, cres, test
+
+http.createServer(function (q, s) {
+  sreq = q
+  sres = s
+  sres.end('ok')
+  this.close(function () { setTimeout(function () {
+    start()
+  }, 200) })
+}).listen(1337, function () {
+  creq = http.get({ port: 1337 })
+  creq.on('response', function (s) { cres = s })
+})
+
+function start () {
+  test = [sreq, sres, creq, cres]
+  // test = sreq
+  // sreq.sres = sres
+  // sreq.creq = creq
+  // sreq.cres = cres
+
+  for (var i in exports.compare) {
+    console.log(i)
+    var hash = exports.compare[i]()
+    console.log(hash)
+    console.log(hash.length)
+    console.log('')
+  }
+
+  require('bench').runMain()
+}
+
+function customWs (obj, md, d) {
+  d = d || 0
+  var to = typeof obj
+  if (to === 'undefined' || to === 'function' || to === null) return ''
+  if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '')
+
+  if (Array.isArray(obj)) {
+    return obj.map(function (i, _, __) {
+      return customWs(i, md, d + 1)
+    }).reduce(function (a, b) { return a + b }, '')
+  }
+
+  var keys = Object.keys(obj)
+  return keys.map(function (k, _, __) {
+    return k + ':' + customWs(obj[k], md, d + 1)
+  }).reduce(function (a, b) { return a + b }, '')
+}
+
+function custom (obj, md, d) {
+  d = d || 0
+  var to = typeof obj
+  if (to === 'undefined' || to === 'function' || to === null) return ''
+  if (d > md || !obj || to !== 'object') return '' + obj
+
+  if (Array.isArray(obj)) {
+    return obj.map(function (i, _, __) {
+      return custom(i, md, d + 1)
+    }).reduce(function (a, b) { return a + b }, '')
+  }
+
+  var keys = Object.keys(obj)
+  return keys.map(function (k, _, __) {
+    return k + ':' + custom(obj[k], md, d + 1)
+  }).reduce(function (a, b) { return a + b }, '')
+}
+
+function sparseFE2 (obj, maxDepth) {
+  var seen = []
+  var soFar = ''
+  function ch (v, depth) {
+    if (depth > maxDepth) return
+    if (typeof v === 'function' || typeof v === 'undefined') return
+    if (typeof v !== 'object' || !v) {
+      soFar += v
+      return
+    }
+    if (seen.indexOf(v) !== -1 || depth === maxDepth) return
+    seen.push(v)
+    soFar += '{'
+    Object.keys(v).forEach(function (k, _, __) {
+      // pseudo-private values.  skip those.
+      if (k.charAt(0) === '_') return
+      var to = typeof v[k]
+      if (to === 'function' || to === 'undefined') return
+      soFar += k + ':'
+      ch(v[k], depth + 1)
+    })
+    soFar += '}'
+  }
+  ch(obj, 0)
+  return soFar
+}
+
+function sparseFE (obj, maxDepth) {
+  var seen = []
+  var soFar = ''
+  function ch (v, depth) {
+    if (depth > maxDepth) return
+    if (typeof v === 'function' || typeof v === 'undefined') return
+    if (typeof v !== 'object' || !v) {
+      soFar += v
+      return
+    }
+    if (seen.indexOf(v) !== -1 || depth === maxDepth) return
+    seen.push(v)
+    soFar += '{'
+    Object.keys(v).forEach(function (k, _, __) {
+      // pseudo-private values.  skip those.
+      if (k.charAt(0) === '_') return
+      var to = typeof v[k]
+      if (to === 'function' || to === 'undefined') return
+      soFar += k
+      ch(v[k], depth + 1)
+    })
+  }
+  ch(obj, 0)
+  return soFar
+}
+
+function sparse (obj, maxDepth) {
+  var seen = []
+  var soFar = ''
+  function ch (v, depth) {
+    if (depth > maxDepth) return
+    if (typeof v === 'function' || typeof v === 'undefined') return
+    if (typeof v !== 'object' || !v) {
+      soFar += v
+      return
+    }
+    if (seen.indexOf(v) !== -1 || depth === maxDepth) return
+    seen.push(v)
+    soFar += '{'
+    for (var k in v) {
+      // pseudo-private values.  skip those.
+      if (k.charAt(0) === '_') continue
+      var to = typeof v[k]
+      if (to === 'function' || to === 'undefined') continue
+      soFar += k
+      ch(v[k], depth + 1)
+    }
+  }
+  ch(obj, 0)
+  return soFar
+}
+
+function noCommas (obj, maxDepth) {
+  var seen = []
+  var soFar = ''
+  function ch (v, depth) {
+    if (depth > maxDepth) return
+    if (typeof v === 'function' || typeof v === 'undefined') return
+    if (typeof v !== 'object' || !v) {
+      soFar += v
+      return
+    }
+    if (seen.indexOf(v) !== -1 || depth === maxDepth) return
+    seen.push(v)
+    soFar += '{'
+    for (var k in v) {
+      // pseudo-private values.  skip those.
+      if (k.charAt(0) === '_') continue
+      var to = typeof v[k]
+      if (to === 'function' || to === 'undefined') continue
+      soFar += k + ':'
+      ch(v[k], depth + 1)
+    }
+    soFar += '}'
+  }
+  ch(obj, 0)
+  return soFar
+}
+
+
+function flatten (obj, maxDepth) {
+  var seen = []
+  var soFar = ''
+  function ch (v, depth) {
+    if (depth > maxDepth) return
+    if (typeof v === 'function' || typeof v === 'undefined') return
+    if (typeof v !== 'object' || !v) {
+      soFar += v
+      return
+    }
+    if (seen.indexOf(v) !== -1 || depth === maxDepth) return
+    seen.push(v)
+    soFar += '{'
+    for (var k in v) {
+      // pseudo-private values.  skip those.
+      if (k.charAt(0) === '_') continue
+      var to = typeof v[k]
+      if (to === 'function' || to === 'undefined') continue
+      soFar += k + ':'
+      ch(v[k], depth + 1)
+      soFar += ','
+    }
+    soFar += '}'
+  }
+  ch(obj, 0)
+  return soFar
+}
+
+exports.compare =
+{
+  // 'custom 2': function () {
+  //   return custom(test, 2, 0)
+  // },
+  // 'customWs 2': function () {
+  //   return customWs(test, 2, 0)
+  // },
+  'JSON.stringify (guarded)': function () {
+    var seen = []
+    return JSON.stringify(test, function (k, v) {
+      if (typeof v !== 'object' || !v) return v
+      if (seen.indexOf(v) !== -1) return undefined
+      seen.push(v)
+      return v
+    })
+  },
+
+  'flatten 10': function () {
+    return flatten(test, 10)
+  },
+
+  // 'flattenFE 10': function () {
+  //   return flattenFE(test, 10)
+  // },
+
+  'noCommas 10': function () {
+    return noCommas(test, 10)
+  },
+
+  'sparse 10': function () {
+    return sparse(test, 10)
+  },
+
+  'sparseFE 10': function () {
+    return sparseFE(test, 10)
+  },
+
+  'sparseFE2 10': function () {
+    return sparseFE2(test, 10)
+  },
+
+  sigmund: function() {
+    return sigmund(test, 10)
+  },
+
+
+  // 'util.inspect 1': function () {
+  //   return util.inspect(test, false, 1, false)
+  // },
+  // 'util.inspect undefined': function () {
+  //   util.inspect(test)
+  // },
+  // 'util.inspect 2': function () {
+  //   util.inspect(test, false, 2, false)
+  // },
+  // 'util.inspect 3': function () {
+  //   util.inspect(test, false, 3, false)
+  // },
+  // 'util.inspect 4': function () {
+  //   util.inspect(test, false, 4, false)
+  // },
+  // 'util.inspect Infinity': function () {
+  //   util.inspect(test, false, Infinity, false)
+  // }
+}
+
+/** results
+**/

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/package.json b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/package.json
new file mode 100644
index 0000000..92a63e9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/package.json
@@ -0,0 +1,38 @@
+{
+  "name": "sigmund",
+  "version": "1.0.0",
+  "description": "Quick and dirty signatures for Objects.",
+  "main": "sigmund.js",
+  "directories": {
+    "test": "test"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "tap": "~0.3.0"
+  },
+  "scripts": {
+    "test": "tap test/*.js",
+    "bench": "node bench.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/sigmund"
+  },
+  "keywords": [
+    "object",
+    "signature",
+    "key",
+    "data",
+    "psychoanalysis"
+  ],
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "license": "BSD",
+  "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n  var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n  var cached = cache.get(key)\n  if (cached) return cached)\n\n  var result = expensiveCalculation(someObj)\n  cache.set(key, result)\n  return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you.  In fact, it's\nbarely even rea
 dable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions.  For example, these objects\nhave the same signature:\n\n    var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n    var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for.  It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n",
+  "readmeFilename": "README.md",
+  "_id": "sigmund@1.0.0",
+  "_from": "sigmund@~1.0.0"
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/sigmund.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/sigmund.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/sigmund.js
new file mode 100644
index 0000000..82c7ab8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/sigmund.js
@@ -0,0 +1,39 @@
+module.exports = sigmund
+function sigmund (subject, maxSessions) {
+    maxSessions = maxSessions || 10;
+    var notes = [];
+    var analysis = '';
+    var RE = RegExp;
+
+    function psychoAnalyze (subject, session) {
+        if (session > maxSessions) return;
+
+        if (typeof subject === 'function' ||
+            typeof subject === 'undefined') {
+            return;
+        }
+
+        if (typeof subject !== 'object' || !subject ||
+            (subject instanceof RE)) {
+            analysis += subject;
+            return;
+        }
+
+        if (notes.indexOf(subject) !== -1 || session === maxSessions) return;
+
+        notes.push(subject);
+        analysis += '{';
+        Object.keys(subject).forEach(function (issue, _, __) {
+            // pseudo-private values.  skip those.
+            if (issue.charAt(0) === '_') return;
+            var to = typeof subject[issue];
+            if (to === 'function' || to === 'undefined') return;
+            analysis += issue;
+            psychoAnalyze(subject[issue], session + 1);
+        });
+    }
+    psychoAnalyze(subject, 0);
+    return analysis;
+}
+
+// vim: set softtabstop=4 shiftwidth=4:

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/test/basic.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/test/basic.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/test/basic.js
new file mode 100644
index 0000000..50c53a1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/sigmund/test/basic.js
@@ -0,0 +1,24 @@
+var test = require('tap').test
+var sigmund = require('../sigmund.js')
+
+
+// occasionally there are duplicates
+// that's an acceptable edge-case.  JSON.stringify and util.inspect
+// have some collision potential as well, though less, and collision
+// detection is expensive.
+var hash = '{abc/def/g{0h1i2{jkl'
+var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}
+var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}
+
+var obj3 = JSON.parse(JSON.stringify(obj1))
+obj3.c = /def/
+obj3.g[2].cycle = obj3
+var cycleHash = '{abc/def/g{0h1i2{jklcycle'
+
+test('basic', function (t) {
+    t.equal(sigmund(obj1), hash)
+    t.equal(sigmund(obj2), hash)
+    t.equal(sigmund(obj3), cycleHash)
+    t.end()
+})
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/package.json b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/package.json
new file mode 100644
index 0000000..1682414
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/package.json
@@ -0,0 +1,36 @@
+{
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me"
+  },
+  "name": "minimatch",
+  "description": "a glob matcher in javascript",
+  "version": "0.2.12",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/minimatch.git"
+  },
+  "main": "minimatch.js",
+  "scripts": {
+    "test": "tap test"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "dependencies": {
+    "lru-cache": "2",
+    "sigmund": "~1.0.0"
+  },
+  "devDependencies": {
+    "tap": ""
+  },
+  "license": {
+    "type": "MIT",
+    "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE"
+  },
+  "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n### Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` charac
 ter, then it is negated.  Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally.  This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`.  Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything.  Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set.  This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.  **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\n
 then minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes.  For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`.  This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern.  Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity.  Since those two are valid, matching proceeds.\n\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The opt
 ions supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n  Each row in the\n  array corresponds to a brace-expanded pattern.  Each item in the row\n  corresponds to a single path-part.  For example, the pattern\n  `{a,b/c}/d` would expand to a set of patterns like:\n\n        [ [ a, d ]\n        , [ b, c, d ] ]\n\n    If a portion of the pattern doesn't have any \"magic\" in it\n    (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n    will be left as a string rather than converted to a regular\n    expression.\n\n* `regexp` Created by the `makeRe` method.  A single regular expression\n  expressing the entire pattern.  This is useful in cases where you wish\n  to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if 
 necessary, and return it.\n  Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n  false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n  filename, and match it against a single row in the `regExpSet`.  This\n  method is mainly for internal use, but is exposed so that it can be\n  used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items.  So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export.  Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minim
 atch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`.  Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob.  If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not expli
 citly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself.  When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes.  For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n",
+  "readmeFilename": "README.md",
+  "_id": "minimatch@0.2.12",
+  "_from": "minimatch@0.2.x"
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/basic.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/basic.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/basic.js
new file mode 100644
index 0000000..ae7ac73
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/basic.js
@@ -0,0 +1,399 @@
+// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test
+//
+// TODO: Some of these tests do very bad things with backslashes, and will
+// most likely fail badly on windows.  They should probably be skipped.
+
+var tap = require("tap")
+  , globalBefore = Object.keys(global)
+  , mm = require("../")
+  , files = [ "a", "b", "c", "d", "abc"
+            , "abd", "abe", "bb", "bcd"
+            , "ca", "cb", "dd", "de"
+            , "bdir/", "bdir/cfile"]
+  , next = files.concat([ "a-b", "aXb"
+                        , ".x", ".y" ])
+
+
+var patterns =
+  [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test"
+  , ["a*", ["a", "abc", "abd", "abe"]]
+  , ["X*", ["X*"], {nonull: true}]
+
+  // allow null glob expansion
+  , ["X*", []]
+
+  // isaacs: Slightly different than bash/sh/ksh
+  // \\* is not un-escaped to literal "*" in a failed match,
+  // but it does make it get treated as a literal star
+  , ["\\*", ["\\*"], {nonull: true}]
+  , ["\\**", ["\\**"], {nonull: true}]
+  , ["\\*\\*", ["\\*\\*"], {nonull: true}]
+
+  , ["b*/", ["bdir/"]]
+  , ["c*", ["c", "ca", "cb"]]
+  , ["**", files]
+
+  , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}]
+  , ["s/\\..*//", ["s/\\..*//"], {nonull: true}]
+
+  , "legendary larry crashes bashes"
+  , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"
+    , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}]
+  , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"
+    , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}]
+
+  , "character classes"
+  , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]]
+  , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd",
+     "bdir/", "ca", "cb", "dd", "de"]]
+  , ["a*[^c]", ["abd", "abe"]]
+  , function () { files.push("a-b", "aXb") }
+  , ["a[X-]b", ["a-b", "aXb"]]
+  , function () { files.push(".x", ".y") }
+  , ["[^a-c]*", ["d", "dd", "de"]]
+  , function () { files.push("a*b/", "a*b/ooo") }
+  , ["a\\*b/*", ["a*b/ooo"]]
+  , ["a\\*?/*", ["a*b/ooo"]]
+  , ["*\\\\!*", [], {null: true}, ["echo !7"]]
+  , ["*\\!*", ["echo !7"], null, ["echo !7"]]
+  , ["*.\\*", ["r.*"], null, ["r.*"]]
+  , ["a[b]c", ["abc"]]
+  , ["a[\\b]c", ["abc"]]
+  , ["a?c", ["abc"]]
+  , ["a\\*c", [], {null: true}, ["abc"]]
+  , ["", [""], { null: true }, [""]]
+
+  , "http://www.opensource.apple.com/source/bash/bash-23/" +
+    "bash/tests/glob-test"
+  , function () { files.push("man/", "man/man1/", "man/man1/bash.1") }
+  , ["*/man*/bash.*", ["man/man1/bash.1"]]
+  , ["man/man1/bash.1", ["man/man1/bash.1"]]
+  , ["a***c", ["abc"], null, ["abc"]]
+  , ["a*****?c", ["abc"], null, ["abc"]]
+  , ["?*****??", ["abc"], null, ["abc"]]
+  , ["*****??", ["abc"], null, ["abc"]]
+  , ["?*****?c", ["abc"], null, ["abc"]]
+  , ["?***?****c", ["abc"], null, ["abc"]]
+  , ["?***?****?", ["abc"], null, ["abc"]]
+  , ["?***?****", ["abc"], null, ["abc"]]
+  , ["*******c", ["abc"], null, ["abc"]]
+  , ["*******?", ["abc"], null, ["abc"]]
+  , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+  , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+  , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+  , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+  , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+  , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+  , ["[-abc]", ["-"], null, ["-"]]
+  , ["[abc-]", ["-"], null, ["-"]]
+  , ["\\", ["\\"], null, ["\\"]]
+  , ["[\\\\]", ["\\"], null, ["\\"]]
+  , ["[[]", ["["], null, ["["]]
+  , ["[", ["["], null, ["["]]
+  , ["[*", ["[abc"], null, ["[abc"]]
+  , "a right bracket shall lose its special meaning and\n" +
+    "represent itself in a bracket expression if it occurs\n" +
+    "first in the list.  -- POSIX.2 2.8.3.2"
+  , ["[]]", ["]"], null, ["]"]]
+  , ["[]-]", ["]"], null, ["]"]]
+  , ["[a-\z]", ["p"], null, ["p"]]
+  , ["??**********?****?", [], { null: true }, ["abc"]]
+  , ["??**********?****c", [], { null: true }, ["abc"]]
+  , ["?************c****?****", [], { null: true }, ["abc"]]
+  , ["*c*?**", [], { null: true }, ["abc"]]
+  , ["a*****c*?**", [], { null: true }, ["abc"]]
+  , ["a********???*******", [], { null: true }, ["abc"]]
+  , ["[]", [], { null: true }, ["a"]]
+  , ["[abc", [], { null: true }, ["["]]
+
+  , "nocase tests"
+  , ["XYZ", ["xYz"], { nocase: true, null: true }
+    , ["xYz", "ABC", "IjK"]]
+  , ["ab*", ["ABC"], { nocase: true, null: true }
+    , ["xYz", "ABC", "IjK"]]
+  , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true }
+    , ["xYz", "ABC", "IjK"]]
+
+  // [ pattern, [matches], MM opts, files, TAP opts]
+  , "onestar/twostar"
+  , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]]
+  , ["{/?,*}", ["/a", "bb"], {null: true}
+    , ["/a", "/b/b", "/a/b/c", "bb"]]
+
+  , "dots should not match unless requested"
+  , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]]
+
+  // .. and . can only match patterns starting with .,
+  // even when options.dot is set.
+  , function () {
+      files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"]
+    }
+  , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}]
+  , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}]
+  , ["a/*/b", ["a/c/b"], {dot:false}]
+  , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}]
+
+
+  // this also tests that changing the options needs
+  // to change the cache key, even if the pattern is
+  // the same!
+  , ["**", ["a/b","a/.d",".a/.d"], { dot: true }
+    , [ ".a/.d", "a/.d", "a/b"]]
+
+  , "paren sets cannot contain slashes"
+  , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]]
+
+  // brace sets trump all else.
+  //
+  // invalid glob pattern.  fails on bash4 and bsdglob.
+  // however, in this implementation, it's easier just
+  // to do the intuitive thing, and let brace-expansion
+  // actually come before parsing any extglob patterns,
+  // like the documentation seems to say.
+  //
+  // XXX: if anyone complains about this, either fix it
+  // or tell them to grow up and stop complaining.
+  //
+  // bash/bsdglob says this:
+  // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]]
+  // but we do this instead:
+  , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]]
+
+  // test partial parsing in the presence of comment/negation chars
+  , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]]
+  , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]]
+
+  // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped.
+  , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g"
+    , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"]
+    , {}
+    , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]]
+
+
+  // crazy nested {,,} and *(||) tests.
+  , function () {
+      files = [ "a", "b", "c", "d"
+              , "ab", "ac", "ad"
+              , "bc", "cb"
+              , "bc,d", "c,db", "c,d"
+              , "d)", "(b|c", "*(b|c"
+              , "b|c", "b|cc", "cb|c"
+              , "x(a|b|c)", "x(a|c)"
+              , "(a|b|c)", "(a|c)"]
+    }
+  , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]]
+  , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]]
+  // a
+  // *(b|c)
+  // *(b|d)
+  , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]]
+  , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]]
+
+
+  // test various flag settings.
+  , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"]
+    , { noext: true } ]
+  , ["a?b", ["x/y/acb", "acb/"], {matchBase: true}
+    , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ]
+  , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]]
+
+
+  // begin channelling Boole and deMorgan...
+  , "negation tests"
+  , function () {
+      files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"]
+    }
+
+  // anything that is NOT a* matches.
+  , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]]
+
+  // anything that IS !a* matches.
+  , ["!a*", ["!ab", "!abc"], {nonegate: true}]
+
+  // anything that IS a* matches
+  , ["!!a*", ["a!b"]]
+
+  // anything that is NOT !a* matches
+  , ["!\\!a*", ["a!b", "d", "e", "\\!a"]]
+
+  // negation nestled within a pattern
+  , function () {
+      files = [ "foo.js"
+              , "foo.bar"
+              // can't match this one without negative lookbehind.
+              , "foo.js.js"
+              , "blar.js"
+              , "foo."
+              , "boo.js.boo" ]
+    }
+  , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ]
+
+  // https://github.com/isaacs/minimatch/issues/5
+  , function () {
+      files = [ 'a/b/.x/c'
+              , 'a/b/.x/c/d'
+              , 'a/b/.x/c/d/e'
+              , 'a/b/.x'
+              , 'a/b/.x/'
+              , 'a/.x/b'
+              , '.x'
+              , '.x/'
+              , '.x/a'
+              , '.x/a/b'
+              , 'a/.x/b/.x/c'
+              , '.x/.x' ]
+  }
+  , ["**/.x/**", [ '.x/'
+                 , '.x/a'
+                 , '.x/a/b'
+                 , 'a/.x/b'
+                 , 'a/b/.x/'
+                 , 'a/b/.x/c'
+                 , 'a/b/.x/c/d'
+                 , 'a/b/.x/c/d/e' ] ]
+
+  ]
+
+var regexps =
+  [ '/^(?:(?=.)a[^/]*?)$/',
+    '/^(?:(?=.)X[^/]*?)$/',
+    '/^(?:(?=.)X[^/]*?)$/',
+    '/^(?:\\*)$/',
+    '/^(?:(?=.)\\*[^/]*?)$/',
+    '/^(?:\\*\\*)$/',
+    '/^(?:(?=.)b[^/]*?\\/)$/',
+    '/^(?:(?=.)c[^/]*?)$/',
+    '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/',
+    '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/',
+    '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/',
+    '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/',
+    '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/',
+    '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/',
+    '/^(?:(?=.)a[^/]*?[^c])$/',
+    '/^(?:(?=.)a[X-]b)$/',
+    '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/',
+    '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/',
+    '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/',
+    '/^(?:(?=.)a[b]c)$/',
+    '/^(?:(?=.)a[b]c)$/',
+    '/^(?:(?=.)a[^/]c)$/',
+    '/^(?:a\\*c)$/',
+    'false',
+    '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/',
+    '/^(?:man\\/man1\\/bash\\.1)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/',
+    '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[-abc])$/',
+    '/^(?:(?!\\.)(?=.)[abc-])$/',
+    '/^(?:\\\\)$/',
+    '/^(?:(?!\\.)(?=.)[\\\\])$/',
+    '/^(?:(?!\\.)(?=.)[\\[])$/',
+    '/^(?:\\[)$/',
+    '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[\\]])$/',
+    '/^(?:(?!\\.)(?=.)[\\]-])$/',
+    '/^(?:(?!\\.)(?=.)[a-z])$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/',
+    '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/',
+    '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/',
+    '/^(?:\\[\\])$/',
+    '/^(?:\\[abc)$/',
+    '/^(?:(?=.)XYZ)$/i',
+    '/^(?:(?=.)ab[^/]*?)$/i',
+    '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i',
+    '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/',
+    '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/',
+    '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/',
+    '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/',
+    '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/',
+    '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/',
+    '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/',
+    '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/',
+    '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/',
+    '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/',
+    '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/',
+    '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/',
+    '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/',
+    '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/',
+    '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/',
+    '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/',
+    '/^(?:(?=.)a[^/]b)$/',
+    '/^(?:(?=.)#[^/]*?)$/',
+    '/^(?!^(?:(?=.)a[^/]*?)$).*$/',
+    '/^(?:(?=.)\\!a[^/]*?)$/',
+    '/^(?:(?=.)a[^/]*?)$/',
+    '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/',
+    '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/',
+    '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ]
+var re = 0;
+
+tap.test("basic tests", function (t) {
+  var start = Date.now()
+
+  // [ pattern, [matches], MM opts, files, TAP opts]
+  patterns.forEach(function (c) {
+    if (typeof c === "function") return c()
+    if (typeof c === "string") return t.comment(c)
+
+    var pattern = c[0]
+      , expect = c[1].sort(alpha)
+      , options = c[2] || {}
+      , f = c[3] || files
+      , tapOpts = c[4] || {}
+
+    // options.debug = true
+    var m = new mm.Minimatch(pattern, options)
+    var r = m.makeRe()
+    var expectRe = regexps[re++]
+    tapOpts.re = String(r) || JSON.stringify(r)
+    tapOpts.files = JSON.stringify(f)
+    tapOpts.pattern = pattern
+    tapOpts.set = m.set
+    tapOpts.negated = m.negate
+
+    var actual = mm.match(f, pattern, options)
+    actual.sort(alpha)
+
+    t.equivalent( actual, expect
+                , JSON.stringify(pattern) + " " + JSON.stringify(expect)
+                , tapOpts )
+
+    t.equal(tapOpts.re, expectRe, tapOpts)
+  })
+
+  t.comment("time=" + (Date.now() - start) + "ms")
+  t.end()
+})
+
+tap.test("global leak test", function (t) {
+  var globalAfter = Object.keys(global)
+  t.equivalent(globalAfter, globalBefore, "no new globals, please")
+  t.end()
+})
+
+function alpha (a, b) {
+  return a > b ? 1 : -1
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/brace-expand.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/brace-expand.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/brace-expand.js
new file mode 100644
index 0000000..7ee278a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/brace-expand.js
@@ -0,0 +1,33 @@
+var tap = require("tap")
+  , minimatch = require("../")
+
+tap.test("brace expansion", function (t) {
+  // [ pattern, [expanded] ]
+  ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}"
+      , [ "abxy"
+        , "abxz"
+        , "acdxy"
+        , "acdxz"
+        , "acexy"
+        , "acexz"
+        , "afhxy"
+        , "afhxz"
+        , "aghxy"
+        , "aghxz" ] ]
+    , [ "a{1..5}b"
+      , [ "a1b"
+        , "a2b"
+        , "a3b"
+        , "a4b"
+        , "a5b" ] ]
+    , [ "a{b}c", ["a{b}c"] ]
+  ].forEach(function (tc) {
+    var p = tc[0]
+      , expect = tc[1]
+    t.equivalent(minimatch.braceExpand(p), expect, p)
+  })
+  console.error("ending")
+  t.end()
+})
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/caching.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/caching.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/caching.js
new file mode 100644
index 0000000..0fec4b0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/caching.js
@@ -0,0 +1,14 @@
+var Minimatch = require("../minimatch.js").Minimatch
+var tap = require("tap")
+tap.test("cache test", function (t) {
+  var mm1 = new Minimatch("a?b")
+  var mm2 = new Minimatch("a?b")
+  t.equal(mm1, mm2, "should get the same object")
+  // the lru should drop it after 100 entries
+  for (var i = 0; i < 100; i ++) {
+    new Minimatch("a"+i)
+  }
+  mm2 = new Minimatch("a?b")
+  t.notEqual(mm1, mm2, "cache should have dropped")
+  t.end()
+})

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/defaults.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/defaults.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/defaults.js
new file mode 100644
index 0000000..25f1f60
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/test/defaults.js
@@ -0,0 +1,274 @@
+// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test
+//
+// TODO: Some of these tests do very bad things with backslashes, and will
+// most likely fail badly on windows.  They should probably be skipped.
+
+var tap = require("tap")
+  , globalBefore = Object.keys(global)
+  , mm = require("../")
+  , files = [ "a", "b", "c", "d", "abc"
+            , "abd", "abe", "bb", "bcd"
+            , "ca", "cb", "dd", "de"
+            , "bdir/", "bdir/cfile"]
+  , next = files.concat([ "a-b", "aXb"
+                        , ".x", ".y" ])
+
+tap.test("basic tests", function (t) {
+  var start = Date.now()
+
+  // [ pattern, [matches], MM opts, files, TAP opts]
+  ; [ "http://www.bashcookbook.com/bashinfo" +
+      "/source/bash-1.14.7/tests/glob-test"
+    , ["a*", ["a", "abc", "abd", "abe"]]
+    , ["X*", ["X*"], {nonull: true}]
+
+    // allow null glob expansion
+    , ["X*", []]
+
+    // isaacs: Slightly different than bash/sh/ksh
+    // \\* is not un-escaped to literal "*" in a failed match,
+    // but it does make it get treated as a literal star
+    , ["\\*", ["\\*"], {nonull: true}]
+    , ["\\**", ["\\**"], {nonull: true}]
+    , ["\\*\\*", ["\\*\\*"], {nonull: true}]
+
+    , ["b*/", ["bdir/"]]
+    , ["c*", ["c", "ca", "cb"]]
+    , ["**", files]
+
+    , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}]
+    , ["s/\\..*//", ["s/\\..*//"], {nonull: true}]
+
+    , "legendary larry crashes bashes"
+    , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"
+      , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}]
+    , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"
+      , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}]
+
+    , "character classes"
+    , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]]
+    , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd",
+       "bdir/", "ca", "cb", "dd", "de"]]
+    , ["a*[^c]", ["abd", "abe"]]
+    , function () { files.push("a-b", "aXb") }
+    , ["a[X-]b", ["a-b", "aXb"]]
+    , function () { files.push(".x", ".y") }
+    , ["[^a-c]*", ["d", "dd", "de"]]
+    , function () { files.push("a*b/", "a*b/ooo") }
+    , ["a\\*b/*", ["a*b/ooo"]]
+    , ["a\\*?/*", ["a*b/ooo"]]
+    , ["*\\\\!*", [], {null: true}, ["echo !7"]]
+    , ["*\\!*", ["echo !7"], null, ["echo !7"]]
+    , ["*.\\*", ["r.*"], null, ["r.*"]]
+    , ["a[b]c", ["abc"]]
+    , ["a[\\b]c", ["abc"]]
+    , ["a?c", ["abc"]]
+    , ["a\\*c", [], {null: true}, ["abc"]]
+    , ["", [""], { null: true }, [""]]
+
+    , "http://www.opensource.apple.com/source/bash/bash-23/" +
+      "bash/tests/glob-test"
+    , function () { files.push("man/", "man/man1/", "man/man1/bash.1") }
+    , ["*/man*/bash.*", ["man/man1/bash.1"]]
+    , ["man/man1/bash.1", ["man/man1/bash.1"]]
+    , ["a***c", ["abc"], null, ["abc"]]
+    , ["a*****?c", ["abc"], null, ["abc"]]
+    , ["?*****??", ["abc"], null, ["abc"]]
+    , ["*****??", ["abc"], null, ["abc"]]
+    , ["?*****?c", ["abc"], null, ["abc"]]
+    , ["?***?****c", ["abc"], null, ["abc"]]
+    , ["?***?****?", ["abc"], null, ["abc"]]
+    , ["?***?****", ["abc"], null, ["abc"]]
+    , ["*******c", ["abc"], null, ["abc"]]
+    , ["*******?", ["abc"], null, ["abc"]]
+    , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+    , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+    , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+    , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+    , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+    , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]]
+    , ["[-abc]", ["-"], null, ["-"]]
+    , ["[abc-]", ["-"], null, ["-"]]
+    , ["\\", ["\\"], null, ["\\"]]
+    , ["[\\\\]", ["\\"], null, ["\\"]]
+    , ["[[]", ["["], null, ["["]]
+    , ["[", ["["], null, ["["]]
+    , ["[*", ["[abc"], null, ["[abc"]]
+    , "a right bracket shall lose its special meaning and\n" +
+      "represent itself in a bracket expression if it occurs\n" +
+      "first in the list.  -- POSIX.2 2.8.3.2"
+    , ["[]]", ["]"], null, ["]"]]
+    , ["[]-]", ["]"], null, ["]"]]
+    , ["[a-\z]", ["p"], null, ["p"]]
+    , ["??**********?****?", [], { null: true }, ["abc"]]
+    , ["??**********?****c", [], { null: true }, ["abc"]]
+    , ["?************c****?****", [], { null: true }, ["abc"]]
+    , ["*c*?**", [], { null: true }, ["abc"]]
+    , ["a*****c*?**", [], { null: true }, ["abc"]]
+    , ["a********???*******", [], { null: true }, ["abc"]]
+    , ["[]", [], { null: true }, ["a"]]
+    , ["[abc", [], { null: true }, ["["]]
+
+    , "nocase tests"
+    , ["XYZ", ["xYz"], { nocase: true, null: true }
+      , ["xYz", "ABC", "IjK"]]
+    , ["ab*", ["ABC"], { nocase: true, null: true }
+      , ["xYz", "ABC", "IjK"]]
+    , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true }
+      , ["xYz", "ABC", "IjK"]]
+
+    // [ pattern, [matches], MM opts, files, TAP opts]
+    , "onestar/twostar"
+    , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]]
+    , ["{/?,*}", ["/a", "bb"], {null: true}
+      , ["/a", "/b/b", "/a/b/c", "bb"]]
+
+    , "dots should not match unless requested"
+    , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]]
+
+    // .. and . can only match patterns starting with .,
+    // even when options.dot is set.
+    , function () {
+        files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"]
+      }
+    , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}]
+    , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}]
+    , ["a/*/b", ["a/c/b"], {dot:false}]
+    , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}]
+
+
+    // this also tests that changing the options needs
+    // to change the cache key, even if the pattern is
+    // the same!
+    , ["**", ["a/b","a/.d",".a/.d"], { dot: true }
+      , [ ".a/.d", "a/.d", "a/b"]]
+
+    , "paren sets cannot contain slashes"
+    , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]]
+
+    // brace sets trump all else.
+    //
+    // invalid glob pattern.  fails on bash4 and bsdglob.
+    // however, in this implementation, it's easier just
+    // to do the intuitive thing, and let brace-expansion
+    // actually come before parsing any extglob patterns,
+    // like the documentation seems to say.
+    //
+    // XXX: if anyone complains about this, either fix it
+    // or tell them to grow up and stop complaining.
+    //
+    // bash/bsdglob says this:
+    // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]]
+    // but we do this instead:
+    , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]]
+
+    // test partial parsing in the presence of comment/negation chars
+    , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]]
+    , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]]
+
+    // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped.
+    , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g"
+      , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"]
+      , {}
+      , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]]
+
+
+    // crazy nested {,,} and *(||) tests.
+    , function () {
+        files = [ "a", "b", "c", "d"
+                , "ab", "ac", "ad"
+                , "bc", "cb"
+                , "bc,d", "c,db", "c,d"
+                , "d)", "(b|c", "*(b|c"
+                , "b|c", "b|cc", "cb|c"
+                , "x(a|b|c)", "x(a|c)"
+                , "(a|b|c)", "(a|c)"]
+      }
+    , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]]
+    , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]]
+    // a
+    // *(b|c)
+    // *(b|d)
+    , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]]
+    , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]]
+
+
+    // test various flag settings.
+    , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"]
+      , { noext: true } ]
+    , ["a?b", ["x/y/acb", "acb/"], {matchBase: true}
+      , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ]
+    , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]]
+
+
+    // begin channelling Boole and deMorgan...
+    , "negation tests"
+    , function () {
+        files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"]
+      }
+
+    // anything that is NOT a* matches.
+    , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]]
+
+    // anything that IS !a* matches.
+    , ["!a*", ["!ab", "!abc"], {nonegate: true}]
+
+    // anything that IS a* matches
+    , ["!!a*", ["a!b"]]
+
+    // anything that is NOT !a* matches
+    , ["!\\!a*", ["a!b", "d", "e", "\\!a"]]
+
+    // negation nestled within a pattern
+    , function () {
+        files = [ "foo.js"
+                , "foo.bar"
+                // can't match this one without negative lookbehind.
+                , "foo.js.js"
+                , "blar.js"
+                , "foo."
+                , "boo.js.boo" ]
+      }
+    , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ]
+
+    ].forEach(function (c) {
+      if (typeof c === "function") return c()
+      if (typeof c === "string") return t.comment(c)
+
+      var pattern = c[0]
+        , expect = c[1].sort(alpha)
+        , options = c[2] || {}
+        , f = c[3] || files
+        , tapOpts = c[4] || {}
+
+      // options.debug = true
+      var Class = mm.defaults(options).Minimatch
+      var m = new Class(pattern, {})
+      var r = m.makeRe()
+      tapOpts.re = String(r) || JSON.stringify(r)
+      tapOpts.files = JSON.stringify(f)
+      tapOpts.pattern = pattern
+      tapOpts.set = m.set
+      tapOpts.negated = m.negate
+
+      var actual = mm.match(f, pattern, options)
+      actual.sort(alpha)
+
+      t.equivalent( actual, expect
+                  , JSON.stringify(pattern) + " " + JSON.stringify(expect)
+                  , tapOpts )
+    })
+
+  t.comment("time=" + (Date.now() - start) + "ms")
+  t.end()
+})
+
+tap.test("global leak test", function (t) {
+  var globalAfter = Object.keys(global)
+  t.equivalent(globalAfter, globalBefore, "no new globals, please")
+  t.end()
+})
+
+function alpha (a, b) {
+  return a > b ? 1 : -1
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/Jakefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/Jakefile b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/Jakefile
new file mode 100644
index 0000000..1523f05
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/Jakefile
@@ -0,0 +1,37 @@
+
+var t = new jake.TestTask('Utilities', function () {
+  this.testFiles.include('test/*.js');
+});
+
+namespace('doc', function () {
+  task('generate', ['doc:clobber'], function () {
+    var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' +
+        '-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib';
+    console.log('Generating docs ...');
+    jake.exec([cmd], function () {
+      console.log('Done.');
+      complete();
+    });
+  }, {async: true});
+
+  task('clobber', function () {
+    var cmd = 'rm -fr ./doc/**';
+    jake.exec([cmd], function () {
+      console.log('Clobbered old docs.');
+      complete();
+    });
+  }, {async: true});
+
+});
+
+desc('Generate docs for Utilities');
+task('doc', ['doc:generate']);
+
+var p = new jake.NpmPublishTask('utilities', [
+  'Jakefile'
+, 'README.md'
+, 'package.json'
+, 'lib/**'
+, 'test/**'
+]);
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/README.md b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/README.md
new file mode 100644
index 0000000..fbbdf59
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/README.md
@@ -0,0 +1,6 @@
+utilities
+=========
+
+[![build status](https://secure.travis-ci.org/mde/utilities.png)](http://travis-ci.org/mde/utilities)
+
+A classic collection of JavaScript utilities
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/array.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/array.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/array.js
new file mode 100644
index 0000000..836de2c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/array.js
@@ -0,0 +1,93 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+/**
+  @name array
+  @namespace array
+*/
+
+var array = new (function () {
+
+  /**
+    @name array#humanize
+    @public
+    @function
+    @return {String} A string containing the array elements in a readable format
+    @description Creates a string containing the array elements in a readable format
+    @param {Array} array The array to humanize
+  */
+  this.humanize = function (array) {
+    // If array only has one item then just return it
+    if (array.length <= 1) {
+      return String(array);
+    }
+
+    var last = array.pop()
+      , items = array.join(', ');
+
+    return items + ' and ' + last;
+  };
+
+  /**
+    @name array#included
+    @public
+    @function
+    @return {Array/Boolean} If `item` is included the `array` is
+      returned otherwise false
+    @description Checks if an `item` is included in an `array`
+    @param {Any} item The item to look for
+    @param {Array} array The array to check
+  */
+  this.included = function (item, array) {
+    var result = array.indexOf(item);
+
+    if (result === -1) {
+      return false;
+    } else {
+      return array;
+    }
+  };
+
+  /**
+    @name array#include
+    @public
+    @function
+    @return {Boolean} Return true if the item is included in the array
+    @description Checks if an `item` is included in an `array`
+    @param {Array} array The array to check
+    @param {Any} item The item to look for
+  */
+  this.include = function (array, item) {
+    var res = -1;
+    if (typeof array.indexOf == 'function') {
+      res = array.indexOf(item);
+    }
+    else {
+      for (var i = 0, ii = array.length; i < ii; i++) {
+        if (array[i] == item) {
+          res = i;
+          break;
+        }
+      }
+    }
+    return res > -1;
+  };
+
+})();
+
+module.exports = array;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/async.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/async.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/async.js
new file mode 100644
index 0000000..06a7429
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/async.js
@@ -0,0 +1,291 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var async = {};
+
+/*
+AsyncChain -- performs a list of asynchronous calls in a desired order.
+Optional "last" method can be set to run after all the items in the
+chain have completed.
+
+  // Example usage
+  var asyncChain = new async.AsyncChain([
+    {
+      func: app.trainToBangkok,
+      args: [geddy, neil, alex],
+      callback: null, // No callback for this action
+    },
+    {
+      func: fs.readdir,
+      args: [geddy.config.dirname + '/thailand/express'],
+      callback: function (err, result) {
+        if (err) {
+          // Bail out completely
+          arguments.callee.chain.abort();
+        }
+        else if (result.theBest) {
+          // Don't run the next item in the chain; go directly
+          // to the 'last' method.
+          arguments.callee.chain.shortCircuit();
+        }
+        else {
+          // Otherwise do some other stuff and
+          // then go to the next link
+        }
+      }
+    },
+    {
+      func: child_process.exec,
+      args: ['ls ./'],
+      callback: this.hitTheStops
+    }
+  ]);
+
+  // Function to exec after all the links in the chain finish
+  asyncChain.last = function () { // Do some final stuff };
+
+  // Start the async-chain
+  asyncChain.run();
+
+*/
+async.execNonBlocking = function (func) {
+  if (typeof process != 'undefined' && typeof process.nextTick == 'function') {
+    process.nextTick(func);
+  }
+  else {
+    setTimeout(func, 0);
+  }
+};
+
+async.AsyncBase = new (function () {
+
+  this.init = function (chain) {
+    var item;
+    this.chain = [];
+    this.currentItem = null;
+    this.shortCircuited = false;
+    this.shortCircuitedArgs = undefined;
+    this.aborted = false;
+
+    for (var i = 0; i < chain.length; i++) {
+      item = chain[i];
+      this.chain.push(new async.AsyncCall(
+          item.func, item.args, item.callback, item.context));
+    }
+  };
+
+  this.runItem = function (item) {
+    // Reference to the current item in the chain -- used
+    // to look up the callback to execute with execCallback
+    this.currentItem = item;
+    // Scopage
+    var _this = this;
+    // Pass the arguments passed to the current async call
+    // to the callback executor, execute it in the correct scope
+    var executor = function () {
+      _this.execCallback.apply(_this, arguments);
+    };
+    // Append the callback executor to the end of the arguments
+    // Node helpfully always has the callback func last
+    var args = item.args.concat(executor);
+    var func = item.func;
+    // Run the async call
+    func.apply(item.context, args);
+  };
+
+  this.next = function () {
+    if (this.chain.length) {
+      this.runItem(this.chain.shift());
+    }
+    else {
+      this.last();
+    }
+  };
+
+  this.execCallback = function () {
+    // Look up the callback, if any, specified for this async call
+    var callback = this.currentItem.callback;
+    // If there's a callback, do it
+    if (callback && typeof callback == 'function') {
+      // Allow access to the chain from inside the callback by setting
+      // callback.chain = this, and then using arguments.callee.chain
+      callback.chain = this;
+      callback.apply(this.currentItem.context, arguments);
+    }
+
+    this.currentItem.finished = true;
+
+    // If one of the async callbacks called chain.shortCircuit,
+    // skip to the 'last' function for the chain
+    if (this.shortCircuited) {
+      this.last.apply(null, this.shortCircuitedArgs);
+    }
+    // If one of the async callbacks called chain.abort,
+    // bail completely out
+    else if (this.aborted) {
+      return;
+    }
+    // Otherwise run the next item, if any, in the chain
+    // Let's try not to block if we don't have to
+    else {
+      // Scopage
+      var _this = this;
+      async.execNonBlocking(function () { _this.next.call(_this); });
+    }
+  }
+
+  // Short-circuit the chain, jump straight to the 'last' function
+  this.shortCircuit = function () {
+    this.shortCircuitedArgs = arguments;
+    this.shortCircuited = true;
+  }
+
+  // Stop execution of the chain, bail completely out
+  this.abort = function () {
+    this.aborted = true;
+  }
+
+  // Kick off the chain by grabbing the first item and running it
+  this.run = this.next;
+
+  // Function to run when the chain is done -- default is a no-op
+  this.last = function () {};
+
+})();
+
+async.AsyncChain = function (chain) {
+  this.init(chain);
+};
+
+async.AsyncChain.prototype = async.AsyncBase;
+
+async.AsyncGroup = function (group) {
+  var item;
+  var callback;
+  var args;
+
+  this.group = [];
+  this.outstandingCount = 0;
+
+  for (var i = 0; i < group.length; i++) {
+    item = group[i];
+    this.group.push(new async.AsyncCall(
+        item.func, item.args, item.callback, item.context));
+    this.outstandingCount++;
+  }
+
+};
+
+/*
+Simpler way to group async calls -- doesn't ensure completion order,
+but still has a "last" method called when the entire group of calls
+have completed.
+*/
+async.AsyncGroup.prototype = new function () {
+  this.run = function () {
+    var _this = this
+      , group = this.group
+      , item
+      , createItem = function (item, args) {
+          return function () {
+            item.func.apply(item.context, args);
+          };
+        }
+      , createCallback = function (item) {
+          return function () {
+            if (item.callback) {
+              item.callback.apply(null, arguments);
+            }
+            _this.finish.call(_this);
+          }
+        };
+
+    for (var i = 0; i < group.length; i++) {
+      item = group[i];
+      callback = createCallback(item);
+      args = item.args.concat(callback);
+      // Run the async call
+      async.execNonBlocking(createItem(item, args));
+    }
+  };
+
+  this.finish = function () {
+    this.outstandingCount--;
+    if (!this.outstandingCount) {
+      this.last();
+    };
+  };
+
+  this.last = function () {};
+
+};
+
+var _createSimpleAsyncCall = function (func, context) {
+  return {
+    func: func
+  , args: []
+  , callback: function () {}
+  , context: context
+  };
+};
+
+async.SimpleAsyncChain = function (funcs, context) {
+  chain = [];
+  for (var i = 0, ii = funcs.length; i < ii; i++) {
+    chain.push(_createSimpleAsyncCall(funcs[i], context));
+  }
+  this.init(chain);
+};
+
+async.SimpleAsyncChain.prototype = async.AsyncBase;
+
+async.AsyncCall = function (func, args, callback, context) {
+  this.func = func;
+  this.args = args;
+  this.callback = callback || null;
+  this.context = context || null;
+};
+
+async.Initializer = function (steps, callback) {
+  var self = this;
+  this.steps = {};
+  this.callback = callback;
+  // Create an object-literal of the steps to tick off
+  steps.forEach(function (step) {
+    self.steps[step] = false;
+  });
+};
+
+async.Initializer.prototype = new (function () {
+  this.complete = function (step) {
+    var steps = this.steps;
+    // Tick this step off
+    steps[step] = true;
+    // Iterate the steps -- if any are not done, bail out
+    for (var p in steps) {
+      if (!steps[p]) {
+        return false;
+      }
+    }
+    // If all steps are done, run the callback
+    this.callback();
+  };
+})();
+
+module.exports = async;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/core.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/core.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/core.js
new file mode 100644
index 0000000..5b4e44b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/core.js
@@ -0,0 +1,106 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var core = new (function () {
+
+  var _mix = function (targ, src, merge, includeProto) {
+    for (var p in src) {
+      // Don't copy stuff from the prototype
+      if (src.hasOwnProperty(p) || includeProto) {
+        if (merge &&
+            // Assumes the source property is an Object you can
+            // actually recurse down into
+            (typeof src[p] == 'object') &&
+            (src[p] !== null) &&
+            !(src[p] instanceof Array)) {
+          // Create the source property if it doesn't exist
+          // TODO: What if it's something weird like a String or Number?
+          if (typeof targ[p] == 'undefined') {
+            targ[p] = {};
+          }
+          _mix(targ[p], src[p], merge, includeProto); // Recurse
+        }
+        // If it's not a merge-copy, just set and forget
+        else {
+          targ[p] = src[p];
+        }
+      }
+    }
+  };
+
+  /*
+   * Mix in the properties on an object to another object
+   * yam.mixin(target, source, [source,] [source, etc.] [merge-flag]);
+   * 'merge' recurses, to merge object sub-properties together instead
+   * of just overwriting with the source object.
+   */
+  this.mixin = function () {
+    var args = Array.prototype.slice.apply(arguments),
+        merge = false,
+        targ, sources;
+    if (args.length > 2) {
+      if (typeof args[args.length - 1] == 'boolean') {
+        merge = args.pop();
+      }
+    }
+    targ = args.shift();
+    sources = args;
+    for (var i = 0, ii = sources.length; i < ii; i++) {
+      _mix(targ, sources[i], merge);
+    }
+    return targ;
+  };
+
+  this.enhance = function () {
+    var args = Array.prototype.slice.apply(arguments),
+        merge = false,
+        targ, sources;
+    if (args.length > 2) {
+      if (typeof args[args.length - 1] == 'boolean') {
+        merge = args.pop();
+      }
+    }
+    targ = args.shift();
+    sources = args;
+    for (var i = 0, ii = sources.length; i < ii; i++) {
+      _mix(targ, sources[i], merge, true);
+    }
+    return targ;
+  };
+
+  // Idea to add invalid number & Date from Michael J. Ryan,
+  // http://frugalcoder.us/post/2010/02/15/js-is-empty.aspx
+  this.isEmpty = function (val) {
+    // Empty string, null or undefined (these two are double-equal)
+    if (val === '' || val == undefined) {
+      return true;
+    }
+    // Invalid numerics
+    if (typeof val == 'number' && isNaN(val)) {
+      return true;
+    }
+    // Invalid Dates
+    if (val instanceof Date && isNaN(val.getTime())) {
+      return true;
+    }
+    return false;
+  };
+
+})();
+
+module.exports = core;


[05/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/LICENSE b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/LICENSE
new file mode 100755
index 0000000..b6ad6d3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/LICENSE
@@ -0,0 +1,22 @@
+The MIT License
+
+Copyright (c) 2010 Adam Abrons and Misko Hevery http://getangular.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/README.md b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/README.md
new file mode 100644
index 0000000..494c0f6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/README.md
@@ -0,0 +1,34 @@
+jasmine-node
+======
+
+This node.js module makes the wonderful Pivotal Lab's jasmine
+(http://github.com/pivotal/jasmine) spec framework available in
+node.js.
+
+usage
+------
+
+Write the specifications for your code in *.js and *.coffee files in the 
+spec/ directory (note: your specification files must end with either 
+.spec.js or .spec.coffee; otherwise jasmine-node won't find them!). You 
+can use sub-directories to better organise your specs.
+
+If you have installed the npm package, you can run it with:
+
+    jasmine-node
+
+If you aren't using npm, you should add `pwd`/lib to the $NODE_PATH
+environment variable, then run:
+
+    node lib/jasmine-node/cli.js
+
+
+You can supply the following arguments:
+
+  * <code>--coffee</code>, allow execution of .coffee specs
+  * <code>--color</code>, indicates spec output should uses color to
+indicates passing (green) or failing (red) specs
+  * <code>--noColor</code>, do not use color in the output
+  * <code>--verbose</code>, verbose output as the specs are run
+
+Checkout spec/SampleSpecs.js to see how to use it.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/bin/jasmine-node
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/bin/jasmine-node b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/bin/jasmine-node
new file mode 100755
index 0000000..86e4492
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/bin/jasmine-node
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+if( !process.env.NODE_ENV ) process.env.NODE_ENV = 'test';
+
+var path = require('path');
+var fs   = require('fs');
+require(path.join(__dirname,'../lib/jasmine-node/cli.js'));

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/cli.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/cli.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/cli.js
new file mode 100755
index 0000000..188b255
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/cli.js
@@ -0,0 +1,94 @@
+var jasmine = require('./index');
+var sys = require('sys'),
+    Path= require('path');
+
+
+var specFolder = null;
+
+for (var key in jasmine)
+  global[key] = jasmine[key];
+
+var isVerbose = false;
+var showColors = true;
+var extentions = "js";
+var match = '.'
+
+var args = process.argv.slice(2);
+
+while(args.length) {
+  var arg = args.shift();
+
+  switch(arg)
+  {
+    case '--color':
+      showColors = true;
+      break;
+    case '--noColor':
+      showColors = false;
+      break;
+    case '--verbose':
+      isVerbose = true;
+      break;
+    case '--coffee':
+      require('coffee-script');
+      extentions = "js|coffee";
+      break;
+    case '-m':
+    case '--match':
+      match = args.shift();
+      break;
+    case '-i':
+    case '--include':
+      var dir = args.shift();
+
+      if(!Path.existsSync(dir))
+        throw new Error("Include path '" + dir + "' doesn't exist!");
+
+      require.paths.unshift(dir);
+      break;
+    default:
+      if (arg.match(/^--/)) help();
+      specFolder = Path.join(process.cwd(), arg);
+      break;
+  }
+}
+
+if (!specFolder) {
+  help();
+}
+
+var exitCode = 0;
+
+process.on("exit", onExit);
+
+function onExit() {
+  process.removeListener("exit", onExit);
+  process.exit(exitCode);
+}
+
+jasmine.loadHelpersInFolder(specFolder, new RegExp("[-_]helper\\.(" + extentions + ")$"));
+jasmine.executeSpecsInFolder(specFolder, function(runner, log){
+  sys.print('\n');
+  if (runner.results().failedCount == 0) {
+    exitCode = 0;
+  } else {
+    exitCode = 1;
+  }
+}, isVerbose, showColors, new RegExp(match + "spec\\.(" + extentions + ")$", 'i'));
+
+function help(){
+  sys.print([
+    'USAGE: jasmine-node [--color|--noColor] [--verbose] [--coffee] directory'
+  , ''
+  , 'Options:'
+  , '  --color            - use color coding for output'
+  , '  --noColor          - do not use color coding for output'
+  , '  -m, --match REGEXP - load only specs containing "REGEXPspec"'
+  , '  -i, --include DIR  - add given directory to node include paths'
+  , '  --verbose          - print extra information per each test run'
+  , '  --coffee           - load coffee-script which allows execution .coffee files'
+  , ''
+  ].join("\n"));
+
+  process.exit(1);
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/index.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/index.js
new file mode 100755
index 0000000..ff23d4e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/index.js
@@ -0,0 +1,147 @@
+
+var fs = require('fs');
+var sys = require('sys');
+var path = require('path');
+
+var filename = __dirname + '/jasmine-1.0.1.js';
+global.window = {
+  setTimeout: setTimeout,
+  clearTimeout: clearTimeout,
+  setInterval: setInterval,
+  clearInterval: clearInterval
+};
+
+var src = fs.readFileSync(filename);
+var jasmine;
+var minorVersion = process.version.match(/\d\.(\d)\.\d/)[1];
+switch (minorVersion) {
+  case "1":
+  case "2":
+    jasmine = process.compile(src + '\njasmine;', filename);
+    break;
+  default:
+    jasmine = require('vm').runInThisContext(src + "\njasmine;", filename);
+}
+
+delete global.window;
+
+jasmine.TerminalReporter = require('./reporter').TerminalReporter;
+
+jasmine.loadHelpersInFolder=function(folder, matcher)
+{
+  var helpers = [];
+
+  if(fs.statSync(folder).isDirectory()) {
+    helpers = jasmine.getAllSpecFiles(folder, matcher);
+  } else {
+    folder = path.dirname(folder);
+    helpers = jasmine.getAllSpecFiles(folder, matcher);
+  }
+
+  for (var i = 0, len = helpers.length; i < len; ++i)
+  {
+    var filename = helpers[i];
+    var helper= require(filename.replace(/\.*$/, ""));
+    for (var key in helper)
+      global[key]= helper[key];
+  }
+};
+
+jasmine.executeSpecsInFolder = function(folder, done, isVerbose, showColors, matcher) {
+  var fileMatcher = matcher || new RegExp(".(js)$", "i");
+  var colors = showColors || false;
+  var specs = [];
+
+  if (fs.statSync(folder).isDirectory()) {
+    specs = jasmine.getAllSpecFiles(folder, fileMatcher);
+  } else {
+    specs.push(folder);
+  }
+
+  for (var i = 0, len = specs.length; i < len; ++i){
+    var filename = specs[i];
+    require(filename.replace(/\.\w+$/, ""));
+  }
+
+  var jasmineEnv = jasmine.getEnv();
+  jasmineEnv.reporter = new jasmine.TerminalReporter({print:      sys.print,
+                                                      verbose:    isVerbose,
+                                                      color:      showColors,
+                                                      onComplete: done});
+  jasmineEnv.execute();
+};
+
+jasmine.getAllSpecFiles = function(dir, matcher){
+  var specs = [];
+  if (fs.statSync(dir).isFile() && dir.match(matcher)) {
+    specs.push(dir);
+  } else {
+    var files = fs.readdirSync(dir);
+    for (var i = 0, len = files.length; i < len; ++i){
+      var filename = dir + '/' + files[i];
+        // fs.fstatSync will pass ENOENT from stat(2) up
+        // the stack. That's not particularly useful right now,
+        // so try and continue...
+        try{
+          isFile = fs.statSync(filename).isFile();
+        }catch (err){
+          if(err.code === 'ENOENT'){
+            isFile = false;
+          }else{
+              throw err;
+          }
+        }
+        if (filename.match(matcher) && isFile){
+          specs.push(filename);
+        }else{
+          try{
+            isDir = fs.statSync(filename).isDirectory();
+          } catch (err) {
+            if(err.code === 'ENOENT'){
+              isDir = false;
+            }else{
+              throw err;
+            }
+          }
+          if (isDir){
+            var subfiles = this.getAllSpecFiles(filename, matcher);
+            subfiles.forEach(function(result){
+                specs.push(result);
+            });
+          }
+        }
+
+    }
+  }
+  return specs;
+};
+
+function now(){
+  return new Date().getTime();
+}
+
+jasmine.asyncSpecWait = function(){
+  var wait = jasmine.asyncSpecWait;
+  wait.start = now();
+  wait.done = false;
+  (function innerWait(){
+    waits(10);
+    runs(function() {
+      if (wait.start + wait.timeout < now()) {
+        expect('timeout waiting for spec').toBeNull();
+      } else if (wait.done) {
+        wait.done = false;
+      } else {
+        innerWait();
+      }
+    });
+  })();
+};
+jasmine.asyncSpecWait.timeout = 4 * 1000;
+jasmine.asyncSpecDone = function(){
+  jasmine.asyncSpecWait.done = true;
+};
+
+for ( var key in jasmine) {
+  exports[key] = jasmine[key];
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/jasmine-1.0.1.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/jasmine-1.0.1.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/jasmine-1.0.1.js
new file mode 100755
index 0000000..964f99e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/jasmine-1.0.1.js
@@ -0,0 +1,2421 @@
+/**
+ * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
+ *
+ * @namespace
+ */
+var jasmine = {};
+
+/**
+ * @private
+ */
+jasmine.unimplementedMethod_ = function() {
+  throw new Error("unimplemented method");
+};
+
+/**
+ * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
+ * a plain old variable and may be redefined by somebody else.
+ *
+ * @private
+ */
+jasmine.undefined = jasmine.___undefined___;
+
+/**
+ * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
+ *
+ */
+jasmine.DEFAULT_UPDATE_INTERVAL = 250;
+
+/**
+ * Default timeout interval in milliseconds for waitsFor() blocks.
+ */
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
+
+jasmine.getGlobal = function() {
+  function getGlobal() {
+    return this;
+  }
+
+  return getGlobal();
+};
+
+/**
+ * Allows for bound functions to be compared.  Internal use only.
+ *
+ * @ignore
+ * @private
+ * @param base {Object} bound 'this' for the function
+ * @param name {Function} function to find
+ */
+jasmine.bindOriginal_ = function(base, name) {
+  var original = base[name];
+  if (original.apply) {
+    return function() {
+      return original.apply(base, arguments);
+    };
+  } else {
+    // IE support
+    return jasmine.getGlobal()[name];
+  }
+};
+
+jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
+jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
+jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
+jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
+
+jasmine.MessageResult = function(values) {
+  this.type = 'log';
+  this.values = values;
+  this.trace = new Error(); // todo: test better
+};
+
+jasmine.MessageResult.prototype.toString = function() {
+  var text = "";
+  for(var i = 0; i < this.values.length; i++) {
+    if (i > 0) text += " ";
+    if (jasmine.isString_(this.values[i])) {
+      text += this.values[i];
+    } else {
+      text += jasmine.pp(this.values[i]);
+    }
+  }
+  return text;
+};
+
+jasmine.ExpectationResult = function(params) {
+  this.type = 'expect';
+  this.matcherName = params.matcherName;
+  this.passed_ = params.passed;
+  this.expected = params.expected;
+  this.actual = params.actual;
+
+  this.message = this.passed_ ? 'Passed.' : params.message;
+  this.trace = this.passed_ ? '' : new Error(this.message);
+};
+
+jasmine.ExpectationResult.prototype.toString = function () {
+  return this.message;
+};
+
+jasmine.ExpectationResult.prototype.passed = function () {
+  return this.passed_;
+};
+
+/**
+ * Getter for the Jasmine environment. Ensures one gets created
+ */
+jasmine.getEnv = function() {
+  return jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isArray_ = function(value) {
+  return jasmine.isA_("Array", value);  
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isString_ = function(value) {
+  return jasmine.isA_("String", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isNumber_ = function(value) {
+  return jasmine.isA_("Number", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param {String} typeName
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isA_ = function(typeName, value) {
+  return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
+};
+
+/**
+ * Pretty printer for expecations.  Takes any object and turns it into a human-readable string.
+ *
+ * @param value {Object} an object to be outputted
+ * @returns {String}
+ */
+jasmine.pp = function(value) {
+  var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
+  stringPrettyPrinter.format(value);
+  return stringPrettyPrinter.string;
+};
+
+/**
+ * Returns true if the object is a DOM Node.
+ *
+ * @param {Object} obj object to check
+ * @returns {Boolean}
+ */
+jasmine.isDomNode = function(obj) {
+  return obj['nodeType'] > 0;
+};
+
+/**
+ * Returns a matchable 'generic' object of the class type.  For use in expecations of type when values don't matter.
+ *
+ * @example
+ * // don't care about which function is passed in, as long as it's a function
+ * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
+ *
+ * @param {Class} clazz
+ * @returns matchable object of the type clazz
+ */
+jasmine.any = function(clazz) {
+  return new jasmine.Matchers.Any(clazz);
+};
+
+/**
+ * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
+ *
+ * Spies should be created in test setup, before expectations.  They can then be checked, using the standard Jasmine
+ * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
+ *
+ * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
+ *
+ * Spies are torn down at the end of every spec.
+ *
+ * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
+ *
+ * @example
+ * // a stub
+ * var myStub = jasmine.createSpy('myStub');  // can be used anywhere
+ *
+ * // spy example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ *
+ * // actual foo.not will not be called, execution stops
+ * spyOn(foo, 'not');
+
+ // foo.not spied upon, execution will continue to implementation
+ * spyOn(foo, 'not').andCallThrough();
+ *
+ * // fake example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ *
+ * // foo.not(val) will return val
+ * spyOn(foo, 'not').andCallFake(function(value) {return value;});
+ *
+ * // mock example
+ * foo.not(7 == 7);
+ * expect(foo.not).toHaveBeenCalled();
+ * expect(foo.not).toHaveBeenCalledWith(true);
+ *
+ * @constructor
+ * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
+ * @param {String} name
+ */
+jasmine.Spy = function(name) {
+  /**
+   * The name of the spy, if provided.
+   */
+  this.identity = name || 'unknown';
+  /**
+   *  Is this Object a spy?
+   */
+  this.isSpy = true;
+  /**
+   * The actual function this spy stubs.
+   */
+  this.plan = function() {
+  };
+  /**
+   * Tracking of the most recent call to the spy.
+   * @example
+   * var mySpy = jasmine.createSpy('foo');
+   * mySpy(1, 2);
+   * mySpy.mostRecentCall.args = [1, 2];
+   */
+  this.mostRecentCall = {};
+
+  /**
+   * Holds arguments for each call to the spy, indexed by call count
+   * @example
+   * var mySpy = jasmine.createSpy('foo');
+   * mySpy(1, 2);
+   * mySpy(7, 8);
+   * mySpy.mostRecentCall.args = [7, 8];
+   * mySpy.argsForCall[0] = [1, 2];
+   * mySpy.argsForCall[1] = [7, 8];
+   */
+  this.argsForCall = [];
+  this.calls = [];
+};
+
+/**
+ * Tells a spy to call through to the actual implemenatation.
+ *
+ * @example
+ * var foo = {
+ *   bar: function() { // do some stuff }
+ * }
+ *
+ * // defining a spy on an existing property: foo.bar
+ * spyOn(foo, 'bar').andCallThrough();
+ */
+jasmine.Spy.prototype.andCallThrough = function() {
+  this.plan = this.originalValue;
+  return this;
+};
+
+/**
+ * For setting the return value of a spy.
+ *
+ * @example
+ * // defining a spy from scratch: foo() returns 'baz'
+ * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
+ *
+ * // defining a spy on an existing property: foo.bar() returns 'baz'
+ * spyOn(foo, 'bar').andReturn('baz');
+ *
+ * @param {Object} value
+ */
+jasmine.Spy.prototype.andReturn = function(value) {
+  this.plan = function() {
+    return value;
+  };
+  return this;
+};
+
+/**
+ * For throwing an exception when a spy is called.
+ *
+ * @example
+ * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
+ * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
+ *
+ * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
+ * spyOn(foo, 'bar').andThrow('baz');
+ *
+ * @param {String} exceptionMsg
+ */
+jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
+  this.plan = function() {
+    throw exceptionMsg;
+  };
+  return this;
+};
+
+/**
+ * Calls an alternate implementation when a spy is called.
+ *
+ * @example
+ * var baz = function() {
+ *   // do some stuff, return something
+ * }
+ * // defining a spy from scratch: foo() calls the function baz
+ * var foo = jasmine.createSpy('spy on foo').andCall(baz);
+ *
+ * // defining a spy on an existing property: foo.bar() calls an anonymnous function
+ * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
+ *
+ * @param {Function} fakeFunc
+ */
+jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
+  this.plan = fakeFunc;
+  return this;
+};
+
+/**
+ * Resets all of a spy's the tracking variables so that it can be used again.
+ *
+ * @example
+ * spyOn(foo, 'bar');
+ *
+ * foo.bar();
+ *
+ * expect(foo.bar.callCount).toEqual(1);
+ *
+ * foo.bar.reset();
+ *
+ * expect(foo.bar.callCount).toEqual(0);
+ */
+jasmine.Spy.prototype.reset = function() {
+  this.wasCalled = false;
+  this.callCount = 0;
+  this.argsForCall = [];
+  this.calls = [];
+  this.mostRecentCall = {};
+};
+
+jasmine.createSpy = function(name) {
+
+  var spyObj = function() {
+    spyObj.wasCalled = true;
+    spyObj.callCount++;
+    var args = jasmine.util.argsToArray(arguments);
+    spyObj.mostRecentCall.object = this;
+    spyObj.mostRecentCall.args = args;
+    spyObj.argsForCall.push(args);
+    spyObj.calls.push({object: this, args: args});
+    return spyObj.plan.apply(this, arguments);
+  };
+
+  var spy = new jasmine.Spy(name);
+
+  for (var prop in spy) {
+    spyObj[prop] = spy[prop];
+  }
+
+  spyObj.reset();
+
+  return spyObj;
+};
+
+/**
+ * Determines whether an object is a spy.
+ *
+ * @param {jasmine.Spy|Object} putativeSpy
+ * @returns {Boolean}
+ */
+jasmine.isSpy = function(putativeSpy) {
+  return putativeSpy && putativeSpy.isSpy;
+};
+
+/**
+ * Creates a more complicated spy: an Object that has every property a function that is a spy.  Used for stubbing something
+ * large in one call.
+ *
+ * @param {String} baseName name of spy class
+ * @param {Array} methodNames array of names of methods to make spies
+ */
+jasmine.createSpyObj = function(baseName, methodNames) {
+  if (!jasmine.isArray_(methodNames) || methodNames.length == 0) {
+    throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
+  }
+  var obj = {};
+  for (var i = 0; i < methodNames.length; i++) {
+    obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
+  }
+  return obj;
+};
+
+/**
+ * All parameters are pretty-printed and concatenated together, then written to the current spec's output.
+ *
+ * Be careful not to leave calls to <code>jasmine.log</code> in production code.
+ */
+jasmine.log = function() {
+  var spec = jasmine.getEnv().currentSpec;
+  spec.log.apply(spec, arguments);
+};
+
+/**
+ * Function that installs a spy on an existing object's method name.  Used within a Spec to create a spy.
+ *
+ * @example
+ * // spy example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
+ *
+ * @see jasmine.createSpy
+ * @param obj
+ * @param methodName
+ * @returns a Jasmine spy that can be chained with all spy methods
+ */
+var spyOn = function(obj, methodName) {
+  return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
+};
+
+/**
+ * Creates a Jasmine spec that will be added to the current suite.
+ *
+ * // TODO: pending tests
+ *
+ * @example
+ * it('should be true', function() {
+ *   expect(true).toEqual(true);
+ * });
+ *
+ * @param {String} desc description of this specification
+ * @param {Function} func defines the preconditions and expectations of the spec
+ */
+var it = function(desc, func) {
+  return jasmine.getEnv().it(desc, func);
+};
+
+/**
+ * Creates a <em>disabled</em> Jasmine spec.
+ *
+ * A convenience method that allows existing specs to be disabled temporarily during development.
+ *
+ * @param {String} desc description of this specification
+ * @param {Function} func defines the preconditions and expectations of the spec
+ */
+var xit = function(desc, func) {
+  return jasmine.getEnv().xit(desc, func);
+};
+
+/**
+ * Starts a chain for a Jasmine expectation.
+ *
+ * It is passed an Object that is the actual value and should chain to one of the many
+ * jasmine.Matchers functions.
+ *
+ * @param {Object} actual Actual value to test against and expected value
+ */
+var expect = function(actual) {
+  return jasmine.getEnv().currentSpec.expect(actual);
+};
+
+/**
+ * Defines part of a jasmine spec.  Used in cominbination with waits or waitsFor in asynchrnous specs.
+ *
+ * @param {Function} func Function that defines part of a jasmine spec.
+ */
+var runs = function(func) {
+  jasmine.getEnv().currentSpec.runs(func);
+};
+
+/**
+ * Waits a fixed time period before moving to the next block.
+ *
+ * @deprecated Use waitsFor() instead
+ * @param {Number} timeout milliseconds to wait
+ */
+var waits = function(timeout) {
+  jasmine.getEnv().currentSpec.waits(timeout);
+};
+
+/**
+ * Waits for the latchFunction to return true before proceeding to the next block.
+ *
+ * @param {Function} latchFunction
+ * @param {String} optional_timeoutMessage
+ * @param {Number} optional_timeout
+ */
+var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
+  jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
+};
+
+/**
+ * A function that is called before each spec in a suite.
+ *
+ * Used for spec setup, including validating assumptions.
+ *
+ * @param {Function} beforeEachFunction
+ */
+var beforeEach = function(beforeEachFunction) {
+  jasmine.getEnv().beforeEach(beforeEachFunction);
+};
+
+/**
+ * A function that is called after each spec in a suite.
+ *
+ * Used for restoring any state that is hijacked during spec execution.
+ *
+ * @param {Function} afterEachFunction
+ */
+var afterEach = function(afterEachFunction) {
+  jasmine.getEnv().afterEach(afterEachFunction);
+};
+
+/**
+ * Defines a suite of specifications.
+ *
+ * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
+ * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
+ * of setup in some tests.
+ *
+ * @example
+ * // TODO: a simple suite
+ *
+ * // TODO: a simple suite with a nested describe block
+ *
+ * @param {String} description A string, usually the class under test.
+ * @param {Function} specDefinitions function that defines several specs.
+ */
+var describe = function(description, specDefinitions) {
+  return jasmine.getEnv().describe(description, specDefinitions);
+};
+
+/**
+ * Disables a suite of specifications.  Used to disable some suites in a file, or files, temporarily during development.
+ *
+ * @param {String} description A string, usually the class under test.
+ * @param {Function} specDefinitions function that defines several specs.
+ */
+var xdescribe = function(description, specDefinitions) {
+  return jasmine.getEnv().xdescribe(description, specDefinitions);
+};
+
+
+// Provide the XMLHttpRequest class for IE 5.x-6.x:
+jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
+  try {
+    return new ActiveXObject("Msxml2.XMLHTTP.6.0");
+  } catch(e) {
+  }
+  try {
+    return new ActiveXObject("Msxml2.XMLHTTP.3.0");
+  } catch(e) {
+  }
+  try {
+    return new ActiveXObject("Msxml2.XMLHTTP");
+  } catch(e) {
+  }
+  try {
+    return new ActiveXObject("Microsoft.XMLHTTP");
+  } catch(e) {
+  }
+  throw new Error("This browser does not support XMLHttpRequest.");
+} : XMLHttpRequest;
+/**
+ * @namespace
+ */
+jasmine.util = {};
+
+/**
+ * Declare that a child class inherit it's prototype from the parent class.
+ *
+ * @private
+ * @param {Function} childClass
+ * @param {Function} parentClass
+ */
+jasmine.util.inherit = function(childClass, parentClass) {
+  /**
+   * @private
+   */
+  var subclass = function() {
+  };
+  subclass.prototype = parentClass.prototype;
+  childClass.prototype = new subclass;
+};
+
+jasmine.util.formatException = function(e) {
+  var lineNumber;
+  if (e.line) {
+    lineNumber = e.line;
+  }
+  else if (e.lineNumber) {
+    lineNumber = e.lineNumber;
+  }
+
+  var file;
+
+  if (e.sourceURL) {
+    file = e.sourceURL;
+  }
+  else if (e.fileName) {
+    file = e.fileName;
+  }
+
+  var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
+
+  if (file && lineNumber) {
+    message += ' in ' + file + ' (line ' + lineNumber + ')';
+  }
+
+  return message;
+};
+
+jasmine.util.htmlEscape = function(str) {
+  if (!str) return str;
+  return str.replace(/&/g, '&amp;')
+    .replace(/</g, '&lt;')
+    .replace(/>/g, '&gt;');
+};
+
+jasmine.util.argsToArray = function(args) {
+  var arrayOfArgs = [];
+  for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
+  return arrayOfArgs;
+};
+
+jasmine.util.extend = function(destination, source) {
+  for (var property in source) destination[property] = source[property];
+  return destination;
+};
+
+/**
+ * Environment for Jasmine
+ *
+ * @constructor
+ */
+jasmine.Env = function() {
+  this.currentSpec = null;
+  this.currentSuite = null;
+  this.currentRunner_ = new jasmine.Runner(this);
+
+  this.reporter = new jasmine.MultiReporter();
+
+  this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
+  this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
+  this.lastUpdate = 0;
+  this.specFilter = function() {
+    return true;
+  };
+
+  this.nextSpecId_ = 0;
+  this.nextSuiteId_ = 0;
+  this.equalityTesters_ = [];
+
+  // wrap matchers
+  this.matchersClass = function() {
+    jasmine.Matchers.apply(this, arguments);
+  };
+  jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
+
+  jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
+};
+
+
+jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
+jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
+jasmine.Env.prototype.setInterval = jasmine.setInterval;
+jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
+
+/**
+ * @returns an object containing jasmine version build info, if set.
+ */
+jasmine.Env.prototype.version = function () {
+  if (jasmine.version_) {
+    return jasmine.version_;
+  } else {
+    throw new Error('Version not set');
+  }
+};
+
+/**
+ * @returns string containing jasmine version build info, if set.
+ */
+jasmine.Env.prototype.versionString = function() {
+  if (jasmine.version_) {
+    var version = this.version();
+    return version.major + "." + version.minor + "." + version.build + " revision " + version.revision;
+  } else {
+    return "version unknown";
+  }
+};
+
+/**
+ * @returns a sequential integer starting at 0
+ */
+jasmine.Env.prototype.nextSpecId = function () {
+  return this.nextSpecId_++;
+};
+
+/**
+ * @returns a sequential integer starting at 0
+ */
+jasmine.Env.prototype.nextSuiteId = function () {
+  return this.nextSuiteId_++;
+};
+
+/**
+ * Register a reporter to receive status updates from Jasmine.
+ * @param {jasmine.Reporter} reporter An object which will receive status updates.
+ */
+jasmine.Env.prototype.addReporter = function(reporter) {
+  this.reporter.addReporter(reporter);
+};
+
+jasmine.Env.prototype.execute = function() {
+  this.currentRunner_.execute();
+};
+
+jasmine.Env.prototype.describe = function(description, specDefinitions) {
+  var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
+
+  var parentSuite = this.currentSuite;
+  if (parentSuite) {
+    parentSuite.add(suite);
+  } else {
+    this.currentRunner_.add(suite);
+  }
+
+  this.currentSuite = suite;
+
+  var declarationError = null;
+  try {
+    specDefinitions.call(suite);
+  } catch(e) {
+    declarationError = e;
+  }
+
+  this.currentSuite = parentSuite;
+
+  if (declarationError) {
+    this.it("encountered a declaration exception", function() {
+      throw declarationError;
+    });
+  }
+
+  return suite;
+};
+
+jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
+  if (this.currentSuite) {
+    this.currentSuite.beforeEach(beforeEachFunction);
+  } else {
+    this.currentRunner_.beforeEach(beforeEachFunction);
+  }
+};
+
+jasmine.Env.prototype.currentRunner = function () {
+  return this.currentRunner_;
+};
+
+jasmine.Env.prototype.afterEach = function(afterEachFunction) {
+  if (this.currentSuite) {
+    this.currentSuite.afterEach(afterEachFunction);
+  } else {
+    this.currentRunner_.afterEach(afterEachFunction);
+  }
+
+};
+
+jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
+  return {
+    execute: function() {
+    }
+  };
+};
+
+jasmine.Env.prototype.it = function(description, func) {
+  var spec = new jasmine.Spec(this, this.currentSuite, description);
+  this.currentSuite.add(spec);
+  this.currentSpec = spec;
+
+  if (func) {
+    spec.runs(func);
+  }
+
+  return spec;
+};
+
+jasmine.Env.prototype.xit = function(desc, func) {
+  return {
+    id: this.nextSpecId(),
+    runs: function() {
+    }
+  };
+};
+
+jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
+  if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
+    return true;
+  }
+
+  a.__Jasmine_been_here_before__ = b;
+  b.__Jasmine_been_here_before__ = a;
+
+  var hasKey = function(obj, keyName) {
+    return obj != null && obj[keyName] !== jasmine.undefined;
+  };
+
+  for (var property in b) {
+    if (!hasKey(a, property) && hasKey(b, property)) {
+      mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
+    }
+  }
+  for (property in a) {
+    if (!hasKey(b, property) && hasKey(a, property)) {
+      mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
+    }
+  }
+  for (property in b) {
+    if (property == '__Jasmine_been_here_before__') continue;
+    if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
+      mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
+    }
+  }
+
+  if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
+    mismatchValues.push("arrays were not the same length");
+  }
+
+  delete a.__Jasmine_been_here_before__;
+  delete b.__Jasmine_been_here_before__;
+  return (mismatchKeys.length == 0 && mismatchValues.length == 0);
+};
+
+jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
+  mismatchKeys = mismatchKeys || [];
+  mismatchValues = mismatchValues || [];
+
+  for (var i = 0; i < this.equalityTesters_.length; i++) {
+    var equalityTester = this.equalityTesters_[i];
+    var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
+    if (result !== jasmine.undefined) return result;
+  }
+
+  if (a === b) return true;
+
+  if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
+    return (a == jasmine.undefined && b == jasmine.undefined);
+  }
+
+  if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
+    return a === b;
+  }
+
+  if (a instanceof Date && b instanceof Date) {
+    return a.getTime() == b.getTime();
+  }
+
+  if (a instanceof jasmine.Matchers.Any) {
+    return a.matches(b);
+  }
+
+  if (b instanceof jasmine.Matchers.Any) {
+    return b.matches(a);
+  }
+
+  if (jasmine.isString_(a) && jasmine.isString_(b)) {
+    return (a == b);
+  }
+
+  if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
+    return (a == b);
+  }
+
+  if (typeof a === "object" && typeof b === "object") {
+    return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
+  }
+
+  //Straight check
+  return (a === b);
+};
+
+jasmine.Env.prototype.contains_ = function(haystack, needle) {
+  if (jasmine.isArray_(haystack)) {
+    for (var i = 0; i < haystack.length; i++) {
+      if (this.equals_(haystack[i], needle)) return true;
+    }
+    return false;
+  }
+  return haystack.indexOf(needle) >= 0;
+};
+
+jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
+  this.equalityTesters_.push(equalityTester);
+};
+/** No-op base class for Jasmine reporters.
+ *
+ * @constructor
+ */
+jasmine.Reporter = function() {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSpecResults = function(spec) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.log = function(str) {
+};
+
+/**
+ * Blocks are functions with executable code that make up a spec.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {Function} func
+ * @param {jasmine.Spec} spec
+ */
+jasmine.Block = function(env, func, spec) {
+  this.env = env;
+  this.func = func;
+  this.spec = spec;
+};
+
+jasmine.Block.prototype.execute = function(onComplete) {  
+  try {
+    this.func.apply(this.spec);
+  } catch (e) {
+    this.spec.fail(e);
+  }
+  onComplete();
+};
+/** JavaScript API reporter.
+ *
+ * @constructor
+ */
+jasmine.JsApiReporter = function() {
+  this.started = false;
+  this.finished = false;
+  this.suites_ = [];
+  this.results_ = {};
+};
+
+jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
+  this.started = true;
+  var suites = runner.topLevelSuites();
+  for (var i = 0; i < suites.length; i++) {
+    var suite = suites[i];
+    this.suites_.push(this.summarize_(suite));
+  }
+};
+
+jasmine.JsApiReporter.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
+  var isSuite = suiteOrSpec instanceof jasmine.Suite;
+  var summary = {
+    id: suiteOrSpec.id,
+    name: suiteOrSpec.description,
+    type: isSuite ? 'suite' : 'spec',
+    children: []
+  };
+  
+  if (isSuite) {
+    var children = suiteOrSpec.children();
+    for (var i = 0; i < children.length; i++) {
+      summary.children.push(this.summarize_(children[i]));
+    }
+  }
+  return summary;
+};
+
+jasmine.JsApiReporter.prototype.results = function() {
+  return this.results_;
+};
+
+jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
+  return this.results_[specId];
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
+  this.finished = true;
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
+  this.results_[spec.id] = {
+    messages: spec.results().getItems(),
+    result: spec.results().failedCount > 0 ? "failed" : "passed"
+  };
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.log = function(str) {
+};
+
+jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
+  var results = {};
+  for (var i = 0; i < specIds.length; i++) {
+    var specId = specIds[i];
+    results[specId] = this.summarizeResult_(this.results_[specId]);
+  }
+  return results;
+};
+
+jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
+  var summaryMessages = [];
+  var messagesLength = result.messages.length;
+  for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
+    var resultMessage = result.messages[messageIndex];
+    summaryMessages.push({
+      text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
+      passed: resultMessage.passed ? resultMessage.passed() : true,
+      type: resultMessage.type,
+      message: resultMessage.message,
+      trace: {
+        stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
+      }
+    });
+  }
+
+  return {
+    result : result.result,
+    messages : summaryMessages
+  };
+};
+
+/**
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param actual
+ * @param {jasmine.Spec} spec
+ */
+jasmine.Matchers = function(env, actual, spec, opt_isNot) {
+  this.env = env;
+  this.actual = actual;
+  this.spec = spec;
+  this.isNot = opt_isNot || false;
+  this.reportWasCalled_ = false;
+};
+
+// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
+jasmine.Matchers.pp = function(str) {
+  throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
+};
+
+// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
+jasmine.Matchers.prototype.report = function(result, failing_message, details) {
+  throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
+};
+
+jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
+  for (var methodName in prototype) {
+    if (methodName == 'report') continue;
+    var orig = prototype[methodName];
+    matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
+  }
+};
+
+jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
+  return function() {
+    var matcherArgs = jasmine.util.argsToArray(arguments);
+    var result = matcherFunction.apply(this, arguments);
+
+    if (this.isNot) {
+      result = !result;
+    }
+
+    if (this.reportWasCalled_) return result;
+
+    var message;
+    if (!result) {
+      if (this.message) {
+        message = this.message.apply(this, arguments);
+        if (jasmine.isArray_(message)) {
+          message = message[this.isNot ? 1 : 0];
+        }
+      } else {
+        var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
+        message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
+        if (matcherArgs.length > 0) {
+          for (var i = 0; i < matcherArgs.length; i++) {
+            if (i > 0) message += ",";
+            message += " " + jasmine.pp(matcherArgs[i]);
+          }
+        }
+        message += ".";
+      }
+    }
+    var expectationResult = new jasmine.ExpectationResult({
+      matcherName: matcherName,
+      passed: result,
+      expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
+      actual: this.actual,
+      message: message
+    });
+    this.spec.addMatcherResult(expectationResult);
+    return jasmine.undefined;
+  };
+};
+
+
+
+
+/**
+ * toBe: compares the actual to the expected using ===
+ * @param expected
+ */
+jasmine.Matchers.prototype.toBe = function(expected) {
+  return this.actual === expected;
+};
+
+/**
+ * toNotBe: compares the actual to the expected using !==
+ * @param expected
+ * @deprecated as of 1.0. Use not.toBe() instead.
+ */
+jasmine.Matchers.prototype.toNotBe = function(expected) {
+  return this.actual !== expected;
+};
+
+/**
+ * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
+ *
+ * @param expected
+ */
+jasmine.Matchers.prototype.toEqual = function(expected) {
+  return this.env.equals_(this.actual, expected);
+};
+
+/**
+ * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
+ * @param expected
+ * @deprecated as of 1.0. Use not.toNotEqual() instead.
+ */
+jasmine.Matchers.prototype.toNotEqual = function(expected) {
+  return !this.env.equals_(this.actual, expected);
+};
+
+/**
+ * Matcher that compares the actual to the expected using a regular expression.  Constructs a RegExp, so takes
+ * a pattern or a String.
+ *
+ * @param expected
+ */
+jasmine.Matchers.prototype.toMatch = function(expected) {
+  return new RegExp(expected).test(this.actual);
+};
+
+/**
+ * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
+ * @param expected
+ * @deprecated as of 1.0. Use not.toMatch() instead.
+ */
+jasmine.Matchers.prototype.toNotMatch = function(expected) {
+  return !(new RegExp(expected).test(this.actual));
+};
+
+/**
+ * Matcher that compares the actual to jasmine.undefined.
+ */
+jasmine.Matchers.prototype.toBeDefined = function() {
+  return (this.actual !== jasmine.undefined);
+};
+
+/**
+ * Matcher that compares the actual to jasmine.undefined.
+ */
+jasmine.Matchers.prototype.toBeUndefined = function() {
+  return (this.actual === jasmine.undefined);
+};
+
+/**
+ * Matcher that compares the actual to null.
+ */
+jasmine.Matchers.prototype.toBeNull = function() {
+  return (this.actual === null);
+};
+
+/**
+ * Matcher that boolean not-nots the actual.
+ */
+jasmine.Matchers.prototype.toBeTruthy = function() {
+  return !!this.actual;
+};
+
+
+/**
+ * Matcher that boolean nots the actual.
+ */
+jasmine.Matchers.prototype.toBeFalsy = function() {
+  return !this.actual;
+};
+
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was called.
+ */
+jasmine.Matchers.prototype.toHaveBeenCalled = function() {
+  if (arguments.length > 0) {
+    throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
+  }
+
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy " + this.actual.identity + " to have been called.",
+      "Expected spy " + this.actual.identity + " not to have been called."
+    ];
+  };
+
+  return this.actual.wasCalled;
+};
+
+/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
+jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was not called.
+ *
+ * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
+ */
+jasmine.Matchers.prototype.wasNotCalled = function() {
+  if (arguments.length > 0) {
+    throw new Error('wasNotCalled does not take arguments');
+  }
+
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy " + this.actual.identity + " to not have been called.",
+      "Expected spy " + this.actual.identity + " to have been called."
+    ];
+  };
+
+  return !this.actual.wasCalled;
+};
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
+ *
+ * @example
+ *
+ */
+jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
+  var expectedArgs = jasmine.util.argsToArray(arguments);
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+  this.message = function() {
+    if (this.actual.callCount == 0) {
+      // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
+      return [
+        "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
+        "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
+      ];
+    } else {
+      return [
+        "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
+        "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
+      ];
+    }
+  };
+
+  return this.env.contains_(this.actual.argsForCall, expectedArgs);
+};
+
+/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
+jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
+
+/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
+jasmine.Matchers.prototype.wasNotCalledWith = function() {
+  var expectedArgs = jasmine.util.argsToArray(arguments);
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
+      "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
+    ]
+  };
+
+  return !this.env.contains_(this.actual.argsForCall, expectedArgs);
+};
+
+/**
+ * Matcher that checks that the expected item is an element in the actual Array.
+ *
+ * @param {Object} expected
+ */
+jasmine.Matchers.prototype.toContain = function(expected) {
+  return this.env.contains_(this.actual, expected);
+};
+
+/**
+ * Matcher that checks that the expected item is NOT an element in the actual Array.
+ *
+ * @param {Object} expected
+ * @deprecated as of 1.0. Use not.toNotContain() instead.
+ */
+jasmine.Matchers.prototype.toNotContain = function(expected) {
+  return !this.env.contains_(this.actual, expected);
+};
+
+jasmine.Matchers.prototype.toBeLessThan = function(expected) {
+  return this.actual < expected;
+};
+
+jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
+  return this.actual > expected;
+};
+
+/**
+ * Matcher that checks that the expected exception was thrown by the actual.
+ *
+ * @param {String} expected
+ */
+jasmine.Matchers.prototype.toThrow = function(expected) {
+  var result = false;
+  var exception;
+  if (typeof this.actual != 'function') {
+    throw new Error('Actual is not a function');
+  }
+  try {
+    this.actual();
+  } catch (e) {
+    exception = e;
+  }
+  if (exception) {
+    result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
+  }
+
+  var not = this.isNot ? "not " : "";
+
+  this.message = function() {
+    if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
+      return ["Expected function " + not + "to throw", expected ? expected.message || expected : " an exception", ", but it threw", exception.message || exception].join(' ');
+    } else {
+      return "Expected function to throw an exception.";
+    }
+  };
+
+  return result;
+};
+
+jasmine.Matchers.Any = function(expectedClass) {
+  this.expectedClass = expectedClass;
+};
+
+jasmine.Matchers.Any.prototype.matches = function(other) {
+  if (this.expectedClass == String) {
+    return typeof other == 'string' || other instanceof String;
+  }
+
+  if (this.expectedClass == Number) {
+    return typeof other == 'number' || other instanceof Number;
+  }
+
+  if (this.expectedClass == Function) {
+    return typeof other == 'function' || other instanceof Function;
+  }
+
+  if (this.expectedClass == Object) {
+    return typeof other == 'object';
+  }
+
+  return other instanceof this.expectedClass;
+};
+
+jasmine.Matchers.Any.prototype.toString = function() {
+  return '<jasmine.any(' + this.expectedClass + ')>';
+};
+
+/**
+ * @constructor
+ */
+jasmine.MultiReporter = function() {
+  this.subReporters_ = [];
+};
+jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
+
+jasmine.MultiReporter.prototype.addReporter = function(reporter) {
+  this.subReporters_.push(reporter);
+};
+
+(function() {
+  var functionNames = [
+    "reportRunnerStarting",
+    "reportRunnerResults",
+    "reportSuiteResults",
+    "reportSpecStarting",
+    "reportSpecResults",
+    "log"
+  ];
+  for (var i = 0; i < functionNames.length; i++) {
+    var functionName = functionNames[i];
+    jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
+      return function() {
+        for (var j = 0; j < this.subReporters_.length; j++) {
+          var subReporter = this.subReporters_[j];
+          if (subReporter[functionName]) {
+            subReporter[functionName].apply(subReporter, arguments);
+          }
+        }
+      };
+    })(functionName);
+  }
+})();
+/**
+ * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
+ *
+ * @constructor
+ */
+jasmine.NestedResults = function() {
+  /**
+   * The total count of results
+   */
+  this.totalCount = 0;
+  /**
+   * Number of passed results
+   */
+  this.passedCount = 0;
+  /**
+   * Number of failed results
+   */
+  this.failedCount = 0;
+  /**
+   * Was this suite/spec skipped?
+   */
+  this.skipped = false;
+  /**
+   * @ignore
+   */
+  this.items_ = [];
+};
+
+/**
+ * Roll up the result counts.
+ *
+ * @param result
+ */
+jasmine.NestedResults.prototype.rollupCounts = function(result) {
+  this.totalCount += result.totalCount;
+  this.passedCount += result.passedCount;
+  this.failedCount += result.failedCount;
+};
+
+/**
+ * Adds a log message.
+ * @param values Array of message parts which will be concatenated later.
+ */
+jasmine.NestedResults.prototype.log = function(values) {
+  this.items_.push(new jasmine.MessageResult(values));
+};
+
+/**
+ * Getter for the results: message & results.
+ */
+jasmine.NestedResults.prototype.getItems = function() {
+  return this.items_;
+};
+
+/**
+ * Adds a result, tracking counts (total, passed, & failed)
+ * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
+ */
+jasmine.NestedResults.prototype.addResult = function(result) {
+  if (result.type != 'log') {
+    if (result.items_) {
+      this.rollupCounts(result);
+    } else {
+      this.totalCount++;
+      if (result.passed()) {
+        this.passedCount++;
+      } else {
+        this.failedCount++;
+      }
+    }
+  }
+  this.items_.push(result);
+};
+
+/**
+ * @returns {Boolean} True if <b>everything</b> below passed
+ */
+jasmine.NestedResults.prototype.passed = function() {
+  return this.passedCount === this.totalCount;
+};
+/**
+ * Base class for pretty printing for expectation results.
+ */
+jasmine.PrettyPrinter = function() {
+  this.ppNestLevel_ = 0;
+};
+
+/**
+ * Formats a value in a nice, human-readable string.
+ *
+ * @param value
+ */
+jasmine.PrettyPrinter.prototype.format = function(value) {
+  if (this.ppNestLevel_ > 40) {
+    throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
+  }
+
+  this.ppNestLevel_++;
+  try {
+    if (value === jasmine.undefined) {
+      this.emitScalar('undefined');
+    } else if (value === null) {
+      this.emitScalar('null');
+    } else if (value === jasmine.getGlobal()) {
+      this.emitScalar('<global>');
+    } else if (value instanceof jasmine.Matchers.Any) {
+      this.emitScalar(value.toString());
+    } else if (typeof value === 'string') {
+      this.emitString(value);
+    } else if (jasmine.isSpy(value)) {
+      this.emitScalar("spy on " + value.identity);
+    } else if (value instanceof RegExp) {
+      this.emitScalar(value.toString());
+    } else if (typeof value === 'function') {
+      this.emitScalar('Function');
+    } else if (typeof value.nodeType === 'number') {
+      this.emitScalar('HTMLNode');
+    } else if (value instanceof Date) {
+      this.emitScalar('Date(' + value + ')');
+    } else if (value.__Jasmine_been_here_before__) {
+      this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
+    } else if (jasmine.isArray_(value) || typeof value == 'object') {
+      value.__Jasmine_been_here_before__ = true;
+      if (jasmine.isArray_(value)) {
+        this.emitArray(value);
+      } else {
+        this.emitObject(value);
+      }
+      delete value.__Jasmine_been_here_before__;
+    } else {
+      this.emitScalar(value.toString());
+    }
+  } finally {
+    this.ppNestLevel_--;
+  }
+};
+
+jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
+  for (var property in obj) {
+    if (property == '__Jasmine_been_here_before__') continue;
+    fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) != null) : false);
+  }
+};
+
+jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
+
+jasmine.StringPrettyPrinter = function() {
+  jasmine.PrettyPrinter.call(this);
+
+  this.string = '';
+};
+jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
+
+jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
+  this.append(value);
+};
+
+jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
+  this.append("'" + value + "'");
+};
+
+jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
+  this.append('[ ');
+  for (var i = 0; i < array.length; i++) {
+    if (i > 0) {
+      this.append(', ');
+    }
+    this.format(array[i]);
+  }
+  this.append(' ]');
+};
+
+jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
+  var self = this;
+  this.append('{ ');
+  var first = true;
+
+  this.iterateObject(obj, function(property, isGetter) {
+    if (first) {
+      first = false;
+    } else {
+      self.append(', ');
+    }
+
+    self.append(property);
+    self.append(' : ');
+    if (isGetter) {
+      self.append('<getter>');
+    } else {
+      self.format(obj[property]);
+    }
+  });
+
+  this.append(' }');
+};
+
+jasmine.StringPrettyPrinter.prototype.append = function(value) {
+  this.string += value;
+};
+jasmine.Queue = function(env) {
+  this.env = env;
+  this.blocks = [];
+  this.running = false;
+  this.index = 0;
+  this.offset = 0;
+  this.abort = false;
+};
+
+jasmine.Queue.prototype.addBefore = function(block) {
+  this.blocks.unshift(block);
+};
+
+jasmine.Queue.prototype.add = function(block) {
+  this.blocks.push(block);
+};
+
+jasmine.Queue.prototype.insertNext = function(block) {
+  this.blocks.splice((this.index + this.offset + 1), 0, block);
+  this.offset++;
+};
+
+jasmine.Queue.prototype.start = function(onComplete) {
+  this.running = true;
+  this.onComplete = onComplete;
+  this.next_();
+};
+
+jasmine.Queue.prototype.isRunning = function() {
+  return this.running;
+};
+
+jasmine.Queue.LOOP_DONT_RECURSE = true;
+
+jasmine.Queue.prototype.next_ = function() {
+  var self = this;
+  var goAgain = true;
+
+  while (goAgain) {
+    goAgain = false;
+    
+    if (self.index < self.blocks.length && !this.abort) {
+      var calledSynchronously = true;
+      var completedSynchronously = false;
+
+      var onComplete = function () {
+        if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
+          completedSynchronously = true;
+          return;
+        }
+
+        if (self.blocks[self.index].abort) {
+          self.abort = true;
+        }
+
+        self.offset = 0;
+        self.index++;
+
+        var now = new Date().getTime();
+        if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
+          self.env.lastUpdate = now;
+          self.env.setTimeout(function() {
+            self.next_();
+          }, 0);
+        } else {
+          if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
+            goAgain = true;
+          } else {
+            self.next_();
+          }
+        }
+      };
+      self.blocks[self.index].execute(onComplete);
+
+      calledSynchronously = false;
+      if (completedSynchronously) {
+        onComplete();
+      }
+      
+    } else {
+      self.running = false;
+      if (self.onComplete) {
+        self.onComplete();
+      }
+    }
+  }
+};
+
+jasmine.Queue.prototype.results = function() {
+  var results = new jasmine.NestedResults();
+  for (var i = 0; i < this.blocks.length; i++) {
+    if (this.blocks[i].results) {
+      results.addResult(this.blocks[i].results());
+    }
+  }
+  return results;
+};
+
+
+/**
+ * Runner
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ */
+jasmine.Runner = function(env) {
+  var self = this;
+  self.env = env;
+  self.queue = new jasmine.Queue(env);
+  self.before_ = [];
+  self.after_ = [];
+  self.suites_ = [];
+};
+
+jasmine.Runner.prototype.execute = function() {
+  var self = this;
+  if (self.env.reporter.reportRunnerStarting) {
+    self.env.reporter.reportRunnerStarting(this);
+  }
+  self.queue.start(function () {
+    self.finishCallback();
+  });
+};
+
+jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
+  beforeEachFunction.typeName = 'beforeEach';
+  this.before_.splice(0,0,beforeEachFunction);
+};
+
+jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
+  afterEachFunction.typeName = 'afterEach';
+  this.after_.splice(0,0,afterEachFunction);
+};
+
+
+jasmine.Runner.prototype.finishCallback = function() {
+  this.env.reporter.reportRunnerResults(this);
+};
+
+jasmine.Runner.prototype.addSuite = function(suite) {
+  this.suites_.push(suite);
+};
+
+jasmine.Runner.prototype.add = function(block) {
+  if (block instanceof jasmine.Suite) {
+    this.addSuite(block);
+  }
+  this.queue.add(block);
+};
+
+jasmine.Runner.prototype.specs = function () {
+  var suites = this.suites();
+  var specs = [];
+  for (var i = 0; i < suites.length; i++) {
+    specs = specs.concat(suites[i].specs());
+  }
+  return specs;
+};
+
+jasmine.Runner.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.Runner.prototype.topLevelSuites = function() {
+  var topLevelSuites = [];
+  for (var i = 0; i < this.suites_.length; i++) {
+    if (!this.suites_[i].parentSuite) {
+      topLevelSuites.push(this.suites_[i]);
+    }
+  }
+  return topLevelSuites;
+};
+
+jasmine.Runner.prototype.results = function() {
+  return this.queue.results();
+};
+/**
+ * Internal representation of a Jasmine specification, or test.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {jasmine.Suite} suite
+ * @param {String} description
+ */
+jasmine.Spec = function(env, suite, description) {
+  if (!env) {
+    throw new Error('jasmine.Env() required');
+  }
+  if (!suite) {
+    throw new Error('jasmine.Suite() required');
+  }
+  var spec = this;
+  spec.id = env.nextSpecId ? env.nextSpecId() : null;
+  spec.env = env;
+  spec.suite = suite;
+  spec.description = description;
+  spec.queue = new jasmine.Queue(env);
+
+  spec.afterCallbacks = [];
+  spec.spies_ = [];
+
+  spec.results_ = new jasmine.NestedResults();
+  spec.results_.description = description;
+  spec.matchersClass = null;
+};
+
+jasmine.Spec.prototype.getFullName = function() {
+  return this.suite.getFullName() + ' ' + this.description + '.';
+};
+
+
+jasmine.Spec.prototype.results = function() {
+  return this.results_;
+};
+
+/**
+ * All parameters are pretty-printed and concatenated together, then written to the spec's output.
+ *
+ * Be careful not to leave calls to <code>jasmine.log</code> in production code.
+ */
+jasmine.Spec.prototype.log = function() {
+  return this.results_.log(arguments);
+};
+
+jasmine.Spec.prototype.runs = function (func) {
+  var block = new jasmine.Block(this.env, func, this);
+  this.addToQueue(block);
+  return this;
+};
+
+jasmine.Spec.prototype.addToQueue = function (block) {
+  if (this.queue.isRunning()) {
+    this.queue.insertNext(block);
+  } else {
+    this.queue.add(block);
+  }
+};
+
+/**
+ * @param {jasmine.ExpectationResult} result
+ */
+jasmine.Spec.prototype.addMatcherResult = function(result) {
+  this.results_.addResult(result);
+};
+
+jasmine.Spec.prototype.expect = function(actual) {
+  var positive = new (this.getMatchersClass_())(this.env, actual, this);
+  positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
+  return positive;
+};
+
+/**
+ * Waits a fixed time period before moving to the next block.
+ *
+ * @deprecated Use waitsFor() instead
+ * @param {Number} timeout milliseconds to wait
+ */
+jasmine.Spec.prototype.waits = function(timeout) {
+  var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
+  this.addToQueue(waitsFunc);
+  return this;
+};
+
+/**
+ * Waits for the latchFunction to return true before proceeding to the next block.
+ *
+ * @param {Function} latchFunction
+ * @param {String} optional_timeoutMessage
+ * @param {Number} optional_timeout
+ */
+jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
+  var latchFunction_ = null;
+  var optional_timeoutMessage_ = null;
+  var optional_timeout_ = null;
+
+  for (var i = 0; i < arguments.length; i++) {
+    var arg = arguments[i];
+    switch (typeof arg) {
+      case 'function':
+        latchFunction_ = arg;
+        break;
+      case 'string':
+        optional_timeoutMessage_ = arg;
+        break;
+      case 'number':
+        optional_timeout_ = arg;
+        break;
+    }
+  }
+
+  var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
+  this.addToQueue(waitsForFunc);
+  return this;
+};
+
+jasmine.Spec.prototype.fail = function (e) {
+  var expectationResult = new jasmine.ExpectationResult({
+    passed: false,
+    message: e ? jasmine.util.formatException(e) : 'Exception'
+  });
+  this.results_.addResult(expectationResult);
+};
+
+jasmine.Spec.prototype.getMatchersClass_ = function() {
+  return this.matchersClass || this.env.matchersClass;
+};
+
+jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
+  var parent = this.getMatchersClass_();
+  var newMatchersClass = function() {
+    parent.apply(this, arguments);
+  };
+  jasmine.util.inherit(newMatchersClass, parent);
+  jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
+  this.matchersClass = newMatchersClass;
+};
+
+jasmine.Spec.prototype.finishCallback = function() {
+  this.env.reporter.reportSpecResults(this);
+};
+
+jasmine.Spec.prototype.finish = function(onComplete) {
+  this.removeAllSpies();
+  this.finishCallback();
+  if (onComplete) {
+    onComplete();
+  }
+};
+
+jasmine.Spec.prototype.after = function(doAfter) {
+  if (this.queue.isRunning()) {
+    this.queue.add(new jasmine.Block(this.env, doAfter, this));
+  } else {
+    this.afterCallbacks.unshift(doAfter);
+  }
+};
+
+jasmine.Spec.prototype.execute = function(onComplete) {
+  var spec = this;
+  if (!spec.env.specFilter(spec)) {
+    spec.results_.skipped = true;
+    spec.finish(onComplete);
+    return;
+  }
+
+  this.env.reporter.reportSpecStarting(this);
+
+  spec.env.currentSpec = spec;
+
+  spec.addBeforesAndAftersToQueue();
+
+  spec.queue.start(function () {
+    spec.finish(onComplete);
+  });
+};
+
+jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
+  var runner = this.env.currentRunner();
+  var i;
+
+  for (var suite = this.suite; suite; suite = suite.parentSuite) {
+    for (i = 0; i < suite.before_.length; i++) {
+      this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
+    }
+  }
+  for (i = 0; i < runner.before_.length; i++) {
+    this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
+  }
+  for (i = 0; i < this.afterCallbacks.length; i++) {
+    this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
+  }
+  for (suite = this.suite; suite; suite = suite.parentSuite) {
+    for (i = 0; i < suite.after_.length; i++) {
+      this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
+    }
+  }
+  for (i = 0; i < runner.after_.length; i++) {
+    this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
+  }
+};
+
+jasmine.Spec.prototype.explodes = function() {
+  throw 'explodes function should not have been called';
+};
+
+jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
+  if (obj == jasmine.undefined) {
+    throw "spyOn could not find an object to spy upon for " + methodName + "()";
+  }
+
+  if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
+    throw methodName + '() method does not exist';
+  }
+
+  if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
+    throw new Error(methodName + ' has already been spied upon');
+  }
+
+  var spyObj = jasmine.createSpy(methodName);
+
+  this.spies_.push(spyObj);
+  spyObj.baseObj = obj;
+  spyObj.methodName = methodName;
+  spyObj.originalValue = obj[methodName];
+
+  obj[methodName] = spyObj;
+
+  return spyObj;
+};
+
+jasmine.Spec.prototype.removeAllSpies = function() {
+  for (var i = 0; i < this.spies_.length; i++) {
+    var spy = this.spies_[i];
+    spy.baseObj[spy.methodName] = spy.originalValue;
+  }
+  this.spies_ = [];
+};
+
+/**
+ * Internal representation of a Jasmine suite.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {String} description
+ * @param {Function} specDefinitions
+ * @param {jasmine.Suite} parentSuite
+ */
+jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
+  var self = this;
+  self.id = env.nextSuiteId ? env.nextSuiteId() : null;
+  self.description = description;
+  self.queue = new jasmine.Queue(env);
+  self.parentSuite = parentSuite;
+  self.env = env;
+  self.before_ = [];
+  self.after_ = [];
+  self.children_ = [];
+  self.suites_ = [];
+  self.specs_ = [];
+};
+
+jasmine.Suite.prototype.getFullName = function() {
+  var fullName = this.description;
+  for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
+    fullName = parentSuite.description + ' ' + fullName;
+  }
+  return fullName;
+};
+
+jasmine.Suite.prototype.finish = function(onComplete) {
+  this.env.reporter.reportSuiteResults(this);
+  this.finished = true;
+  if (typeof(onComplete) == 'function') {
+    onComplete();
+  }
+};
+
+jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
+  beforeEachFunction.typeName = 'beforeEach';
+  this.before_.unshift(beforeEachFunction);
+};
+
+jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
+  afterEachFunction.typeName = 'afterEach';
+  this.after_.unshift(afterEachFunction);
+};
+
+jasmine.Suite.prototype.results = function() {
+  return this.queue.results();
+};
+
+jasmine.Suite.prototype.add = function(suiteOrSpec) {
+  this.children_.push(suiteOrSpec);
+  if (suiteOrSpec instanceof jasmine.Suite) {
+    this.suites_.push(suiteOrSpec);
+    this.env.currentRunner().addSuite(suiteOrSpec);
+  } else {
+    this.specs_.push(suiteOrSpec);
+  }
+  this.queue.add(suiteOrSpec);
+};
+
+jasmine.Suite.prototype.specs = function() {
+  return this.specs_;
+};
+
+jasmine.Suite.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.Suite.prototype.children = function() {
+  return this.children_;
+};
+
+jasmine.Suite.prototype.execute = function(onComplete) {
+  var self = this;
+  this.queue.start(function () {
+    self.finish(onComplete);
+  });
+};
+jasmine.WaitsBlock = function(env, timeout, spec) {
+  this.timeout = timeout;
+  jasmine.Block.call(this, env, null, spec);
+};
+
+jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
+
+jasmine.WaitsBlock.prototype.execute = function (onComplete) {
+  this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
+  this.env.setTimeout(function () {
+    onComplete();
+  }, this.timeout);
+};
+/**
+ * A block which waits for some condition to become true, with timeout.
+ *
+ * @constructor
+ * @extends jasmine.Block
+ * @param {jasmine.Env} env The Jasmine environment.
+ * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
+ * @param {Function} latchFunction A function which returns true when the desired condition has been met.
+ * @param {String} message The message to display if the desired condition hasn't been met within the given time period.
+ * @param {jasmine.Spec} spec The Jasmine spec.
+ */
+jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
+  this.timeout = timeout || env.defaultTimeoutInterval;
+  this.latchFunction = latchFunction;
+  this.message = message;
+  this.totalTimeSpentWaitingForLatch = 0;
+  jasmine.Block.call(this, env, null, spec);
+};
+jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
+
+jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
+
+jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
+  this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
+  var latchFunctionResult;
+  try {
+    latchFunctionResult = this.latchFunction.apply(this.spec);
+  } catch (e) {
+    this.spec.fail(e);
+    onComplete();
+    return;
+  }
+
+  if (latchFunctionResult) {
+    onComplete();
+  } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
+    var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
+    this.spec.fail({
+      name: 'timeout',
+      message: message
+    });
+
+    this.abort = true;
+    onComplete();
+  } else {
+    this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
+    var self = this;
+    this.env.setTimeout(function() {
+      self.execute(onComplete);
+    }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
+  }
+};
+// Mock setTimeout, clearTimeout
+// Contributed by Pivotal Computer Systems, www.pivotalsf.com
+
+jasmine.FakeTimer = function() {
+  this.reset();
+
+  var self = this;
+  self.setTimeout = function(funcToCall, millis) {
+    self.timeoutsMade++;
+    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
+    return self.timeoutsMade;
+  };
+
+  self.setInterval = function(funcToCall, millis) {
+    self.timeoutsMade++;
+    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
+    return self.timeoutsMade;
+  };
+
+  self.clearTimeout = function(timeoutKey) {
+    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
+  };
+
+  self.clearInterval = function(timeoutKey) {
+    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
+  };
+
+};
+
+jasmine.FakeTimer.prototype.reset = function() {
+  this.timeoutsMade = 0;
+  this.scheduledFunctions = {};
+  this.nowMillis = 0;
+};
+
+jasmine.FakeTimer.prototype.tick = function(millis) {
+  var oldMillis = this.nowMillis;
+  var newMillis = oldMillis + millis;
+  this.runFunctionsWithinRange(oldMillis, newMillis);
+  this.nowMillis = newMillis;
+};
+
+jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
+  var scheduledFunc;
+  var funcsToRun = [];
+  for (var timeoutKey in this.scheduledFunctions) {
+    scheduledFunc = this.scheduledFunctions[timeoutKey];
+    if (scheduledFunc != jasmine.undefined &&
+        scheduledFunc.runAtMillis >= oldMillis &&
+        scheduledFunc.runAtMillis <= nowMillis) {
+      funcsToRun.push(scheduledFunc);
+      this.scheduledFunctions[timeoutKey] = jasmine.undefined;
+    }
+  }
+
+  if (funcsToRun.length > 0) {
+    funcsToRun.sort(function(a, b) {
+      return a.runAtMillis - b.runAtMillis;
+    });
+    for (var i = 0; i < funcsToRun.length; ++i) {
+      try {
+        var funcToRun = funcsToRun[i];
+        this.nowMillis = funcToRun.runAtMillis;
+        funcToRun.funcToCall();
+        if (funcToRun.recurring) {
+          this.scheduleFunction(funcToRun.timeoutKey,
+              funcToRun.funcToCall,
+              funcToRun.millis,
+              true);
+        }
+      } catch(e) {
+      }
+    }
+    this.runFunctionsWithinRange(oldMillis, nowMillis);
+  }
+};
+
+jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
+  this.scheduledFunctions[timeoutKey] = {
+    runAtMillis: this.nowMillis + millis,
+    funcToCall: funcToCall,
+    recurring: recurring,
+    timeoutKey: timeoutKey,
+    millis: millis
+  };
+};
+
+/**
+ * @namespace
+ */
+jasmine.Clock = {
+  defaultFakeTimer: new jasmine.FakeTimer(),
+
+  reset: function() {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.defaultFakeTimer.reset();
+  },
+
+  tick: function(millis) {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.defaultFakeTimer.tick(millis);
+  },
+
+  runFunctionsWithinRange: function(oldMillis, nowMillis) {
+    jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
+  },
+
+  scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
+    jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
+  },
+
+  useMock: function() {
+    if (!jasmine.Clock.isInstalled()) {
+      var spec = jasmine.getEnv().currentSpec;
+      spec.after(jasmine.Clock.uninstallMock);
+
+      jasmine.Clock.installMock();
+    }
+  },
+
+  installMock: function() {
+    jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
+  },
+
+  uninstallMock: function() {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.installed = jasmine.Clock.real;
+  },
+
+  real: {
+    setTimeout: jasmine.getGlobal().setTimeout,
+    clearTimeout: jasmine.getGlobal().clearTimeout,
+    setInterval: jasmine.getGlobal().setInterval,
+    clearInterval: jasmine.getGlobal().clearInterval
+  },
+
+  assertInstalled: function() {
+    if (!jasmine.Clock.isInstalled()) {
+      throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
+    }
+  },
+
+  isInstalled: function() {
+    return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
+  },
+
+  installed: null
+};
+jasmine.Clock.installed = jasmine.Clock.real;
+
+//else for IE support
+jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
+  if (jasmine.Clock.installed.setTimeout.apply) {
+    return jasmine.Clock.installed.setTimeout.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.setTimeout(funcToCall, millis);
+  }
+};
+
+jasmine.getGlobal().setInterval = function(funcToCall, millis) {
+  if (jasmine.Clock.installed.setInterval.apply) {
+    return jasmine.Clock.installed.setInterval.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.setInterval(funcToCall, millis);
+  }
+};
+
+jasmine.getGlobal().clearTimeout = function(timeoutKey) {
+  if (jasmine.Clock.installed.clearTimeout.apply) {
+    return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.clearTimeout(timeoutKey);
+  }
+};
+
+jasmine.getGlobal().clearInterval = function(timeoutKey) {
+  if (jasmine.Clock.installed.clearTimeout.apply) {
+    return jasmine.Clock.installed.clearInterval.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.clearInterval(timeoutKey);
+  }
+};
+
+
+jasmine.version_= {
+  "major": 1,
+  "minor": 0,
+  "build": 1,
+  "revision": 1286311016
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/reporter.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/reporter.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/reporter.js
new file mode 100755
index 0000000..f663bde
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/lib/jasmine-node/reporter.js
@@ -0,0 +1,141 @@
+//
+// Imports
+//
+var sys = require('sys');
+
+
+//
+// Helpers
+//
+function noop() {}
+
+printRunnerResults = function(runner){
+  var results = runner.results();
+  var suites = runner.suites();
+  var msg = '';
+  msg += suites.length + ' test' + ((suites.length === 1) ? '' : 's') + ', ';
+  msg += results.totalCount + ' assertion' + ((results.totalCount === 1) ? '' : 's') + ', ';
+  msg += results.failedCount + ' failure' + ((results.failedCount === 1) ? '' : 's') + '\n';
+  return msg;
+};
+
+ANSIColors = {
+  pass:    function() { return '\033[32m'; }, // Green
+  fail:    function() { return '\033[31m'; }, // Red
+  neutral: function() { return '\033[0m';  }  // Normal
+};
+
+NoColors = {
+  pass:    function() { return ''; },
+  fail:    function() { return ''; },
+  neutral: function() { return ''; }
+};
+
+
+//
+// Reporter implementation
+//
+TerminalReporter = function(config) {
+  this.print_      = config.print      || sys.print;
+  this.isVerbose_  = config.verbose    || false;
+  this.onComplete_ = config.onComplete || noop;
+  this.color_      = config.color? ANSIColors: NoColors;
+
+  this.columnCounter_ = 0;
+  this.log_           = [];
+  this.start_         = 0;
+};
+
+TerminalReporter.prototype = {
+  // Public Methods //
+  log: noop,
+
+  reportSpecStarting: noop,
+
+  reportRunnerStarting: function(runner) {
+    this.printLine_('Started');
+    this.start_ = Number(new Date);
+  },
+
+  reportSuiteResults: function(suite) {
+    var specResults = suite.results();
+    var path = [];
+    while(suite) {
+      path.unshift(suite.description);
+      suite = suite.parentSuite;
+    }
+    var description = path.join(' ');
+
+    if (this.isVerbose_)
+      this.log_.push('Spec ' + description);
+
+    outerThis = this;
+    specResults.items_.forEach(function(spec){
+      if (spec.failedCount > 0 && spec.description) {
+        if (!outerThis.isVerbose_)
+          outerThis.log_.push(description);
+        outerThis.log_.push('  it ' + spec.description);
+        spec.items_.forEach(function(result){
+          outerThis.log_.push('  ' + result.trace.stack + '\n');
+        });
+      } else {
+        if (outerThis.isVerbose_)
+          outerThis.log_.push('  it ' + spec.description);
+      }
+    });
+  },
+
+  reportSpecResults: function(spec) {
+    var result = spec.results();
+    var msg = '';
+    if (result.passed()) {
+      msg = this.stringWithColor_('.', this.color_.pass());
+      //      } else if (result.skipped) {  TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
+      //        msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
+    } else {
+      msg = this.stringWithColor_('F', this.color_.fail());
+    }
+    this.print_(msg);
+    if (this.columnCounter_++ < 50) return;
+    this.columnCounter_ = 0;
+    this.print_('\n');
+  },
+
+  reportRunnerResults: function(runner) {
+    var elapsed = (Number(new Date) - this.start_) / 1000;
+    var owner   = this;
+
+    this.printLine_('\n');
+    this.log_.forEach(function(entry) {
+      owner.printLine_(entry);
+    });
+    this.printLine_('Finished in ' + elapsed + ' seconds');
+
+    var summary = printRunnerResults(runner);
+    if(runner.results().failedCount === 0 ) {
+      this.printLine_(this.stringWithColor_(summary, this.color_.pass()));
+    }
+    else {
+      this.printLine_(this.stringWithColor_(summary, this.color_.fail()));
+    }
+
+    this.onComplete_(runner, this.log_);
+  },
+
+  // Helper Methods //
+  stringWithColor_: function(str, color) {
+    return (color || this.color_.neutral()) + str + this.color_.neutral();
+  },
+
+  printLine_: function(str) {
+    this.print_(str);
+    this.print_('\n');
+  }
+
+};
+
+
+//
+// Exports
+//
+exports.TerminalReporter = TerminalReporter;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake
new file mode 100755
index 0000000..5965f4e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/cake
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var fs   = require('fs');
+var lib  = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
+
+require(lib + '/coffee-script/cake').run();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee
new file mode 100755
index 0000000..3d1d71c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/.bin/coffee
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var fs   = require('fs');
+var lib  = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
+
+require(lib + '/coffee-script/command').run();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore
new file mode 100644
index 0000000..21e430d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/.npmignore
@@ -0,0 +1,11 @@
+*.coffee
+*.html
+.DS_Store
+.git*
+Cakefile
+documentation/
+examples/
+extras/coffee-script.js
+raw/
+src/
+test/

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME
new file mode 100644
index 0000000..faadabe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CNAME
@@ -0,0 +1 @@
+coffeescript.org
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md
new file mode 100644
index 0000000..6390c68
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/CONTRIBUTING.md
@@ -0,0 +1,9 @@
+## How to contribute to CoffeeScript
+
+* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/coffee-script/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
+
+* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffee-script/tree/master/test).
+
+* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffee-script/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
+
+* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release.
\ No newline at end of file


[16/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/overlayWebView.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/overlayWebView.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/overlayWebView.js
new file mode 100644
index 0000000..21150a9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/overlayWebView.js
@@ -0,0 +1,187 @@
+/*
+ *  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.
+ */
+describe("Overlay Webview", function () {
+    var webview,
+        libPath = "./../../../",
+        mockedController,
+        mockedWebview,
+        mockedApplication;
+
+    beforeEach(function () {
+        webview = require(libPath + "lib/overlayWebView");
+        mockedWebview = {
+            id: 42,
+            enableCrossSiteXHR: undefined,
+            visible: undefined,
+            active: undefined,
+            zOrder: undefined,
+            url: undefined,
+            setGeometry: jasmine.createSpy(),
+            setApplicationOrientation: jasmine.createSpy(),
+            notifyApplicationOrientationDone: jasmine.createSpy(),
+            onContextMenuRequestEvent: undefined,
+            onNetworkResourceRequested: undefined,
+            destroy: jasmine.createSpy(),
+            executeJavaScript: jasmine.createSpy(),
+            windowGroup: undefined,
+            addEventListener: jasmine.createSpy(),
+            enableWebEventRedirect: jasmine.createSpy(),
+            notifyContextMenuCancelled: jasmine.createSpy(),
+            allowQnxObject: undefined,
+            allowRpc: undefined,
+            contextMenu: {
+                subscribeTo: jasmine.createSpy()
+            },
+            invocationlist: {
+                show: jasmine.createSpy()
+            }
+        };
+        mockedController = {
+            dispatchEvent : jasmine.createSpy(),
+            addEventListener : jasmine.createSpy()
+        };
+
+        mockedApplication = {
+            windowVisible: undefined
+        };
+        GLOBAL.qnx = {
+            callExtensionMethod: jasmine.createSpy(),
+            webplatform: {
+                getController: function () {
+                    return mockedController;
+                },
+                createUIWebView: function (createFunction) {
+                    runs(createFunction);
+                    return mockedWebview;
+                },
+                getApplication: function () {
+                    return mockedApplication;
+                }
+            }
+        };
+        GLOBAL.window = {
+            qnx: qnx
+        };
+        GLOBAL.screen = {
+            width : 1024,
+            height: 768
+        };
+    });
+
+    describe("create", function () {
+        it("sets up the visible webview", function () {
+            webview.create();
+            waits(1);
+            runs(function () {
+                expect(mockedWebview.visible).toEqual(true);
+                expect(mockedWebview.active).toEqual(true);
+                expect(mockedWebview.zOrder).toEqual(2);
+                expect(mockedWebview.setGeometry).toHaveBeenCalledWith(0, 0, screen.width, screen.height);
+                expect(mockedWebview.backgroundColor).toEqual(0x00FFFFFF);
+                expect(mockedWebview.sensitivity).toEqual("SensitivityTest");
+                expect(mockedWebview.allowQnxObject).toEqual(true);
+                expect(mockedWebview.allowRpc).toEqual(true);
+                expect(mockedController.dispatchEvent).toHaveBeenCalledWith("overlayWebView.initialized", jasmine.any(Array));
+            });
+        });
+
+        it("calls the ready function", function () {
+            var chuck = jasmine.createSpy();
+            webview.create(chuck);
+            waits(1);
+            runs(function () {
+                expect(chuck).toHaveBeenCalled();
+            });
+        });
+
+    });
+
+    describe("methods other than create", function () {
+
+        it("calls the underlying destroy", function () {
+            webview.create(mockedWebview);
+            webview.destroy();
+            expect(mockedWebview.destroy).toHaveBeenCalled();
+        });
+
+        it("sets the url property", function () {
+            var url = "http://AWESOMESAUCE.com";
+            webview.create(mockedWebview);
+            webview.setURL(url);
+            expect(mockedWebview.url).toEqual(url);
+        });
+
+        it("calls the underlying executeJavascript", function () {
+            var js = "var awesome='Jasmine BDD'";
+            webview.create(mockedWebview);
+            webview.executeJavascript(js);
+            expect(mockedWebview.executeJavaScript).toHaveBeenCalledWith(js);
+        });
+        it("calls the underlying windowGroup property", function () {
+            webview.create(mockedWebview);
+            expect(webview.windowGroup()).toEqual(mockedWebview.windowGroup);
+        });
+
+        it("can get the id for the webiew", function () {
+            webview.create();
+            expect(webview.id).toEqual(mockedWebview.id);
+        });
+
+        it("can set geometry", function () {
+            webview.create();
+            webview.setGeometry(0, 0, 100, 200);
+            expect(mockedWebview.setGeometry).toHaveBeenCalledWith(0, 0, 100, 200);
+        });
+
+        it("can set application orientation", function () {
+            webview.create();
+            webview.setApplicationOrientation(90);
+            expect(mockedWebview.setApplicationOrientation).toHaveBeenCalledWith(90);
+        });
+
+        it("can notifyApplicationOrientationDone", function () {
+            webview.create();
+            webview.notifyApplicationOrientationDone();
+            expect(mockedWebview.notifyApplicationOrientationDone).toHaveBeenCalled();
+        });
+
+        it("can notifyContextMenuCancelled", function () {
+            webview.create();
+            webview.notifyContextMenuCancelled();
+            expect(mockedWebview.notifyContextMenuCancelled).toHaveBeenCalled();
+        });
+
+        it("can render the ccm for another webview ", function () {
+            webview.create();
+            webview.renderContextMenuFor(webview);
+            expect(mockedWebview.contextMenu.subscribeTo).toHaveBeenCalledWith(webview);
+        });
+
+        it("It has a zOrder propety ", function () {
+            expect(webview.zOrder).toBeDefined();
+        });
+
+        it('proxies calls to invocationlist.show()', function () {
+            var request = {},
+                title = {},
+                success = function () {},
+                error = function () {};
+            webview.create();
+            webview.showInvocationList(request, title, success, error);
+            expect(mockedWebview.invocationlist.show).toHaveBeenCalledWith(request, title, success, error);
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/default.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/default.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/default.js
new file mode 100644
index 0000000..349bfea
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/default.js
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+var ROOT = "../../../../";
+
+describe("default plugin", function () {
+
+    var defaultPlugin = require(ROOT + 'lib/plugins/default'),
+        testExtension,
+        utils,
+        mockController,
+        mockApplication;
+
+    describe("when handling requests", function () {
+        var req, res, succ, fail, args;
+
+        beforeEach(function () {
+            req = {
+                origin: "http://www.origin.com",
+                params: {}
+            };
+            res = {
+                send: jasmine.createSpy()
+            };
+            succ = jasmine.createSpy("lib/plugin/default success");
+            fail = jasmine.createSpy("lib/plugin/default fail");
+            args = {};
+
+            GLOBAL.frameworkModules = ["plugin/blackberry.app/index.js"];
+
+            //All of this mocking is required for modules to load, DO NOT REMOVE
+            mockController = {
+                dispatchEvent: jasmine.createSpy()
+            };
+            mockApplication = {
+            };
+            GLOBAL.window = {
+                qnx: {
+                    webplatform: {
+                        getController: jasmine.createSpy().andReturn(mockController),
+                        getApplication: jasmine.createSpy().andReturn(mockApplication)
+                    }
+                }
+            };
+
+            testExtension = {
+                getReadOnlyFields: function () {}
+            };
+
+            delete require.cache[require.resolve(ROOT + "lib/utils")];
+            utils = require(ROOT + "lib/utils");
+            spyOn(utils, "loadModule").andCallFake(function (module) {
+                // on device, "plugin/blackberry.app/index.js" would exist since packager would
+                // name the extension folder with feature id in compilation time
+                if (module.indexOf("/plugin") !== -1) {
+                    return testExtension;
+                } else {
+                    return undefined;
+                }
+            });
+        });
+
+        afterEach(function () {
+            delete GLOBAL.frameworkModules;
+            delete GLOBAL.window;
+        });
+
+        it("returns 404 if the extension is not found", function () {
+            var ext = "NotAnExt",
+                errMsg = "Extension " + ext + " not found";
+
+            req.params.ext = ext;
+            spyOn(console, "warn");
+
+            defaultPlugin.exec(req, succ, fail, args);
+
+            expect(fail).toHaveBeenCalledWith(-1, errMsg, 404);
+            expect(console.warn).toHaveBeenCalledWith(errMsg);
+        });
+
+        it("returns 404 if the method is not found", function () {
+            req.params.ext = "blackberry.app";
+            req.params.method = "NotAMethod";
+            spyOn(console, "warn");
+
+            defaultPlugin.exec(req, succ, fail, args);
+
+            expect(fail).toHaveBeenCalledWith(-1, jasmine.any(String), 404);
+            expect(console.warn).toHaveBeenCalledWith("Method " + req.params.method + " for " + req.params.ext + " not found");
+        });
+
+        it("calls the method of the extension", function () {
+            var env = {"request": req, "response": res};
+
+            spyOn(testExtension, "getReadOnlyFields");
+
+            req.params.ext = "blackberry.app";
+            req.params.method = "getReadOnlyFields";
+
+            defaultPlugin.exec(req, succ, fail, args, env);
+
+            expect(testExtension.getReadOnlyFields).toHaveBeenCalledWith(succ, fail, args, env);
+        });
+
+        it("calls a multi-level method of the extension", function () {
+            var env = {"request": req, "response": res};
+
+            spyOn(testExtension, "getReadOnlyFields");
+            testExtension.getReadOnlyFields.a = {
+                b : {
+                    c : jasmine.createSpy()
+                }
+            };
+
+            req.params.ext = "blackberry.app";
+            req.params.method = "getReadOnlyFields/a/b/c";
+
+            defaultPlugin.exec(req, succ, fail, args, env);
+
+            expect(fail).wasNotCalled();
+            expect(testExtension.getReadOnlyFields.a.b.c).toHaveBeenCalledWith(succ, fail, args, env);
+        });
+
+        it("throws a 404 is a multi-level method is not found", function () {
+            var env = {"request": req, "response": res};
+
+            spyOn(console, "warn");
+            spyOn(testExtension, "getReadOnlyFields");
+            testExtension.getReadOnlyFields.a = {
+            };
+
+            req.params.ext = "blackberry.app";
+            req.params.method = "getReadOnlyFields/a/b/c";
+
+            defaultPlugin.exec(req, succ, fail, args, env);
+
+            expect(fail).toHaveBeenCalledWith(-1, jasmine.any(String), 404);
+            expect(console.warn).toHaveBeenCalledWith("Method " + req.params.method + " for " + req.params.ext + " not found");
+        });
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/event.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/event.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/event.js
new file mode 100644
index 0000000..ea92f1d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/plugins/event.js
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+describe("event plugin", function () {
+
+    var ROOT = "./../../../../",
+        eventLib = require(ROOT + "lib/event"),
+        eventPlugin;
+
+    describe("once function", function () {
+        var args = {
+            eventName: encodeURIComponent(JSON.stringify("GRRRRR"))
+        };
+
+        it("calls success if no error", function () {
+            var success = jasmine.createSpy(),
+                fail = jasmine.createSpy(),
+                webview = {};
+
+            spyOn(eventLib, "add");
+            delete require.cache[require.resolve(ROOT + "lib/plugins/event")];
+            eventPlugin = require(ROOT + "lib/plugins/event");
+            this.after(function () {
+                delete require.cache[require.resolve(ROOT + "lib/plugins/event")];
+            });
+
+            eventPlugin.once(undefined, success, fail, args, {webview: webview});
+
+            expect(eventLib.add).toHaveBeenCalledWith(
+                {
+                    event: "GRRRRR",
+                    once: true
+                },
+                webview
+            );
+            expect(success).toHaveBeenCalled();
+            expect(fail).not.toHaveBeenCalledWith(-1, jasmine.any(String));
+        });
+
+        it("calls fail if there is an error", function () {
+            var success = jasmine.createSpy(),
+                fail = jasmine.createSpy(),
+                webview = {};
+
+            spyOn(eventLib, "add").andThrow("ERRRORZ");
+            delete require.cache[require.resolve(ROOT + "lib/plugins/event")];
+            eventPlugin = require(ROOT + "lib/plugins/event");
+            this.after(function () {
+                delete require.cache[require.resolve(ROOT + "lib/plugins/event")];
+            });
+
+            eventPlugin.once(undefined, success, fail, args, {webview: webview});
+
+            expect(eventLib.add).toHaveBeenCalledWith(
+                {
+                    event: "GRRRRR",
+                    once: true
+                },
+                webview
+            );
+            expect(success).not.toHaveBeenCalled();
+            expect(fail).toHaveBeenCalledWith(-1, jasmine.any(String));
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/webkitOriginAccess.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/webkitOriginAccess.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/webkitOriginAccess.js
new file mode 100644
index 0000000..4a5ac8e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/webkitOriginAccess.js
@@ -0,0 +1,194 @@
+/*
+ *  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.
+ */
+
+var LIB_PATH = __dirname + "/../../../../lib/",
+    utils = require(LIB_PATH + 'utils'),
+    webkitOriginAccess = require(LIB_PATH + "policy/webkitOriginAccess"),
+    LOCAL_URI = "local://",
+    FILE_URI = "file://",
+    WW_URI = utils.getURIPrefix(),
+    mockWebView;
+
+describe("lib/policy/webkitOriginAccess", function () {
+    beforeEach(function () {
+        mockWebView = {
+            addOriginAccessWhitelistEntry: jasmine.createSpy()
+        };
+    });
+
+    afterEach(function () {
+        mockWebView = undefined;
+        delete require.cache[require.resolve(LIB_PATH + "config")];
+        delete require.cache[require.resolve(LIB_PATH + "policy/webkitOriginAccess")];
+        webkitOriginAccess = require(LIB_PATH + "policy/webkitOriginAccess");
+    });
+
+    function mockConfig(mockAccessList, hasMultiAccess) {
+        delete require.cache[require.resolve(LIB_PATH + "config")];
+        delete require.cache[require.resolve(LIB_PATH + "policy/webkitOriginAccess")];
+        var config = require(LIB_PATH + "config");
+        config.accessList = mockAccessList;
+        config.hasMultiAccess = !!hasMultiAccess;
+        webkitOriginAccess = require(LIB_PATH + "policy/webkitOriginAccess");
+    }
+
+    describe("addWebview function", function () {
+
+        it("exists", function () {
+            expect(webkitOriginAccess.addWebView).toBeDefined();
+        });
+
+        it("sets up one time whitelisting", function () {
+            webkitOriginAccess.addWebView(mockWebView);
+
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, FILE_URI, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(FILE_URI, LOCAL_URI, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, WW_URI, true);
+        });
+
+        it("initializes the webview with whitelisting based on the config", function () {
+            var mockAccessList = [
+                {
+                    uri : "http://google.com",
+                    allowSubDomain : true,
+                    features : null
+                }
+            ];
+            mockConfig(mockAccessList);
+
+            webkitOriginAccess.addWebView(mockWebView);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, "http://google.com", true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith("http://google.com", LOCAL_URI, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith("http://google.com", WW_URI, true);
+        });
+
+        it("initializes the webview with whitelisting based on what domains have been added", function () {
+            var mockAccessList = [{
+                    uri : "http://google.com",
+                    allowSubDomain : true,
+                    features : null
+                }],
+                url = "http://www.rim.com";
+
+            mockConfig(mockAccessList, true);
+
+            webkitOriginAccess.addOriginAccess(url, true);
+
+            webkitOriginAccess.addWebView(mockWebView);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, url, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, LOCAL_URI, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, "http://google.com", true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith("http://google.com", url, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, WW_URI, true);
+        });
+
+        it("will not initialize twice", function () {
+            var origCallCount;
+
+            webkitOriginAccess.addWebView(mockWebView);
+            origCallCount = mockWebView.addOriginAccessWhitelistEntry.callCount;
+            webkitOriginAccess.addWebView(mockWebView);
+
+            expect(mockWebView.addOriginAccessWhitelistEntry.callCount).toEqual(origCallCount);
+        });
+
+    });
+
+    describe("addOriginAccess function", function () {
+        it("exists", function () {
+            expect(webkitOriginAccess.addOriginAccess).toBeDefined();
+        });
+
+        it("Treats falsey values as false", function () {
+            var url = "http://www.rim.com";
+
+            webkitOriginAccess.addWebView(mockWebView);
+            webkitOriginAccess.addOriginAccess(url);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, url, false);
+        });
+
+        it("Adds access for any non-local and non-file url", function () {
+            var url = "http://www.rim.com/grrr/arrg/blah.htm";
+
+            webkitOriginAccess.addWebView(mockWebView);
+            webkitOriginAccess.addOriginAccess(url);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, url, false);
+        });
+
+        //Because local:// is already a domain, the spy should not have no new calls
+        it("Local uris are treated as local://", function () {
+            var url = "local:///buy/local/beef/mmmmmmmmmmmmm/Steak.yum",
+                origCallCount;
+
+            webkitOriginAccess.addWebView(mockWebView);
+            webkitOriginAccess.addOriginAccess(url);
+            origCallCount = mockWebView.addOriginAccessWhitelistEntry.callCount;
+            webkitOriginAccess.addOriginAccess(url);
+            expect(mockWebView.addOriginAccessWhitelistEntry.callCount).toEqual(origCallCount);
+        });
+
+        it("File uris are treated as file://", function () {
+            var url = "file:///buy/local/beef/mmmmmmmmmmmmm/Steak.yum",
+                authority = "file://";
+
+            webkitOriginAccess.addWebView(mockWebView);
+            webkitOriginAccess.addOriginAccess(url);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, authority, false);
+        });
+
+        it("updates all managed webviews of the new domain access", function () {
+            var mockWebView2 = {
+                    addOriginAccessWhitelistEntry: jasmine.createSpy()
+                },
+                url = "http://www.rim.com";
+
+            webkitOriginAccess.addWebView(mockWebView);
+            webkitOriginAccess.addWebView(mockWebView2);
+
+            webkitOriginAccess.addOriginAccess(url, true);
+
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, url, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, LOCAL_URI, true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, WW_URI, true);
+            expect(mockWebView2.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(LOCAL_URI, url, true);
+            expect(mockWebView2.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, LOCAL_URI, true);
+            expect(mockWebView2.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, WW_URI, true);
+        });
+
+        it("updates all managed webviews when a new domain is added", function () {
+            var mockAccessList = [{
+                    uri : "http://google.com",
+                    allowSubDomain : true,
+                    features : null
+                }],
+                url = "http://www.rim.com";
+
+            mockConfig(mockAccessList, true);
+
+            webkitOriginAccess.addWebView(mockWebView);
+
+            expect(mockWebView.addOriginAccessWhitelistEntry).not.toHaveBeenCalledWith(url, "http://google.com", true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).not.toHaveBeenCalledWith("http://google.com", url, true);
+
+            webkitOriginAccess.addOriginAccess(url, true);
+
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith(url, "http://google.com", true);
+            expect(mockWebView.addOriginAccessWhitelistEntry).toHaveBeenCalledWith("http://google.com", url, true);
+        });
+
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/whitelist.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/whitelist.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/whitelist.js
new file mode 100644
index 0000000..59f9425
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/policy/whitelist.js
@@ -0,0 +1,859 @@
+/*
+ * Copyright 2011 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.
+ */
+
+var srcPath = __dirname + "/../../../../lib/",
+    Whitelist = require(srcPath + "policy/whitelist").Whitelist;
+
+describe("whitelist", function () {
+    describe("when user includes a wildcard access", function () {
+        it("can allow access to any domain not from XHR using uri *", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : true,
+                accessList : null
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.google.com")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.msn.com")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.cnn.com")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.rim.com")).toEqual(true);
+            expect(whitelist.isAccessAllowed("local:///index.html")).toEqual(true);
+            expect(whitelist.isAccessAllowed("file://store/home/user/documents/file.doc")).toEqual(true);
+        });
+        it("can allow access to explicit domains only when XHR using uri *", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : true,
+                accessList : [
+                    {
+                        uri : "http://google.com",
+                        allowSubDomain : true,
+                        features : null
+                    }
+                ]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.google.com", true)).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.google.com/a/b/c", true)).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.msn.com", true)).toEqual(false);
+            expect(whitelist.isAccessAllowed("http://www.cnn.com", true)).toEqual(false);
+        });
+    });
+
+    describe("when user does not include a wildcard access", function () {
+        it("can deny all web access when no uris are whitelisted", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : null
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.google.com")).toEqual(false);
+        });
+
+        it("can deny all API access when no uris are whitelisted", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : null
+            });
+
+            expect(whitelist.isFeatureAllowed("http://www.google.com"), "blackberry.app").toEqual(false);
+        });
+
+        it("can return empty feature list when nothing is whitelisted", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : null
+            });
+
+            expect(whitelist.getFeaturesForUrl("http://www.google.com")).toEqual([]);
+        });
+
+        it("can allow access to whitelisted HTTP URL", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com",
+                    allowSubDomain : true,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.google.com")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.cnn.com")).toEqual(false);
+        });
+
+        it("can allow access to whitelisted URL with different case (host)", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com",
+                    allowSubDomain : true,
+                    features : null
+                },
+                {
+                    uri : "http://ABC.com",
+                    allowSubDomain : true,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.GOOGLE.com")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.abc.com")).toEqual(true);
+        });
+
+        it("can allow access to whitelisted URL with different case (path)", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com/SOME/path",
+                    allowSubDomain : true,
+                    features : null
+                },
+                {
+                    uri : "http://google.com/another/path",
+                    allowSubDomain : true,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.google.com/some/path")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.google.com/ANOTHER/path")).toEqual(true);
+        });
+
+        it("can deny access to non-whitelisted HTTP URL", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com",
+                    allowSubDomain : true,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.cnn.com")).toEqual(false);
+        });
+
+        it("can allow access to whitelisted feature for whitelisted HTTP uris", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [
+                    {
+                        uri : "http://google.com",
+                        allowSubDomain : false,
+                        features : [{
+                            id : "blackberry.app",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }, {
+                        uri: "http://smoketest1-vmyyz.labyyz.testnet.rim.net:8080/",
+                        allowSubDomain: false,
+                        features: [{
+                            id : "blackberry.app",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }
+                ]
+            });
+
+            expect(whitelist.isFeatureAllowed("http://google.com", "blackberry.app")).toEqual(true);
+            expect(whitelist.isFeatureAllowed("http://smoketest1-vmyyz.labyyz.testnet.rim.net:8080/a/webworks.html", "blackberry.app")).toEqual(true);
+        });
+
+        it("can deny access to non-whitelisted feature for whitelisted HTTP uris", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com",
+                    allowSubDomain : false,
+                    features : [{
+                        id : "blackberry.app",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }]
+            });
+
+            expect(whitelist.isFeatureAllowed("http://google.com", "blackberry.io.file")).toEqual(false);
+        });
+
+        it("can get all whitelisted features for url", function () {
+            var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://google.com",
+                        allowSubDomain : false,
+                        features : [{
+                            id : "blackberry.app",
+                            required : true,
+                            version : "1.0.0"
+                        }, {
+                            id : "blackberry.media.camera",
+                            required : true,
+                            version : "1.0.0"
+                        }, {
+                            id : "blackberry.io.dir",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }]
+                });
+
+            expect(whitelist.getFeaturesForUrl("http://google.com")).toContain("blackberry.app");
+            expect(whitelist.getFeaturesForUrl("http://google.com")).toContain("blackberry.media.camera");
+            expect(whitelist.getFeaturesForUrl("http://google.com")).toContain("blackberry.io.dir");
+            expect(whitelist.getFeaturesForUrl("http://www.wikipedia.org")).toEqual([]);
+        });
+
+        it("can allow access for query strings using a query string wildcard", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://www.google.com/search?*",
+                    allowSubDomain : true,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.google.com/search?q=awesome")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.google.com/search?a=anyLetter")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://www.google.com/search")).toEqual(false);
+            expect(whitelist.isAccessAllowed("http://www.google.com/blah?q=awesome")).toEqual(false);
+        });
+
+        it("can deny access for query strings without a query string wildcard", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://www.google.com/search",
+                    allowSubDomain : true,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.google.com/search?q=awesome", true)).toEqual(false);
+            expect(whitelist.isAccessAllowed("http://www.google.com/search?a=anyLetter", true)).toEqual(false);
+        });
+
+        it("can allow access for ports given just the whitelist url", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://www.awesome.com",
+                    allowSubDomain : true,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.awesome.com:9000")).toEqual(true);
+        });
+
+        it("allows api access for ports given just the whitelist url", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://www.awesome.com",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.app",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }]
+            });
+
+            expect(whitelist.isFeatureAllowed("http://www.awesome.com:8080", "blackberry.app")).toEqual(true);
+        });
+
+        it("allows api access for child pages with ports given just the whitelist url", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://smoketest8-vmyyz.labyyz.testnet.rim.net/",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.app",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }]
+            });
+
+            expect(whitelist.isFeatureAllowed("http://www.smoketest8-vmyyz.labyyz.testnet.rim.net:8080//webworks.html", "blackberry.app")).toEqual(true);
+        });
+
+        it("can allow folder level access of whitelisted uris", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://www.awesome.com/parent/child",
+                    allowSubDomain : false,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.awesome.com/parent/child")).toEqual(true);
+        });
+
+        it("can deny access to parent folders of whitelisted uris", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://www.awesome.com/parent/child",
+                    allowSubDomain : false,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.awesome.com/parent")).toEqual(false);
+        });
+
+        it("can deny access to sibling folders of whitelisted uris", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://www.awesome.com/parent/child/",
+                    allowSubDomain : false,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://www.awesome.com/parent/sibling/")).toEqual(false);
+        });
+
+        it("can deny access to sibling folders of whitelisted uris", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://rim4.awesome.com/goodChild/index.html",
+                    allowSubDomain : false,
+                    features : null
+                }]
+            });
+
+            expect(whitelist.isAccessAllowed("http://rim4.awesome.com/goodChild/index.html")).toEqual(true);
+            expect(whitelist.isAccessAllowed("http://rim4.awesome.com/badChild/index.html")).toEqual(false);
+        });
+
+        it("can get whitelisted features at a folder level", function () {
+            var list1 = [{
+                    id : "blackberry.app",
+                    required : true,
+                    version : "1.0.0"
+                }],
+                list2 = [{
+                    id : "blackberry.media.camera",
+                    required : true,
+                    version : "1.0.0"
+                }],
+                whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://google.com/ninjas",
+                        allowSubDomain : true,
+                        features : list1
+                    }, {
+                        uri : "http://google.com/pirates",
+                        allowSubDomain : true,
+                        features : list2
+                    }]
+                });
+
+            expect(whitelist.getFeaturesForUrl("http://google.com/ninjas")).toEqual(["blackberry.app"]);
+            expect(whitelist.getFeaturesForUrl("http://google.com/pirates")).toEqual(["blackberry.media.camera"]);
+        });
+
+        it("can allow API permissions at a folder level", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com/ninjas",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.app",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }, {
+                    uri : "http://google.com/pirates",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.media.camera",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }]
+            });
+
+            expect(whitelist.isFeatureAllowed("http://google.com/ninjas", "blackberry.app")).toEqual(true);
+            expect(whitelist.isFeatureAllowed("http://google.com/pirates", "blackberry.media.camera")).toEqual(true);
+        });
+
+        it("can deny API permissions at a folder level", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com/ninjas",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.app",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }, {
+                    uri : "http://google.com/pirates",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.media.camera",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }]
+            });
+
+            expect(whitelist.isFeatureAllowed("http://google.com/ninjas", "blackberry.media.camera")).toEqual(false);
+            expect(whitelist.isFeatureAllowed("http://google.com/pirates", "blackberry.app")).toEqual(false);
+        });
+
+        it("can allow access specific folder rules to override more general domain rules", function () {
+            var whitelist = new Whitelist({
+                hasMultiAccess : false,
+                accessList : [{
+                    uri : "http://google.com",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.app",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }, {
+                    uri : "http://google.com/folder",
+                    allowSubDomain : true,
+                    features : [{
+                        id : "blackberry.media.camera",
+                        required : true,
+                        version : "1.0.0"
+                    }]
+                }]
+            });
+
+            expect(whitelist.isFeatureAllowed("http://google.com/folder", "blackberry.app")).toEqual(false);
+            expect(whitelist.isFeatureAllowed("http://google.com/folder", "blackberry.media.camera")).toEqual(true);
+        });
+
+        describe("when access uris have subdomains", function () {
+            it("can get whitelisted features for subdomains", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://google.com",
+                        allowSubDomain : true,
+                        features : [{
+                            id : "blackberry.system",
+                            required : true,
+                            version : "1.0.0.0"
+                        }, {
+                            id : "blackberry.media.microphone",
+                            required : true,
+                            version : "1.0.0.0"
+                        }]
+                    }]
+                });
+
+                expect(whitelist.getFeaturesForUrl("http://code.google.com")).toContain("blackberry.media.microphone");
+                expect(whitelist.getFeaturesForUrl("http://code.google.com")).toContain("blackberry.system");
+                expect(whitelist.getFeaturesForUrl("http://translate.google.com/lang=en")).toContain("blackberry.media.microphone");
+                expect(whitelist.getFeaturesForUrl("http://translate.google.com/lang=en")).toContain("blackberry.system");
+                expect(whitelist.getFeaturesForUrl("http://blah.goooooogle.com")).toEqual([]);
+            });
+
+            it("can allow access to whitelisted features for the subdomains", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://google.com",
+                        allowSubDomain : true,
+                        features : [{
+                            id : "blackberry.app",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }]
+                });
+
+                expect(whitelist.isFeatureAllowed("http://abc.google.com", "blackberry.app")).toEqual(true);
+                expect(whitelist.isFeatureAllowed("http://xyz.google.com", "blackberry.app")).toEqual(true);
+            });
+
+            it("can allow access to subdomains of whitelisted uris", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [
+                        {
+                            uri : "http://awesome.com/",
+                            allowSubDomain : true,
+                            features : null
+                        }, {
+                            uri: "http://smoketest9-vmyyz.labyyz.testnet.rim.net:8080",
+                            allowSubDomain: true,
+                            features: null
+                        }
+                    ]
+                });
+
+                expect(whitelist.isAccessAllowed("http://subdomain.awesome.com")).toEqual(true);
+                expect(whitelist.isAccessAllowed("http://www.smoketest9-vmyyz.labyyz.testnet.rim.net:8080")).toEqual(true);
+            });
+
+            it("can disallow access to subdomains of whitelisted uris", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://awesome.com/",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("http://subdomain.awesome.com")).toEqual(false);
+            });
+
+            it("can disallow access to subdomains of a specified uri", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://awesome.com/",
+                        allowSubDomain : true,
+                        features : null
+                    }, {
+                        uri : "http://moreawesome.com/",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("http://subdomain.moreawesome.com")).toEqual(false);
+            });
+
+            it("can allow specific subdomain rules to override more general domain rules when subdomains are allowed", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://google.com",
+                        allowSubDomain : true,
+                        features : [{
+                            id : "blackberry.app",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }, {
+                        uri : "http://sub.google.com",
+                        allowSubDomain : true,
+                        features : [{
+                            id : "blackberry.media.camera",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }]
+                });
+
+                expect(whitelist.isFeatureAllowed("http://sub.google.com", "blackberry.app")).toEqual(false);
+                expect(whitelist.isFeatureAllowed("http://sub.google.com", "blackberry.media.camera")).toEqual(true);
+            });
+
+            it("can get whitelisted features for a more specific subdomain", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://google.com",
+                        allowSubDomain : false,
+                        features : [{
+                            id : "blackberry.app",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }, {
+                        uri : "http://sub.google.com",
+                        allowSubDomain : false,
+                        features : [{
+                            id : "blackberry.media.camera",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }]
+                });
+
+                expect(whitelist.getFeaturesForUrl("http://google.com")).toContain("blackberry.app");
+                expect(whitelist.getFeaturesForUrl("http://sub.google.com")).toContain("blackberry.media.camera");
+                expect(whitelist.getFeaturesForUrl("http://sub.google.com")).not.toContain("blckberry.app");
+                expect(whitelist.getFeaturesForUrl("http://code.google.com")).toEqual([]);
+            });
+
+            it("can allow specific subdomain rules to override more general domain rules when subdomains are disallowed", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://google.com",
+                        allowSubDomain : false,
+                        features : [{
+                            id : "blackberry.app",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }, {
+                        uri : "http://sub.google.com",
+                        allowSubDomain : false,
+                        features : [{
+                            id : "blackberry.media.camera",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }]
+                });
+
+                expect(whitelist.isFeatureAllowed("http://sub.google.com", "blackberry.app")).toEqual(false);
+                expect(whitelist.isFeatureAllowed("http://sub.google.com", "blackberry.media.camera")).toEqual(true);
+            });
+        });
+
+        describe("when uris with other protocols are requested", function () {
+            it("can allow access to whitelisted HTTPS URL", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "https://google.com",
+                        allowSubDomain : true,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("https://www.google.com")).toEqual(true);
+                expect(whitelist.isAccessAllowed("https://www.cnn.com")).toEqual(false);
+            });
+
+            it("can deny access to non-whitelisted HTTPS URL", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "https://google.com",
+                        allowSubDomain : true,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("https://www.cnn.com")).toEqual(false);
+            });
+
+            it("can allow access to local URLs", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "WIDGET_LOCAL",    // packager always inserts a local access into access list
+                        allowSubDomain : false
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("local:///index.html")).toEqual(true);
+                expect(whitelist.isAccessAllowed("local:///appDir/subDir/index.html")).toEqual(true);
+            });
+
+            it("can allow access to whitelisted features for local URLs", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "WIDGET_LOCAL",    // packager always inserts a local access into access list
+                        allowSubDomain : false,
+                        features : [{
+                            id : "blackberry.media.microphone",
+                            required : true,
+                            version : "2.0.0"
+                        }, {
+                            id : "blackberry.media.camera",
+                            required : true,
+                            version : "1.0.0"
+                        }]
+                    }]
+                });
+
+                expect(whitelist.isFeatureAllowed("local:///index.html", "blackberry.media.microphone")).toEqual(true);
+                expect(whitelist.isFeatureAllowed("local:///index.html", "blackberry.media.camera")).toEqual(true);
+            });
+
+            it("can allow access to whitelisted file URL", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "file://store/home/user/documents",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("file://store/home/user/documents/file.doc")).toEqual(true);
+            });
+
+            it("can access file if rule specifed was file:///", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [
+                        {
+                            uri : "file:///accounts/1000/shared/documents/textData.txt",
+                            allowSubDomain : false,
+                            features: []
+                        }
+                    ]
+                });
+
+                expect(whitelist.isAccessAllowed("file:///accounts/1000/shared/documents/textData.txt")).toEqual(true);
+                expect(whitelist.isAccessAllowed("file:///etc/passwd")).toEqual(false);
+            });
+
+            it("can access file if rule specifed was file:///", function () {
+                var whitelist = new Whitelist({
+                    "hasMultiAccess": false,
+                    "accessList": [
+                        {
+                            "features": [],
+                            "uri": "WIDGET_LOCAL",
+                            "allowSubDomain": true
+                        },
+                        {
+                            "features": [],
+                            "uri": "file:///accounts/1000/shared/documents/textData.txt"
+                        }
+                    ]
+                });
+                expect(whitelist.isAccessAllowed("file:///etc/passwd", false)).toEqual(false);
+            });
+
+            it("can deny file access when access file:/// with no rule", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : null
+                });
+
+                expect(whitelist.isAccessAllowed("file:///accounts/1000/shared/documents/textData.txt")).toEqual(false);
+            });
+
+            it("can allow access to whitelisted file URL from an external startup page", function () {
+                var whitelist = new Whitelist({
+                    content: "http://www.google.com",
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "file://store/home/user/documents",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("file://store/home/user/documents/file.doc")).toEqual(true);
+            });
+
+            it("can allow access to whitelisted local URL from an external startup page", function () {
+                var whitelist = new Whitelist({
+                    content: "http://www.google.com",
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "local://localpage.html",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("local://localpage.html")).toEqual(true);
+            });
+
+            it("can allow access to whitelisted file URL from an external startup page with wildcard access", function () {
+                var whitelist = new Whitelist({
+                    content: "http://www.google.com",
+                    hasMultiAccess : true
+                });
+
+                expect(whitelist.isAccessAllowed("file://store/home/user/documents/file.doc")).toEqual(true);
+            });
+
+            it("can allow access to whitelisted local URL from an external startup page with wildcard access", function () {
+                var whitelist = new Whitelist({
+                    content: "http://www.google.com",
+                    hasMultiAccess : true
+                });
+
+                expect(whitelist.isAccessAllowed("local://localpage.html")).toEqual(true);
+            });
+
+            it("can deny file URL access when no file urls are whitelisted", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : null
+                });
+
+                expect(whitelist.isAccessAllowed("file://store/home/user/documents/file.doc")).toEqual(false);
+            });
+
+            it("can allow access to a subfolder of a whitelisted file URL", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "file://store/home/user/",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("file://store/home/user/documents/file.doc")).toEqual(true);
+            });
+
+            it("can deny access to a different folder of a whitelisted file URL", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://store.com/home/user/documents",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("http://store.com/home/user/documents/file.doc")).toEqual(true);
+                expect(whitelist.isAccessAllowed("http://store.com/file2.doc")).toEqual(false);
+            });
+
+            it("can allow access to RTSP protocol urls", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "rtsp://media.com",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("rtsp://media.com/video.avi")).toEqual(true);
+            });
+
+            it("always allows access to data-uris", function () {
+                var whitelist = new Whitelist({
+                    hasMultiAccess : false,
+                    accessList : [{
+                        uri : "http://awesome.com",
+                        allowSubDomain : false,
+                        features : null
+                    }]
+                });
+
+                expect(whitelist.isAccessAllowed("data:image/png;base64,zamagawdbase64string")).toEqual(true);
+            });
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/server.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/server.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/server.js
new file mode 100644
index 0000000..2b89b0a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/server.js
@@ -0,0 +1,293 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+var ROOT = "../../../";
+
+describe("server", function () {
+
+    var server = require(ROOT + "lib/server"),
+        plugin = require(ROOT + "lib/plugins/default"),
+        applicationAPIServer,
+        utils,
+        DEFAULT_SERVICE = "default",
+        DEFAULT_ACTION = "exec",
+        config = {};
+
+    beforeEach(function () {
+        applicationAPIServer = {
+            getReadOnlyFields: function () {}
+        };
+        delete require.cache[require.resolve(ROOT + "lib/utils")];
+        utils = require("../../../lib/utils");
+        spyOn(utils, "loadModule").andCallFake(function (module) {
+            if (module.indexOf("plugin/") >= 0) {
+                // on device, "plugin/blackberry.app/index.js" would exist
+                return applicationAPIServer;
+            } else {
+                return require("../../../lib/" + module);
+            }
+        });
+    });
+
+    describe("when handling requests", function () {
+        var req, res;
+
+        beforeEach(function () {
+            req = {
+                params: {
+                    service: "",
+                    action: ""
+                },
+                body: "",
+                origin: ""
+            };
+            res = {
+                send: jasmine.createSpy()
+            };
+            GLOBAL.frameworkModules = ['plugin/blackberry.app/index.js', 'lib/plugins/default.js'];
+        });
+
+        afterEach(function () {
+            delete GLOBAL.frameworkModules;
+        });
+
+        it("calls the default plugin if the service doesn't exist", function () {
+            var rebuiltRequest = {
+                    params: {
+                        service: DEFAULT_SERVICE,
+                        action: DEFAULT_ACTION,
+                        ext: "not",
+                        method: "here",
+                        args: null
+                    },
+                    body: "",
+                    origin: ""
+                },
+                webview = {};
+
+            spyOn(plugin, DEFAULT_ACTION);
+            req.params.service = "not";
+            req.params.action = "here";
+
+            server.handle(req, res, webview, config);
+
+            expect(plugin[DEFAULT_ACTION]).toHaveBeenCalledWith(
+                rebuiltRequest, jasmine.any(Function),
+                jasmine.any(Function),
+                rebuiltRequest.params.args,
+                {
+                    request: rebuiltRequest,
+                    response: res,
+                    webview: webview,
+                    config: config
+                }
+            );
+        });
+
+        it("returns 404 if the action doesn't exist", function () {
+            req.params.service = "default";
+            req.params.action = "ThisActionDoesNotExist";
+
+            spyOn(console, "error");
+
+            server.handle(req, res);
+            expect(res.send).toHaveBeenCalledWith(404, jasmine.any(String));
+            expect(console.error).toHaveBeenCalled();
+        });
+
+        it("calls the action method on the plugin", function () {
+            var webview = "BLAHBLAHBLAH";
+
+            spyOn(plugin, "exec");
+
+            req.params.service = "default";
+            req.params.action = "exec";
+
+            expect(function () {
+                return server.handle(req, res, webview, config);
+            }).not.toThrow();
+            expect(plugin.exec).toHaveBeenCalledWith(
+                req,
+                jasmine.any(Function),
+                jasmine.any(Function),
+                req.params.args,
+                {
+                    request: req,
+                    response: res,
+                    webview: webview,
+                    config: config
+                });
+        });
+
+        it("parses url encoded args", function () {
+            var webview = "BLAHBLAHBLAH";
+
+            spyOn(plugin, "exec");
+
+            expect(function () {
+                req.params.service = "default";
+                req.params.action = "exec";
+                req.params.args = "a=1&b=2&c=3";
+
+                return server.handle(req, res, webview);
+            }).not.toThrow();
+            expect(plugin.exec).toHaveBeenCalledWith(
+                jasmine.any(Object),
+                jasmine.any(Function),
+                jasmine.any(Function),
+                {
+                    a: '1',
+                    b: '2',
+                    c: '3'
+                },
+                jasmine.any(Object)
+            );
+        });
+
+        it("parses url encoded args", function () {
+            var webview = "BLAHBLAHBLAH";
+
+            spyOn(plugin, "exec");
+
+            expect(function () {
+                req.params.service = "default";
+                req.params.action = "exec";
+                req.body = JSON.stringify({a: '1', b: '2', c: '3'});
+
+                return server.handle(req, res, webview);
+            }).not.toThrow();
+            expect(plugin.exec).toHaveBeenCalledWith(
+                jasmine.any(Object),
+                jasmine.any(Function),
+                jasmine.any(Function),
+                {
+                    a: '1',
+                    b: '2',
+                    c: '3'
+                },
+                jasmine.any(Object)
+            );
+        });
+
+        it("returns the result and code 42 when success callback called", function () {
+            spyOn(plugin, "exec").andCallFake(function (request, succ, fail, body) {
+                succ(["MyFeatureId"]);
+            });
+
+            req.params.service = "default";
+            req.params.action = "exec";
+
+            server.handle(req, res);
+            expect(res.send).toHaveBeenCalledWith(200, encodeURIComponent(JSON.stringify({
+                code: 42,
+                data: ["MyFeatureId"]
+            })));
+        });
+
+        it("returns the result and code -1 when fail callback called", function () {
+            spyOn(plugin, "exec").andCallFake(function (request, succ, fail, body) {
+                fail(-1, "ErrorMessage");
+            });
+
+            req.params.service = "default";
+            req.params.action = "exec";
+
+            server.handle(req, res);
+            expect(res.send).toHaveBeenCalledWith(200, encodeURIComponent(JSON.stringify({
+                code: -1,
+                data: null,
+                msg: "ErrorMessage"
+            })));
+        });
+    });
+
+    describe("when handling feature requests", function () {
+        var req, res;
+
+        beforeEach(function () {
+            req = {
+                params: {
+                    service: "default",
+                    action: "exec",
+                    ext: "blackberry.app",
+                    method: "getReadOnlyFields",
+                    args: null
+                },
+                headers: {
+                    host: ""
+                },
+                url: "",
+                body: "",
+                origin: ""
+            };
+            res = {
+                send: jasmine.createSpy()
+            };
+            GLOBAL.frameworkModules = ['plugin/blackberry.app/index.js', 'lib/plugins/default.js'];
+        });
+
+        afterEach(function () {
+            delete GLOBAL.frameworkModules;
+        });
+
+        it("calls the action method on the feature", function () {
+            var webview = {};
+            spyOn(applicationAPIServer, "getReadOnlyFields");
+            server.handle(req, res, webview, config);
+            expect(applicationAPIServer.getReadOnlyFields).toHaveBeenCalledWith(
+                jasmine.any(Function),
+                jasmine.any(Function),
+                req.params.args,
+                {
+                    request: req,
+                    response: res,
+                    webview: webview,
+                    config: config
+                }
+            );
+        });
+
+        it("returns the result and code 42 when success callback called", function () {
+            var expectedResult = {"getReadOnlyFields": "Yogi bear"};
+
+            spyOn(applicationAPIServer, "getReadOnlyFields").andCallFake(function (success, fail) {
+                success(expectedResult);
+            });
+
+            server.handle(req, res);
+
+            expect(res.send).toHaveBeenCalledWith(200, encodeURIComponent(JSON.stringify({
+                code: 42,
+                data: expectedResult
+            })));
+        });
+
+        it("returns the result and code -1 when fail callback called", function () {
+            var expectedResult = "omg";
+
+            spyOn(applicationAPIServer, "getReadOnlyFields").andCallFake(function (success, fail) {
+                fail(-1, expectedResult);
+            });
+
+            server.handle(req, res);
+
+            expect(res.send).toHaveBeenCalledWith(200, encodeURIComponent(JSON.stringify({
+                code: -1,
+                data: null,
+                msg: expectedResult
+            })));
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/utils.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/utils.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/utils.js
new file mode 100644
index 0000000..4b7f5a8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/utils.js
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var srcPath = __dirname + '/../../../lib/';
+
+describe("Utils", function () {
+    var utils = require(srcPath + 'utils.js');
+
+    describe("endsWith", function () {
+        it("returns true when a string ends with another", function () {
+            expect(utils.endsWith("www.smoketest9-vmyyz.labyyz.testnet.rim.net:8080", ".smoketest9-vmyyz.labyyz.testnet.rim.net:8080")).toEqual(true);
+        });
+    });
+
+    it("Verify that the filenameToImageMIME is defined", function () {
+        expect(utils.fileNameToImageMIME).toBeDefined();
+    });
+
+    it("Verify that the proper PNG MIME types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.png")).toEqual("image/png");
+    });
+
+    it("Verify that the proper period MIME types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.t.png")).toEqual("image/png");
+    });
+
+    it("Verify that the proper JPG types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.jpg")).toEqual("image/jpeg");
+    });
+
+    it("Verify that the proper GIF types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.gif")).toEqual("image/gif");
+    });
+
+    it("Verify that the proper TIFF types are returned", function () {
+        expect(utils.fileNameToImageMIME("test_test_.tif")).toEqual("image/tiff");
+    });
+
+    it("Verify that the proper TIFF types are returned", function () {
+        expect(utils.fileNameToImageMIME("test_test_.tiff")).toEqual("image/tiff");
+    });
+
+    it("Verify that the proper JPE MIME types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.jpe")).toEqual("image/jpeg");
+    });
+
+    it("Verify that the proper BMP MIME types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.bmp")).toEqual("image/bmp");
+    });
+
+    it("Verify that the proper JPEG MIME types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.jpeg")).toEqual("image/jpeg");
+    });
+
+    it("Verify that the proper SVG MIME types are returned", function () {
+        expect(utils.fileNameToImageMIME("test.svg")).toEqual("image/svg+xml");
+    });
+
+    it("has an invokeInBrowser function", function () {
+        var url = "http://www.webworks.com",
+            mockApplication = {
+                invocation: {
+                    invoke: jasmine.createSpy("invocation.invoke")
+                }
+            },
+            mockWindow = {
+                qnx: {
+                    webplatform: {
+                        getApplication: function () {
+                            return mockApplication;
+                        }
+                    }
+                }
+            };
+
+        GLOBAL.window = mockWindow;
+
+        this.after(function () {
+            delete GLOBAL.window;
+        });
+
+        expect(utils.invokeInBrowser).toBeDefined();
+
+        utils.invokeInBrowser(url);
+
+        expect(mockApplication.invocation.invoke).toHaveBeenCalledWith({
+            uri: url,
+            target: "sys.browser"
+        });
+    });
+
+    // A cascading method invoker, kinda like jWorkflow
+    describe("series", function () {
+        var tasks,
+            callbackObj,
+            seriesComplete,
+            callbackInvocations,
+            invocationCounter,
+            task;
+
+        beforeEach(function () {
+            tasks = [];
+            callbackInvocations = [];
+            invocationCounter = 0;
+            seriesComplete = false;
+            callbackObj = {
+                func: function (args) {
+                    callbackInvocations.push('done');
+                    seriesComplete = true;
+                },
+                args: []
+            };
+            task = {
+                func: function (callback) {
+                    callbackInvocations.push(invocationCounter++);
+                    callback();
+                },
+                args: []
+            };
+        });
+
+        afterEach(function () {
+            tasks = null;
+            callbackObj = null;
+            seriesComplete = null;
+            callbackInvocations = null;
+            invocationCounter = null;
+            task = null;
+        });
+
+        it('should call callback right away when there are no tasks to execute', function () {
+            spyOn(callbackObj, 'func');
+            utils.series(tasks, callbackObj);
+            expect(callbackObj.func).toHaveBeenCalled();
+        });
+
+        it('should invoke the task method before the callback', function () {
+            tasks.push(task);
+            utils.series(tasks, callbackObj);
+            waitsFor(function () {
+                return seriesComplete;
+            });
+
+            expect(callbackInvocations.length).toEqual(2);
+            expect(callbackInvocations[0]).toEqual(0);
+            expect(callbackInvocations[1]).toEqual('done');
+        });
+
+        it('should invocation the tasks in order with the callback being the last invocation', function () {
+            var i;
+
+            tasks.push(task);
+            tasks.push(task);
+            tasks.push(task);
+            tasks.push(task);
+
+            utils.series(tasks, callbackObj);
+
+            waitsFor(function () {
+                return seriesComplete;
+            });
+
+            expect(callbackInvocations.length).toEqual(5);
+
+            for (i = 0; i < 4; i++) {
+                expect(callbackInvocations[i]).toEqual(i);
+            }
+
+            expect(callbackInvocations[4]).toEqual('done');
+        });
+    });
+
+    describe("utils translate path", function () {
+        beforeEach(function () {
+            GLOBAL.window = {
+                qnx: {
+                    webplatform: {
+                        getApplication: function () {
+                            return {
+                                getEnv: function (path) {
+                                    if (path === "HOME")
+                                        return "/accounts/home";
+                                }
+                            };
+                        }
+                    }
+                }
+            };
+        });
+
+        afterEach(function () {
+            delete GLOBAL.window;
+        });
+
+        it("Expect translate path to be defined", function () {
+            expect(utils.translatePath).toBeDefined();
+        });
+        it("translate path successfully returns the original path when passed non local value", function () {
+            var path = "http://google.com";
+            path = utils.translatePath(path);
+            expect(path).toEqual("http://google.com");
+        });
+        it("translate path successfully returns the original path when passed a telephone uri", function () {
+            var path = "tel://250-654-34243";
+            path = utils.translatePath(path);
+            expect(path).toEqual("tel://250-654-34243");
+        });
+        it("translate path successfully retuns an updated string for a local path", function () {
+            var path = "local:///this-is-a-local/img/path.jpg";
+            path = utils.translatePath(path);
+            expect(path).toEqual("file:///accounts/home/../app/native/this-is-a-local/img/path.jpg");
+        });
+    });
+
+    describe("deepclone", function () {
+        it("passes through null", function () {
+            expect(utils.deepclone(null)).toBe(null);
+        });
+
+        it("passes through undefined", function () {
+            expect(utils.deepclone(undefined)).toBe(undefined);
+        });
+
+        it("passes through a Number", function () {
+            expect(utils.deepclone(1)).toBe(1);
+        });
+
+        it("passes through a String", function () {
+            var str = "hello world";
+            expect(utils.deepclone(str)).toBe(str);
+        });
+
+        it("passes through a Boolean", function () {
+            expect(utils.deepclone(true)).toBe(true);
+            expect(utils.deepclone(false)).toBe(false);
+        });
+
+        it("returns a new Date", function () {
+            var date = new Date(),
+                dateCopy = utils.deepclone(date);
+
+            expect(dateCopy instanceof Date).toBe(true, "Not a Date");
+            expect(date).not.toBe(dateCopy);
+            expect(date.getTime()).toBe(dateCopy.getTime());
+        });
+
+        it("returns a new RegExp", function () {
+            var regex = /a/,
+                regexCopy = utils.deepclone(regex);
+
+            expect(regexCopy instanceof RegExp).toBe(true, "Not a RegExp");
+            expect(regexCopy).not.toBe(regex);
+            expect(regexCopy.toString()).toBe(regex.toString());
+        });
+
+        it("copies nested Object properties", function () {
+            var obj = {
+                    a: "hello world",
+                    b: "hello again"
+                },
+                objCopy = utils.deepclone(obj);
+
+            expect(obj).not.toBe(objCopy);
+            expect(obj).toEqual(objCopy);
+        });
+    });
+});


[06/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/object.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/object.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/object.js
new file mode 100644
index 0000000..ea2cea5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/object.js
@@ -0,0 +1,76 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var object = require('../lib/object')
+  , array = require('../lib/array')
+  , assert = require('assert')
+  , tests = {}
+  , checkObjects;
+
+tests = {
+
+  'test merge in object': function () {
+    var expected = {user: 'geddy', key: 'key'}
+      , actual = object.merge({user: 'geddy'}, {key: 'key'});
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test merge with overwriting keys in object': function () {
+    var expected = {user: 'geddy', key: 'key'}
+      , actual = object.merge({user: 'geddy', key: 'geddyKey'}, {key: 'key'});
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test merge with objects as keys': function () {
+    var expected = {user: {name: 'geddy', password: 'random', key: 'key'}, key: 'key'}
+      , actual = object.merge({key: 'key'}, {user: {name: 'geddy', password: 'random', key: 'key'}});
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test reverseMerge in object': function () {
+    var expected = {user: 'geddy', key: 'key'}
+      , actual = object.reverseMerge({user: 'geddy'}, {key: 'key'});
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test reverseMerge with keys overwriting default in object': function () {
+    var expected = {user: 'geddy', key: 'geddyKey'}
+    , actual = object.reverseMerge({user: 'geddy', key: 'geddyKey'}, {key: 'key'});
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test reverseMerge with objects as keys': function () {
+    var expected = {user: {name: 'geddy', password: 'random', key: 'key'}, key: 'key'}
+      , actual = object.merge({user: {name: 'geddy', password: 'random', key: 'key'}}, {key: 'key'});
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test isEmpty with non empty object in object': function () {
+    var expected = false
+      , actual = object.isEmpty({user: 'geddy'});
+    assert.equal(actual, expected);
+  }
+
+, 'test isEmpty with empty object in object': function () {
+    var expected = true
+      , actual = object.isEmpty({});
+    assert.equal(actual, expected);
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/sorted_collection.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/sorted_collection.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/sorted_collection.js
new file mode 100644
index 0000000..2701a99
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/sorted_collection.js
@@ -0,0 +1,115 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var SortedCollection = require('../lib/sorted_collection').SortedCollection
+  , assert = require('assert')
+  , tests;
+
+tests = {
+
+  'test no default value': function () {
+    // Set up a collection, no default value for new items
+    var c = new SortedCollection();
+    // Add some items
+    c.addItem('testA', 'AAAA');
+    c.addItem('testB', 'BBBB');
+    c.addItem('testC', 'CCCC');
+    // Test count
+    assert.equal(3, c.count);
+    // Test getItem by string key
+    var item = c.getItem('testC');
+    assert.equal('CCCC', item);
+    // Test getItem by index number
+    var item = c.getItem(1);
+    assert.equal('BBBB', item);
+    // Test setItem by string key
+    c.setItem('testA', 'aaaa');
+    var item = c.getItem('testA');
+    assert.equal('aaaa', item);
+    // Test setItem by index number
+    c.setItem(2, 'cccc');
+    var item = c.getItem(2);
+    assert.equal('cccc', item);
+  }
+
+, 'test default value': function () {
+    // Set up a collection, default value for new items is 'foo'
+    var c = new SortedCollection('foo');
+    // Add an item with no value -- should get
+    // default value
+    c.addItem('testA');
+    // Add some items with empty/falsey values --
+    // should be set to desired values
+    c.addItem('testB', null);
+    c.addItem('testC', false);
+    // Test getItem for default value
+    var item = c.getItem('testA');
+    assert.equal('foo', item);
+    var item = c.getItem('testB');
+    assert.equal(null, item);
+    var item = c.getItem('testC');
+    assert.equal(false, item);
+  }
+
+, 'test each': function () {
+    var c = new SortedCollection()
+      , str = '';
+    // Add an item with no value -- should get
+    // default value
+    c.addItem('a', 'A');
+    c.addItem('b', 'B');
+    c.addItem('c', 'C');
+    c.addItem('d', 'D');
+    c.each(function (val, key) {
+      str += val + key;
+    });
+    assert.equal('AaBbCcDd', str);
+  }
+
+, 'test removing an item': function () {
+    var c = new SortedCollection()
+      , str = '';
+    // Add an item with no value -- should get
+    // default value
+    c.addItem('a', 'A');
+    c.addItem('b', 'B');
+    c.addItem('c', 'C');
+    c.addItem('d', 'D');
+    assert.equal(4, c.count);
+
+    omg = c.removeItem('c');
+    assert.equal(3, c.count);
+
+    c.each(function (val, key) {
+      str += val + key;
+    });
+    assert.equal('AaBbDd', str);
+  }
+
+, 'test clone': function () {
+    var c = new SortedCollection()
+      , copy;
+    c.addItem('a', 'A');
+    c.addItem('b', 'B');
+    copy = c.clone();
+    assert.equal(2, copy.count);
+    assert.equal('A', copy.getItem('a'));
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/string.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/string.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/string.js
new file mode 100644
index 0000000..a03027c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/string.js
@@ -0,0 +1,411 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var assert = require('assert')
+  , string = require('../lib/string')
+  , tests;
+
+tests = {
+
+  'test basic escapeXML for string': function () {
+    var expected = '&lt;html&gt;&lt;/html&gt;'
+      , actual = string.escapeXML('<html></html>');
+    assert.equal(expected, actual);
+  }
+
+, 'test all escape characters for escapeXML': function () {
+    var expected = '&lt;&gt;&amp;&quot;&#39;'
+      , actual = string.escapeXML('<>&"\'');
+    assert.equal(expected, actual);
+  }
+
+, 'test no escape characters with string for escapeXML': function () {
+    var expected = 'Geddy'
+      , actual = string.escapeXML('Geddy');
+    assert.equal(expected, actual);
+  }
+
+, 'test no escape characters with numbers for escapeXML': function () {
+    var expected = 05
+      , actual = string.escapeXML(05);
+    assert.equal(expected, actual);
+  }
+
+, 'test basic unescapeXML for string': function () {
+    var expected = '<html></html>'
+      , actual = string.unescapeXML('&lt;html&gt;&lt;/html&gt;');
+    assert.equal(expected, actual);
+  }
+
+, 'test all escape characters for unescapeXML': function () {
+    var expected = '<>&"\''
+      , actual = string.unescapeXML('&lt;&gt;&amp;&quot;&#39;');
+    assert.equal(expected, actual);
+  }
+
+, 'test no escape characters with string for unescapeXML': function () {
+    var expected = 'Geddy'
+      , actual = string.unescapeXML('Geddy');
+    assert.equal(expected, actual);
+  }
+
+, 'test no escape characters with numbers for unescapeXML': function () {
+    var expected = 05
+      , actual = string.unescapeXML(05);
+    assert.equal(expected, actual);
+  }
+
+, 'test basic needsEscape for string': function () {
+    var expected = true
+      , actual = string.needsEscape('Geddy>');
+    assert.equal(expected, actual);
+  }
+
+, 'test basic needsEscape thats false for string': function () {
+    var expected = false
+      , actual = string.needsEscape('Geddy');
+    assert.equal(expected, actual);
+  }
+
+, 'test basic needsUnescape for string': function () {
+    var expected = true
+      , actual = string.needsEscape('&quot;Geddy&quot;');
+    assert.equal(expected, actual);
+  }
+
+, 'test basic needsUnescape thats false for string': function () {
+    var expected = false
+      , actual = string.needsEscape('Geddy');
+    assert.equal(expected, actual);
+  }
+
+,  'test escapeRegExpCharacters': function () {
+    var expected = '\\^\\/\\.\\*\\+\\?\\|\\(\\)\\[\\]\\{\\}\\\\'
+      actual = string.escapeRegExpChars('^/.*+?|()[]{}\\');
+    assert.equal(expected, actual);
+  }
+
+, 'test toArray for string': function () {
+    var data = string.toArray('geddy')
+      , expected = ['g', 'e', 'd', 'd', 'y'];
+
+    // Loop through each item and check
+    // if not, then the arrays aren't _really_ the same
+    var i = expected.length;
+    while (--i >= 0) {
+      assert.equal(expected[i], data[i]);
+    }
+  }
+
+, 'test reverse for string': function () {
+    var data = string.reverse('yddeg')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test basic ltrim for string': function () {
+    var data = string.ltrim('   geddy')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test custom char ltrim for string': function () {
+    var data = string.ltrim('&&geddy', '&')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test basic rtrim for string': function () {
+    var data = string.rtrim('geddy  ')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test custom char rtrim for string': function () {
+    var data = string.rtrim('geddy&&', '&')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test basic trim for string': function () {
+    var data = string.trim(' geddy  ')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test custom char trim for string': function () {
+    var data = string.trim('&geddy&&', '&')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test chop special-case line-ending': function () {
+    var expected = 'geddy'
+      , actual = string.chop('geddy\r\n');
+    assert.equal(expected, actual);
+  }
+
+, 'test chop not actual special-case line-ending': function () {
+    var expected = 'geddy\n'
+      , actual = string.chop('geddy\n\r');
+    assert.equal(expected, actual);
+  }
+
+, 'test chop normal line-ending': function () {
+    var expected = 'geddy'
+      , actual = string.chop('geddy\n');
+    assert.equal(expected, actual);
+  }
+
+, 'test chop whatever character': function () {
+    var expected = 'gedd'
+      , actual = string.chop('geddy');
+    assert.equal(expected, actual);
+  }
+
+, 'test chop empty string': function () {
+    var expected = ''
+      , actual = string.chop('');
+    assert.equal(expected, actual);
+  }
+
+, 'test basic lpad for string': function () {
+    var data = string.lpad('geddy', '&', 7)
+      , expected = '&&geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test lpad without width for string': function () {
+    var data = string.lpad('geddy', '&')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test lpad without width of char for string': function () {
+    var data = string.lpad('geddy')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test basic rpad for string': function () {
+    var data = string.rpad('geddy', '&', 7)
+      , expected = 'geddy&&';
+    assert.equal(expected, data);
+  }
+
+, 'test rpad without width for string': function () {
+    var data = string.rpad('geddy', '&')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test rpad without width of char for string': function () {
+    var data = string.rpad('geddy')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test basic pad for string': function () {
+    var data = string.pad('geddy', '&', 7)
+      , expected = '&geddy&';
+    assert.equal(expected, data);
+  }
+
+, 'test pad without width for string': function () {
+    var data = string.pad('geddy', '&')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test pad without width of char for string': function () {
+    var data = string.pad('geddy')
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test single tags in truncateHTML': function () {
+    var str = string.truncateHTML('<p>Once upon a time in a world</p>', { length: 10 });
+    assert.equal(str, '<p>Once up...</p>');
+  }
+
+, 'test multiple tags in truncateHTML': function () {
+    var str = string.truncateHTML('<p>Once upon a time <small>in a world</small></p>', { length: 10 });
+    assert.equal(str, '<p>Once up...<small>in a wo...</small></p>');
+  }
+
+, 'test multiple tags but only truncate once in truncateHTML': function () {
+    var str = string.truncateHTML('<p>Once upon a time <small>in a world</small></p>', { length: 10, once: true });
+    assert.equal(str, '<p>Once up...<small>in a world</small></p>');
+  }
+
+, 'test standard truncate': function () {
+    var str = string.truncate('Once upon a time in a world', { length: 10 });
+    assert.equal(str, 'Once up...');
+  }
+
+, 'test custom omission in truncate': function () {
+    var str = string.truncate('Once upon a time in a world', { length: 10, omission: '///' });
+    assert.equal(str, 'Once up///');
+  }
+
+, 'test regex seperator in truncate': function () {
+    var str = string.truncate('Once upon a time in a world', { length: 15, seperator: /\s/ });
+    assert.equal(str, 'Once upon a...');
+  }
+
+, 'test string seperator in truncate': function () {
+    var str = string.truncate('Once upon a time in a world', { length: 15, seperator: ' ' });
+    assert.equal(str, 'Once upon a...');
+  }
+
+, 'test unsafe html in truncate': function () {
+    var str = string.truncate('<p>Once upon a time in a world</p>', { length: 20 });
+    assert.equal(str, '<p>Once upon a ti...');
+  }
+
+, 'test nl2br for string': function () {
+    var data = string.nl2br("geddy\n")
+      , expected = 'geddy<br />';
+    assert.equal(expected, data);
+  }
+
+, 'test snakeize for string': function () {
+    var data = string.snakeize("geddyJs")
+      , expected = 'geddy_js';
+    assert.equal(expected, data);
+  }
+
+, 'test snakeize with beginning caps for string': function () {
+    var data = string.snakeize("GeddyJs")
+      , expected = 'geddy_js';
+    assert.equal(expected, data);
+  }
+
+, 'test camelize for string': function () {
+    var data = string.camelize("geddy_js")
+      , expected = 'geddyJs';
+    assert.equal(expected, data);
+  }
+
+, 'test camelize with initialCap for string': function () {
+    var data = string.camelize("geddy_js", {initialCap: true})
+      , expected = 'GeddyJs';
+    assert.equal(expected, data);
+  }
+
+, 'test camelize with leadingUnderscore with no underscore for string': function () {
+    var data = string.camelize("geddy_js", {leadingUnderscore: true})
+      , expected = 'geddyJs';
+    assert.equal(expected, data);
+  }
+
+, 'test camelize with leadingUnderscore with underscore for string': function () {
+    var data = string.camelize("_geddy_js", {leadingUnderscore: true})
+      , expected = '_geddyJs';
+    assert.equal(expected, data);
+  }
+
+, 'test decapitalize for string': function () {
+    var data = string.decapitalize("Geddy")
+      , expected = 'geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test capitalize for string': function () {
+    var data = string.capitalize("geddy")
+      , expected = 'Geddy';
+    assert.equal(expected, data);
+  }
+
+, 'test dasherize for string': function () {
+    var data = string.dasherize("geddyJs")
+      , expected = 'geddy-js';
+    assert.equal(expected, data);
+  }
+
+, 'test dasherize with custom replace char for string': function () {
+    var data = string.dasherize("geddyJs", "_")
+      , expected = 'geddy_js';
+    assert.equal(expected, data);
+  }
+
+, 'test underscorize for string': function () {
+    var data = string.underscorize("geddyJs")
+      , expected = 'geddy_js';
+    assert.equal(expected, data);
+  }
+
+, 'test include for string with included string': function () {
+    assert.ok(string.include('foobarbaz', 'foo'));
+  }
+
+, 'test include for string with not included string': function () {
+    assert.ok(!string.include('foobarbaz', 'qux'));
+  }
+
+, 'test getInflections for string': function () {
+    var actual = string.getInflections("string")
+      , expected = {
+        filename: {
+            singular: "string"
+          , plural: "strings"
+        },
+        constructor: {
+            singular: "String"
+          , plural: "Strings"
+        },
+        property: {
+            singular: "string"
+          , plural: "strings"
+        },
+      };
+
+    assert.deepEqual(expected, actual);
+  }
+
+, 'test inflection with odd name for string': function () {
+    var actual = string.getInflections("snow_dog")
+      , expected = {
+        filename: {
+            singular: "snow_dog"
+          , plural: "snow_dogs"
+        },
+        constructor: {
+            singular: "SnowDog"
+          , plural: "SnowDogs"
+        },
+        property: {
+            singular: "snowDog"
+          , plural: "snowDogs"
+        },
+      };
+
+    assert.deepEqual(expected, actual);
+  }
+
+, 'test uuid length for string': function () {
+    var data = string.uuid(5).length
+      , expected = 5;
+    assert.equal(expected, data);
+  }
+
+};
+
+module.exports = tests;
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/uri.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/uri.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/uri.js
new file mode 100644
index 0000000..8048493
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/uri.js
@@ -0,0 +1,99 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var uri = require('../lib/uri')
+  , array = require('../lib/array')
+  , assert = require('assert')
+  , tests = {};
+
+tests = {
+
+  'test getFileExtension for uri': function () {
+    var data = uri.getFileExtension('users.json')
+      , actual = 'json';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify for uri': function () {
+    var data = uri.paramify({username: 'user', token: 'token', secret: 'secret'})
+      , actual = 'username=user&token=token&secret=secret';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify with conslidate option for uri': function () {
+    var data = uri.paramify({username: 'user', auth: ['token', 'secret']}, {conslidate: true})
+      , actual = 'username=user&auth=token&auth=secret';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify with includeEmpty option for uri': function () {
+    var data = uri.paramify({username: 'user', token: ''}, {includeEmpty: true})
+      , actual = 'username=user&token=';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify with includeEmpty as 0 option for uri': function () {
+    var data = uri.paramify({username: 'user', token: 0}, {includeEmpty: true})
+      , actual = 'username=user&token=0';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify with includeEmpty as null option for uri': function () {
+    var data = uri.paramify({username: 'user', token: null}, {includeEmpty: true})
+      , actual = 'username=user&token=';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify with includeEmpty as undefined option for uri': function () {
+    var data = uri.paramify({username: 'user', token: undefined}, {includeEmpty: true})
+      , actual = 'username=user&token=';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify with snakeize option for uri': function () {
+    var data = uri.paramify({username: 'user', authToken: 'token'}, {snakeize: true})
+      , actual = 'username=user&auth_token=token';
+    assert.equal(actual, data);
+  }
+
+, 'test paramify with escapeVals option for uri': function () {
+    var data = uri.paramify({username: 'user', token: '<token'}, {escapeVals: true})
+      , actual = 'username=user&token=%26lt%3Btoken';
+    assert.equal(actual, data);
+  }
+
+, 'test objectify for uri': function () {
+    var expected = {name: 'user'}
+      , actual = uri.objectify('name=user');
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test objectify with multiple matching keys for uri': function () {
+    var expected = {name: ['user', 'user2']}
+      , actual = uri.objectify('name=user&name=user2');
+    assert.deepEqual(actual, expected);
+  }
+
+, 'test objectify with no conslidation for uri': function () {
+    var expected= {name: 'user2'}
+      , actual = uri.objectify('name=user&name=user2', {consolidate: false});
+    assert.deepEqual(actual, expected);
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/xml.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/xml.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/xml.js
new file mode 100644
index 0000000..3bb8e83
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/xml.js
@@ -0,0 +1,122 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var XML = require('../lib/xml').XML
+  , assert = require('assert')
+  , obj
+  , xml
+  , res
+  , serialize
+  , tests;
+
+serialize = function (o) {
+  return XML.stringify(o, {whitespace: false});
+};
+
+tests = {
+
+  'test serialized object': function () {
+    obj = {foo: 'bar'};
+    xml = serialize(obj);
+    res = '<?xml version="1.0" encoding="UTF-8"?><object><foo>bar</foo></object>';
+    assert.equal(res, xml);
+  }
+
+, 'test array of numbers': function () {
+    obj = [1, 2, 3];
+    xml = serialize(obj);
+    res = '<?xml version="1.0" encoding="UTF-8"?><numbers type="array"><number>1</number><number>2</number><number>3</number></numbers>';
+    assert.equal(res, xml);
+  }
+
+, 'test array of strings': function () {
+    obj = ['foo', 'bar'];
+    xml = serialize(obj);
+    res = '<?xml version="1.0" encoding="UTF-8"?><strings type="array"><string>foo</string><string>bar</string></strings>';
+    assert.equal(res, xml);
+  }
+
+, 'test array of mixed datatypes': function () {
+    obj = ['foo', 1];
+    xml = serialize(obj);
+    res = '<?xml version="1.0" encoding="UTF-8"?><records type="array"><record>foo</record><record>1</record></records>';
+    assert.equal(res, xml);
+  }
+
+, 'test array property of an object': function () {
+    obj = {foo: ['bar', 'baz']};
+    xml = serialize(obj);
+    res = '<?xml version="1.0" encoding="UTF-8"?><object><foo type="array"><foo>bar</foo><foo>baz</foo></foo></object>';
+    assert.equal(res, xml);
+  }
+
+, 'test setIndentLevel for xml': function () {
+    var data = XML.setIndentLevel(5)
+      , actual = 5;
+    assert.equal(actual, data)
+  }
+
+, 'test stringify with object for xml': function () {
+    var data = XML.stringify({user: 'name'})
+      , actual = '<?xml version="1.0" encoding="UTF-8"?>\n<object>\n    <user>name</user>\n</object>\n';
+    assert.equal(actual, data)
+  }
+
+, 'test stringify with array for xml': function () {
+    var data = XML.stringify(['user'])
+      , actual = '<?xml version="1.0" encoding="UTF-8"?>\n<strings type="array">\n\
+    <string>user</string>\n</strings>';
+    assert.equal(actual, data)
+  }
+
+, 'test stringify with object and no whitespace for xml': function () {
+    var data = XML.stringify({user: 'name'}, {whitespace: false})
+      , actual = '<?xml version="1.0" encoding="UTF-8"?><object><user>name</user></object>';
+    assert.equal(actual, data)
+  }
+
+, 'test stringify with object and name for xml': function () {
+    var data = XML.stringify({user: 'name'}, {name: 'omg'})
+      , actual = '<?xml version="1.0" encoding="UTF-8"?>\n<omg>\n<user>name</user>\n</omg>\n';
+    assert.equal(actual, data)
+  }
+
+, 'test stringify with object and fragment for xml': function () {
+    var data = XML.stringify({user: 'name'}, {fragment: true})
+      , actual = '<object>\n<user>name</user>\n</object>\n';
+    assert.equal(actual, data)
+  }
+
+, 'test stringify with object for xml': function () {
+    var data = XML.stringify({user: 'name'}, {level: 1})
+      , actual = '<?xml version="1.0" encoding="UTF-8"?>\n         <user>name</user>\n';
+    assert.equal(actual, data)
+  }
+
+, 'test stringify with array and no arrayRoot for xml': function () {
+    var data = XML.stringify(['user'], {arrayRoot: false})
+      , actual = '<?xml version="1.0" encoding="UTF-8"?>\n<strings type="array">\n\
+<string>user</string>\n</strings>';
+    assert.equal(actual, data)
+  }
+
+
+};
+
+module.exports = tests;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/package.json b/lib/cordova-blackberry/blackberry10/node_modules/jake/package.json
new file mode 100644
index 0000000..2c9141c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/package.json
@@ -0,0 +1,37 @@
+{
+  "name": "jake",
+  "description": "JavaScript build tool, similar to Make or Rake",
+  "keywords": [
+    "build",
+    "cli",
+    "make",
+    "rake"
+  ],
+  "version": "0.5.14",
+  "author": {
+    "name": "Matthew Eernisse",
+    "email": "mde@fleegix.org",
+    "url": "http://fleegix.org"
+  },
+  "bin": {
+    "jake": "./bin/cli.js"
+  },
+  "main": "./lib/jake.js",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/mde/jake.git"
+  },
+  "preferGlobal": true,
+  "dependencies": {
+    "minimatch": "0.2.x",
+    "utilities": "0.0.x"
+  },
+  "devDependencies": {},
+  "engines": {
+    "node": "*"
+  },
+  "readme": "### Jake -- JavaScript build tool for Node.js\n\n### Installing with [NPM](http://npmjs.org/)\n\nInstall globally with:\n\n    npm install -g jake\n\nOr you may also install it as a development dependency in a package.json file:\n\n    // package.json\n    \"devDependencies\": {\n      \"jake\": \"latest\"\n    }\n\nThen install it with `npm install`\n\nNote Jake is intended to be mostly a command-line tool, but lately there have been\nchanges to it so it can be either embedded, or run from inside your project.\n\n### Installing from source\n\nPrerequisites: Jake requires [Node.js](<http://nodejs.org/>), and the\n[utilities](https://npmjs.org/package/utilities) and\n[minimatch](https://npmjs.org/package/minimatch) modules.\n\nGet Jake:\n\n    git clone git://github.com/mde/jake.git\n\nBuild Jake:\n\n    cd jake && make && sudo make install\n\nEven if you're installing Jake from source, you'll still need NPM for installing\nthe few modules Jake depends on. `make install`
  will do this automatically for\nyou.\n\nBy default Jake is installed in \"/usr/local.\" To install it into a different\ndirectory (e.g., one that doesn't require super-user privilege), pass the PREFIX\nvariable to the `make install` command.  For example, to install it into a\n\"jake\" directory in your home directory, you could use this:\n\n    make && make install PREFIX=~/jake\n\nIf do you install Jake somewhere special, you'll need to add the \"bin\" directory\nin the install target to your PATH to get access to the `jake` executable.\n\n### Windows, installing from source\n\nFor Windows users installing from source, there are some additional steps.\n\n*Assumed: current directory is the same directory where node.exe is present.*\n\nGet Jake:\n\n    git clone git://github.com/mde/jake.git node_modules/jake\n\nCopy jake.bat and jake to the same directory as node.exe\n\n    copy node_modules/jake/jake.bat jake.bat\n    copy node_modules/jake/jake jake\n\nAdd the directory of node.
 exe to the environment PATH variable.\n\n### Basic usage\n\n    jake [options ...] [env variables ...] target\n\n### Description\n\n    Jake is a simple JavaScript build program with capabilities similar to the\n    regular make or rake command.\n\n    Jake has the following features:\n        * Jakefiles are in standard JavaScript syntax\n        * Tasks with prerequisites\n        * Namespaces for tasks\n        * Async task execution\n\n### Options\n\n    -V/v\n    --version                   Display the Jake version.\n\n    -h\n    --help                      Display help message.\n\n    -f *FILE*\n    --jakefile *FILE*           Use FILE as the Jakefile.\n\n    -C *DIRECTORY*\n    --directory *DIRECTORY*     Change to DIRECTORY before running tasks.\n\n    -q\n    --quiet                     Do not log messages to standard output.\n\n    -J *JAKELIBDIR*\n    --jakelibdir *JAKELIBDIR*   Auto-import any .jake files in JAKELIBDIR.\n                                (default is 'jake
 lib')\n\n    -B\n    --always-make               Unconditionally make all targets.\n\n    -t\n    --trace                     Enable full backtrace.\n\n    -T/ls\n    --tasks                     Display the tasks (matching optional PATTERN)\n                                with descriptions, then exit.\n\n### Jakefile syntax\n\nA Jakefile is just executable JavaScript. You can include whatever JavaScript\nyou want in it.\n\n## API Docs\n\nAPI docs [can be found here](http://mde.github.com/jake/doc/).\n\n## Tasks\n\nUse `task` to define tasks. It has one required argument, the task-name, and\nthree optional arguments:\n\n```javascript\ntask(name, [prerequisites], [action], [opts]);\n```\n\nThe `name` argument is a String with the name of the task, and `prerequisites`\nis an optional Array arg of the list of prerequisite tasks to perform first.\n\nThe `action` is a Function defininng the action to take for the task. (Note that\nObject-literal syntax for name/prerequisites in a single 
 argument a la Rake is\nalso supported, but JavaScript's lack of support for dynamic keys in Object\nliterals makes it not very useful.) The action is invoked with the Task object\nitself as the execution context (i.e, \"this\" inside the action references the\nTask object).\n\nThe `opts` argument is the normal JavaScript-style 'options' object. When a\ntask's operations are asynchronous, the `async` property should be set to\n`true`, and the task must call `complete()` to signal to Jake that the task is\ndone, and execution can proceed. By default the `async` property is `false`.\n\nTasks created with `task` are always executed when asked for (or are a\nprerequisite). Tasks created with `file` are only executed if no file with the\ngiven name exists or if any of its file-prerequisites are more recent than the\nfile named by the task. Also, if any prerequisite is a regular task, the file\ntask will always be executed.\n\nUse `desc` to add a string description of the task.\n\nHere's a
 n example:\n\n```javascript\ndesc('This is the default task.');\ntask('default', function (params) {\n  console.log('This is the default task.');\n});\n\ndesc('This task has prerequisites.');\ntask('hasPrereqs', ['foo', 'bar', 'baz'], function (params) {\n  console.log('Ran some prereqs first.');\n});\n```\n\nAnd here's an example of an asynchronous task:\n\n```javascript\ndesc('This is an asynchronous task.');\ntask('asyncTask', {async: true}, function () {\n  setTimeout(complete, 1000);\n});\n```\n\nA Task is also an EventEmitter which emits the 'complete' event when it is\nfinished. This allows asynchronous tasks to be run from within other asked via\neither `invoke` or `execute`, and ensure they will complete before the rest of\nthe containing task executes. See the section \"Running tasks from within other\ntasks,\" below.\n\n### File-tasks\n\nCreate a file-task by calling `file`.\n\nFile-tasks create a file from one or more other files. With a file-task, Jake\nchecks both that
  the file exists, and also that it is not older than the files\nspecified by any prerequisite tasks. File-tasks are particularly useful for\ncompiling something from a tree of source files.\n\n```javascript\ndesc('This builds a minified JS file for production.');\nfile('foo-minified.js', ['bar', 'foo-bar.js', 'foo-baz.js'], function () {\n  // Code to concat and minify goes here\n});\n```\n\n### Directory-tasks\n\nCreate a directory-task by calling `directory`.\n\nDirectory-tasks create a directory for use with for file-tasks. Jake checks for\nthe existence of the directory, and only creates it if needed.\n\n```javascript\ndesc('This creates the bar directory for use with the foo-minified.js file-task.');\ndirectory('bar');\n```\n\nThis task will create the directory when used as a prerequisite for a file-task,\nor when run from the command-line.\n\n### Namespaces\n\nUse `namespace` to create a namespace of tasks to perform. Call it with two arguments:\n\n```javascript\nnamespace(na
 me, namespaceTasks);\n```\n\nWhere is `name` is the name of the namespace, and `namespaceTasks` is a function\nwith calls inside it to `task` or `desc` definining all the tasks for that\nnamespace.\n\nHere's an example:\n\n```javascript\ndesc('This is the default task.');\ntask('default', function () {\n  console.log('This is the default task.');\n});\n\nnamespace('foo', function () {\n  desc('This the foo:bar task');\n  task('bar', function () {\n    console.log('doing foo:bar task');\n  });\n\n  desc('This the foo:baz task');\n  task('baz', ['default', 'foo:bar'], function () {\n    console.log('doing foo:baz task');\n  });\n\n});\n```\n\nIn this example, the foo:baz task depends on the the default and foo:bar tasks.\n\n### Passing parameters to jake\n\nParameters can be passed to Jake two ways: plain arguments, and environment\nvariables.\n\nTo pass positional arguments to the Jake tasks, enclose them in square braces,\nseparated by commas, after the name of the task on the comma
 nd-line. For\nexample, with the following Jakefile:\n\n```javascript\ndesc('This is an awesome task.');\ntask('awesome', function (a, b, c) {\n  console.log(a, b, c);\n});\n```\n\nYou could run `jake` like this:\n\n    jake awesome[foo,bar,baz]\n\nAnd you'd get the following output:\n\n    foo bar baz\n\nNote that you *cannot* uses spaces between the commas separating the parameters.\n\nAny parameters passed after the Jake task that contain an equals sign (=) will\nbe added to process.env.\n\nWith the following Jakefile:\n\n```javascript\ndesc('This is an awesome task.');\ntask('awesome', function (a, b, c) {\n  console.log(a, b, c);\n  console.log(process.env.qux, process.env.frang);\n});\n```\n\nYou could run `jake` like this:\n\n    jake awesome[foo,bar,baz] qux=zoobie frang=asdf\n\nAnd you'd get the following output:\n\n    foo bar baz\n    zoobie asdf\nRunning `jake` with no arguments runs the default task.\n\n__Note for zsh users__ : you will need to escape the brackets or wra
 p in single\nquotes like this to pass parameters :\n\n    jake 'awesome[foo,bar,baz]'\n\nAn other solution is to desactivate permannently file-globbing for the `jake`\ncommand. You can do this by adding this line to your `.zshrc` file :\n\n    alias jake=\"noglob jake\"\n\n### Cleanup after all tasks run, jake 'complete' event\n\nThe base 'jake' object is an EventEmitter, and fires a 'complete' event after\nrunning all tasks.\n\nThis is sometimes useful when a task starts a process which keeps the Node\nevent-loop running (e.g., a database connection). If you know you want to stop\nthe running Node process after all tasks have finished, you can set a listener\nfor the 'complete' event, like so:\n\n```javascript\njake.addListener('complete', function () {\n  process.exit();\n});\n```\n\n### Running tasks from within other tasks\n\nJake supports the ability to run a task from within another task via the\n`invoke` and `execute` methods.\n\nThe `invoke` method will run the desired task,
  along with its prerequisites:\n\n```javascript\ndesc('Calls the foo:bar task and its prerequisites.');\ntask('invokeFooBar', function () {\n  // Calls foo:bar and its prereqs\n  jake.Task['foo:bar'].invoke();\n});\n```\n\nThe `invoke` method will only run the task once, even if you call it repeatedly.\n\n```javascript\ndesc('Calls the foo:bar task and its prerequisites.');\ntask('invokeFooBar', function () {\n  // Calls foo:bar and its prereqs\n  jake.Task['foo:bar'].invoke();\n  // Does nothing\n  jake.Task['foo:bar'].invoke();\n});\n```\n\nThe `execute` method will run the desired task without its prerequisites:\n\n```javascript\ndesc('Calls the foo:bar task without its prerequisites.');\ntask('executeFooBar', function () {\n  // Calls foo:bar without its prereqs\n  jake.Task['foo:baz'].execute();\n});\n```\n\nCalling `execute` repeatedly will run the desired task repeatedly.\n\n```javascript\ndesc('Calls the foo:bar task without its prerequisites.');\ntask('executeFooBar', funct
 ion () {\n  // Calls foo:bar without its prereqs\n  jake.Task['foo:baz'].execute();\n  // Can keep running this over and over\n  jake.Task['foo:baz'].execute();\n  jake.Task['foo:baz'].execute();\n});\n```\n\nIf you want to run the task and its prerequisites more than once, you can use\n`invoke` with the `reenable` method.\n\n```javascript\ndesc('Calls the foo:bar task and its prerequisites.');\ntask('invokeFooBar', function () {\n  // Calls foo:bar and its prereqs\n  jake.Task['foo:bar'].invoke();\n  // Does nothing\n  jake.Task['foo:bar'].invoke();\n  // Only re-runs foo:bar, but not its prerequisites\n  jake.Task['foo:bar'].reenable();\n  jake.Task['foo:bar'].invoke();\n});\n```\n\nThe `reenable` method takes a single Boolean arg, a 'deep' flag, which reenables\nthe task's prerequisites if set to true.\n\n```javascript\ndesc('Calls the foo:bar task and its prerequisites.');\ntask('invokeFooBar', function () {\n  // Calls foo:bar and its prereqs\n  jake.Task['foo:bar'].invoke();\n
   // Does nothing\n  jake.Task['foo:bar'].invoke();\n  // Re-runs foo:bar and all of its prerequisites\n  jake.Task['foo:bar'].reenable(true);\n  jake.Task['foo:bar'].invoke();\n});\n```\n\nIt's easy to pass params on to a sub-task run via `invoke` or `execute`:\n\n```javascript\ndesc('Passes params on to other tasks.');\ntask('passParams', function () {\n  var t = jake.Task['foo:bar'];\n  // Calls foo:bar, passing along current args\n  t.invoke.apply(t, arguments);\n});\n```\n\n### Managing asynchrony without prereqs (e.g., when using `invoke`)\n\nYou can mix sync and async without problems when using normal prereqs, because\nthe Jake execution loop takes care of the difference for you. But when you call\n`invoke` or `execute`, you have to manage the asynchrony yourself.\n\nHere's a correct working example:\n\n```javascript\ntask('async1', ['async2'], {async: true}, function () {\n    console.log('-- async1 start ----------------');\n    setTimeout(function () {\n        console.lo
 g('-- async1 done ----------------');\n        complete();\n    }, 1000);\n});\n\ntask('async2', {async: true}, function () {\n    console.log('-- async2 start ----------------');\n    setTimeout(function () {\n        console.log('-- async2 done ----------------');\n        complete();\n    }, 500);\n});\n\ntask('init', ['async1', 'async2'], {async: true}, function () {\n    console.log('-- init start ----------------');\n    setTimeout(function () {\n        console.log('-- init done ----------------');\n        complete();\n    }, 100);\n});\n\ntask('default', {async: true}, function () {\n  console.log('-- default start ----------------');\n  var init = jake.Task.init;\n  init.addListener('complete', function () {\n    console.log('-- default done ----------------');\n    complete();\n  });\n  init.invoke();\n});\n```\n\nYou have to declare the \"default\" task as asynchronous as well, and call\n`complete` on it when \"init\" finishes. Here's the output:\n\n    -- default start 
 ----------------\n    -- async2 start ----------------\n    -- async2 done ----------------\n    -- async1 start ----------------\n    -- async1 done ----------------\n    -- init start ----------------\n    -- init done ----------------\n    -- default done ----------------\n\nYou get what you expect -- \"default\" starts, the rest runs, and finally\n\"default\" finishes.\n\n### Evented tasks\n\nTasks are EventEmitters. They can fire 'complete' and 'error' events.\n\nIf a task called via `invoke` is asynchronous, you can set a listener on the\n'complete' event to run any code that depends on it.\n\n```javascript\ndesc('Calls the async foo:baz task and its prerequisites.');\ntask('invokeFooBaz', {async: true}, function () {\n  var t = jake.Task['foo:baz'];\n  t.addListener('complete', function () {\n    console.log('Finished executing foo:baz');\n    // Maybe run some other code\n    // ...\n    // Complete the containing task\n    complete();\n  });\n  // Kick off foo:baz\n  t.invo
 ke();\n});\n```\n\nIf you want to handle the errors in a task in some specific way, you can set a\nlistener for the 'error' event, like so:\n\n```javascript\nnamespace('vronk', function () {\n  task('groo', function () {\n    var t = jake.Task['vronk:zong'];\n    t.addListener('error', function (e) {\n      console.log(e.message);\n    });\n    t.invoke();\n  });\n\n  task('zong', function () {\n    throw new Error('OMFGZONG');\n  });\n});\n```\n\nIf no specific listener is set for the \"error\" event, errors are handled by\nJake's generic error-handling.\n\n### Aborting a task\n\nYou can abort a task by calling the `fail` function, and Jake will abort the\ncurrently running task. You can pass a customized error message to `fail`:\n\n```javascript\ndesc('This task fails.');\ntask('failTask', function () {\n  fail('Yikes. Something back happened.');\n});\n```\n\nYou can also pass an optional exit status-code to the fail command, like so:\n\n```javascript\ndesc('This task fails with a
 n exit-status of 42.');\ntask('failTaskQuestionCustomStatus', function () {\n  fail('What is the answer?', 42);\n});\n```\n\nThe process will exit with a status of 42.\n\nUncaught errors will also abort the currently running task.\n\n### Showing the list of tasks\n\nPassing `jake` the -T or --tasks flag will display the full list of tasks\navailable in a Jakefile, along with their descriptions:\n\n    $ jake -T\n    jake default       # This is the default task.\n    jake asdf          # This is the asdf task.\n    jake concat.txt    # File task, concating two files together\n    jake failure       # Failing task.\n    jake lookup        # Jake task lookup by name.\n    jake foo:bar       # This the foo:bar task\n    jake foo:fonebone  # This the foo:fonebone task\n\nSetting a value for -T/--tasks will filter the list by that value:\n\n    $ jake -T foo\n    jake foo:bar       # This the foo:bar task\n    jake foo:fonebone  # This the foo:fonebone task\n\nThe list displayed will be 
 all tasks whose namespace/name contain the filter-string.\n\n## Breaking things up into multiple files\n\nJake will automatically look for files with a .jake extension in a 'jakelib'\ndirectory in your project, and load them (via `require`) after loading your\nJakefile. (The directory name can be overridden using the -J/--jakelibdir\ncommand-line option.)\n\nThis allows you to break your tasks up over multiple files -- a good way to do\nit is one namespace per file: e.g., a `zardoz` namespace full of tasks in\n'jakelib/zardox.jake'.\n\nNote that these .jake files each run in their own module-context, so they don't\nhave access to each others' data. However, the Jake API methods, and the\ntask-hierarchy are globally available, so you can use tasks in any file as\nprerequisites for tasks in any other, just as if everything were in a single\nfile.\n\nEnvironment-variables set on the command-line are likewise also naturally\navailable to code in all files via process.env.\n\n## File-uti
 ls\n\nSince shelling out in Node is an asynchronous operation, Jake comes with a few\nuseful file-utilities with a synchronous API, that make scripting easier.\n\nThe `jake.mkdirP` utility recursively creates a set of nested directories. It\nwill not throw an error if any of the directories already exists. Here's an example:\n\n```javascript\njake.mkdirP('app/views/layouts');\n```\n\nThe `jake.cpR` utility does a recursive copy of a file or directory. It takes\ntwo arguments, the file/directory to copy, and the destination. Note that this\ncommand can only copy files and directories; it does not perform globbing (so\narguments like '*.txt' are not possible).\n\n```javascript\njake.cpR(path.join(sourceDir, '/templates'), currentDir);\n```\n\nThis would copy 'templates' (and all its contents) into `currentDir`.\n\nThe `jake.readdirR` utility gives you a recursive directory listing, giving you\noutput somewhat similar to the Unix `find` command. It only works with a\ndirectory name, an
 d does not perform filtering or globbing.\n\n```javascript\njake.readdirR('pkg');\n```\n\nThis would return an array of filepaths for all files in the 'pkg' directory,\nand all its subdirectories.\n\nThe `jake.rmRf` utility recursively removes a directory and all its contents.\n\n```javascript\njake.rmRf('pkg');\n```\n\nThis would remove the 'pkg' directory, and all its contents.\n\n## Running shell-commands: `jake.exec` and `jake.createExec`\n\nJake also provides a more general utility function for running a sequence of\nshell-commands.\n\n### `jake.exec`\n\nThe `jake.exec` command takes an array of shell-command strings, and an optional\ncallback to run after completing them. Here's an example from Jake's Jakefile,\nthat runs the tests:\n\n```javascript\ndesc('Runs the Jake tests.');\ntask('test', {async: true}, function () {\n  var cmds = [\n    'node ./tests/parseargs.js'\n  , 'node ./tests/task_base.js'\n  , 'node ./tests/file_task.js'\n  ];\n  jake.exec(cmds, {printStdout: tru
 e}, function () {\n    console.log('All tests passed.');\n    complete();\n  });\n\ndesc('Runs some apps in interactive mode.');\ntask('interactiveTask', {async: true}, function () {\n  var cmds = [\n    'node' // Node conosle\n  , 'vim' // Open Vim\n  ];\n  jake.exec(cmds, {interactive: true}, function () {\n    complete();\n  });\n});\n```\n\nIt also takes an optional options-object, with the following options:\n\n * `interactive` (tasks are interactive, trumps printStdout and\n    printStderr below, default false)\n\n * `printStdout` (print to stdout, default false)\n\n * `printStderr` (print to stderr, default false)\n\n * `breakOnError` (stop execution on error, default true)\n\nThis command doesn't pipe input between commands -- it's for simple execution.\n\n### `jake.createExec` and the evented Exec object\n\nJake also provides an evented interface for running shell commands. Calling\n`jake.createExec` returns an instance of `jake.Exec`, which is an `EventEmitter`\nthat fires
  events as it executes commands.\n\nIt emits the following events:\n\n* 'cmdStart': When a new command begins to run. Passes one arg, the command\nbeing run.\n\n* 'cmdEnd': When a command finishes. Passes one arg, the command\nbeing run.\n\n* 'stdout': When the stdout for the child-process recieves data. This streams\nthe stdout data. Passes one arg, the chunk of data.\n\n* 'stderr': When the stderr for the child-process recieves data. This streams\nthe stderr data. Passes one arg, the chunk of data.\n\n* 'error': When a shell-command exits with a non-zero status-code. Passes two\nargs -- the error message, and the status code. If you do not set an error\nhandler, and a command exits with an error-code, Jake will throw the unhandled\nerror. If `breakOnError` is set to true, the Exec object will emit and 'error'\nevent after the first error, and stop any further execution.\n\nTo begin running the commands, you have to call the `run` method on it. It also\nhas an `append` method for a
 dding new commands to the list of commands to run.\n\nHere's an example:\n\n```javascript\nvar ex = jake.createExec(['do_thing.sh'], {printStdout: true});\nex.addListener('error', function (msg, code) {\n  if (code == 127) {\n    console.log(\"Couldn't find do_thing script, trying do_other_thing\");\n    ex.append('do_other_thing.sh');\n  }\n  else {\n    fail('Fatal error: ' + msg, code);\n  }\n});\nex.run();\n```\n\nUsing the evented Exec object gives you a lot more flexibility in running shell\ncommmands. But if you need something more sophisticated, Procstreams\n(<https://github.com/polotek/procstreams>) might be a good option.\n\n## Logging and output\n\nUsing the -q/--quiet flag at the command-line will stop Jake from sending its\nnormal output to standard output. Note that this only applies to built-in output\nfrom Jake; anything you output normally from your tasks will still be displayed.\n\nIf you want to take advantage of the -q/--quiet flag in your own programs, you\ncan 
 use `jake.logger.log` and `jake.logger.error` for displaying output. These\ntwo commands will respect the flag, and suppress output correctly when the\nquiet-flag is on.\n\nYou can check the current value of this flag in your own tasks by using\n`jake.program.opts.quiet`. If you want the output of a `jake.exec` shell-command\nto respect the quiet-flag, set your `printStdout` and `printStderr` options to\nfalse if the quiet-option is on:\n\n```javascript\ntask('echo', {async: true}, function () {\n  jake.exec(['echo \"hello\"'], function () {\n    jake.logger.log('Done.');\n    complete();\n  }, {printStdout: !jake.program.opts.quiet});\n});\n```\n\n## PackageTask\n\nInstantiating a PackageTask programmically creates a set of tasks for packaging\nup your project for distribution. Here's an example:\n\n```javascript\nvar t = new jake.PackageTask('fonebone', 'v0.1.2112', function () {\n  var fileList = [\n    'Jakefile'\n  , 'README.md'\n  , 'package.json'\n  , 'lib/*'\n  , 'bin/*'\n  
 , 'tests/*'\n  ];\n  this.packageFiles.include(fileList);\n  this.needTarGz = true;\n  this.needTarBz2 = true;\n});\n```\n\nThis will automatically create a 'package' task that will assemble the specified\nfiles in 'pkg/fonebone-v0.1.2112,' and compress them according to the specified\noptions. After running `jake package`, you'll have the following in pkg/:\n\n    fonebone-v0.1.2112\n    fonebone-v0.1.2112.tar.bz2\n    fonebone-v0.1.2112.tar.gz\n\nPackageTask also creates a 'clobber' task that removes the pkg/\ndirectory.\n\nThe [PackageTask API\ndocs](http://mde.github.com/jake/doc/symbols/jake.PackageTask.html) include a\nlot more information, including different archiving options.\n\n### FileList\n\nJake's FileList takes a list of glob-patterns and file-names, and lazy-creates a\nlist of files to include. Instead of immediately searching the filesystem to\nfind the files, a FileList holds the pattern until it is actually used.\n\nWhen any of the normal JavaScript Array methods (
 or the `toArray` method) are\ncalled on the FileList, the pending patterns are resolved into an actual list of\nfile-names. FileList uses the [minimatch](https://github.com/isaacs/minimatch) module.\n\nTo build the list of files, use FileList's `include` and `exclude` methods:\n\n```javascript\nvar list = new jake.FileList();\nlist.include('foo/*.txt');\nlist.include(['bar/*.txt', 'README.md']);\nlist.include('Makefile', 'package.json');\nlist.exclude('foo/zoobie.txt');\nlist.exclude(/foo\\/src.*.txt/);\nconsole.log(list.toArray());\n```\n\nThe `include` method can be called either with an array of items, or multiple\nsingle parameters. Items can be either glob-patterns, or individual file-names.\n\nThe `exclude` method will prevent files from being included in the list. These\nfiles must resolve to actual files on the filesystem. It can be called either\nwith an array of items, or mutliple single parameters. Items can be\nglob-patterns, individual file-names, string-representations
  of\nregular-expressions, or regular-expression literals.\n\n## TestTask\n\nInstantiating a TestTask programmically creates a simple task for running tests\nfor your project. The first argument of the constructor is the project-name\n(used in the description of the task), and the second argument is a function\nthat defines the task. It allows you to specifify what files to run as tests,\nand what to name the task that gets created (defaults to \"test\" if unset).\n\n```javascript\nvar t = new jake.TestTask('fonebone', function () {\n  var fileList = [\n    'tests/*'\n  , 'lib/adapters/**/test.js'\n  ];\n  this.testFiles.include(fileList);\n  this.testFiles.exclude('tests/helper.js');\n  this.testName = 'testMainAndAdapters';\n});\n```\n\nTests in the specified file should be in the very simple format of\ntest-functions hung off the export. These tests are converted into Jake tasks\nwhich Jake then runs normally.\n\nIf a test needs to run asynchronously, simply define the test-functi
 on with a\nsingle argument, a callback. Jake will define this as an asynchronous task, and\nwill wait until the callback is called in the test function to run the next test.\n\nHere's an example test-file:\n\n```javascript\nvar assert = require('assert')\n  , tests;\n\ntests = {\n  'sync test': function () {\n    // Assert something\n    assert.ok(true);\n  }\n, 'async test': function (next) {\n    // Assert something else\n    assert.ok(true);\n    // Won't go next until this is called\n    next();\n  }\n, 'another sync test': function () {\n    // Assert something else\n    assert.ok(true);\n  }\n};\n\nmodule.exports = tests;\n```\n\nJake's tests are also a good example of use of a TestTask.\n\n## NpmPublishTask\n\nThe NpmPublishTask builds on top of PackageTask to allow you to do a version\nbump of your project, package it, and publish it to NPM. Define the task with\nyour project's name, and the list of files you want packaged and published to\nNPM.\n\nHere's an example from Jak
 e's Jakefile:\n\n```javascript\nvar p = new jake.NpmPublishTask('jake', [\n  'Makefile'\n, 'Jakefile'\n, 'README.md'\n, 'package.json'\n, 'lib/*'\n, 'bin/*'\n, 'tests/*'\n]);\n```\n\nThe NpmPublishTask will automatically create a `publish` task which performs the\nfollowing steps:\n\n1. Bump the version number in your package.json\n2. Commit change in git, push it to GitHub\n3. Create a git tag for the version\n4. Push the tag to GitHub\n5. Package the new version of your project\n6. Publish it to NPM\n7. Clean up the package\n\n## CoffeeScript Jakefiles\n\nJake can also handle Jakefiles in CoffeeScript. Be sure to make it\nJakefile.coffee so Jake knows it's in CoffeeScript.\n\nHere's an example:\n\n```coffeescript\nutil = require('util')\n\ndesc 'This is the default task.'\ntask 'default', (params) ->\n  console.log 'Ths is the default task.'\n  console.log(util.inspect(arguments))\n  jake.Task['new'].invoke []\n\ntask 'new', ->\n  console.log 'ello from new'\n  jake.Task['foo:next
 '].invoke ['param']\n\nnamespace 'foo', ->\n  task 'next', (param) ->\n    console.log 'ello from next with param: ' + param\n```\n\n## Related projects\n\nJames Coglan's \"Jake\": <http://github.com/jcoglan/jake>\n\nConfusingly, this is a Ruby tool for building JavaScript packages from source code.\n\n280 North's Jake: <http://github.com/280north/jake>\n\nThis is also a JavaScript port of Rake, which runs on the Narwhal platform.\n\n### License\n\nLicensed under the Apache License, Version 2.0\n(<http://www.apache.org/licenses/LICENSE-2.0>)\n",
+  "readmeFilename": "README.md",
+  "_id": "jake@0.5.14",
+  "_from": "jake@*"
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/Jakefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/Jakefile b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/Jakefile
new file mode 100644
index 0000000..7e49ab2
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/Jakefile
@@ -0,0 +1,214 @@
+var exec = require('child_process').exec
+  , fs = require('fs');
+
+desc('The default task.');
+task('default', function () {
+  console.log('default task');
+});
+
+desc('No action.');
+task({'noAction': ['default']});
+
+desc('No action, no prereqs.');
+task('noActionNoPrereqs');
+
+desc('Accepts args and env vars.');
+task('argsEnvVars', function () {
+  var res = {
+    args: arguments
+  , env: {
+      foo: process.env.foo
+    , baz: process.env.baz
+    }
+  };
+  console.log(JSON.stringify(res));
+});
+
+namespace('foo', function () {
+  desc('The foo:bar task.');
+  task('bar', function () {
+    if (arguments.length) {
+      console.log('foo:bar[' +
+          Array.prototype.join.call(arguments, ',') +
+          '] task');
+    }
+    else {
+      console.log('foo:bar task');
+    }
+  });
+
+  desc('The foo:baz task, calls foo:bar as a prerequisite.');
+  task('baz', ['foo:bar'], function () {
+    console.log('foo:baz task');
+  });
+
+  desc('The foo:qux task, calls foo:bar with cmdline args as a prerequisite.');
+  task('qux', ['foo:bar[asdf,qwer]'], function () {
+    console.log('foo:qux task');
+  });
+
+  desc('The foo:frang task, calls foo:bar with passed args as a prerequisite.');
+  task('frang', function () {
+    var task = jake.Task['foo:bar'];
+    // Do args pass-through
+    task.invoke.apply(task, arguments);
+    console.log('foo:frang task');
+  });
+
+  desc('The foo:zoobie task, has no prerequisites.');
+  task('zoobie', function () {
+    console.log('foo:zoobie task');
+  });
+
+  desc('The foo:voom task, has no prerequisites.');
+  task('voom', function () {
+    console.log('foo:voom task');
+  });
+
+  desc('The foo:asdf task, has the same prereq twice.');
+  task('asdf', ['foo:bar', 'foo:baz'], function () {
+    console.log('foo:asdf task');
+  });
+
+});
+
+namespace('bar', function () {
+  desc('The bar:foo task, has no prerequisites, is async.');
+  task('foo', function () {
+    console.log('bar:foo task');
+    complete();
+  }, {async: true});
+
+  desc('The bar:bar task, has the async bar:foo task as a prerequisite.');
+  task('bar', ['bar:foo'], function () {
+    console.log('bar:bar task');
+  });
+
+});
+
+namespace('hoge', function () {
+  desc('The hoge:hoge task, has no prerequisites.');
+  task('hoge', function () {
+    console.log('hoge:hoge task');
+  });
+
+  desc('The hoge:piyo task, has no prerequisites.');
+  task('piyo', function () {
+    console.log('hoge:piyo task');
+  });
+
+  desc('The hoge:fuga task, has hoge:hoge and hoge:piyo as prerequisites.');
+  task('fuga', ['hoge:hoge', 'hoge:piyo'], function () {
+    console.log('hoge:fuga task');
+  });
+
+  desc('The hoge:charan task, has hoge:fuga as a prerequisite.');
+  task('charan', ['hoge:fuga'], function () {
+    console.log('hoge:charan task');
+  });
+
+  desc('The hoge:gero task, has hoge:fuga as a prerequisite.');
+  task('gero', ['hoge:fuga'], function () {
+    console.log('hoge:gero task');
+  });
+
+  desc('The hoge:kira task, has hoge:charan and hoge:gero as prerequisites.');
+  task('kira', ['hoge:charan', 'hoge:gero'], function () {
+    console.log('hoge:kira task');
+  });
+
+});
+
+namespace('fileTest', function () {
+  directory('foo');
+
+  desc('File task, concatenating two files together');
+  file({'foo/concat.txt': ['fileTest:foo', 'fileTest:foo/src1.txt', 'fileTest:foo/src2.txt']}, function () {
+    console.log('fileTest:foo/concat.txt task');
+    var data1 = fs.readFileSync('foo/src1.txt');
+    var data2 = fs.readFileSync('foo/src2.txt');
+    fs.writeFileSync('foo/concat.txt', data1 + data2);
+  });
+
+  desc('File task, async creation with child_process.exec');
+  file('foo/src1.txt', function () {
+    fs.writeFile('foo/src1.txt', 'src1', function (err) {
+      if (err) {
+        throw err;
+      }
+      console.log('fileTest:foo/src1.txt task');
+      complete();
+    });
+  }, {async: true});
+
+  desc('File task, sync creation with writeFileSync');
+  file('foo/src2.txt', ['default'], function () {
+    fs.writeFileSync('foo/src2.txt', 'src2');
+    console.log('fileTest:foo/src2.txt task');
+  });
+
+  desc('File task, do not run unless the prereq file changes');
+  file('foo/from-src1.txt', ['fileTest:foo', 'fileTest:foo/src1.txt'], function () {
+    var data = fs.readFileSync('foo/src1.txt');
+    fs.writeFileSync('foo/from-src1.txt', data);
+    console.log('fileTest:foo/from-src1.txt task');
+  }, {async: true});
+
+  desc('File task, run if the prereq file changes');
+  task('touch-prereq', function() {
+    fs.writeFileSync('foo/prereq.txt', 'UPDATED');
+  })
+
+  desc('File task, has a preexisting file (with no associated task) as a prereq');
+  file('foo/from-prereq.txt', ['fileTest:foo', 'foo/prereq.txt'], function () {
+    var data = fs.readFileSync('foo/prereq.txt');
+    fs.writeFileSync('foo/from-prereq.txt', data);
+    console.log('fileTest:foo/from-prereq.txt task');
+  });
+
+  directory('foo/bar/baz');
+
+  desc('Write a file in a nested subdirectory');
+  file('foo/bar/baz/bamf.txt', ['foo/bar/baz'], function () {
+    fs.writeFileSync('foo/bar/baz/bamf.txt', 'w00t');
+  });
+
+});
+
+task('blammo');
+// Define task
+task('voom', ['blammo'], function () {
+  console.log(this.prereqs.length);
+});
+
+// Modify, add a prereq
+task('voom', ['noActionNoPrereqs']);
+
+namespace('vronk', function () {
+  task('groo', function () {
+    var t = jake.Task['vronk:zong'];
+    t.addListener('error', function (e) {
+      console.log(e.message);
+    });
+    t.invoke();
+  });
+  task('zong', function () {
+    throw new Error('OMFGZONG');
+  });
+});
+
+// define namespace
+namespace('one', function() {
+  task('one', function() {
+    console.log('one:one');
+  });
+});
+
+// modify namespace (add task)
+namespace('one', function() {
+  task('two', ['one:one'], function() {
+    console.log('one:two');
+  });
+});
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/exec.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/exec.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/exec.js
new file mode 100644
index 0000000..0dec945
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/exec.js
@@ -0,0 +1,113 @@
+var assert = require('assert')
+  , h = require('./helpers')
+  , jake = {}
+  , utils = require('../lib/utils');
+
+utils.mixin(jake, utils);
+
+var tests = {
+  'before': function () {
+    process.chdir('./test');
+  }
+
+, 'after': function () {
+    process.chdir('../');
+  }
+
+, 'test basic exec': function (next) {
+    var ex = jake.createExec('ls', function () {})
+      , evts = { // Events should fire in this order
+          cmdStart: [0, null]
+        , stdout: [1, null]
+        , cmdEnd: [2, null]
+        , end: [3, null]
+        }
+      , incr = 0; // Increment with each event to check order
+    assert.ok(ex instanceof jake.Exec);
+    // Make sure basic events fire and fire in the right order
+    for (var p in evts) {
+      (function (p) {
+        ex.addListener(p, function () {
+          evts[p][1] = incr;
+          incr++;
+        });
+      })(p);
+    }
+    ex.run();
+    ex.addListener('end', function () {
+      for (var p in evts) {
+        assert.equal(evts[p][0], evts[p][1]);
+      }
+      next();
+    });
+
+  }
+
+, 'test an exec failure': function (next) {
+    var ex = jake.createExec('false', function () {});
+    ex.addListener('error', function (msg, code) {
+      assert.equal(1, code);
+      next();
+    });
+    ex.run();
+  }
+
+, 'test exec stdout events': function (next) {
+    var ex = jake.createExec('echo "foo"', function () {});
+    ex.addListener('stdout', function (data) {
+      assert.equal("foo", h.trim(data.toString()));
+      next();
+    });
+    ex.run();
+  }
+
+, 'test exec stderr events': function (next) {
+    var ex = jake.createExec('echo "foo" 1>&2', function () {});
+    ex.addListener('stderr', function (data) {
+      assert.equal("foo", h.trim(data.toString()));
+      next();
+    });
+    ex.run();
+  }
+
+, 'test piping results into next command': function (next) {
+    var ex = jake.createExec('ls', function () {})
+      , data
+      , appended = false;
+
+    ex.addListener('stdout', function (d) {
+      data += h.trim(d.toString());
+    });
+
+    // After the first command ends, get the accumulated result,
+    // and use it to build a new command to append to the queue.
+    // Grep through the result for files that end in .js
+    ex.addListener('cmdEnd', function () {
+      // Only append after the first cmd, avoid infinite loop
+      if (appended) {
+        return;
+      }
+      appended = true;
+      // Take the original output and build the new command
+      ex.append('echo "' + data + '" | grep "\\.js$"');
+      // Clear out data
+      data = '';
+    });
+
+    // And the end, the stdout data has been cleared once, and the new
+    // data should be the result of the second command
+    ex.addListener('end', function () {
+      // Should be a list of files ending in .js
+      data = data.split('\n');
+      data.forEach(function (d) {
+        assert.ok(/\.js$/.test(d));
+      });
+      next();
+    });
+    ex.run();
+  }
+
+};
+
+module.exports = tests;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/file_task.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/file_task.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/file_task.js
new file mode 100644
index 0000000..f279100
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/file_task.js
@@ -0,0 +1,123 @@
+var assert = require('assert')
+  , fs = require('fs')
+  , path = require('path')
+  , exec = require('child_process').exec
+  , h = require('./helpers');
+
+var cleanUpAndNext = function (callback) {
+  exec('rm -fr ./foo', function (err, stdout, stderr) {
+    if (err) { throw err }
+    if (stderr || stdout) {
+      console.log (stderr || stdout);
+    }
+    callback();
+  });
+};
+
+var tests = {
+
+  'before': function (next) {
+    process.chdir('./test');
+    cleanUpAndNext(next);
+  }
+
+, 'after': function () {
+    process.chdir('../');
+  }
+
+, 'test concating two files': function (next) {
+    h.exec('../bin/cli.js fileTest:foo/concat.txt', function (out) {
+      var data;
+      assert.equal('fileTest:foo/src1.txt task\ndefault task\nfileTest:foo/src2.txt task\n' +
+          'fileTest:foo/concat.txt task', out);
+      // Check to see the two files got concat'd
+      data = fs.readFileSync(process.cwd() + '/foo/concat.txt');
+      assert.equal('src1src2', data.toString());
+      cleanUpAndNext(next);
+    });
+  }
+
+, 'test where a file-task prereq does not change': function (next) {
+    h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {
+      assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task', out);
+      h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {
+        // Second time should be a no-op
+        assert.equal('', out);
+        next(); // Don't clean up
+      });
+    });
+  }
+
+, 'file-task where prereq file is modified': function (next) {
+    setTimeout(function () {
+      exec('touch ./foo/src1.txt', function (err, data) {
+        if (err) {
+          throw err;
+        }
+        h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {
+          assert.equal('fileTest:foo/from-src1.txt task', out);
+          cleanUpAndNext(next);
+        });
+      });
+    }, 1000); // Wait to do the touch to ensure mod-time is different
+  }
+
+, 'test where a file-task prereq does not change with --always-make': function (next) {
+    h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {
+      assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task',
+        out);
+      h.exec('../bin/cli.js -B fileTest:foo/from-src1.txt', function (out) {
+        assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task',
+          out);
+        cleanUpAndNext(next);
+      });
+    });
+  }
+
+, 'test a preexisting file': function (next) {
+    var prereqData = 'howdy';
+    h.exec('mkdir -p foo', function (out) {
+      fs.writeFileSync('foo/prereq.txt', prereqData);
+      h.exec('../bin/cli.js fileTest:foo/from-prereq.txt', function (out) {
+        var data;
+        assert.equal('fileTest:foo/from-prereq.txt task', out);
+        data = fs.readFileSync(process.cwd() + '/foo/from-prereq.txt');
+        assert.equal(prereqData, data.toString());
+        h.exec('../bin/cli.js fileTest:foo/from-prereq.txt', function (out) {
+          // Second time should be a no-op
+          assert.equal('', out);
+          cleanUpAndNext(next);
+        });
+      });
+    });
+  }
+
+, 'test a preexisting file with --always-make flag': function (next) {
+    var prereqData = 'howdy';
+    h.exec('mkdir -p foo', function (out) {
+      fs.writeFileSync('foo/prereq.txt', prereqData);
+      h.exec('../bin/cli.js fileTest:foo/from-prereq.txt', function (out) {
+        var data;
+        assert.equal('fileTest:foo/from-prereq.txt task', out);
+        data = fs.readFileSync(process.cwd() + '/foo/from-prereq.txt');
+        assert.equal(prereqData, data.toString());
+        h.exec('../bin/cli.js -B fileTest:foo/from-prereq.txt', function (out) {
+          assert.equal('fileTest:foo/from-prereq.txt task', out);
+          cleanUpAndNext(next);
+        });
+      });
+    });
+  }
+
+, 'test nested directory-task': function (next) {
+    h.exec('../bin/cli.js fileTest:foo/bar/baz/bamf.txt', function (out) {
+      data = fs.readFileSync(process.cwd() + '/foo/bar/baz/bamf.txt');
+      assert.equal('w00t', data);
+      cleanUpAndNext(next);
+    });
+  }
+
+};
+
+module.exports = tests;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/foo.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/foo.html b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/foo.html
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/foo.txt
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/foo.txt b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/foo.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/helpers.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/helpers.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/helpers.js
new file mode 100644
index 0000000..34e540e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/helpers.js
@@ -0,0 +1,59 @@
+var exec = require('child_process').exec;
+
+var helpers = new (function () {
+  var _tests
+    , _names = []
+    , _name
+    , _callback
+    , _runner = function () {
+        if (!!(_name = _names.shift())) {
+          console.log('Running ' + _name);
+          _tests[_name]();
+        }
+        else {
+          _callback();
+        }
+      };
+
+  this.exec = function (cmd, callback) {
+    cmd += ' --trace';
+    exec(cmd, function (err, stdout, stderr) {
+      var out = helpers.trim(stdout);
+      if (err) {
+        throw err;
+      }
+      if (stderr) {
+        callback(stderr);
+      }
+      else {
+        callback(out);
+      }
+    });
+  };
+
+  this.trim = function (s) {
+    var str = s || '';
+    return str.replace(/^\s*|\s*$/g, '');
+  };
+
+  this.parse = function (s) {
+    var str = s || '';
+    str = helpers.trim(str);
+    str = str.replace(/'/g, '"');
+    return JSON.parse(str);
+  };
+
+  this.run = function (tests, callback) {
+    _tests = tests;
+    _names = Object.keys(tests);
+    _callback = callback;
+    _runner();
+  };
+
+  this.next = function () {
+    _runner();
+  };
+
+})();
+
+module.exports = helpers;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/namespace.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/namespace.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/namespace.js
new file mode 100644
index 0000000..d255d4e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/namespace.js
@@ -0,0 +1,27 @@
+var assert = require('assert')
+  , h = require('./helpers')
+  , jake = {}
+  , utils = require('../lib/utils');
+
+utils.mixin(jake, utils);
+
+var tests = {
+  'before': function() {
+    process.chdir('./test');
+  }
+
+, 'after': function() {
+    process.chdir('../');
+  }
+
+, 'test modifying a namespace by adding a new task': function(next) {
+    h.exec('../bin/cli.js one:two', function(out) {
+      assert.equal('one:one\none:two', out);
+      next();
+    });
+  }
+
+};
+
+module.exports = tests;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/parseargs.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/parseargs.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/parseargs.js
new file mode 100644
index 0000000..5997d07
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/parseargs.js
@@ -0,0 +1,150 @@
+var parseargs = require('../lib/parseargs')
+  , assert = require('assert')
+  , optsReg = [
+      { full: 'directory'
+      , abbr: 'C'
+      , preempts: false
+      , expectValue: true
+      }
+    , { full: 'jakefile'
+      , abbr: 'f'
+      , preempts: false
+      , expectValue: true
+      }
+    , { full: 'tasks'
+      , abbr: 'T'
+      , preempts: true
+      }
+    , { full: 'tasks'
+      , abbr: 'ls'
+      , preempts: true
+      }
+    , { full: 'trace'
+      , abbr: 't'
+      , preempts: false
+      , expectValue: false
+      }
+    , { full: 'help'
+      , abbr: 'h'
+      , preempts: true
+      }
+    , { full: 'version'
+      , abbr: 'V'
+      , preempts: true
+      }
+    ]
+  , p = new parseargs.Parser(optsReg)
+  , z = function (s) { return s.split(' '); }
+  , res;
+
+var tests = {
+
+  'test long preemptive opt and val with equal-sign, ignore further opts': function () {
+    res = p.parse(z('--tasks=foo --jakefile=asdf'));
+    assert.equal('foo', res.opts.tasks);
+    assert.equal(undefined, res.opts.jakefile);
+  }
+
+, 'test long preemptive opt and val without equal-sign, ignore further opts': function () {
+    res = p.parse(z('--tasks foo --jakefile=asdf'));
+    assert.equal('foo', res.opts.tasks);
+    assert.equal(undefined, res.opts.jakefile);
+  }
+
+, 'test long preemptive opt and no val, ignore further opts': function () {
+    res = p.parse(z('--tasks --jakefile=asdf'));
+    assert.equal(true, res.opts.tasks);
+    assert.equal(undefined, res.opts.jakefile);
+  }
+
+, 'test preemptive opt with no val, should be true': function () {
+    res = p.parse(z('-T'));
+    assert.equal(true, res.opts.tasks);
+  }
+
+, 'test preemptive opt with no val, should be true and ignore further opts': function () {
+    res = p.parse(z('-T -f'));
+    assert.equal(true, res.opts.tasks);
+    assert.equal(undefined, res.opts.jakefile);
+  }
+
+, 'test preemptive opt with val, should be val': function () {
+    res = p.parse(z('-T zoobie -f foo/bar/baz'));
+    assert.equal('zoobie', res.opts.tasks);
+    assert.equal(undefined, res.opts.jakefile);
+  }
+
+, 'test -f expects a value, -t does not (howdy is task-name)': function () {
+    res = p.parse(z('-f zoobie -t howdy'));
+    assert.equal('zoobie', res.opts.jakefile);
+    assert.equal(true, res.opts.trace);
+    assert.equal('howdy', res.taskNames[0]);
+  }
+
+, 'test different order, -f expects a value, -t does not (howdy is task-name)': function () {
+    res = p.parse(z('-f zoobie howdy -t'));
+    assert.equal('zoobie', res.opts.jakefile);
+    assert.equal(true, res.opts.trace);
+    assert.equal('howdy', res.taskNames[0]);
+  }
+
+, 'test -f expects a value, -t does not (foo=bar is env var)': function () {
+    res = p.parse(z('-f zoobie -t foo=bar'));
+    assert.equal('zoobie', res.opts.jakefile);
+    assert.equal(true, res.opts.trace);
+    assert.equal('bar', res.envVars.foo);
+    assert.equal(undefined, res.taskName);
+  }
+
+, 'test -f expects a value, -t does not (foo=bar is env-var, task-name follows)': function () {
+    res = p.parse(z('-f zoobie -t howdy foo=bar'));
+    assert.equal('zoobie', res.opts.jakefile);
+    assert.equal(true, res.opts.trace);
+    assert.equal('bar', res.envVars.foo);
+    assert.equal('howdy', res.taskNames[0]);
+  }
+
+, 'test -t does not expect a value, -f does (throw howdy away)': function () {
+    res = p.parse(z('-t howdy -f zoobie'));
+    assert.equal(true, res.opts.trace);
+    assert.equal('zoobie', res.opts.jakefile);
+    assert.equal(undefined, res.taskName);
+
+  }
+
+, 'test --trace does not expect a value, -f does (throw howdy away)': function () {
+    res = p.parse(z('--trace howdy --jakefile zoobie'));
+    assert.equal(true, res.opts.trace);
+    assert.equal('zoobie', res.opts.jakefile);
+    assert.equal(undefined, res.taskName);
+  }
+
+, 'test --trace does not expect a value, -f does (throw howdy away)': function () {
+    res = p.parse(z('--trace=howdy --jakefile=zoobie'));
+    assert.equal(true, res.opts.trace);
+    assert.equal('zoobie', res.opts.jakefile);
+    assert.equal(undefined, res.taskName);
+  }
+
+/*
+, 'test task-name with positional args': function () {
+    res = p.parse(z('foo:bar[asdf,qwer]'));
+    assert.equal('asdf', p.taskArgs[0]);
+    assert.equal('qwer', p.taskArgs[1]);
+  }
+
+, 'test opts, env vars, task-name with positional args': function () {
+    res = p.parse(z('-f ./tests/Jakefile -t default[asdf,qwer] foo=bar'));
+    assert.equal('./tests/Jakefile', res.opts.jakefile);
+    assert.equal(true, res.opts.trace);
+    assert.equal('bar', res.envVars.foo);
+    assert.equal('default', res.taskName);
+    assert.equal('asdf', p.taskArgs[0]);
+    assert.equal('qwer', p.taskArgs[1]);
+  }
+*/
+
+};
+
+module.exports = tests;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/test/task_base.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/test/task_base.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/task_base.js
new file mode 100644
index 0000000..7d4269e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/test/task_base.js
@@ -0,0 +1,137 @@
+var assert = require('assert')
+  , h = require('./helpers');
+
+var tests = {
+
+  'before': function () {
+    process.chdir('./test');
+  }
+
+, 'after': function () {
+    process.chdir('../');
+  }
+
+, 'test default task': function (next) {
+    h.exec('../bin/cli.js', function (out) {
+      assert.equal('default task', out);
+      h.exec('../bin/cli.js default', function (out) {
+        assert.equal('default task', out);
+        next();
+      });
+    });
+  }
+
+, 'test task with no action': function (next) {
+    h.exec('../bin/cli.js noAction', function (out) {
+      assert.equal('default task', out);
+      next();
+    });
+  }
+
+, 'test a task with no action and no prereqs': function (next) {
+    h.exec('../bin/cli.js noActionNoPrereqs', function () {
+      next();
+    });
+  }
+
+, 'test passing args to a task': function (next) {
+    h.exec('../bin/cli.js argsEnvVars[foo,bar]', function (out) {
+      var parsed = h.parse(out)
+        , args = parsed.args;
+      assert.equal(args[0], 'foo');
+      assert.equal(args[1], 'bar');
+      next();
+    });
+  }
+
+, 'test a task with environment vars': function (next) {
+    h.exec('../bin/cli.js argsEnvVars foo=bar baz=qux', function (out) {
+      var parsed = h.parse(out)
+        , env = parsed.env;
+      assert.equal(env.foo, 'bar');
+      assert.equal(env.baz, 'qux');
+      next();
+    });
+  }
+
+, 'test passing args and using environment vars': function (next) {
+    h.exec('../bin/cli.js argsEnvVars[foo,bar] foo=bar baz=qux', function (out) {
+      var parsed = h.parse(out)
+        , args = parsed.args
+        , env = parsed.env;
+      assert.equal(args[0], 'foo');
+      assert.equal(args[1], 'bar');
+      assert.equal(env.foo, 'bar');
+      assert.equal(env.baz, 'qux');
+      next();
+    });
+  }
+
+, 'test a simple prereq': function (next) {
+    h.exec('../bin/cli.js foo:baz', function (out) {
+      assert.equal('foo:bar task\nfoo:baz task', out);
+      next();
+    });
+  }
+
+, 'test a duplicate prereq only runs once': function (next) {
+    h.exec('../bin/cli.js foo:asdf', function (out) {
+      assert.equal('foo:bar task\nfoo:baz task\nfoo:asdf task', out);
+      next();
+    });
+  }
+
+, 'test a prereq with command-line args': function (next) {
+    h.exec('../bin/cli.js foo:qux', function (out) {
+      assert.equal('foo:bar[asdf,qwer] task\nfoo:qux task', out);
+      next();
+    });
+  }
+
+, 'test a prereq with args via invoke': function (next) {
+    h.exec('../bin/cli.js foo:frang[zxcv,uiop]', function (out) {
+      assert.equal('foo:bar[zxcv,uiop] task\nfoo:frang task', out);
+      next();
+    });
+  }
+
+, 'test prereq execution-order': function (next) {
+    h.exec('../bin/cli.js hoge:fuga', function (out) {
+      assert.equal('hoge:hoge task\nhoge:piyo task\nhoge:fuga task', out);
+      next();
+    });
+  }
+
+, 'test basic async task': function (next) {
+    h.exec('../bin/cli.js bar:bar', function (out) {
+      assert.equal('bar:foo task\nbar:bar task', out);
+      next();
+    });
+  }
+
+, 'test that current-prereq index gets reset': function (next) {
+    h.exec('../bin/cli.js hoge:kira', function (out) {
+      assert.equal('hoge:hoge task\nhoge:piyo task\nhoge:fuga task\n' +
+          'hoge:charan task\nhoge:gero task\nhoge:kira task', out);
+      next();
+    });
+  }
+
+, 'test modifying a task by adding prereq during execution': function (next) {
+    h.exec('../bin/cli.js voom', function (out) {
+      assert.equal(2, out);
+      next();
+    });
+  }
+
+, 'test listening for task error-event': function (next) {
+    h.exec('../bin/cli.js vronk:groo', function (out) {
+      assert.equal('OMFGZONG', out);
+      next();
+    });
+  }
+
+};
+
+module.exports = tests;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/.npmignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/.npmignore b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/.npmignore
new file mode 100755
index 0000000..1e90ec5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/.npmignore
@@ -0,0 +1,9 @@
+.DS_Store
+.idea
+*.iml
+*.ipr
+*.iws
+*.tmproj
+.project
+.settings
+.externalToolBuilders
\ No newline at end of file


[08/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/date.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/date.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/date.js
new file mode 100644
index 0000000..7232ce0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/date.js
@@ -0,0 +1,903 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var string = require('./string')
+  , date
+  , log = require('./log');
+
+/**
+  @name date
+  @namespace date
+*/
+
+date = new (function () {
+  var _this = this
+    , _date = new Date();
+
+  var _US_DATE_PAT = /^(\d{1,2})(?:\-|\/|\.)(\d{1,2})(?:\-|\/|\.)(\d{4})/;
+  var _DATETIME_PAT = /^(\d{4})(?:\-|\/|\.)(\d{1,2})(?:\-|\/|\.)(\d{1,2})(?:T| )?(\d{2})?(?::)?(\d{2})?(?::)?(\d{2})?(?:\.)?(\d+)?(?: *)?(Z|[+-]\d{4}|[+-]\d{2}:\d{2}|[+-]\d{2})?/;
+  // TODO Add am/pm parsing instead of dumb, 24-hour clock.
+  var _TIME_PAT = /^(\d{1,2})?(?::)?(\d{2})?(?::)?(\d{2})?(?:\.)?(\d+)?$/;
+
+  var _dateMethods = [
+      'FullYear'
+    , 'Month'
+    , 'Date'
+    , 'Hours'
+    , 'Minutes'
+    , 'Seconds'
+    , 'Milliseconds'
+  ];
+
+  var _isArray = function (obj) {
+    return obj &&
+      typeof obj === 'object' &&
+      typeof obj.length === 'number' &&
+      typeof obj.splice === 'function' &&
+      !(obj.propertyIsEnumerable('length'));
+  };
+
+  this.weekdayLong = ['Sunday', 'Monday', 'Tuesday',
+    'Wednesday', 'Thursday', 'Friday', 'Saturday'];
+  this.weekdayShort = ['Sun', 'Mon', 'Tue', 'Wed',
+    'Thu', 'Fri', 'Sat'];
+  this.monthLong = ['January', 'February', 'March',
+    'April', 'May', 'June', 'July', 'August', 'September',
+    'October', 'November', 'December'];
+  this.monthShort = ['Jan', 'Feb', 'Mar', 'Apr',
+    'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+  this.meridiem = {
+    'AM': 'AM',
+    'PM': 'PM'
+  }
+  // compat
+  this.meridian = this.meridiem
+
+  /**
+    @name date#supportedFormats
+    @public
+    @object
+    @description List of supported strftime formats
+  */
+  this.supportedFormats = {
+    // abbreviated weekday name according to the current locale
+    'a': function (dt) { return _this.weekdayShort[dt.getDay()]; },
+    // full weekday name according to the current locale
+    'A': function (dt) { return _this.weekdayLong[dt.getDay()]; },
+    //  abbreviated month name according to the current locale
+    'b': function (dt) { return _this.monthShort[dt.getMonth()]; },
+    'h': function (dt) { return _this.strftime(dt, '%b'); },
+    // full month name according to the current locale
+    'B': function (dt) { return _this.monthLong[dt.getMonth()]; },
+    // preferred date and time representation for the current locale
+    'c': function (dt) { return _this.strftime(dt, '%a %b %d %T %Y'); },
+    // century number (the year divided by 100 and truncated
+    // to an integer, range 00 to 99)
+    'C': function (dt) { return _this.calcCentury(dt.getFullYear());; },
+    // day of the month as a decimal number (range 01 to 31)
+    'd': function (dt) { return string.lpad(dt.getDate(), '0', 2); },
+    // same as %m/%d/%y
+    'D': function (dt) { return _this.strftime(dt, '%m/%d/%y') },
+    // day of the month as a decimal number, a single digit is
+    // preceded by a space (range ' 1' to '31')
+    'e': function (dt) { return string.lpad(dt.getDate(), ' ', 2); },
+    // month as a decimal number, a single digit is
+    // preceded by a space (range ' 1' to '12')
+    'f': function () { return _this.strftimeNotImplemented('f'); },
+    // same as %Y-%m-%d
+    'F': function (dt) { return _this.strftime(dt, '%Y-%m-%d');  },
+    // like %G, but without the century.
+    'g': function () { return _this.strftimeNotImplemented('g'); },
+    // The 4-digit year corresponding to the ISO week number
+    // (see %V).  This has the same format and value as %Y,
+    // except that if the ISO week number belongs to the
+    // previous or next year, that year is used instead.
+    'G': function () { return _this.strftimeNotImplemented('G'); },
+    // hour as a decimal number using a 24-hour clock (range
+    // 00 to 23)
+    'H': function (dt) { return string.lpad(dt.getHours(), '0', 2); },
+    // hour as a decimal number using a 12-hour clock (range
+    // 01 to 12)
+    'I': function (dt) { return string.lpad(
+      _this.hrMil2Std(dt.getHours()), '0', 2); },
+    // day of the year as a decimal number (range 001 to 366)
+    'j': function (dt) { return string.lpad(
+      _this.calcDays(dt), '0', 3); },
+    // Hour as a decimal number using a 24-hour clock (range
+    // 0 to 23 (space-padded))
+    'k': function (dt) { return string.lpad(dt.getHours(), ' ', 2); },
+    // Hour as a decimal number using a 12-hour clock (range
+    // 1 to 12 (space-padded))
+    'l': function (dt) { return string.lpad(
+      _this.hrMil2Std(dt.getHours()), ' ', 2); },
+    // month as a decimal number (range 01 to 12)
+    'm': function (dt) { return string.lpad((dt.getMonth()+1), '0', 2); },
+    // minute as a decimal number
+    'M': function (dt) { return string.lpad(dt.getMinutes(), '0', 2); },
+    // Linebreak
+    'n': function () { return '\n'; },
+    // either `am' or `pm' according to the given time value,
+    // or the corresponding strings for the current locale
+    'p': function (dt) { return _this.getMeridian(dt.getHours()); },
+    // time in a.m. and p.m. notation
+    'r': function (dt) { return _this.strftime(dt, '%I:%M:%S %p'); },
+    // time in 24 hour notation
+    'R': function (dt) { return _this.strftime(dt, '%H:%M'); },
+    // second as a decimal number
+    'S': function (dt) { return string.lpad(dt.getSeconds(), '0', 2); },
+    // Tab char
+    't': function () { return '\t'; },
+    // current time, equal to %H:%M:%S
+    'T': function (dt) { return _this.strftime(dt, '%H:%M:%S'); },
+    // weekday as a decimal number [1,7], with 1 representing
+    // Monday
+    'u': function (dt) { return _this.convertOneBase(dt.getDay()); },
+    // week number of the current year as a decimal number,
+    // starting with the first Sunday as the first day of the
+    // first week
+    'U': function () { return _this.strftimeNotImplemented('U'); },
+    // week number of the year (Monday as the first day of the
+    // week) as a decimal number [01,53]. If the week containing
+    // 1 January has four or more days in the new year, then it
+    // is considered week 1. Otherwise, it is the last week of
+    // the previous year, and the next week is week 1.
+    'V': function () { return _this.strftimeNotImplemented('V'); },
+    // week number of the current year as a decimal number,
+    // starting with the first Monday as the first day of the
+    // first week
+    'W': function () { return _this.strftimeNotImplemented('W'); },
+    // day of the week as a decimal, Sunday being 0
+    'w': function (dt) { return dt.getDay(); },
+    // preferred date representation for the current locale
+    // without the time
+    'x': function (dt) { return _this.strftime(dt, '%D'); },
+    // preferred time representation for the current locale
+    // without the date
+    'X': function (dt) { return _this.strftime(dt, '%T'); },
+    // year as a decimal number without a century (range 00 to
+    // 99)
+    'y': function (dt) { return _this.getTwoDigitYear(dt.getFullYear()); },
+    // year as a decimal number including the century
+    'Y': function (dt) { return string.lpad(dt.getFullYear(), '0', 4); },
+    // time zone or name or abbreviation
+    'z': function () { return _this.strftimeNotImplemented('z'); },
+    'Z': function () { return _this.strftimeNotImplemented('Z'); },
+    // Literal percent char
+    '%': function (dt) { return '%'; }
+  };
+
+  /**
+    @name date#getSupportedFormats
+    @public
+    @function
+    @description return the list of formats in a string
+    @return {String} The list of supported formats
+  */
+  this.getSupportedFormats = function () {
+    var str = '';
+    for (var i in this.supportedFormats) { str += i; }
+    return str;
+  }
+
+  this.supportedFormatsPat = new RegExp('%[' +
+      this.getSupportedFormats() + ']{1}', 'g');
+
+  /**
+    @name date#strftime
+    @public
+    @function
+    @return {String} The `dt` formated with the given `format`
+    @description Formats the given date with the strftime formated
+    @param {Date} dt the date object to format
+    @param {String} format the format to convert the date to
+  */
+  this.strftime = function (dt, format) {
+    if (!dt) { return '' }
+
+    var d = dt;
+    var pats = [];
+    var dts = [];
+    var str = format;
+
+    // Allow either Date obj or UTC stamp
+    d = typeof dt == 'number' ? new Date(dt) : dt;
+
+    // Grab all instances of expected formats into array
+    while (pats = this.supportedFormatsPat.exec(format)) {
+      dts.push(pats[0]);
+    }
+
+    // Process any hits
+    for (var i = 0; i < dts.length; i++) {
+      key = dts[i].replace(/%/, '');
+      str = str.replace('%' + key,
+        this.supportedFormats[key](d));
+    }
+    return str;
+
+  };
+
+  this.strftimeNotImplemented = function (s) {
+    throw('this.strftime format "' + s + '" not implemented.');
+  };
+
+  /**
+    @name date#calcCentury
+    @public
+    @function
+    @return {String} The century for the given date
+    @description Find the century for the given `year`
+    @param {Number} year The year to find the century for
+  */
+  this.calcCentury = function (year) {
+    if(!year) {
+      year = _date.getFullYear();
+    }
+
+    var ret = parseInt((year / 100) + 1);
+    year = year.toString();
+
+    // If year ends in 00 subtract one, because it's still the century before the one
+    // it divides to
+    if (year.substring(year.length - 2) === '00') {
+      ret--;
+    }
+
+    return ret.toString();
+  };
+
+  /**
+    @name date#calcDays
+    @public
+    @function
+    @return {Number} The number of days so far for the given date
+    @description Calculate the day number in the year a particular date is on
+    @param {Date} dt The date to use
+  */
+  this.calcDays = function (dt) {
+    var first = new Date(dt.getFullYear(), 0, 1);
+    var diff = 0;
+    var ret = 0;
+    first = first.getTime();
+    diff = (dt.getTime() - first);
+    ret = parseInt(((((diff/1000)/60)/60)/24))+1;
+    return ret;
+  };
+
+  /**
+   * Adjust from 0-6 base week to 1-7 base week
+   * @param d integer for day of week
+   * @return Integer day number for 1-7 base week
+   */
+  this.convertOneBase = function (d) {
+    return d == 0 ? 7 : d;
+  };
+
+  this.getTwoDigitYear = function (yr) {
+    // Add a millenium to take care of years before the year 1000,
+    // (e.g, the year 7) since we're only taking the last two digits
+    // If we overshoot, it doesn't matter
+    var millenYear = yr + 1000;
+    var str = millenYear.toString();
+    str = str.substr(2); // Get the last two digits
+    return str
+  };
+
+  /**
+    @name date#getMeridiem
+    @public
+    @function
+    @return {String} Return 'AM' or 'PM' based on hour in 24-hour format
+    @description Return 'AM' or 'PM' based on hour in 24-hour format
+    @param {Number} h The hour to check
+  */
+  this.getMeridiem = function (h) {
+    return h > 11 ? this.meridiem.PM :
+      this.meridiem.AM;
+  };
+  // Compat
+  this.getMeridian = this.getMeridiem;
+
+  /**
+    @name date#hrMil2Std
+    @public
+    @function
+    @return {String} Return a 12 hour version of the given time
+    @description Convert a 24-hour formatted hour to 12-hour format
+    @param {String} hour The hour to convert
+  */
+  this.hrMil2Std = function (hour) {
+    var h = typeof hour == 'number' ? hour : parseInt(hour);
+    var str = h > 12 ? h - 12 : h;
+    str = str == 0 ? 12 : str;
+    return str;
+  };
+
+  /**
+    @name date#hrStd2Mil
+    @public
+    @function
+    @return {String} Return a 24 hour version of the given time
+    @description Convert a 12-hour formatted hour with meridian flag to 24-hour format
+    @param {String} hour The hour to convert
+    @param {Boolean} pm hour is PM then this should be true
+  */
+  this.hrStd2Mil = function  (hour, pm) {
+    var h = typeof hour == 'number' ? hour : parseInt(hour);
+    var str = '';
+    // PM
+    if (pm) {
+      str = h < 12 ? (h+12) : h;
+    }
+    // AM
+    else {
+      str = h == 12 ? 0 : h;
+    }
+    return str;
+  };
+
+  // Constants for use in this.add
+  var dateParts = {
+    YEAR: 'year'
+    , MONTH: 'month'
+    , DAY: 'day'
+    , HOUR: 'hour'
+    , MINUTE: 'minute'
+    , SECOND: 'second'
+    , MILLISECOND: 'millisecond'
+    , QUARTER: 'quarter'
+    , WEEK: 'week'
+    , WEEKDAY: 'weekday'
+  };
+  // Create a map for singular/plural lookup, e.g., day/days
+  var datePartsMap = {};
+  for (var p in dateParts) {
+    datePartsMap[dateParts[p]] = dateParts[p];
+    datePartsMap[dateParts[p] + 's'] = dateParts[p];
+  }
+  this.dateParts = dateParts;
+
+  /**
+    @name date#add
+    @public
+    @function
+    @return {Date} Incremented date
+    @description Add to a Date in intervals of different size, from
+                 milliseconds to years
+    @param {Date} dt Date (or timestamp Number), date to increment
+    @param {String} interv a constant representing the interval,
+    e.g. YEAR, MONTH, DAY.  See this.dateParts
+    @param {Number} incr how much to add to the date
+  */
+  this.add = function (dt, interv, incr) {
+    if (typeof dt == 'number') { dt = new Date(dt); }
+    function fixOvershoot() {
+      if (sum.getDate() < dt.getDate()) {
+        sum.setDate(0);
+      }
+    }
+    var key = datePartsMap[interv];
+    var sum = new Date(dt);
+    switch (key) {
+      case dateParts.YEAR:
+        sum.setFullYear(dt.getFullYear()+incr);
+        // Keep increment/decrement from 2/29 out of March
+        fixOvershoot();
+        break;
+      case dateParts.QUARTER:
+        // Naive quarter is just three months
+        incr*=3;
+        // fallthrough...
+      case dateParts.MONTH:
+        sum.setMonth(dt.getMonth()+incr);
+        // Reset to last day of month if you overshoot
+        fixOvershoot();
+        break;
+      case dateParts.WEEK:
+        incr*=7;
+        // fallthrough...
+      case dateParts.DAY:
+        sum.setDate(dt.getDate() + incr);
+        break;
+      case dateParts.WEEKDAY:
+        //FIXME: assumes Saturday/Sunday weekend, but even this is not fixed.
+        // There are CLDR entries to localize this.
+        var dat = dt.getDate();
+        var weeks = 0;
+        var days = 0;
+        var strt = 0;
+        var trgt = 0;
+        var adj = 0;
+        // Divide the increment time span into weekspans plus leftover days
+        // e.g., 8 days is one 5-day weekspan / and two leftover days
+        // Can't have zero leftover days, so numbers divisible by 5 get
+        // a days value of 5, and the remaining days make up the number of weeks
+        var mod = incr % 5;
+        if (mod == 0) {
+          days = (incr > 0) ? 5 : -5;
+          weeks = (incr > 0) ? ((incr-5)/5) : ((incr+5)/5);
+        }
+        else {
+          days = mod;
+          weeks = parseInt(incr/5);
+        }
+        // Get weekday value for orig date param
+        strt = dt.getDay();
+        // Orig date is Sat / positive incrementer
+        // Jump over Sun
+        if (strt == 6 && incr > 0) {
+          adj = 1;
+        }
+        // Orig date is Sun / negative incrementer
+        // Jump back over Sat
+        else if (strt == 0 && incr < 0) {
+          adj = -1;
+        }
+        // Get weekday val for the new date
+        trgt = strt + days;
+        // New date is on Sat or Sun
+        if (trgt == 0 || trgt == 6) {
+          adj = (incr > 0) ? 2 : -2;
+        }
+        // Increment by number of weeks plus leftover days plus
+        // weekend adjustments
+        sum.setDate(dat + (7*weeks) + days + adj);
+        break;
+      case dateParts.HOUR:
+        sum.setHours(sum.getHours()+incr);
+        break;
+      case dateParts.MINUTE:
+        sum.setMinutes(sum.getMinutes()+incr);
+        break;
+      case dateParts.SECOND:
+        sum.setSeconds(sum.getSeconds()+incr);
+        break;
+      case dateParts.MILLISECOND:
+        sum.setMilliseconds(sum.getMilliseconds()+incr);
+        break;
+      default:
+        // Do nothing
+        break;
+    }
+    return sum; // Date
+  };
+
+  /**
+    @name date#diff
+    @public
+    @function
+    @return {Number} number of (interv) units apart that
+    the two dates are
+    @description Get the difference in a specific unit of time (e.g., number
+                 of months, weeks, days, etc.) between two dates.
+    @param {Date} date1 First date to check
+    @param {Date} date2 Date to compate `date1` with
+    @param {String} interv a constant representing the interval,
+    e.g. YEAR, MONTH, DAY.  See this.dateParts
+  */
+  this.diff = function (date1, date2, interv) {
+    //  date1
+    //    Date object or Number equivalent
+    //
+    //  date2
+    //    Date object or Number equivalent
+    //
+    //  interval
+    //    A constant representing the interval, e.g. YEAR, MONTH, DAY.  See this.dateParts.
+
+    // Accept timestamp input
+    if (typeof date1 == 'number') { date1 = new Date(date1); }
+    if (typeof date2 == 'number') { date2 = new Date(date2); }
+    var yeaDiff = date2.getFullYear() - date1.getFullYear();
+    var monDiff = (date2.getMonth() - date1.getMonth()) + (yeaDiff * 12);
+    var msDiff = date2.getTime() - date1.getTime(); // Millisecs
+    var secDiff = msDiff/1000;
+    var minDiff = secDiff/60;
+    var houDiff = minDiff/60;
+    var dayDiff = houDiff/24;
+    var weeDiff = dayDiff/7;
+    var delta = 0; // Integer return value
+
+    var key = datePartsMap[interv];
+    switch (key) {
+      case dateParts.YEAR:
+        delta = yeaDiff;
+        break;
+      case dateParts.QUARTER:
+        var m1 = date1.getMonth();
+        var m2 = date2.getMonth();
+        // Figure out which quarter the months are in
+        var q1 = Math.floor(m1/3) + 1;
+        var q2 = Math.floor(m2/3) + 1;
+        // Add quarters for any year difference between the dates
+        q2 += (yeaDiff * 4);
+        delta = q2 - q1;
+        break;
+      case dateParts.MONTH:
+        delta = monDiff;
+        break;
+      case dateParts.WEEK:
+        // Truncate instead of rounding
+        // Don't use Math.floor -- value may be negative
+        delta = parseInt(weeDiff);
+        break;
+      case dateParts.DAY:
+        delta = dayDiff;
+        break;
+      case dateParts.WEEKDAY:
+        var days = Math.round(dayDiff);
+        var weeks = parseInt(days/7);
+        var mod = days % 7;
+
+        // Even number of weeks
+        if (mod == 0) {
+          days = weeks*5;
+        }
+        else {
+          // Weeks plus spare change (< 7 days)
+          var adj = 0;
+          var aDay = date1.getDay();
+          var bDay = date2.getDay();
+
+          weeks = parseInt(days/7);
+          mod = days % 7;
+          // Mark the date advanced by the number of
+          // round weeks (may be zero)
+          var dtMark = new Date(date1);
+          dtMark.setDate(dtMark.getDate()+(weeks*7));
+          var dayMark = dtMark.getDay();
+
+          // Spare change days -- 6 or less
+          if (dayDiff > 0) {
+            switch (true) {
+              // Range starts on Sat
+              case aDay == 6:
+                adj = -1;
+                break;
+              // Range starts on Sun
+              case aDay == 0:
+                adj = 0;
+                break;
+              // Range ends on Sat
+              case bDay == 6:
+                adj = -1;
+                break;
+              // Range ends on Sun
+              case bDay == 0:
+                adj = -2;
+                break;
+              // Range contains weekend
+              case (dayMark + mod) > 5:
+                adj = -2;
+                break;
+              default:
+                // Do nothing
+                break;
+            }
+          }
+          else if (dayDiff < 0) {
+            switch (true) {
+              // Range starts on Sat
+              case aDay == 6:
+                adj = 0;
+                break;
+              // Range starts on Sun
+              case aDay == 0:
+                adj = 1;
+                break;
+              // Range ends on Sat
+              case bDay == 6:
+                adj = 2;
+                break;
+              // Range ends on Sun
+              case bDay == 0:
+                adj = 1;
+                break;
+              // Range contains weekend
+              case (dayMark + mod) < 0:
+                adj = 2;
+                break;
+              default:
+                // Do nothing
+                break;
+            }
+          }
+          days += adj;
+          days -= (weeks*2);
+        }
+        delta = days;
+
+        break;
+      case dateParts.HOUR:
+        delta = houDiff;
+        break;
+      case dateParts.MINUTE:
+        delta = minDiff;
+        break;
+      case dateParts.SECOND:
+        delta = secDiff;
+        break;
+      case dateParts.MILLISECOND:
+        delta = msDiff;
+        break;
+      default:
+        // Do nothing
+        break;
+    }
+    // Round for fractional values and DST leaps
+    return Math.round(delta); // Number (integer)
+  };
+
+  /**
+    @name date#parse
+    @public
+    @function
+    @return {Date} a JavaScript Date object
+    @description Convert various sorts of strings to JavaScript
+                 Date objects
+    @param {String} val The string to convert to a Date
+  */
+  this.parse = function (val) {
+    var dt
+      , matches
+      , reordered
+      , off
+      , posOff
+      , offHours
+      , offMinutes
+      , curr
+      , stamp
+      , utc;
+
+    // Yay, we have a date, use it as-is
+    if (val instanceof Date || typeof val.getFullYear == 'function') {
+      dt = val;
+    }
+
+    // Timestamp?
+    else if (typeof val == 'number') {
+      dt = new Date(val);
+    }
+
+    // String or Array
+    else {
+      // Value preparsed, looks like [yyyy, mo, dd, hh, mi, ss, ms, (offset?)]
+      if (_isArray(val)) {
+        matches = val;
+        matches.unshift(null);
+        matches[8] = null;
+      }
+
+      // Oh, crap, it's a string -- parse this bitch
+      else if (typeof val == 'string') {
+        matches = val.match(_DATETIME_PAT);
+
+        // Stupid US-only format?
+        if (!matches) {
+          matches = val.match(_US_DATE_PAT);
+          if (matches) {
+            reordered = [matches[0], matches[3], matches[1], matches[2]];
+            // Pad the results to the same length as ISO8601
+            reordered[8] = null;
+            matches = reordered;
+          }
+        }
+
+        // Time-stored-in-Date hack?
+        if (!matches) {
+          matches = val.match(_TIME_PAT);
+          if (matches) {
+            reordered = [matches[0], 0, 1, 0, matches[1],
+                matches[2], matches[3], matches[4], null];
+            matches = reordered;
+          }
+        }
+
+      }
+
+      // Sweet, the regex actually parsed it into something useful
+      if (matches) {
+        matches.shift(); // First match is entire match, DO NOT WANT
+
+        off = matches.pop();
+        // If there's an offset (or the 'Z' non-offset offset), use UTC
+        // methods to set everything
+        if (off) {
+          if (off == 'Z') {
+            utc = true;
+            offMinutes = 0;
+          }
+          else {
+            utc = false;
+            off = off.replace(/\+|-|:/g, '');
+            if (parseInt(off, 10) === 0) {
+              utc = true;
+            }
+            else {
+              posOff = off.indexOf('+') === 0;
+              off = off.substr(1);
+              off = off.split(':');
+              offHours = parseInt(off[0], 10);
+              offMinutes = parseInt(off[1], 10) || 0;
+              offMinutes += (offHours * 60);
+              if (!posOff) {
+                offMinutes = 0 - offMinutes;
+              }
+            }
+          }
+        }
+
+        dt = new Date(0);
+
+        // Stupid zero-based months
+        matches[1] = parseInt(matches[1], 10) - 1;
+
+        // Specific offset, iterate the array and set each date property
+        // using UTC setters, then adjust time using offset
+        if (off) {
+          for (var i = matches.length - 1; i > -1; i--) {
+            curr = parseInt(matches[i], 10) || 0;
+            dt['setUTC' + _dateMethods[i]](curr);
+          }
+          // Add any offset
+          dt.setMinutes(dt.getMinutes() - offMinutes);
+        }
+        // Otherwise we know nothing about the offset, just iterate the
+        // array and set each date property using regular setters
+        else {
+          for (var i = matches.length - 1; i > -1; i--) {
+            curr = parseInt(matches[i], 10) || 0;
+            dt['set' + _dateMethods[i]](curr);
+          }
+        }
+      }
+
+      // Shit, last-ditch effort using Date.parse
+      else {
+        stamp = Date.parse(val);
+        // Failures to parse yield NaN
+        if (!isNaN(stamp)) {
+          dt = new Date(stamp);
+        }
+      }
+
+    }
+
+    return dt || null;
+  };
+
+  /**
+    @name date#relativeTime
+    @public
+    @function
+    @return {String} A string describing the amount of time ago
+    the passed-in Date is
+    @description Convert a Date to an English sentence representing
+    how long ago the Date was
+    @param {Date} dt The Date to to convert to a relative time string
+    @param {Object} [opts]
+      @param {Boolean} [opts.abbreviated=false] Use short strings
+      (e.g., '<1m') for the relative-time string
+  */
+  this.relativeTime = function (dt, options) {
+    var opts = options || {}
+      , now = opts.now || new Date()
+      , abbr = opts.abbreviated || false
+      , format = opts.format || '%F %T'
+    // Diff in seconds
+      , diff = (now.getTime() - dt.getTime()) / 1000
+      , ret
+      , num
+      , hour = 60*60
+      , day = 24*hour
+      , week = 7*day
+      , month = 30*day;
+    switch (true) {
+      case diff < 60:
+        ret = abbr ? '<1m' : 'less than a minute ago';
+        break;
+      case diff < 120:
+        ret = abbr ? '1m' : 'about a minute ago';
+        break;
+      case diff < (45*60):
+        num = parseInt((diff / 60), 10);
+        ret = abbr ? num + 'm' : num + ' minutes ago';
+        break;
+      case diff < (2*hour):
+        ret = abbr ? '1h' : 'about an hour ago';
+        break;
+      case diff < (1*day):
+        num = parseInt((diff / hour), 10);
+        ret = abbr ? num + 'h' : 'about ' + num + ' hours ago';
+        break;
+      case diff < (2*day):
+        ret = abbr ? '1d' : 'one day ago';
+        break;
+      case diff < (7*day):
+        num = parseInt((diff / day), 10);
+        ret = abbr ? num + 'd' : 'about ' + num + ' days ago';
+        break;
+      case diff < (11*day):
+        ret = abbr ? '1w': 'one week ago';
+        break;
+      case diff < (1*month):
+        num = Math.round(diff / week);
+        ret = abbr ? num + 'w' : 'about ' + num + ' weeks ago';
+        break;
+      default:
+        ret = date.strftime(dt, format);
+        break;
+    }
+    return ret;
+  };
+
+  /**
+    @name date#toISO8601
+    @public
+    @function
+    @return {String} A string describing the amount of time ago
+    @description Convert a Date to an ISO8601-formatted string
+    @param {Date} dt The Date to to convert to an ISO8601 string
+  */
+  var _pad = function (n) {
+    return n < 10 ? '0' + n : n;
+  };
+  this.toISO8601 = function (dt, options) {
+    var opts = options || {}
+      , off = dt.getTimezoneOffset()
+      , offHours
+      , offMinutes
+      , str = this.strftime(dt, '%F') + 'T'
+          + this.strftime(dt, '%T') + '.'
+          + string.lpad(dt.getMilliseconds(), '0', 3);
+    // Pos and neg numbers are both truthy; only
+    // zero is falsy
+    if (off && !opts.utc) {
+      str += off > 0 ? '-' : '+';
+      offHours = parseInt(off / 60, 10);
+      str += string.lpad(offHours, '0', 2);
+      offMinutes = off % 60;
+      if (offMinutes) {
+        str += string.lpad(offMinutes, '0', 2);
+      }
+    }
+    else {
+      str += 'Z';
+    }
+    return str;
+  };
+
+  // Alias
+  this.toIso8601 = this.toISO8601;
+
+  this.toUTC = function (dt) {
+    return new Date(
+        dt.getUTCFullYear()
+      , dt.getUTCMonth()
+      , dt.getUTCDate()
+      , dt.getUTCHours()
+      , dt.getUTCMinutes()
+      , dt.getUTCSeconds()
+      , dt.getUTCMilliseconds());
+  };
+
+})();
+
+module.exports = date;
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/event_buffer.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/event_buffer.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/event_buffer.js
new file mode 100644
index 0000000..3e224c8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/event_buffer.js
@@ -0,0 +1,109 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+/*
+This is a very simple buffer for a predetermined set of events. It is unbounded.
+It forwards all arguments to any outlet emitter attached with sync().
+
+Example:
+    var source = new Stream()
+      , dest = new EventEmitter()
+      , buff = new EventBuffer(source)
+      , data = '';
+    dest.on('data', function (d) { data += d; });
+    source.writeable = true;
+    source.readable = true;
+    source.emit('data', 'abcdef');
+    source.emit('data', '123456');
+    buff.sync(dest);
+*/
+
+/**
+  @name EventBuffer
+  @namespace EventBuffer
+  @constructor
+*/
+
+var EventBuffer = function (src, events) {
+  // By default, we service the default stream events
+  var self = this
+    , streamEvents = ['data', 'end', 'error', 'close', 'fd', 'drain', 'pipe'];
+  this.events = events || streamEvents;
+  this.emitter = src;
+  this.eventBuffer = [];
+  this.outlet = null;
+  this.events.forEach(function (name) {
+    self.emitter.addListener(name, function () {
+      self.proxyEmit(name, arguments);
+    });
+  });
+};
+
+EventBuffer.prototype = new (function () {
+  /**
+    @name EventBuffer#proxyEmit
+    @public
+    @function
+    @description Emit an event by name and arguments or add it to the buffer if
+                 no outlet is set
+    @param {String} name The name to use for the event
+    @param {Array} args An array of arguments to emit
+  */
+  this.proxyEmit = function (name, args) {
+    if (this.outlet) {
+      this.emit(name, args);
+    }
+    else {
+      this.eventBuffer.push({name: name, args: args});
+    }
+  };
+
+  /**
+    @name EventBuffer#emit
+    @public
+    @function
+    @description Emit an event by name and arguments
+    @param {String} name The name to use for the event
+    @param {Array} args An array of arguments to emit
+  */
+  this.emit = function (name, args) {
+    // Prepend name to args
+    var outlet = this.outlet;
+    Array.prototype.splice.call(args, 0, 0, name);
+    outlet.emit.apply(outlet, args);
+  };
+
+  /**
+    @name EventBuffer#sync
+    @public
+    @function
+    @description Flush the buffer and continue piping new events to the outlet
+    @param {Object} outlet The emitter to send events to
+  */
+  this.sync = function (outlet) {
+    var buffer = this.eventBuffer
+      , bufferItem;
+    this.outlet = outlet;
+    while ((bufferItem = buffer.shift())) {
+      this.emit(bufferItem.name, bufferItem.args);
+    }
+  };
+})();
+EventBuffer.prototype.constructor = EventBuffer;
+
+module.exports.EventBuffer = EventBuffer;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/file.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/file.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/file.js
new file mode 100644
index 0000000..a4bd2e7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/file.js
@@ -0,0 +1,520 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var fs = require('fs')
+  , path = require('path')
+  , JS_PAT = /\.(js|coffee)$/
+  , logger;
+
+var logger = new (function () {
+  var out;
+  try {
+    out = require('./logger');
+  }
+  catch (e) {
+    out = console;
+  }
+
+  this.log = function (o) {
+    out.log(o);
+  };
+})();
+
+/**
+  @name file
+  @namespace file
+*/
+
+var fileUtils = new (function () {
+  var _copyFile
+    , _copyDir
+    , _readDir
+    , _rmDir
+    , _watch;
+
+
+  // Recursively copy files and directories
+  _copyFile = function (fromPath, toPath, opts) {
+    var from = path.normalize(fromPath)
+      , to = path.normalize(toPath)
+      , options = opts || {}
+      , fromStat
+      , toStat
+      , destExists
+      , destDoesNotExistErr
+      , content
+      , filename
+      , dirContents
+      , targetDir;
+
+    fromStat = fs.statSync(from);
+
+    try {
+      //console.dir(to + ' destExists');
+      toStat = fs.statSync(to);
+      destExists = true;
+    }
+    catch(e) {
+      //console.dir(to + ' does not exist');
+      destDoesNotExistErr = e;
+      destExists = false;
+    }
+    // Destination dir or file exists, copy into (directory)
+    // or overwrite (file)
+    if (destExists) {
+
+      // If there's a rename-via-copy file/dir name passed, use it.
+      // Otherwise use the actual file/dir name
+      filename = options.rename || path.basename(from);
+
+      // Copying a directory
+      if (fromStat.isDirectory()) {
+        dirContents = fs.readdirSync(from);
+        targetDir = path.join(to, filename);
+        // We don't care if the target dir already exists
+        try {
+          fs.mkdirSync(targetDir, options.mode || 0755);
+        }
+        catch(e) {
+          if (e.code != 'EEXIST') {
+            throw e;
+          }
+        }
+        for (var i = 0, ii = dirContents.length; i < ii; i++) {
+          //console.log(dirContents[i]);
+          _copyFile(path.join(from, dirContents[i]), targetDir);
+        }
+      }
+      // Copying a file
+      else {
+        content = fs.readFileSync(from);
+        // Copy into dir
+        if (toStat.isDirectory()) {
+          //console.log('copy into dir ' + to);
+          fs.writeFileSync(path.join(to, filename), content);
+        }
+        // Overwrite file
+        else {
+          //console.log('overwriting ' + to);
+          fs.writeFileSync(to, content);
+        }
+      }
+    }
+    // Dest doesn't exist, can't create it
+    else {
+      throw destDoesNotExistErr;
+    }
+  };
+
+  _copyDir = function (from, to, opts) {
+    var createDir = opts.createDir;
+  };
+
+  // Return the contents of a given directory
+  _readDir = function (dirPath) {
+    var dir = path.normalize(dirPath)
+      , paths = []
+      , ret = [dir]
+      , msg;
+
+    try {
+      paths = fs.readdirSync(dir);
+    }
+    catch (e) {
+      msg = 'Could not read path ' + dir + '\n';
+      if (e.stack) {
+        msg += e.stack;
+      }
+      throw new Error(msg);
+    }
+
+    paths.forEach(function (p) {
+      var curr = path.join(dir, p);
+      var stat = fs.statSync(curr);
+      if (stat.isDirectory()) {
+        ret = ret.concat(_readDir(curr));
+      }
+      else {
+        ret.push(curr);
+      }
+    });
+
+    return ret;
+  };
+
+  // Remove the given directory
+  _rmDir = function (dirPath) {
+    var dir = path.normalize(dirPath)
+      , paths = [];
+    paths = fs.readdirSync(dir);
+    paths.forEach(function (p) {
+      var curr = path.join(dir, p);
+      var stat = fs.statSync(curr);
+      if (stat.isDirectory()) {
+        _rmDir(curr);
+      }
+      else {
+        fs.unlinkSync(curr);
+      }
+    });
+    fs.rmdirSync(dir);
+  };
+
+  // Recursively watch files with a callback
+  _watch = function (path, callback) {
+    fs.stat(path, function (err, stats) {
+      if (err) {
+        return false;
+      }
+      if (stats.isFile() && JS_PAT.test(path)) {
+        fs.watchFile(path, callback);
+      }
+      else if (stats.isDirectory()) {
+        fs.readdir(path, function (err, files) {
+          if (err) {
+            return log.fatal(err);
+          }
+          for (var f in files) {
+            _watch(path + '/' + files[f], callback);
+          }
+        });
+      }
+    });
+  };
+
+  /**
+    @name file#cpR
+    @public
+    @function
+    @description Copies a directory/file to a destination
+    @param {String} fromPath The source path to copy from
+    @param {String} toPath The destination path to copy to
+    @param {Object} opts Options to use
+      @param {Boolean} [opts.silent] If false then will log the command
+  */
+  this.cpR = function (fromPath, toPath, options) {
+    var from = path.normalize(fromPath)
+      , to = path.normalize(toPath)
+      , toStat
+      , doesNotExistErr
+      , paths
+      , filename
+      , opts = options || {};
+
+    if (!opts.silent) {
+      logger.log('cp -r ' + fromPath + ' ' + toPath);
+    }
+
+    opts = {}; // Reset
+
+    if (from == to) {
+      throw new Error('Cannot copy ' + from + ' to itself.');
+    }
+
+    // Handle rename-via-copy
+    try {
+      toStat = fs.statSync(to);
+    }
+    catch(e) {
+      doesNotExistErr = e;
+
+      // Get abs path so it's possible to check parent dir
+      if (!this.isAbsolute(to)) {
+        to = path.join(process.cwd() , to);
+      }
+
+      // Save the file/dir name
+      filename = path.basename(to);
+      // See if a parent dir exists, so there's a place to put the
+      /// renamed file/dir (resets the destination for the copy)
+      to = path.dirname(to);
+      try {
+        toStat = fs.statSync(to);
+      }
+      catch(e) {}
+      if (toStat && toStat.isDirectory()) {
+        // Set the rename opt to pass to the copy func, will be used
+        // as the new file/dir name
+        opts.rename = filename;
+        //console.log('filename ' + filename);
+      }
+      else {
+        throw doesNotExistErr;
+      }
+    }
+
+    _copyFile(from, to, opts);
+  };
+
+  /**
+    @name file#mkdirP
+    @public
+    @function
+    @description Create the given directory(ies) using the given mode permissions
+    @param {String} dir The directory to create
+    @param {Number} mode The mode to give the created directory(ies)(Default: 0755)
+  */
+  this.mkdirP = function (dir, mode) {
+    var dirPath = path.normalize(dir)
+      , paths = dirPath.split(/\/|\\/)
+      , currPath = ''
+      , next;
+
+    if (paths[0] == '' || /^[A-Za-z]+:/.test(paths[0])) {
+      currPath = paths.shift() || '/';
+      currPath = path.join(currPath, paths.shift());
+      //console.log('basedir');
+    }
+    while ((next = paths.shift())) {
+      if (next == '..') {
+        currPath = path.join(currPath, next);
+        continue;
+      }
+      currPath = path.join(currPath, next);
+      try {
+        //console.log('making ' + currPath);
+        fs.mkdirSync(currPath, mode || 0755);
+      }
+      catch(e) {
+        if (e.code != 'EEXIST') {
+          throw e;
+        }
+      }
+    }
+  };
+
+  /**
+    @name file#readdirR
+    @public
+    @function
+    @return {Array} Returns the contents as an Array, can be configured via opts.format
+    @description Reads the given directory returning it's contents
+    @param {String} dir The directory to read
+    @param {Object} opts Options to use
+      @param {String} [opts.format] Set the format to return(Default: Array)
+  */
+  this.readdirR = function (dir, opts) {
+    var options = opts || {}
+      , format = options.format || 'array'
+      , ret;
+    ret = _readDir(dir);
+    return format == 'string' ? ret.join('\n') : ret;
+  };
+
+  /**
+    @name file#rmRf
+    @public
+    @function
+    @description Deletes the given directory/file
+    @param {String} p The path to delete, can be a directory or file
+    @param {Object} opts Options to use
+      @param {String} [opts.silent] If false then logs the command
+  */
+  this.rmRf = function (p, options) {
+    var stat
+      , opts = options || {};
+    if (!opts.silent) {
+      logger.log('rm -rf ' + p);
+    }
+    try {
+      stat = fs.statSync(p);
+      if (stat.isDirectory()) {
+        _rmDir(p);
+      }
+      else {
+        fs.unlinkSync(p);
+      }
+    }
+    catch (e) {}
+  };
+
+  /**
+    @name file#isAbsolute
+    @public
+    @function
+    @return {Boolean/String} If it's absolute the first char is returned otherwise false
+    @description Checks if a given path is absolute or relative
+    @param {String} p Path to check
+  */
+  this.isAbsolute = function (p) {
+    var match = /^[A-Za-z]+:\\|^\//.exec(p);
+    if (match && match.length) {
+      return match[0];
+    }
+    return false;
+  };
+
+  /**
+    @name file#absolutize
+    @public
+    @function
+    @return {String} Returns the absolute path for the given path
+    @description Returns the absolute path for the given path
+    @param {String} p The path to get the absolute path for
+  */
+  this.absolutize = function (p) {
+    if (this.isAbsolute(p)) {
+      return p;
+    }
+    else {
+      return path.join(process.cwd(), p);
+    }
+  };
+
+  /**
+    Given a patern, return the base directory of it (ie. the folder
+    that will contain all the files matching the path).
+    eg. file.basedir('/test/**') => '/test/'
+    Path ending by '/' are considerd as folder while other are considerd
+    as files, eg.:
+        file.basedir('/test/a/') => '/test/a'
+        file.basedir('/test/a') => '/test'
+    The returned path always end with a '/' so we have:
+        file.basedir(file.basedir(x)) == file.basedir(x)
+  */
+  this.basedir = function (pathParam) {
+    var basedir = ''
+      , parts
+      , part
+      , pos = 0
+      , p = pathParam || '';
+
+    // If the path has a leading asterisk, basedir is the current dir
+    if (p.indexOf('*') == 0 || p.indexOf('**') == 0) {
+      return '.';
+    }
+
+    // always consider .. at the end as a folder and not a filename
+    if (/(?:^|\/|\\)\.\.$/.test(p.slice(-3))) {
+      p += '/';
+    }
+
+    parts = p.split(/\\|\//);
+    for (var i = 0, l = parts.length - 1; i < l; i++) {
+      part = parts[i];
+      if (part.indexOf('*') > -1 || part.indexOf('**') > -1) {
+        break;
+      }
+      pos += part.length + 1;
+      basedir += part + p[pos - 1];
+    }
+    if (!basedir) {
+      basedir = '.';
+    }
+    // Strip trailing slashes
+    if (!(basedir == '\\' || basedir == '/')) {
+      basedir = basedir.replace(/\\$|\/$/, '');
+    }
+    return basedir;
+
+  };
+
+  /**
+    @name file#searchParentPath
+    @public
+    @function
+    @description Search for a directory/file in the current directory and parent directories
+    @param {String} p The path to search for
+    @param {Function} callback The function to call once the path is found
+  */
+  this.searchParentPath = function (location, beginPath, callback) {
+    if (typeof beginPath === 'function' && !callback) {
+      callback = beginPath;
+      beginPath = process.cwd();
+    }
+    var cwd = beginPath || process.cwd();
+
+    if (!location) {
+      // Return if no path is given
+      return;
+    }
+    var relPath = ''
+      , i = 5 // Only search up to 5 directories
+      , pathLoc
+      , pathExists;
+
+    while (--i >= 0) {
+      pathLoc = path.join(cwd, relPath, location);
+      pathExists = this.existsSync(pathLoc);
+
+      if (pathExists) {
+        callback && callback(undefined, pathLoc);
+        break;
+      } else {
+        // Dir could not be found
+        if (i === 0) {
+          callback && callback(new Error("Path \"" + pathLoc + "\" not found"), undefined);
+          break;
+        }
+
+        // Add a relative parent directory
+        relPath += '../';
+        // Switch to relative parent directory
+        process.chdir(path.join(cwd, relPath));
+      }
+    }
+  };
+
+  /**
+    @name file#watch
+    @public
+    @function
+    @description Watch a given path then calls the callback once a change occurs
+    @param {String} path The path to watch
+    @param {Function} callback The function to call when a change occurs
+  */
+  this.watch = function () {
+    _watch.apply(this, arguments);
+  };
+
+  // Compatibility for fs.exists(0.8) and path.exists(0.6)
+  this.exists = (typeof fs.exists === 'function') ? fs.exists : path.exists;
+
+  // Compatibility for fs.existsSync(0.8) and path.existsSync(0.6)
+  this.existsSync = (typeof fs.existsSync === 'function') ? fs.existsSync : path.existsSync;
+
+  /**
+    @name file#requireLocal
+    @public
+    @function
+    @return {Object} The given module is returned
+    @description Require a local module from the node_modules in the current directory
+    @param {String} module The module to require
+    @param {String} message An option message to throw if the module doesn't exist
+  */
+  this.requireLocal = function (module, message) {
+    // Try to require in the application directory
+    try {
+      dep = require(path.join(process.cwd(), 'node_modules', module));
+    }
+    catch(err) {
+      if (message) {
+        throw new Error(message);
+      }
+      throw new Error('Module "' + module + '" could not be found as a ' +
+          'local module.\n Please make sure there is a node_modules directory in the ' +
+          'current directory,\n and install it by doing "npm install ' +
+          module + '"');
+    }
+    return dep;
+  };
+
+})();
+
+module.exports = fileUtils;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/i18n.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/i18n.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/i18n.js
new file mode 100644
index 0000000..aa00950
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/i18n.js
@@ -0,0 +1,60 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var core = require('./core')
+  , i18n;
+
+i18n = new (function () {
+  var _defaultLocale = 'en-us'
+    , _strings = {};
+
+  this.getText = function (key, opts, locale) {
+    var currentLocale = locale || _defaultLocale
+      , currentLocaleStrings = _strings[currentLocale] || {}
+      , defaultLocaleStrings = _strings[_defaultLocale] || {}
+      , str = currentLocaleStrings[key]
+            || defaultLocaleStrings[key] || "[[" + key + "]]";
+    for (p in opts) {
+      str = str.replace(new RegExp('\\{' + p + '\\}', 'g'), opts[p]);
+    }
+    return str;
+  };
+
+  this.getDefaultLocale = function (locale) {
+    return _defaultLocale;
+  };
+
+  this.setDefaultLocale = function (locale) {
+    _defaultLocale = locale;
+  };
+
+  this.loadLocale = function (locale, strings) {
+    _strings[locale] = _strings[locale] || {};
+    core.mixin(_strings[locale], strings);
+  };
+
+})();
+
+i18n.I18n = function (locale) {
+  this.getText = function (key, opts) {
+    return i18n.getText(key, opts || {}, locale);
+  };
+  this.t = this.getText;
+};
+
+module.exports = i18n;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/index.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/index.js
new file mode 100644
index 0000000..97e1118
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/index.js
@@ -0,0 +1,59 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var utils = {}
+// Core methods
+  , core = require('./core')
+// Namespaces with methods
+  , string = require('./string')
+  , file = require('./file')
+  , async = require('./async')
+  , i18n = require('./i18n')
+  , uri = require('./uri')
+  , array = require('./array')
+  , object = require('./object')
+  , date = require('./date')
+  , request = require('./request')
+  , log = require('./log')
+  , network = require('./network')
+// Third-party -- remove this if possible
+  , inflection = require('./inflection')
+// Constructors
+  , EventBuffer = require('./event_buffer').EventBuffer
+  , XML = require('./xml').XML
+  , SortedCollection = require('./sorted_collection').SortedCollection;
+
+core.mixin(utils, core);
+
+utils.string = string;
+utils.file = file;
+utils.async = async;
+utils.i18n = i18n;
+utils.uri = uri;
+utils.array = array;
+utils.object = object;
+utils.date = date;
+utils.request = request;
+utils.log = log;
+utils.network = network;
+utils.inflection = inflection;
+utils.SortedCollection = SortedCollection;
+utils.EventBuffer = EventBuffer;
+utils.XML = XML;
+
+module.exports = utils;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/inflection.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/inflection.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/inflection.js
new file mode 100644
index 0000000..2d89839
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/inflection.js
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2010 George Moschovitis, http://www.gmosx.com
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * A port of the Rails/ActiveSupport Inflector class
+ * http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html
+*/
+
+/**
+  @name inflection
+  @namespace inflection
+*/
+
+var inflection = new (function () {
+
+  /**
+    @name inflection#inflections
+    @public
+    @object
+    @description A list of rules and replacements for different inflection types
+  */
+  this.inflections = {
+      plurals: []
+    , singulars: []
+    , uncountables: []
+  };
+
+  var self = this
+    , setInflection
+    , setPlural
+    , setSingular
+    , setUncountable
+    , setIrregular;
+
+  // Add a new inflection rule/replacement to the beginning of the array for the
+  // inflection type
+  setInflection = function (type, rule, replacement) {
+    self.inflections[type].unshift([rule, replacement]);
+  };
+
+  // Add a new plural inflection rule
+  setPlural = function (rule, replacement) {
+    setInflection('plurals', rule, replacement);
+  };
+
+  // Add a new singular inflection rule
+  setSingular = function (rule, replacement) {
+    setInflection('singulars', rule, replacement);
+  };
+
+  // Add a new irregular word to the inflection list, by a given singular and plural inflection
+  setIrregular = function (singular, plural) {
+    if (singular.substr(0, 1).toUpperCase() == plural.substr(0, 1).toUpperCase()) {
+      setPlural(new RegExp("(" + singular.substr(0, 1) + ")" + singular.substr(1) + "$", "i"),
+        '$1' + plural.substr(1));
+      setPlural(new RegExp("(" + plural.substr(0, 1) + ")" + plural.substr(1) + "$", "i"),
+        '$1' + plural.substr(1));
+      setSingular(new RegExp("(" + plural.substr(0, 1) + ")" + plural.substr(1) + "$", "i"),
+        '$1' + singular.substr(1));
+    } else {
+      setPlural(new RegExp(singular.substr(0, 1).toUpperCase() + singular.substr(1) + "$"),
+        plural.substr(0, 1).toUpperCase() + plural.substr(1));
+      setPlural(new RegExp(singular.substr(0, 1).toLowerCase() + singular.substr(1) + "$"),
+        plural.substr(0, 1).toLowerCase() + plural.substr(1));
+      setPlural(new RegExp(plural.substr(0, 1).toUpperCase() + plural.substr(1) + "$"),
+        plural.substr(0, 1).toUpperCase() + plural.substr(1));
+      setPlural(new RegExp(plural.substr(0, 1).toLowerCase() + plural.substr(1) + "$"),
+        plural.substr(0, 1).toLowerCase() + plural.substr(1));
+      setSingular(new RegExp(plural.substr(0, 1).toUpperCase() + plural.substr(1) + "$"),
+        singular.substr(0, 1).toUpperCase() + singular.substr(1));
+      setSingular(new RegExp(plural.substr(0, 1).toLowerCase() + plural.substr(1) + "$"),
+        singular.substr(0, 1).toLowerCase() + singular.substr(1));
+    }
+  };
+
+  // Add a new word to the uncountable inflection list
+  setUncountable = function (word) {
+    self.inflections.uncountables[word] = true;
+  };
+
+  // Create inflections
+  (function () {
+    setPlural(/$/, "s");
+    setPlural(/s$/i, "s");
+    setPlural(/(ax|test)is$/i, "$1es");
+    setPlural(/(octop|vir)us$/i, "$1i");
+    setPlural(/(alias|status)$/i, "$1es");
+    setPlural(/(bu)s$/i, "$1ses");
+    setPlural(/(buffal|tomat)o$/i, "$1oes");
+    setPlural(/([ti])um$/i, "$1a");
+    setPlural(/sis$/i, "ses");
+    setPlural(/(?:([^f])fe|([lr])f)$/i, "$1$2ves");
+    setPlural(/(hive)$/i, "$1s");
+    setPlural(/([^aeiouy]|qu)y$/i, "$1ies");
+    setPlural(/(x|ch|ss|sh)$/i, "$1es");
+    setPlural(/(matr|vert|ind)(?:ix|ex)$/i, "$1ices");
+    setPlural(/([m|l])ouse$/i, "$1ice");
+    setPlural(/^(ox)$/i, "$1en");
+    setPlural(/(quiz)$/i, "$1zes");
+
+    setSingular(/s$/i, "")
+		setSingular(/ss$/i, "ss")
+    setSingular(/(n)ews$/i, "$1ews")
+    setSingular(/([ti])a$/i, "$1um")
+    setSingular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, "$1$2sis")
+    setSingular(/(^analy)ses$/i, "$1sis")
+    setSingular(/([^f])ves$/i, "$1fe")
+    setSingular(/(hive)s$/i, "$1")
+    setSingular(/(tive)s$/i, "$1")
+    setSingular(/([lr])ves$/i, "$1f")
+    setSingular(/([^aeiouy]|qu)ies$/i, "$1y")
+    setSingular(/(s)eries$/i, "$1eries")
+    setSingular(/(m)ovies$/i, "$1ovie")
+    setSingular(/(x|ch|ss|sh)es$/i, "$1")
+    setSingular(/([m|l])ice$/i, "$1ouse")
+    setSingular(/(bus)es$/i, "$1")
+    setSingular(/(o)es$/i, "$1")
+    setSingular(/(shoe)s$/i, "$1")
+    setSingular(/(cris|ax|test)es$/i, "$1is")
+    setSingular(/(octop|vir)i$/i, "$1us")
+    setSingular(/(alias|status)es$/i, "$1")
+    setSingular(/^(ox)en/i, "$1")
+    setSingular(/(vert|ind)ices$/i, "$1ex")
+    setSingular(/(matr)ices$/i, "$1ix")
+    setSingular(/(quiz)zes$/i, "$1")
+    setSingular(/(database)s$/i, "$1")
+
+    setIrregular("person", "people");
+    setIrregular("man", "men");
+    setIrregular("child", "children");
+    setIrregular("sex", "sexes");
+    setIrregular("move", "moves");
+    setIrregular("cow", "kine");
+
+    setUncountable("equipment");
+    setUncountable("information");
+    setUncountable("rice");
+    setUncountable("money");
+    setUncountable("species");
+    setUncountable("series");
+    setUncountable("fish");
+    setUncountable("sheep");
+    setUncountable("jeans");
+  })();
+
+  /**
+    @name inflection#parse
+    @public
+    @function
+    @return {String} The inflection of the word from the type given
+    @description Parse a word from the given inflection type
+    @param {String} type A type of the inflection to use
+    @param {String} word the word to parse
+  */
+  this.parse = function (type, word) {
+    var lowWord = word.toLowerCase()
+      , inflections = this.inflections[type];
+
+    if (this.inflections.uncountables[lowWord]) {
+      return word;
+    }
+
+    var i = -1;
+    while (++i < inflections.length) {
+      var rule = inflections[i][0]
+        , replacement = inflections[i][1];
+
+      if (rule.test(word)) {
+        return word.replace(rule, replacement)
+      }
+    }
+
+    return word;
+  };
+
+  /**
+    @name inflection#pluralize
+    @public
+    @function
+    @return {String} The plural inflection for the given word
+    @description Create a plural inflection for a word
+    @param {String} word the word to create a plural version for
+  */
+  this.pluralize = function (word) {
+    return this.parse('plurals', word);
+  };
+
+  /**
+    @name inflection#singularize
+    @public
+    @function
+    @return {String} The singular inflection for the given word
+    @description Create a singular inflection for a word
+    @param {String} word the word to create a singular version for
+  */
+  this.singularize = function (word) {
+    return this.parse('singulars', word);
+  };
+
+})();
+
+module.exports = inflection;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/log.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/log.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/log.js
new file mode 100644
index 0000000..d26557b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/log.js
@@ -0,0 +1,67 @@
+var util = require('util')
+  , log
+  , _logger
+  , _levels
+  , _serialize
+  , _output;
+
+_levels = {
+  'debug': 'log'
+, 'info': 'log'
+, 'notice': 'log'
+, 'warning': 'error'
+, 'error': 'error'
+, 'critical': 'error'
+, 'alert': 'error'
+, 'emergency': 'error'
+};
+
+_serialize = function (obj) {
+  var out;
+  if (typeof obj == 'string') {
+    out = obj;
+  }
+  else {
+    out = util.inspect(obj);
+  }
+  return out;
+};
+
+_output = function (obj, level) {
+  var out = _serialize(obj);
+  if (_logger) {
+    _logger[level](out);
+  }
+  else {
+    console[_levels[level]](out);
+  }
+};
+
+
+log = function (obj) {
+  _output(obj, 'info');
+};
+
+log.registerLogger = function (logger) {
+  // Malkovitch, Malkovitch
+  if (logger === log) {
+    return;
+  }
+  _logger = logger;
+};
+
+(function () {
+  var level;
+  for (var p in _levels) {
+    (function (p) {
+      level = _levels[p];
+      log[p] = function (obj) {
+        _output(obj, p);
+      };
+    })(p);
+  }
+  // Also handle 'access', not an actual level
+  log.access = log.info;
+})();
+
+module.exports = log;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/network.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/network.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/network.js
new file mode 100644
index 0000000..c90324d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/network.js
@@ -0,0 +1,72 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var network
+	, net = require('net');
+
+/**
+  @name network
+  @namespace network
+*/
+
+network = new (function () {
+	/**
+		@name network#isPortOpen
+		@public
+		@function
+		@description Checks if the given port in the given host is open
+		@param {Number} port number
+		@param {String} host
+		@param {Function} callback Callback function -- should be in the format
+			of function(err, result) {}
+	*/
+	this.isPortOpen = function (port, host, callback) {
+		if (typeof host === 'function' && !callback) {
+			callback = host;
+			host = 'localhost';
+		}
+
+		var isOpen = false
+			, connection
+			, error;
+
+		connection = net.createConnection(port, host, function () {
+			isOpen = true;
+			connection.end();
+		});
+
+		connection.on('error', function (err) {
+			// We ignore 'ECONNREFUSED' as it simply indicates the port isn't open.
+			// Anything else is reported
+			if(err.code !== 'ECONNREFUSED') {
+				error = err;
+			}
+		});
+
+		connection.setTimeout(400, function () {
+			connection.end();
+		});
+
+		connection.on('close', function () {
+			callback && callback(error, isOpen);
+		});
+	};
+
+})();
+
+module.exports = network;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/object.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/object.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/object.js
new file mode 100644
index 0000000..dd92e7d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/object.js
@@ -0,0 +1,108 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+/**
+  @name object
+  @namespace object
+*/
+
+var object = new (function () {
+
+  /**
+    @name object#merge
+    @public
+    @function
+    @return {Object} Returns the merged object
+    @description Merge merges `otherObject` into `object` and takes care of deep
+                 merging of objects
+    @param {Object} object Object to merge into
+    @param {Object} otherObject Object to read from
+  */
+  this.merge = function (object, otherObject) {
+    var obj = object || {}
+      , otherObj = otherObject || {}
+      , key, value;
+
+    for (key in otherObj) {
+      value = otherObj[key];
+
+      // Check if a value is an Object, if so recursively add it's key/values
+      if (typeof value === 'object' && !(value instanceof Array)) {
+        // Update value of object to the one from otherObj
+        obj[key] = this.merge(obj[key], value);
+      }
+      // Value is anything other than an Object, so just add it
+      else {
+        obj[key] = value;
+      }
+    }
+
+    return obj;
+  };
+
+  /**
+    @name object#reverseMerge
+    @public
+    @function
+    @return {Object} Returns the merged object
+    @description ReverseMerge merges `object` into `defaultObject`
+    @param {Object} object Object to read from
+    @param {Object} defaultObject Object to merge into
+  */
+  this.reverseMerge = function (object, defaultObject) {
+    // Same as `merge` except `defaultObject` is the object being changed
+    // - this is useful if we want to easily deal with default object values
+    return this.merge(defaultObject, object);
+  };
+
+  /**
+    @name object#isEmpty
+    @public
+    @function
+    @return {Boolean} Returns true if empty false otherwise
+    @description isEmpty checks if an Object is empty
+    @param {Object} object Object to check if empty
+  */
+  this.isEmpty = function (object) {
+    // Returns true if a object is empty false if not
+    for (var i in object) { return false; }
+    return true;
+  };
+
+  /**
+    @name object#toArray
+    @public
+    @function
+    @return {Array} Returns an array of objects each including the original key and value
+    @description Converts an object to an array of objects each including the original key/value
+    @param {Object} object Object to convert
+  */
+  this.toArray = function (object) {
+    // Converts an object into an array of objects with the original key, values
+    array = [];
+
+    for (var i in object) {
+      array.push({ key: i, value: object[i] });
+    }
+
+    return array;
+  };
+
+})();
+
+module.exports = object;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/request.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/request.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/request.js
new file mode 100644
index 0000000..0984db1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/request.js
@@ -0,0 +1,143 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var http = require('http')
+  , https = require('https')
+  , url = require('url')
+  , uri = require('./uri')
+  , log = require('./log')
+  , core = require('./core');
+
+var formatters = {
+  xml: function (data) {
+    return data;
+  }
+, html: function (data) {
+    return data;
+  }
+, txt: function (data) {
+    return data;
+  }
+, json: function (data) {
+    return JSON.parse(data);
+  }
+}
+
+/**
+  @name request
+  @namespace request
+  @public
+  @function
+  @description Sends requests to the given url sending any data if the method is POST or PUT
+  @param {Object} opts The options to use for the request
+    @param {String} [opts.url] The URL to send the request to
+    @param {String} [opts.method=GET] The method to use for the request
+    @param {Object} [opts.headers] Headers to send on requests
+    @param {String} [opts.data] Data to send on POST and PUT requests
+    @param {String} [opts.dataType] The type of data to send
+  @param {Function} callback the function to call after, args are `error, data`
+*/
+var request = function (opts, callback) {
+  var client
+    , options = opts || {}
+    , parsed = url.parse(options.url)
+    , path
+    , requester = parsed.protocol == 'http:' ? http : https
+    , method = (options.method && options.method.toUpperCase()) || 'GET'
+    , headers = core.mixin({}, options.headers || {})
+    , contentLength
+    , port
+    , clientOpts;
+
+  if (parsed.port) {
+    port = parsed.port;
+  }
+  else {
+    port = parsed.protocol == 'http:' ? '80' : '443';
+  }
+
+  path = parsed.pathname;
+  if (parsed.search) {
+    path += parsed.search;
+  }
+
+  if (method == 'POST' || method == 'PUT') {
+    if (options.data) {
+      contentLength = options.data.length;
+    }
+    else {
+      contentLength = 0
+    }
+    headers['Content-Length'] = contentLength;
+  }
+
+  clientOpts = {
+    host: parsed.hostname
+  , port: port
+  , method: method
+  , agent: false
+  , path: path
+  , headers: headers
+  };
+  client = requester.request(clientOpts);
+
+  client.addListener('response', function (resp) {
+    var data = ''
+      , dataType;
+    resp.addListener('data', function (chunk) {
+      data += chunk.toString();
+    });
+    resp.addListener('end', function () {
+      var stat = resp.statusCode
+        , err;
+      // Successful response
+      if ((stat > 199 && stat < 300) || stat == 304) {
+        dataType = options.dataType || uri.getFileExtension(parsed.pathname);
+        if (formatters[dataType]) {
+          try {
+            if (data) {
+              data = formatters[dataType](data);
+            }
+          }
+          catch (e) {
+            callback(e, null);
+          }
+        }
+        callback(null, data);
+      }
+      // Something failed
+      else {
+        err = new Error(data);
+        err.statusCode = resp.statusCode;
+        callback(err, null);
+      }
+
+    });
+  });
+
+  client.addListener('error', function (e) {
+    callback(e, null);
+  });
+
+  if ((method == 'POST' || method == 'PUT') && options.data) {
+    client.write(options.data);
+  }
+
+  client.end();
+};
+
+module.exports = request;


[17/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/policy/whitelist.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/policy/whitelist.js b/lib/cordova-blackberry/blackberry10/framework/lib/policy/whitelist.js
new file mode 100644
index 0000000..dcfbc3c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/policy/whitelist.js
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var WebFolderAccess = require("./folderAccess").WebFolderAccess,
+    util = require("../utils");
+
+function _isLocalAccess(access) {
+    return access && access.uri === "WIDGET_LOCAL";
+}
+
+function _isMatch(access, requestURI) {
+    // Look for local first
+    if (_isLocalAccess(access)) {
+        // Local access always allowed
+        //THIS USED TO RETURN TRUE FOR FILE ACCESS
+        //I HAVE TURNED IT OFF BECAUSE IT MAKES NO SENSE THAT LOCAL ACCESS ALWAYS MATCHES FILE ACCESS
+        return (util.isLocalURI(requestURI));
+    } else if (util.isDataURI(requestURI)) {
+        // Check for data url
+        // data urls are allowed
+        return true;
+    }
+
+    // Based on widgets 1.0 (access control)
+    // http://www.w3.org/TR/2009/WD-widgets-access-20090618/#rfc3987
+    var refURI = util.parseUri(access.uri),
+        allowSub = access.allowSubDomain;
+
+    if (!requestURI.path) {
+        requestURI.path = "/";
+    }
+
+    // Start comparison based on widget spec.
+    // 1. Compare scheme
+    if (refURI.scheme.toLowerCase() !== requestURI.scheme.toLowerCase()) {
+        return false;
+    }
+
+    // 2. Compare host - if subdoman is false, host must match exactly
+    // (referenceURI MUST HAVE host specified - not null.)
+    // Special Case: Ignore this condition if we are dealing with file://
+    if (!requestURI.authority && !util.isFileURI(requestURI)) {
+        return false;
+    }
+
+    if (!allowSub && refURI.host.toLowerCase() !== requestURI.host.toLowerCase()) {
+        return false;
+    }
+
+    // 3. Compare host - if subdomain is true, check for subdomain or match
+    if (allowSub && !util.endsWith(requestURI.host.toLowerCase(), "." + refURI.host.toLowerCase()) &&
+        requestURI.host.toLowerCase() !== refURI.host.toLowerCase()) {
+        return false;
+    }
+
+    // 4. Compare port
+    if (refURI.port && refURI.port !== requestURI.port) {
+        return false;
+    }
+
+    // 5.  Compare path+query
+    if (!util.startsWith(requestURI.path.toLowerCase(), refURI.path.toLowerCase()) && refURI.query !== "*") {
+        return false;
+    }
+
+    return true;
+}
+
+function _getAccessForPathAndQuery(folderAccess, path, query) {
+    if (folderAccess) {
+        if (!query) {
+            return folderAccess.getAccess(path);
+        } else {
+            return folderAccess.getAccess(path + "?" + query);
+        }
+    }
+
+    return null;
+}
+
+function AccessManager(config) {
+    config = config || require("../config");
+
+    this._accessList = config.accessList;
+    this._hasGlobalAccess = config.hasMultiAccess;
+    this._authorityCollection = null;
+    this._localAccess = null;
+}
+
+AccessManager.prototype.getFolderAccess = function (scheme, authority) {
+    var key = scheme + "://" + authority;
+    key = key.toLowerCase();
+
+    if (this._authorityCollection.hasOwnProperty(key)) {
+        return this._authorityCollection[key];
+    }
+
+    return null;
+};
+
+AccessManager.prototype.putFolderAccess = function (scheme, authority, folderAccess) {
+    var key = scheme + "://" + authority;
+    key = key.toLowerCase();
+    this._authorityCollection[key] = folderAccess;
+};
+
+AccessManager.prototype.initializeAuthCollection = function () {
+    var folderAccess, currentURI, that = this;
+
+    if (!this._authorityCollection) {
+        this._authorityCollection = {};
+
+        if (this._accessList) {
+            this._accessList.forEach(function (access) {
+                if (_isLocalAccess(access)) {
+                    that._localAccess = access;
+                } else {
+                    currentURI = util.parseUri(access.uri);
+
+                    // Check the authority collection to see if the authority item
+                    // we want already exists
+                    folderAccess = that.getFolderAccess(currentURI.scheme, currentURI.authority) || new WebFolderAccess();
+
+                    // Add folder path access to the authority item
+                    if (!currentURI.query) {
+                        folderAccess.addAccess(currentURI.path, access);
+                    } else {
+                        folderAccess.addAccess(currentURI.path + "?" + currentURI.query, access);
+                    }
+
+                    that.putFolderAccess(currentURI.scheme, currentURI.authority, folderAccess);
+                }
+            });
+        }
+    }
+};
+
+AccessManager.prototype.authorityCheck = function (port, scheme, authority) {
+    var originalAuthority = authority;
+
+    if (port) {
+        // If authority has a specific port, and the collection does not have an access matches
+        // the exact authority, strip port from authority to see if there is a match
+        if (!this.getFolderAccess(scheme, authority)) {
+            authority = authority.slice(0, authority.lastIndexOf(":"));
+            authority = this.authorityCheck("", scheme, authority);
+        }
+
+        //If no successful match was found without the port, reset the authority and try with it
+        if (!this.getFolderAccess(scheme, authority)) {
+            authority = originalAuthority;
+        }
+    }
+
+    if (authority.indexOf(".") === -1) {
+        // If authority is computer name, must have exact match in collection
+        if (!this.getFolderAccess(scheme, authority)) {
+            return "";
+        }
+
+        return authority;
+    }
+
+    while (authority && !this.getFolderAccess(scheme, authority)) {
+        if (authority.indexOf(".") === -1) {
+            return "";
+        }
+        authority = authority.substring(authority.indexOf(".") + 1);
+    }
+
+    return authority;
+};
+
+AccessManager.prototype.getFromFolderAccess = function (folderAccess, requestURI) {
+    var fetchedAccess = null,
+        scheme = requestURI.scheme,
+        authority = requestURI.authority,
+        path = requestURI.path,
+        query = requestURI.query,
+        prevAuthority;
+
+    if (!path) {
+        fetchedAccess = folderAccess.getAccess("/");
+    } else {
+        fetchedAccess = _getAccessForPathAndQuery(folderAccess, path, query);
+    }
+
+    // Make sure we've got the right one
+    while (!fetchedAccess || !_isMatch(fetchedAccess, requestURI)) {
+        // There was an auth url that matched, but didnt match the folder structure
+        // Try the next level up
+        prevAuthority = authority;
+        authority = authority.substring(authority.indexOf(".") + 1);
+        //If authority hasn't changed, then this loop will continue endlessly because nothing else has changed
+        //This will happen when an element has the same authority but no folder access.
+        if (prevAuthority === authority) {
+            return null;
+        }
+
+        // Check for an authority string that has an existing key
+        authority = this.authorityCheck(requestURI.port, scheme, authority);
+        if (!authority) {
+            return null;
+        }
+
+        // Retrieve access set for the specified authority
+        folderAccess = this.getFolderAccess(scheme, authority);
+
+        // Special case: no access element was found for a file protocol request.
+        // This is added since file protocol was allowed through the above check
+        if (scheme === "file" && !folderAccess) {
+            return null;
+        }
+
+        fetchedAccess = _getAccessForPathAndQuery(folderAccess, path, query);
+    }
+
+    return fetchedAccess;
+};
+
+AccessManager.prototype.getAccessByUrl = function (url) {
+    var requestURI = util.parseUri(url),
+        authority = requestURI.authority,
+        scheme = requestURI.scheme,
+        folderAccess,
+        fetchedAccess;
+
+    if (util.isAbsoluteURI(requestURI)) {
+        // Initialize authority collection if it does not yet exist
+        this.initializeAuthCollection();
+
+        // Start with the full authority path and check if an access exists for that path
+        // If it does not exist, remove the first section of the authority path and try again
+
+        // Check for an authority string that has an existing key
+        // Special case: Allow file, and local protocol to proceed without an authority
+        authority = this.authorityCheck(requestURI.port, scheme, authority);
+        if (!authority && !(scheme === "file" || scheme === "local" || scheme === "data")) {
+            return null;
+        }
+        // Retrieve access set for the specified authority
+        folderAccess = this.getFolderAccess(scheme, authority);
+
+        // Special case: no access was found for a file protocol request
+        // This is added since file protocol was allowed through the above check
+        if (scheme === "file" && !folderAccess) {
+            return null;
+        } else if (scheme === "local" && !folderAccess) {
+            // If no access element is found with local URI, use local access for this request
+            return this._localAccess;
+        } else if (scheme === "data") {
+            // Always allow data-uris
+            return true;
+        }
+
+        fetchedAccess = this.getFromFolderAccess(folderAccess, requestURI);
+
+        if (fetchedAccess) {
+            return fetchedAccess;
+        } else if (this._localAccess && _isMatch(this._localAccess, requestURI)) {
+            // If we cannot find a more specific access for this local URI, use local access
+            return this._localAccess;
+        } else if (folderAccess && _isMatch(folderAccess, requestURI)) {
+            return folderAccess;
+        }
+    }
+
+    return null;
+};
+
+AccessManager.prototype.hasGlobalAccess = function () {
+    return this._hasGlobalAccess;
+};
+
+function Whitelist(config) {
+    this._mgr = new AccessManager(config);
+}
+
+Whitelist.prototype.getFeaturesForUrl = function (url) {
+    var access = this._mgr.getAccessByUrl(url),
+        featureIds = [];
+
+    if (access && access.features) {
+        access.features.forEach(function (elem) {
+            featureIds.push(elem.id);
+        });
+    }
+
+    return featureIds;
+};
+
+Whitelist.prototype.isFeatureAllowed = function (url, feature) {
+    var features = this.getFeaturesForUrl(url);
+
+    return !!features && features.reduce(function (found, current) {
+        return found || current === feature;
+    }, false);
+};
+
+Whitelist.prototype.isAccessAllowed = function (url, isXHR) {
+    return (this._mgr.hasGlobalAccess() && !isXHR) || !!this._mgr.getAccessByUrl(url);
+};
+
+exports.Whitelist = Whitelist;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/server.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/server.js b/lib/cordova-blackberry/blackberry10/framework/lib/server.js
new file mode 100644
index 0000000..15b95b0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/server.js
@@ -0,0 +1,121 @@
+/*
+ *  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.
+ */
+
+var DEFAULT_SERVICE = "default",
+    DEFAULT_ACTION = "exec";
+
+function rebuildRequest(req) {
+    var originalURL = req.params.service + "/" +
+            req.params.action +
+            (req.params.ext ? "/" + req.params.ext  : "") +
+            (req.params.method ? "/" + req.params.method : "") +
+            (req.params.args ? "?" + req.params.args : ""),
+        tokens = originalURL.split('/'),
+        //Handle the case where the method is multi-level
+        finalToken = (tokens[1] && tokens.length > 2) ? tokens.slice(1).join('/') : tokens[1],
+        args = null;
+
+    // set args
+    if (finalToken && finalToken.indexOf("?") >= 0) {
+        // Re-split args
+        args = finalToken.split("?")[1];
+    }
+
+    return {
+        params : {
+            service : DEFAULT_SERVICE,
+            action : DEFAULT_ACTION,
+            ext : tokens[0],
+            method : (finalToken && finalToken.indexOf("?") >= 0) ? finalToken.split("?")[0] : finalToken,
+            args : args
+        },
+        body : req.body,
+        origin : req.origin
+    };
+}
+
+function parseArgs(req) {
+    var args = null,
+        params;
+    // set args
+    if (req.params.args && typeof req.params.args === "string") {
+        // GET querystring to json
+        params = req.params.args.split("&");
+        if (params) {
+            args = {};
+            params.forEach(function (param) {
+                var parts = param.split("=");
+                args[parts[0]] = parts[1];
+            });
+        }
+    } else {
+        // POST body to json
+        if (req.body) {
+            args = JSON.parse(req.body);
+        }
+    }
+    req.params.args = args;
+}
+
+module.exports = {
+    handle: function (req, res, sourceWebview, config) {
+        try {
+            var pluginName = "lib/plugins/" + req.params.service,
+                plugin;
+
+            if (frameworkModules.indexOf(pluginName + ".js") === -1) {
+                pluginName = "lib/plugins/" + DEFAULT_SERVICE;
+                req = rebuildRequest(req);
+            }
+
+            parseArgs(req);
+
+            //Updating because some versions of node only work with relative paths
+            pluginName = pluginName.replace('lib', '.');
+
+            plugin = require("./utils").loadModule(pluginName);
+
+            plugin[req.params.action](req,
+            function (result) {
+                res.send(200, encodeURIComponent(JSON.stringify({
+                    code: 42,
+                    data: result
+                })));
+            },
+            function (code, error, httpCode) {
+                if (!httpCode) {
+                    httpCode = 200;
+                }
+
+                res.send(httpCode, encodeURIComponent(JSON.stringify({
+                    code: Math.abs(code) * -1 || -1,
+                    data: null,
+                    msg: error
+                })));
+            },
+            req.params.args,
+            {
+                "request": req,
+                "response": res,
+                "webview": sourceWebview,
+                "config": config
+            });
+        } catch (e) {
+            console.error(e);
+            res.send(404, "can't find the stuff");
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/utils.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/utils.js b/lib/cordova-blackberry/blackberry10/framework/lib/utils.js
new file mode 100644
index 0000000..4ab008a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/utils.js
@@ -0,0 +1,549 @@
+/*
+ *  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.
+ */
+
+var self,
+    exception = require('./exception');
+
+function S4() {
+    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
+}
+
+self = module.exports = {
+    validateNumberOfArguments: function (lowerBound, upperBound, numberOfArguments, customExceptionType, customExceptionMessage, customExceptionObject) {
+
+        customExceptionMessage = customExceptionMessage || "";
+
+        if (arguments.length < 3 || arguments.length > 6) {
+            exception.raise(exception.types.Argument, "Wrong number of arguments when calling: validateNumberOfArguments()");
+        }
+
+        if (isNaN(lowerBound) && isNaN(upperBound) && isNaN(numberOfArguments)) {
+            exception.raise(exception.types.ArgumentType, "(validateNumberOfArguments) Arguments are not numbers");
+        }
+
+        lowerBound = parseInt(lowerBound, 10);
+        upperBound = parseInt(upperBound, 10);
+        numberOfArguments = parseInt(numberOfArguments, 10);
+
+        if (numberOfArguments < lowerBound || numberOfArguments > upperBound) {
+            exception.raise((customExceptionType || exception.types.ArgumentLength), (customExceptionMessage + "\n\nWrong number of arguments"), customExceptionObject);
+        }
+
+    },
+
+    validateArgumentType: function (arg, argType, customExceptionType, customExceptionMessage, customExceptionObject) {
+        var invalidArg = false,
+            msg;
+
+        switch (argType) {
+        case "array":
+            if (!arg instanceof Array) {
+                invalidArg = true;
+            }
+            break;
+        case "date":
+            if (!arg instanceof Date) {
+                invalidArg = true;
+            }
+            break;
+        case "integer":
+            if (typeof arg === "number") {
+                if (arg !== Math.floor(arg)) {
+                    invalidArg = true;
+                }
+            }
+            else {
+                invalidArg = true;
+            }
+            break;
+        default:
+            if (typeof arg !== argType) {
+                invalidArg = true;
+            }
+            break;
+        }
+
+        if (invalidArg) {
+            msg = customExceptionMessage +  ("\n\nInvalid Argument type. argument: " + arg + " ==> was expected to be of type: " + argType);
+            exception.raise((customExceptionType || exception.types.ArgumentType), msg, customExceptionObject);
+        }
+    },
+
+    validateMultipleArgumentTypes: function (argArray, argTypeArray, customExceptionType, customExceptionMessage, customExceptionObject) {
+        for (var i = 0; i < argArray.length; i++) {
+            this.validateArgumentType(argArray[i], argTypeArray[i], customExceptionType, customExceptionMessage, customExceptionObject);
+        }
+    },
+
+    arrayContains: function (array, obj) {
+        var i = array.length;
+        while (i--) {
+            if (array[i] === obj) {
+                return true;
+            }
+        }
+        return false;
+    },
+
+    some: function (obj, predicate, scope) {
+        if (obj instanceof Array) {
+            return obj.some(predicate, scope);
+        }
+        else {
+            var values = self.map(obj, predicate, scope);
+
+            return self.reduce(values, function (some, value) {
+                return value ? value : some;
+            }, false);
+        }
+    },
+
+    count: function (obj) {
+        return self.sum(obj, function (total) {
+            return 1;
+        });
+    },
+
+    sum: function (obj, selector, scope) {
+        var values = self.map(obj, selector, scope);
+        return self.reduce(values, function (total, value) {
+            return total + value;
+        });
+    },
+
+    max: function (obj, selector, scope) {
+        var values = self.map(obj, selector, scope);
+        return self.reduce(values, function (max, value) {
+            return max < value ? value : max;
+        }, Number.MIN_VALUE);
+    },
+
+    min: function (obj, selector, scope) {
+        var values = self.map(obj, selector, scope);
+        return self.reduce(values, function (min, value) {
+            return min > value ? value : min;
+        }, Number.MAX_VALUE);
+    },
+
+    forEach: function (obj, action, scope) {
+        if (obj instanceof Array) {
+            return obj.forEach(action, scope);
+        }
+        else {
+            self.map(obj, action, scope);
+        }
+    },
+
+    filter: function (obj, predicate, scope) {
+        if (obj instanceof Array) {
+            return obj.filter(predicate, scope);
+        }
+        else {
+            var result = [];
+            self.forEach(obj, function (value, index) {
+                if (predicate.apply(scope, [value, index])) {
+                    result.push(value);
+                }
+
+            }, scope);
+
+            return result;
+        }
+    },
+
+    reduce: function (obj, func, init, scope) {
+        var i,
+            initial = init === undefined ? 0 : init,
+            result = initial;
+
+
+        if (obj instanceof Array) {
+            return obj.reduce(func, initial);
+        }
+        else if (obj instanceof NamedNodeMap) {
+            for (i = 0; i < obj.length; i++) {
+                result = func.apply(scope, [result, obj[i], i]);
+            }
+        }
+        else {
+            for (i in obj) {
+                if (obj.hasOwnProperty(i)) {
+                    result = func.apply(scope, [result, obj[i], i]);
+                }
+            }
+        }
+
+        return result;
+
+    },
+
+    map: function (obj, func, scope) {
+        var i,
+            returnVal = null,
+            result = [];
+
+        if (obj instanceof Array) {
+            return obj.map(func, scope);
+        }
+        else if (obj instanceof NamedNodeMap) {
+            for (i = 0; i < obj.length; i++) {
+                returnVal = func.apply(scope, [obj[i], i]);
+                result.push(returnVal);
+            }
+        }
+        else {
+            for (i in obj) {
+                if (obj.hasOwnProperty(i)) {
+                    returnVal = func.apply(scope, [obj[i], i]);
+                    result.push(returnVal);
+                }
+            }
+        }
+
+        return result;
+    },
+
+    series: function (tasks, callback) {
+
+        var execute = function () {
+            var args = [],
+                task;
+
+            if (tasks.length) {
+                task = tasks.shift();
+                args = args.concat(task.args).concat(execute);
+                task.func.apply(this, args);
+            }
+            else {
+                callback.func.apply(this, callback.args);
+            }
+        };
+
+        execute();
+    },
+
+    regexSanitize: function (regexString) {
+        return regexString.replace("^", "\\^")
+                    .replace("$", "\\$")
+                    .replace("(", "\\(")
+                    .replace(")", "\\)")
+                    .replace("<", "\\<")
+                    .replace("[", "\\[")
+                    .replace("{", "\\{")
+                    .replace(/\\/, "\\\\")
+                    .replace("|", "\\|")
+                    .replace(">", "\\>")
+                    .replace(".", "\\.")
+                    .replace("*", "\\*")
+                    .replace("+", "\\+")
+                    .replace("?", "\\?");
+    },
+
+    find: function (comparison, collection, startInx, endInx, callback) {
+        var results = [],
+            compare = function (s, pattern) {
+
+                if (typeof(s) !== "string" || pattern === null) {
+                    return s === pattern;
+                }
+
+                var regex = pattern.replace(/\./g, "\\.")
+                                   .replace(/\^/g, "\\^")
+                                   .replace(/\*/g, ".*")
+                                   .replace(/\\\.\*/g, "\\*");
+
+                regex = "^".concat(regex, "$");
+
+                return !!s.match(new RegExp(regex, "i"));
+            };
+
+        self.forEach(collection, function (c) {
+            var match,
+                fail = false;
+
+            self.forEach(comparison, function (value, key) {
+                if (!fail && value !== undefined) {
+
+                    if (compare(c[key], value)) {
+                        match = c;
+                    }
+                    else {
+                        fail = true;
+                        match = null;
+                    }
+                }
+            });
+
+            if (match) {
+                results.push(match);
+            }
+        });
+
+        if (callback) {
+            if (startInx === undefined) {
+                startInx = 0;
+            }
+            if (endInx === undefined) {
+                endInx = results.length;
+            }
+            if (startInx === endInx) {
+                endInx = startInx + 1;
+            }
+
+            callback.apply(null, [results.slice(startInx, endInx)]);
+        }
+    },
+
+    mixin: function (mixin, to) {
+        Object.getOwnPropertyNames(mixin).forEach(function (prop) {
+            if (Object.hasOwnProperty.call(mixin, prop)) {
+                Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(mixin, prop));
+            }
+        });
+        return to;
+    },
+
+    copy: function (obj) {
+        var i,
+            newObj = (obj === null ? false : global.toString.call(obj) === "[object Array]") ? [] : {};
+
+        if (typeof obj === 'number' ||
+            typeof obj === 'string' ||
+            typeof obj === 'boolean' ||
+            obj === null ||
+            obj === undefined) {
+            return obj;
+        }
+
+        if (obj instanceof Date) {
+            return new Date(obj);
+        }
+
+        if (obj instanceof RegExp) {
+            return new RegExp(obj);
+        }
+
+        for (i in obj) {
+            if (obj.hasOwnProperty(i)) {
+                if (obj[i] && typeof obj[i] === "object") {
+                    if (obj[i] instanceof Date) {
+                        newObj[i] = obj[i];
+                    }
+                    else {
+                        newObj[i] = self.copy(obj[i]);
+                    }
+                }
+                else {
+                    newObj[i] = obj[i];
+                }
+            }
+        }
+
+        return newObj;
+    },
+
+    startsWith : function (str, substr) {
+        return str.indexOf(substr) === 0;
+    },
+
+    endsWith : function (str, substr) {
+        return str.indexOf(substr, str.length - substr.length) !== -1;
+    },
+
+    parseUri : function (str) {
+        var i, uri = {},
+            key = [ "source", "scheme", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor" ],
+            matcher = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(str);
+
+        for (i = key.length - 1; i >= 0; i--) {
+            uri[key[i]] = matcher[i] || "";
+        }
+
+        return uri;
+    },
+
+    // uri - output from parseUri
+    isAbsoluteURI : function (uri) {
+        if (uri && uri.source) {
+            return uri.relative !== uri.source;
+        }
+
+        return false;
+    },
+
+    fileNameToImageMIME : function (fileName) {
+
+        var extensionsToMIME = {},
+            ext;
+
+        extensionsToMIME.png = 'image/png';
+        extensionsToMIME.jpg = 'image/jpeg';
+        extensionsToMIME.jpe = 'image/jpeg';
+        extensionsToMIME.jpeg = 'image/jpeg';
+        extensionsToMIME.gif = 'image/gif';
+        extensionsToMIME.bmp = 'image/bmp';
+        extensionsToMIME.bm = 'image/bmp';
+        extensionsToMIME.svg = 'image/svg+xml';
+        extensionsToMIME.tif = 'image/tiff';
+        extensionsToMIME.tiff = 'image/tiff';
+
+        ext = fileName.split('.').pop();
+        return extensionsToMIME[ext];
+    },
+
+    isLocalURI : function (uri) {
+        return uri && uri.scheme && "local:///".indexOf(uri.scheme.toLowerCase()) !== -1;
+    },
+
+    isFileURI : function (uri) {
+        return uri && uri.scheme && "file://".indexOf(uri.scheme.toLowerCase()) !== -1;
+    },
+
+    isHttpURI : function (uri) {
+        return uri && uri.scheme && "http://".indexOf(uri.scheme.toLowerCase()) !== -1;
+    },
+
+    isHttpsURI : function (uri) {
+        return uri && uri.scheme && "https://".indexOf(uri.scheme.toLowerCase()) !== -1;
+    },
+
+    // Checks if the specified uri starts with 'data:'
+    isDataURI : function (uri) {
+        return uri && uri.scheme && "data:".indexOf(uri.scheme.toLowerCase()) !== -1;
+    },
+
+    performExec : function (featureId, property, args) {
+        var result;
+
+        window.webworks.exec(function (data, response) {
+            result = data;
+        }, function (data, response) {
+            throw data;
+        }, featureId, property, args, true);
+
+        return result;
+    },
+
+    inNode : function () {
+        return !!require.resolve;
+    },
+
+    requireWebview : function () {
+        return require("./webview");
+    },
+    convertDataToBinary : function (data, dataEncoding) {
+        var rawData,
+            uint8Array,
+            i;
+
+        if (data) {
+            if (dataEncoding.toLowerCase() === "base64") {
+                rawData = window.atob(data);
+            }
+            else {
+                rawData = data;
+            }
+
+            uint8Array = new Uint8Array(new ArrayBuffer(rawData.length));
+
+            for (i = 0; i < uint8Array.length; i++) {
+                uint8Array[i] = rawData.charCodeAt(i);
+            }
+
+            return uint8Array.buffer;
+        }
+    },
+    getBlobWithArrayBufferAsData : function (data, dataEncoding) {
+        var rawData,
+            blobBuilderObj = new window.WebKitBlobBuilder();
+        rawData = this.convertDataToBinary(data, dataEncoding);
+        blobBuilderObj.append(rawData);
+
+        return blobBuilderObj.getBlob("arraybuffer");
+    },
+    loadModule: function (module) {
+        return require(module);
+    },
+    loadExtensionModule: function (plugin, path) {
+        if (plugin && path) {
+            return require("../plugin/" + plugin + "/" + path);
+        } else {
+            return null;
+        }
+    },
+    hasPermission: function (config, permission) {
+        if (config && config.permissions && config.permissions.length) {
+            return config.permissions.indexOf(permission) >= 0;
+        }
+
+        return false;
+    },
+    guid: function () {
+        return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
+    },
+    getURIPrefix: function () {
+        return "http://localhost:8472/";
+    },
+    translatePath: function (path) {
+        if (path.indexOf("local:///") === 0) {
+            var sourceDir = window.qnx.webplatform.getApplication().getEnv("HOME"); //leading slashes need to be removed
+            path = "file:///" + sourceDir.replace(/^\/*/, '') + "/../app/native/" + path.replace(/local:\/\/\//, '');
+        }
+        return path;
+    },
+    invokeInBrowser: function (url) {
+        var request = {
+            uri: url,
+            target: "sys.browser"
+        };
+        window.qnx.webplatform.getApplication().invocation.invoke(request);
+    },
+    isPersonal: function () {
+        return window.qnx.webplatform.getApplication().getEnv("PERIMETER") === "personal";
+    },
+    deepclone: function (obj) {
+        var newObj = obj instanceof Array ? [] : {},
+            key;
+
+        if (typeof obj === 'number' ||
+                typeof obj === 'string' ||
+                typeof obj === 'boolean' ||
+                obj === null ||
+                obj === undefined) {
+            return obj;
+        }
+
+        if (obj instanceof Date) {
+            return new Date(obj);
+        }
+
+        if (obj instanceof RegExp) {
+            return new RegExp(obj);
+        }
+
+        for (key in obj) {
+            if (obj.hasOwnProperty(key)) {
+                if (obj[key] && typeof obj[key] === "object") {
+                    newObj[key] = self.deepclone(obj[key]);
+                } else {
+                    newObj[key] = obj[key];
+                }
+            }
+        }
+
+        return newObj;
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/webkitEvent.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/webkitEvent.js b/lib/cordova-blackberry/blackberry10/framework/lib/webkitEvent.js
new file mode 100644
index 0000000..0f4bef7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/webkitEvent.js
@@ -0,0 +1,87 @@
+/*
+ *  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.
+ */
+var utils = require('./utils'),
+    exception = require('./exception'),
+    _listeners = {};
+
+function _on(eventType, listener, scope, once) {
+    if (!eventType) {
+        throw "eventType must be truthy";
+    }
+    _listeners[eventType] = _listeners[eventType] || [];
+    _listeners[eventType].push({
+        func: listener,
+        scope: scope,
+        once: !!once
+    });
+}
+
+function _trigger(listener, args, sync) {
+    try {
+        if (sync) {
+            listener.func.apply(listener.scope, args);
+        }
+        else {
+            setTimeout(function () {
+                listener.func.apply(listener.scope, args);
+            }, 1);
+        }
+    }
+    catch (e) {
+        exception.handle(e);
+    }
+}
+
+module.exports = {
+    on: function (eventType, listener, scope) {
+        _on(eventType, listener, scope, false);
+    },
+
+    once: function (eventType, listener, scope) {
+        _on(eventType, listener, scope, true);
+    },
+
+    trigger: function (eventType, args, sync) {
+        args = args || [];
+        sync = sync || false;
+
+        var listeners = _listeners[eventType];
+
+        if (listeners) {
+            listeners.forEach(function (listener) {
+                _trigger(listener, args, sync);
+            });
+
+            _listeners[eventType] = listeners.filter(function (listener) {
+                return !listener.once;
+            });
+        }
+    },
+
+    eventHasSubscriber: function (eventType) {
+        return !!_listeners[eventType];
+    },
+
+    getEventSubscribers: function (eventType) {
+        return utils.copy(_listeners[eventType]) || [];
+    },
+
+    clear: function (eventType) {
+        if (eventType) {
+            delete _listeners[eventType];
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/webkitHandlers/networkResourceRequested.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/webkitHandlers/networkResourceRequested.js b/lib/cordova-blackberry/blackberry10/framework/lib/webkitHandlers/networkResourceRequested.js
new file mode 100644
index 0000000..759c8bd
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/webkitHandlers/networkResourceRequested.js
@@ -0,0 +1,126 @@
+/*
+ *  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.
+ */
+var Whitelist = require('../policy/whitelist').Whitelist,
+    ACCEPT_RESPONSE = {setAction: "ACCEPT"},
+    DENY_RESPONSE = {setAction: "DENY"},
+    SUBSTITUTE_RESPONSE = {setAction: "SUBSTITUTE"},
+    utils = require('../utils');
+
+function _formMessage(url, origin, sid, body, securityOrigin, webview) {
+    var tokens = url.split(utils.getURIPrefix())[1].split("/"),
+        //Handle the case where the method is multi-level
+        finalToken = (tokens[3] && tokens.length > 4) ? tokens.slice(3).join('/') : tokens[3];
+
+    return {
+        request : {
+            params : {
+                service : tokens[0],
+                action : tokens[1],
+                ext : tokens[2],
+                method : (finalToken && finalToken.indexOf("?") >= 0) ? finalToken.split("?")[0] : finalToken,
+                args : (finalToken && finalToken.indexOf("?") >= 0) ? finalToken.split("?")[1] : null
+            },
+            body : body,
+            origin : origin,
+            securityOrigin: securityOrigin
+
+        },
+        response : {
+            send : function (code, data) {
+                var responseText;
+                if (typeof(data) === 'string') {
+                    responseText = data;
+                } else {
+                    responseText =  JSON.stringify(data);
+                }
+
+                webview.notifyOpen(sid, code, "OK");
+                webview.notifyHeaderReceived(sid, "Access-Control-Allow-Origin", "*");
+                webview.notifyHeaderReceived(sid, "Access-Control-Allow-Origin", securityOrigin);
+                webview.notifyHeaderReceived(sid, "Access-Control-Allow-Headers", "Content-Type");
+                webview.notifyDataReceived(sid, responseText, responseText.length);
+                webview.notifyDone(sid);
+            }
+        }
+    };
+}
+
+function networkResourceRequestedHandler(value) {
+    var config = require("./../config"),
+        obj = JSON.parse(value),
+        response,
+        url = obj.url,
+        body = obj.body,
+        whitelist = new Whitelist(),
+        server,
+        message,
+        sid = obj.streamId,
+        origin = obj.referrer,
+        securityOrigin = obj.securityOrigin,
+        isXHR = obj.targetType === "TargetIsXMLHTTPRequest",
+        //Assumes its a navigation request if the target is the main frame
+        isNav = obj.targetType === "TargetIsMainFrame",
+        hasAccess = whitelist.isAccessAllowed(url, isXHR),
+        deniedMsg;
+
+    //If the URL starts with the prefix then its a request from an API
+    //In this case we will hijack and give our own response
+    //Otherwise follow whitelisting rules
+    if (url.match("^" + utils.getURIPrefix())) {
+        server = require("../server");
+        message = _formMessage(url, origin, sid, body, securityOrigin, this.webview, config);
+        response = SUBSTITUTE_RESPONSE;
+        server.handle(message.request, message.response, this.webview);
+    } else {
+        //Whitelisting will not prevent navigation, ONLY we will
+        //Except when they've disabled web security
+        if (hasAccess || !config.enableWebSecurity) {
+            response = ACCEPT_RESPONSE;
+        } else {
+            response = DENY_RESPONSE;
+            url = utils.parseUri(url);
+            deniedMsg = "Access to \"" + url.source + "\" not allowed";
+
+            console.warn(deniedMsg);
+
+            //Denied navigation requests are sent to the inApp browser rather than an alert
+            if (isNav) {
+                if (config.enableChildWebView) {
+                    this.webview.uiWebView.childwebviewcontrols.open(url.source);
+                } else {
+                    utils.invokeInBrowser(url.source);
+                }
+            } else {
+                this.webview.executeJavaScript("alert('" + deniedMsg + "')");
+            }
+        }
+    }
+
+    if (response) {
+        return JSON.stringify(response);
+    }
+}
+
+function NetworkResourceRequestHandler(webview) {
+    this.webview = webview;
+    this.networkResourceRequestedHandler = networkResourceRequestedHandler.bind(this);
+}
+
+module.exports = {
+    createHandler: function (webview) {
+        return new NetworkResourceRequestHandler(webview);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/webview.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/webview.js b/lib/cordova-blackberry/blackberry10/framework/lib/webview.js
new file mode 100644
index 0000000..495dfbe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/webview.js
@@ -0,0 +1,271 @@
+/*
+ *  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.
+ */
+
+var networkResourceRequested = require('./webkitHandlers/networkResourceRequested'),
+    utils = require('./utils'),
+    config = require('./config'),
+    webkitOriginAccess = require("./policy/webkitOriginAccess"),
+    CHROME_HEIGHT = 0,
+    OUT_OF_PROCESS = 1,
+    webview,
+    _webviewObj;
+
+webview =
+    {
+    create: function (ready) {
+        _webviewObj = window.qnx.webplatform.createWebView({processId: OUT_OF_PROCESS, defaultSendEventHandlers: ['onChooseFile', 'onOpenWindow'], defaultWebEventHandlers: ['InvokeRequestEvent']}, function () {
+            //Create webkit event handlers
+            var requestObj =  networkResourceRequested.createHandler(_webviewObj);
+
+            //Bind networkResourceRequested event so that everything works
+            _webviewObj.onNetworkResourceRequested = requestObj.networkResourceRequestedHandler;
+
+            webkitOriginAccess.addWebView(_webviewObj);
+
+            _webviewObj.visible = true;
+            _webviewObj.active = true;
+            _webviewObj.zOrder = 0;
+            _webviewObj.setGeometry(0, CHROME_HEIGHT, screen.width, screen.height - CHROME_HEIGHT);
+
+            if (typeof config.backgroundColor !== 'undefined') {
+                _webviewObj.backgroundColor = config.backgroundColor;
+            }
+
+            if (typeof config.customHeaders !== 'undefined') {
+                _webviewObj.extraHttpHeaders = config.customHeaders;
+            }
+
+            if (typeof config.userAgent !== 'undefined') {
+                _webviewObj.userAgent = config.userAgent;
+            }
+
+            _webviewObj.autoDeferNetworkingAndJavaScript = config.autoDeferNetworkingAndJavaScript;
+
+            /* Catch and trigger our custom HTML dialog */
+            _webviewObj.allowWebEvent("DialogRequested");
+
+            _webviewObj.addEventListener("DocumentLoadFinished", function () {
+                // show app window if auto hide splash screen is true, OR splash screen is not specified
+                // if auto hide is set to false explicitly but no splash screen is specified, should still show app window
+                // otherwise the app cannot be launched
+                if (config.autoHideSplashScreen || !config["rim:splash"]) {
+                    window.qnx.webplatform.getApplication().windowVisible = true;
+                }
+            });
+
+
+            if (ready && typeof ready === 'function') {
+                ready();
+            }
+
+            window.qnx.webplatform.getController().dispatchEvent("webview.initialized", [_webviewObj]);
+
+            // If content is not loaded, too bad open the visibility up.
+            setTimeout(function () {
+                if (config.autoHideSplashScreen || !config["rim:splash"]) {
+                    window.qnx.webplatform.getApplication().windowVisible = true;
+                }
+            }, 2500);
+        });
+
+    },
+
+    destroy: function () {
+        _webviewObj.destroy();
+    },
+
+    setURL: function (url) {
+        _webviewObj.url = url;
+    },
+
+    reload: function () {
+        _webviewObj.reload();
+    },
+
+    executeJavascript: function (js) {
+        _webviewObj.executeJavaScript(js);
+    },
+
+    addEventListener: function (eventName, callback) {
+        _webviewObj.addEventListener(eventName, callback);
+    },
+
+    removeEventListener: function (eventName, callback) {
+        _webviewObj.removeEventListener(eventName, callback);
+    },
+
+    windowGroup: function () {
+        return _webviewObj.windowGroup;
+    },
+
+    getGeometry: function () {
+        return this.geometry;
+    },
+
+    setGeometry: function (x, y, width, height) {
+        this.geometry = {x: x, y: y, w: width, h: height};
+        _webviewObj.setGeometry(x, y, width, height);
+    },
+
+    setApplicationOrientation: function (angle) {
+        _webviewObj.setApplicationOrientation(angle);
+    },
+
+    setExtraPluginDirectory: function (directory) {
+        _webviewObj.setExtraPluginDirectory(directory);
+    },
+
+    setEnablePlugins: function (enablePlugins) {
+        _webviewObj.pluginsEnabled = enablePlugins;
+    },
+
+    getEnablePlugins: function () {
+        return _webviewObj.pluginsEnabled;
+    },
+
+    notifyApplicationOrientationDone: function () {
+        _webviewObj.notifyApplicationOrientationDone();
+    },
+
+    setSandbox: function (sandbox) {
+        _webviewObj.setFileSystemSandbox = sandbox;
+    },
+
+    getSandbox: function () {
+        return _webviewObj.setFileSystemSandbox;
+    },
+
+    downloadURL: function (url) {
+        _webviewObj.downloadURL(url);
+    },
+
+    handleContextMenuResponse: function (action) {
+        _webviewObj.handleContextMenuResponse(action);
+    },
+
+    allowGeolocation : function (url) {
+        _webviewObj.allowGeolocation(url);
+    },
+
+    disallowGeolocation : function (url) {
+        _webviewObj.disallowGeolocation(url);
+
+    },
+
+    addKnownSSLCertificate: function (url, certificateInfo) {
+        _webviewObj.addKnownSSLCertificate(url, certificateInfo);
+    },
+
+    continueSSLHandshaking: function (streamId, SSLAction) {
+        _webviewObj.continueSSLHandshaking(streamId, SSLAction);
+    },
+
+    getSensitivity: function () {
+        return _webviewObj.getSensitivity();
+    },
+
+    setSensitivity: function (sensitivity) {
+        return _webviewObj.setSensitivity(sensitivity);
+    },
+
+    getBackgroundColor: function () {
+        return _webviewObj.getBackgroundColor();
+    },
+
+    setBackgroundColor: function (backgroundColor) {
+        return _webviewObj.setBackgroundColor(backgroundColor);
+    },
+
+    getWebViewObj: function (webview) {
+        return _webviewObj;
+    },
+
+    setUIWebViewObj: function (webviewObj) {
+        _webviewObj.uiWebView = webviewObj;
+    },
+
+    allowUserMedia: function (evtId, cameraName) {
+        _webviewObj.allowUserMedia(evtId, cameraName);
+    },
+
+    disallowUserMedia: function (evtId) {
+        _webviewObj.disallowUserMedia(evtId);
+    }
+};
+
+webview.__defineGetter__('id', function () {
+    if (_webviewObj) {
+        return _webviewObj.id;
+    }
+});
+
+webview.__defineGetter__('enableCrossSiteXHR', function () {
+    return _webviewObj.enableCrossSiteXHR;
+});
+
+webview.__defineSetter__('enableCrossSiteXHR', function (shouldEnable) {
+    _webviewObj.enableCrossSiteXHR = !!shouldEnable;
+});
+
+webview.__defineGetter__('processId', function () {
+    return _webviewObj.processId;
+});
+
+webview.__defineSetter__('onOpenWindow', function (input) {
+    _webviewObj.onOpenWindow = input;
+});
+
+webview.__defineSetter__('onCloseWindow', function (input) {
+    _webviewObj.onCloseWindow = input;
+});
+
+webview.__defineSetter__('onDestroyWindow', function (input) {
+    _webviewObj.onDestroyWindow = input;
+});
+
+webview.__defineSetter__('onDialogRequested', function (input) {
+    _webviewObj.onDialogRequested = input;
+});
+
+webview.__defineSetter__('onGeolocationPermissionRequest', function (input) {
+    _webviewObj.onGeolocationPermissionRequest = input;
+});
+
+webview.__defineSetter__('onSSLHandshakingFailed', function (input) {
+    _webviewObj.onSSLHandshakingFailed = input;
+});
+
+webview.__defineSetter__('onPropertyCurrentContextEvent', function (input) {
+    _webviewObj.onPropertyCurrentContextEvent = input;
+});
+
+webview.__defineSetter__('onContextMenuRequestEvent', function (input) {
+    _webviewObj.onContextMenuRequestEvent = input;
+});
+
+webview.__defineSetter__('onContextMenuCancelEvent', function (input) {
+    _webviewObj.onContextMenuCancelEvent = input;
+});
+
+webview.__defineSetter__('onUserMediaRequest', function (input) {
+    _webviewObj.onUserMediaRequest = input;
+});
+
+webview.__defineSetter__('onChildWindowOpen', function (input) {
+    _webviewObj.onChildWindowOpen = input;
+});
+
+module.exports = webview;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/config.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/config.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/config.js
new file mode 100644
index 0000000..64e8f7e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/config.js
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var srcPath = __dirname + '/../../../lib/';
+
+describe("Config", function () {
+    var config = require(srcPath + 'config.js');
+
+    it("verify user value is correctly mixed", function () {
+        expect(config.copyright).toEqual("@Rebecca");
+    });
+
+    it("verify default value is correctly mixed", function () {
+        expect(config.widgetExtensions).toEqual(null);
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/controllerWebView.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/controllerWebView.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/controllerWebView.js
new file mode 100644
index 0000000..003d276
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/controllerWebView.js
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2010-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.
+ */
+
+describe("controllerWebView", function () {
+    var controllerWebView = require('./../../../lib/controllerWebView'),
+        mockedController,
+        mockedInvocation,
+        mockedApplication;
+
+    beforeEach(function () {
+        mockedController = {
+            id: 42,
+            enableWebInspector: null,
+            enableCrossSiteXHR: null,
+            visible: null,
+            active: null,
+            setGeometry: jasmine.createSpy(),
+            setApplicationOrientation: jasmine.createSpy(),
+            notifyApplicationOrientationDone: jasmine.createSpy(),
+            publishRemoteFunction: jasmine.createSpy(),
+            dispatchEvent : jasmine.createSpy()
+        };
+        mockedInvocation = {
+            queryTargets: function (request, callback) {
+                callback("error", "results");
+            }
+        };
+        mockedApplication = {
+            invocation: mockedInvocation
+        };
+        GLOBAL.window = {
+            qnx: {
+                webplatform: {
+                    getController: function () {
+                        return mockedController;
+                    },
+                    getApplication: function () {
+                        return mockedApplication;
+                    }
+                }
+            }
+        };
+        GLOBAL.screen = {
+            width : 1024,
+            height: 768
+        };
+    });
+
+    describe("init", function () {
+        it("sets up the controllerWebview", function () {
+            controllerWebView.init({debugEnabled: true});
+            expect(mockedController.enableWebInspector).toEqual(true);
+            expect(mockedController.enableCrossSiteXHR).toEqual(true);
+            expect(mockedController.visible).toEqual(false);
+            expect(mockedController.active).toEqual(false);
+            expect(mockedController.setGeometry).toHaveBeenCalledWith(0, 0, screen.width, screen.height);
+        });
+
+        it("tests that the dispatch function is called properly", function () {
+            controllerWebView.init({debugEnabled: true});
+            controllerWebView.dispatchEvent('Awesome Event', ['these are agruments', 'another argument']);
+            expect(mockedController.dispatchEvent).toHaveBeenCalledWith('Awesome Event', ['these are agruments', 'another argument']);
+        });
+    });
+
+    describe("id", function () {
+        it("can get the id for the webiew", function () {
+            controllerWebView.init({debugEnabled: true});
+            expect(controllerWebView.id).toEqual(mockedController.id);
+        });
+    });
+
+    describe("geometry", function () {
+        it("can set geometry", function () {
+            controllerWebView.init({debugEnabled: true});
+            controllerWebView.setGeometry(0, 0, 100, 200);
+            expect(mockedController.setGeometry).toHaveBeenCalledWith(0, 0, 100, 200);
+        });
+    });
+
+    describe("application orientation", function () {
+        it("can set application orientation", function () {
+            controllerWebView.init({debugEnabled: true});
+            controllerWebView.setApplicationOrientation(90);
+            expect(mockedController.setApplicationOrientation).toHaveBeenCalledWith(90);
+        });
+
+        it("can notifyApplicationOrientationDone", function () {
+            controllerWebView.init({debugEnabled: true});
+            controllerWebView.notifyApplicationOrientationDone();
+            expect(mockedController.notifyApplicationOrientationDone).toHaveBeenCalled();
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/event.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/event.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/event.js
new file mode 100644
index 0000000..3d3e7fe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/event.js
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+var libRoot = __dirname + "/../../../lib/";
+
+describe("lib/event", function () {
+    var event = require(libRoot + "event"),
+        webview = require(libRoot + "webview"),
+        mockedWebview;
+
+    beforeEach(function () {
+        spyOn(webview, "executeJavascript");
+        mockedWebview = {
+            executeJavaScript: jasmine.createSpy(),
+            id: (new Date()).getTime()
+        };
+    });
+
+    describe("trigger", function () {
+
+
+        it("will trigger on the content webview when no webview is registered (for backwards compatability)", function () {
+            event.trigger("foo", {"id": 123});
+            expect(mockedWebview.executeJavaScript).not.toHaveBeenCalled();
+            expect(webview.executeJavascript).toHaveBeenCalled();
+        });
+
+        it("can invoke the webview execute javascript", function () {
+            var data = {"id": 123};
+            event.add({event: "foo", context: {addEventListener: jasmine.createSpy()}}, mockedWebview);
+            event.trigger("foo", data);
+            expect(mockedWebview.executeJavaScript).toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([data]))) + "')");
+            expect(webview.executeJavascript).not.toHaveBeenCalled();
+            this.after(function () {
+                event.remove({event: "foo", context: {removeEventListener: jasmine.createSpy()}}, mockedWebview);
+            });
+        });
+
+        it("sends multiple arguments passed in across as a JSONified array", function () {
+            var args = [{"id": 123, "foo": "hello world", list: [1, 2, 3]}, "Grrrrrrr", "Arrrrg"];
+            event.add({event: "foo", context: {addEventListener: jasmine.createSpy()}}, mockedWebview);
+            event.trigger.apply(null, ["foo"].concat(args));
+            expect(mockedWebview.executeJavaScript).toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify(args))) + "')");
+            expect(webview.executeJavascript).not.toHaveBeenCalled();
+            this.after(function () {
+                event.remove({event: "foo", context: {removeEventListener: jasmine.createSpy()}}, mockedWebview);
+            });
+        });
+
+        it("invokes on all webviews that have registered, but not those removed", function () {
+            var mockedWebview2 = {
+                    executeJavaScript: jasmine.createSpy(),
+                    id: mockedWebview.id - 42
+                },
+                mockedWebview3 = {
+                    executeJavaScript: jasmine.createSpy(),
+                    id: mockedWebview.id + 42
+                },
+                mockedWebview4 = {
+                    executeJavaScript: jasmine.createSpy(),
+                    id: mockedWebview.id * 42
+                };
+            event.add({event: "foo", context: {addEventListener: jasmine.createSpy()}}, mockedWebview);
+            event.add({event: "foo", context: {addEventListener: jasmine.createSpy()}}, mockedWebview2);
+            event.add({event: "foo", context: {addEventListener: jasmine.createSpy()}}, mockedWebview3);
+            event.trigger("foo", {"id": 123});
+            expect(mockedWebview.executeJavaScript).toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(mockedWebview2.executeJavaScript).toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(mockedWebview3.executeJavaScript).toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(mockedWebview4.executeJavaScript).not.toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(webview.executeJavascript).not.toHaveBeenCalled();
+
+
+            event.remove({event: "foo", context: {removeEventListener: jasmine.createSpy()}}, mockedWebview3);
+            mockedWebview.executeJavaScript.reset();
+            mockedWebview2.executeJavaScript.reset();
+            mockedWebview3.executeJavaScript.reset();
+            mockedWebview4.executeJavaScript.reset();
+            event.trigger("foo", {"id": 123});
+            expect(mockedWebview.executeJavaScript).toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(mockedWebview2.executeJavaScript).toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(mockedWebview3.executeJavaScript).not.toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(mockedWebview4.executeJavaScript).not.toHaveBeenCalledWith("webworks.event.trigger('foo', '" + escape(encodeURIComponent(JSON.stringify([{"id": 123}]))) + "')");
+            expect(webview.executeJavascript).not.toHaveBeenCalled();
+            this.after(function () {
+                event.remove({event: "foo", context: {removeEventListener: jasmine.createSpy()}}, mockedWebview);
+                event.remove({event: "foo", context: {removeEventListener: jasmine.createSpy()}}, mockedWebview2);
+            });
+        });
+
+    });
+
+    describe("add/remove would invoke action context", function () {
+        var action = {
+                context: {
+                    addEventListener: jasmine.createSpy(),
+                    removeEventListener: jasmine.createSpy()
+                },
+                event: "HELLO",
+                trigger: function () {}
+            };
+
+        beforeEach(function () {
+            action.context.addEventListener.reset();
+            action.context.removeEventListener.reset();
+        });
+
+        it("can invoke action context add listener", function () {
+            event.add(action, mockedWebview);
+            expect(action.context.addEventListener).toHaveBeenCalledWith(action.event, action.trigger);
+        });
+
+        it("will not invoke action context add listener when the action has a once field", function () {
+            action.once = true;
+            event.add(action, mockedWebview);
+            expect(action.context.addEventListener).not.toHaveBeenCalledWith(action.event, action.trigger);
+            this.after(function () {
+                delete action.once;
+            });
+        });
+
+        it("can invoke action context remove listener", function () {
+            event.remove(action, mockedWebview);
+            expect(action.context.removeEventListener).toHaveBeenCalledWith(action.event, action.trigger);
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/applicationEvents.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/applicationEvents.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/applicationEvents.js
new file mode 100644
index 0000000..81fa2e1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/applicationEvents.js
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var _libDir = __dirname + "./../../../../lib/",
+    appEventPrefix = "application.",
+    appEvents,
+    mockedApplication;
+
+describe("lib/events/applicationEvents", function () {
+    beforeEach(function () {
+        mockedApplication = {
+            addEventListener: jasmine.createSpy("application addEventListener"),
+            removeEventListener: jasmine.createSpy("application removeEventListener")
+        };
+        GLOBAL.window = {
+            qnx: {
+                webplatform: {
+                    getApplication: function () {
+                        return mockedApplication;
+                    }
+                }
+            }
+        };
+        appEvents = require(_libDir + "events/applicationEvents");
+    });
+
+    afterEach(function () {
+        mockedApplication = null;
+        delete GLOBAL.window;
+        appEvents = null;
+        delete require.cache[require.resolve(_libDir + "events/applicationEvents")];
+    });
+
+    describe("addEventListener", function () {
+        it("adds event name with application prepended", function () {
+            var eventName = "MostAwesomeEventEver",
+                trigger = function () {};
+            appEvents.addEventListener(eventName, trigger);
+            expect(mockedApplication.addEventListener).toHaveBeenCalledWith(appEventPrefix + eventName, trigger);
+        });
+
+        it("warns in the console if the eventName is falsey", function () {
+            var eventName = false,
+                trigger = function () {};
+            spyOn(console, "warn");
+            appEvents.addEventListener(eventName, trigger);
+            expect(mockedApplication.addEventListener).not.toHaveBeenCalledWith(appEventPrefix + eventName, trigger);
+            expect(console.warn).toHaveBeenCalledWith(jasmine.any(String));
+        });
+    });
+
+    describe("removeEventListener", function () {
+        it("adds event name with application prepended", function () {
+            var eventName = "MostAwesomeEventEver",
+                trigger = function () {};
+            appEvents.removeEventListener(eventName, trigger);
+            expect(mockedApplication.removeEventListener).toHaveBeenCalledWith(appEventPrefix + eventName, trigger);
+        });
+
+        it("warns in the console if the eventName is falsey", function () {
+            var eventName = false,
+                trigger = function () {};
+            spyOn(console, "warn");
+            appEvents.removeEventListener(eventName, trigger);
+            expect(mockedApplication.removeEventListener).not.toHaveBeenCalledWith(appEventPrefix + eventName, trigger);
+            expect(console.warn).toHaveBeenCalledWith(jasmine.any(String));
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/deviceEvents.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/deviceEvents.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/deviceEvents.js
new file mode 100644
index 0000000..2e55455
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/events/deviceEvents.js
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var _libDir = __dirname + "./../../../../lib/",
+    deviceEventPrefix = "device.",
+    deviceEvents;
+
+describe("lib/events/deviceEvents", function () {
+    beforeEach(function () {
+        GLOBAL.window = {
+            qnx: {
+                webplatform: {
+                    device: {
+                        addEventListener: jasmine.createSpy(),
+                        removeEventListener: jasmine.createSpy()
+                    }
+                }
+            }
+        };
+        deviceEvents = require(_libDir + "events/deviceEvents");
+    });
+
+    afterEach(function () {
+        delete GLOBAL.window;
+        deviceEvents = null;
+        delete require.cache[require.resolve(_libDir + "events/deviceEvents")];
+    });
+
+    describe("addEventListener", function () {
+        it("adds event name with application prepended", function () {
+            var eventName = "MostAwesomeEventEver",
+                trigger = function () {};
+            deviceEvents.addEventListener(eventName, trigger);
+            expect(window.qnx.webplatform.device.addEventListener).toHaveBeenCalledWith(deviceEventPrefix + eventName, trigger);
+        });
+
+        it("warns in the console if the eventName is falsey", function () {
+            var eventName = false,
+                trigger = function () {};
+            spyOn(console, "warn");
+            deviceEvents.addEventListener(eventName, trigger);
+            expect(window.qnx.webplatform.device.addEventListener).not.toHaveBeenCalledWith(deviceEventPrefix + eventName, trigger);
+            expect(console.warn).toHaveBeenCalledWith(jasmine.any(String));
+        });
+    });
+
+    describe("removeEventListener", function () {
+        it("adds event name with application prepended", function () {
+            var eventName = "MostAwesomeEventEver",
+                trigger = function () {};
+            deviceEvents.removeEventListener(eventName, trigger);
+            expect(window.qnx.webplatform.device.removeEventListener).toHaveBeenCalledWith(deviceEventPrefix + eventName, trigger);
+        });
+
+        it("warns in the console if the eventName is falsey", function () {
+            var eventName = false,
+                trigger = function () {};
+            spyOn(console, "warn");
+            deviceEvents.removeEventListener(eventName, trigger);
+            expect(window.qnx.webplatform.device.removeEventListener).not.toHaveBeenCalledWith(deviceEventPrefix + eventName, trigger);
+            expect(console.warn).toHaveBeenCalledWith(jasmine.any(String));
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/framework.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/framework.js b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/framework.js
new file mode 100644
index 0000000..312dd8b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/test/unit/lib/framework.js
@@ -0,0 +1,429 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var srcPath = __dirname + '/../../../lib/',
+    config = require(srcPath + "config"),
+    framework,
+    webview,
+    overlayWebView,
+    overlayWebViewObj,
+    controllerWebView,
+    Whitelist = require(srcPath + 'policy/whitelist').Whitelist,
+    mockedController,
+    mockedApplicationWindow,
+    mockedApplication,
+    mockedDevice,
+    mockedQnx,
+    mock_request = {
+        url: "http://www.dummy.com",
+        allow: jasmine.createSpy(),
+        deny: jasmine.createSpy()
+    };
+
+describe("framework", function () {
+    beforeEach(function () {
+        mockedController = {
+            id: 42,
+            enableCrossSiteXHR: undefined,
+            visible: undefined,
+            active: undefined,
+            zOrder: undefined,
+            url: undefined,
+            setGeometry: jasmine.createSpy(),
+            onNetworkResourceRequested: undefined,
+            destroy: jasmine.createSpy(),
+            executeJavaScript: jasmine.createSpy(),
+            windowGroup: undefined,
+            addEventListener: jasmine.createSpy(),
+            uiWebView: undefined,
+            onChildWindowOpen: undefined
+        };
+        mockedApplicationWindow = {
+            visible: undefined
+        };
+        mockedApplication = {
+            addEventListener: jasmine.createSpy(),
+            webInspectorPort : "1337",
+            invocation: {
+                invoke: jasmine.createSpy()
+            }
+        };
+        mockedDevice = {
+            getNetworkInterfaces : jasmine.createSpy()
+        };
+        mockedQnx = {
+            callExtensionMethod : function () {
+                return 42;
+            },
+            webplatform : {
+                getController : function () {
+                    return mockedController;
+                },
+                getApplication : function () {
+                    return mockedApplication;
+                },
+                getApplicationWindow : function () {
+                    return mockedApplicationWindow;
+                },
+                device : mockedDevice,
+                nativeCall: jasmine.createSpy("qnx.webplatform.nativeCall")
+            }
+        };
+        GLOBAL.window = {
+            qnx: mockedQnx
+        };
+        GLOBAL.qnx = mockedQnx;
+        GLOBAL.NamedNodeMap = function () {};
+
+        delete require.cache[require.resolve(srcPath + "webview")];
+        webview = require(srcPath + "webview");
+        delete require.cache[require.resolve(srcPath + "overlayWebView")];
+        overlayWebView = require(srcPath + "overlayWebView");
+        delete require.cache[require.resolve(srcPath + "controllerWebView")];
+        controllerWebView = require(srcPath + "controllerWebView");
+
+        spyOn(webview, "create").andCallFake(function (done) {
+            done();
+        });
+
+        spyOn(overlayWebView, "getWebViewObj").andCallFake(function () {
+            overlayWebViewObj = {
+                formcontrol: {
+                    subscribeTo: jasmine.createSpy()
+                }
+            };
+            return overlayWebViewObj;
+        });
+
+        spyOn(overlayWebView, "create").andCallFake(function (done) {
+            done();
+        });
+
+        spyOn(controllerWebView, "init");
+        spyOn(controllerWebView, "dispatchEvent");
+        spyOn(webview, "destroy");
+        spyOn(webview, "executeJavascript");
+        spyOn(webview, "setURL");
+        spyOn(webview, "setUIWebViewObj");
+        spyOn(webview, "addEventListener").andCallFake(function (eventName, callback) {
+            callback();
+        });
+        spyOn(webview, "removeEventListener");
+
+        spyOn(overlayWebView, "setURL");
+        spyOn(overlayWebView, "renderContextMenuFor");
+        spyOn(overlayWebView, "handleDialogFor");
+        spyOn(overlayWebView, "addEventListener").andCallFake(function (eventName, callback) {
+            callback();
+        });
+        spyOn(overlayWebView, "removeEventListener");
+        spyOn(overlayWebView, "bindAppWebViewToChildWebViewControls");
+
+        delete require.cache[require.resolve(srcPath + "framework")];
+        framework = require(srcPath + 'framework');
+    });
+
+    afterEach(function () {
+        delete GLOBAL.blackberry;
+        delete GLOBAL.window;
+        delete GLOBAL.qnx;
+        delete GLOBAL.NamedNodeMap;
+    });
+
+    it("can start a webview instance", function () {
+        framework.start();
+        expect(controllerWebView.init).toHaveBeenCalled();
+        expect(webview.create).toHaveBeenCalled();
+    });
+
+    it("on start passing callback and setting object parameters to create method of webview", function () {
+        framework.start();
+        expect(webview.create).toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Object));
+    });
+
+    it("setting object should have debugEnabled to be defined", function () {
+        framework.start();
+        expect((webview.create.mostRecentCall.args)[1].debugEnabled).toBeDefined();
+    });
+
+    it("can start a webview instance with a url", function () {
+        var url = "http://www.google.com";
+        framework.start(url);
+        expect(webview.setURL).toHaveBeenCalledWith(url);
+    });
+
+    it("can stop a webview instance", function () {
+        framework.start();
+        framework.stop();
+        expect(webview.destroy).toHaveBeenCalled();
+    });
+
+    describe('creating the overlay webview', function () {
+        beforeEach(function () {
+            framework.start();
+        });
+        it('calls overlayWebView.create', function () {
+            expect(overlayWebView.create).toHaveBeenCalled();
+        });
+
+        it('sets the overlayWebView URL', function () {
+            expect(overlayWebView.setURL).toHaveBeenCalledWith("local:///chrome/ui.html");
+        });
+
+        it('calls renderContextMenuFor passing the webview', function () {
+            expect(overlayWebView.renderContextMenuFor).toHaveBeenCalledWith(webview);
+        });
+
+        it('calls handleDialogFor passing the webview', function () {
+            expect(overlayWebView.handleDialogFor).toHaveBeenCalledWith(webview);
+        });
+
+        it('dispatches the ui.init event on the controllerWebView', function () {
+            expect(controllerWebView.dispatchEvent).toHaveBeenCalledWith('ui.init', null);
+        });
+    });
+
+    describe('configuring webSecurity', function () {
+        var enableCrossSiteXHRSetter;
+
+        beforeEach(function () {
+            enableCrossSiteXHRSetter = jasmine.createSpy();
+            Object.defineProperty(webview, "enableCrossSiteXHR", {set: enableCrossSiteXHRSetter, configurable: true});
+        });
+
+        afterEach(function () {
+            delete webview.enableCrossSiteXHR;
+            delete require.cache[require.resolve(srcPath + "webview")];
+            webview = require(srcPath + "webview");
+        });
+
+        it('does not call enableCrossSiteXHR by default', function () {
+            expect(config.enableWebSecurity).toBe(true);
+            framework.start();
+
+            expect(enableCrossSiteXHRSetter).not.toHaveBeenCalledWith(true);
+        });
+
+        it('does enable crossSiteXHR when the config says too', function () {
+            delete require.cache[require.resolve(srcPath + "config")];
+            config = require(srcPath + 'config');
+            config.enableWebSecurity = false;
+
+            //reload config in framework
+            delete require.cache[require.resolve(srcPath + "framework")];
+            framework = require(srcPath + 'framework');
+
+            this.after(function () {
+                delete require.cache[require.resolve(srcPath + "config")];
+                config = require(srcPath + 'config');
+
+                delete require.cache[require.resolve(srcPath + "framework")];
+                framework = require(srcPath + 'framework');
+            });
+
+            expect(config.enableWebSecurity).toBe(false);
+            framework.start();
+
+            expect(enableCrossSiteXHRSetter).toHaveBeenCalledWith(true);
+        });
+    });
+
+    describe('configuring OpenChildWindow events', function () {
+        var onChildWindowOpenHandler;
+
+        beforeEach(function () {
+            Object.defineProperty(webview, "onChildWindowOpen", {set: function (input) {
+                onChildWindowOpenHandler = input;
+            }, configurable: true});
+        });
+
+        afterEach(function () {
+            delete webview.onChildWindowOpen;
+            delete require.cache[require.resolve(srcPath + "webview")];
+            webview = require(srcPath + "webview");
+        });
+
+        it('delegates to childWebViewControls on the overlay webview', function () {
+            config.enableChildWebView = true;
+
+            //reload config in framework
+            delete require.cache[require.resolve(srcPath + "framework")];
+            framework = require(srcPath + 'framework');
+
+            this.after(function () {
+                delete require.cache[require.resolve(srcPath + "config")];
+                config = require(srcPath + 'config');
+            });
+
+            framework.start();
+            expect(overlayWebView.bindAppWebViewToChildWebViewControls).toHaveBeenCalledWith(webview);
+            expect(webview.onChildWindowOpen).not.toBeDefined();
+        });
+
+        it('binds to OpenChildWindow and invokes the browser', function () {
+            config.enableChildWebView = false;
+
+            //reload config in framework
+            delete require.cache[require.resolve(srcPath + "framework")];
+            framework = require(srcPath + 'framework');
+
+            this.after(function () {
+                delete require.cache[require.resolve(srcPath + "config")];
+                config = require(srcPath + 'config');
+            });
+
+            framework.start();
+            expect(overlayWebView.bindAppWebViewToChildWebViewControls).not.toHaveBeenCalledWith(webview);
+            expect(onChildWindowOpenHandler).toEqual(jasmine.any(Function));
+            onChildWindowOpenHandler(JSON.stringify({url: 'http://www.google.com'}));
+            expect(mockedApplication.invocation.invoke).toHaveBeenCalledWith(
+                {uri: 'http://www.google.com', target: "sys.browser" }
+            );
+        });
+    });
+
+    describe('shows the webinspector dialog', function () {
+        it('show the webinspector dialog', function () {
+            var flag = false;
+            spyOn(overlayWebView, "showDialog");
+
+            window.qnx.webplatform.device.getNetworkInterfaces = function (callback) {
+                callback();
+                flag = true;
+            };
+            config.debugEnabled = true;
+            framework.start();
+            waitsFor(function () {
+                return flag;
+            });
+            runs(function () {
+                expect(overlayWebView.showDialog).toHaveBeenCalled();
+            });
+        });
+
+        it('show the webinspector dialog with the correct IP address', function () {
+            var flag = false,
+            messageObj;
+            spyOn(overlayWebView, "showDialog");
+
+            window.qnx.webplatform.device.getNetworkInterfaces = function (callback) {
+                var dummyData = {
+                    asix0i : null,
+                    bb0 : null,
+                    bptp0 : null,
+                    cellular0 : null,
+                    cellular1 : null,
+                    cellular2 : null,
+                    cellular3 : null,
+                    cellular4 : null,
+                    ecm0 : {
+                        connected : true,
+                        ipv4Address : "169.254.0.1",
+                        ipv6Address : "fe80::70aa:b2ff:fef9:b374",
+                        type : "usb"
+                    },
+                    ipsec0 : null,
+                    ipsec1 : null,
+                    lo0 : null,
+                    lo2 : null,
+                    nap0 : null,
+                    pan0 : null,
+                    pflog0 : null,
+                    ppp0 : null,
+                    rndis0 : null,
+                    smsc0 : null,
+                    tiw_drv0 : null,
+                    tiw_ibss0 : null,
+                    tiw_p2pdev0 : null,
+                    tiw_p2pgrp0 : null,
+                    tiw_sta0 : {
+                        connected : true,
+                        ipv4Address : "192.168.2.2",
+                        ipv6Address : "fe80::72aa:b2ff:fef9:b374",
+                        type : "wifi"
+                    },
+                    vlan0 : null,
+                    vpn0 : null
+                };
+                callback(dummyData);
+                flag = true;
+            };
+            config.debugEnabled = true;
+            framework.start();
+            waitsFor(function () {
+                return flag;
+            });
+            runs(function () {
+                messageObj = {
+                    title : "Web Inspector Enabled",
+                    htmlmessage : "\n ip4:    169.254.0.1:1337<br/> ip6:    fe80::70aa:b2ff:fef9:b374:1337",
+                    dialogType : "JavaScriptAlert"
+                };
+                expect(overlayWebView.showDialog).toHaveBeenCalledWith(messageObj);
+            });
+        });
+
+    });
+
+    describe('enabling form control', function () {
+        var originalConfigVal;
+
+        beforeEach(function () {
+            originalConfigVal = config.enableFormControl;
+        });
+
+        afterEach(function () {
+            config.enableFormControl = originalConfigVal;
+        });
+
+        it('subscribes webview to formcontrol', function () {
+            config.enableFormControl = true;
+            framework.start();
+            expect(overlayWebViewObj.formcontrol.subscribeTo).toHaveBeenCalledWith(webview);
+        });
+
+        it('does not subscribe webview to formcontrol is enableFormControl is false', function () {
+            config.enableFormControl = false;
+            framework.start();
+            expect(overlayWebViewObj.formcontrol.subscribeTo).not.toHaveBeenCalled();
+        });
+    });
+
+    describe('enabling popup blocker', function () {
+        var originalConfigVal;
+
+        beforeEach(function () {
+            originalConfigVal = config.enablePopupBlocker;
+        });
+
+        afterEach(function () {
+            config.enablePopupBlocker = originalConfigVal;
+        });
+
+        it('does nothing when enablePopupBlocker is true', function () {
+            config.enablePopupBlocker = true;
+            framework.start();
+            expect(mockedQnx.webplatform.nativeCall).not.toHaveBeenCalledWith('webview.setBlockPopups', webview.id, false);
+        });
+
+        it('Disables popupblocker when enablePopupBlocker is false', function () {
+            config.enablePopupBlocker = false;
+            framework.start();
+            expect(mockedQnx.webplatform.nativeCall).toHaveBeenCalledWith('webview.setBlockPopups', webview.id, false);
+        });
+    });
+
+});


[46/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js b/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
deleted file mode 100644
index 03bf89a..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
+++ /dev/null
@@ -1,2529 +0,0 @@
-var isCommonJS = typeof window == "undefined";
-
-/**
- * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
- *
- * @namespace
- */
-var jasmine = {};
-if (isCommonJS) exports.jasmine = jasmine;
-/**
- * @private
- */
-jasmine.unimplementedMethod_ = function() {
-  throw new Error("unimplemented method");
-};
-
-/**
- * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
- * a plain old variable and may be redefined by somebody else.
- *
- * @private
- */
-jasmine.undefined = jasmine.___undefined___;
-
-/**
- * Show diagnostic messages in the console if set to true
- *
- */
-jasmine.VERBOSE = false;
-
-/**
- * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
- *
- */
-jasmine.DEFAULT_UPDATE_INTERVAL = 250;
-
-/**
- * Default timeout interval in milliseconds for waitsFor() blocks.
- */
-jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
-
-jasmine.getGlobal = function() {
-  function getGlobal() {
-    return this;
-  }
-
-  return getGlobal();
-};
-
-/**
- * Allows for bound functions to be compared.  Internal use only.
- *
- * @ignore
- * @private
- * @param base {Object} bound 'this' for the function
- * @param name {Function} function to find
- */
-jasmine.bindOriginal_ = function(base, name) {
-  var original = base[name];
-  if (original.apply) {
-    return function() {
-      return original.apply(base, arguments);
-    };
-  } else {
-    // IE support
-    return jasmine.getGlobal()[name];
-  }
-};
-
-jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
-jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
-jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
-jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
-
-jasmine.MessageResult = function(values) {
-  this.type = 'log';
-  this.values = values;
-  this.trace = new Error(); // todo: test better
-};
-
-jasmine.MessageResult.prototype.toString = function() {
-  var text = "";
-  for (var i = 0; i < this.values.length; i++) {
-    if (i > 0) text += " ";
-    if (jasmine.isString_(this.values[i])) {
-      text += this.values[i];
-    } else {
-      text += jasmine.pp(this.values[i]);
-    }
-  }
-  return text;
-};
-
-jasmine.ExpectationResult = function(params) {
-  this.type = 'expect';
-  this.matcherName = params.matcherName;
-  this.passed_ = params.passed;
-  this.expected = params.expected;
-  this.actual = params.actual;
-  this.message = this.passed_ ? 'Passed.' : params.message;
-
-  var trace = (params.trace || new Error(this.message));
-  this.trace = this.passed_ ? '' : trace;
-};
-
-jasmine.ExpectationResult.prototype.toString = function () {
-  return this.message;
-};
-
-jasmine.ExpectationResult.prototype.passed = function () {
-  return this.passed_;
-};
-
-/**
- * Getter for the Jasmine environment. Ensures one gets created
- */
-jasmine.getEnv = function() {
-  var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
-  return env;
-};
-
-/**
- * @ignore
- * @private
- * @param value
- * @returns {Boolean}
- */
-jasmine.isArray_ = function(value) {
-  return jasmine.isA_("Array", value);
-};
-
-/**
- * @ignore
- * @private
- * @param value
- * @returns {Boolean}
- */
-jasmine.isString_ = function(value) {
-  return jasmine.isA_("String", value);
-};
-
-/**
- * @ignore
- * @private
- * @param value
- * @returns {Boolean}
- */
-jasmine.isNumber_ = function(value) {
-  return jasmine.isA_("Number", value);
-};
-
-/**
- * @ignore
- * @private
- * @param {String} typeName
- * @param value
- * @returns {Boolean}
- */
-jasmine.isA_ = function(typeName, value) {
-  return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
-};
-
-/**
- * Pretty printer for expecations.  Takes any object and turns it into a human-readable string.
- *
- * @param value {Object} an object to be outputted
- * @returns {String}
- */
-jasmine.pp = function(value) {
-  var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
-  stringPrettyPrinter.format(value);
-  return stringPrettyPrinter.string;
-};
-
-/**
- * Returns true if the object is a DOM Node.
- *
- * @param {Object} obj object to check
- * @returns {Boolean}
- */
-jasmine.isDomNode = function(obj) {
-  return obj.nodeType > 0;
-};
-
-/**
- * Returns a matchable 'generic' object of the class type.  For use in expecations of type when values don't matter.
- *
- * @example
- * // don't care about which function is passed in, as long as it's a function
- * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
- *
- * @param {Class} clazz
- * @returns matchable object of the type clazz
- */
-jasmine.any = function(clazz) {
-  return new jasmine.Matchers.Any(clazz);
-};
-
-/**
- * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the
- * attributes on the object.
- *
- * @example
- * // don't care about any other attributes than foo.
- * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"});
- *
- * @param sample {Object} sample
- * @returns matchable object for the sample
- */
-jasmine.objectContaining = function (sample) {
-    return new jasmine.Matchers.ObjectContaining(sample);
-};
-
-/**
- * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
- *
- * Spies should be created in test setup, before expectations.  They can then be checked, using the standard Jasmine
- * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
- *
- * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
- *
- * Spies are torn down at the end of every spec.
- *
- * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
- *
- * @example
- * // a stub
- * var myStub = jasmine.createSpy('myStub');  // can be used anywhere
- *
- * // spy example
- * var foo = {
- *   not: function(bool) { return !bool; }
- * }
- *
- * // actual foo.not will not be called, execution stops
- * spyOn(foo, 'not');
-
- // foo.not spied upon, execution will continue to implementation
- * spyOn(foo, 'not').andCallThrough();
- *
- * // fake example
- * var foo = {
- *   not: function(bool) { return !bool; }
- * }
- *
- * // foo.not(val) will return val
- * spyOn(foo, 'not').andCallFake(function(value) {return value;});
- *
- * // mock example
- * foo.not(7 == 7);
- * expect(foo.not).toHaveBeenCalled();
- * expect(foo.not).toHaveBeenCalledWith(true);
- *
- * @constructor
- * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
- * @param {String} name
- */
-jasmine.Spy = function(name) {
-  /**
-   * The name of the spy, if provided.
-   */
-  this.identity = name || 'unknown';
-  /**
-   *  Is this Object a spy?
-   */
-  this.isSpy = true;
-  /**
-   * The actual function this spy stubs.
-   */
-  this.plan = function() {
-  };
-  /**
-   * Tracking of the most recent call to the spy.
-   * @example
-   * var mySpy = jasmine.createSpy('foo');
-   * mySpy(1, 2);
-   * mySpy.mostRecentCall.args = [1, 2];
-   */
-  this.mostRecentCall = {};
-
-  /**
-   * Holds arguments for each call to the spy, indexed by call count
-   * @example
-   * var mySpy = jasmine.createSpy('foo');
-   * mySpy(1, 2);
-   * mySpy(7, 8);
-   * mySpy.mostRecentCall.args = [7, 8];
-   * mySpy.argsForCall[0] = [1, 2];
-   * mySpy.argsForCall[1] = [7, 8];
-   */
-  this.argsForCall = [];
-  this.calls = [];
-};
-
-/**
- * Tells a spy to call through to the actual implemenatation.
- *
- * @example
- * var foo = {
- *   bar: function() { // do some stuff }
- * }
- *
- * // defining a spy on an existing property: foo.bar
- * spyOn(foo, 'bar').andCallThrough();
- */
-jasmine.Spy.prototype.andCallThrough = function() {
-  this.plan = this.originalValue;
-  return this;
-};
-
-/**
- * For setting the return value of a spy.
- *
- * @example
- * // defining a spy from scratch: foo() returns 'baz'
- * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
- *
- * // defining a spy on an existing property: foo.bar() returns 'baz'
- * spyOn(foo, 'bar').andReturn('baz');
- *
- * @param {Object} value
- */
-jasmine.Spy.prototype.andReturn = function(value) {
-  this.plan = function() {
-    return value;
-  };
-  return this;
-};
-
-/**
- * For throwing an exception when a spy is called.
- *
- * @example
- * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
- * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
- *
- * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
- * spyOn(foo, 'bar').andThrow('baz');
- *
- * @param {String} exceptionMsg
- */
-jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
-  this.plan = function() {
-    throw exceptionMsg;
-  };
-  return this;
-};
-
-/**
- * Calls an alternate implementation when a spy is called.
- *
- * @example
- * var baz = function() {
- *   // do some stuff, return something
- * }
- * // defining a spy from scratch: foo() calls the function baz
- * var foo = jasmine.createSpy('spy on foo').andCall(baz);
- *
- * // defining a spy on an existing property: foo.bar() calls an anonymnous function
- * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
- *
- * @param {Function} fakeFunc
- */
-jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
-  this.plan = fakeFunc;
-  return this;
-};
-
-/**
- * Resets all of a spy's the tracking variables so that it can be used again.
- *
- * @example
- * spyOn(foo, 'bar');
- *
- * foo.bar();
- *
- * expect(foo.bar.callCount).toEqual(1);
- *
- * foo.bar.reset();
- *
- * expect(foo.bar.callCount).toEqual(0);
- */
-jasmine.Spy.prototype.reset = function() {
-  this.wasCalled = false;
-  this.callCount = 0;
-  this.argsForCall = [];
-  this.calls = [];
-  this.mostRecentCall = {};
-};
-
-jasmine.createSpy = function(name) {
-
-  var spyObj = function() {
-    spyObj.wasCalled = true;
-    spyObj.callCount++;
-    var args = jasmine.util.argsToArray(arguments);
-    spyObj.mostRecentCall.object = this;
-    spyObj.mostRecentCall.args = args;
-    spyObj.argsForCall.push(args);
-    spyObj.calls.push({object: this, args: args});
-    return spyObj.plan.apply(this, arguments);
-  };
-
-  var spy = new jasmine.Spy(name);
-
-  for (var prop in spy) {
-    spyObj[prop] = spy[prop];
-  }
-
-  spyObj.reset();
-
-  return spyObj;
-};
-
-/**
- * Determines whether an object is a spy.
- *
- * @param {jasmine.Spy|Object} putativeSpy
- * @returns {Boolean}
- */
-jasmine.isSpy = function(putativeSpy) {
-  return putativeSpy && putativeSpy.isSpy;
-};
-
-/**
- * Creates a more complicated spy: an Object that has every property a function that is a spy.  Used for stubbing something
- * large in one call.
- *
- * @param {String} baseName name of spy class
- * @param {Array} methodNames array of names of methods to make spies
- */
-jasmine.createSpyObj = function(baseName, methodNames) {
-  if (!jasmine.isArray_(methodNames) || methodNames.length === 0) {
-    throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
-  }
-  var obj = {};
-  for (var i = 0; i < methodNames.length; i++) {
-    obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
-  }
-  return obj;
-};
-
-/**
- * All parameters are pretty-printed and concatenated together, then written to the current spec's output.
- *
- * Be careful not to leave calls to <code>jasmine.log</code> in production code.
- */
-jasmine.log = function() {
-  var spec = jasmine.getEnv().currentSpec;
-  spec.log.apply(spec, arguments);
-};
-
-/**
- * Function that installs a spy on an existing object's method name.  Used within a Spec to create a spy.
- *
- * @example
- * // spy example
- * var foo = {
- *   not: function(bool) { return !bool; }
- * }
- * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
- *
- * @see jasmine.createSpy
- * @param obj
- * @param methodName
- * @returns a Jasmine spy that can be chained with all spy methods
- */
-var spyOn = function(obj, methodName) {
-  return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
-};
-if (isCommonJS) exports.spyOn = spyOn;
-
-/**
- * Creates a Jasmine spec that will be added to the current suite.
- *
- * // TODO: pending tests
- *
- * @example
- * it('should be true', function() {
- *   expect(true).toEqual(true);
- * });
- *
- * @param {String} desc description of this specification
- * @param {Function} func defines the preconditions and expectations of the spec
- */
-var it = function(desc, func) {
-  return jasmine.getEnv().it(desc, func);
-};
-if (isCommonJS) exports.it = it;
-
-/**
- * Creates a <em>disabled</em> Jasmine spec.
- *
- * A convenience method that allows existing specs to be disabled temporarily during development.
- *
- * @param {String} desc description of this specification
- * @param {Function} func defines the preconditions and expectations of the spec
- */
-var xit = function(desc, func) {
-  return jasmine.getEnv().xit(desc, func);
-};
-if (isCommonJS) exports.xit = xit;
-
-/**
- * Starts a chain for a Jasmine expectation.
- *
- * It is passed an Object that is the actual value and should chain to one of the many
- * jasmine.Matchers functions.
- *
- * @param {Object} actual Actual value to test against and expected value
- */
-var expect = function(actual) {
-  return jasmine.getEnv().currentSpec.expect(actual);
-};
-if (isCommonJS) exports.expect = expect;
-
-/**
- * Defines part of a jasmine spec.  Used in cominbination with waits or waitsFor in asynchrnous specs.
- *
- * @param {Function} func Function that defines part of a jasmine spec.
- */
-var runs = function(func) {
-  jasmine.getEnv().currentSpec.runs(func);
-};
-if (isCommonJS) exports.runs = runs;
-
-/**
- * Waits a fixed time period before moving to the next block.
- *
- * @deprecated Use waitsFor() instead
- * @param {Number} timeout milliseconds to wait
- */
-var waits = function(timeout) {
-  jasmine.getEnv().currentSpec.waits(timeout);
-};
-if (isCommonJS) exports.waits = waits;
-
-/**
- * Waits for the latchFunction to return true before proceeding to the next block.
- *
- * @param {Function} latchFunction
- * @param {String} optional_timeoutMessage
- * @param {Number} optional_timeout
- */
-var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
-  jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
-};
-if (isCommonJS) exports.waitsFor = waitsFor;
-
-/**
- * A function that is called before each spec in a suite.
- *
- * Used for spec setup, including validating assumptions.
- *
- * @param {Function} beforeEachFunction
- */
-var beforeEach = function(beforeEachFunction) {
-  jasmine.getEnv().beforeEach(beforeEachFunction);
-};
-if (isCommonJS) exports.beforeEach = beforeEach;
-
-/**
- * A function that is called after each spec in a suite.
- *
- * Used for restoring any state that is hijacked during spec execution.
- *
- * @param {Function} afterEachFunction
- */
-var afterEach = function(afterEachFunction) {
-  jasmine.getEnv().afterEach(afterEachFunction);
-};
-if (isCommonJS) exports.afterEach = afterEach;
-
-/**
- * Defines a suite of specifications.
- *
- * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
- * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
- * of setup in some tests.
- *
- * @example
- * // TODO: a simple suite
- *
- * // TODO: a simple suite with a nested describe block
- *
- * @param {String} description A string, usually the class under test.
- * @param {Function} specDefinitions function that defines several specs.
- */
-var describe = function(description, specDefinitions) {
-  return jasmine.getEnv().describe(description, specDefinitions);
-};
-if (isCommonJS) exports.describe = describe;
-
-/**
- * Disables a suite of specifications.  Used to disable some suites in a file, or files, temporarily during development.
- *
- * @param {String} description A string, usually the class under test.
- * @param {Function} specDefinitions function that defines several specs.
- */
-var xdescribe = function(description, specDefinitions) {
-  return jasmine.getEnv().xdescribe(description, specDefinitions);
-};
-if (isCommonJS) exports.xdescribe = xdescribe;
-
-
-// Provide the XMLHttpRequest class for IE 5.x-6.x:
-jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
-  function tryIt(f) {
-    try {
-      return f();
-    } catch(e) {
-    }
-    return null;
-  }
-
-  var xhr = tryIt(function() {
-    return new ActiveXObject("Msxml2.XMLHTTP.6.0");
-  }) ||
-    tryIt(function() {
-      return new ActiveXObject("Msxml2.XMLHTTP.3.0");
-    }) ||
-    tryIt(function() {
-      return new ActiveXObject("Msxml2.XMLHTTP");
-    }) ||
-    tryIt(function() {
-      return new ActiveXObject("Microsoft.XMLHTTP");
-    });
-
-  if (!xhr) throw new Error("This browser does not support XMLHttpRequest.");
-
-  return xhr;
-} : XMLHttpRequest;
-/**
- * @namespace
- */
-jasmine.util = {};
-
-/**
- * Declare that a child class inherit it's prototype from the parent class.
- *
- * @private
- * @param {Function} childClass
- * @param {Function} parentClass
- */
-jasmine.util.inherit = function(childClass, parentClass) {
-  /**
-   * @private
-   */
-  var subclass = function() {
-  };
-  subclass.prototype = parentClass.prototype;
-  childClass.prototype = new subclass();
-};
-
-jasmine.util.formatException = function(e) {
-  var lineNumber;
-  if (e.line) {
-    lineNumber = e.line;
-  }
-  else if (e.lineNumber) {
-    lineNumber = e.lineNumber;
-  }
-
-  var file;
-
-  if (e.sourceURL) {
-    file = e.sourceURL;
-  }
-  else if (e.fileName) {
-    file = e.fileName;
-  }
-
-  var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
-
-  if (file && lineNumber) {
-    message += ' in ' + file + ' (line ' + lineNumber + ')';
-  }
-
-  return message;
-};
-
-jasmine.util.htmlEscape = function(str) {
-  if (!str) return str;
-  return str.replace(/&/g, '&amp;')
-    .replace(/</g, '&lt;')
-    .replace(/>/g, '&gt;');
-};
-
-jasmine.util.argsToArray = function(args) {
-  var arrayOfArgs = [];
-  for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
-  return arrayOfArgs;
-};
-
-jasmine.util.extend = function(destination, source) {
-  for (var property in source) destination[property] = source[property];
-  return destination;
-};
-
-/**
- * Environment for Jasmine
- *
- * @constructor
- */
-jasmine.Env = function() {
-  this.currentSpec = null;
-  this.currentSuite = null;
-  this.currentRunner_ = new jasmine.Runner(this);
-
-  this.reporter = new jasmine.MultiReporter();
-
-  this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
-  this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
-  this.lastUpdate = 0;
-  this.specFilter = function() {
-    return true;
-  };
-
-  this.nextSpecId_ = 0;
-  this.nextSuiteId_ = 0;
-  this.equalityTesters_ = [];
-
-  // wrap matchers
-  this.matchersClass = function() {
-    jasmine.Matchers.apply(this, arguments);
-  };
-  jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
-
-  jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
-};
-
-
-jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
-jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
-jasmine.Env.prototype.setInterval = jasmine.setInterval;
-jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
-
-/**
- * @returns an object containing jasmine version build info, if set.
- */
-jasmine.Env.prototype.version = function () {
-  if (jasmine.version_) {
-    return jasmine.version_;
-  } else {
-    throw new Error('Version not set');
-  }
-};
-
-/**
- * @returns string containing jasmine version build info, if set.
- */
-jasmine.Env.prototype.versionString = function() {
-  if (!jasmine.version_) {
-    return "version unknown";
-  }
-
-  var version = this.version();
-  var versionString = version.major + "." + version.minor + "." + version.build;
-  if (version.release_candidate) {
-    versionString += ".rc" + version.release_candidate;
-  }
-  versionString += " revision " + version.revision;
-  return versionString;
-};
-
-/**
- * @returns a sequential integer starting at 0
- */
-jasmine.Env.prototype.nextSpecId = function () {
-  return this.nextSpecId_++;
-};
-
-/**
- * @returns a sequential integer starting at 0
- */
-jasmine.Env.prototype.nextSuiteId = function () {
-  return this.nextSuiteId_++;
-};
-
-/**
- * Register a reporter to receive status updates from Jasmine.
- * @param {jasmine.Reporter} reporter An object which will receive status updates.
- */
-jasmine.Env.prototype.addReporter = function(reporter) {
-  this.reporter.addReporter(reporter);
-};
-
-jasmine.Env.prototype.execute = function() {
-  this.currentRunner_.execute();
-};
-
-jasmine.Env.prototype.describe = function(description, specDefinitions) {
-  var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
-
-  var parentSuite = this.currentSuite;
-  if (parentSuite) {
-    parentSuite.add(suite);
-  } else {
-    this.currentRunner_.add(suite);
-  }
-
-  this.currentSuite = suite;
-
-  var declarationError = null;
-  try {
-    specDefinitions.call(suite);
-  } catch(e) {
-    declarationError = e;
-  }
-
-  if (declarationError) {
-    this.it("encountered a declaration exception", function() {
-      throw declarationError;
-    });
-  }
-
-  this.currentSuite = parentSuite;
-
-  return suite;
-};
-
-jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
-  if (this.currentSuite) {
-    this.currentSuite.beforeEach(beforeEachFunction);
-  } else {
-    this.currentRunner_.beforeEach(beforeEachFunction);
-  }
-};
-
-jasmine.Env.prototype.currentRunner = function () {
-  return this.currentRunner_;
-};
-
-jasmine.Env.prototype.afterEach = function(afterEachFunction) {
-  if (this.currentSuite) {
-    this.currentSuite.afterEach(afterEachFunction);
-  } else {
-    this.currentRunner_.afterEach(afterEachFunction);
-  }
-
-};
-
-jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
-  return {
-    execute: function() {
-    }
-  };
-};
-
-jasmine.Env.prototype.it = function(description, func) {
-  var spec = new jasmine.Spec(this, this.currentSuite, description);
-  this.currentSuite.add(spec);
-  this.currentSpec = spec;
-
-  if (func) {
-    spec.runs(func);
-  }
-
-  return spec;
-};
-
-jasmine.Env.prototype.xit = function(desc, func) {
-  return {
-    id: this.nextSpecId(),
-    runs: function() {
-    }
-  };
-};
-
-jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
-  if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
-    return true;
-  }
-
-  a.__Jasmine_been_here_before__ = b;
-  b.__Jasmine_been_here_before__ = a;
-
-  var hasKey = function(obj, keyName) {
-    return obj !== null && obj[keyName] !== jasmine.undefined;
-  };
-
-  for (var property in b) {
-    if (!hasKey(a, property) && hasKey(b, property)) {
-      mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
-    }
-  }
-  for (property in a) {
-    if (!hasKey(b, property) && hasKey(a, property)) {
-      mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
-    }
-  }
-  for (property in b) {
-    if (property == '__Jasmine_been_here_before__') continue;
-    if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
-      mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
-    }
-  }
-
-  if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
-    mismatchValues.push("arrays were not the same length");
-  }
-
-  delete a.__Jasmine_been_here_before__;
-  delete b.__Jasmine_been_here_before__;
-  return (mismatchKeys.length === 0 && mismatchValues.length === 0);
-};
-
-jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
-  mismatchKeys = mismatchKeys || [];
-  mismatchValues = mismatchValues || [];
-
-  for (var i = 0; i < this.equalityTesters_.length; i++) {
-    var equalityTester = this.equalityTesters_[i];
-    var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
-    if (result !== jasmine.undefined) return result;
-  }
-
-  if (a === b) return true;
-
-  if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
-    return (a == jasmine.undefined && b == jasmine.undefined);
-  }
-
-  if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
-    return a === b;
-  }
-
-  if (a instanceof Date && b instanceof Date) {
-    return a.getTime() == b.getTime();
-  }
-
-  if (a.jasmineMatches) {
-    return a.jasmineMatches(b);
-  }
-
-  if (b.jasmineMatches) {
-    return b.jasmineMatches(a);
-  }
-
-  if (a instanceof jasmine.Matchers.ObjectContaining) {
-    return a.matches(b);
-  }
-
-  if (b instanceof jasmine.Matchers.ObjectContaining) {
-    return b.matches(a);
-  }
-
-  if (jasmine.isString_(a) && jasmine.isString_(b)) {
-    return (a == b);
-  }
-
-  if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
-    return (a == b);
-  }
-
-  if (typeof a === "object" && typeof b === "object") {
-    return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
-  }
-
-  //Straight check
-  return (a === b);
-};
-
-jasmine.Env.prototype.contains_ = function(haystack, needle) {
-  if (jasmine.isArray_(haystack)) {
-    for (var i = 0; i < haystack.length; i++) {
-      if (this.equals_(haystack[i], needle)) return true;
-    }
-    return false;
-  }
-  return haystack.indexOf(needle) >= 0;
-};
-
-jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
-  this.equalityTesters_.push(equalityTester);
-};
-/** No-op base class for Jasmine reporters.
- *
- * @constructor
- */
-jasmine.Reporter = function() {
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.Reporter.prototype.reportSpecResults = function(spec) {
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.Reporter.prototype.log = function(str) {
-};
-
-/**
- * Blocks are functions with executable code that make up a spec.
- *
- * @constructor
- * @param {jasmine.Env} env
- * @param {Function} func
- * @param {jasmine.Spec} spec
- */
-jasmine.Block = function(env, func, spec) {
-  this.env = env;
-  this.func = func;
-  this.spec = spec;
-};
-
-jasmine.Block.prototype.execute = function(onComplete) {  
-  try {
-    this.func.apply(this.spec);
-  } catch (e) {
-    this.spec.fail(e);
-  }
-  onComplete();
-};
-/** JavaScript API reporter.
- *
- * @constructor
- */
-jasmine.JsApiReporter = function() {
-  this.started = false;
-  this.finished = false;
-  this.suites_ = [];
-  this.results_ = {};
-};
-
-jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
-  this.started = true;
-  var suites = runner.topLevelSuites();
-  for (var i = 0; i < suites.length; i++) {
-    var suite = suites[i];
-    this.suites_.push(this.summarize_(suite));
-  }
-};
-
-jasmine.JsApiReporter.prototype.suites = function() {
-  return this.suites_;
-};
-
-jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
-  var isSuite = suiteOrSpec instanceof jasmine.Suite;
-  var summary = {
-    id: suiteOrSpec.id,
-    name: suiteOrSpec.description,
-    type: isSuite ? 'suite' : 'spec',
-    children: []
-  };
-  
-  if (isSuite) {
-    var children = suiteOrSpec.children();
-    for (var i = 0; i < children.length; i++) {
-      summary.children.push(this.summarize_(children[i]));
-    }
-  }
-  return summary;
-};
-
-jasmine.JsApiReporter.prototype.results = function() {
-  return this.results_;
-};
-
-jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
-  return this.results_[specId];
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
-  this.finished = true;
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
-  this.results_[spec.id] = {
-    messages: spec.results().getItems(),
-    result: spec.results().failedCount > 0 ? "failed" : "passed"
-  };
-};
-
-//noinspection JSUnusedLocalSymbols
-jasmine.JsApiReporter.prototype.log = function(str) {
-};
-
-jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
-  var results = {};
-  for (var i = 0; i < specIds.length; i++) {
-    var specId = specIds[i];
-    results[specId] = this.summarizeResult_(this.results_[specId]);
-  }
-  return results;
-};
-
-jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
-  var summaryMessages = [];
-  var messagesLength = result.messages.length;
-  for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
-    var resultMessage = result.messages[messageIndex];
-    summaryMessages.push({
-      text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
-      passed: resultMessage.passed ? resultMessage.passed() : true,
-      type: resultMessage.type,
-      message: resultMessage.message,
-      trace: {
-        stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
-      }
-    });
-  }
-
-  return {
-    result : result.result,
-    messages : summaryMessages
-  };
-};
-
-/**
- * @constructor
- * @param {jasmine.Env} env
- * @param actual
- * @param {jasmine.Spec} spec
- */
-jasmine.Matchers = function(env, actual, spec, opt_isNot) {
-  this.env = env;
-  this.actual = actual;
-  this.spec = spec;
-  this.isNot = opt_isNot || false;
-  this.reportWasCalled_ = false;
-};
-
-// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
-jasmine.Matchers.pp = function(str) {
-  throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
-};
-
-// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
-jasmine.Matchers.prototype.report = function(result, failing_message, details) {
-  throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
-};
-
-jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
-  for (var methodName in prototype) {
-    if (methodName == 'report') continue;
-    var orig = prototype[methodName];
-    matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
-  }
-};
-
-jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
-  return function() {
-    var matcherArgs = jasmine.util.argsToArray(arguments);
-    var result = matcherFunction.apply(this, arguments);
-
-    if (this.isNot) {
-      result = !result;
-    }
-
-    if (this.reportWasCalled_) return result;
-
-    var message;
-    if (!result) {
-      if (this.message) {
-        message = this.message.apply(this, arguments);
-        if (jasmine.isArray_(message)) {
-          message = message[this.isNot ? 1 : 0];
-        }
-      } else {
-        var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
-        message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
-        if (matcherArgs.length > 0) {
-          for (var i = 0; i < matcherArgs.length; i++) {
-            if (i > 0) message += ",";
-            message += " " + jasmine.pp(matcherArgs[i]);
-          }
-        }
-        message += ".";
-      }
-    }
-    var expectationResult = new jasmine.ExpectationResult({
-      matcherName: matcherName,
-      passed: result,
-      expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
-      actual: this.actual,
-      message: message
-    });
-    this.spec.addMatcherResult(expectationResult);
-    return jasmine.undefined;
-  };
-};
-
-
-
-
-/**
- * toBe: compares the actual to the expected using ===
- * @param expected
- */
-jasmine.Matchers.prototype.toBe = function(expected) {
-  return this.actual === expected;
-};
-
-/**
- * toNotBe: compares the actual to the expected using !==
- * @param expected
- * @deprecated as of 1.0. Use not.toBe() instead.
- */
-jasmine.Matchers.prototype.toNotBe = function(expected) {
-  return this.actual !== expected;
-};
-
-/**
- * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
- *
- * @param expected
- */
-jasmine.Matchers.prototype.toEqual = function(expected) {
-  return this.env.equals_(this.actual, expected);
-};
-
-/**
- * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
- * @param expected
- * @deprecated as of 1.0. Use not.toEqual() instead.
- */
-jasmine.Matchers.prototype.toNotEqual = function(expected) {
-  return !this.env.equals_(this.actual, expected);
-};
-
-/**
- * Matcher that compares the actual to the expected using a regular expression.  Constructs a RegExp, so takes
- * a pattern or a String.
- *
- * @param expected
- */
-jasmine.Matchers.prototype.toMatch = function(expected) {
-  return new RegExp(expected).test(this.actual);
-};
-
-/**
- * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
- * @param expected
- * @deprecated as of 1.0. Use not.toMatch() instead.
- */
-jasmine.Matchers.prototype.toNotMatch = function(expected) {
-  return !(new RegExp(expected).test(this.actual));
-};
-
-/**
- * Matcher that compares the actual to jasmine.undefined.
- */
-jasmine.Matchers.prototype.toBeDefined = function() {
-  return (this.actual !== jasmine.undefined);
-};
-
-/**
- * Matcher that compares the actual to jasmine.undefined.
- */
-jasmine.Matchers.prototype.toBeUndefined = function() {
-  return (this.actual === jasmine.undefined);
-};
-
-/**
- * Matcher that compares the actual to null.
- */
-jasmine.Matchers.prototype.toBeNull = function() {
-  return (this.actual === null);
-};
-
-/**
- * Matcher that boolean not-nots the actual.
- */
-jasmine.Matchers.prototype.toBeTruthy = function() {
-  return !!this.actual;
-};
-
-
-/**
- * Matcher that boolean nots the actual.
- */
-jasmine.Matchers.prototype.toBeFalsy = function() {
-  return !this.actual;
-};
-
-
-/**
- * Matcher that checks to see if the actual, a Jasmine spy, was called.
- */
-jasmine.Matchers.prototype.toHaveBeenCalled = function() {
-  if (arguments.length > 0) {
-    throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
-  }
-
-  if (!jasmine.isSpy(this.actual)) {
-    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
-  }
-
-  this.message = function() {
-    return [
-      "Expected spy " + this.actual.identity + " to have been called.",
-      "Expected spy " + this.actual.identity + " not to have been called."
-    ];
-  };
-
-  return this.actual.wasCalled;
-};
-
-/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
-jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
-
-/**
- * Matcher that checks to see if the actual, a Jasmine spy, was not called.
- *
- * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
- */
-jasmine.Matchers.prototype.wasNotCalled = function() {
-  if (arguments.length > 0) {
-    throw new Error('wasNotCalled does not take arguments');
-  }
-
-  if (!jasmine.isSpy(this.actual)) {
-    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
-  }
-
-  this.message = function() {
-    return [
-      "Expected spy " + this.actual.identity + " to not have been called.",
-      "Expected spy " + this.actual.identity + " to have been called."
-    ];
-  };
-
-  return !this.actual.wasCalled;
-};
-
-/**
- * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
- *
- * @example
- *
- */
-jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
-  var expectedArgs = jasmine.util.argsToArray(arguments);
-  if (!jasmine.isSpy(this.actual)) {
-    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
-  }
-  this.message = function() {
-    if (this.actual.callCount === 0) {
-      // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
-      return [
-        "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
-        "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
-      ];
-    } else {
-      return [
-        "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
-        "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
-      ];
-    }
-  };
-
-  return this.env.contains_(this.actual.argsForCall, expectedArgs);
-};
-
-/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
-jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
-
-/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
-jasmine.Matchers.prototype.wasNotCalledWith = function() {
-  var expectedArgs = jasmine.util.argsToArray(arguments);
-  if (!jasmine.isSpy(this.actual)) {
-    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
-  }
-
-  this.message = function() {
-    return [
-      "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
-      "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
-    ];
-  };
-
-  return !this.env.contains_(this.actual.argsForCall, expectedArgs);
-};
-
-/**
- * Matcher that checks that the expected item is an element in the actual Array.
- *
- * @param {Object} expected
- */
-jasmine.Matchers.prototype.toContain = function(expected) {
-  return this.env.contains_(this.actual, expected);
-};
-
-/**
- * Matcher that checks that the expected item is NOT an element in the actual Array.
- *
- * @param {Object} expected
- * @deprecated as of 1.0. Use not.toContain() instead.
- */
-jasmine.Matchers.prototype.toNotContain = function(expected) {
-  return !this.env.contains_(this.actual, expected);
-};
-
-jasmine.Matchers.prototype.toBeLessThan = function(expected) {
-  return this.actual < expected;
-};
-
-jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
-  return this.actual > expected;
-};
-
-/**
- * Matcher that checks that the expected item is equal to the actual item
- * up to a given level of decimal precision (default 2).
- *
- * @param {Number} expected
- * @param {Number} precision
- */
-jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {
-  if (!(precision === 0)) {
-    precision = precision || 2;
-  }
-  var multiplier = Math.pow(10, precision);
-  var actual = Math.round(this.actual * multiplier);
-  expected = Math.round(expected * multiplier);
-  return expected == actual;
-};
-
-/**
- * Matcher that checks that the expected exception was thrown by the actual.
- *
- * @param {String} expected
- */
-jasmine.Matchers.prototype.toThrow = function(expected) {
-  var result = false;
-  var exception;
-  if (typeof this.actual != 'function') {
-    throw new Error('Actual is not a function');
-  }
-  try {
-    this.actual();
-  } catch (e) {
-    exception = e;
-  }
-  if (exception) {
-    result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
-  }
-
-  var not = this.isNot ? "not " : "";
-
-  this.message = function() {
-    if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
-      return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' ');
-    } else {
-      return "Expected function to throw an exception.";
-    }
-  };
-
-  return result;
-};
-
-jasmine.Matchers.Any = function(expectedClass) {
-  this.expectedClass = expectedClass;
-};
-
-jasmine.Matchers.Any.prototype.jasmineMatches = function(other) {
-  if (this.expectedClass == String) {
-    return typeof other == 'string' || other instanceof String;
-  }
-
-  if (this.expectedClass == Number) {
-    return typeof other == 'number' || other instanceof Number;
-  }
-
-  if (this.expectedClass == Function) {
-    return typeof other == 'function' || other instanceof Function;
-  }
-
-  if (this.expectedClass == Object) {
-    return typeof other == 'object';
-  }
-
-  return other instanceof this.expectedClass;
-};
-
-jasmine.Matchers.Any.prototype.jasmineToString = function() {
-  return '<jasmine.any(' + this.expectedClass + ')>';
-};
-
-jasmine.Matchers.ObjectContaining = function (sample) {
-  this.sample = sample;
-};
-
-jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
-  mismatchKeys = mismatchKeys || [];
-  mismatchValues = mismatchValues || [];
-
-  var env = jasmine.getEnv();
-
-  var hasKey = function(obj, keyName) {
-    return obj != null && obj[keyName] !== jasmine.undefined;
-  };
-
-  for (var property in this.sample) {
-    if (!hasKey(other, property) && hasKey(this.sample, property)) {
-      mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
-    }
-    else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
-      mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual.");
-    }
-  }
-
-  return (mismatchKeys.length === 0 && mismatchValues.length === 0);
-};
-
-jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () {
-  return "<jasmine.objectContaining(" + jasmine.pp(this.sample) + ")>";
-};
-// Mock setTimeout, clearTimeout
-// Contributed by Pivotal Computer Systems, www.pivotalsf.com
-
-jasmine.FakeTimer = function() {
-  this.reset();
-
-  var self = this;
-  self.setTimeout = function(funcToCall, millis) {
-    self.timeoutsMade++;
-    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
-    return self.timeoutsMade;
-  };
-
-  self.setInterval = function(funcToCall, millis) {
-    self.timeoutsMade++;
-    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
-    return self.timeoutsMade;
-  };
-
-  self.clearTimeout = function(timeoutKey) {
-    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
-  };
-
-  self.clearInterval = function(timeoutKey) {
-    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
-  };
-
-};
-
-jasmine.FakeTimer.prototype.reset = function() {
-  this.timeoutsMade = 0;
-  this.scheduledFunctions = {};
-  this.nowMillis = 0;
-};
-
-jasmine.FakeTimer.prototype.tick = function(millis) {
-  var oldMillis = this.nowMillis;
-  var newMillis = oldMillis + millis;
-  this.runFunctionsWithinRange(oldMillis, newMillis);
-  this.nowMillis = newMillis;
-};
-
-jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
-  var scheduledFunc;
-  var funcsToRun = [];
-  for (var timeoutKey in this.scheduledFunctions) {
-    scheduledFunc = this.scheduledFunctions[timeoutKey];
-    if (scheduledFunc != jasmine.undefined &&
-        scheduledFunc.runAtMillis >= oldMillis &&
-        scheduledFunc.runAtMillis <= nowMillis) {
-      funcsToRun.push(scheduledFunc);
-      this.scheduledFunctions[timeoutKey] = jasmine.undefined;
-    }
-  }
-
-  if (funcsToRun.length > 0) {
-    funcsToRun.sort(function(a, b) {
-      return a.runAtMillis - b.runAtMillis;
-    });
-    for (var i = 0; i < funcsToRun.length; ++i) {
-      try {
-        var funcToRun = funcsToRun[i];
-        this.nowMillis = funcToRun.runAtMillis;
-        funcToRun.funcToCall();
-        if (funcToRun.recurring) {
-          this.scheduleFunction(funcToRun.timeoutKey,
-              funcToRun.funcToCall,
-              funcToRun.millis,
-              true);
-        }
-      } catch(e) {
-      }
-    }
-    this.runFunctionsWithinRange(oldMillis, nowMillis);
-  }
-};
-
-jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
-  this.scheduledFunctions[timeoutKey] = {
-    runAtMillis: this.nowMillis + millis,
-    funcToCall: funcToCall,
-    recurring: recurring,
-    timeoutKey: timeoutKey,
-    millis: millis
-  };
-};
-
-/**
- * @namespace
- */
-jasmine.Clock = {
-  defaultFakeTimer: new jasmine.FakeTimer(),
-
-  reset: function() {
-    jasmine.Clock.assertInstalled();
-    jasmine.Clock.defaultFakeTimer.reset();
-  },
-
-  tick: function(millis) {
-    jasmine.Clock.assertInstalled();
-    jasmine.Clock.defaultFakeTimer.tick(millis);
-  },
-
-  runFunctionsWithinRange: function(oldMillis, nowMillis) {
-    jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
-  },
-
-  scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
-    jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
-  },
-
-  useMock: function() {
-    if (!jasmine.Clock.isInstalled()) {
-      var spec = jasmine.getEnv().currentSpec;
-      spec.after(jasmine.Clock.uninstallMock);
-
-      jasmine.Clock.installMock();
-    }
-  },
-
-  installMock: function() {
-    jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
-  },
-
-  uninstallMock: function() {
-    jasmine.Clock.assertInstalled();
-    jasmine.Clock.installed = jasmine.Clock.real;
-  },
-
-  real: {
-    setTimeout: jasmine.getGlobal().setTimeout,
-    clearTimeout: jasmine.getGlobal().clearTimeout,
-    setInterval: jasmine.getGlobal().setInterval,
-    clearInterval: jasmine.getGlobal().clearInterval
-  },
-
-  assertInstalled: function() {
-    if (!jasmine.Clock.isInstalled()) {
-      throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
-    }
-  },
-
-  isInstalled: function() {
-    return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
-  },
-
-  installed: null
-};
-jasmine.Clock.installed = jasmine.Clock.real;
-
-//else for IE support
-jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
-  if (jasmine.Clock.installed.setTimeout.apply) {
-    return jasmine.Clock.installed.setTimeout.apply(this, arguments);
-  } else {
-    return jasmine.Clock.installed.setTimeout(funcToCall, millis);
-  }
-};
-
-jasmine.getGlobal().setInterval = function(funcToCall, millis) {
-  if (jasmine.Clock.installed.setInterval.apply) {
-    return jasmine.Clock.installed.setInterval.apply(this, arguments);
-  } else {
-    return jasmine.Clock.installed.setInterval(funcToCall, millis);
-  }
-};
-
-jasmine.getGlobal().clearTimeout = function(timeoutKey) {
-  if (jasmine.Clock.installed.clearTimeout.apply) {
-    return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
-  } else {
-    return jasmine.Clock.installed.clearTimeout(timeoutKey);
-  }
-};
-
-jasmine.getGlobal().clearInterval = function(timeoutKey) {
-  if (jasmine.Clock.installed.clearTimeout.apply) {
-    return jasmine.Clock.installed.clearInterval.apply(this, arguments);
-  } else {
-    return jasmine.Clock.installed.clearInterval(timeoutKey);
-  }
-};
-
-/**
- * @constructor
- */
-jasmine.MultiReporter = function() {
-  this.subReporters_ = [];
-};
-jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
-
-jasmine.MultiReporter.prototype.addReporter = function(reporter) {
-  this.subReporters_.push(reporter);
-};
-
-(function() {
-  var functionNames = [
-    "reportRunnerStarting",
-    "reportRunnerResults",
-    "reportSuiteResults",
-    "reportSpecStarting",
-    "reportSpecResults",
-    "log"
-  ];
-  for (var i = 0; i < functionNames.length; i++) {
-    var functionName = functionNames[i];
-    jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
-      return function() {
-        for (var j = 0; j < this.subReporters_.length; j++) {
-          var subReporter = this.subReporters_[j];
-          if (subReporter[functionName]) {
-            subReporter[functionName].apply(subReporter, arguments);
-          }
-        }
-      };
-    })(functionName);
-  }
-})();
-/**
- * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
- *
- * @constructor
- */
-jasmine.NestedResults = function() {
-  /**
-   * The total count of results
-   */
-  this.totalCount = 0;
-  /**
-   * Number of passed results
-   */
-  this.passedCount = 0;
-  /**
-   * Number of failed results
-   */
-  this.failedCount = 0;
-  /**
-   * Was this suite/spec skipped?
-   */
-  this.skipped = false;
-  /**
-   * @ignore
-   */
-  this.items_ = [];
-};
-
-/**
- * Roll up the result counts.
- *
- * @param result
- */
-jasmine.NestedResults.prototype.rollupCounts = function(result) {
-  this.totalCount += result.totalCount;
-  this.passedCount += result.passedCount;
-  this.failedCount += result.failedCount;
-};
-
-/**
- * Adds a log message.
- * @param values Array of message parts which will be concatenated later.
- */
-jasmine.NestedResults.prototype.log = function(values) {
-  this.items_.push(new jasmine.MessageResult(values));
-};
-
-/**
- * Getter for the results: message & results.
- */
-jasmine.NestedResults.prototype.getItems = function() {
-  return this.items_;
-};
-
-/**
- * Adds a result, tracking counts (total, passed, & failed)
- * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
- */
-jasmine.NestedResults.prototype.addResult = function(result) {
-  if (result.type != 'log') {
-    if (result.items_) {
-      this.rollupCounts(result);
-    } else {
-      this.totalCount++;
-      if (result.passed()) {
-        this.passedCount++;
-      } else {
-        this.failedCount++;
-      }
-    }
-  }
-  this.items_.push(result);
-};
-
-/**
- * @returns {Boolean} True if <b>everything</b> below passed
- */
-jasmine.NestedResults.prototype.passed = function() {
-  return this.passedCount === this.totalCount;
-};
-/**
- * Base class for pretty printing for expectation results.
- */
-jasmine.PrettyPrinter = function() {
-  this.ppNestLevel_ = 0;
-};
-
-/**
- * Formats a value in a nice, human-readable string.
- *
- * @param value
- */
-jasmine.PrettyPrinter.prototype.format = function(value) {
-  if (this.ppNestLevel_ > 40) {
-    throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
-  }
-
-  this.ppNestLevel_++;
-  try {
-    if (value === jasmine.undefined) {
-      this.emitScalar('undefined');
-    } else if (value === null) {
-      this.emitScalar('null');
-    } else if (value === jasmine.getGlobal()) {
-      this.emitScalar('<global>');
-    } else if (value.jasmineToString) {
-      this.emitScalar(value.jasmineToString());
-    } else if (typeof value === 'string') {
-      this.emitString(value);
-    } else if (jasmine.isSpy(value)) {
-      this.emitScalar("spy on " + value.identity);
-    } else if (value instanceof RegExp) {
-      this.emitScalar(value.toString());
-    } else if (typeof value === 'function') {
-      this.emitScalar('Function');
-    } else if (typeof value.nodeType === 'number') {
-      this.emitScalar('HTMLNode');
-    } else if (value instanceof Date) {
-      this.emitScalar('Date(' + value + ')');
-    } else if (value.__Jasmine_been_here_before__) {
-      this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
-    } else if (jasmine.isArray_(value) || typeof value == 'object') {
-      value.__Jasmine_been_here_before__ = true;
-      if (jasmine.isArray_(value)) {
-        this.emitArray(value);
-      } else {
-        this.emitObject(value);
-      }
-      delete value.__Jasmine_been_here_before__;
-    } else {
-      this.emitScalar(value.toString());
-    }
-  } finally {
-    this.ppNestLevel_--;
-  }
-};
-
-jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
-  for (var property in obj) {
-    if (property == '__Jasmine_been_here_before__') continue;
-    fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && 
-                                         obj.__lookupGetter__(property) !== null) : false);
-  }
-};
-
-jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
-jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
-jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
-jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
-
-jasmine.StringPrettyPrinter = function() {
-  jasmine.PrettyPrinter.call(this);
-
-  this.string = '';
-};
-jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
-
-jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
-  this.append(value);
-};
-
-jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
-  this.append("'" + value + "'");
-};
-
-jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
-  this.append('[ ');
-  for (var i = 0; i < array.length; i++) {
-    if (i > 0) {
-      this.append(', ');
-    }
-    this.format(array[i]);
-  }
-  this.append(' ]');
-};
-
-jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
-  var self = this;
-  this.append('{ ');
-  var first = true;
-
-  this.iterateObject(obj, function(property, isGetter) {
-    if (first) {
-      first = false;
-    } else {
-      self.append(', ');
-    }
-
-    self.append(property);
-    self.append(' : ');
-    if (isGetter) {
-      self.append('<getter>');
-    } else {
-      self.format(obj[property]);
-    }
-  });
-
-  this.append(' }');
-};
-
-jasmine.StringPrettyPrinter.prototype.append = function(value) {
-  this.string += value;
-};
-jasmine.Queue = function(env) {
-  this.env = env;
-  this.blocks = [];
-  this.running = false;
-  this.index = 0;
-  this.offset = 0;
-  this.abort = false;
-};
-
-jasmine.Queue.prototype.addBefore = function(block) {
-  this.blocks.unshift(block);
-};
-
-jasmine.Queue.prototype.add = function(block) {
-  this.blocks.push(block);
-};
-
-jasmine.Queue.prototype.insertNext = function(block) {
-  this.blocks.splice((this.index + this.offset + 1), 0, block);
-  this.offset++;
-};
-
-jasmine.Queue.prototype.start = function(onComplete) {
-  this.running = true;
-  this.onComplete = onComplete;
-  this.next_();
-};
-
-jasmine.Queue.prototype.isRunning = function() {
-  return this.running;
-};
-
-jasmine.Queue.LOOP_DONT_RECURSE = true;
-
-jasmine.Queue.prototype.next_ = function() {
-  var self = this;
-  var goAgain = true;
-
-  while (goAgain) {
-    goAgain = false;
-    
-    if (self.index < self.blocks.length && !this.abort) {
-      var calledSynchronously = true;
-      var completedSynchronously = false;
-
-      var onComplete = function () {
-        if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
-          completedSynchronously = true;
-          return;
-        }
-
-        if (self.blocks[self.index].abort) {
-          self.abort = true;
-        }
-
-        self.offset = 0;
-        self.index++;
-
-        var now = new Date().getTime();
-        if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
-          self.env.lastUpdate = now;
-          self.env.setTimeout(function() {
-            self.next_();
-          }, 0);
-        } else {
-          if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
-            goAgain = true;
-          } else {
-            self.next_();
-          }
-        }
-      };
-      self.blocks[self.index].execute(onComplete);
-
-      calledSynchronously = false;
-      if (completedSynchronously) {
-        onComplete();
-      }
-      
-    } else {
-      self.running = false;
-      if (self.onComplete) {
-        self.onComplete();
-      }
-    }
-  }
-};
-
-jasmine.Queue.prototype.results = function() {
-  var results = new jasmine.NestedResults();
-  for (var i = 0; i < this.blocks.length; i++) {
-    if (this.blocks[i].results) {
-      results.addResult(this.blocks[i].results());
-    }
-  }
-  return results;
-};
-
-
-/**
- * Runner
- *
- * @constructor
- * @param {jasmine.Env} env
- */
-jasmine.Runner = function(env) {
-  var self = this;
-  self.env = env;
-  self.queue = new jasmine.Queue(env);
-  self.before_ = [];
-  self.after_ = [];
-  self.suites_ = [];
-};
-
-jasmine.Runner.prototype.execute = function() {
-  var self = this;
-  if (self.env.reporter.reportRunnerStarting) {
-    self.env.reporter.reportRunnerStarting(this);
-  }
-  self.queue.start(function () {
-    self.finishCallback();
-  });
-};
-
-jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
-  beforeEachFunction.typeName = 'beforeEach';
-  this.before_.splice(0,0,beforeEachFunction);
-};
-
-jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
-  afterEachFunction.typeName = 'afterEach';
-  this.after_.splice(0,0,afterEachFunction);
-};
-
-
-jasmine.Runner.prototype.finishCallback = function() {
-  this.env.reporter.reportRunnerResults(this);
-};
-
-jasmine.Runner.prototype.addSuite = function(suite) {
-  this.suites_.push(suite);
-};
-
-jasmine.Runner.prototype.add = function(block) {
-  if (block instanceof jasmine.Suite) {
-    this.addSuite(block);
-  }
-  this.queue.add(block);
-};
-
-jasmine.Runner.prototype.specs = function () {
-  var suites = this.suites();
-  var specs = [];
-  for (var i = 0; i < suites.length; i++) {
-    specs = specs.concat(suites[i].specs());
-  }
-  return specs;
-};
-
-jasmine.Runner.prototype.suites = function() {
-  return this.suites_;
-};
-
-jasmine.Runner.prototype.topLevelSuites = function() {
-  var topLevelSuites = [];
-  for (var i = 0; i < this.suites_.length; i++) {
-    if (!this.suites_[i].parentSuite) {
-      topLevelSuites.push(this.suites_[i]);
-    }
-  }
-  return topLevelSuites;
-};
-
-jasmine.Runner.prototype.results = function() {
-  return this.queue.results();
-};
-/**
- * Internal representation of a Jasmine specification, or test.
- *
- * @constructor
- * @param {jasmine.Env} env
- * @param {jasmine.Suite} suite
- * @param {String} description
- */
-jasmine.Spec = function(env, suite, description) {
-  if (!env) {
-    throw new Error('jasmine.Env() required');
-  }
-  if (!suite) {
-    throw new Error('jasmine.Suite() required');
-  }
-  var spec = this;
-  spec.id = env.nextSpecId ? env.nextSpecId() : null;
-  spec.env = env;
-  spec.suite = suite;
-  spec.description = description;
-  spec.queue = new jasmine.Queue(env);
-
-  spec.afterCallbacks = [];
-  spec.spies_ = [];
-
-  spec.results_ = new jasmine.NestedResults();
-  spec.results_.description = description;
-  spec.matchersClass = null;
-};
-
-jasmine.Spec.prototype.getFullName = function() {
-  return this.suite.getFullName() + ' ' + this.description + '.';
-};
-
-
-jasmine.Spec.prototype.results = function() {
-  return this.results_;
-};
-
-/**
- * All parameters are pretty-printed and concatenated together, then written to the spec's output.
- *
- * Be careful not to leave calls to <code>jasmine.log</code> in production code.
- */
-jasmine.Spec.prototype.log = function() {
-  return this.results_.log(arguments);
-};
-
-jasmine.Spec.prototype.runs = function (func) {
-  var block = new jasmine.Block(this.env, func, this);
-  this.addToQueue(block);
-  return this;
-};
-
-jasmine.Spec.prototype.addToQueue = function (block) {
-  if (this.queue.isRunning()) {
-    this.queue.insertNext(block);
-  } else {
-    this.queue.add(block);
-  }
-};
-
-/**
- * @param {jasmine.ExpectationResult} result
- */
-jasmine.Spec.prototype.addMatcherResult = function(result) {
-  this.results_.addResult(result);
-};
-
-jasmine.Spec.prototype.expect = function(actual) {
-  var positive = new (this.getMatchersClass_())(this.env, actual, this);
-  positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
-  return positive;
-};
-
-/**
- * Waits a fixed time period before moving to the next block.
- *
- * @deprecated Use waitsFor() instead
- * @param {Number} timeout milliseconds to wait
- */
-jasmine.Spec.prototype.waits = function(timeout) {
-  var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
-  this.addToQueue(waitsFunc);
-  return this;
-};
-
-/**
- * Waits for the latchFunction to return true before proceeding to the next block.
- *
- * @param {Function} latchFunction
- * @param {String} optional_timeoutMessage
- * @param {Number} optional_timeout
- */
-jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
-  var latchFunction_ = null;
-  var optional_timeoutMessage_ = null;
-  var optional_timeout_ = null;
-
-  for (var i = 0; i < arguments.length; i++) {
-    var arg = arguments[i];
-    switch (typeof arg) {
-      case 'function':
-        latchFunction_ = arg;
-        break;
-      case 'string':
-        optional_timeoutMessage_ = arg;
-        break;
-      case 'number':
-        optional_timeout_ = arg;
-        break;
-    }
-  }
-
-  var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
-  this.addToQueue(waitsForFunc);
-  return this;
-};
-
-jasmine.Spec.prototype.fail = function (e) {
-  var expectationResult = new jasmine.ExpectationResult({
-    passed: false,
-    message: e ? jasmine.util.formatException(e) : 'Exception',
-    trace: { stack: e.stack }
-  });
-  this.results_.addResult(expectationResult);
-};
-
-jasmine.Spec.prototype.getMatchersClass_ = function() {
-  return this.matchersClass || this.env.matchersClass;
-};
-
-jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
-  var parent = this.getMatchersClass_();
-  var newMatchersClass = function() {
-    parent.apply(this, arguments);
-  };
-  jasmine.util.inherit(newMatchersClass, parent);
-  jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
-  this.matchersClass = newMatchersClass;
-};
-
-jasmine.Spec.prototype.finishCallback = function() {
-  this.env.reporter.reportSpecResults(this);
-};
-
-jasmine.Spec.prototype.finish = function(onComplete) {
-  this.removeAllSpies();
-  this.finishCallback();
-  if (onComplete) {
-    onComplete();
-  }
-};
-
-jasmine.Spec.prototype.after = function(doAfter) {
-  if (this.queue.isRunning()) {
-    this.queue.add(new jasmine.Block(this.env, doAfter, this));
-  } else {
-    this.afterCallbacks.unshift(doAfter);
-  }
-};
-
-jasmine.Spec.prototype.execute = function(onComplete) {
-  var spec = this;
-  if (!spec.env.specFilter(spec)) {
-    spec.results_.skipped = true;
-    spec.finish(onComplete);
-    return;
-  }
-
-  this.env.reporter.reportSpecStarting(this);
-
-  spec.env.currentSpec = spec;
-
-  spec.addBeforesAndAftersToQueue();
-
-  spec.queue.start(function () {
-    spec.finish(onComplete);
-  });
-};
-
-jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
-  var runner = this.env.currentRunner();
-  var i;
-
-  for (var suite = this.suite; suite; suite = suite.parentSuite) {
-    for (i = 0; i < suite.before_.length; i++) {
-      this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
-    }
-  }
-  for (i = 0; i < runner.before_.length; i++) {
-    this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
-  }
-  for (i = 0; i < this.afterCallbacks.length; i++) {
-    this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
-  }
-  for (suite = this.suite; suite; suite = suite.parentSuite) {
-    for (i = 0; i < suite.after_.length; i++) {
-      this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
-    }
-  }
-  for (i = 0; i < runner.after_.length; i++) {
-    this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
-  }
-};
-
-jasmine.Spec.prototype.explodes = function() {
-  throw 'explodes function should not have been called';
-};
-
-jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
-  if (obj == jasmine.undefined) {
-    throw "spyOn could not find an object to spy upon for " + methodName + "()";
-  }
-
-  if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
-    throw methodName + '() method does not exist';
-  }
-
-  if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
-    throw new Error(methodName + ' has already been spied upon');
-  }
-
-  var spyObj = jasmine.createSpy(methodName);
-
-  this.spies_.push(spyObj);
-  spyObj.baseObj = obj;
-  spyObj.methodName = methodName;
-  spyObj.originalValue = obj[methodName];
-
-  obj[methodName] = spyObj;
-
-  return spyObj;
-};
-
-jasmine.Spec.prototype.removeAllSpies = function() {
-  for (var i = 0; i < this.spies_.length; i++) {
-    var spy = this.spies_[i];
-    spy.baseObj[spy.methodName] = spy.originalValue;
-  }
-  this.spies_ = [];
-};
-
-/**
- * Internal representation of a Jasmine suite.
- *
- * @constructor
- * @param {jasmine.Env} env
- * @param {String} description
- * @param {Function} specDefinitions
- * @param {jasmine.Suite} parentSuite
- */
-jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
-  var self = this;
-  self.id = env.nextSuiteId ? env.nextSuiteId() : null;
-  self.description = description;
-  self.queue = new jasmine.Queue(env);
-  self.parentSuite = parentSuite;
-  self.env = env;
-  self.before_ = [];
-  self.after_ = [];
-  self.children_ = [];
-  self.suites_ = [];
-  self.specs_ = [];
-};
-
-jasmine.Suite.prototype.getFullName = function() {
-  var fullName = this.description;
-  for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
-    fullName = parentSuite.description + ' ' + fullName;
-  }
-  return fullName;
-};
-
-jasmine.Suite.prototype.finish = function(onComplete) {
-  this.env.reporter.reportSuiteResults(this);
-  this.finished = true;
-  if (typeof(onComplete) == 'function') {
-    onComplete();
-  }
-};
-
-jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
-  beforeEachFunction.typeName = 'beforeEach';
-  this.before_.unshift(beforeEachFunction);
-};
-
-jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
-  afterEachFunction.typeName = 'afterEach';
-  this.after_.unshift(afterEachFunction);
-};
-
-jasmine.Suite.prototype.results = function() {
-  return this.queue.results();
-};
-
-jasmine.Suite.prototype.add = function(suiteOrSpec) {
-  this.children_.push(suiteOrSpec);
-  if (suiteOrSpec instanceof jasmine.Suite) {
-    this.suites_.push(suiteOrSpec);
-    this.env.currentRunner().addSuite(suiteOrSpec);
-  } else {
-    this.specs_.push(suiteOrSpec);
-  }
-  this.queue.add(suiteOrSpec);
-};
-
-jasmine.Suite.prototype.specs = function() {
-  return this.specs_;
-};
-
-jasmine.Suite.prototype.suites = function() {
-  return this.suites_;
-};
-
-jasmine.Suite.prototype.children = function() {
-  return this.children_;
-};
-
-jasmine.Suite.prototype.execute = function(onComplete) {
-  var self = this;
-  this.queue.start(function () {
-    self.finish(onComplete);
-  });
-};
-jasmine.WaitsBlock = function(env, timeout, spec) {
-  this.timeout = timeout;
-  jasmine.Block.call(this, env, null, spec);
-};
-
-jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
-
-jasmine.WaitsBlock.prototype.execute = function (onComplete) {
-  if (jasmine.VERBOSE) {
-    this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
-  }
-  this.env.setTimeout(function () {
-    onComplete();
-  }, this.timeout);
-};
-/**
- * A block which waits for some condition to become true, with timeout.
- *
- * @constructor
- * @extends jasmine.Block
- * @param {jasmine.Env} env The Jasmine environment.
- * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
- * @param {Function} latchFunction A function which returns true when the desired condition has been met.
- * @param {String} message The message to display if the desired condition hasn't been met within the given time period.
- * @param {jasmine.Spec} spec The Jasmine spec.
- */
-jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
-  this.timeout = timeout || env.defaultTimeoutInterval;
-  this.latchFunction = latchFunction;
-  this.message = message;
-  this.totalTimeSpentWaitingForLatch = 0;
-  jasmine.Block.call(this, env, null, spec);
-};
-jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
-
-jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
-
-jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
-  if (jasmine.VERBOSE) {
-    this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
-  }
-  var latchFunctionResult;
-  try {
-    latchFunctionResult = this.latchFunction.apply(this.spec);
-  } catch (e) {
-    this.spec.fail(e);
-    onComplete();
-    return;
-  }
-
-  if (latchFunctionResult) {
-    onComplete();
-  } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
-    var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
-    this.spec.fail({
-      name: 'timeout',
-      message: message
-    });
-
-    this.abort = true;
-    onComplete();
-  } else {
-    this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
-    var self = this;
-    this.env.setTimeout(function() {
-      self.execute(onComplete);
-    }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
-  }
-};
-
-jasmine.version_= {
-  "major": 1,
-  "minor": 2,
-  "build": 0,
-  "revision": 1337005947
-};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/LICENSE b/lib/cordova-blackberry/blackberry/LICENSE
new file mode 100644
index 0000000..ee6a935
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/LICENSE
@@ -0,0 +1,268 @@
+
+                               Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+For the template/project/lib/ant-contrib/ant-contrib-1.0b3.jar component:
+
+   The Apache Software License, Version 1.1
+
+   Copyright (c) 2001-2003 Ant-Contrib project.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+   3. The end-user documentation included with the redistribution, if
+      any, must include the following acknowlegement:
+         "This product includes software developed by the
+          Ant-Contrib project (http://sourceforge.net/projects/ant-contrib)."
+      Alternately, this acknowlegement may appear in the software itself,
+      if and wherever such third-party acknowlegements normally appear.
+
+   4. The name Ant-Contrib must not be used to endorse or promote products
+      derived from this software without prior written permission. For
+      written permission, please contact
+      ant-contrib-developers@lists.sourceforge.net.
+
+   5. Products derived from this software may not be called "Ant-Contrib"
+      nor may "Ant-Contrib" appear in their names without prior written
+      permission of the Ant-Contrib project.
+
+   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED.  IN NO EVENT SHALL THE ANT-CONTRIB PROJECT OR ITS
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+   SUCH DAMAGE.
+   ====================================================================
+
+For the template/project/www/json2.js component:
+
+    http://www.JSON.org/json2.js
+    2010-03-20
+
+    Public Domain.
+
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+    See http://www.JSON.org/js.html
+
+
+    This code should be minified before deployment.
+    See http://javascript.crockford.com/jsmin.html
+
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+    NOT CONTROL.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/NOTICE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/NOTICE b/lib/cordova-blackberry/blackberry/NOTICE
new file mode 100644
index 0000000..23360ce
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/NOTICE
@@ -0,0 +1,8 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org)
+
+This product includes software developed by
+Ant-Contrib project (http://sourceforge.net/projects/ant-contrib).


[03/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js
new file mode 100644
index 0000000..00ab2d5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js
@@ -0,0 +1,914 @@
+// Generated by CoffeeScript 1.6.2
+(function() {
+  var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, invertLiterate, key, last, locationDataToString, starts, throwSyntaxError, _ref, _ref1,
+    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+  _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES;
+
+  _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
+
+  exports.Lexer = Lexer = (function() {
+    function Lexer() {}
+
+    Lexer.prototype.tokenize = function(code, opts) {
+      var consumed, i, tag, _ref2;
+
+      if (opts == null) {
+        opts = {};
+      }
+      this.literate = opts.literate;
+      this.indent = 0;
+      this.indebt = 0;
+      this.outdebt = 0;
+      this.indents = [];
+      this.ends = [];
+      this.tokens = [];
+      this.chunkLine = opts.line || 0;
+      this.chunkColumn = opts.column || 0;
+      code = this.clean(code);
+      i = 0;
+      while (this.chunk = code.slice(i)) {
+        consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken();
+        _ref2 = this.getLineAndColumnFromChunk(consumed), this.chunkLine = _ref2[0], this.chunkColumn = _ref2[1];
+        i += consumed;
+      }
+      this.closeIndentation();
+      if (tag = this.ends.pop()) {
+        this.error("missing " + tag);
+      }
+      if (opts.rewrite === false) {
+        return this.tokens;
+      }
+      return (new Rewriter).rewrite(this.tokens);
+    };
+
+    Lexer.prototype.clean = function(code) {
+      if (code.charCodeAt(0) === BOM) {
+        code = code.slice(1);
+      }
+      code = code.replace(/\r/g, '').replace(TRAILING_SPACES, '');
+      if (WHITESPACE.test(code)) {
+        code = "\n" + code;
+        this.chunkLine--;
+      }
+      if (this.literate) {
+        code = invertLiterate(code);
+      }
+      return code;
+    };
+
+    Lexer.prototype.identifierToken = function() {
+      var colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, tag, tagToken, _ref2, _ref3, _ref4;
+
+      if (!(match = IDENTIFIER.exec(this.chunk))) {
+        return 0;
+      }
+      input = match[0], id = match[1], colon = match[2];
+      idLength = id.length;
+      poppedToken = void 0;
+      if (id === 'own' && this.tag() === 'FOR') {
+        this.token('OWN', id);
+        return id.length;
+      }
+      forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::' || _ref2 === '?::') || !prev.spaced && prev[0] === '@');
+      tag = 'IDENTIFIER';
+      if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) {
+        tag = id.toUpperCase();
+        if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) {
+          tag = 'LEADING_WHEN';
+        } else if (tag === 'FOR') {
+          this.seenFor = true;
+        } else if (tag === 'UNLESS') {
+          tag = 'IF';
+        } else if (__indexOf.call(UNARY, tag) >= 0) {
+          tag = 'UNARY';
+        } else if (__indexOf.call(RELATION, tag) >= 0) {
+          if (tag !== 'INSTANCEOF' && this.seenFor) {
+            tag = 'FOR' + tag;
+            this.seenFor = false;
+          } else {
+            tag = 'RELATION';
+            if (this.value() === '!') {
+              poppedToken = this.tokens.pop();
+              id = '!' + id;
+            }
+          }
+        }
+      }
+      if (__indexOf.call(JS_FORBIDDEN, id) >= 0) {
+        if (forcedIdentifier) {
+          tag = 'IDENTIFIER';
+          id = new String(id);
+          id.reserved = true;
+        } else if (__indexOf.call(RESERVED, id) >= 0) {
+          this.error("reserved word \"" + id + "\"");
+        }
+      }
+      if (!forcedIdentifier) {
+        if (__indexOf.call(COFFEE_ALIASES, id) >= 0) {
+          id = COFFEE_ALIAS_MAP[id];
+        }
+        tag = (function() {
+          switch (id) {
+            case '!':
+              return 'UNARY';
+            case '==':
+            case '!=':
+              return 'COMPARE';
+            case '&&':
+            case '||':
+              return 'LOGIC';
+            case 'true':
+            case 'false':
+              return 'BOOL';
+            case 'break':
+            case 'continue':
+              return 'STATEMENT';
+            default:
+              return tag;
+          }
+        })();
+      }
+      tagToken = this.token(tag, id, 0, idLength);
+      if (poppedToken) {
+        _ref4 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = _ref4[0], tagToken[2].first_column = _ref4[1];
+      }
+      if (colon) {
+        colonOffset = input.lastIndexOf(':');
+        this.token(':', ':', colonOffset, colon.length);
+      }
+      return input.length;
+    };
+
+    Lexer.prototype.numberToken = function() {
+      var binaryLiteral, lexedLength, match, number, octalLiteral;
+
+      if (!(match = NUMBER.exec(this.chunk))) {
+        return 0;
+      }
+      number = match[0];
+      if (/^0[BOX]/.test(number)) {
+        this.error("radix prefix '" + number + "' must be lowercase");
+      } else if (/E/.test(number) && !/^0x/.test(number)) {
+        this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'");
+      } else if (/^0\d*[89]/.test(number)) {
+        this.error("decimal literal '" + number + "' must not be prefixed with '0'");
+      } else if (/^0\d+/.test(number)) {
+        this.error("octal literal '" + number + "' must be prefixed with '0o'");
+      }
+      lexedLength = number.length;
+      if (octalLiteral = /^0o([0-7]+)/.exec(number)) {
+        number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16);
+      }
+      if (binaryLiteral = /^0b([01]+)/.exec(number)) {
+        number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16);
+      }
+      this.token('NUMBER', number, 0, lexedLength);
+      return lexedLength;
+    };
+
+    Lexer.prototype.stringToken = function() {
+      var match, octalEsc, string;
+
+      switch (this.chunk.charAt(0)) {
+        case "'":
+          if (!(match = SIMPLESTR.exec(this.chunk))) {
+            return 0;
+          }
+          string = match[0];
+          this.token('STRING', string.replace(MULTILINER, '\\\n'), 0, string.length);
+          break;
+        case '"':
+          if (!(string = this.balancedString(this.chunk, '"'))) {
+            return 0;
+          }
+          if (0 < string.indexOf('#{', 1)) {
+            this.interpolateString(string.slice(1, -1), {
+              strOffset: 1,
+              lexedLength: string.length
+            });
+          } else {
+            this.token('STRING', this.escapeLines(string, 0, string.length));
+          }
+          break;
+        default:
+          return 0;
+      }
+      if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) {
+        this.error("octal escape sequences " + string + " are not allowed");
+      }
+      return string.length;
+    };
+
+    Lexer.prototype.heredocToken = function() {
+      var doc, heredoc, match, quote;
+
+      if (!(match = HEREDOC.exec(this.chunk))) {
+        return 0;
+      }
+      heredoc = match[0];
+      quote = heredoc.charAt(0);
+      doc = this.sanitizeHeredoc(match[2], {
+        quote: quote,
+        indent: null
+      });
+      if (quote === '"' && 0 <= doc.indexOf('#{')) {
+        this.interpolateString(doc, {
+          heredoc: true,
+          strOffset: 3,
+          lexedLength: heredoc.length
+        });
+      } else {
+        this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length);
+      }
+      return heredoc.length;
+    };
+
+    Lexer.prototype.commentToken = function() {
+      var comment, here, match;
+
+      if (!(match = this.chunk.match(COMMENT))) {
+        return 0;
+      }
+      comment = match[0], here = match[1];
+      if (here) {
+        this.token('HERECOMMENT', this.sanitizeHeredoc(here, {
+          herecomment: true,
+          indent: Array(this.indent + 1).join(' ')
+        }), 0, comment.length);
+      }
+      return comment.length;
+    };
+
+    Lexer.prototype.jsToken = function() {
+      var match, script;
+
+      if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
+        return 0;
+      }
+      this.token('JS', (script = match[0]).slice(1, -1), 0, script.length);
+      return script.length;
+    };
+
+    Lexer.prototype.regexToken = function() {
+      var flags, length, match, prev, regex, _ref2, _ref3;
+
+      if (this.chunk.charAt(0) !== '/') {
+        return 0;
+      }
+      if (match = HEREGEX.exec(this.chunk)) {
+        length = this.heregexToken(match);
+        return length;
+      }
+      prev = last(this.tokens);
+      if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) {
+        return 0;
+      }
+      if (!(match = REGEX.exec(this.chunk))) {
+        return 0;
+      }
+      _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2];
+      if (regex.slice(0, 2) === '/*') {
+        this.error('regular expressions cannot begin with `*`');
+      }
+      if (regex === '//') {
+        regex = '/(?:)/';
+      }
+      this.token('REGEX', "" + regex + flags, 0, match.length);
+      return match.length;
+    };
+
+    Lexer.prototype.heregexToken = function(match) {
+      var body, flags, flagsOffset, heregex, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
+
+      heregex = match[0], body = match[1], flags = match[2];
+      if (0 > body.indexOf('#{')) {
+        re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/');
+        if (re.match(/^\*/)) {
+          this.error('regular expressions cannot begin with `*`');
+        }
+        this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length);
+        return heregex.length;
+      }
+      this.token('IDENTIFIER', 'RegExp', 0, 0);
+      this.token('CALL_START', '(', 0, 0);
+      tokens = [];
+      _ref2 = this.interpolateString(body, {
+        regex: true
+      });
+      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+        token = _ref2[_i];
+        tag = token[0], value = token[1];
+        if (tag === 'TOKENS') {
+          tokens.push.apply(tokens, value);
+        } else if (tag === 'NEOSTRING') {
+          if (!(value = value.replace(HEREGEX_OMIT, ''))) {
+            continue;
+          }
+          value = value.replace(/\\/g, '\\\\');
+          token[0] = 'STRING';
+          token[1] = this.makeString(value, '"', true);
+          tokens.push(token);
+        } else {
+          this.error("Unexpected " + tag);
+        }
+        prev = last(this.tokens);
+        plusToken = ['+', '+'];
+        plusToken[2] = prev[2];
+        tokens.push(plusToken);
+      }
+      tokens.pop();
+      if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') {
+        this.token('STRING', '""', 0, 0);
+        this.token('+', '+', 0, 0);
+      }
+      (_ref4 = this.tokens).push.apply(_ref4, tokens);
+      if (flags) {
+        flagsOffset = heregex.lastIndexOf(flags);
+        this.token(',', ',', flagsOffset, 0);
+        this.token('STRING', '"' + flags + '"', flagsOffset, flags.length);
+      }
+      this.token(')', ')', heregex.length - 1, 0);
+      return heregex.length;
+    };
+
+    Lexer.prototype.lineToken = function() {
+      var diff, indent, match, noNewlines, size;
+
+      if (!(match = MULTI_DENT.exec(this.chunk))) {
+        return 0;
+      }
+      indent = match[0];
+      this.seenFor = false;
+      size = indent.length - 1 - indent.lastIndexOf('\n');
+      noNewlines = this.unfinished();
+      if (size - this.indebt === this.indent) {
+        if (noNewlines) {
+          this.suppressNewlines();
+        } else {
+          this.newlineToken(0);
+        }
+        return indent.length;
+      }
+      if (size > this.indent) {
+        if (noNewlines) {
+          this.indebt = size - this.indent;
+          this.suppressNewlines();
+          return indent.length;
+        }
+        diff = size - this.indent + this.outdebt;
+        this.token('INDENT', diff, indent.length - size, size);
+        this.indents.push(diff);
+        this.ends.push('OUTDENT');
+        this.outdebt = this.indebt = 0;
+      } else {
+        this.indebt = 0;
+        this.outdentToken(this.indent - size, noNewlines, indent.length);
+      }
+      this.indent = size;
+      return indent.length;
+    };
+
+    Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) {
+      var dent, len;
+
+      while (moveOut > 0) {
+        len = this.indents.length - 1;
+        if (this.indents[len] === void 0) {
+          moveOut = 0;
+        } else if (this.indents[len] === this.outdebt) {
+          moveOut -= this.outdebt;
+          this.outdebt = 0;
+        } else if (this.indents[len] < this.outdebt) {
+          this.outdebt -= this.indents[len];
+          moveOut -= this.indents[len];
+        } else {
+          dent = this.indents.pop() + this.outdebt;
+          moveOut -= dent;
+          this.outdebt = 0;
+          this.pair('OUTDENT');
+          this.token('OUTDENT', dent, 0, outdentLength);
+        }
+      }
+      if (dent) {
+        this.outdebt -= moveOut;
+      }
+      while (this.value() === ';') {
+        this.tokens.pop();
+      }
+      if (!(this.tag() === 'TERMINATOR' || noNewlines)) {
+        this.token('TERMINATOR', '\n', outdentLength, 0);
+      }
+      return this;
+    };
+
+    Lexer.prototype.whitespaceToken = function() {
+      var match, nline, prev;
+
+      if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) {
+        return 0;
+      }
+      prev = last(this.tokens);
+      if (prev) {
+        prev[match ? 'spaced' : 'newLine'] = true;
+      }
+      if (match) {
+        return match[0].length;
+      } else {
+        return 0;
+      }
+    };
+
+    Lexer.prototype.newlineToken = function(offset) {
+      while (this.value() === ';') {
+        this.tokens.pop();
+      }
+      if (this.tag() !== 'TERMINATOR') {
+        this.token('TERMINATOR', '\n', offset, 0);
+      }
+      return this;
+    };
+
+    Lexer.prototype.suppressNewlines = function() {
+      if (this.value() === '\\') {
+        this.tokens.pop();
+      }
+      return this;
+    };
+
+    Lexer.prototype.literalToken = function() {
+      var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5;
+
+      if (match = OPERATOR.exec(this.chunk)) {
+        value = match[0];
+        if (CODE.test(value)) {
+          this.tagParameters();
+        }
+      } else {
+        value = this.chunk.charAt(0);
+      }
+      tag = value;
+      prev = last(this.tokens);
+      if (value === '=' && prev) {
+        if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) {
+          this.error("reserved word \"" + (this.value()) + "\" can't be assigned");
+        }
+        if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') {
+          prev[0] = 'COMPOUND_ASSIGN';
+          prev[1] += '=';
+          return value.length;
+        }
+      }
+      if (value === ';') {
+        this.seenFor = false;
+        tag = 'TERMINATOR';
+      } else if (__indexOf.call(MATH, value) >= 0) {
+        tag = 'MATH';
+      } else if (__indexOf.call(COMPARE, value) >= 0) {
+        tag = 'COMPARE';
+      } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) {
+        tag = 'COMPOUND_ASSIGN';
+      } else if (__indexOf.call(UNARY, value) >= 0) {
+        tag = 'UNARY';
+      } else if (__indexOf.call(SHIFT, value) >= 0) {
+        tag = 'SHIFT';
+      } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) {
+        tag = 'LOGIC';
+      } else if (prev && !prev.spaced) {
+        if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) {
+          if (prev[0] === '?') {
+            prev[0] = 'FUNC_EXIST';
+          }
+          tag = 'CALL_START';
+        } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) {
+          tag = 'INDEX_START';
+          switch (prev[0]) {
+            case '?':
+              prev[0] = 'INDEX_SOAK';
+          }
+        }
+      }
+      switch (value) {
+        case '(':
+        case '{':
+        case '[':
+          this.ends.push(INVERSES[value]);
+          break;
+        case ')':
+        case '}':
+        case ']':
+          this.pair(value);
+      }
+      this.token(tag, value);
+      return value.length;
+    };
+
+    Lexer.prototype.sanitizeHeredoc = function(doc, options) {
+      var attempt, herecomment, indent, match, _ref2;
+
+      indent = options.indent, herecomment = options.herecomment;
+      if (herecomment) {
+        if (HEREDOC_ILLEGAL.test(doc)) {
+          this.error("block comment cannot contain \"*/\", starting");
+        }
+        if (doc.indexOf('\n') < 0) {
+          return doc;
+        }
+      } else {
+        while (match = HEREDOC_INDENT.exec(doc)) {
+          attempt = match[1];
+          if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) {
+            indent = attempt;
+          }
+        }
+      }
+      if (indent) {
+        doc = doc.replace(RegExp("\\n" + indent, "g"), '\n');
+      }
+      if (!herecomment) {
+        doc = doc.replace(/^\n/, '');
+      }
+      return doc;
+    };
+
+    Lexer.prototype.tagParameters = function() {
+      var i, stack, tok, tokens;
+
+      if (this.tag() !== ')') {
+        return this;
+      }
+      stack = [];
+      tokens = this.tokens;
+      i = tokens.length;
+      tokens[--i][0] = 'PARAM_END';
+      while (tok = tokens[--i]) {
+        switch (tok[0]) {
+          case ')':
+            stack.push(tok);
+            break;
+          case '(':
+          case 'CALL_START':
+            if (stack.length) {
+              stack.pop();
+            } else if (tok[0] === '(') {
+              tok[0] = 'PARAM_START';
+              return this;
+            } else {
+              return this;
+            }
+        }
+      }
+      return this;
+    };
+
+    Lexer.prototype.closeIndentation = function() {
+      return this.outdentToken(this.indent);
+    };
+
+    Lexer.prototype.balancedString = function(str, end) {
+      var continueCount, i, letter, match, prev, stack, _i, _ref2;
+
+      continueCount = 0;
+      stack = [end];
+      for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) {
+        if (continueCount) {
+          --continueCount;
+          continue;
+        }
+        switch (letter = str.charAt(i)) {
+          case '\\':
+            ++continueCount;
+            continue;
+          case end:
+            stack.pop();
+            if (!stack.length) {
+              return str.slice(0, +i + 1 || 9e9);
+            }
+            end = stack[stack.length - 1];
+            continue;
+        }
+        if (end === '}' && (letter === '"' || letter === "'")) {
+          stack.push(end = letter);
+        } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) {
+          continueCount += match[0].length - 1;
+        } else if (end === '}' && letter === '{') {
+          stack.push(end = '}');
+        } else if (end === '"' && prev === '#' && letter === '{') {
+          stack.push(end = '}');
+        }
+        prev = letter;
+      }
+      return this.error("missing " + (stack.pop()) + ", starting");
+    };
+
+    Lexer.prototype.interpolateString = function(str, options) {
+      var column, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, rparen, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
+
+      if (options == null) {
+        options = {};
+      }
+      heredoc = options.heredoc, regex = options.regex, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength;
+      offsetInChunk = offsetInChunk || 0;
+      strOffset = strOffset || 0;
+      lexedLength = lexedLength || str.length;
+      if (heredoc && str.length > 0 && str[0] === '\n') {
+        str = str.slice(1);
+        strOffset++;
+      }
+      tokens = [];
+      pi = 0;
+      i = -1;
+      while (letter = str.charAt(i += 1)) {
+        if (letter === '\\') {
+          i += 1;
+          continue;
+        }
+        if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) {
+          continue;
+        }
+        if (pi < i) {
+          tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi));
+        }
+        inner = expr.slice(1, -1);
+        if (inner.length) {
+          _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 1), line = _ref2[0], column = _ref2[1];
+          nested = new Lexer().tokenize(inner, {
+            line: line,
+            column: column,
+            rewrite: false
+          });
+          popped = nested.pop();
+          if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') {
+            popped = nested.shift();
+          }
+          if (len = nested.length) {
+            if (len > 1) {
+              nested.unshift(this.makeToken('(', '(', strOffset + i + 1, 0));
+              nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0));
+            }
+            tokens.push(['TOKENS', nested]);
+          }
+        }
+        i += expr.length;
+        pi = i + 1;
+      }
+      if ((i > pi && pi < str.length)) {
+        tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi));
+      }
+      if (regex) {
+        return tokens;
+      }
+      if (!tokens.length) {
+        return this.token('STRING', '""', offsetInChunk, lexedLength);
+      }
+      if (tokens[0][0] !== 'NEOSTRING') {
+        tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk));
+      }
+      if (interpolated = tokens.length > 1) {
+        this.token('(', '(', offsetInChunk, 0);
+      }
+      for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) {
+        token = tokens[i];
+        tag = token[0], value = token[1];
+        if (i) {
+          if (i) {
+            plusToken = this.token('+', '+');
+          }
+          locationToken = tag === 'TOKENS' ? value[0] : token;
+          plusToken[2] = {
+            first_line: locationToken[2].first_line,
+            first_column: locationToken[2].first_column,
+            last_line: locationToken[2].first_line,
+            last_column: locationToken[2].first_column
+          };
+        }
+        if (tag === 'TOKENS') {
+          (_ref4 = this.tokens).push.apply(_ref4, value);
+        } else if (tag === 'NEOSTRING') {
+          token[0] = 'STRING';
+          token[1] = this.makeString(value, '"', heredoc);
+          this.tokens.push(token);
+        } else {
+          this.error("Unexpected " + tag);
+        }
+      }
+      if (interpolated) {
+        rparen = this.makeToken(')', ')', offsetInChunk + lexedLength, 0);
+        rparen.stringEnd = true;
+        this.tokens.push(rparen);
+      }
+      return tokens;
+    };
+
+    Lexer.prototype.pair = function(tag) {
+      var size, wanted;
+
+      if (tag !== (wanted = last(this.ends))) {
+        if ('OUTDENT' !== wanted) {
+          this.error("unmatched " + tag);
+        }
+        this.indent -= size = last(this.indents);
+        this.outdentToken(size, true);
+        return this.pair(tag);
+      }
+      return this.ends.pop();
+    };
+
+    Lexer.prototype.getLineAndColumnFromChunk = function(offset) {
+      var column, lineCount, lines, string;
+
+      if (offset === 0) {
+        return [this.chunkLine, this.chunkColumn];
+      }
+      if (offset >= this.chunk.length) {
+        string = this.chunk;
+      } else {
+        string = this.chunk.slice(0, +(offset - 1) + 1 || 9e9);
+      }
+      lineCount = count(string, '\n');
+      column = this.chunkColumn;
+      if (lineCount > 0) {
+        lines = string.split('\n');
+        column = (last(lines)).length;
+      } else {
+        column += string.length;
+      }
+      return [this.chunkLine + lineCount, column];
+    };
+
+    Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) {
+      var lastCharacter, locationData, token, _ref2, _ref3;
+
+      if (offsetInChunk == null) {
+        offsetInChunk = 0;
+      }
+      if (length == null) {
+        length = value.length;
+      }
+      locationData = {};
+      _ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = _ref2[0], locationData.first_column = _ref2[1];
+      lastCharacter = Math.max(0, length - 1);
+      _ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = _ref3[0], locationData.last_column = _ref3[1];
+      token = [tag, value, locationData];
+      return token;
+    };
+
+    Lexer.prototype.token = function(tag, value, offsetInChunk, length) {
+      var token;
+
+      token = this.makeToken(tag, value, offsetInChunk, length);
+      this.tokens.push(token);
+      return token;
+    };
+
+    Lexer.prototype.tag = function(index, tag) {
+      var tok;
+
+      return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]);
+    };
+
+    Lexer.prototype.value = function(index, val) {
+      var tok;
+
+      return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]);
+    };
+
+    Lexer.prototype.unfinished = function() {
+      var _ref2;
+
+      return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS');
+    };
+
+    Lexer.prototype.escapeLines = function(str, heredoc) {
+      return str.replace(MULTILINER, heredoc ? '\\n' : '');
+    };
+
+    Lexer.prototype.makeString = function(body, quote, heredoc) {
+      if (!body) {
+        return quote + quote;
+      }
+      body = body.replace(/\\([\s\S])/g, function(match, contents) {
+        if (contents === '\n' || contents === quote) {
+          return contents;
+        } else {
+          return match;
+        }
+      });
+      body = body.replace(RegExp("" + quote, "g"), '\\$&');
+      return quote + this.escapeLines(body, heredoc) + quote;
+    };
+
+    Lexer.prototype.error = function(message) {
+      return throwSyntaxError(message, {
+        first_line: this.chunkLine,
+        first_column: this.chunkColumn
+      });
+    };
+
+    return Lexer;
+
+  })();
+
+  JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super'];
+
+  COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when'];
+
+  COFFEE_ALIAS_MAP = {
+    and: '&&',
+    or: '||',
+    is: '==',
+    isnt: '!=',
+    not: '!',
+    yes: 'true',
+    no: 'false',
+    on: 'true',
+    off: 'false'
+  };
+
+  COFFEE_ALIASES = (function() {
+    var _results;
+
+    _results = [];
+    for (key in COFFEE_ALIAS_MAP) {
+      _results.push(key);
+    }
+    return _results;
+  })();
+
+  COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES);
+
+  RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield'];
+
+  STRICT_PROSCRIBED = ['arguments', 'eval'];
+
+  JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED);
+
+  exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED);
+
+  exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED;
+
+  BOM = 65279;
+
+  IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/;
+
+  NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;
+
+  HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/;
+
+  OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?(\.|::)|\.{2,3})/;
+
+  WHITESPACE = /^[^\n\S]+/;
+
+  COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)$)|^(?:\s*#(?!##[^#]).*)+/;
+
+  CODE = /^[-=]>/;
+
+  MULTI_DENT = /^(?:\n[^\n\S]*)+/;
+
+  SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/;
+
+  JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/;
+
+  REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/;
+
+  HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/;
+
+  HEREGEX_OMIT = /\s+(?:#.*)?/g;
+
+  MULTILINER = /\n/g;
+
+  HEREDOC_INDENT = /\n+([^\n\S]*)/g;
+
+  HEREDOC_ILLEGAL = /\*\//;
+
+  LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/;
+
+  TRAILING_SPACES = /\s+$/;
+
+  COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
+
+  UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO'];
+
+  LOGIC = ['&&', '||', '&', '|', '^'];
+
+  SHIFT = ['<<', '>>', '>>>'];
+
+  COMPARE = ['==', '!=', '<', '>', '<=', '>='];
+
+  MATH = ['*', '/', '%'];
+
+  RELATION = ['IN', 'OF', 'INSTANCEOF'];
+
+  BOOL = ['TRUE', 'FALSE'];
+
+  NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']'];
+
+  NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
+
+  CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
+
+  INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED');
+
+  LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
+
+}).call(this);


[28/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/config-parser.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/config-parser.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/config-parser.js
new file mode 100644
index 0000000..15d6281
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/config-parser.js
@@ -0,0 +1,669 @@
+/*
+ *  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.
+ */
+/*jshint sub:true*/
+var fs = require("fs"),
+    util = require('util'),
+    xml2js = require('xml2js'),
+    packagerUtils = require('./packager-utils'),
+    check = require('validator').check,
+    sanitize = require('validator').sanitize,
+    localize = require("./localize"),
+    logger = require("./logger"),
+    fileManager = require("./file-manager"),
+    utils = require("./packager-utils"),
+    i18nMgr = require("./i18n-manager"),
+    _self,
+    _predefinedFeatures,
+    _hybridFeatures;
+
+//This function will convert a wc3 paramObj with a list of
+//<param name="" value=""> elements into a single object
+function processParamObj(paramObj) {
+    var processedObj = {},
+        attribs,
+        paramName,
+        paramValue;
+
+    if (paramObj) {
+        //Convert to array for single param entries where only an object is created
+        if (!Array.isArray(paramObj)) {
+            paramObj = [paramObj];
+        }
+
+        paramObj.forEach(function (param) {
+            attribs = param["@"];
+
+            if (attribs) {
+                paramName = attribs["name"];
+                paramValue = attribs["value"];
+
+                if (paramName && paramValue) {
+                    //Add the key/value pair to the processedObj
+                    processedObj[paramName] = paramValue;
+                }
+            }
+        });
+    }
+
+    return processedObj;
+}
+
+function processFeatures(featuresArray, widgetConfig, processPredefinedFeatures) {
+    var features = [],
+        attribs;
+    if (featuresArray) {
+        featuresArray.forEach(function (feature) {
+            attribs = feature["@"];
+            if (attribs) {
+                attribs.required = packagerUtils.toBoolean(attribs.required, true);
+
+                // We do NOT want to auto defer networking and JavaScript if the
+                // blackberry.push feature is being used
+                if (attribs.id === "blackberry.push") {
+                    widgetConfig.autoDeferNetworkingAndJavaScript = false;
+                }
+
+                if (_predefinedFeatures[attribs.id]) {
+                    //Handle features that do NOT contain an API namespace
+                    if (processPredefinedFeatures) {
+                        _predefinedFeatures[attribs.id](feature, widgetConfig);
+                    }
+                } else {
+                    //Handle features that contain both a namespace and custom params
+                    if (_hybridFeatures[attribs.id]) {
+                        _hybridFeatures[attribs.id](feature, widgetConfig);
+                    }
+                    features.push(attribs);
+                }
+            } else {
+                features.push(attribs);
+            }
+        });
+    }
+
+    return features;
+}
+
+function createAccessListObj(uri, allowSubDomain) {
+    return {
+        uri: uri,
+        allowSubDomain: allowSubDomain
+    };
+}
+
+function processVersion(widgetConfig) {
+    if (widgetConfig.version) {
+        var versionArray = widgetConfig.version.split(".");
+
+        //if 4rth number in version exists, extract for build id
+        if (versionArray.length > 3) {
+            widgetConfig.buildId = versionArray[3];
+            widgetConfig.version = widgetConfig.version.substring(0, widgetConfig.version.lastIndexOf('.'));
+        }
+    }
+}
+
+function processBuildID(widgetConfig, session) {
+    if (session.buildId) {
+        //user specified a build id (--buildId), overide any previously set build id
+        widgetConfig.buildId = session.buildId;
+    }
+}
+
+function processWidgetData(data, widgetConfig, session) {
+    var attribs, featureArray, header;
+
+    if (data["@"]) {
+        widgetConfig.version = data["@"].version;
+        widgetConfig.id = data["@"].id;
+
+        if (data["@"]["rim:header"]) {
+            widgetConfig.customHeaders = {};
+            header = data["@"]["rim:header"].split(":");
+            // Just set it for now, in the future we can append them
+            widgetConfig.customHeaders[header[0]] = header[1];
+        }
+
+        if (data["@"]["rim:userAgent"]) {
+            widgetConfig.userAgent = data["@"]["rim:userAgent"];
+        }
+    }
+
+    //Default values
+    widgetConfig.hasMultiAccess = false;
+    widgetConfig.accessList = [];
+    widgetConfig.enableFlash = false;
+    widgetConfig.autoOrientation = true;
+    widgetConfig.autoDeferNetworkingAndJavaScript = true;
+    widgetConfig.theme = "default";
+
+    //set locally available features to access list
+   if (data.feature) {
+        featureArray = packagerUtils.isArray(data.feature) ? data.feature : [data.feature];
+    }
+
+    //Handle features that do not have source code
+    featureArray = processFeatures(featureArray, widgetConfig, true);
+
+    //Push empty WIDGET_LOCAL access obj until whitelisting is cleaned up
+    widgetConfig.accessList.push(createAccessListObj("WIDGET_LOCAL", true));
+
+    //add whitelisted features to access list
+    if (data.access) {
+        //If there is only one access list element, it will be parsed as an object and not an array
+        if (!packagerUtils.isArray(data.access)) {
+            data.access = [data.access];
+        }
+
+        data.access.forEach(function (accessElement) {
+            attribs = accessElement["@"];
+
+            if (attribs) {
+                if (attribs.uri === "*") {
+                    if (accessElement.feature) {
+                        throw localize.translate("EXCEPTION_FEATURE_DEFINED_WITH_WILDCARD_ACCESS_URI");
+                    }
+
+                    widgetConfig.hasMultiAccess = true;
+                } else {
+                    attribs.subdomains = packagerUtils.toBoolean(attribs.subdomains);
+                    widgetConfig.accessList.push(createAccessListObj(attribs.uri, attribs.subdomains));
+                }
+            }
+        });
+    }
+}
+
+function trim(obj) {
+    return (typeof obj === "string" ? obj.trim() : obj);
+}
+
+function processSplashScreenIconSrc(data, widgetConfig, key) {
+    if (data[key]) {
+        widgetConfig[key] = [];
+
+        if (!(data[key] instanceof Array)) {
+            data[key] = [data[key]];
+        }
+
+        data[key].forEach(function (obj) {
+            if (obj["@"]) {
+                widgetConfig[key].push(obj["@"].src);
+            } else {
+                widgetConfig[key].push(obj);
+            }
+        });
+    }
+}
+
+function processSplashScreenData(data, widgetConfig) {
+    //
+    // This takes config.xml markup in the form of:
+    //
+    // <rim:splash src="splash-1280x768.jpg" />
+    // <rim:splash src="splash-768x1280.jpg" />
+    // <rim:splash src="splash-1024x600.jpg" />
+    // <rim:splash src="splash-600x1024.jpg" />
+    //
+    // and turns it into:
+    //
+    // icon: ["splash-1280x768.jpg", "splash-768x1280.jpg", "splash-1024x600.jpg", "splash-600x1024.jpg"]
+    //
+    // Folder-based localization now done in i18n-manager
+    //
+    processSplashScreenIconSrc(data, widgetConfig, "rim:splash");
+}
+
+function processIconData(data, widgetConfig, session) {
+    //
+    // This takes config.xml markup in the form of:
+    //
+    // <icon src="icon-86.png" />
+    // <icon src="icon-150.png" />
+    //
+    // and turns it into:
+    //
+    // icon: ["icon-86.png", "icon-150.png"]
+    //
+    // Folder-based localization now done in i18n-manager
+    //
+    var default_icon_filename = "default-icon.png",
+        default_icon_src = session.conf.DEFAULT_ICON,
+        default_icon_dst = session.sourceDir;
+
+    processSplashScreenIconSrc(data, widgetConfig, "icon");
+
+    if (!widgetConfig.icon) {
+        packagerUtils.copyFile(default_icon_src, default_icon_dst);
+
+        widgetConfig["icon"] = [];
+        widgetConfig["icon"].push(default_icon_filename);
+    }
+}
+
+function validateSplashScreensIcon(widgetConfig, key) {
+    if (widgetConfig[key]) {
+        var msg = localize.translate(key === "icon" ? "EXCEPTION_INVALID_ICON_SRC" : "EXCEPTION_INVALID_SPLASH_SRC");
+
+        if (widgetConfig[key].length === 0) {
+            // element without src attribute
+            throw msg;
+        } else {
+            widgetConfig[key].forEach(function (src) {
+                var msg2 = localize.translate(key === "icon" ? "EXCEPTION_INVALID_ICON_SRC_LOCALES" : "EXCEPTION_INVALID_SPLASH_SRC_LOCALES");
+
+                // check that src attribute is specified and is not empty
+                check(src, msg).notNull();
+
+                // check that src attribute does not start with reserved locales folder
+                src = src.replace(/\\/g, "/");
+                check(src, msg2).notRegex("^" + i18nMgr.LOCALES_DIR + "\/");
+            });
+        }
+
+    }
+}
+
+function processAuthorData(data, widgetConfig) {
+    if (data.author) {
+        var attribs = data.author["@"];
+
+        if (!attribs && typeof data.author === "string") {
+            //do not sanitize empty objects {} (must be string)
+            widgetConfig.author = sanitize(data.author).trim();
+        } else if (data.author["#"]) {
+            widgetConfig.author = sanitize(data.author["#"]).trim();
+        }
+
+        if (attribs) {
+            widgetConfig.authorURL = attribs.href;
+            widgetConfig.copyright = attribs["rim:copyright"];
+            widgetConfig.authorEmail = attribs.email;
+        }
+    }
+}
+
+function processLicenseData(data, widgetConfig) {
+    if (data.license && data.license["#"]) {
+        widgetConfig.license = data.license["#"];
+    } else {
+        widgetConfig.license = "";
+    }
+
+    if (data.license && data.license["@"]) {
+        widgetConfig.licenseURL = data.license["@"].href;
+    } else {
+        widgetConfig.licenseURL = "";
+    }
+}
+
+function processContentData(data, widgetConfig) {
+    if (data.content) {
+        var attribs  = data.content["@"],
+            startPage;
+        if (attribs) {
+            widgetConfig.content = attribs.src;
+
+            startPage = packagerUtils.parseUri(attribs.src);
+
+            // if start page is local but does not start with local:///, will prepend it
+            // replace any backslash with forward slash
+            if (!packagerUtils.isAbsoluteURI(startPage) && !packagerUtils.isLocalURI(startPage)) {
+                if (!startPage.relative.match(/^\//)) {
+                    widgetConfig.content = "local:///" + startPage.relative.replace(/\\/g, "/");
+                } else {
+                    widgetConfig.content = "local://" + startPage.relative.replace(/\\/g, "/");
+                }
+            }
+
+            widgetConfig.foregroundSource = attribs.src;
+            widgetConfig.contentType = attribs.type;
+            widgetConfig.contentCharSet = attribs.charset;
+            widgetConfig.allowInvokeParams = attribs["rim:allowInvokeParams"];
+            //TODO content rim:background
+        }
+    }
+}
+
+function processPermissionsData(data, widgetConfig) {
+    if (data["rim:permissions"] && data["rim:permissions"]["rim:permit"]) {
+        var permissions = data["rim:permissions"]["rim:permit"];
+
+        if (permissions instanceof Array) {
+            widgetConfig.permissions = permissions;
+        } else {
+            //user entered one permission and it comes in as an object
+            widgetConfig.permissions = [permissions];
+        }
+    } else {
+        widgetConfig.permissions = [];
+    }
+
+    // We do NOT want to auto defer networking and JavaScript if the
+    // run_when_backgrounded permission is set
+    if (widgetConfig.permissions.indexOf("run_when_backgrounded") >= 0) {
+        widgetConfig.autoDeferNetworkingAndJavaScript = false;
+    }
+}
+
+function processInvokeTargetsData(data, widgetConfig) {
+
+    if (data["rim:invoke-target"]) {
+        widgetConfig["invoke-target"] = data["rim:invoke-target"];
+
+        //If invoke-target is not an array, wrap the invoke-target in an array
+        utils.wrapPropertyInArray(widgetConfig, "invoke-target");
+
+        widgetConfig["invoke-target"].forEach(function (invokeTarget) {
+            if (invokeTarget.type && !packagerUtils.isEmpty(invokeTarget.type)) {
+                invokeTarget.type = invokeTarget.type.toUpperCase();
+            }
+
+            if (invokeTarget.filter) {
+                utils.wrapPropertyInArray(invokeTarget, "filter");
+
+                invokeTarget.filter.forEach(function (filter) {
+
+                    if (filter["action"]) {
+                        utils.wrapPropertyInArray(filter, "action");
+                    }
+
+                    if (filter["mime-type"]) {
+                        utils.wrapPropertyInArray(filter, "mime-type");
+                    }
+
+                    if (filter["property"]) {
+                        utils.wrapPropertyInArray(filter, "property");
+                    }
+                });
+            }
+        });
+    }
+}
+
+function validateConfig(widgetConfig) {
+    check(widgetConfig.version, localize.translate("EXCEPTION_INVALID_VERSION"))
+        .notNull()
+        .regex("^[0-9]{1,3}([.][0-9]{1,3}){2,3}$");
+
+    for (var prop in widgetConfig.name) {
+        if (widgetConfig.name.hasOwnProperty(prop)) {
+            check(widgetConfig.name[prop], localize.translate("EXCEPTION_INVALID_NAME")).notEmpty();
+        }
+    }
+
+    check(widgetConfig.author, localize.translate("EXCEPTION_INVALID_AUTHOR")).notNull();
+    check(widgetConfig.id, localize.translate("EXCEPTION_INVALID_ID")).notNull().notEmpty();
+    check(widgetConfig.content, localize.translate("EXCEPTION_INVALID_CONTENT"))
+        .notNull()
+        .notEmpty();
+
+    validateSplashScreensIcon(widgetConfig, "rim:splash");
+
+    validateSplashScreensIcon(widgetConfig, "icon");
+
+    if (widgetConfig.accessList) {
+        widgetConfig.accessList.forEach(function (access) {
+            if (access.uri) {
+                if (access.uri !== "WIDGET_LOCAL") {
+                    check(access.uri, localize.translate("EXCEPTION_INVALID_ACCESS_URI_NO_PROTOCOL", access.uri))
+                        .regex("^[a-zA-Z]+:\/\/");
+                    check(access.uri, localize.translate("EXCEPTION_INVALID_ACCESS_URI_NO_URN", access.uri))
+                        .notRegex("^[a-zA-Z]+:\/\/$");
+                }
+            }
+
+            if (access.features) {
+                // Assert each feature has a proper ID and is not empty
+                access.features.forEach(function (feature) {
+                    if (!feature) {
+                        throw localize.translate("EXCEPTION_INVALID_FEATURE_ID");
+                    }
+                    check(feature.id, localize.translate("EXCEPTION_INVALID_FEATURE_ID")).notNull().notEmpty();
+                });
+            }
+
+        });
+    }
+
+    if (widgetConfig["invoke-target"]) {
+
+        widgetConfig["invoke-target"].forEach(function (invokeTarget) {
+
+            check(typeof invokeTarget["@"] === "undefined",
+                    localize.translate("EXCEPTION_INVOKE_TARGET_INVALID_ID"))
+                .equals(false);
+            check(invokeTarget["@"].id, localize.translate("EXCEPTION_INVOKE_TARGET_INVALID_ID"))
+                .notNull()
+                .notEmpty();
+            check(invokeTarget.type, localize.translate("EXCEPTION_INVOKE_TARGET_INVALID_TYPE"))
+                .notNull()
+                .notEmpty();
+
+            if (invokeTarget.filter) {
+
+                invokeTarget.filter.forEach(function (filter) {
+
+                    check(filter["action"] && filter["action"] instanceof Array && filter["action"].length > 0,
+                            localize.translate("EXCEPTION_INVOKE_TARGET_ACTION_INVALID"))
+                        .equals(true);
+
+                    check(filter["mime-type"] && filter["mime-type"] instanceof Array && filter["mime-type"].length > 0,
+                            localize.translate("EXCEPTION_INVOKE_TARGET_MIME_TYPE_INVALID"))
+                        .equals(true);
+
+                    if (filter.property) {
+                        filter.property.forEach(function (property) {
+                            check(property["@"] && property["@"]["var"] && typeof property["@"]["var"] === "string",
+                                    localize.translate("EXCEPTION_INVOKE_TARGET_FILTER_PROPERTY_INVALID"))
+                                .equals(true);
+                        });
+                    }
+                });
+            }
+        });
+    }
+}
+
+function processLocalizedText(tag, data, widgetConfig) {
+    var tagData = data[tag],
+        DEFAULT = 'default';
+
+    function processLanguage(tagElement) {
+        var attribs = tagElement['@'],
+            language;
+
+        if (attribs) {
+            language = attribs['xml:lang'] || DEFAULT;
+            widgetConfig[tag][language.toLowerCase()] = tagElement['#'];
+        } else {
+            widgetConfig[tag][DEFAULT] = tagElement;
+        }
+    }
+
+    if (Array.isArray(tagData)) {
+        //i.e. <element xml:lang="en">english value</element>
+        //     <element xml:lang="fr">french value</element>
+        tagData.forEach(processLanguage);
+    } else if (tagData instanceof Object) {
+        //i.e. <element xml:lang="en">english value</element>
+        processLanguage(tagData);
+    } else {
+        //i.e <element>value</element>
+        widgetConfig[tag][DEFAULT] = tagData;
+    }
+}
+
+function processNameAndDescription(data, widgetConfig) {
+    widgetConfig.name = {};
+    widgetConfig.description = {};
+
+    processLocalizedText('name', data, widgetConfig);
+    processLocalizedText('description', data, widgetConfig);
+}
+
+function processCordovaPreferences(data, widgetConfig) {
+    if (data.preference) {
+        var preference = processParamObj(data.preference);
+        widgetConfig.packageCordovaJs = preference.packageCordovaJs === "enable";
+        widgetConfig.autoHideSplashScreen = preference.AutoHideSplashScreen !== "false";
+    }
+}
+
+function processResult(data, session) {
+    var widgetConfig = {};
+
+    processWidgetData(data, widgetConfig, session);
+    processIconData(data, widgetConfig, session);
+    processAuthorData(data, widgetConfig);
+    processLicenseData(data, widgetConfig);
+    processContentData(data, widgetConfig);
+    processPermissionsData(data, widgetConfig);
+    processInvokeTargetsData(data, widgetConfig);
+    processSplashScreenData(data, widgetConfig);
+    processNameAndDescription(data, widgetConfig);
+    processCordovaPreferences(data, widgetConfig);
+
+    widgetConfig.configXML = "config.xml";
+
+    //validate the widgetConfig
+    validateConfig(widgetConfig);
+
+    //special handling for version and grabbing the buildId if specified (4rth number)
+    processVersion(widgetConfig);
+
+    //if --buildId was specified, it takes precedence
+    processBuildID(widgetConfig, session);
+
+    return widgetConfig;
+}
+
+function init() {
+    //Predefined features are features that do NOT contain an API namespace
+    _predefinedFeatures = {
+        "enable-flash" : function (feature, widgetConfig) {
+            widgetConfig.enableFlash = true;
+        },
+        "blackberry.app.orientation": function (feature, widgetConfig) {
+            if (feature) {
+                var params = processParamObj(feature.param),
+                    mode = params.mode;
+
+                if (!mode) {
+                    //No mode provided, throw error
+                    throw localize.translate("EXCEPTION_EMPTY_ORIENTATION_MODE", mode);
+                } else if (mode === "landscape" || mode === "portrait" || mode === "north") {
+                    widgetConfig.autoOrientation = false;//Overwrites default value
+                    widgetConfig.orientation = mode;
+                } else if (mode !== "auto") {
+                    //Mode invalid, throw error
+                    throw localize.translate("EXCEPTION_INVALID_ORIENTATION_MODE", mode);
+                }
+
+                // Throw a warning since this feature is deprecated
+                logger.warn(localize.translate("WARNING_ORIENTATION_DEPRECATED"));
+            }
+        }
+    };
+
+    //Hybrid features are features that have both an API namespace and custom parameters
+    _hybridFeatures = {
+        "blackberry.app": function (feature, widgetConfig) {
+            if (feature) {
+                var params = processParamObj(feature.param),
+                    bgColor = params.backgroundColor,
+                    childBrowser = params.childBrowser,
+                    formControl = params.formControl,
+                    orientation = params.orientation,
+                    theme = params.theme,
+                    popupBlocker = params.popupBlocker,
+                    websecurity = params.websecurity;
+
+                if (bgColor) {
+                    //Convert bgColor to a number
+                    bgColor = parseInt(bgColor, 16);
+
+                    if (isNaN(bgColor)) {
+                        //bgcolor is not a number, throw error
+                        throw localize.translate("EXCEPTION_BGCOLOR_INVALID", params.backgroundColor);
+                    } else {
+                        widgetConfig.backgroundColor = bgColor;
+                    }
+                }
+
+                if (childBrowser) {
+                    widgetConfig.enableChildWebView = ((childBrowser + '').toLowerCase() === 'disable') === false;
+                }
+
+                if (formControl) {
+                    widgetConfig.enableFormControl = ((formControl + '').toLowerCase() === 'disable') === false;
+                }
+
+                if (popupBlocker) {
+                    widgetConfig.enablePopupBlocker = ((popupBlocker + '').toLowerCase() === 'enable') === true;
+                }
+
+                if (orientation) {
+                    if (orientation ===  "landscape" || orientation === "portrait" || orientation === "north") {
+                        widgetConfig.autoOrientation = false;
+                        widgetConfig.orientation = orientation;
+                    } else if (orientation !== "auto") {
+                        throw localize.translate("EXCEPTION_INVALID_ORIENTATION_MODE", orientation);
+                    }
+                }
+
+                if (theme && (typeof theme === "string")) {
+                    theme = theme.toLowerCase();
+
+                    if (theme ===  "bright" || theme === "dark" || theme === "inherit" || theme ===  "default") {
+                        widgetConfig.theme = theme;
+                    }
+                }
+
+                if (websecurity && (typeof websecurity === "string") && (websecurity.toLowerCase() === "disable")) {
+                    widgetConfig.enableWebSecurity = false;
+                    logger.warn(localize.translate("WARNING_WEBSECURITY_DISABLED"));
+                }
+            }
+        }
+    };
+}
+
+_self = {
+    parse: function (xmlPath, session, callback) {
+        if (!fs.existsSync(xmlPath)) {
+            throw localize.translate("EXCEPTION_CONFIG_NOT_FOUND");
+        }
+
+        var fileData = fs.readFileSync(xmlPath),
+            xml = utils.bufferToString(fileData),
+            parser = new xml2js.Parser({trim: true, normalize: true, explicitRoot: false});
+
+        init();
+
+        //parse xml file data
+        parser.parseString(xml, function (err, result) {
+            if (err) {
+                logger.error(localize.translate("EXCEPTION_PARSING_XML"));
+                fileManager.cleanSource(session);
+            } else {
+                callback(processResult(result, session));
+            }
+        });
+    }
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/debugtoken-helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/debugtoken-helper.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/debugtoken-helper.js
new file mode 100755
index 0000000..8a936b1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/debugtoken-helper.js
@@ -0,0 +1,211 @@
+/*
+ *  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.
+ */
+
+var childProcess = require("child_process"),
+    fs = require("fs"),
+    path = require("path"),
+    conf = require("./conf"),
+    localize = require("./localize"),
+    logger = require("./logger"),
+    pkgrUtils = require("./packager-utils"),
+    workingDir = path.normalize(__dirname + "/.."),
+    debugTokenDir = path.normalize(workingDir + "/" + "debugtoken.bar"),
+    properties,
+    targets,
+    deployCallback,
+    self = {};
+
+function generateCreateTokenOptions(pins, password) {
+    var options = [],
+        i;
+
+    options.push("-storepass");
+    options.push(password);
+
+    for (i = 0; i < pins.length; i++) {
+        options.push("-devicepin");
+        options.push(pins[i]);
+    }
+
+    options.push(debugTokenDir);
+
+    return options;
+}
+
+function generateDeployTokenOptions(target) {
+    var options = [];
+
+    options.push("-installDebugToken");
+    options.push(debugTokenDir);
+
+    options.push("-device");
+    options.push(properties.targets[target].ip);
+
+    options.push("-password");
+    options.push(properties.targets[target].password);
+
+    return options;
+}
+
+function execNativeScript(script, options, callback) {
+    var process;
+
+    if (pkgrUtils.isWindows()) {
+        script += ".bat";
+    }
+
+    if (fs.existsSync(conf.DEPENDENCIES_TOOLS)) {
+        process = childProcess.spawn(path.normalize(conf.DEPENDENCIES_TOOLS + script), options, {
+            "cwd" : workingDir,
+            "env" : process ? process.env : undefined
+        });
+
+        process.stdout.on("data", pkgrUtils.handleProcessOutput);
+
+        process.stderr.on("data", pkgrUtils.handleProcessOutput);
+
+        process.on("exit", function (code) {
+            if (callback && typeof callback === "function") {
+                callback(code);
+            }
+        });
+    } else {
+        throw localize.translate("EXCEPTION_MISSING_TOOLS");
+    }
+}
+
+function checkTarget(target) {
+    if (!properties.targets[target]) {
+        logger.warn(localize.translate("WARN_TARGET_NOT_EXIST", target));
+        return false;
+    }
+
+    if (!properties.targets[target].ip) {
+        logger.warn(localize.translate("WARN_IP_NOT_DEFINED", target));
+        return false;
+    }
+
+    if (!properties.targets[target].password) {
+        logger.warn(localize.translate("WARN_PASSWORD_NOT_DEFINED", target));
+        return false;
+    }
+
+    return true;
+
+}
+
+// Deploy the debug token for each target in targets array recursively
+function deployTokenToTargetsRecursively() {
+    var target;
+
+    if (targets.length > 0) {
+        target = targets.pop();
+
+        logger.info(localize.translate("PROGRESS_DEPLOYING_DEBUG_TOKEN", target));
+        if (checkTarget(target)) {
+            execNativeScript("/bin/blackberry-deploy",
+                generateDeployTokenOptions(target),
+                deployTokenToTargetsRecursively
+            );
+        } else {
+            deployTokenToTargetsRecursively();
+        }
+    } else {
+        if (deployCallback && typeof deployCallback === "function") {
+            deployCallback();
+        }
+    }
+}
+
+self.createToken = function (projectProperties, target, callback) {
+    var pins = [],
+        key;
+
+    // Store the global variable "properties"
+    properties = projectProperties;
+
+    // Gather PINs information from properties
+    if (target === "all") {
+        for (key in properties.targets) {
+            if (properties.targets.hasOwnProperty(key) && properties.targets[key].pin) {
+                pins.push(properties.targets[key].pin);
+            }
+        }
+    } else {
+        if (!target) {
+            target = properties.defaultTarget;
+        }
+
+        if (properties.targets.hasOwnProperty(target) && properties.targets[target].pin) {
+            pins.push(properties.targets[target].pin);
+        }
+    }
+
+    if (pins.length === 0) {
+        logger.warn(localize.translate("WARN_NO_DEVICE_PIN_FOUND"));
+        if (callback && typeof callback === "function") {
+            callback(-1);
+        }
+    } else if (!properties.keystorepass) {
+        logger.warn(localize.translate("WARN_NO_SIGNING_PASSWORD_PROVIDED"));
+        if (callback && typeof callback === "function") {
+            callback(-1);
+        }
+    } else {
+        logger.info(localize.translate("PROGRESS_GENERATING_DEBUG_TOKEN"));
+        // Call "blackberry-debugtokenrequest" to generate debug token
+        execNativeScript("/bin/blackberry-debugtokenrequest",
+            generateCreateTokenOptions(pins, properties.keystorepass),
+            callback
+        );
+    }
+};
+
+self.deployToken = function (projectProperties, target, callback) {
+    var key;
+
+    // Store the global variable "properties"
+    properties = projectProperties;
+
+    // Initialize the global variable "targets"
+    targets = [];
+
+    // Store callback so it will be invoked after debug token is deployed to all target(s)
+    deployCallback = callback;
+
+    // Gather targets information from properties
+    // Gather PINs information from properties
+    if (target === "all") {
+        for (key in properties.targets) {
+            if (properties.targets.hasOwnProperty(key) && properties.targets[key].pin) {
+                targets.push(key);
+            }
+        }
+    } else {
+        if (!target) {
+            target = properties.defaultTarget;
+        }
+
+        if (properties.targets.hasOwnProperty(target) && properties.targets[target].pin) {
+            targets.push(target);
+        }
+    }
+
+    // Deploy debug token recursively
+    deployTokenToTargetsRecursively();
+};
+
+module.exports = self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/file-manager.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/file-manager.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/file-manager.js
new file mode 100755
index 0000000..3f9e92b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/file-manager.js
@@ -0,0 +1,311 @@
+/*
+ *  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.
+ */
+
+var path = require("path"),
+    util = require("util"),
+    packagerUtils = require("./packager-utils"),
+    fs = require("fs"),
+    conf = require("./conf"),
+    BBWPignore = require('./bbwpignore'),
+    wrench = require("wrench"),
+    zip = require("zip"),
+    localize = require("./localize"),
+    logger = require("./logger"),
+    CLIENT_JS = "client.js",
+    SERVER_JS = "index.js",
+    VALID_EXTENSIONS = [".js", ".json"],
+    CORDOVA_JS_REGEX = /(cordova-.+js)|cordova\.js/;
+
+function unzip(from, to) {
+    var data, entries, p, parent;
+
+    if (fs.existsSync(from)) {
+        data = fs.readFileSync(from);
+        entries = zip.Reader(data).toObject();
+
+        if (!fs.existsSync(to)) {
+            wrench.mkdirSyncRecursive(to, "0755");
+        }
+
+        for (p in entries) {
+            if (p.indexOf("__MACOSX") >= 0) {
+                continue;
+            }
+
+            if (p.split("/").length > 1) {
+                parent = p.split("/").slice(0, -1).join("/");
+                wrench.mkdirSyncRecursive(to + "/" + parent, "0755");
+            }
+
+            fs.writeFileSync(to + "/" + p, entries[p]);
+        }
+    } else {
+        throw localize.translate("EXCEPTION_WIDGET_ARCHIVE_NOT_FOUND", from);
+    }
+}
+
+function copyDirContents(from, to) {
+    var files = wrench.readdirSyncRecursive(from),
+        bbwpignore,
+        bbwpignoreFile = path.join(from, conf.BBWP_IGNORE_FILENAME),
+        toBeIgnored = [];
+
+    if (fs.existsSync(bbwpignoreFile)) {
+        bbwpignore = new BBWPignore(bbwpignoreFile, files);
+
+        bbwpignore.matchedFiles.forEach(function (i) {
+            toBeIgnored.push(from + "/" + i);
+        });
+        toBeIgnored.push(from + "/" + conf.BBWP_IGNORE_FILENAME); //add the .bbwpignore file to the ignore list
+    }
+    wrench.copyDirSyncRecursive(from, to, {preserve: true}, function (file) {
+        return toBeIgnored.indexOf(file) === -1;
+    });
+}
+
+function prepare(session) {
+    var conf = session.conf,
+        dest = session.sourcePaths;
+
+    if (fs.existsSync(session.sourceDir)) {
+        wrench.rmdirSyncRecursive(session.sourceDir);
+    }
+
+    if (!fs.existsSync(dest.CHROME)) {
+        wrench.mkdirSyncRecursive(dest.CHROME, "0755");
+    }
+
+    // copy bootstrap as well as ui.html file
+    wrench.copyDirSyncRecursive(conf.DEPENDENCIES_BOOTSTRAP, dest.CHROME);
+
+    if (!fs.existsSync(dest.LIB)) {
+        wrench.mkdirSyncRecursive(dest.LIB, "0755");
+    }
+
+    // copy framework
+    wrench.copyDirSyncRecursive(conf.LIB, dest.LIB);
+
+    // Copy the ui-resources if they exist
+    if (fs.existsSync(conf.UI)) {
+        if (!fs.existsSync(dest.UI)) {
+            wrench.mkdirSyncRecursive(dest.UI, "0755");
+        }
+        wrench.copyDirSyncRecursive(conf.UI, dest.UI);
+    }
+
+    // unzip archive
+    if (fs.existsSync(session.archivePath)) {
+        if (session.archivePath.toLowerCase().match("[.]zip$")) {
+            unzip(session.archivePath, session.sourceDir);
+        } else {
+            copyDirContents(session.archivePath, session.sourceDir);
+        }
+    } else {
+        throw localize.translate("EXCEPTION_INVALID_ARCHIVE_PATH", session.archivePath);
+    }
+}
+
+
+function getModulesArray(dest, files, baseDir) {
+    var modulesList = [],
+        EXCLUDE_FILES = ["client.js", "manifest.json"];
+
+    function isExcluded(file) {
+        return EXCLUDE_FILES.some(function (element) {
+            return path.basename(file) === element;
+        });
+    }
+
+    files.forEach(function (file) {
+        file = path.resolve(baseDir, file);
+
+        if (!fs.statSync(file).isDirectory()) {
+            if (baseDir !== dest.EXT || !isExcluded(file)) {
+                modulesList.push({name: path.relative(path.normalize(dest.CHROME), file).replace(/\\/g, "/"), file: file});
+            }
+        }
+    });
+
+    return modulesList;
+}
+
+function generateFrameworkModulesJS(session) {
+    var dest = session.sourcePaths,
+        modulesList = [],
+        modulesStr = "(function () { ",
+        frameworkModulesStr = "window.frameworkModules = [",
+        libFiles = wrench.readdirSyncRecursive(dest.LIB),
+        extFiles,
+        extModules;
+
+    modulesList = modulesList.concat(getModulesArray(dest, libFiles, dest.LIB));
+
+    if (fs.existsSync(dest.EXT)) {
+        extFiles = wrench.readdirSyncRecursive(dest.EXT);
+        extModules = getModulesArray(dest, extFiles, dest.EXT);
+        modulesList = modulesList.concat(extModules);
+    }
+
+    modulesList.forEach(function (module, index) {
+        modulesStr += "define('" + module.name + "', function (require, exports, module) {\n" +
+                      fs.readFileSync(module.file, "utf-8") + "\n" +
+                      "});\n";
+        frameworkModulesStr += "'" + module.name + "'" +  (index !== modulesList.length-1 ? ", " : "");
+    });
+
+    modulesStr += "}());";
+    frameworkModulesStr += "];\n";
+    fs.writeFileSync(path.normalize(dest.CHROME + "/frameworkModules.js"), frameworkModulesStr + modulesStr);
+}
+
+function copyWWE(session, target) {
+    var src = path.normalize(session.conf.DEPENDENCIES_BOOTSTRAP + "/wwe"),
+        dest = path.normalize(session.sourceDir);
+
+    packagerUtils.copyFile(src, dest);
+}
+
+function copyWebplatform(session, target) {
+
+    var wpSrc = path.normalize(session.conf.ROOT + "/webplatform.js"),
+        dest = path.normalize(session.sourceDir),
+        i18nSrc = path.normalize(session.conf.ROOT + "/i18n.js");
+
+    if (fs.existsSync(wpSrc)) {
+        logger.warn(localize.translate("WARN_WEBPLATFORM_JS_PACKAGED"));
+        packagerUtils.copyFile(wpSrc, dest);
+    }
+    if (fs.existsSync(i18nSrc)) {
+        logger.warn(localize.translate("WARN_WEBPLATFORM_I18N_PACKAGED"));
+        packagerUtils.copyFile(i18nSrc, dest);
+    }
+}
+
+function copyWebworks(session) {
+    var srcPath = path.normalize(session.conf.PROJECT_ROOT + "/lib"),
+        dest = path.normalize(session.sourceDir + "/chrome"),
+        srcFiles;
+
+    srcFiles = packagerUtils.listFiles(srcPath, function (file) {
+        return CORDOVA_JS_REGEX.test(file);
+    });
+
+    if (srcFiles.length === 1) {
+        packagerUtils.copyFile(srcFiles[0], dest);
+
+        //Rename file to webworks.js
+        fs.renameSync(path.join(dest, path.basename(srcFiles[0])), path.join(dest, "cordova.js"));
+    } else {
+        throw localize.translate("EXCEPTION_CORDOVA_JS_IN_LIB_DIR", srcFiles.length);
+    }
+}
+
+
+function copyJnextDependencies(session) {
+    var conf = session.conf,
+        dest = path.normalize(session.sourcePaths.JNEXT_PLUGINS),
+        data = "local:/// *\nfile:// *\nhttp:// *";
+
+    if (!fs.existsSync(dest)) {
+        wrench.mkdirSyncRecursive(dest, "0755");
+    }
+
+    //write auth.txt jnext file
+    fs.writeFileSync(path.join(dest, "auth.txt"), data);
+}
+
+function hasValidExtension(file) {
+    return VALID_EXTENSIONS.some(function (element, index, array) {
+        return path.extname(file) === element;
+    });
+}
+
+function copyExtension(session, target, pluginPath) {
+    var basename = path.basename(pluginPath),
+        extDest = session.sourcePaths.EXT,
+        soDest = session.sourcePaths.JNEXT_PLUGINS,
+        soPath = path.normalize(path.join(pluginPath, "native", target)),
+        jsFiles,
+        soFiles;
+
+    if (fs.existsSync(pluginPath) && fs.statSync(pluginPath).isDirectory()) {
+        //create output folders
+        wrench.mkdirSyncRecursive(path.join(extDest, basename), "0755");
+        wrench.mkdirSyncRecursive(soDest, "0755");
+
+        //find all .js and .json files
+        jsFiles = packagerUtils.listFiles(pluginPath, function (file) {
+            return hasValidExtension(file);
+        });
+
+        //Copy each .js file to its extensions folder
+        jsFiles.forEach(function (jsFile) {
+            packagerUtils.copyFile(jsFile, path.join(extDest, basename), pluginPath);
+        });
+
+        if (fs.existsSync(soPath)) {
+            //find all .so files
+            soFiles = packagerUtils.listFiles(soPath, function (file) {
+                return path.extname(file) === ".so";
+            });
+
+            //Copy each .so file to the extensions folder
+            soFiles.forEach(function (soFile) {
+                packagerUtils.copyFile(soFile, soDest);
+            });
+        }
+    }
+}
+
+function copyExtensions(session, target) {
+    var pluginDir = session.conf.EXT;
+
+    if (fs.existsSync(pluginDir)) {
+        // just read the top-level dirs under "plugin"
+        fs.readdirSync(pluginDir).forEach(function (plugin) {
+            copyExtension(session, target, path.join(pluginDir, plugin));
+        });
+
+    }
+
+
+}
+
+module.exports = {
+    unzip: unzip,
+
+    copyWWE: copyWWE,
+
+    copyWebplatform: copyWebplatform,
+
+    copyWebworks : copyWebworks,
+
+    copyJnextDependencies: copyJnextDependencies,
+
+    prepareOutputFiles: prepare,
+
+    copyExtensions: copyExtensions,
+
+    generateFrameworkModulesJS: generateFrameworkModulesJS,
+
+    cleanSource: function (session) {
+        if (!session.keepSource) {
+            wrench.rmdirSyncRecursive(session.sourceDir);
+        }
+    },
+
+    copyDirContents: copyDirContents
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/i18n-manager.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/i18n-manager.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/i18n-manager.js
new file mode 100644
index 0000000..3aa1645
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/i18n-manager.js
@@ -0,0 +1,146 @@
+/*
+ *  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.
+ */
+/*jshint sub:true*/
+var path = require("path"),
+    fs = require("fs"),
+    wrench = require("wrench"),
+    pkgrUtils = require("./packager-utils"),
+    LOCALES_DIR = "locales";
+
+// Given a list of locale files (as follows), based on un-localized splash/icon definition, generate
+// localized splash/icon metadata.
+//
+// zh-hans-cn/a.gif
+// zh-hans-cn/f.gif
+// zh-hans-cn/images/splash-1024x600.png
+// zh-hans-cn/images/splash-600x1024.png
+// zh-hans/a.gif
+// zh-hans/b.gif
+// zh/a.gif
+// zh/b.gif
+// zh/c.gif
+function generateLocalizedMetadataForSplashScreenIcon(config, configKey, xmlObject, xmlObjectKey, localeFiles) {
+    // localeMap looks like this:
+    // {
+    //     "zh-hans-cn": ["a.gif", "f.gif", "images/splash-1024x600.png", "images/splash-600x1024.png"],
+    //     "zh-hans": ["a.gif", "b.gif"],
+    //     "zh": ["a.gif", "b.gif", "c.gif"]
+    // }
+    var localeMap = {};
+
+    if (localeFiles) {
+        localeFiles.forEach(function (path) {
+            var splitted = path.replace(/\.\./g, "").split("/"),
+                locale;
+
+            splitted = splitted.filter(function (element) {
+                return element.length > 0;
+            });
+
+            if (splitted.length > 1) {
+                locale = splitted[0];
+
+                if (!localeMap[locale]) {
+                    localeMap[locale] = [];
+                }
+
+                // remove locale subfolder from path
+                splitted.splice(0, 1);
+                localeMap[locale].push(splitted.join("/"));
+            }
+        });
+    }
+
+    xmlObject[xmlObjectKey] = {};
+    xmlObject[xmlObjectKey]["image"] = [];
+
+    if (config[configKey]) {
+        config[configKey].forEach(function (imgPath) {
+            imgPath = imgPath.replace(/\\/g, "/"); // replace any backslash with forward slash
+
+            Object.getOwnPropertyNames(localeMap).forEach(function (locale) {
+                if (localeMap[locale].indexOf(imgPath) !== -1) {
+                    // localized image found for locale
+                    xmlObject[xmlObjectKey]["image"].push({
+                        text: {
+                            _attr: {
+                                "xml:lang": locale
+                            },
+                            _value: LOCALES_DIR + "/" + locale + "/" + imgPath
+                        }
+                    });
+                }
+            });
+
+            xmlObject[xmlObjectKey]["image"].push({
+                _value: imgPath
+            });
+        });
+    }
+}
+
+function generateLocalizedText(session, config, xmlObject, key) {
+    var localizedText = config[key],
+        textElements = [],
+        locale;
+
+    for (locale in localizedText) {
+        if (localizedText.hasOwnProperty(locale)) {
+            //Don't add default locale and don't add locale if it already exists
+            if (locale !== 'default' && textElements && textElements.indexOf(locale) === -1) {
+                textElements.push({
+                    _attr: {
+                        "xml:lang": locale
+                    },
+                    _value: localizedText[locale]
+                });
+            }
+        }
+    }
+
+    xmlObject[key] = {
+        _value: localizedText['default'],
+        text: textElements
+    };
+}
+
+function generateLocalizedMetadata(session, config, xmlObject, key) {
+    if (config.icon || config["rim:splash"]) {
+        var localeFiles,
+            normalizedLocaleFiles = [];
+
+        if (fs.existsSync(session.sourceDir + "/" + LOCALES_DIR)) {
+            localeFiles = wrench.readdirSyncRecursive(session.sourceDir + "/" + LOCALES_DIR);
+            if (pkgrUtils.isWindows()) {
+
+                localeFiles.forEach(function (file) {
+                    file = path.relative(path.resolve(session.sourceDir, "locales"), file).replace(/\\/g, "/");
+                    normalizedLocaleFiles.push(file);
+                });
+            } else {
+                normalizedLocaleFiles = localeFiles;
+            }
+        }
+
+        generateLocalizedMetadataForSplashScreenIcon(config, key, xmlObject, key === "rim:splash" ? "splashScreens" : key, normalizedLocaleFiles);
+    }
+}
+
+module.exports = {
+    LOCALES_DIR: LOCALES_DIR,
+    generateLocalizedMetadata: generateLocalizedMetadata,
+    generateLocalizedText: generateLocalizedText
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/localize.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/localize.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/localize.js
new file mode 100644
index 0000000..04e89ac
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/localize.js
@@ -0,0 +1,207 @@
+/*
+ *  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.
+ */
+
+var Localize = require("localize"),
+    loc = new Localize({
+        "EXCEPTION_NATIVEPACKAGER": {
+            "en": "Native Packager exception occurred"
+        },
+        "EXCEPTION_WIDGET_ARCHIVE_NOT_FOUND": {
+            "en": "Failed to find WebWorks archive: $[1]"
+        },
+        "EXCEPTION_MISSING_SIGNING_KEY_FILE": {
+            "en": "Cannot sign application - failed to find signing key file: $[1]"
+        },
+        "WARNING_MISSING_SIGNING_KEY_FILE": {
+            "en": "Build ID set in config.xml [version], but signing key file was not found: $[1]"
+        },
+        "EXCEPTION_MISSING_SIGNING_PASSWORD": {
+            "en": "Cannot sign application - No signing password provided [-g]"
+        },
+        "WARNING_SIGNING_PASSWORD_EXPECTED": {
+            "en": "Build ID set in config.xml [version], but no signing password was provided [-g]. Bar will be unsigned"
+        },
+        "EXCEPTION_MISSING_SIGNING_BUILDID": {
+            "en": "Cannot sign application - No buildId provided [--buildId]"
+        },
+        "EXCEPTION_DEBUG_TOKEN_NOT_FOUND": {
+            "en": "Failed to find debug token"
+        },
+        "EXCEPTION_DEBUG_TOKEN_WRONG_FILE_EXTENSION": {
+            "en": "Specified debug token not a .bar extension"
+        },
+        "PROGRESS_SESSION_CONFIGXML": {
+            "en": "Parsing config.xml"
+        },
+        "PROGRESS_FILE_POPULATING_SOURCE": {
+            "en": "Populating application source"
+        },
+        "PROGRESS_GEN_OUTPUT": {
+            "en": "Generating output files"
+        },
+        "PROGRESS_PACKAGING": {
+            "en": "Packaging the BAR file"
+        },
+        "PROGRESS_COMPLETE": {
+            "en": "BAR packaging complete"
+        },
+        "EXCEPTION_PARSING_XML": {
+            "en": "An error has occurred parsing the config.xml. Please ensure that it is syntactically correct"
+        },
+        "EXCEPTION_INVALID_VERSION": {
+            "en": "Please enter a valid application version"
+        },
+        "EXCEPTION_INVALID_NAME": {
+            "en": "Please enter a valid application name"
+        },
+        "EXCEPTION_INVALID_AUTHOR": {
+            "en": "Please enter an author for the application"
+        },
+        "EXCEPTION_INVALID_ID": {
+            "en": "Please enter an application id"
+        },
+        "EXCEPTION_INVALID_CONTENT": {
+            "en": "Invalid config.xml - failed to parse the <content> element(Invalid source or the source is not specified.)"
+        },
+        "EXCEPTION_INVALID_FEATURE_ID": {
+            "en": "Invalid <feature> element - failed to find the id attribute"
+        },
+        "EXCEPTION_BUFFER_ERROR": {
+            "en": "ERROR in bufferToString(): Buffer length must be even"
+        },
+        "EXCEPTION_FEATURE_DEFINED_WITH_WILDCARD_ACCESS_URI": {
+            "en": "Invalid config.xml - no <feature> tags are allowed for this <access> element"
+        },
+        "EXCEPTION_INVALID_ACCESS_URI_NO_PROTOCOL": {
+            "en": "Invalid URI attribute in the access element - protocol required($[1])"
+        },
+        "EXCEPTION_INVALID_ACCESS_URI_NO_URN": {
+            "en": "Failed to parse the URI attribute in the access element($[1])"
+        },
+        "EXCEPTION_CMDLINE_ARG_INVALID": {
+            "en": "Invalid command line argument \"$[1]\""
+        },
+        "EXCEPTION_INVOKE_TARGET_INVALID_ID": {
+            "en": "Each rim:invoke-target element must specify a valid id attribute"
+        },
+        "EXCEPTION_INVOKE_TARGET_INVALID_TYPE": {
+            "en": "rim:invoke-target element must be specified and cannot be empty"
+        },
+        "EXCEPTION_INVOKE_TARGET_ACTION_INVALID": {
+            "en": "Each filter element must specify at least one valid action"
+        },
+        "EXCEPTION_INVOKE_TARGET_MIME_TYPE_INVALID": {
+            "en": "Each filter element must specify at least one valid mime-type"
+        },
+        "EXCEPTION_INVOKE_TARGET_FILTER_PROPERTY_INVALID": {
+            "en": "At least one property element in an invoke filter is invalid"
+        },
+        "EXCEPTION_INVALID_ICON_SRC": {
+            "en": "Icon src cannot be empty"
+        },
+        "EXCEPTION_INVALID_SPLASH_SRC": {
+            "en": "Splash src cannot be empty"
+        },
+        "EXCEPTION_INVALID_ICON_SRC_LOCALES": {
+            "en": "Icon src should not point to files under \"locales\" folder, bbwp will perform folder-based localization"
+        },
+        "EXCEPTION_INVALID_SPLASH_SRC_LOCALES": {
+            "en": "Splash src should not point to files under \"locales\" folder, bbwp will perform folder-based localization"
+        },
+        "EXCEPTION_EXTENSION_CIRCULAR_DEPENDENCY": {
+            "en": "Circular dependency detected for extension: \"$[1]\""
+        },
+        "EXCEPTION_EXTENSION_NOT_FOUND": {
+            "en": "Extension \"$[1]\" not found in \"ext\" folder"
+        },
+        "EXCEPTION_PARAMS_FILE_ERROR": {
+            "en": "An error has occurred parsing \"$[1]\""
+        },
+        "EXCEPTION_PARAMS_FILE_NOT_FOUND": {
+            "en": "\"$[1]\" does not exist"
+        },
+        "EXCEPTION_MISSING_TOOLS": {
+            "en": "BBNDK tools could not be found. Please ensure you have installed the BlackBerry Native SDK [http://developer.blackberry.com/native/] and have the PATH configured via bbndk-env script."
+        },
+        "EXCEPTION_INVALID_ORIENTATION_MODE": {
+            "en": "\"$[1]\" is not a valid orientation mode"
+        },
+        "EXCEPTION_EMPTY_ORIENTATION_MODE": {
+            "en": "blackberry.app.orientation parameter \"mode\" missing"
+        },
+        "EXCEPTION_BGCOLOR_INVALID" : {
+            "en": "Background color \"$[1]\" is not a valid number"
+        },
+        "EXCEPTION_CONFIG_NOT_FOUND" : {
+            "en": "No config.xml file was found at the root of the .zip file"
+        },
+        "EXCEPTION_CORDOVA_JS_IN_LIB_DIR" : {
+            "en": "$[1] cordova.js files found in lib"
+        },
+        "WARN_CORDOVA_JS_PACKAGED" : {
+            "en": "cordova.js is now packaged as local:///chrome/cordova.js"
+        },
+        "WARN_WEBPLATFORM_JS_PACKAGED" : {
+            "en": "webplatform.js has been packaged as an alternative to the on device version"
+        },
+        "WARN_WEBPLATFORM_I18N_PACKAGED" : {
+            "en": "i18n.js has been packaged as an alternative to the on device version"
+        },
+        "EXCEPTION_INVALID_ARCHIVE_PATH" : {
+            "en": "An archive or directory does not exist at the path specified: \"$[1]\""
+        },
+        "EXCEPTION_APPDESC_NOT_FOUND" : {
+            "en": "The bar descriptor file does not exist at the path specified: \"$[1]\""
+        },
+        "WARNING_ORIENTATION_DEPRECATED": {
+            "en": "blackberry.app.orientation has been deprecated, please use blackberry.app instead"
+        },
+        "WARNING_WEBSECURITY_DISABLED": {
+            "en": "You have disabled all web security in this WebWorks application"
+        },
+        "PROGRESS_WILL_CREATE_DEBUG_TOKEN": {
+            "en": "Will create debug token"
+        },
+        "PROGRESS_WILL_DEPLOY_DEBUG_TOKEN": {
+            "en": "Will deploy debug token"
+        },
+        "WARN_TARGET_NOT_EXIST": {
+            "en": "The target \"$[1]\" does not exist"
+        },
+        "WARN_IP_NOT_DEFINED": {
+            "en": "IP is not defined in target \"$[1]\""
+        },
+        "WARN_PASSWORD_NOT_DEFINED": {
+            "en": "Password is not defined in target \"$[1]\""
+        },
+        "PROGRESS_DEPLOYING_DEBUG_TOKEN": {
+            "en": "Deploying debug token to target \"$[1]\""
+        },
+        "WARN_NO_DEVICE_PIN_FOUND": {
+            "en": "No device PIN found, will omit debug token generation"
+        },
+        "WARN_NO_SIGNING_PASSWORD_PROVIDED": {
+            "en": "No signing password provided, will omit debug token generation"
+        },
+        "PROGRESS_GENERATING_DEBUG_TOKEN": {
+            "en": "Generating debug token"
+        }
+
+    }, "", ""); // TODO maybe a bug in localize, must set default locale to "" in order get it to work
+
+loc.setLocale("en");
+
+module.exports = loc;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/logger.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/logger.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/logger.js
new file mode 100644
index 0000000..6cab576
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/logger.js
@@ -0,0 +1,38 @@
+/*
+ *  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.
+ */
+var level = 'verbose';
+
+module.exports = {
+    level: function (value) {
+        level = value;
+    },
+    info: function (msg) {
+        if (level === 'verbose') {
+            console.log("[INFO]    " + msg);
+        }
+    },
+    error: function (msg) {
+        console.log("[ERROR]   " + msg);
+    },
+    warn: function (msg) {
+        if (level !== 'error') {
+            console.log("[WARN]    " + msg);
+        }
+    },
+    log: function (msg) {
+        console.log("[BUILD]   " + msg);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/native-packager.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/native-packager.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/native-packager.js
new file mode 100644
index 0000000..8529458
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/native-packager.js
@@ -0,0 +1,286 @@
+/*
+ *  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.
+ */
+/*jshint sub:true*/
+var childProcess = require("child_process"),
+    fs = require("fs"),
+    path = require("path"),
+    util = require("util"),
+    data2xml = require("../third_party/data2xml/data2xml"),
+    wrench = require("wrench"),
+    conf = require("./conf"),
+    logger = require("./logger"),
+    localize = require("./localize"),
+    pkgrUtils = require("./packager-utils"),
+    i18nMgr = require("./i18n-manager"),
+    NL = pkgrUtils.isWindows() ? "\r\n" : "\n";
+
+function generateTabletXMLFile(session, config) {
+    var files = wrench.readdirSyncRecursive(session.sourceDir),
+        xmlObject = {
+            id : config.id,
+            versionNumber : config.version,
+            author : config.author,
+            asset : [{
+                _attr : { entry : 'true', type : 'qnx/elf' },
+                _value : 'wwe'
+            }],
+            entryPointType : {
+                _value : "Qnx/WebKit"
+            },
+            cascadesTheme : {
+                _value : config.theme
+            },
+            initialWindow : {
+                systemChrome : 'none',
+                transparent : 'true',
+                autoOrients : 'true'
+            },
+            env : [],
+            permission : [{
+                _attr : { system : 'true'},
+                _value : 'run_native'
+            }, {
+                // hardcoded access_internet to ensure user has internet (whitelist takes care of security)
+                _attr : { system : 'false'},
+                _value : 'access_internet'
+            }]
+        };
+
+    // If appdesc is specified, use it as the bar descriptor
+    if (session.appdesc) {
+        pkgrUtils.copyFile(session.appdesc, session.sourceDir);
+        return;
+    }
+
+    //Enable slog2 output if debugging
+    if (session.debug) {
+        xmlObject.env.push({
+            _attr : { value : 'slog2', 'var' : 'CONSOLE_MODE' }
+        });
+    }
+
+    //Write user specified permissions
+    if (config.permissions) {
+        config.permissions.forEach(function (permission) {
+            var permissionAttr,
+                permissionValue;
+
+            if (typeof permission === "string") {
+                //Permission with no attributes
+                permissionValue = permission;
+            } else if (permission["@"] && permission["#"]) {
+                //Permission with attributes
+                permissionAttr = permission["@"];
+                permissionValue = permission["#"];
+            }
+
+            if (permissionValue) {
+                xmlObject.permission.push({
+                    _attr : permissionAttr,
+                    _value : permissionValue
+                });
+            }
+        });
+    }
+
+    i18nMgr.generateLocalizedText(session, config, xmlObject, "name");
+
+    if (config.description) {
+        i18nMgr.generateLocalizedText(session, config, xmlObject, "description");
+    }
+
+    i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "icon");
+    i18nMgr.generateLocalizedMetadata(session, config, xmlObject, "rim:splash");
+
+    if (config["invoke-target"]) {
+        xmlObject["invoke-target"] = [];
+
+        config["invoke-target"].forEach(function (invokeTarget) {
+
+            var xmlInvokeTarget = {
+                "_attr" : { id : invokeTarget["@"]["id"] },
+                "entry-point" : config.name,
+                "type" : invokeTarget["type"]
+            };
+
+            if (invokeTarget["require-source-permissions"]) {
+                xmlInvokeTarget["require-source-permissions"] = {
+                    _value : invokeTarget["require-source-permissions"]
+                };
+            }
+
+            if (invokeTarget.filter) {
+                xmlInvokeTarget.filter = [];
+                invokeTarget.filter.forEach(function (filter) {
+                    var xmlFilter = {
+                        "action" : filter.action,
+                        "mime-type": filter["mime-type"]
+                    };
+
+                    if (filter.property) {
+                        xmlFilter.property = [];
+                        filter.property.forEach(function (property) {
+                            xmlFilter.property.push({
+                                "_attr": { var : property["@"]["var"], value : property["@"].value }
+                            });
+                        });
+                    }
+
+                    xmlInvokeTarget.filter.push(xmlFilter);
+                });
+            }
+
+            xmlObject["invoke-target"].push(xmlInvokeTarget);
+
+        });
+    }
+
+    //buildId
+    if (config.buildId) {
+        xmlObject.buildId = config.buildId;
+    }
+
+    if (files) {
+        files.forEach(function (file) {
+            file = path.resolve(session.sourceDir, file);
+
+            if (file.indexOf(conf.BAR_DESCRIPTOR) < 0 && !fs.statSync(file).isDirectory()) {
+                file = file.replace(/\\/g, "/");
+                file = file.split("src/")[1];
+
+                if (path.extname(file) === ".so") {
+                    xmlObject.asset.push({
+                        _attr : { type : 'qnx/elf' },
+                        _value : file
+                    });
+                } else {
+                    xmlObject.asset.push({
+                        _value : file
+                    });
+                }
+            }
+        });
+    }
+
+    //Add orientation mode
+    if (config.orientation) {
+        xmlObject.initialWindow.aspectRatio = config.orientation;
+    }
+
+    //Add auto orientation
+    xmlObject.initialWindow.autoOrients = config.autoOrientation;
+
+    pkgrUtils.writeFile(session.sourceDir, conf.BAR_DESCRIPTOR, data2xml('qnx', xmlObject));
+}
+
+function generateOptionsFile(session, target, config) {
+    var srcFiles = wrench.readdirSyncRecursive(session.sourceDir),
+        isSigning = session.isSigningRequired(config),
+        optionsStr = "-package" + NL,
+        debugToken,
+        params = session.getParams("blackberry-nativepackager");
+
+    //if -d was provided and we are not signing [-g], set debugToken
+    if (session.debug && !isSigning) {
+        if (path.extname(conf.DEBUG_TOKEN) === ".bar") {
+            if (fs.existsSync(conf.DEBUG_TOKEN)) {
+                debugToken = "-debugToken" + NL;
+                debugToken += conf.DEBUG_TOKEN + NL;
+            }
+            else {
+                logger.warn(localize.translate("EXCEPTION_DEBUG_TOKEN_NOT_FOUND"));
+            }
+        } else {
+            logger.warn(localize.translate("EXCEPTION_DEBUG_TOKEN_WRONG_FILE_EXTENSION"));
+        }
+    }
+
+    if (target === "device" && isSigning) {
+        optionsStr += "-buildId" + NL;
+        optionsStr += config.buildId + NL;
+    } else if (session.debug) {
+        //DebugToken params
+        optionsStr += "-devMode" + NL;
+        optionsStr += (debugToken ? debugToken : "");
+    }
+
+    if (params) {
+        Object.getOwnPropertyNames(params).forEach(function (p) {
+            optionsStr += p + NL;
+
+            if (params[p]) {
+                optionsStr += params[p] + NL;
+            }
+        });
+    }
+
+    optionsStr += path.resolve(util.format(session.barPath, target)) + NL;
+
+    //to supoprt splash screens/icons for multiple resolutions/devices
+    optionsStr += "-barVersion" + NL;
+    optionsStr += "1.5" + NL;
+
+    optionsStr += "-C" + NL;
+    optionsStr += session.sourceDir + NL;
+    optionsStr += conf.BAR_DESCRIPTOR + NL;
+
+    srcFiles.forEach(function (file) {
+        file = path.resolve(session.sourceDir, file);
+
+        if (file.indexOf(conf.BAR_DESCRIPTOR) < 0 && !fs.statSync(file).isDirectory()) {
+            optionsStr += file + NL;
+        }
+    });
+
+    fs.writeFileSync(path.normalize(session.sourceDir + "/options"), optionsStr);
+}
+
+function execNativePackager(session, callback) {
+    var script = "/bin/blackberry-nativepackager",
+        cwd = session.sourceDir,
+        nativePkgr;
+
+    if (pkgrUtils.isWindows()) {
+        script += ".bat";
+    }
+
+    if (fs.existsSync(conf.DEPENDENCIES_TOOLS)) {
+        nativePkgr = childProcess.spawn(path.normalize(conf.DEPENDENCIES_TOOLS + script), ["@options"], {
+            "cwd": cwd,
+            "env": process.env
+        });
+
+        nativePkgr.stdout.on("data", pkgrUtils.handleProcessOutput);
+
+        nativePkgr.stderr.on("data", pkgrUtils.handleProcessOutput);
+
+        nativePkgr.on("exit", function (code) {
+            if (callback && typeof callback === "function") {
+                callback(code);
+            }
+        });
+    } else {
+        throw localize.translate("EXCEPTION_MISSING_TOOLS");
+    }
+}
+
+module.exports = {
+    exec: function (session, target, config, callback) {
+        generateOptionsFile(session, target, config);
+        generateTabletXMLFile(session, config);
+        execNativePackager(session, callback);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-utils.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
new file mode 100644
index 0000000..9b1c2e0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
@@ -0,0 +1,178 @@
+/*
+ *  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.
+ */
+
+var fs = require('fs'),
+    path = require('path'),
+    wrench = require('wrench'),
+    localize = require("./localize"),
+    logger = require("./logger"),
+    os = require('os'),
+    _self;
+
+function swapBytes(buffer) {
+    var l = buffer.length,
+        i,
+        a;
+
+    if (l % 2 === 0x01) {
+        throw localize.translate("EXCEPTION_BUFFER_ERROR");
+    }
+
+    for (i = 0; i < l; i += 2) {
+        a = buffer[i];
+        buffer[i] = buffer[i + 1];
+        buffer[i + 1] = a;
+    }
+
+    return buffer;
+}
+
+_self = {
+    writeFile: function (fileLocation, fileName, fileData) {
+        //If directory does not exist, create it.
+        if (!fs.existsSync(fileLocation)) {
+            wrench.mkdirSyncRecursive(fileLocation, "0755");
+        }
+
+        fs.writeFile(path.join(fileLocation, fileName), fileData, function (err) {
+            if (err) throw err;
+        });
+    },
+    
+    copyFile: function (srcFile, destDir, baseDir) {
+        var filename = path.basename(srcFile),
+            fileBuffer = fs.readFileSync(srcFile),
+            fileLocation;
+        
+        //if a base directory was provided, determine
+        //folder structure from the relative path of the base folder
+        if (baseDir && srcFile.indexOf(baseDir) === 0) {
+            fileLocation = srcFile.replace(baseDir, destDir);
+            wrench.mkdirSyncRecursive(path.dirname(fileLocation), "0755");
+            fs.writeFileSync(fileLocation, fileBuffer);
+        } else {
+            fs.writeFileSync(path.join(destDir, filename), fileBuffer);
+        }
+    },
+    
+    listFiles: function (directory, filter) {
+        var files = wrench.readdirSyncRecursive(directory),
+            filteredFiles = [];
+        
+        files.forEach(function (file) {
+            //On mac wrench.readdirSyncRecursive does not return absolute paths, so resolve one.
+            file = path.resolve(directory, file);
+        
+            if (filter(file)) {
+                filteredFiles.push(file);
+            }
+        });
+        
+        return filteredFiles;
+    },
+
+    isWindows: function () {
+        return os.type().toLowerCase().indexOf("windows") >= 0;
+    },
+    
+    isArray: function (obj) {
+        return obj.constructor.toString().indexOf("Array") !== -1;
+    },
+
+    isEmpty : function (obj) {
+        for (var prop in obj) {
+            if (obj.hasOwnProperty(prop))
+                return false;
+        }
+        return true;
+    },
+    
+    toBoolean: function (myString, defaultVal) {
+        // if defaultVal is not passed, default value is undefined
+        return myString === "true" ? true : myString === "false" ? false : defaultVal;
+    },
+
+    parseUri : function (str) {
+        var i, uri = {},
+            key = [ "source", "scheme", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor" ],
+            matcher = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(str);
+
+        for (i = key.length - 1; i >= 0; i--) {
+            uri[key[i]] = matcher[i] || "";
+        }
+
+        return uri;
+    },
+
+    // uri - output from parseUri
+    isAbsoluteURI : function (uri) {
+        if (uri && uri.source) {
+            return uri.relative !== uri.source;
+        }
+
+        return false;
+    },
+
+    isLocalURI : function (uri) {
+        return uri && uri.scheme && uri.scheme.toLowerCase() === "local";
+    },
+
+    // Convert node.js Buffer data (encoded) to String
+    bufferToString : function (data) {
+        var s = "";
+        if (Buffer.isBuffer(data)) {
+            if (data.length >= 2 && data[0] === 0xFF && data[1] === 0xFE) {
+                s = data.toString("ucs2", 2);
+            } else if (data.length >= 2 && data[0] === 0xFE && data[1] === 0xFF) {
+                swapBytes(data);
+                s = data.toString("ucs2", 2);
+            } else if (data.length >= 3 && data[0] === 0xEF && data[1] === 0xBB && data[2] === 0xBF) {
+                s = data.toString("utf8", 3);
+            } else {
+                s = data.toString("ascii");
+            }
+        }
+
+        return s;
+    },
+
+    // Wrap object property in an Array if the property is defined and it is not an Array
+    wrapPropertyInArray : function (obj, property) {
+        if (obj && obj[property] && !(obj[property] instanceof Array)) {
+            obj[property] = [ obj[property] ];
+        }
+    },
+
+    loadModule: function (path) {
+        return require(path);
+    },
+
+    handleProcessOutput: function (data) {
+        var msg = data.toString().replace(/[\n\r]/g, '');
+
+        if (msg) {
+            if (msg.toLowerCase().indexOf("error:") >= 0) {
+                logger.error(msg);
+            } else if (msg.toLowerCase().indexOf("warn") >= 0) {
+                logger.warn(msg);
+            } else {
+                logger.info(msg);
+            }
+        }
+    }
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-validator.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-validator.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-validator.js
new file mode 100644
index 0000000..507b9f2
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager-validator.js
@@ -0,0 +1,110 @@
+/*
+ *  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.
+ */
+var check = require('validator').check,
+    sanitize = require('validator').sanitize,
+    localize = require("./localize"),
+    logger = require("./logger"),
+    signingHelper = require("./signing-helper"),
+    path = require("path"),
+    fs = require("fs"),
+    packagerUtils = require("./packager-utils"),
+    CORDOVA_JS_REGEX = /(cordova-.+js)|cordova\.js/,
+    _self;
+
+//NOTE this class is unfinished and is a work in progress
+
+_self = {
+    //TODO create one global validate method that will validate
+    //both the session and configObj?
+    validateSession: function (session, widgetConfig) {
+        //The string checks below is to get around a really weird issue in commander
+        //where sometimes unspecified arguments come in as a function...
+        var keysFound = session.keystore,
+            cskFound = session.keystoreCsk,//barsigner.csk
+            dbFound = session.keystoreDb,//barsigner.db
+            keysPassword = session.storepass && typeof session.storepass === "string",
+            commandLinebuildId = session.buildId && typeof session.buildId === "string",//--buildId
+            buildId = widgetConfig.buildId && typeof widgetConfig.buildId === "string",//Finalized Build ID
+
+            //Constants
+            AUTHOR_P12 = "author.p12",
+            BARSIGNER_CSK = "barsigner.csk",
+            BARSIGNER_DB = "barsigner.db",
+
+            //Logging function
+            signingFileWarn = function (file) {
+                logger.warn(localize.translate("WARNING_MISSING_SIGNING_KEY_FILE", file));
+            },
+            signingFileError = function (file) {
+                throw localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", file);
+            };
+
+        //If -g <password> or --buildId is set, but signing key files are missing, throw an error
+        if (keysPassword || commandLinebuildId) {
+            if (!keysFound) {
+                signingFileError(AUTHOR_P12);
+            } else if (!cskFound) {
+                signingFileError(BARSIGNER_CSK);
+            } else if (!dbFound) {
+                signingFileError(BARSIGNER_DB);
+            }
+
+        //If a buildId exists in config, but no keys were found, throw a warning
+        } else if (buildId) {
+            if (!keysFound) {
+                signingFileWarn(AUTHOR_P12);
+            } else if (!cskFound) {
+                signingFileWarn(BARSIGNER_CSK);
+            } else if (!dbFound) {
+                signingFileWarn(BARSIGNER_DB);
+            }
+        }
+
+        //if -g was provided with NO build id, throw error
+        if (keysPassword && !buildId) {
+            throw localize.translate("EXCEPTION_MISSING_SIGNING_BUILDID");
+        }
+
+        if (commandLinebuildId && !keysPassword) {
+            //if --buildId was provided with NO password, throw error
+            throw localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD");
+        } else if (buildId && !keysPassword) {
+            //if a buildId was provided in config.xml with NO password, throw warning
+            logger.warn(localize.translate("WARNING_SIGNING_PASSWORD_EXPECTED"));
+        }
+
+        //if --appdesc was provided, but the file is not existing, throw an error
+        if (session.appdesc && !fs.existsSync(session.appdesc)) {
+            throw localize.translate("EXCEPTION_APPDESC_NOT_FOUND", session.appdesc);
+        }
+    },
+
+    //Validation for configObj, iterates through whitelisted features in configObj to remove any non-existing APIs
+    validateConfig: function (session, configObj) {
+        //if packageCordovaJs was set, test for existing cordova.js files
+        if (configObj.packageCordovaJs) {
+            cordovaJsFiles = packagerUtils.listFiles(session.sourceDir, function (file) {
+                return CORDOVA_JS_REGEX.test(file);
+            });
+            if (cordovaJsFiles.length > 0) {
+                logger.warn(localize.translate("WARN_CORDOVA_JS_PACKAGED"));
+            }
+        }
+
+    }
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager.js
new file mode 100644
index 0000000..ae73dae
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/cordova/lib/packager.js
@@ -0,0 +1,74 @@
+/*
+ *  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.
+ */
+
+require('./../third_party/wrench/wrench');
+
+var path = require("path"),
+    wrench = require("wrench"),
+    cmdline = require("./cmdline"),
+    logger = require("./logger"),
+    fileManager = require("./file-manager"),
+    localize = require("./localize"),
+    configParser = require("./config-parser"),
+    packagerUtils = require("./packager-utils"),
+    packagerValidator = require("./packager-validator"),
+    barBuilder = require("./bar-builder"),
+    session;
+
+module.exports = {
+    start: function(callback) {
+        try {
+            cmdline.parse(process.argv);
+            session = require("./session").initialize(cmdline.commander);
+
+            //prepare files for webworks archiving
+            logger.log(localize.translate("PROGRESS_FILE_POPULATING_SOURCE"));
+            fileManager.prepareOutputFiles(session);
+
+            //parse config.xml
+            logger.log(localize.translate("PROGRESS_SESSION_CONFIGXML"));
+            configParser.parse(path.join(session.sourceDir, "config.xml"), session, function (configObj) {
+                //validate session Object
+                packagerValidator.validateSession(session, configObj);
+                //validage configuration object
+                packagerValidator.validateConfig(session, configObj);
+
+                //generate user.js
+                logger.log(localize.translate("PROGRESS_GEN_OUTPUT"));
+                //Adding debuEnabled property to user.js. Framework will enable/disable WebInspector based on that variable.
+                configObj.debugEnabled = session.debug;
+                packagerUtils.writeFile(path.join(session.sourcePaths.LIB, "config"), "user.js", "module.exports = " + JSON.stringify(configObj, null, "    ") + ";");
+
+                barBuilder.build(session, configObj, function (code) {
+                    fileManager.cleanSource(session);
+
+                    if (code === 0) {
+                        logger.log(localize.translate("PROGRESS_COMPLETE"));
+
+                        //call packager callback
+                        callback();
+                    }
+                });
+            });
+        } catch (e) {
+            try {
+                fileManager.cleanSource(session);
+            } catch (ex) {}
+
+            logger.error(e);
+        }
+    }
+};


[48/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz
deleted file mode 100644
index a65adda..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz
deleted file mode 100644
index fb693c2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz
deleted file mode 100644
index e61b9d9..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz
deleted file mode 100644
index 1b906e7..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz
deleted file mode 100644
index dc73b68..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz
deleted file mode 100644
index 76e1b0d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz
deleted file mode 100644
index f1f85b9..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz
deleted file mode 100644
index c00d5de..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz
deleted file mode 100644
index 0cdbf53..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz
deleted file mode 100644
index 5405116..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz
deleted file mode 100644
index 79c2841..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz
deleted file mode 100644
index 35a134a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz
deleted file mode 100644
index 6c30687..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz
deleted file mode 100644
index e6f2529..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz
deleted file mode 100644
index 146dee3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz
deleted file mode 100644
index 8cb1758..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz
deleted file mode 100644
index e327a14..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz
deleted file mode 100644
index eaa6076..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz
deleted file mode 100644
index 65ce247..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz
deleted file mode 100644
index 9e647a7..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz
deleted file mode 100644
index 0e6d09b..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz
deleted file mode 100644
index cda0352..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz
deleted file mode 100644
index 91efb10..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz
deleted file mode 100644
index 8933e3d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz
deleted file mode 100644
index db66e86..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz
deleted file mode 100644
index ea0a479..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz
deleted file mode 100644
index 720baad..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz
deleted file mode 100644
index 7e860ff..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz
deleted file mode 100644
index 5ffc7ba..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz
deleted file mode 100644
index 5e7ed2f..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz
deleted file mode 100644
index c1221b5..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz
deleted file mode 100644
index f233e90..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz
deleted file mode 100644
index 0ca8ffa..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz
deleted file mode 100644
index 1b3c306..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz
deleted file mode 100644
index 92a324a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz
deleted file mode 100644
index 362232d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz
deleted file mode 100644
index 53e9e23..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz
deleted file mode 100644
index 26c6fff..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz
deleted file mode 100644
index 559db9e..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz
deleted file mode 100644
index 819e45d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz
deleted file mode 100644
index 589d775..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz
deleted file mode 100644
index e1aba86..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz
deleted file mode 100644
index 43ce67a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz
deleted file mode 100644
index 76a40da..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz
deleted file mode 100644
index 86302a5..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz
deleted file mode 100644
index 5f3a6d2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz
deleted file mode 100644
index 44a20ec..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz
deleted file mode 100644
index 3d60ce9..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz
deleted file mode 100644
index c928b88..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz
deleted file mode 100644
index 0d3800a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz
deleted file mode 100644
index 2243584..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz
deleted file mode 100644
index db5ce23..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz
deleted file mode 100644
index b57e2e1..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz
deleted file mode 100644
index e685c40..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz
deleted file mode 100644
index 8ceff8f..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz
deleted file mode 100644
index 9b4617d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz
deleted file mode 100644
index b45e6fe..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/et_EE_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz
deleted file mode 100644
index fff6196..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz
deleted file mode 100644
index 08c6e67..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz
deleted file mode 100644
index 54e241a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fi_FI_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz
deleted file mode 100644
index 9912df3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz
deleted file mode 100644
index af1052d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz
deleted file mode 100644
index 35870dc..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_BE_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz
deleted file mode 100644
index 3c3a9b4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz
deleted file mode 100644
index a2136b7..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_CH.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz
deleted file mode 100644
index aa47e36..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz
deleted file mode 100644
index ffb547d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_FR_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz
deleted file mode 100644
index c664df2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz
deleted file mode 100644
index 6b9d6b5..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/fr_LU_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz
deleted file mode 100644
index d7d24e7..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz
deleted file mode 100644
index 7d3c880..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ga_IE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz
deleted file mode 100644
index 66416b2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz
deleted file mode 100644
index 4d0608c..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/gu_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz
deleted file mode 100644
index 6b07571..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hi_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz
deleted file mode 100644
index cbfb8a6..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz
deleted file mode 100644
index 61c88c4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hr_HR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz
deleted file mode 100644
index 61e3c8c..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz
deleted file mode 100644
index cabecb1..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz
deleted file mode 100644
index 4d3edc6..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz
deleted file mode 100644
index 4c914db..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/hu_HU_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz
deleted file mode 100644
index 5005d70..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz
deleted file mode 100644
index 3f982c4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/in_ID.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz
deleted file mode 100644
index 903b3f2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz
deleted file mode 100644
index 5a7a4cf..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/is_IS.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz
deleted file mode 100644
index f9ffdb8..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz
deleted file mode 100644
index 0c474dd..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_CH.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz
deleted file mode 100644
index fc88b58..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz
deleted file mode 100644
index ef6be7a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/it_IT_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz
deleted file mode 100644
index 956a656..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz
deleted file mode 100644
index e51daa1..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/iw_IL.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz
deleted file mode 100644
index 5d604b3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz
deleted file mode 100644
index ef1956f..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz
deleted file mode 100644
index 358b709..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ja_JP_JP.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz
deleted file mode 100644
index d1bc61a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz
deleted file mode 100644
index 40a1732..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kk_KZ.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz
deleted file mode 100644
index 4a668ab..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz
deleted file mode 100644
index f813453..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/kn_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz
deleted file mode 100644
index a3752b4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz
deleted file mode 100644
index a1d6b83..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ko_KR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz
deleted file mode 100644
index 959e78f..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz
deleted file mode 100644
index d981980..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz
deleted file mode 100644
index cf11515..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz
deleted file mode 100644
index c438a65..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lt_LT_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz
deleted file mode 100644
index a768a43..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz
deleted file mode 100644
index b877f68..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz
deleted file mode 100644
index 9a4fa57..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz
deleted file mode 100644
index 757c861..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/lv_LV_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz
deleted file mode 100644
index b437e2b..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz
deleted file mode 100644
index 9dba801..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mk_MK.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz
deleted file mode 100644
index f0553f1..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ml_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz
deleted file mode 100644
index 3f00081..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz
deleted file mode 100644
index 3f4e42f..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mr_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz
deleted file mode 100644
index 47b15ab..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz
deleted file mode 100644
index d4b42f4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ms_MY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz
deleted file mode 100644
index f46acdf..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz
deleted file mode 100644
index 65bd5d4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz
deleted file mode 100644
index c371c5a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz
deleted file mode 100644
index 272ed07..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/mt_MT_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz
deleted file mode 100644
index 953b051..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nb_NO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz
deleted file mode 100644
index 1fc0521..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz
deleted file mode 100644
index 4ea4bd5..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz
deleted file mode 100644
index b69f55a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_BE_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz
deleted file mode 100644
index f10c527..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz
deleted file mode 100644
index a36a696..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/nl_NL_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz
deleted file mode 100644
index 2828495..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz
deleted file mode 100644
index f027493..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz
deleted file mode 100644
index 71e5b02..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/no_NO_NY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz
deleted file mode 100644
index fcec744..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/or_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz
deleted file mode 100644
index a818414..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz
deleted file mode 100644
index e86fc9d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pa_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz
deleted file mode 100644
index 92a36df..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz
deleted file mode 100644
index be45a80..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz
deleted file mode 100644
index ad0dd65..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz
deleted file mode 100644
index a0c6116..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pl_PL_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz
deleted file mode 100644
index 1a02bc1..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz
deleted file mode 100644
index 89adc5e..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_BR.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz
deleted file mode 100644
index 9f38787..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz
deleted file mode 100644
index 5adb184..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/pt_PT_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz
deleted file mode 100644
index 3e04e6e..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz
deleted file mode 100644
index 1ef6e7d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ro_RO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz
deleted file mode 100644
index 664de07..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz
deleted file mode 100644
index 49bc219..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ru_RU.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz
deleted file mode 100644
index 3db9b20..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz
deleted file mode 100644
index 0f62a17..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sh_CS.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz
deleted file mode 100644
index 8636208..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz
deleted file mode 100644
index dfb2908..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz
deleted file mode 100644
index baddfcf..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz
deleted file mode 100644
index e1cc9e0..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sk_SK_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz
deleted file mode 100644
index ac93f3e..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz
deleted file mode 100644
index 7286da1..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz
deleted file mode 100644
index 1eabc09..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sl_SI_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz
deleted file mode 100644
index 0a5f716..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz
deleted file mode 100644
index 2969ca7..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sq_AL.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz
deleted file mode 100644
index 45a8f4b..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz
deleted file mode 100644
index 89f8484..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_BA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz
deleted file mode 100644
index 9d3d758..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_CS.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz
deleted file mode 100644
index d50466e..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_ME.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz
deleted file mode 100644
index 66e041f..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz
deleted file mode 100644
index 9cc15d6..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/sr_RS_Cyrl.js.gz and /dev/null differ


[39/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/Camera.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/Camera.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/Camera.java
new file mode 100644
index 0000000..d54483f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/Camera.java
@@ -0,0 +1,470 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.camera;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Date;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.util.Logger;
+
+import net.rim.blackberry.api.invoke.CameraArguments;
+import net.rim.blackberry.api.invoke.Invoke;
+import net.rim.device.api.io.Base64OutputStream;
+import net.rim.device.api.io.IOUtilities;
+import net.rim.device.api.system.ApplicationDescriptor;
+import net.rim.device.api.system.Bitmap;
+import net.rim.device.api.system.Characters;
+import net.rim.device.api.system.ControlledAccessException;
+import net.rim.device.api.system.EncodedImage;
+import net.rim.device.api.system.EventInjector;
+import net.rim.device.api.system.JPEGEncodedImage;
+import net.rim.device.api.system.PNGEncodedImage;
+import net.rim.device.api.ui.UiApplication;
+
+/**
+ * The Camera plugin interface.
+ *
+ * The Camera class can invoke the following actions:
+ *
+ *   - takePicture: takes photo and returns base64 encoded image or image file URI
+ *
+ *   future?
+ *   - captureVideo...
+ *
+ */
+public class Camera extends Plugin
+{
+    /**
+     * Possible actions.
+     */
+    public static final String ACTION_TAKE_PICTURE = "takePicture";
+
+    /**
+     * Maximum image encoding size (in bytes) to allow.  (Obtained unofficially
+     * through trial and error). Anything larger will cause stability issues
+     * when sending back to the browser.
+     */
+    private static final long MAX_ENCODING_SIZE = 1500000L;
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action The action to execute.
+     * @param callbackId The callback ID to be invoked upon action completion
+     * @param args   JSONArry of arguments for the action.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId)
+    {
+        PluginResult result = null;
+
+        // take a picture
+        if (action != null && action.equals(ACTION_TAKE_PICTURE))
+        {
+            // Parse the options specified for the take picture action.
+            CameraOptions options;
+            try {
+                options = CameraOptions.fromJSONArray(args);
+            } catch (NumberFormatException e) {
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "One of the camera options is not a valid number.");
+            } catch (JSONException e) {
+                return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "One of the camera options is not valid JSON.");
+            }
+
+            // launch native camera application
+            launchCamera(new PhotoListener(options, callbackId));
+
+            // The native camera application runs in a separate process, so we
+            // must now wait for the listener to retrieve the photo taken.
+            // Return NO_RESULT status so plugin manager does not invoke a callback,
+            // but keep the callback so the listener can invoke it later.
+            result = new PluginResult(PluginResult.Status.NO_RESULT);
+            result.setKeepCallback(true);
+            return result;
+        }
+        else
+        {
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION, "Camera: Invalid action:" + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Launches the native camera application.
+     */
+    private static void launchCamera(PhotoListener listener)
+    {
+        // MMAPI interface doesn't use the native Camera application or interface
+        // (we would have to replicate it).  So, we invoke the native Camera application,
+        // which doesn't allow us to set any options.
+        synchronized(UiApplication.getEventLock()) {
+            UiApplication.getUiApplication().addFileSystemJournalListener(listener);
+            Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());
+        }
+    }
+
+    /**
+     * Closes the native camera application.
+     */
+    public static void closeCamera()
+    {
+        // simulate two escape characters to exit native camera application
+        // no, there is no other way to do this
+        UiApplication.getUiApplication().invokeLater(new Runnable() {
+            public void run() {
+                try
+                {
+                    EventInjector.KeyEvent inject = new EventInjector.KeyEvent(
+                            EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0);
+                    inject.post();
+                    inject.post();
+                }
+                catch (ControlledAccessException e)
+                {
+                    // the application doesn't have key injection permissions
+                    Logger.log(Camera.class.getName() + ": Unable to close camera.  " +
+                            ApplicationDescriptor.currentApplicationDescriptor().getName() +
+                            " does not have key injection permissions.");
+                }
+            }
+        });
+    }
+
+    /**
+     * Returns the image file URI or the Base64-encoded image.
+     * @param filePath The full path of the image file
+     * @param options Specifies the format of the image and the result
+     * @param callbackId The id of the callback to receive the result
+     */
+    public static void processImage(String filePath, CameraOptions options,
+            String callbackId) {
+        PluginResult result = null;
+        try
+        {
+            // wait for the file to be fully written to the file system
+            // to avoid premature access to it (yes, this has happened)
+            waitForImageFile(filePath);
+
+            // Reformat the image if the specified options require it,
+            // otherwise, get encoded string if base 64 string is output format.
+            String imageURIorData = filePath;
+            
+            // save to file:///store/home/user/ as oppsed to photo album
+            // so it doesn't show up in the camera's photo album viewer
+            if(!options.saveToPhotoAlbum){
+                FileConnection fconnIn = null;
+                FileConnection fconnOut = null;
+                InputStream in = null;
+                OutputStream out = null;
+                String newOutName = "";
+                try
+                {
+                    fconnIn = (FileConnection)Connector.open(filePath);
+                    if (fconnIn.exists())
+                    {
+                        newOutName = "file:///store/home/user/"+fconnIn.getName();
+                        fconnOut = (FileConnection)Connector.open(newOutName);
+                        if (!fconnOut.exists())
+                         {
+                             fconnOut.create();  
+                             in = fconnIn.openInputStream();
+                             out = fconnOut.openOutputStream();
+                             out.write(IOUtilities.streamToBytes(in, 96*1024));
+                             fconnIn.delete();
+                             out.close();
+                             imageURIorData = newOutName;
+                             filePath = newOutName;
+                             waitForImageFile(newOutName);
+                         }
+                    }
+                }
+                finally
+                {
+                    if (in != null) in.close();
+                    if (out != null) out.close();
+                    if (fconnIn != null) fconnIn.close();
+                    if (fconnOut != null) fconnOut.close();
+                }
+                
+            }
+
+            if (options.reformat) {
+                imageURIorData = reformatImage(filePath, options);
+            } else if (options.destinationType == CameraOptions.DESTINATION_DATA_URL) {
+                imageURIorData = encodeImage(filePath);
+            }
+
+            // we have to check the size to avoid memory errors in the browser
+            if (imageURIorData.length() > MAX_ENCODING_SIZE)
+            {
+                // it's a big one.  this is for your own good.
+                String msg = "Encoded image is too large.  Try reducing camera image size.";
+                Logger.log(Camera.class.getName() + ": " + msg);
+                result =  new PluginResult(PluginResult.Status.ERROR, msg);
+            }
+            else
+            {
+                result = new PluginResult(PluginResult.Status.OK, imageURIorData);
+            }
+        }
+        catch (Exception e)
+        {
+            result = new PluginResult(PluginResult.Status.IO_EXCEPTION, e.toString());
+        }
+
+        // send result back to JavaScript
+        sendResult(result, callbackId);
+    }
+
+    /**
+     * Waits for the image file to be fully written to the file system.
+     * @param filePath     Full path of the image file
+     * @throws IOException
+     */
+    private static void waitForImageFile(String filePath) throws IOException
+    {
+        long start = (new Date()).getTime();
+        FileConnection fconn = null;
+        try
+        {
+            fconn = (FileConnection)Connector.open(filePath, Connector.READ);
+            if (fconn.exists())
+            {
+                long fileSize = fconn.fileSize();
+                long size = 0;
+                while (true)
+                {
+                    try { Thread.sleep(100); } catch (InterruptedException e) {}
+                    size = fconn.fileSize();
+                    if (size == fileSize) {
+                        break;
+                    }
+                    fileSize = size;
+                }
+                Logger.log(Camera.class.getName() + ": " + filePath +
+                    " size=" + Long.toString(fileSize) + " bytes");
+            }
+        }
+        finally
+        {
+            if (fconn != null) fconn.close();
+        }
+        long end = (new Date()).getTime();
+        Logger.log(Camera.class.getName() + ": wait time=" + Long.toString(end-start) + " ms");
+    }
+
+    /**
+     * Opens the specified image file and converts its contents to a Base64-encoded string.
+     * @param filePath     Full path of the image file
+     * @return file contents as a Base64-encoded String
+     */
+    private static String encodeImage(String filePath) throws IOException
+    {
+        String imageData = null;
+
+        // open the image file
+        FileConnection fconn = null;
+        InputStream in = null;
+        ByteArrayOutputStream byteArrayOS = null;
+        try
+        {
+            fconn = (FileConnection)Connector.open(filePath);
+            if (fconn.exists())
+            {
+                // encode file contents using BASE64 encoding
+                in = fconn.openInputStream();
+                byteArrayOS = new ByteArrayOutputStream();
+                Base64OutputStream base64OS = new Base64OutputStream(byteArrayOS);
+                base64OS.write(IOUtilities.streamToBytes(in, 96*1024));
+                base64OS.flush();
+                base64OS.close();
+                imageData = byteArrayOS.toString();
+
+                Logger.log(Camera.class.getName() + ": Base64 encoding size=" +
+                        Integer.toString(imageData.length()));
+            }
+        }
+        finally
+        {
+            if (in != null) in.close();
+            if (fconn != null) fconn.close();
+            if (byteArrayOS != null) byteArrayOS.close();
+        }
+
+        return imageData;
+    }
+
+    /**
+     * Reformats the image taken with the camera based on the options specified.
+     *
+     * Unfortunately, reformatting the image will cause EXIF data in the photo
+     * to be lost.  Most importantly the orientation data is lost so the
+     * picture is not auto rotated by software that recognizes EXIF data.
+     *
+     * @param filePath
+     *            The full path of the image file
+     * @param options
+     *            Specifies the format of the image and the result
+     * @return the reformatted image file URI or Base64-encoded image
+     * @throws IOException
+     */
+    private static String reformatImage(String filePath, CameraOptions options)
+            throws IOException {
+        long start = (new Date()).getTime();
+
+        // Open the original image created by the camera application and read
+        // it into an EncodedImage object.
+        FileConnection fconn = null;
+        InputStream in = null;
+        Bitmap originalImage = null;
+        try {
+            fconn = (FileConnection) Connector.open(filePath);
+            in = fconn.openInputStream();
+            originalImage = Bitmap.createBitmapFromBytes(IOUtilities.streamToBytes(in, 96*1024), 0, -1, 1);
+        } finally {
+            if (in != null)
+                in.close();
+            if (fconn != null)
+                fconn.close();
+        }
+
+        int newWidth = options.targetWidth;
+        int newHeight = options.targetHeight;
+        int origWidth = originalImage.getWidth();
+        int origHeight = originalImage.getHeight();
+
+        // If only width or only height was specified, the missing dimension is
+        // set based on the current aspect ratio of the image.
+        if (newWidth > 0 && newHeight <= 0) {
+            newHeight = (newWidth * origHeight) / origWidth;
+        } else if (newWidth <= 0 && newHeight > 0) {
+            newWidth = (newHeight * origWidth) / origHeight;
+        } else if (newWidth <= 0 && newHeight <= 0) {
+            newWidth = origWidth;
+            newHeight = origHeight;
+        } else {
+            // If the user specified both a positive width and height
+            // (potentially different aspect ratio) then the width or height is
+            // scaled so that the image fits while maintaining aspect ratio.
+            // Alternatively, the specified width and height could have been
+            // kept and Bitmap.SCALE_TO_FIT specified when scaling, but this
+            // would result in whitespace in the new image.
+            double newRatio = newWidth / (double)newHeight;
+            double origRatio = origWidth / (double)origHeight;
+
+            if (origRatio > newRatio) {
+                newHeight = (newWidth * origHeight) / origWidth;
+            } else if (origRatio < newRatio) {
+                newWidth = (newHeight * origWidth) / origHeight;
+            }
+        }
+
+        Bitmap newImage = new Bitmap(newWidth, newHeight);
+        originalImage.scaleInto(newImage, options.imageFilter, Bitmap.SCALE_TO_FILL);
+
+        // Convert the image to the appropriate encoding.  PNG does not allow
+        // quality to be specified so the only affect that the quality option
+        // has for a PNG is on the seelction of the image filter.
+        EncodedImage encodedImage;
+        if (options.encoding == CameraOptions.ENCODING_PNG) {
+            encodedImage = PNGEncodedImage.encode(newImage);
+        } else {
+            encodedImage = JPEGEncodedImage.encode(newImage, options.quality);
+        }
+
+        // Rewrite the modified image back out to the same file.  This is done
+        // to ensure that for every picture taken, only one shows up in the
+        // gallery.  If the encoding changed the file extension will differ
+        // from the original.
+        OutputStream out = null;
+        int dirIndex = filePath.lastIndexOf('/');
+        String filename = filePath.substring(dirIndex + 1, filePath.lastIndexOf('.'))
+                + options.fileExtension;
+        try {
+            fconn = (FileConnection) Connector.open(filePath);
+            fconn.truncate(0);
+            out = fconn.openOutputStream();
+            out.write(encodedImage.getData());
+            fconn.rename(filename);
+        } finally {
+            if (out != null)
+                out.close();
+            if (fconn != null)
+                fconn.close();
+        }
+
+        // Return either the Base64-encoded string or the image URI for the
+        // new image.
+        String imageURIorData;
+        if (options.destinationType == CameraOptions.DESTINATION_DATA_URL) {
+            ByteArrayOutputStream byteArrayOS = null;
+
+            try {
+                byteArrayOS = new ByteArrayOutputStream();
+                Base64OutputStream base64OS = new Base64OutputStream(
+                        byteArrayOS);
+                base64OS.write(encodedImage.getData());
+                base64OS.flush();
+                base64OS.close();
+                imageURIorData = byteArrayOS.toString();
+                Logger.log(Camera.class.getName() + ": Base64 encoding size="
+                        + Integer.toString(imageURIorData.length()));
+            } finally {
+                if (byteArrayOS != null) {
+                    byteArrayOS.close();
+                }
+            }
+        } else {
+            imageURIorData = filePath.substring(0, dirIndex + 1) + filename;
+        }
+
+        long end = (new Date()).getTime();
+        Logger.log(Camera.class.getName() + ": reformat time=" + Long.toString(end-start) + " ms");
+
+        return imageURIorData;
+    }
+
+    /**
+     * Sends result back to JavaScript.
+     * @param result PluginResult
+     */
+    private static void sendResult(PluginResult result, String callbackId)
+    {
+        // invoke the appropriate callback
+        if (result.getStatus() == PluginResult.Status.OK.ordinal())
+        {
+            success(result, callbackId);
+        }
+        else
+        {
+            error(result, callbackId);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/CameraOptions.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/CameraOptions.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/CameraOptions.java
new file mode 100644
index 0000000..8bfa0df
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/CameraOptions.java
@@ -0,0 +1,193 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.camera;
+
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+
+import net.rim.device.api.system.Bitmap;
+
+/**
+ * A helper class to hold all the options specified when using the camera api.
+ */
+public class CameraOptions {
+
+    /** Return the result as a Base-64 encoded string. */
+    public static final int DESTINATION_DATA_URL = 0;
+
+    /** Return the result as a file URI. */
+    public static final int DESTINATION_FILE_URI = 1;
+
+    /** JPEG image encoding. */
+    public static final int ENCODING_JPEG = 0;
+
+    /** PNG image encoding. */
+    public static final int ENCODING_PNG = 1;
+
+    /** Select image from picture library. */
+    public static final int SOURCE_PHOTOLIBRARY = 0;
+
+    /** Take picture from camera. */
+    public static final int SOURCE_CAMERA = 1;
+
+    /** Select image from picture library. */
+    public static final int SOURCE_SAVEDPHOTOALBUM = 2;
+
+    // Class members with defaults set.
+    public int quality = 80;
+    public int destinationType = DESTINATION_DATA_URL;
+    public int sourceType = SOURCE_CAMERA;
+    public int targetWidth = -1;
+    public int targetHeight = -1;
+    public int encoding = ENCODING_JPEG;
+    public String fileExtension = ".jpg";
+    public int imageFilter = Bitmap.FILTER_LANCZOS;
+    public boolean reformat = false;
+    public boolean saveToPhotoAlbum = true;
+
+    /**
+     * Defines the order of args in the JSONArray
+     *
+     * [ 80,                                   // quality
+     *   Camera.DestinationType.DATA_URL,      // destinationType
+     *   Camera.PictureSourceType.PHOTOLIBRARY // sourceType (ignored)
+     *   400,                                  // targetWidth
+     *   600,                                  // targetHeight
+     *   Camera.EncodingType.JPEG              // encoding
+     *	 Camera.mediaType
+     *   Camera.allowEdit
+     *   Camera.correctOrientation
+     *	 Camera.saveToPhotoAlbum			   // save to photo album
+     *   Camera.popoverOptions]			   
+     */
+    private static final int ARG_QUALITY = 0;
+    private static final int ARG_DESTINATION_TYPE = 1;
+    private static final int ARG_SOURCE_TYPE = 2;
+    private static final int ARG_TARGET_WIDTH = 3;
+    private static final int ARG_TARGET_HEIGHT = 4;
+    private static final int ARG_ENCODING = 5;
+    private static final int ARG_SAVETOPHOTOALBUM = 9;
+
+    /**
+     * Parse the JSONArray and populate the class members with the values.
+     *
+     * @param args
+     *            a JSON Array of camera options.
+     * @return a new CameraOptions object with values set.
+     * @throws NumberFormatException
+     * @throws JSONException
+     */
+    public static CameraOptions fromJSONArray(JSONArray args)
+            throws NumberFormatException, JSONException {
+        CameraOptions options = new CameraOptions();
+
+        if (args != null && args.length() > 0) {
+            // Use the quality value to determine what image filter to use
+            // if a reformat is necessary.  The possible values in order from
+            // fastest (poorest quality) to slowest (best quality) are:
+            //
+            //     FILTER_BOX -> FILTER_BILINEAR -> FILTER_LANCZOS
+            if (!args.isNull(ARG_QUALITY)) {
+                int quality = Integer.parseInt(args.getString(ARG_QUALITY));
+                if (quality > 0) {
+                    options.quality = quality > 100 ? 100 : quality;
+                    if (options.quality < 30) {
+                        options.imageFilter = Bitmap.FILTER_BOX;
+                    } else if (options.quality < 60) {
+                        options.imageFilter = Bitmap.FILTER_BILINEAR;
+                    }
+                }
+            }
+
+            if (!args.isNull(ARG_DESTINATION_TYPE)) {
+                int destType = Integer.parseInt(args
+                        .getString(ARG_DESTINATION_TYPE));
+                if (destType == DESTINATION_FILE_URI) {
+                    options.destinationType = DESTINATION_FILE_URI;
+                }
+            }
+
+            if (!args.isNull(ARG_SOURCE_TYPE)) {
+                options.sourceType = Integer.parseInt(args
+                        .getString(ARG_SOURCE_TYPE));
+            }
+
+            if (!args.isNull(ARG_TARGET_WIDTH)) {
+                options.targetWidth = Integer.parseInt(args
+                        .getString(ARG_TARGET_WIDTH));
+            }
+
+            if (!args.isNull(ARG_TARGET_HEIGHT)) {
+                options.targetHeight = Integer.parseInt(args
+                        .getString(ARG_TARGET_HEIGHT));
+            }
+
+            if (!args.isNull(ARG_ENCODING)) {
+                int encoding = Integer.parseInt(args.getString(ARG_ENCODING));
+                if (encoding == ENCODING_PNG) {
+                    options.encoding = ENCODING_PNG;
+                    options.fileExtension = ".png";
+                }
+            }
+
+            // A reformat of the picture taken from the camera is only performed
+            // if a custom width or height was specified or the user wants
+            // the output in an encoded form which is not JPEG.
+            if (options.targetWidth > 0 || options.targetHeight > 0
+                    || options.encoding != ENCODING_JPEG) {
+                options.reformat = true;
+            }
+
+            if (!args.isNull(ARG_SAVETOPHOTOALBUM)) {
+                options.saveToPhotoAlbum = parseBoolean(args.getString(ARG_SAVETOPHOTOALBUM));
+            }
+            
+        }
+
+        return options;
+    }
+
+    /**
+     * no parseBoolean in JDK 1.3 :(
+    */
+    public static boolean parseBoolean(String s) {
+        if(s.equals("true")){
+            return true;
+        }else{
+            return false;
+        }
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        StringBuffer str = new StringBuffer();
+        str.append("Destination: " + destinationType + "\n");
+        str.append("Source: " + sourceType + "\n");
+        str.append("Quality: " + quality + "\n");
+        str.append("Width:  " + targetWidth + "\n");
+        str.append("Height: " + targetHeight + "\n");
+        str.append("Encoding:    " + encoding + "\n");
+        str.append("Filter: " + imageFilter + "\n");
+        str.append("Reformat: " + reformat);
+        str.append("Save To Photo Album: " + saveToPhotoAlbum);
+        return str.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/PhotoListener.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/PhotoListener.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/PhotoListener.java
new file mode 100644
index 0000000..8571788
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/camera/PhotoListener.java
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.camera;
+
+import net.rim.device.api.io.file.FileSystemJournal;
+import net.rim.device.api.io.file.FileSystemJournalEntry;
+import net.rim.device.api.io.file.FileSystemJournalListener;
+import net.rim.device.api.ui.UiApplication;
+
+/**
+ * Listens for photo added to file system and invokes the specified callback
+ * with the result formatted according the specified destination type.
+ */
+public class PhotoListener implements FileSystemJournalListener {
+
+    /**
+     * Image format options specified by the caller.
+     */
+    private CameraOptions options;
+
+    /**
+     * Callback to be invoked with the result.
+     */
+    private String callbackId;
+
+    /**
+     * Used to track file system changes.
+     */
+    private long lastUSN = 0;
+
+    /**
+     * Constructor.
+     * @param options         Specifies the format of the image and result
+     * @param callbackId      The id of the callback to receive the result
+     */
+    public PhotoListener(CameraOptions options, String callbackId)
+    {
+        this.options = options;
+        this.callbackId = callbackId;
+    }
+
+    /**
+     * Listens for file system changes.  When a JPEG file is added, we process
+     * it and send it back.
+     */
+    public void fileJournalChanged()
+    {
+        // next sequence number file system will use
+        long USN = FileSystemJournal.getNextUSN();
+
+        for (long i = USN - 1; i >= lastUSN && i < USN; --i)
+        {
+            FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);
+            if (entry == null)
+            {
+                break;
+            }
+
+            if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED)
+            {
+                String path = entry.getPath();
+                if (path != null && path.indexOf(".jpg") != -1)
+                {
+                    // we found a new JPEG file
+                    // first, stop listening to avoid processing the file more than once
+                    synchronized(UiApplication.getEventLock()) {
+                        UiApplication.getUiApplication().removeFileSystemJournalListener(this);
+                    }
+
+                    // process the image on a background thread to avoid clogging the event queue
+                    final String filePath = "file://" + path;
+                    Thread thread = new Thread(new Runnable() {
+                        public void run() {
+                            Camera.processImage(filePath, options, callbackId);
+                        }
+                    });
+                    thread.start();
+
+                    // clean up
+                    Camera.closeCamera();
+
+                    break;
+                }
+            }
+        }
+
+        // remember the file journal change number,
+        // so we don't search the same events again and again
+        lastUSN = USN;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureListener.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureListener.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureListener.java
new file mode 100644
index 0000000..9267e9b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureListener.java
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import net.rim.device.api.io.file.FileSystemJournal;
+import net.rim.device.api.io.file.FileSystemJournalEntry;
+import net.rim.device.api.io.file.FileSystemJournalListener;
+
+/**
+ * Listens for audio recording files that are added to file system.
+ * <p>
+ * Audio recordings are added to the file system when the user stops the
+ * recording. The audio recording file extension is '.amr'. Therefore, we listen
+ * for the <code>FileSystemJournalEntry.FILE_ADDED</code> event, capturing when
+ * the new file is written.
+ * <p>
+ * The file system notifications will arrive on the application event thread.
+ * When it receives a notification, it adds the image file path to a MediaQueue
+ * so that the capture thread can process the file.
+ */
+public class AudioCaptureListener implements FileSystemJournalListener {
+    /**
+     * Used to track file system changes.
+     */
+    private long lastUSN = 0;
+
+    /**
+     * Queue to send media files to for processing.
+     */
+    private MediaQueue queue = null;
+
+    /**
+     * Constructor.
+     */
+    AudioCaptureListener(MediaQueue queue) {
+        this.queue = queue;
+    }
+
+    public void fileJournalChanged() {
+        // next sequence number file system will use
+        long USN = FileSystemJournal.getNextUSN();
+
+        for (long i = USN - 1; i >= lastUSN && i < USN; --i) {
+            FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);
+            if (entry == null) {
+                break;
+            }
+
+            // has audio recording file has been added to the file system?
+            String path = entry.getPath();
+            if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED
+                    && path.endsWith(".amr")) {
+                // add file path to the capture queue
+                queue.add("file://" + path);
+
+                break;
+            }
+        }
+
+        // remember the file journal change number,
+        // so we don't search the same events again and again
+        lastUSN = USN;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureOperation.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureOperation.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureOperation.java
new file mode 100644
index 0000000..f4fd9b4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioCaptureOperation.java
@@ -0,0 +1,173 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import java.io.IOException;
+import java.util.Date;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+
+import org.apache.cordova.file.File;
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.io.MIMETypeAssociations;
+import net.rim.device.api.ui.UiApplication;
+
+public class AudioCaptureOperation extends CaptureOperation {
+
+    // content type
+    public static final String CONTENT_TYPE = "audio/";
+
+    // maximum duration to capture media (milliseconds)
+    private double duration = 0;
+
+    // file system listener
+    private AudioCaptureListener listener = null;
+
+    /**
+     * Creates and starts an audio capture operation.
+     *
+     * @param limit
+     *            maximum number of media files to capture
+     * @param duration
+     *            maximum duration to capture media (milliseconds)
+     * @param callbackId
+     *            the callback to receive the files
+     * @param queue
+     *            the queue from which to retrieve captured media files
+     */
+    public AudioCaptureOperation(long limit, double duration, String callbackId, MediaQueue queue) {
+        super(limit, callbackId, queue);
+
+        if (duration > 0) {
+            this.duration = duration;
+        }
+
+        // listener to capture image files added to file system
+        this.listener = new AudioCaptureListener(queue);
+
+        start();
+    }
+
+    /**
+     * Registers file system listener and launches native voice notes recorder
+     * application.
+     */
+    protected void setup() {
+        // register listener for files being written
+        synchronized(UiApplication.getEventLock()) {
+            UiApplication.getUiApplication().addFileSystemJournalListener(listener);
+        }
+
+        // launch the native voice notes recorder application
+        AudioControl.launchAudioRecorder();
+    }
+
+    /**
+     * Unregisters file system listener and closes native voice notes recorder
+     * application.
+     */
+    protected void teardown() {
+        // remove file system listener
+        synchronized(UiApplication.getEventLock()) {
+            UiApplication.getUiApplication().removeFileSystemJournalListener(listener);
+        }
+
+        // close the native voice notes recorder application
+        AudioControl.closeAudioRecorder();
+    }
+
+    /**
+     * Retrieves the file properties for the captured audio recording.
+     *
+     * @param filePath
+     *            full path of the audio recording file
+     */
+    protected void processFile(String filePath) {
+        Logger.log(this.getClass().getName() + ": processing file: " + filePath);
+
+        // wait for file to finish writing and add it to captured files
+        addCaptureFile(getMediaFile(filePath));
+    }
+
+    /**
+     * Waits for file to be fully written to the file system before retrieving
+     * its file properties.
+     *
+     * @param filePath
+     *            Full path of the image file
+     * @throws IOException
+     */
+    private File getMediaFile(String filePath) {
+        File file = new File(FileUtils.stripSeparator(filePath));
+
+        // time begin waiting for file write
+        long start = (new Date()).getTime();
+
+        // wait for the file to be fully written, then grab its properties
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection) Connector.open(filePath, Connector.READ);
+            if (fconn.exists()) {
+                // wait for file to be fully written
+                long fileSize = fconn.fileSize();
+                long size = 0;
+                Thread thisThread = Thread.currentThread();
+                while (myThread == thisThread) {
+                    try {
+                        Thread.sleep(100);
+                    }
+                    catch (InterruptedException e) {
+                        break;
+                    }
+                    size = fconn.fileSize();
+                    if (fileSize != 0 && size == fileSize) {
+                        break;
+                    }
+                    fileSize = size;
+                }
+                Logger.log(this.getClass().getName() + ": " + filePath + " size="
+                        + Long.toString(fileSize) + " bytes");
+
+                // retrieve file properties
+                file.setLastModifiedDate(fconn.lastModified());
+                file.setName(FileUtils.stripSeparator(fconn.getName()));
+                file.setSize(fileSize);
+                file.setType(MIMETypeAssociations.getMIMEType(filePath));
+            }
+        }
+        catch (IOException e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            } catch (IOException ignored) {}
+        }
+
+        // log time it took to write the file
+        long end = (new Date()).getTime();
+        Logger.log(this.getClass().getName() + ": wait time="
+                + Long.toString(end - start) + " ms");
+
+        return file;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioControl.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioControl.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioControl.java
new file mode 100644
index 0000000..45e9f9c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/AudioControl.java
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import org.apache.cordova.util.ApplicationUtils;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.system.ApplicationDescriptor;
+import net.rim.device.api.system.ApplicationManager;
+import net.rim.device.api.system.ApplicationManagerException;
+import net.rim.device.api.system.CodeModuleManager;
+
+public class AudioControl {
+    /**
+     * Determines if the native voice notes recorder application is installed
+     * on the device.
+     *
+     * @return true if native voice notes recorder application is installed
+     */
+    public static boolean hasAudioRecorderApplication() {
+        return ApplicationUtils.isModuleInstalled("net_rim_bb_voicenotesrecorder");
+    }
+
+    /**
+     * Determines if the native voice notes recorder application is running in
+     * the foreground.
+     *
+     * @return true if native voice notes recorder application is running in
+     *         foreground
+     */
+    public static boolean isAudioRecorderActive() {
+        return ApplicationUtils.isApplicationInForeground("net_rim_bb_voicenotesrecorder");
+    }
+
+    /**
+     * Launches the native audio recorder application.
+     */
+    public static void launchAudioRecorder() {
+        int handle = CodeModuleManager.getModuleHandle("net_rim_bb_voicenotesrecorder");
+        ApplicationDescriptor ad = CodeModuleManager.getApplicationDescriptors(handle)[0];
+        ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, null);
+        try {
+            ApplicationManager.getApplicationManager().runApplication(ad2, true);
+        }
+        catch (ApplicationManagerException e) {
+            Logger.log(AudioControl.class.getName() + ": unable to launch net_rim_bb_voicenotesrecorder");
+        }
+    }
+
+    /**
+     * Closes the native audio recorder application.
+     */
+    public static void closeAudioRecorder() {
+        if (!isAudioRecorderActive()) {
+            return;
+        }
+        ApplicationUtils.injectEscKeyPress(1);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CameraControl.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CameraControl.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CameraControl.java
new file mode 100644
index 0000000..2ed9206
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CameraControl.java
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import org.apache.cordova.util.ApplicationUtils;
+
+import net.rim.blackberry.api.invoke.CameraArguments;
+import net.rim.blackberry.api.invoke.Invoke;
+import net.rim.device.api.ui.UiApplication;
+
+public class CameraControl {
+    /**
+     * Determines if the native camera application is running in the foreground.
+     *
+     * @return true if native camera application is running in foreground
+     */
+    public static boolean isCameraActive() {
+        return ApplicationUtils.isApplicationInForeground("net_rim_bb_camera");
+    }
+
+    /**
+     * Determines if the native video recorder application is running in the
+     * foreground.
+     *
+     * @return true if native video recorder application is running in
+     *         foreground
+     */
+    public static boolean isVideoRecorderActive() {
+        return ApplicationUtils.isApplicationInForeground("net_rim_bb_videorecorder");
+    }
+
+    /**
+     * Launches the native camera application.
+     */
+    public static void launchCamera() {
+        synchronized(UiApplication.getEventLock()) {
+            Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA,
+                    new CameraArguments());
+        }
+    }
+
+    /**
+     * Launches the native video recorder application.
+     */
+    public static void launchVideoRecorder() {
+        synchronized(UiApplication.getEventLock()) {
+            Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA,
+                    new CameraArguments(CameraArguments.ARG_VIDEO_RECORDER));
+        }
+    }
+
+    /**
+     * Closes the native camera application.
+     */
+    public static void closeCamera() {
+        if (!isCameraActive()) {
+            return;
+        }
+        ApplicationUtils.injectEscKeyPress(2);
+    }
+
+    /**
+     * Closes the native video recorder application.
+     */
+    public static void closeVideoRecorder() {
+        if (!isVideoRecorderActive()) {
+            return;
+        }
+        ApplicationUtils.injectEscKeyPress(2);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureControl.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureControl.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureControl.java
new file mode 100644
index 0000000..e37dd56
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureControl.java
@@ -0,0 +1,169 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+public class CaptureControl {
+
+    /**
+     * Pending capture operations.
+     */
+    private Vector pendingOperations = new Vector();
+
+    /**
+     * Singleton.
+     */
+    private CaptureControl() {}
+
+    /**
+     * Holds the singleton for lazy instantiation.
+     */
+    private static class CaptureControlHolder {
+        static final CaptureControl INSTANCE = new CaptureControl();
+    }
+
+    /**
+     * Retrieves a CaptureControl instance.
+     * @return CaptureControl instance.
+     */
+    public static final CaptureControl getCaptureControl() {
+        return CaptureControlHolder.INSTANCE;
+    }
+
+    /**
+     * Add capture operation so we can stop it manually.
+     */
+    public void addCaptureOperation(CaptureOperation operation) {
+        if (operation == null) {
+            return;
+        }
+
+        synchronized (pendingOperations) {
+            pendingOperations.addElement(operation);
+        }
+    }
+
+    /**
+     * Remove capture operation.
+     */
+    public void removeCaptureOperation(CaptureOperation operation) {
+        if (operation == null) {
+            return;
+        }
+
+        synchronized (pendingOperations) {
+            pendingOperations.removeElement(operation);
+        }
+    }
+
+    /**
+     * Starts an image capture operation, during which a user can take multiple
+     * photos. The capture operation runs in the background.
+     *
+     * @param limit
+     *            the maximum number of images to capture during the operation
+     * @param callbackId
+     *            the callback to be invoked with capture file properties
+     */
+    public void startImageCaptureOperation(long limit, String callbackId) {
+        // setup a queue to receive image file paths
+        MediaQueue queue = new MediaQueue();
+
+        // start a capture operation on a background thread
+        CaptureOperation operation = new ImageCaptureOperation(limit,
+                callbackId, queue);
+
+        // track the operation so we can stop or cancel it later
+        addCaptureOperation(operation);
+    }
+
+    /**
+     * Starts a video capture operation, during which a user can record multiple
+     * recordings.  The capture operation runs in the background.
+     *
+     * @param limit
+     *            the maximum number of images to capture during the operation
+     * @param callbackId
+     *            the callback to be invoked with capture file properties
+     */
+    public void startVideoCaptureOperation(long limit, String callbackId) {
+        // setup a queue to receive video recording file paths
+        MediaQueue queue = new MediaQueue();
+
+        // start a capture operation on a background thread
+        CaptureOperation operation = new VideoCaptureOperation(limit,
+                callbackId, queue);
+
+        // track the operation so we can stop or cancel it later
+        addCaptureOperation(operation);
+    }
+
+    /**
+     * Starts an audio capture operation using the native voice notes recorder
+     * application.
+     *
+     * @param limit
+     *            the maximum number of audio clips to capture during the
+     *            operation
+     * @param duration
+     *            the maximum duration of each captured clip
+     * @param callbackId
+     *            the callback to be invoked with the capture results
+     */
+    public void startAudioCaptureOperation(long limit, double duration, String callbackId) {
+        // setup a queue to receive recording file paths
+        MediaQueue queue = new MediaQueue();
+
+        // start a capture operation on a background thread
+        CaptureOperation operation = new AudioCaptureOperation(limit, duration,
+                callbackId, queue);
+
+        // track the operation so we can stop or cancel it later
+        addCaptureOperation(operation);
+    }
+
+    /**
+     * Stops all pending capture operations. If the <code>cancel</code>
+     * parameter is <code>true</code>, no results will be sent via the callback
+     * mechanism and any captured files will be removed from the file system.
+     *
+     * @param cancel
+     *            true if operations should be canceled
+     */
+    public void stopPendingOperations(boolean cancel) {
+        // There are two scenarios where the capture operation would be stopped
+        // manually:
+        // 1- The user stops the capture application, and this application
+        //    returns to the foreground.
+        // 2- It is canceled programmatically.  No results should be sent.
+        synchronized (pendingOperations) {
+            for (Enumeration e = pendingOperations.elements(); e.hasMoreElements(); ) {
+                CaptureOperation operation = (CaptureOperation) e.nextElement();
+                if (cancel) {
+                    operation.cancel();
+                }
+                else {
+                    operation.stop();
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureMode.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureMode.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureMode.java
new file mode 100644
index 0000000..7c71f96
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureMode.java
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+public class CaptureMode {
+
+    private String mimeType = null;
+    private long height = 0;
+    private long width = 0;
+
+    public CaptureMode() {
+    }
+
+    public CaptureMode(String type) {
+        this.mimeType = type;
+    }
+
+    public CaptureMode(String type, long width, long height) {
+        this.mimeType = type;
+        this.height = height;
+        this.width = width;
+    }
+
+    public String getMimeType() {
+        return mimeType;
+    }
+
+    public long getHeight() {
+        return height;
+    }
+
+    public long getWidth() {
+        return width;
+    }
+
+    public JSONObject toJSONObject() {
+        JSONObject o = new JSONObject();
+        try {
+            o.put("type", getMimeType());
+            o.put("height", getHeight());
+            o.put("width", getWidth());
+        }
+        catch (JSONException ignored) {
+        }
+        return o;
+    }
+
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (!(o instanceof CaptureMode)) {
+            return false;
+        }
+        CaptureMode cm = (CaptureMode)o;
+        return ((mimeType == null ? cm.mimeType == null :
+            mimeType.equals(cm.mimeType))
+            && (width == cm.width)
+            && (height == cm.height));
+    }
+
+    public int hashCode() {
+        int hash = (mimeType != null ? mimeType.hashCode() : 19);
+        hash = 37*hash + (int)width;
+        hash = 37*hash + (int)height;
+        return hash;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureOperation.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureOperation.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureOperation.java
new file mode 100644
index 0000000..dc85bd8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/CaptureOperation.java
@@ -0,0 +1,202 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Vector;
+
+import org.apache.cordova.file.File;
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+public abstract class CaptureOperation implements Runnable {
+    // max number of media files to capture
+    protected long limit = 1;
+
+    // for sending results
+    protected String callbackId = null;
+
+    // list of captured media files
+    protected final Vector captureFiles = new Vector();
+
+    // media file queue
+    protected MediaQueue mediaQueue = null;
+
+    // used to interrupt thread
+    protected volatile Thread myThread;
+
+    // to determine if operation has been canceled
+    protected boolean canceled = false;
+
+    /**
+     * Creates and starts a capture operation on a new thread.
+     *
+     * @param limit
+     *            maximum number of media files to capture
+     * @param callbackId
+     *            the callback to receive the files
+     * @param queue
+     *            the queue from which to retrieve captured media files
+     */
+    public CaptureOperation(long limit, String callbackId, MediaQueue queue) {
+        if (limit > 1) {
+            this.limit = limit;
+        }
+
+        this.callbackId = callbackId;
+        this.mediaQueue = queue;
+        this.myThread = new Thread(this);
+    }
+
+    /**
+     * Waits for media file to be captured.
+     */
+    public void run() {
+        if (myThread == null) {
+            return; // stopped before started
+        }
+
+        Logger.log(this.getClass().getName() + ": " + callbackId + " started");
+
+        // tasks to be run before entering main loop
+        setup();
+
+        // capture until interrupted or we've reached capture limit
+        Thread thisThread = Thread.currentThread();
+        String filePath = null;
+        while (myThread == thisThread && captureFiles.size() < limit) {
+            try {
+                // consume file added to media capture queue
+                filePath = mediaQueue.remove();
+            }
+            catch (InterruptedException e) {
+                Logger.log(this.getClass().getName() + ": " + callbackId + " interrupted");
+                // and we're done
+                break;
+            }
+            processFile(filePath);
+        }
+
+        // perform cleanup tasks
+        teardown();
+
+        // process captured results
+        processResults();
+
+        // unregister the operation from the controller
+        CaptureControl.getCaptureControl().removeCaptureOperation(this);
+
+        Logger.log(this.getClass().getName() + ": " + callbackId + " finished");
+    }
+
+    /**
+     * Starts this capture operation on a new thread.
+     */
+    protected void start() {
+        if (myThread == null) {
+            return; // stopped before started
+        }
+        myThread.start();
+    }
+
+    /**
+     * Stops the operation.
+     */
+    public void stop() {
+        // interrupt capture thread
+        Thread tmpThread = myThread;
+        myThread = null;
+        if (tmpThread != null && tmpThread.isAlive()) {
+            tmpThread.interrupt();
+        }
+    }
+
+    /**
+     * Cancels the operation.
+     */
+    public void cancel() {
+        canceled = true;
+        stop();
+    }
+
+    /**
+     * Processes the results of the capture operation.
+     */
+    protected void processResults() {
+        // process results
+        if (!canceled) {
+            // invoke appropriate callback
+            if (captureFiles.size() > 0) {
+                // send capture files
+                MediaCapture.captureSuccess(captureFiles, callbackId);
+            }
+            else {
+                // error
+                MediaCapture.captureError(callbackId);
+            }
+        }
+        else {
+            removeCaptureFiles();
+        }
+    }
+
+    /**
+     * Adds a media file to list of collected media files for this operation.
+     *
+     * @param file
+     *            object containing media file properties
+     */
+    protected void addCaptureFile(File file) {
+        captureFiles.addElement(file);
+    }
+
+    /**
+     * Removes captured files from the file system.
+     */
+    protected void removeCaptureFiles() {
+        for (Enumeration e = captureFiles.elements(); e.hasMoreElements();) {
+            File file = (File) e.nextElement();
+            try {
+                FileUtils.delete(file.getFullPath());
+            }
+            catch (IOException ignored) {
+            }
+        }
+    }
+
+    /**
+     * Override this method to perform tasks before the operation starts.
+     */
+    protected void setup() {
+    }
+
+    /**
+     * Override this method to perform tasks after the operation has
+     * stopped.
+     */
+    protected void teardown() {
+    }
+
+    /**
+     * Subclasses must implement this method to process a captured media file.
+     * @param filePath the full path of the media file
+     */
+    protected abstract void processFile(final String filePath);
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureListener.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureListener.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureListener.java
new file mode 100644
index 0000000..4906ee8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureListener.java
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import net.rim.device.api.io.file.FileSystemJournal;
+import net.rim.device.api.io.file.FileSystemJournalEntry;
+import net.rim.device.api.io.file.FileSystemJournalListener;
+
+/**
+ * Listens for image files that are added to file system.
+ * <p>
+ * The file system notifications will arrive on the application event thread.
+ * When it receives a notification, it adds the image file path to a MediaQueue
+ * so that the capture thread can process the file.
+ */
+class ImageCaptureListener implements FileSystemJournalListener {
+
+    /**
+     * Used to track file system changes.
+     */
+    private long lastUSN = 0;
+
+    /**
+     * Collection of media files.
+     */
+    private MediaQueue queue = null;
+
+    /**
+     * Constructor.
+     */
+    ImageCaptureListener(MediaQueue queue) {
+        this.queue = queue;
+    }
+
+    /**
+     * Listens for file system changes.  When a JPEG file is added, we process
+     * it and send it back.
+     */
+    public void fileJournalChanged()
+    {
+        // next sequence number file system will use
+        long USN = FileSystemJournal.getNextUSN();
+
+        for (long i = USN - 1; i >= lastUSN && i < USN; --i)
+        {
+            FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);
+            if (entry == null)
+            {
+                break;
+            }
+
+            if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED)
+            {
+                String path = entry.getPath();
+                if (path != null && path.indexOf(".jpg") != -1)
+                {
+                    // add file path to the capture queue
+                    queue.add("file://" + path);
+                    break;
+                }
+            }
+        }
+
+        // remember the file journal change number,
+        // so we don't search the same events again and again
+        lastUSN = USN;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureOperation.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureOperation.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureOperation.java
new file mode 100644
index 0000000..a831dc2
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/capture/ImageCaptureOperation.java
@@ -0,0 +1,161 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.capture;
+
+import java.io.IOException;
+import java.util.Date;
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+
+import org.apache.cordova.file.File;
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.io.MIMETypeAssociations;
+import net.rim.device.api.ui.UiApplication;
+
+public class ImageCaptureOperation extends CaptureOperation {
+    // content type
+    public static String CONTENT_TYPE = "image/";
+
+    // file system listener
+    private ImageCaptureListener listener = null;
+
+    /**
+     * Creates and starts an image capture operation.
+     *
+     * @param limit
+     *            maximum number of media files to capture
+     * @param callbackId
+     *            the callback to receive the files
+     * @param queue
+     *            the queue from which to retrieve captured media files
+     */
+    public ImageCaptureOperation(long limit, String callbackId, MediaQueue queue) {
+        super(limit, callbackId, queue);
+
+        // listener to capture image files added to file system
+        this.listener = new ImageCaptureListener(queue);
+
+        start();
+    }
+
+    /**
+     * Registers file system listener and launches native camera application.
+     */
+    protected void setup() {
+        // register listener for files being written
+        synchronized(UiApplication.getEventLock()) {
+            UiApplication.getUiApplication().addFileSystemJournalListener(listener);
+        }
+
+        // launch the native camera application
+        CameraControl.launchCamera();
+    }
+
+    /**
+     * Unregisters file system listener and closes native camera application.
+     */
+    protected void teardown() {
+        // remove file system listener
+        synchronized(UiApplication.getEventLock()) {
+            UiApplication.getUiApplication().removeFileSystemJournalListener(listener);
+        }
+
+        // close the native camera application
+        CameraControl.closeCamera();
+    }
+
+    /**
+     * Waits for image file to be written to file system and retrieves its file
+     * properties.
+     *
+     * @param filePath
+     *            the full path of the media file
+     */
+    protected void processFile(final String filePath) {
+        Logger.log(this.getClass().getName() + ": processing file: " + filePath);
+
+        // wait for file to finish writing and add it to captured files
+        addCaptureFile(getMediaFile(filePath));
+    }
+
+    /**
+     * Waits for file to be fully written to the file system before retrieving
+     * its file properties.
+     *
+     * @param filePath
+     *            Full path of the image file
+     * @throws IOException
+     */
+    private File getMediaFile(String filePath) {
+        File file = new File(FileUtils.stripSeparator(filePath));
+
+        // time begin waiting for file write
+        long start = (new Date()).getTime();
+
+        // wait for the file to be fully written, then grab its properties
+        FileConnection fconn = null;
+        try {
+            fconn = (FileConnection) Connector.open(filePath, Connector.READ);
+            if (fconn.exists()) {
+                // wait for file to be fully written
+                long fileSize = fconn.fileSize();
+                long size = 0;
+                Thread thisThread = Thread.currentThread();
+                while (myThread == thisThread) {
+                    try {
+                        Thread.sleep(100);
+                    }
+                    catch (InterruptedException e) {
+                        break;
+                    }
+                    size = fconn.fileSize();
+                    if (size == fileSize) {
+                        break;
+                    }
+                    fileSize = size;
+                }
+                Logger.log(this.getClass().getName() + ": " + filePath + " size="
+                        + Long.toString(fileSize) + " bytes");
+
+                // retrieve file properties
+                file.setLastModifiedDate(fconn.lastModified());
+                file.setName(FileUtils.stripSeparator(fconn.getName()));
+                file.setSize(fileSize);
+                file.setType(MIMETypeAssociations.getMIMEType(filePath));
+            }
+        }
+        catch (IOException e) {
+            Logger.log(this.getClass().getName() + ": " + e);
+        }
+        finally {
+            try {
+                if (fconn != null) fconn.close();
+            } catch (IOException ignored) {}
+        }
+
+        // log time it took to write the file
+        long end = (new Date()).getTime();
+        Logger.log(this.getClass().getName() + ": wait time="
+                + Long.toString(end - start) + " ms");
+
+        return file;
+    }
+}


[32/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/AudioPlayer.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/AudioPlayer.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/AudioPlayer.java
new file mode 100644
index 0000000..9958cf0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/AudioPlayer.java
@@ -0,0 +1,654 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.media;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+import javax.microedition.media.Manager;
+import javax.microedition.media.MediaException;
+import javax.microedition.media.Player;
+import javax.microedition.media.PlayerListener;
+import javax.microedition.media.control.RecordControl;
+import javax.microedition.media.control.VolumeControl;
+import javax.microedition.media.protocol.DataSource;
+
+import net.rim.device.api.media.protocol.ByteArrayInputStreamDataSource;
+
+import org.apache.cordova.util.FileUtils;
+import org.apache.cordova.util.Logger;
+
+/**
+ * This class implements the audio playback and recording capabilities used by
+ * Cordova. It is called by the Media Cordova class. Only one file can be played
+ * or recorded per class instance.
+ *
+ * Supports playing audio locally and remotely. Files located within the
+ * application package must be prefixed with "local:///". If no URI prefix
+ * (file, http, local) is found, file is assumed to be on device and "file:///"
+ * prefix added.
+ */
+public class AudioPlayer implements PlayerListener {
+
+    private static final String LOG_TAG = "AudioPlayer: ";
+
+    // Media states
+    public static final int MEDIA_NONE = 0;
+    public static final int MEDIA_STARTING = 1;
+    public static final int MEDIA_RUNNING = 2;
+    public static final int MEDIA_PAUSED = 3;
+    public static final int MEDIA_STOPPED = 4;
+
+    // Media message ids
+    private static final int MEDIA_STATE = 1;
+    private static final int MEDIA_DURATION = 2;
+    private static final int MEDIA_POSITION = 3;
+    private static final int MEDIA_ERROR = 9;
+
+    // Media error codes
+    private static final int MEDIA_ERR_NONE_ACTIVE = 0;
+    private static final int MEDIA_ERR_ABORTED = 1;
+    private static final int MEDIA_ERR_NETWORK = 2;
+    private static final int MEDIA_ERR_DECODE = 3;
+    private static final int MEDIA_ERR_NONE_SUPPORTED = 4;
+
+    private final Media handler;
+    private final String id;
+    private int state = MEDIA_NONE; // State of recording or playback
+    private String audioFile = null; // File name to play or record to
+    private float duration = -1; // Duration of audio
+
+    private Player recorder = null; // Audio recording object
+    private RecordControl recorderControl = null;
+    private ByteArrayOutputStream recorderOutput = null;
+
+    private Player player = null; // Audio player object
+    private boolean prepareOnly = false;
+
+    private long prevPos = 0;
+    private long adjustTime = 0;
+    private long previousTime = 0;
+
+    private long lastPlay = System.currentTimeMillis();
+
+    private boolean buffering = false;
+
+    /**
+     * Constructor.
+     *
+     * @param handler
+     *            The audio handler object
+     * @param id
+     *            The id of this audio player
+     */
+    public AudioPlayer(Media handler, String id) {
+        this.handler = handler;
+        this.id = id;
+    }
+
+    /**
+     * Destroy stop audio playing or recording and free resources.
+     */
+    public synchronized void destroy() {
+        // Stop any play or record
+        destroyPlayer();
+        if (recorder != null) {
+            stopRecording();
+        }
+    }
+
+    /**
+     * Stop and free the player.
+     */
+    private void destroyPlayer() {
+        if (player != null) {
+            if (state == MEDIA_RUNNING || state == MEDIA_PAUSED) {
+                stopPlaying();
+            }
+            player.removePlayerListener(this);
+            player.close();
+            player = null;
+        }
+    }
+
+    /**
+     * Get current position of playback.
+     *
+     * @return position as a floating point number indicating number of seconds
+     *         or -1 if not playing
+     */
+    public synchronized float getCurrentPosition() {
+        // Current position is only valid when running, paused or buffering.
+        if (state == MEDIA_RUNNING || state == MEDIA_PAUSED || buffering) {
+            // The time returned by getMediaTime() is only updated every second.
+            // Keep track of time between updates in order to provide
+            // millisecond granularity.
+            long curPos = player.getMediaTime();
+
+            // Media time is within the 1 second granularity window so add time
+            // since last update.
+            if (curPos == prevPos && state == MEDIA_RUNNING) {
+                if (previousTime == 0) {
+                    previousTime = System.currentTimeMillis();
+                } else {
+                    long newTime = System.currentTimeMillis();
+                    // Convert from milliseconds to microseconds.
+                    adjustTime += ((newTime - previousTime) * 1000);
+                    previousTime = newTime;
+                    curPos += adjustTime;
+                }
+            } else {
+                prevPos = curPos;
+                previousTime = System.currentTimeMillis();
+                adjustTime = 0;
+            }
+
+            // Convert from microseconds to floating point seconds.
+            float time = curPos / 1000000.0f;
+            sendStatus(MEDIA_POSITION, time);
+            return time;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * Get the duration of the audio file.
+     *
+     * @param file
+     *            The name of the audio file.
+     * @return duration as a floating point number indicating number of seconds
+     *         or -1 = can't be determined or -2 = not allowed
+     */
+    public synchronized float getDuration(String file) {
+        // Can't get duration of recording
+        if (recorder != null) {
+            return (-2); // not allowed
+        }
+
+        // If audio file already loaded and started, then return duration
+        if (player != null) {
+            return duration;
+        }
+
+        // If no player yet, then create one
+        else {
+            prepareOnly = true;
+            startPlaying(file);
+            // This will only return value for local, since streaming
+            // file hasn't been read yet.
+            return duration;
+        }
+    }
+
+    /**
+     * Get the audio state.
+     *
+     * @return int
+     */
+    public synchronized int getState() {
+        return state;
+    }
+
+    /**
+     * Pause playing.
+     */
+    public synchronized void pausePlaying() {
+        // If playing, then pause
+        if (state == MEDIA_RUNNING) {
+            try {
+                player.stop();
+                setState(MEDIA_PAUSED);
+            } catch (MediaException e) {
+                Logger.log(LOG_TAG + "pausePlaying() Error: " + e.getMessage());
+                sendError(MEDIA_ERR_ABORTED);
+            }
+        } else {
+            Logger.log(LOG_TAG
+                    + "pausePlaying() Error: called during invalid state: "
+                    + state);
+            sendError(MEDIA_ERR_NONE_ACTIVE);
+        }
+    }
+
+    /**
+     * PlayerListener interface callback when an event occurs in the player.
+     *
+     * @see javax.microedition.media.PlayerListener#playerUpdate(javax.microedition.media.Player,
+     *      java.lang.String, java.lang.Object)
+     */
+    public void playerUpdate(Player player, String event, Object eventData) {
+        if (BUFFERING_STARTED.equals(event)) {
+            buffering = true;
+        } else if (BUFFERING_STOPPED.equals(event)) {
+            buffering = false;
+            setState(MEDIA_RUNNING);
+        } else if (DURATION_UPDATED.equals(event)) {
+            if (eventData != null && eventData instanceof Long) {
+                // Convert duration from microseconds to seconds.
+                duration = ((Long) eventData).longValue() / 1000000.0f;
+                sendStatus(MEDIA_DURATION, duration);
+            }
+        } else if (END_OF_MEDIA.equals(event)) {
+            // Update the final position before stopping the player.
+            if (eventData != null && eventData instanceof Long) {
+                sendStatus(MEDIA_POSITION,
+                        ((Long) eventData).longValue() / 1000000.0f);
+            }
+            stopPlaying();
+        } else if (ERROR.equals(event)) {
+            // Send error notification to JavaScript
+            if (eventData != null && eventData instanceof String) {
+                try {
+                    int code = Integer.parseInt((String) eventData);
+                    sendError(code);
+                } catch (NumberFormatException ne) {
+                    Logger.log(LOG_TAG + "playerUpdate(): Player id(" + id + ") received error: "
+                            + eventData);
+                }
+            } else {
+                Logger.log(LOG_TAG + "playerUpdate(): Player id(" + id + ") received error: " + eventData);
+            }
+            destroy();
+        }
+    }
+
+    /**
+     * Seek or jump to a new time in the track.
+     *
+     * @throws MediaException
+     */
+    public synchronized void seekToPlaying(int milliseconds) {
+        if (player != null) {
+            try {
+                // Convert milliseconds to microseconds.
+                player.setMediaTime(milliseconds > 0 ? milliseconds * 1000
+                        : milliseconds);
+                sendStatus(MEDIA_POSITION, milliseconds / 1000.0f);
+            } catch (MediaException e) {
+                Logger.log(LOG_TAG + "seekToPlaying() Error: " + e.getMessage());
+                sendError(MEDIA_ERR_ABORTED);
+            }
+        }
+    }
+
+    /**
+     * Set the volume for audio player
+     *
+     * @param volume
+     *            volume level 0.0-1.0
+     */
+    public synchronized void setVolume(float volume) {
+        if (player != null) {
+            if (player.getState() >= Player.REALIZED) {
+                VolumeControl vc = (VolumeControl) player
+                        .getControl("VolumeControl");
+                // Native volume level range is 0-100
+                vc.setLevel((int) (volume * 100));
+            }
+        }
+    }
+
+    /**
+     * Start or resume playing audio file.
+     *
+     * @param file
+     *            The name of the audio file.
+     */
+    public synchronized void startPlaying(String file) {
+        try {
+            if (recorder != null) {
+                Logger.log(LOG_TAG
+                        + "startPlaying() Error: Can't play in record mode.");
+                sendError(MEDIA_ERR_ABORTED);
+            }
+
+            // If this is a new request to play audio, or stopped
+            else if (player == null || state == MEDIA_STOPPED) {
+                setState(MEDIA_STARTING);
+
+                if (file == null || file.length() == 0) {
+                    Logger.log(LOG_TAG
+                            + "startPlaying(): Input file not specified.");
+                    sendError(MEDIA_ERR_ABORTED);
+                    setState(MEDIA_NONE);
+                    destroy();
+                    return;
+                }
+
+                // If the player was previously used, need to check if it needs
+                // recreated to pick up file changes. Cases when the player
+                // needs recreated:
+                //     1. New source file was specified.
+                //     2. File is local and has been modified since last play.
+                if (player != null) {
+                    if (!file.equals(audioFile)) {
+                        destroyPlayer();
+                    } else if (!isStreaming(file)) {
+                        // File needs to follow the local or file URI protocol
+                        // so if neither prefix exists assume a file URI and add
+                        // the "file:///" prefix.
+                        file = FileUtils.prefixFileURI(file);
+                        FileConnection fconn = null;
+                        try {
+                            fconn = (FileConnection) Connector.open(file,
+                                    Connector.READ);
+                            if (fconn.exists()) {
+                                if (fconn.lastModified() > lastPlay) {
+                                    destroyPlayer();
+                                }
+                            }
+                        } catch (Exception e) {
+                            // Ignore
+                        } finally {
+                            try {
+                                if (fconn != null) {
+                                    fconn.close();
+                                }
+                            } catch (IOException ignored) {
+                            }
+                        }
+                    }
+                }
+
+                // At this point if player is not null then the file previously
+                // played is still valid so just reset the current position.
+                if (player != null) {
+                    player.setMediaTime(0);
+                }
+                // Otherwise, create a new one
+                else {
+                    // If streaming file
+                    if (isStreaming(file)) {
+                        player = Manager.createPlayer(file);
+                    } else {
+                        // File needs to follow the local or file URI protocol
+                        // so if neither prefix exists assume a file URI and add
+                        // the "file:///" prefix.
+                        file = FileUtils.prefixFileURI(file);
+
+                        String contentType = "audio/mp3";
+                        if (file.endsWith(".amr")) {
+                            contentType = "audio/amr";
+                        } else if (file.endsWith(".wav")) {
+                            contentType = "audio/wav";
+                        }
+
+                        DataSource dataSource = new ByteArrayInputStreamDataSource(
+                                new ByteArrayInputStream(FileUtils.readFile(
+                                        file, Connector.READ)), contentType);
+                        player = Manager.createPlayer(dataSource);
+                    }
+                    audioFile = file;
+                    player.addPlayerListener(this);
+                }
+
+                lastPlay = System.currentTimeMillis();
+                player.realize();
+                player.prefetch();
+
+                // Get duration as floating point seconds.
+                duration = player.getDuration() == Player.TIME_UNKNOWN ? Player.TIME_UNKNOWN
+                        : player.getDuration() / 1000000.0f;
+
+                sendStatus(MEDIA_DURATION, duration);
+
+                if (!prepareOnly) {
+                    player.start();
+                }
+                prepareOnly = false;
+            }
+
+            // If previously existing player is still valid.
+            else {
+                // If player has been paused, then resume playback
+                if (state == MEDIA_PAUSED || state == MEDIA_STARTING) {
+                    player.start();
+                    setState(MEDIA_RUNNING);
+                } else {
+                    Logger.log(LOG_TAG
+                            + "Error: startPlaying() called during invalid state: "
+                            + state);
+                    sendError(MEDIA_ERR_ABORTED);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            Logger.log(LOG_TAG + "startPlaying() Error: " + e.getMessage());
+            sendError(MEDIA_ERR_ABORTED);
+        }
+    }
+
+    /**
+     * Start recording the specified file.
+     *
+     * @param file
+     *            The name of the file
+     */
+    public synchronized void startRecording(String file) {
+        try {
+            if (player != null) {
+                Logger.log(LOG_TAG
+                        + "startRecording() Error: Can't record in play mode.");
+                sendError(MEDIA_ERR_ABORTED);
+            } else if (recorder == null) {
+
+                if (file == null || file.length() == 0) {
+                    Logger.log(LOG_TAG
+                            + "startRecording() Error: Output file not specified.");
+                    sendError(MEDIA_ERR_ABORTED);
+                    return;
+                }
+                setState(MEDIA_STARTING);
+                file = FileUtils.prefixFileURI(file);
+
+                recorder = Manager.createPlayer("capture://audio");
+                recorder.addPlayerListener(this);
+                recorder.realize();
+                recorderControl = (RecordControl) recorder
+                        .getControl("RecordControl");
+                recorderOutput = new ByteArrayOutputStream();
+                recorderControl.setRecordStream(recorderOutput);
+                recorderControl.startRecord();
+                recorder.start();
+                audioFile = file;
+                setState(MEDIA_RUNNING);
+
+            } else {
+                Logger.log(LOG_TAG
+                        + "startRecording() Error: Already recording.");
+                sendError(MEDIA_ERR_ABORTED);
+            }
+        } catch (Exception e) {
+            Logger.log(LOG_TAG
+                    + "startRecording() Error: Failed to start recording. "
+                    + e.getMessage());
+            if (recorder != null) {
+                recorder.removePlayerListener(this);
+                recorder.close();
+                recorder = null;
+            }
+            if (recorderControl != null) {
+                try {
+                    recorderControl.reset();
+                } catch (IOException e1) {
+                    // Ignore
+                }
+                recorderControl = null;
+            }
+            if (recorderOutput != null) {
+                try {
+                    recorderOutput.close();
+                } catch (IOException e1) {
+                    // Ignore
+                }
+                recorderOutput = null;
+            }
+
+            setState(MEDIA_NONE);
+        }
+    }
+
+    /**
+     * Stop playing the audio file.
+     */
+    public synchronized void stopPlaying() {
+        if (state == MEDIA_RUNNING || state == MEDIA_PAUSED) {
+            try {
+                player.stop();
+                player.setMediaTime(0);
+            } catch (MediaException e) {
+                Logger.log(LOG_TAG + "stopPlaying() Error: " + e.getMessage());
+                sendError(MEDIA_ERR_ABORTED);
+            }
+            setState(MEDIA_STOPPED);
+        } else {
+            Logger.log(LOG_TAG + "stopPlaying() called during invalid state: "
+                    + state);
+            sendError(MEDIA_ERR_NONE_ACTIVE);
+        }
+    }
+
+    /**
+     * Stop recording and save to the file specified when recording started.
+     */
+    public synchronized void stopRecording() {
+        DataOutputStream output = null;
+        FileConnection conn = null;
+
+        try {
+            if (recorder != null) {
+                if (state == MEDIA_RUNNING) {
+                    recorderControl.commit();
+                    byte data[] = recorderOutput.toByteArray();
+
+                    conn = (FileConnection) Connector.open(audioFile,
+                            Connector.READ_WRITE);
+                    if (conn.exists()) {
+                        conn.delete();
+                        conn.close();
+                        conn = (FileConnection) Connector.open(audioFile,
+                                Connector.READ_WRITE);
+                    }
+                    conn.create();
+                    output = conn.openDataOutputStream();
+                    output.write(data);
+                    output.flush();
+                }
+            }
+        } catch (IOException e) {
+            // Ignore
+            Logger.log(LOG_TAG + "stopRecording() Error: " + e.getMessage());
+        } finally {
+            if (recorderOutput != null) {
+                try {
+                    recorderOutput.close();
+                } catch (IOException e) {
+                    // Ignore
+                    Logger.log(LOG_TAG
+                            + "stopRecording() Failed to close recorder output. "
+                            + e.getMessage());
+                }
+                recorderOutput = null;
+            }
+            if (recorder != null) {
+                recorder.removePlayerListener(this);
+                recorder.close();
+                recorder = null;
+            }
+
+            if (recorderControl != null) {
+                recorderControl.stopRecord();
+                recorderControl = null;
+            }
+
+            if (output != null) {
+                try {
+                    output.close();
+                } catch (IOException e) {
+                    // Ignore
+                    Logger.log(LOG_TAG
+                            + "stopRecording() Failed to close output file. "
+                            + e.getMessage());
+                }
+                output = null;
+            }
+
+            if (conn != null) {
+                try {
+                    conn.close();
+                } catch (IOException e) {
+                    // Ignore
+                    Logger.log(LOG_TAG
+                            + "stopRecording() Failed to close connection. "
+                            + e.getMessage());
+                }
+            }
+            setState(MEDIA_STOPPED);
+        }
+    }
+
+    /**
+     * Determine if playback file is streaming or local. It is streaming if file
+     * name starts with "http://"
+     *
+     * @param file
+     *            The file name
+     * @return T=streaming, F=local
+     */
+    private boolean isStreaming(String file) {
+        if (file.startsWith("http://") || file.startsWith("https://")) {
+            return true;
+        }
+        return false;
+    }
+
+    private void sendError(int code) {
+        handler.invokeScript("cordova.require('cordova/plugin/Media').onStatus('"
+                + id + "', " + MEDIA_ERROR + ", { \"code\":" + code + "});");
+    }
+
+    private void sendStatus(int msg, float value) {
+        handler.invokeScript("cordova.require('cordova/plugin/Media').onStatus('"
+                + id + "', " + msg + ", " + value + ");");
+    }
+
+    private void sendStatus(int msg, int value) {
+        handler.invokeScript("cordova.require('cordova/plugin/Media').onStatus('"
+                + id + "', " + msg + ", " + value + ");");
+    }
+
+    /**
+     * Set the state and send it to JavaScript.
+     *
+     * @param state
+     */
+    private synchronized void setState(int state) {
+        // Only send state back to JavaScript if it has changed.
+        if (this.state != state) {
+            sendStatus(MEDIA_STATE, state);
+        }
+
+        this.state = state;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/Media.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/Media.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/Media.java
new file mode 100644
index 0000000..f1e2b27
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/media/Media.java
@@ -0,0 +1,344 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.media;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.util.Logger;
+
+/**
+ * This plugin provides the ability to play and record audio. The file can be
+ * local or over a network using http.
+ *
+ * Audio formats supported (tested): .mp3, .wav, .amr
+ *
+ * Supports playing audio locally and remotely. Files located within the
+ * application package must be prefixed with "local:///". If no URI prefix
+ * (file, http, local) is found, file is assumed to be on device and "file:///"
+ * prefix added.
+ */
+public class Media extends Plugin {
+
+    private static final String LOG_TAG = "Media: ";
+    private final Hashtable players = new Hashtable();
+
+    // Cross-platform defined actions
+    private static final String CREATE = "create";
+    private static final String START_RECORDING = "startRecordingAudio";
+    private static final String STOP_RECORDING = "stopRecordingAudio";
+    private static final String START_PLAYING = "startPlayingAudio";
+    private static final String STOP_PLAYING = "stopPlayingAudio";
+    private static final String SEEK_TO = "seekToAudio";
+    private static final String PAUSE_PLAYING = "pausePlayingAudio";
+    private static final String SET_VOLUME = "setVolume";
+    private static final String GET_POSITION = "getCurrentPositionAudio";
+    private static final String GET_DURATION = "getDurationAudio";
+    private static final String RELEASE = "release";
+
+    /**
+     * Executes the request and returns PluginResult.
+     *
+     * @param action
+     *            The action to execute.
+     * @param args
+     *            JSONArry of arguments for the plugin.
+     * @param callbackId
+     *            The callback id used when calling back into JavaScript.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+        PluginResult.Status status = PluginResult.Status.NO_RESULT;
+
+        try {
+            if (CREATE.equals(action)) {
+                createMedia(args.getString(0), args.getString(1));
+                return new PluginResult(PluginResult.Status.OK, "");
+            } else if (START_RECORDING.equals(action)) {
+                startRecordingAudio(args.getString(0), args.getString(1));
+            } else if (STOP_RECORDING.equals(action)) {
+                stopRecordingAudio(args.getString(0));
+            } else if (START_PLAYING.equals(action)) {
+                startPlayingAudio(args.getString(0), args.getString(1));
+            } else if (SEEK_TO.equals(action)) {
+                seekToAudio(args.getString(0), args.getInt(1));
+            } else if (PAUSE_PLAYING.equals(action)) {
+                pausePlayingAudio(args.getString(0));
+            } else if (STOP_PLAYING.equals(action)) {
+                stopPlayingAudio(args.getString(0));
+            } else if (SET_VOLUME.equals(action)) {
+                try {
+                    float level = Float.parseFloat(args.getString(1));
+                    setVolume(args.getString(0), level);
+                } catch (NumberFormatException nfe) {
+                    Logger.log(LOG_TAG + "execute(): Failed to convert volume level: "
+                            + args.getString(1) + " " + nfe.getMessage());
+                    return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
+                }
+            } else if (GET_POSITION.equals(action)) {
+                float f = getCurrentPositionAudio(args.getString(0));
+                return new PluginResult(PluginResult.Status.OK, f);
+            } else if (GET_DURATION.equals(action)) {
+                float f = getDurationAudio(args.getString(0), args.getString(1));
+                return new PluginResult(PluginResult.Status.OK, f);
+            } else if (RELEASE.equals(action)) {
+                boolean b = release(args.getString(0));
+                return new PluginResult(PluginResult.Status.OK, b);
+            } else {
+                Logger.log(LOG_TAG + "execute(): Invalid action: " + action);
+                return new PluginResult(PluginResult.Status.INVALID_ACTION,
+                        "Invalid action: " + action);
+            }
+            return new PluginResult(status, "");
+        } catch (JSONException e) {
+            Logger.log(LOG_TAG + "execute() Error: " + e.getMessage());
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
+        }
+    }
+
+    /**
+     * Identifies if action to be executed returns a value and should be run
+     * synchronously.
+     *
+     * @param action
+     *            The action to execute
+     * @return T=returns value
+     */
+    public boolean isSynch(String action) {
+        if (CREATE.equals(action) || GET_POSITION.equals(action)
+                || GET_DURATION.equals(action) || RELEASE.equals(action)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Stop all audio players and recorders.
+     */
+    public void onDestroy() {
+        Enumeration keys = players.keys();
+        while (keys.hasMoreElements()) {
+            AudioPlayer audio = (AudioPlayer) players.get(keys.nextElement());
+            if (audio != null) {
+                audio.destroy();
+            }
+        }
+
+        players.clear();
+    }
+
+    /**
+     * Start or resume playing audio file.
+     *
+     * @param id
+     *            The id of the audio player
+     * @param file
+     *            The name of the audio file.
+     */
+    private void createMedia(String id, String file) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio == null) {
+            audio = new AudioPlayer(this, id);
+            players.put(id, audio);
+        }
+    }
+
+    /**
+     * Get current position of playback.
+     *
+     * @param id
+     *            The id of the audio player
+     * @return position in msec
+     */
+    private float getCurrentPositionAudio(String id) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio != null) {
+            return (audio.getCurrentPosition());
+        }
+        return -1;
+    }
+
+    /**
+     * Get the duration of the audio file.
+     *
+     * @param id
+     *            The id of the audio player
+     * @param file
+     *            The name of the audio file.
+     * @return The duration in msec.
+     */
+    private float getDurationAudio(String id, String file) {
+        // Get audio file
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio != null) {
+            return (audio.getDuration(file));
+        }
+
+        // If not already open, then open the file
+        audio = new AudioPlayer(this, id);
+        players.put(id, audio);
+        return (audio.getDuration(file));
+    }
+
+    /**
+     * Pause playing.
+     *
+     * @param id
+     *            The id of the audio player
+     */
+    private void pausePlayingAudio(String id) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio != null) {
+            audio.pausePlaying();
+        } else {
+            Logger.log(LOG_TAG
+                    + "pausePlayingAudio() Error: Unknown Audio Player " + id);
+        }
+    }
+
+    /**
+     * Release the audio player instance to save memory.
+     *
+     * @param id
+     *            The id of the audio player
+     */
+    private boolean release(String id) {
+        if (!players.containsKey(id)) {
+            Logger.log(LOG_TAG + "release() Error: Unknown Audio Player " + id);
+            return false;
+        }
+
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        players.remove(id);
+        audio.destroy();
+        return true;
+    }
+
+    /**
+     * Seek to a location.
+     *
+     * @param id
+     *            The id of the audio player
+     * @param miliseconds
+     *            int: number of milliseconds to skip 1000 = 1 second
+     */
+    private void seekToAudio(String id, int milliseconds) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio != null) {
+            audio.seekToPlaying(milliseconds);
+        } else {
+            Logger.log(LOG_TAG + "seekToAudio() Error: Unknown Audio Player "
+                    + id);
+        }
+    }
+
+    /**
+     * Set the volume for an audio device
+     *
+     * @param id
+     *            The id of the audio player
+     * @param volume
+     *            Volume to adjust to 0 - 1
+     */
+    private void setVolume(String id, float volume) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio != null) {
+            audio.setVolume(volume);
+        } else {
+            Logger.log(LOG_TAG + "setVolume() Error: Unknown Audio Player "
+                    + id);
+        }
+    }
+
+    /**
+     * Start or resume playing audio file.
+     *
+     * @param id
+     *            The id of the audio player
+     * @param file
+     *            The name of the audio file.
+     */
+    private void startPlayingAudio(String id, String file) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio == null) {
+            audio = new AudioPlayer(this, id);
+            players.put(id, audio);
+        }
+        audio.startPlaying(file);
+    }
+
+    /**
+     * Start recording and save the specified file.
+     *
+     * @param id
+     *            The id of the audio player
+     * @param file
+     *            The name of the file
+     */
+    private void startRecordingAudio(String id, String file) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio == null) {
+            audio = new AudioPlayer(this, id);
+            players.put(id, audio);
+        }
+
+        int state = audio.getState();
+        if (state == AudioPlayer.MEDIA_NONE
+                || state == AudioPlayer.MEDIA_STOPPED) {
+            audio.startRecording(file);
+        }
+    }
+
+    /**
+     * Stop playing the audio file.
+     *
+     * @param id
+     *            The id of the audio player
+     */
+    private void stopPlayingAudio(String id) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio != null) {
+            audio.stopPlaying();
+        } else {
+            Logger.log(LOG_TAG
+                    + "stopPlayingAudio() Error: Unknown Audio Player " + id);
+        }
+    }
+
+    /**
+     * Stop recording and save to the file specified when recording started.
+     *
+     * @param id
+     *            The id of the audio player
+     */
+    private void stopRecordingAudio(String id) {
+        AudioPlayer audio = (AudioPlayer) players.get(id);
+        if (audio != null) {
+            audio.stopRecording();
+            players.remove(id);
+        } else {
+            Logger.log(LOG_TAG
+                    + "stopRecordingAudio() Error: Unknown Audio Player " + id);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/ConnectionInfoAction.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/ConnectionInfoAction.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/ConnectionInfoAction.java
new file mode 100644
index 0000000..2a280e6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/ConnectionInfoAction.java
@@ -0,0 +1,355 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.network;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.system.Application;
+import net.rim.device.api.system.CoverageInfo;
+import net.rim.device.api.system.CoverageStatusListener;
+import net.rim.device.api.system.RadioInfo;
+import net.rim.device.api.system.RadioStatusListener;
+import net.rim.device.api.system.WLANConnectionListener;
+import net.rim.device.api.system.WLANInfo;
+
+/**
+ * Determines the current network data connection type and listens for changes
+ * to network coverage. This class is intended for use through the Network
+ * plug-in.
+ */
+public class ConnectionInfoAction {
+    // Return types
+    private static final String TYPE_UNKNOWN = "unknown";
+    private static final String TYPE_ETHERNET = "ethernet";
+    private static final String TYPE_WIFI = "wifi";
+    private static final String TYPE_2G = "2g";
+    private static final String TYPE_3G = "3g";
+    private static final String TYPE_4G = "4g";
+    private static final String TYPE_NONE = "none";
+
+    // Network status event values
+    private static final String OFFLINE = "offline";
+    private static final String ONLINE = "online";
+
+    // Network service support constants
+    private static final int DATA = RadioInfo.NETWORK_SERVICE_DATA;
+    private static final int TWO_G = RadioInfo.NETWORK_SERVICE_DATA
+            | RadioInfo.NETWORK_SERVICE_EDGE;
+    private static final int THREE_G = RadioInfo.NETWORK_SERVICE_EVDO_REV0
+            | RadioInfo.NETWORK_SERVICE_EVDO_REV0_ONLY
+            | RadioInfo.NETWORK_SERVICE_EVDO_REVA
+            | RadioInfo.NETWORK_SERVICE_EVDO_REVA_ONLY
+            | RadioInfo.NETWORK_SERVICE_UMTS;
+
+    // Listeners used to detect network changes
+    private RadioStatusListener radioListener = null;
+    private WLANConnectionListener wlanListener = null;
+    private CoverageStatusListener coverageListener = null;
+
+    // Variable indicating whether the user has disabled mobile data
+    private Boolean dataDisabled = Boolean.FALSE;
+
+    // The set of call back IDs to send results to. Using Hashtable because
+    // BlackBerry does not support Collections. There should only ever be one
+    // call back ID, but this allows multiple.
+    private Hashtable callbackIds = new Hashtable();
+
+    private String prevType = TYPE_NONE;
+    private String prevEvent = OFFLINE;
+
+    /**
+     * Determines the current network data connection type. Listeners are
+     * registered to return additional results when network state changes.
+     *
+     * @param callbackId
+     *            The success call back ID to receive network type results.
+     * @return A PluginResult object with the success or failure result of the
+     *         operation. A success result includes information about the
+     *         currently active network type.
+     */
+    protected PluginResult getConnectionInfo(String callbackId) {
+
+        // Ensure that the dataDisabled variable is initialized.
+        setDataDisabled(CoverageInfo.getCoverageStatus(), false);
+
+        // Add the network change listeners if they have not been added.
+        addListeners(callbackId);
+
+        // Retrieve the current active connection type and build the return
+        // result.
+        PluginResult result = new PluginResult(PluginResult.Status.OK,
+                getConnectionType(true, true));
+
+        // Need to keep the call back since listeners have been registered to
+        // fire events on the specified call back ID.
+        result.setKeepCallback(true);
+
+        return result;
+    }
+
+    /**
+     * Removes all coverage listeners and clears the list of call back IDs. This
+     * method should be invoked when the Network plug-in's onDestroy is called.
+     */
+    protected synchronized void shutdown() {
+        if (radioListener != null) {
+            Application.getApplication().removeRadioListener(radioListener);
+            radioListener = null;
+        }
+
+        if (wlanListener != null) {
+            WLANInfo.removeListener(wlanListener);
+            wlanListener = null;
+        }
+
+        if (coverageListener != null) {
+            CoverageInfo.removeListener(coverageListener);
+            coverageListener = null;
+        }
+
+        callbackIds.clear();
+    }
+
+    /**
+     * Adds a RadioStatusListener, WLANConnectionListener and
+     * CoverageStatusListener to listen for various network change events. The
+     * listeners are only registered if they have not already been added. Each
+     * listener is used to detect different types of network change events.
+     *
+     * RadioStatusListener - Detects changes in cellular data coverage.
+     * WLANConnectionListener - Detects changes in wifi coverage.
+     * CoverageStatusListener - Used to detect changes in the mobile data config
+     *
+     * @param callbackId
+     *            The reference point to call back when a listener event occurs.
+     */
+    private synchronized void addListeners(String callbackId) {
+        callbackIds.put(callbackId, callbackId);
+
+        if (radioListener == null) {
+            radioListener = new RadioStatusListener() {
+                public void baseStationChange() {}
+                public void networkScanComplete(boolean success) {}
+
+                public void networkServiceChange(int networkId, int service) {
+                    // Cellular data change detected. If the user hasn't
+                    // disabled mobile data and wifi is not currently in use
+                    // return a result indicating the cellular data coverage
+                    // change.
+                    if (dataDisabled == Boolean.FALSE
+                            && WLANInfo.getWLANState() != WLANInfo.WLAN_STATE_CONNECTED) {
+                        if ((service & DATA) == 0) {
+                            sendResult(TYPE_NONE, OFFLINE);
+                        } else {
+                            // In the case where cell data and wifi was turned
+                            // off and then the user disabled mobile data
+                            // configuration, the mobile data config disablement
+                            // by the user isn't detected by the coverage status
+                            // listener so dataDisabled may not be accurate.
+                            // When service data is activated, have to make sure
+                            // that dataDisabled is properly set.
+                            setDataDisabled(CoverageInfo.getCoverageStatus(),
+                                    false);
+                            if (dataDisabled == Boolean.FALSE) {
+                                sendResult(getConnectionType(false, true),
+                                        ONLINE);
+                            }
+                        }
+                    }
+                }
+
+                public void networkStarted(int networkId, int service) {}
+                public void networkStateChange(int state) {}
+                public void pdpStateChange(int apn, int state, int cause) {}
+                public void radioTurnedOff() {}
+                public void signalLevel(int level) {}
+            };
+            Application.getApplication().addRadioListener(radioListener);
+        }
+
+        if (wlanListener == null) {
+            wlanListener = new WLANConnectionListener() {
+                public void networkConnected() {
+                    if (dataDisabled == Boolean.FALSE) {
+                        sendResult(TYPE_WIFI, ONLINE);
+                    }
+                }
+
+                public void networkDisconnected(int reason) {
+                    // Wifi was disconnected, if the user hasn't disabled mobile
+                    // data, check if cellular data coverage exists.
+                    if (dataDisabled == Boolean.FALSE) {
+                        String type = getConnectionType(false, true);
+                        String event = OFFLINE;
+                        if (!TYPE_NONE.equals(type)) {
+                            event = ONLINE;
+                        }
+                        sendResult(type, event);
+                    }
+                }
+            };
+            WLANInfo.addListener(wlanListener);
+        }
+
+        if (coverageListener == null) {
+            coverageListener = new CoverageStatusListener() {
+                public void coverageStatusChanged(int newCoverage) {
+                    // When coverage changes, check to determine if it is due
+                    // to the user disabling mobile data through configuration
+                    // flag.
+                    setDataDisabled(newCoverage, true);
+                }
+            };
+            CoverageInfo.addListener(coverageListener);
+        }
+    }
+
+    /**
+     * Determine the type of connection currently being used for data
+     * transmission on the device. If the user has disabled mobile data then
+     * TYPE_NONE is returned regardless of cellular or wifi radio state as this
+     * is the way the browser behaves. Otherwise, wifi and/or cellular radios
+     * are queried for state based on the passed in parameters.
+     *
+     * @param checkWLAN
+     *            Determines whether wifi radio state is queried or not.
+     * @param checkCell
+     *            Determines whether cellular radio state is queried or not.
+     * @return A string indicating one of the defined network connections types.
+     */
+    private String getConnectionType(boolean checkWLAN, boolean checkCell) {
+        String networkType = TYPE_NONE;
+
+        if (dataDisabled == Boolean.FALSE) {
+            // Detect if wifi is active and connected. If wifi is active it
+            // takes precedence over cellular data transmission.
+            if (checkWLAN
+                    && WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
+                networkType = TYPE_WIFI;
+            }
+
+            if (checkCell && TYPE_NONE.equals(networkType)
+                    && RadioInfo.isDataServiceOperational()) {
+
+                int activeServices = RadioInfo.getNetworkService();
+                networkType = TYPE_UNKNOWN;
+                if ((activeServices & THREE_G) != 0) {
+                    networkType = TYPE_3G;
+                } else if ((activeServices & TWO_G) != 0) {
+                    networkType = TYPE_2G;
+                }
+            }
+        }
+
+        return networkType;
+    }
+
+    /**
+     * Helper function to build and send the PluginResult to the saved call back
+     * IDs.
+     *
+     * @param type
+     *            The network connection type. This value should be null if the
+     *            specified event is "offline".
+     * @param event
+     *            The network event.
+     */
+    private void sendResult(String type, String event) {
+
+        // Only send the event if it is different then the last sent event.
+        synchronized (prevType) {
+            if (prevType != null && prevEvent != null && prevType.equals(type)
+                    && prevEvent.equals(event)) {
+                return;
+            } else {
+                prevType = type;
+                prevEvent = event;
+            }
+        }
+
+        PluginResult result = new PluginResult(PluginResult.Status.OK,
+                type);
+
+        // Must keep the call back active for future events.
+        result.setKeepCallback(true);
+
+        // Iterate through the saved call back IDs. Really should only ever be
+        // one.
+        for (Enumeration callbacks = this.callbackIds.elements(); callbacks
+                .hasMoreElements();) {
+            String callbackId = (String) callbacks.nextElement();
+            CordovaExtension.invokeSuccessCallback(callbackId, result);
+        }
+
+    }
+
+    /**
+     * Determines if the user has disabled mobile data through the user level
+     * configuration panels and optionally returns an "online" or "offline"
+     * result.
+     *
+     * @param newCoverage
+     *            A bit mask of CoverageInfo.COVERAGE_* flags indicating the
+     *            current coverage.
+     * @param returnResult
+     *            If true, return a result based on the value of the mobile data
+     *            configuration.
+     */
+    private void setDataDisabled(int newCoverage, boolean returnResult) {
+
+        boolean isRadioData = (RadioInfo.getNetworkService() & DATA) != 0;
+        boolean wlanConnected = WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED;
+        boolean eventDetected = false;
+        String event = OFFLINE;
+
+        // Note: To detect that mobile data has been disabled through
+        // configuration, determine if the current coverage is
+        // CoverageInfo.COVERAGE_NONE AND that either cellular or wifi radios
+        // are currently connected. This is because the low level radio routines
+        // will return a connected state even when mobile data is disabled
+        // through configuration.
+        synchronized (dataDisabled) {
+            if (newCoverage == CoverageInfo.COVERAGE_NONE
+                    && (isRadioData || wlanConnected)) {
+                if (dataDisabled == Boolean.FALSE) {
+                    Logger.log("Mobile data was disabled by the user through configuration.");
+                    dataDisabled = Boolean.TRUE;
+                    eventDetected = true;
+                }
+            } else if (dataDisabled == Boolean.TRUE) {
+                Logger.log("Mobile data was enabled by the user.");
+                dataDisabled = Boolean.FALSE;
+                event = ONLINE;
+                eventDetected = true;
+            }
+        }
+
+        if (returnResult && eventDetected) {
+            // The user has enabled/disabled mobile data. Return a result
+            // indicating the current network state.
+            String type = getConnectionType(true, true);
+            sendResult(type, event);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/Network.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/Network.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/Network.java
new file mode 100644
index 0000000..86e5ac6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/network/Network.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.network;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+
+/**
+ * The Network command interface.
+ *
+ * The Network class can invoke the following actions:
+ *
+ *   - getConnectionInfo(callback)
+ *
+ */
+public class Network extends Plugin {
+	// Supported actions
+	public static final String ACTION_CONNECTION_INFO = "getConnectionInfo";
+
+	private ConnectionInfoAction connectionInfo = new ConnectionInfoAction();
+
+	/**
+	 * Executes the request and returns CommandResult.
+	 *
+	 * @param action The command to execute.
+	 * @param callbackId The callback ID to be invoked upon action completion
+	 * @param args   JSONArry of arguments for the command.
+	 * @return A CommandResult object with a status and message.
+	 */
+	public PluginResult execute(String action, JSONArray args, String callbackId) {
+		PluginResult result = null;
+
+		if (action.equals(ACTION_CONNECTION_INFO)) {
+			result = connectionInfo.getConnectionInfo(callbackId);
+		}
+		else {
+			result = new PluginResult(PluginResult.Status.INVALID_ACTION, "Network: Invalid action: " + action);
+		}
+
+		return result;
+	}
+
+	/**
+	 * Called when Plugin is destroyed.
+	 */
+	public void onDestroy() {
+		connectionInfo.shutdown();
+	}
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ActivityDialog.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ActivityDialog.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ActivityDialog.java
new file mode 100644
index 0000000..710f61e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ActivityDialog.java
@@ -0,0 +1,146 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.ui.SpacerField;
+
+import net.rim.device.api.system.Bitmap;
+import net.rim.device.api.system.Characters;
+import net.rim.device.api.ui.UiApplication;
+import net.rim.device.api.ui.component.BitmapField;
+import net.rim.device.api.ui.component.LabelField;
+import net.rim.device.api.ui.component.SeparatorField;
+import net.rim.device.api.ui.container.HorizontalFieldManager;
+import net.rim.device.api.ui.container.PopupScreen;
+import net.rim.device.api.ui.container.VerticalFieldManager;
+
+/**
+ * A Popup activity dialog box with an optional title and message.
+ */
+public final class ActivityDialog extends PopupScreen {
+    private static ActivityDialog dialog = null;
+
+    /**
+     * Construct an activity dialog, with customizable title and message.
+     *
+     * @param title
+     *            Title of the activity dialog
+     * @param message
+     *            Message to print in the body of the dialog
+     */
+    private ActivityDialog(String title, String message) {
+        super(new VerticalFieldManager());
+
+        if (title != null && title.length() > 0) {
+            add(new LabelField(title));
+            add(new SeparatorField(SeparatorField.LINE_HORIZONTAL));
+        }
+        add(new SpacerField(0, 20));
+
+        HorizontalFieldManager hfm = new HorizontalFieldManager();
+
+        Bitmap hourglass = Bitmap.getPredefinedBitmap(Bitmap.HOURGLASS);
+
+        BitmapField bitmap = new BitmapField(hourglass);
+        hfm.add(bitmap);
+
+        if (message != null && message.length() > 0) {
+            hfm.add(new LabelField(message, FIELD_HCENTER | FIELD_VCENTER));
+        }
+
+        add(hfm);
+        add(new SpacerField(0, 20));
+    }
+
+    /**
+     * Creates and displays the activity dialog.
+     *
+     * @param args
+     *            JSONArray of arguments.
+     * @return a PluginResult indicating success or error.
+     */
+    static synchronized PluginResult start(JSONArray args) {
+        if (dialog == null) {
+            String message = null;
+            String title = null;
+
+            // Title and message are optional, grab the strings from the args
+            // if they are there.
+            if (args != null && args.length() > 0) {
+                try {
+                    if (!args.isNull(0)) {
+                        title = args.getString(0);
+                    }
+                    if (args.length() > 1 && !args.isNull(1)) {
+                        message = args.getString(1);
+                    }
+                } catch (JSONException e) {
+                    return new PluginResult(PluginResult.Status.JSON_EXCEPTION,
+                            "JSONException: " + e.getMessage());
+                }
+            }
+
+            dialog = new ActivityDialog(title, message);
+            final UiApplication uiApp = UiApplication.getUiApplication();
+            uiApp.invokeLater(new Runnable() {
+                public void run() {
+                    uiApp.pushModalScreen(dialog);
+                }
+            });
+        }
+
+        return new PluginResult(PluginResult.Status.OK, "");
+    }
+
+    /**
+     * Closes the activity dialog.
+     *
+     * @return a PluginResult indicating success or error.
+     */
+    static synchronized PluginResult stop() {
+        if (dialog != null) {
+            final UiApplication uiApp = UiApplication.getUiApplication();
+            final ActivityDialog tmpDialog = dialog;
+            uiApp.invokeLater(new Runnable() {
+                public void run() {
+                    uiApp.popScreen(tmpDialog);
+                }
+            });
+            dialog = null;
+        }
+
+        return new PluginResult(PluginResult.Status.OK, "");
+    }
+
+    /**
+     * @see net.rim.device.api.ui.Screen#keyChar(char, int, int)
+     */
+    protected boolean keyChar(char key, int status, int time) {
+        // If the user clicks back key while progress dialog is displayed, close
+        // the progress dialog.
+        if (key == Characters.ESCAPE) {
+            stop();
+        }
+
+        return super.keyChar(key, status, time);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertAction.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertAction.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertAction.java
new file mode 100644
index 0000000..c04a3cb
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertAction.java
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+
+import net.rim.device.api.ui.UiApplication;
+
+/**
+ * Alert Action
+ *
+ * Displays and interacts with a dialog box.
+ *
+ */
+public class AlertAction {
+
+    private static final String DEFAULT_MESSAGE = "";
+    private static final String DEFAULT_TITLE   = "Alert";
+    private static final String DEFAULT_BUTTON  = "OK";
+
+    /**
+     * Displays a custom alert.
+     *
+     * @param args JSONArray formatted as [ message, title, buttonLabel ]
+     *             message:     the message to display in the dialog body (default: "").
+     *             title:       the title to display at the top of the dialog (default: "Alert").
+     *             buttonLabel: the button text (default: "OK").
+     * @return A PluginResult object with the success or failure state for displaying the dialog box.
+     */
+    public static PluginResult execute(JSONArray args) {
+
+        PluginResult result = null;
+
+        try {
+            String message = DEFAULT_MESSAGE;
+            String title = DEFAULT_TITLE;
+            String buttonLabel = DEFAULT_BUTTON;
+            if (args.length() > 0 && !args.isNull(0))
+                message = args.getString(0);
+            if (args.length() > 1 && !args.isNull(1))
+                title = args.getString(1);
+            if (args.length() > 2 && !args.isNull(2))
+                buttonLabel = args.getString(2);
+
+            // construct the dialog
+            final AlertDialog dialog = new AlertDialog(message, title, buttonLabel);
+
+            // ask the event dispatch thread to show dialog
+            Runnable runnable = new Runnable() {
+                public void run() {
+                    UiApplication ui = UiApplication.getUiApplication();
+                    ui.pushModalScreen(dialog);
+                }
+            };
+            UiApplication.getUiApplication().invokeAndWait(runnable);
+
+            result = new PluginResult(PluginResult.Status.OK);
+        }
+        catch (JSONException e) {
+            result = new PluginResult(PluginResult.Status.JSON_EXCEPTION, "JSONException: " + e.getMessage());
+        }
+
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertDialog.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertDialog.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertDialog.java
new file mode 100644
index 0000000..a32666b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/AlertDialog.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.ui.SpacerField;
+
+import net.rim.device.api.ui.Field;
+import net.rim.device.api.ui.FieldChangeListener;
+import net.rim.device.api.ui.component.ButtonField;
+import net.rim.device.api.ui.component.LabelField;
+import net.rim.device.api.ui.component.SeparatorField;
+import net.rim.device.api.ui.container.PopupScreen;
+import net.rim.device.api.ui.container.VerticalFieldManager;
+
+public final class AlertDialog extends PopupScreen implements FieldChangeListener {
+
+    private ButtonField button;
+
+    /**
+     * Open a custom alert dialog, with a customizable title and button text.
+     *
+     * @param {String} message Message to print in the body of the alert
+     * @param {String} title Title of the alert dialog (default: 'Alert')
+     * @param {String} buttonLabel Label of the close button (default: 'OK')
+     */
+    public AlertDialog(String message, String title, String buttonLabel) {
+
+        super(new VerticalFieldManager());
+
+        // title
+        add(new LabelField(title));
+
+        // separator
+        add(new SeparatorField(SeparatorField.LINE_HORIZONTAL));
+
+        // message
+        add(new SpacerField(0, 20));
+        add(new LabelField(message, FIELD_HCENTER | FIELD_VCENTER));
+        add(new SpacerField(0, 20));
+
+        // button
+        button = new ButtonField(buttonLabel, ButtonField.CONSUME_CLICK | FIELD_HCENTER);
+        button.setChangeListener(this);
+        add(button);
+    }
+
+    public void fieldChanged(Field field, int context) {
+        if (button == field) {
+            close();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/BeepAction.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/BeepAction.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/BeepAction.java
new file mode 100644
index 0000000..b1c3658
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/BeepAction.java
@@ -0,0 +1,160 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import java.io.IOException;
+
+import javax.microedition.media.Control;
+import javax.microedition.media.Manager;
+import javax.microedition.media.MediaException;
+import javax.microedition.media.Player;
+import javax.microedition.media.control.ToneControl;
+import javax.microedition.media.control.VolumeControl;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.media.control.AudioPathControl;
+import net.rim.device.api.notification.NotificationsManager;
+import net.rim.device.api.system.Alert;
+
+/**
+ * Beep Action plays a device tone.
+ */
+public class BeepAction {
+
+    private static final int BEEP_VOLUME = 100;
+    private static final byte NOTE = 76;                // E5
+    private static final byte D = 16;                   // quarter note
+    private static final byte tempo = 30;               // 120 bpm
+
+    private static final byte[] TONE_SEQUENCE_START = {
+            ToneControl.VERSION, 1,
+            ToneControl.TEMPO, tempo
+    };
+
+    private static final byte[] TONE = {
+        NOTE,D, ToneControl.SILENCE,D/2
+	};
+
+    /**
+     * Beeps the device for a given number of times.  By default, it will beep
+     * once.  If the user explicitly sets the beep count to zero, it will play
+     * the applications notification profile.  The application profile playback
+     * sequence is controlled by the user.
+     *
+     * @param args JSONArray formatted as [ count ]
+     *             count: specifies the number of times to beep the device (default: 1).
+     * @return A CommandResult object with the success or failure
+     *         state for beeping the device.
+     */
+    public static PluginResult execute(JSONArray args) {
+        PluginResult result = null;
+
+        if (Alert.isAudioSupported()) {
+
+            try {
+                int repeatCount = 1;
+                if (args.length() > 0 && !args.isNull(0)) {
+                    repeatCount = args.getInt(0);
+                }
+
+                // play tone n times
+                if (repeatCount > 0) {
+                    playTone(repeatCount);
+                }
+                // FIXME: unsupported on other platforms
+                // send notification event to application profile
+                else {
+                    NotificationsManager.triggerImmediateEvent(
+                            CordovaExtension.getAppID(), 0, null, null);
+                }
+            }
+            catch (JSONException e) {
+                Logger.log(BeepAction.class.getName() + ": " + e);
+                result = new PluginResult(PluginResult.Status.JSON_EXCEPTION, e.getMessage());
+            }
+            catch (Exception e) {
+                Logger.log(BeepAction.class.getName() + ": " + e);
+                result = new PluginResult(PluginResult.Status.IO_EXCEPTION, e.getMessage());
+            }
+
+            result = new PluginResult(PluginResult.Status.OK);
+        }
+        else {
+            result = new PluginResult(PluginResult.Status.ILLEGAL_ACCESS_EXCEPTION, "Audio not supported");
+        }
+
+        return result;
+    }
+
+    /**
+     * Plays a tone the specified number of times on the device audio system.
+     * @param repeatCount number of times to play tone
+     */
+    private static void playTone(int repeatCount) throws MediaException, IOException {
+
+        // get tone player
+        Player p = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);
+        p.realize();
+
+        // set tone sequence
+        ToneControl tc = (ToneControl)p.getControl("ToneControl");
+        tc.setSequence(getToneSequence(repeatCount));
+
+        // crank up the volume
+        VolumeControl vc = (VolumeControl)p.getControl("VolumeControl");
+        vc.setLevel(BEEP_VOLUME);
+
+        // route audio to speaker phone
+        p.prefetch();
+        Control[] c = p.getControls();
+        for(int i=c.length-1; i>=0; --i) {
+            if(c[i] instanceof AudioPathControl) {
+                AudioPathControl apc = (AudioPathControl)c[i];
+                apc.setAudioPath(AudioPathControl.AUDIO_PATH_HANDSFREE);
+                break;
+            }
+        }
+
+        // play
+        p.start();
+    }
+
+    /**
+     * Creates a tone sequence to play.
+     * @param repeatCount number of times to play tone
+     * @return tone sequence
+     */
+    private static byte[] getToneSequence(int repeatCount) {
+        // we have to build the sequence dynamically because
+        // ToneControl.REPEAT, repeatCount, TONE, DURATION
+        // doesn't seem to work
+        byte[] sequence = new byte[TONE_SEQUENCE_START.length + TONE.length * repeatCount];
+        System.arraycopy(TONE_SEQUENCE_START, 0, sequence, 0, TONE_SEQUENCE_START.length);
+        for (int i = 0; i < repeatCount; i++) {
+            System.arraycopy(TONE, 0, sequence, (TONE_SEQUENCE_START.length+TONE.length*i), TONE.length);
+        }
+
+        return sequence;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmAction.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmAction.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmAction.java
new file mode 100644
index 0000000..881ca0e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmAction.java
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.ui.UiApplication;
+
+/**
+ * Displays a confirmation dialog with customizable title, message, and button
+ * fields.
+ */
+public class ConfirmAction {
+
+    private static final String DEFAULT_MESSAGE = "";
+    private static final String DEFAULT_TITLE   = "Confirm";
+    private static final String DEFAULT_BUTTONS = "OK,Cancel";
+
+    /**
+     * Displays a custom confirmation dialog.
+     *
+     * @param args JSONArray formatted as [ message, title, buttonLabels ]
+     *             message:     the message to display in the dialog body (default: "").
+     *             title:       the title to display at the top of the dialog (default: "Confirm").
+     *             buttonLabel: the button text (default: "OK,Cancel").
+     * @return A PluginResult object with index of dialog button pressed (1,2,3...).
+     */
+    public static PluginResult execute(JSONArray args) {
+
+        PluginResult result = null;
+
+        try {
+            String message = DEFAULT_MESSAGE;
+            String title = DEFAULT_TITLE;
+            String buttonLabels = DEFAULT_BUTTONS;
+            if (args.length() > 0 && !args.isNull(0))
+                message = args.getString(0);
+            if (args.length() > 1 && !args.isNull(1))
+                title = args.getString(1);
+            if (args.length() > 2 && !args.isNull(2))
+                buttonLabels = args.getString(2);
+
+            // construct the dialog
+            final ConfirmDialog dialog = new ConfirmDialog(message, title, buttonLabels);
+
+            // ask the event dispatch thread to show it
+            Runnable runnable = new Runnable() {
+                public void run() {
+                    UiApplication ui = UiApplication.getUiApplication();
+                    ui.pushModalScreen(dialog);
+                }
+            };
+            Logger.log(ConfirmAction.class.getName() + ": showing confirm dialog: '" + title + "'");
+            UiApplication.getUiApplication().invokeAndWait(runnable);
+
+            // add +1 to the button index to match the JavaScript API (which starts at 1)
+            int button = dialog.getSelectedValue() + 1;
+            result = new PluginResult(PluginResult.Status.OK, Integer.toString(button));
+        }
+        catch (JSONException e) {
+            result = new PluginResult(PluginResult.Status.JSON_EXCEPTION, "JSONException: " + e.getMessage());
+        }
+
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmDialog.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmDialog.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmDialog.java
new file mode 100644
index 0000000..d19003c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/ConfirmDialog.java
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.ui.SpacerField;
+import org.apache.cordova.util.StringUtils;
+
+import net.rim.device.api.ui.Field;
+import net.rim.device.api.ui.FieldChangeListener;
+import net.rim.device.api.ui.component.ButtonField;
+import net.rim.device.api.ui.component.LabelField;
+import net.rim.device.api.ui.component.SeparatorField;
+import net.rim.device.api.ui.container.PopupScreen;
+import net.rim.device.api.ui.container.VerticalFieldManager;
+
+/**
+ * Creates a dialog box in which the title, message, and button labels are all
+ * customizable.
+ */
+public final class ConfirmDialog extends PopupScreen implements FieldChangeListener {
+
+    private ButtonField[] buttons;              // the button fields
+    private int           selectedValue = -1;   // the selected button
+
+    /**
+     * Construct a confirmation dialog, with customizable title and button text.
+     *
+     * @param {String} message Message to print in the body of the alert
+     * @param {String} title Title of the alert dialog (default: 'Confirm')
+     * @param {String} buttonLabels Labels of the buttons (default: 'OK,Cancel')
+     */
+    public ConfirmDialog(String message, String title, String buttonLabels) {
+        super(new VerticalFieldManager());
+
+        // title
+        add(new LabelField(title));
+
+        // separator
+        add(new SeparatorField(SeparatorField.LINE_HORIZONTAL));
+
+        // message
+        add(new SpacerField(0, 20));
+        add(new LabelField(message, FIELD_HCENTER | FIELD_VCENTER));
+        add(new SpacerField(0, 20));
+
+        // parse the button labels
+        String[] labels = StringUtils.split(buttonLabels, ",");
+        buttons = new ButtonField[labels.length];
+
+        // add buttons
+        for (int i = 0; i < labels.length; i++) {
+            buttons[i] = new ButtonField(labels[i], ButtonField.CONSUME_CLICK | FIELD_HCENTER);
+            buttons[i].setChangeListener(this);
+            add(new SpacerField(0, 5));
+            add(buttons[i]);
+        }
+    }
+
+    /**
+     * Returns the index of the button pressed.
+     *
+     * @return The index of the button pressed (0,1,2...).
+     */
+    public int getSelectedValue() {
+        return this.selectedValue;
+    }
+
+    /**
+     * Invoked when a button is pressed.
+     */
+    public void fieldChanged(Field field, int context) {
+
+        // figure out which button was pressed
+        for (int i = 0; i < buttons.length; i++) {
+            if (buttons[i] == field) {
+                this.selectedValue = i;
+                break;
+            }
+        }
+
+        // close the dialog
+        close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/Notification.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/Notification.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/Notification.java
new file mode 100644
index 0000000..4183987
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/notification/Notification.java
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.notification;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+
+import net.rim.device.api.notification.NotificationsConstants;
+import net.rim.device.api.notification.NotificationsManager;
+
+/**
+ * Cordova Notification plugin.
+ *
+ * The Notification plugin can invoke the following actions:
+ *
+ *   - alert(message, title, buttonLabel)
+ *   - confirm(message, title, button1,button2,button3...)
+ *   - beep(count)
+ *   - vibrate(duration)
+ *   - progressStart(title, message)
+ *   - progressStop()
+ *   - progressValue(value)
+ *   - activityStart(title, message)
+ *   - activityStop()
+ */
+public class Notification extends Plugin {
+
+    /**
+     * Possible actions
+     */
+    private static final String ACTION_ALERT = "alert";
+    private static final String ACTION_BEEP = "beep";
+    private static final String ACTION_CONFIRM = "confirm";
+    private static final String ACTION_VIBRATE = "vibrate";
+    private static final String ACTION_PROGRESS_START = "progressStart";
+    private static final String ACTION_PROGRESS_STOP = "progressStop";
+    private static final String ACTION_PROGRESS_VALUE = "progressValue";
+    private static final String ACTION_ACTIVITY_START = "activityStart";
+    private static final String ACTION_ACTIVITY_STOP = "activityStop";
+
+    /**
+     * Creates a notification profile for the application on the device. The
+     * application can trigger a notification event that will play the profile.
+     * The profile settings are set by the user.
+     */
+    public static void registerProfile() {
+        // Register with the NotificationsManager to create a notification
+        // profile for this application and enable notifications to be
+        // controlled by the user
+        Object object = new Object() {
+            private String appName = CordovaExtension.getAppName();
+
+            public String toString() {
+                return appName;
+            }
+        };
+        NotificationsManager.registerSource(CordovaExtension.getAppID(),
+                object, NotificationsConstants.IMPORTANT);
+    }
+
+    /**
+     * Executes the request and returns CommandResult.
+     *
+     * @param action
+     *            The action to perform.
+     * @param callbackId
+     *            The callback ID to be invoked upon action completion
+     * @param args
+     *            JSONArry of arguments for the specified action.
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray args, String callbackId) {
+        PluginResult result = null;
+
+        if (ACTION_ALERT.equals(action)) {
+            result = AlertAction.execute(args);
+        } else if (ACTION_BEEP.equals(action)) {
+            result = BeepAction.execute(args);
+        } else if (ACTION_CONFIRM.equals(action)) {
+            result = ConfirmAction.execute(args);
+        } else if (ACTION_VIBRATE.equals(action)) {
+            result = VibrateAction.execute(args);
+        } else if (ACTION_ACTIVITY_START.equals(action)) {
+            result = ActivityDialog.start(args);
+        } else if (ACTION_ACTIVITY_STOP.equals(action)) {
+            result = ActivityDialog.stop();
+        } else if (ACTION_PROGRESS_START.equals(action)) {
+            result = ProgressDialog.start(args);
+        } else if (ACTION_PROGRESS_STOP.equals(action)) {
+            result = ProgressDialog.stop();
+        } else if (ACTION_PROGRESS_VALUE.equals(action)) {
+            result = ProgressDialog.setValue(args);
+        } else {
+            result = new PluginResult(PluginResult.Status.INVALID_ACTION,
+                    "Notification: Invalid action: " + action);
+        }
+
+        return result;
+    }
+
+    /**
+     * Identifies if action to be executed returns a value and should be run
+     * synchronously.
+     *
+     * @param action
+     *            The action to execute
+     * @return T=returns value
+     */
+    public boolean isSynch(String action) {
+        if (ACTION_ALERT.equals(action) || ACTION_CONFIRM.equals(action)) {
+            return false;
+        }
+
+        return true;
+    }
+
+}


[25/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/common.mk
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/common.mk b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/common.mk
new file mode 100644
index 0000000..90a43db
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/common.mk
@@ -0,0 +1,18 @@
+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-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so
new file mode 100644
index 0000000..126d02c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/device/libutils.so differ

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

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp
new file mode 100644
index 0000000..68397a1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.cpp
@@ -0,0 +1,55 @@
+/*
+ * 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-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp
new file mode 100644
index 0000000..4ab2ca7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/plugins/Utils/native/webworks_utils.hpp
@@ -0,0 +1,34 @@
+/*
+ * 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-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/project.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/project.json b/lib/cordova-blackberry/blackberry10/bin/templates/project/project.json
new file mode 100644
index 0000000..97bbb24
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/project.json
@@ -0,0 +1,6 @@
+{
+    "barName": "cordova-BB10-app",
+    "keystorepass": "password",
+    "defaultTarget": "",
+    "targets": {}
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/LICENSE b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/LICENSE
new file mode 100644
index 0000000..9f761f1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/LICENSE
@@ -0,0 +1,296 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+==============================================================
+This product also include the following software:
+==============================================================
+
+--------------------------------------------------------------
+jasmine from GitHub
+
+   https://github.com/pivotal/jasmine
+
+MIT-style license
+
+license available from:
+
+   https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE
+   
+-----------------------------
+
+Copyright (c) 2008-2011 Pivotal Labs
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------------------------------------------------------
+commonjs tests from the commonjs organization at GitHub
+
+   https://github.com/commonjs/commonjs
+
+MIT-style license
+
+license available from:
+
+   https://github.com/commonjs/commonjs/blob/master/docs/license.html.markdown
+
+contributor list available from:
+
+   https://github.com/commonjs/commonjs/blob/master/docs/contributors.html.markdown
+
+-----------------------------
+
+Copyright 2009 Kevin Dangoor
+Copyright 2009 Ihab Awad
+Copyright 2009 Ash Berlin
+Copyright 2009 Aristid Breitkreuz
+Copyright 2009 Kevin Dangoor
+Copyright 2009 Daniel Friesen
+Copyright 2009 Wes Garland
+Copyright 2009 Kris Kowal
+Copyright 2009 Dean Landolt
+Copyright 2009 Peter Michaux
+Copyright 2009 George Moschovitis
+Copyright 2009 Michael O'Brien
+Copyright 2009 Tom Robinson
+Copyright 2009 Hannes Wallnoefer
+Copyright 2009 Mike Wilson
+Copyright 2009 Ondrej Zara
+Copyright 2009 Chris Zumbrunn
+Copyright 2009 Kris Zyp
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/NOTICE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/NOTICE b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/NOTICE
new file mode 100644
index 0000000..4e02ca4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/NOTICE
@@ -0,0 +1,8 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org)
+
+This product includes software developed by
+Jasmine (https://github.com/pivotal/jasmine)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/README.md b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/README.md
new file mode 100644
index 0000000..61256fe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/README.md
@@ -0,0 +1,30 @@
+# Apache Cordova Hello World Application
+
+> Simple Hello World application and test suite.
+
+## Run Application
+
+    /www/index.html
+
+## Run Tests
+
+    /www/spec.html
+
+## Versions and Tags
+
+The Hello World's version is directly tied to an Apache Cordova release.
+
+For example, Hello World `2.0.0` is compatible with Apache Cordova `2.0.0`.
+
+## How to Update
+
+Update to Apache Cordova x.x.x by:
+
+1. `www/index.html`
+    - Update `<script type="text/javascript" src="cordova-x.x.x.js"></script>`
+2. `VERSION`
+    - Update the version
+3. Commit and Tag
+    - `git commit -am "[app] Version x.x.x"`
+    - `git tag x.x.x`
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/VERSION b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/VERSION
new file mode 100644
index 0000000..2eca156
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/VERSION
@@ -0,0 +1 @@
+2.4.0rc1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/config.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/config.xml b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/config.xml
new file mode 100644
index 0000000..6e0d3c3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/config.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+       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.
+-->
+<!--
+  Widget Configuration Reference:
+    http://docs.blackberry.com/en/developers/deliverables/15274/
+-->
+
+<widget xmlns="http://www.w3.org/ns/widgets"
+        xmlns:rim="http://www.blackberry.com/ns/widgets"
+	version="1.0.0" id="default.app.id">
+
+  <name>Webworks Application</name>
+
+  <author>Your Name Here</author>
+
+  <description>
+       A sample Apache Cordova application that responds to the deviceready event.
+  </description>
+
+  <license href="http://opensource.org/licenses/alphabetical">
+  </license>
+
+  <!-- Expose access to all URIs, including the file and http protocols -->
+  <access subdomains="true" uri="file:///store/home" />
+  <access subdomains="true" uri="file:///SDCard" />
+  <access subdomains="true" uri="*" />
+
+  <icon rim:hover="false" src="res/icon/blackberry/icon-80.png" />
+  <icon rim:hover="true" src="res/icon/blackberry/icon-80.png" />
+
+  <rim:loadingScreen backgroundColor="#CFCFCF"
+                     foregroundImage="res/screen/blackberry/screen-225.png"
+		     onFirstLaunch="true">
+    <rim:transitionEffect type="fadeOut" />
+  </rim:loadingScreen>
+
+  <content src="index.html" />
+
+  <rim:permissions>
+    <rim:permit>use_camera</rim:permit>
+    <rim:permit>read_device_identifying_information</rim:permit>
+    <rim:permit>access_shared</rim:permit>
+    <rim:permit>read_geolocation</rim:permit>
+    <rim:permit>record_audio</rim:permit>
+    <rim:permit>access_pimdomain_contacts</rim:permit>
+  </rim:permissions>
+
+</widget>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/css/index.css
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/css/index.css b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/css/index.css
new file mode 100644
index 0000000..51daa79
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/css/index.css
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+* {
+    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+}
+
+body {
+    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
+    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
+    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
+    background-color:#E4E4E4;
+    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        color-stop(0, #A7A7A7),
+        color-stop(0.51, #E4E4E4)
+    );
+    background-attachment:fixed;
+    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+    font-size:12px;
+    height:100%;
+    margin:0px;
+    padding:0px;
+    text-transform:uppercase;
+    width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+    position:absolute;             /* position in the center of the screen */
+    left:50%;
+    top:50%;
+    height:50px;                   /* text area height */
+    width:225px;                   /* text area width */
+    text-align:center;
+    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with text) */
+    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area height */
+                                   /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+    .app {
+        background-position:left center;
+        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image height */
+        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
+                                      /* offset horizontal: half of image width and text area width */
+    }
+}
+
+h1 {
+    font-size:24px;
+    font-weight:normal;
+    margin:0px;
+    overflow:visible;
+    padding:0px;
+    text-align:center;
+}
+
+.event {
+    border-radius:4px;
+    -webkit-border-radius:4px;
+    color:#FFFFFF;
+    font-size:12px;
+    margin:0px 30px;
+    padding:2px 0px;
+}
+
+.event.listening {
+    background-color:#333333;
+    display:block;
+}
+
+.event.received {
+    background-color:#4B946A;
+    display:none;
+}
+
+@keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+@-webkit-keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+.blink {
+    animation:fade 3000ms infinite;
+    -webkit-animation:fade 3000ms infinite;
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/img/logo.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/img/logo.png b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/img/logo.png differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/index.html b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/index.html
new file mode 100644
index 0000000..d45ae9f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/index.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!--
+    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.
+-->
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        <meta name="format-detection" content="telephone=no" />
+        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
+        <link rel="stylesheet" type="text/css" href="css/index.css" />
+        <title>Hello World</title>
+    </head>
+    <body>
+        <div class="app">
+            <h1>Apache Cordova</h1>
+            <div id="deviceready" class="blink">
+                <p class="event listening">Connecting to Device</p>
+                <p class="event received">Device is Ready</p>
+            </div>
+        </div>
+        <script type="text/javascript" src="cordova-2.4.0rc1.js"></script>
+        <script type="text/javascript" src="js/index.js"></script>
+        <script type="text/javascript">
+            app.initialize();
+        </script>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/js/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/js/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/js/index.js
new file mode 100644
index 0000000..31d9064
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/js/index.js
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+var app = {
+    // Application Constructor
+    initialize: function() {
+        this.bindEvents();
+    },
+    // Bind Event Listeners
+    //
+    // Bind any events that are required on startup. Common events are:
+    // 'load', 'deviceready', 'offline', and 'online'.
+    bindEvents: function() {
+        document.addEventListener('deviceready', this.onDeviceReady, false);
+    },
+    // deviceready Event Handler
+    //
+    // The scope of 'this' is the event. In order to call the 'receivedEvent'
+    // function, we must explicity call 'app.receivedEvent(...);'
+    onDeviceReady: function() {
+        app.receivedEvent('deviceready');
+    },
+    // Update DOM on a Received Event
+    receivedEvent: function(id) {
+        var parentElement = document.getElementById(id);
+        var listeningElement = parentElement.querySelector('.listening');
+        var receivedElement = parentElement.querySelector('.received');
+
+        listeningElement.setAttribute('style', 'display:none;');
+        receivedElement.setAttribute('style', 'display:block;');
+
+        console.log('Received Event: ' + id);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/json2.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/json2.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/json2.js
new file mode 100644
index 0000000..c52b92a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/json2.js
@@ -0,0 +1,482 @@
+/*
+    http://www.JSON.org/json2.js
+    2010-03-20
+
+    Public Domain.
+
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+    See http://www.JSON.org/js.html
+
+
+    This code should be minified before deployment.
+    See http://javascript.crockford.com/jsmin.html
+
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+    NOT CONTROL.
+
+
+    This file creates a global JSON object containing two methods: stringify
+    and parse.
+
+        JSON.stringify(value, replacer, space)
+            value       any JavaScript value, usually an object or array.
+
+            replacer    an optional parameter that determines how object
+                        values are stringified for objects. It can be a
+                        function or an array of strings.
+
+            space       an optional parameter that specifies the indentation
+                        of nested structures. If it is omitted, the text will
+                        be packed without extra whitespace. If it is a number,
+                        it will specify the number of spaces to indent at each
+                        level. If it is a string (such as '\t' or '&nbsp;'),
+                        it contains the characters used to indent at each level.
+
+            This method produces a JSON text from a JavaScript value.
+
+            When an object value is found, if the object contains a toJSON
+            method, its toJSON method will be called and the result will be
+            stringified. A toJSON method does not serialize: it returns the
+            value represented by the name/value pair that should be serialized,
+            or undefined if nothing should be serialized. The toJSON method
+            will be passed the key associated with the value, and this will be
+            bound to the value
+
+            For example, this would serialize Dates as ISO strings.
+
+                Date.prototype.toJSON = function (key) {
+                    function f(n) {
+                        // Format integers to have at least two digits.
+                        return n < 10 ? '0' + n : n;
+                    }
+
+                    return this.getUTCFullYear()   + '-' +
+                         f(this.getUTCMonth() + 1) + '-' +
+                         f(this.getUTCDate())      + 'T' +
+                         f(this.getUTCHours())     + ':' +
+                         f(this.getUTCMinutes())   + ':' +
+                         f(this.getUTCSeconds())   + 'Z';
+                };
+
+            You can provide an optional replacer method. It will be passed the
+            key and value of each member, with this bound to the containing
+            object. The value that is returned from your method will be
+            serialized. If your method returns undefined, then the member will
+            be excluded from the serialization.
+
+            If the replacer parameter is an array of strings, then it will be
+            used to select the members to be serialized. It filters the results
+            such that only members with keys listed in the replacer array are
+            stringified.
+
+            Values that do not have JSON representations, such as undefined or
+            functions, will not be serialized. Such values in objects will be
+            dropped; in arrays they will be replaced with null. You can use
+            a replacer function to replace those with JSON values.
+            JSON.stringify(undefined) returns undefined.
+
+            The optional space parameter produces a stringification of the
+            value that is filled with line breaks and indentation to make it
+            easier to read.
+
+            If the space parameter is a non-empty string, then that string will
+            be used for indentation. If the space parameter is a number, then
+            the indentation will be that many spaces.
+
+            Example:
+
+            text = JSON.stringify(['e', {pluribus: 'unum'}]);
+            // text is '["e",{"pluribus":"unum"}]'
+
+
+            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+            text = JSON.stringify([new Date()], function (key, value) {
+                return this[key] instanceof Date ?
+                    'Date(' + this[key] + ')' : value;
+            });
+            // text is '["Date(---current time---)"]'
+
+
+        JSON.parse(text, reviver)
+            This method parses a JSON text to produce an object or array.
+            It can throw a SyntaxError exception.
+
+            The optional reviver parameter is a function that can filter and
+            transform the results. It receives each of the keys and values,
+            and its return value is used instead of the original value.
+            If it returns what it received, then the structure is not modified.
+            If it returns undefined then the member is deleted.
+
+            Example:
+
+            // Parse the text. Values that look like ISO date strings will
+            // be converted to Date objects.
+
+            myData = JSON.parse(text, function (key, value) {
+                var a;
+                if (typeof value === 'string') {
+                    a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+                    if (a) {
+                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+                            +a[5], +a[6]));
+                    }
+                }
+                return value;
+            });
+
+            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+                var d;
+                if (typeof value === 'string' &&
+                        value.slice(0, 5) === 'Date(' &&
+                        value.slice(-1) === ')') {
+                    d = new Date(value.slice(5, -1));
+                    if (d) {
+                        return d;
+                    }
+                }
+                return value;
+            });
+
+
+    This is a reference implementation. You are free to copy, modify, or
+    redistribute.
+*/
+
+/*jslint evil: true, strict: false */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+    lastIndex, length, parse, prototype, push, replace, slice, stringify,
+    test, toJSON, toString, valueOf
+*/
+
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+if (!this.JSON) {
+    this.JSON = {};
+}
+
+(function () {
+
+    function f(n) {
+        // Format integers to have at least two digits.
+        return n < 10 ? '0' + n : n;
+    }
+
+    if (typeof Date.prototype.toJSON !== 'function') {
+
+        Date.prototype.toJSON = function (key) {
+
+            return isFinite(this.valueOf()) ?
+                   this.getUTCFullYear()   + '-' +
+                 f(this.getUTCMonth() + 1) + '-' +
+                 f(this.getUTCDate())      + 'T' +
+                 f(this.getUTCHours())     + ':' +
+                 f(this.getUTCMinutes())   + ':' +
+                 f(this.getUTCSeconds())   + 'Z' : null;
+        };
+
+        String.prototype.toJSON =
+        Number.prototype.toJSON =
+        Boolean.prototype.toJSON = function (key) {
+            return this.valueOf();
+        };
+    }
+
+    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+        gap,
+        indent,
+        meta = {    // table of character substitutions
+            '\b': '\\b',
+            '\t': '\\t',
+            '\n': '\\n',
+            '\f': '\\f',
+            '\r': '\\r',
+            '"' : '\\"',
+            '\\': '\\\\'
+        },
+        rep;
+
+
+    function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+        escapable.lastIndex = 0;
+        return escapable.test(string) ?
+            '"' + string.replace(escapable, function (a) {
+                var c = meta[a];
+                return typeof c === 'string' ? c :
+                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+            }) + '"' :
+            '"' + string + '"';
+    }
+
+
+    function str(key, holder) {
+
+// Produce a string from holder[key].
+
+        var i,          // The loop counter.
+            k,          // The member key.
+            v,          // The member value.
+            length,
+            mind = gap,
+            partial,
+            value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+        if (value && typeof value === 'object' &&
+                typeof value.toJSON === 'function') {
+            value = value.toJSON(key);
+        }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+        if (typeof rep === 'function') {
+            value = rep.call(holder, key, value);
+        }
+
+// What happens next depends on the value's type.
+
+        switch (typeof value) {
+        case 'string':
+            return quote(value);
+
+        case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+            return isFinite(value) ? String(value) : 'null';
+
+        case 'boolean':
+        case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+            return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+        case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+            if (!value) {
+                return 'null';
+            }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+            gap += indent;
+            partial = [];
+
+// Is the value an array?
+
+            if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+                length = value.length;
+                for (i = 0; i < length; i += 1) {
+                    partial[i] = str(i, value) || 'null';
+                }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+                v = partial.length === 0 ? '[]' :
+                    gap ? '[\n' + gap +
+                            partial.join(',\n' + gap) + '\n' +
+                                mind + ']' :
+                          '[' + partial.join(',') + ']';
+                gap = mind;
+                return v;
+            }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+            if (rep && typeof rep === 'object') {
+                length = rep.length;
+                for (i = 0; i < length; i += 1) {
+                    k = rep[i];
+                    if (typeof k === 'string') {
+                        v = str(k, value);
+                        if (v) {
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
+                        }
+                    }
+                }
+            } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+                for (k in value) {
+                    if (Object.hasOwnProperty.call(value, k)) {
+                        v = str(k, value);
+                        if (v) {
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
+                        }
+                    }
+                }
+            }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+            v = partial.length === 0 ? '{}' :
+                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
+                        mind + '}' : '{' + partial.join(',') + '}';
+            gap = mind;
+            return v;
+        }
+    }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+    if (typeof JSON.stringify !== 'function') {
+        JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+            var i;
+            gap = '';
+            indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+            if (typeof space === 'number') {
+                for (i = 0; i < space; i += 1) {
+                    indent += ' ';
+                }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+            } else if (typeof space === 'string') {
+                indent = space;
+            }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+            rep = replacer;
+            if (replacer && typeof replacer !== 'function' &&
+                    (typeof replacer !== 'object' ||
+                     typeof replacer.length !== 'number')) {
+                throw new Error('JSON.stringify');
+            }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+            return str('', {'': value});
+        };
+    }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+    if (typeof JSON.parse !== 'function') {
+        JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+            var j;
+
+            function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+                var k, v, value = holder[key];
+                if (value && typeof value === 'object') {
+                    for (k in value) {
+                        if (Object.hasOwnProperty.call(value, k)) {
+                            v = walk(value, k);
+                            if (v !== undefined) {
+                                value[k] = v;
+                            } else {
+                                delete value[k];
+                            }
+                        }
+                    }
+                }
+                return reviver.call(holder, key, value);
+            }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+            text = String(text);
+            cx.lastIndex = 0;
+            if (cx.test(text)) {
+                text = text.replace(cx, function (a) {
+                    return '\\u' +
+                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+                });
+            }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+            if (/^[\],:{}\s]*$/.
+test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
+replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
+replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+                j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+                return typeof reviver === 'function' ?
+                    walk({'': j}, '') : j;
+            }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+            throw new SyntaxError('JSON.parse');
+        };
+    }
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/icon/blackberry/icon-80.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/icon/blackberry/icon-80.png b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/icon/blackberry/icon-80.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/icon/blackberry/icon-80.png differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar.js.gz
new file mode 100644
index 0000000..3c1fecd
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz
new file mode 100644
index 0000000..677a6ad
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz
new file mode 100644
index 0000000..602c22c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz
new file mode 100644
index 0000000..485b9a2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz
new file mode 100644
index 0000000..dfc2045
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz
new file mode 100644
index 0000000..9e7c5ae
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz
new file mode 100644
index 0000000..72d26ca
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz
new file mode 100644
index 0000000..1dde592
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz
new file mode 100644
index 0000000..640e8be
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz
new file mode 100644
index 0000000..b7beb36
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz
new file mode 100644
index 0000000..3eb49f9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz
new file mode 100644
index 0000000..b68cf81
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz
new file mode 100644
index 0000000..d2583d4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz
new file mode 100644
index 0000000..aa15f88
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz
new file mode 100644
index 0000000..116f0e2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz
new file mode 100644
index 0000000..65aaeb0
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz
new file mode 100644
index 0000000..853cc9e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz
new file mode 100644
index 0000000..841ee63
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be.js.gz
new file mode 100644
index 0000000..a0a64b8
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be_BY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be_BY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be_BY.js.gz
new file mode 100644
index 0000000..fec5f32
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/be_BY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg.js.gz
new file mode 100644
index 0000000..4f816d8
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz
new file mode 100644
index 0000000..9cc5ec3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz
new file mode 100644
index 0000000..3f40ba4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca.js.gz
new file mode 100644
index 0000000..32e04c5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz
new file mode 100644
index 0000000..93d8ec3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz
new file mode 100644
index 0000000..69be9b1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs.js.gz
new file mode 100644
index 0000000..28dd3ee
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz
new file mode 100644
index 0000000..95d0e32
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz
new file mode 100644
index 0000000..9d821d6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz
new file mode 100644
index 0000000..681c4b3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da.js.gz
new file mode 100644
index 0000000..ba270ad
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK.js.gz
new file mode 100644
index 0000000..0b9dbe2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz
new file mode 100644
index 0000000..8d52b6a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de.js.gz
new file mode 100644
index 0000000..a65adda
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT.js.gz
new file mode 100644
index 0000000..fb693c2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz
new file mode 100644
index 0000000..e61b9d9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_CH.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_CH.js.gz
new file mode 100644
index 0000000..1b906e7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_CH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE.js.gz
new file mode 100644
index 0000000..dc73b68
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz
new file mode 100644
index 0000000..76e1b0d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU.js.gz
new file mode 100644
index 0000000..f1f85b9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz
new file mode 100644
index 0000000..c00d5de
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el.js.gz
new file mode 100644
index 0000000..0cdbf53
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY.js.gz
new file mode 100644
index 0000000..5405116
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz
new file mode 100644
index 0000000..79c2841
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz
new file mode 100644
index 0000000..35a134a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR.js.gz
new file mode 100644
index 0000000..6c30687
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz
new file mode 100644
index 0000000..e6f2529
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en.js.gz
new file mode 100644
index 0000000..146dee3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_AU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_AU.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_AU.js.gz
new file mode 100644
index 0000000..8cb1758
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_AU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE.js.gz
new file mode 100644
index 0000000..e327a14
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz
new file mode 100644
index 0000000..eaa6076
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_CA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_CA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_CA.js.gz
new file mode 100644
index 0000000..65ce247
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_CA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB.js.gz
new file mode 100644
index 0000000..9e647a7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz
new file mode 100644
index 0000000..0e6d09b
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz differ


[35/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArray.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArray.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArray.java
new file mode 100644
index 0000000..87362c8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArray.java
@@ -0,0 +1,1123 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.Vector;
+
+import org.apache.cordova.json4j.internal.JSON4JStringReader;
+import org.apache.cordova.json4j.internal.JSON4JStringWriter;
+import org.apache.cordova.json4j.internal.NumberUtil;
+import org.apache.cordova.json4j.internal.Parser;
+import org.apache.cordova.json4j.internal.Serializer;
+import org.apache.cordova.json4j.internal.SerializerVerbose;
+
+/**
+ * Extension of ArrayList that only allows values which are JSON-able.
+ * See JSONObject for a list of valid values.
+ *
+ * Instances of this class are not thread-safe.
+ */
+public class JSONArray extends Vector implements JSONArtifact {
+
+    /**
+     * Serial UID for serialization checking.
+     */
+    private static final long serialVersionUID = 9076798781015779954L;
+
+    /**
+     * Create a new instance of this class.
+     */
+    public JSONArray() {
+        super();
+    }
+
+    /**
+     * Create a new instance of this class with the specified initial capacity.
+     * @param initialCapacity The initial size to define the array as.
+     */
+    public JSONArray(int initialCapacity) {
+        super(initialCapacity);
+    }
+
+    /**
+     * Create a new instance of this class based off the contents of the passed object array.
+     * @param elems The strings to add to a new JSONArray
+     * @throws JSONException Thrown when objects in the array are not JSONable.
+     */
+    public JSONArray(Object[] elems) throws JSONException {
+        if(elems != null){
+            for(int i = 0; i < elems.length; i++){
+                this.add(elems[i]);
+            }
+        }
+    }
+
+    /**
+     * Create a new instance of this class based off the contents of the passed object array.
+     * @param elems The strings to add to a new JSONArray
+     * @param includeSuperclass For JavaBeans, include all superclass info.
+     * @throws JSONException Thrown when objects in the array are not JSONable.
+     */
+    public JSONArray(Object[] elems, boolean includeSuperclass) throws JSONException {
+        if(elems != null){
+            for(int i = 0; i < elems.length; i++){
+                this.add(elems[i]);
+            }
+        }
+    }
+
+    /**
+     * Create a new instance of this class from the provided JSON object string.
+     * Note:  This is the same as calling new JSONArray(str, false);  Parsing in non-strict mode.
+     * @param str The JSON array string to parse.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONArray(String str) throws JSONException {
+        super();
+        JSON4JStringReader reader = new JSON4JStringReader(str);
+        (new Parser(reader)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the provided JSON object string.
+     * @param str The JSON array string to parse.
+     * @param strict Boolean denoting if the JSON should be parsed n strict mode, meaning unquoted strings and comments are not allowed.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONArray(String str, boolean strict) throws JSONException {
+        super();
+        JSON4JStringReader reader = new JSON4JStringReader(str);
+        (new Parser(reader, strict)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the reader.  The reader content must be a JSON array string.
+     * Note:  The reader will not be closed, that is left to the caller.
+     * Note:  This is the same as calling new JSONArray(rdr, false);  Parsing in non-strict mode.
+     * @param rdr The Reader from which to read the JSON array string to parse.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONArray(Reader rdr) throws JSONException {
+        (new Parser(rdr)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the reader.  The reader content must be a JSON array string.
+     * Note:  The reader will not be closed, that is left to the caller.
+     * @param rdr The Reader from which to read the JSON array string to parse.
+     * @param strict Boolean denoting if the JSON should be parsed n strict mode, meaning unquoted strings and comments are not allowed.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONArray(Reader rdr, boolean strict) throws JSONException {
+        (new Parser(rdr, strict)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the input stream.  The stream content must be a JSON array string.
+     * Note:  The input stream content is assumed to be UTF-8 encoded.
+     * Note:  The InputStream will not be closed, that is left to the caller.
+     * @param is The InputStream from which to read the JSON array string to parse.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONArray(InputStream is) throws JSONException {
+        InputStreamReader isr = null;
+        if (is != null) {
+            try {
+                isr = new InputStreamReader(is, "UTF-8");
+            } catch (Exception ex) {
+                isr = new InputStreamReader(is);
+            }
+        } else {
+            throw new JSONException("Inputstream cannot be null");
+        }
+        (new Parser(isr)).parse(true, this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the input stream.  The stream content must be a JSON array string.
+     * Note:  The input stream content is assumed to be UTF-8 encoded.
+     * Note:  The InputStream will not be closed, that is left to the caller.
+     * @param is The InputStream from which to read the JSON array string to parse.
+     * @param strict Boolean denoting if the JSON should be parsed n strict mode, meaning unquoted strings and comments are not allowed.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONArray(InputStream is, boolean strict) throws JSONException {
+        InputStreamReader isr = null;
+        if (is != null) {
+            try {
+                isr = new InputStreamReader(is, "UTF-8");
+            } catch (Exception ex) {
+                isr = new InputStreamReader(is);
+            }
+        } else {
+            throw new JSONException("InputStream cannot be null");
+        }
+        (new Parser(isr, strict)).parse(true, this);
+    }
+
+    /**
+     * Function to get a JSONArray entry at a specified index.
+     * @param index The position in the rray to fetch the object from
+     * @throws JSONException Thrown if the index is outside the array bounds.
+     */
+    public Object getIndex(int index) throws JSONException {
+        try{
+            return super.elementAt(index);
+        }catch (Exception ex) {
+            JSONException jex = new JSONException("Error occurred trying to access element at: " + index);
+            jex.setCause(ex);
+            throw jex;
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see java.util.ArrayList#add(int, java.lang.Object)
+     */
+    public void add(int index, Object element) {
+        if(index > this.size() - 1){
+            expandArray(index);
+        }
+        if (!JSONObject.isValidObject(element)) {
+            throw new IllegalArgumentException("Object of type: [" + element.getClass().getName() + "] could not be converted to a JSON representation.");
+        }
+        super.insertElementAt(element, index);
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see java.util.ArrayList#add(java.lang.Object)
+     */
+    public boolean add(Object element, boolean includeSuperclass) {
+        if (!JSONObject.isValidObject(element)) {
+            throw new IllegalArgumentException("Object of type: [" + element.getClass().getName() + "] could not be converted to a JSON representation.");
+        }
+        super.addElement(element);
+        return true;
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see java.util.ArrayList#add(java.lang.Object)
+     */
+    public boolean add(Object element) {
+        return this.add(element, true);
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see java.util.ArrayList#set(int, java.lang.Object)
+     */
+    public Object set(int index, Object element) {
+        if(index > this.size() - 1){
+            expandArray(index);
+        }
+        if (!JSONObject.isValidObject(element)) {
+            throw new IllegalArgumentException("Object of type: [" + element.getClass().getName() + "] could not be converted to a JSON representation.");
+        }
+        Object obj = super.elementAt(index);
+        super.setElementAt(element, index);
+        return obj;
+    }
+
+    /**
+     * Internal function to pad-out the array list
+     * Added to mimic expansion behavior of other JSON models.
+     * @param toIndex Increase the array so that it has up to 'toIndex' as indexable slots.
+     */
+    private void expandArray(int toIndex){
+        int maxIndex = this.size();
+        toIndex = toIndex - maxIndex;
+        if(toIndex > 0){
+            for(int i = 0; i < toIndex; i++){
+                super.addElement(null);
+            }
+        }
+    }
+
+    /**************************************************************/
+    /* Maps of add to put, for API compatibility to other parsers.*/
+    /**************************************************************/
+
+    /**
+     * Map of java.util.ArrayList.add(int, java.lang.Object), for compatibility to other JSON parsers.
+     * @see java.util.ArrayList#add(int, java.lang.Object)
+     * @throws JSONException in the case of index out of bounds, etc.
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(int index, Object element) throws JSONException {
+        if (!JSONObject.isValidObject(element)) {
+            throw new IllegalArgumentException("Object of type: [" + element.getClass().getName() + "] could not be converted to a JSON representation.");
+        }
+        try {
+            super.insertElementAt(element, index);
+        } catch (Exception ex) {
+            JSONException jex = new JSONException("Exception occurred while placing element.");
+            jex.setCause(ex);
+            throw jex;
+        }
+        return this;
+    }
+
+    /**
+     * Map of java.util.ArrayList.add(java.lang.Object), for compatibility to other JSON parsers.
+     * @see java.util.ArrayList#add(java.lang.Object)
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(Object element) throws JSONException {
+        return put(element, true);
+    }
+
+    /**
+     * Map of java.util.ArrayList.add(java.lang.Object), for compatibility to other JSON parsers.
+     * @see java.util.ArrayList#add(java.lang.Object)
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(Object element, boolean includeSuperclass)  throws JSONException {
+        if (!JSONObject.isValidObject(element)) {
+            throw new IllegalArgumentException("Object of type: [" + element.getClass().getName() + "] could not be converted to a JSON representation.");
+
+        }
+        try {
+            super.addElement(element);
+        } catch (Exception ex) {
+            JSONException jex = new JSONException("Exception occurred while placing element.");
+            jex.setCause(ex);
+            throw jex;
+        }
+        return this;
+    }
+
+    /**
+     * Method to place a long into the array.
+     * @param value A long
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(long value) {
+        this.add(new Long(value));
+        return this;
+    }
+
+    /**
+     * Method to place a long into the array.
+     * @param index The position in the array to place the long.
+     * @param value A long
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(int index, long value) {
+        this.add(index, new Long(value));
+        return this;
+    }
+
+    /**
+     * Method to place a int into the array.
+     * @param value An int
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(int value) {
+        this.add(new Integer(value));
+        return this;
+    }
+
+    /**
+     * Method to place an int into the array.
+     * @param index The position in the array to place the int.
+     * @param value An int
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(int index, int value) {
+        this.add(index, new Integer(value));
+        return this;
+    }
+
+    /**
+     * Method to place a short into the array.
+     * @param value A short
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(short value) {
+        this.add(new Short(value));
+        return this;
+    }
+
+    /**
+     * Method to place a short into the array.
+     * @param index The position in the array to place the short.
+     * @param value A short
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(int index, short value) {
+        this.add(index, new Short(value));
+        return this;
+    }
+
+    /**
+     * Method to place a double into the array.
+     * @param value A double
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(double value) {
+        this.add(new Double(value));
+        return this;
+    }
+
+    /**
+     * Method to place a double into the array.
+     * @param index The position in the array to place the double.
+     * @param value A double
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(int index, double value) {
+        this.add(index, new Double(value));
+        return this;
+    }
+
+    /**
+     * Method to place a int into the array.
+     * @param value A boolean
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(boolean value) {
+        this.add(new Boolean(value));
+        return this;
+    }
+
+    /**
+     * Method to place a boolean into the array.
+     * @param index The position in the array to place the int.
+     * @param value A boolean
+     * @return A reference to this array instance.
+     */
+    public JSONArray put(int index, boolean value) {
+        this.add(index, new Boolean(value));
+        return this;
+    }
+
+    /*****************/
+    /* End of mapping*/
+    /*****************/
+
+    /********************/
+    /* Utility functions*/
+    /********************/
+
+    /**
+     * Function to obtain a value at the specified index as a boolean.
+     * @param index The index of the item to retrieve.
+     * @return boolean value.
+     * @throws JSONException if the index is outside the range or if the type at the position was not Boolean or a string of 'true' or 'false'
+     */
+    public boolean getBoolean(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                if (Boolean.class.isAssignableFrom(val.getClass())) {
+                    return((Boolean)val).booleanValue();
+                } else if (NumberUtil.isNumber(val.getClass())) {
+                    throw new JSONException("Value at index: [" + index + "] was not a boolean or string value of 'true' or 'false'.");
+                } else if (String.class.isAssignableFrom(val.getClass())) {
+                    String str = (String)val;
+                    if (str.equals("true")) {
+                        return true;
+                    } else if (str.equals("false")) {
+                        return false;
+                    } else {
+                        throw new JSONException("Value at index: [" + index + "] was not a boolean or string value of 'true' or 'false'.");
+                    }
+                }
+            } else {
+                throw new JSONException("Value at index: [" + index + "] was null");
+            }
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+        return false;
+    }
+
+    /**
+     * Function to obtain a value at the specified index as a double.
+     * @param index The index of the item to retrieve.
+     * @return double value.
+     * @throws JSONException if the index is outside the range or if the type at the position was not Number.
+     */
+    public double getDouble(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                if (NumberUtil.isNumber(val.getClass())) {
+                    return NumberUtil.getDouble(val);
+                }
+                else {
+                    throw new JSONException("Value at index: [" + index + "] was not a number.");
+                }
+            } else {
+                throw new JSONException("Value at index: [" + index + "] was null");
+            }
+
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+    }
+
+    /**
+     * Function to obtain a value at the specified index as a long.
+     * @param index The index of the item to retrieve.
+     * @return long value.
+     * @throws JSONException if the index is outside the range or if the type at the position was not Number.
+     */
+    public long getLong(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                if (NumberUtil.isNumber(val.getClass())) {
+                    return NumberUtil.getLong(val);
+                } else {
+                    throw new JSONException("Value at index: [" + index + "] was not a number.");
+                }
+            } else {
+                throw new JSONException("Value at index: [" + index + "] was null");
+            }
+
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+    }
+
+    /**
+     * Function to obtain a value at the specified index as an int.
+     * @param index The index of the item to retrieve.
+     * @return int value.
+     * @throws JSONException if the index is outside the range or if the type at the position was not Number.
+     */
+    public int getInt(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                if (NumberUtil.isNumber(val.getClass())) {
+                    return NumberUtil.getInt(val);
+                }else {
+                    throw new JSONException("Value at index: [" + index + "] was not a number.");
+                }
+            } else {
+                throw new JSONException("Value at index: [" + index + "] was null");
+            }
+
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+    }
+
+    /**
+     * Function to obtain a value at the specified index as a short.
+     * @param index The index of the item to retrieve.
+     * @return short value.
+     * @throws JSONException if the index is outside the range or if the type at the position was not Number.
+     */
+    public short getShort(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                if (NumberUtil.isNumber(val.getClass())) {
+                    return NumberUtil.getShort(val);
+                }
+                else {
+                    throw new JSONException("Value at index: [" + index + "] was not a number.");
+                }
+            } else {
+                throw new JSONException("Value at index: [" + index + "] was null");
+            }
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+    }
+
+    /**
+     * Function to obtain a value at the specified index as a string.
+     * @param index The index of the item to retrieve.
+     * @return string value.
+     * @throws JSONException if the index is outside the range or if the type at the position was not an object with a toString() function..
+     */
+    public String getString(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                return val.toString();
+            } else {
+                throw new JSONException("The value at index: [" + index + "] was null.");
+            }
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a JSONObject
+     * Only values that are instances of JSONObject will be returned.  A null will generate an exception.
+     * @param index The index to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a JSONObject instance.
+     * @return A JSONObject value if the value stored for key is an instance or subclass of JSONObject.
+     */
+    public JSONObject getJSONObject(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                if (JSONObject.class.isAssignableFrom(val.getClass())) {
+                    return(JSONObject)val;
+                } else {
+                    throw new JSONException("The value for index: [" + index + "] was not a JSONObject");
+                }
+            } else {
+                throw new JSONException("The value for index: [" + index + "] was null.  Object required.");
+            }
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified index as a JSONArray
+     * Only values that are instances of JSONArray will be returned.  A null will generate an exception.
+     * @param index The index to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a Long instance, or cannot be converted to a long..
+     * @return A JSONArray value if the value stored for key is an instance or subclass of JSONArray.
+     */
+    public JSONArray getJSONArray(int index) throws JSONException {
+        try {
+            Object val = this.elementAt(index);
+            if (val != null) {
+                if (JSONArray.class.isAssignableFrom(val.getClass())) {
+                    return(JSONArray)val;
+                } else {
+                    throw new JSONException("The value index key: [" + index + "] was not a JSONObject");
+                }
+            } else {
+                throw new JSONException("The value for index: [" + index + "] was null.  Object required.");
+            }
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            JSONException jex = new JSONException("The specified index was outside of the array boundries");
+            jex.setCause(iobe);
+            throw jex;
+        }
+    }
+
+    /**
+     * Utility function for testing if an element at index 'idx' is null or not.
+     * @return boolean indicating if an index is null or not.  Will also return true for indexes outside the size of the array.
+     */
+    public boolean isNull(int index) {
+        try {
+            Object obj = this.elementAt(index);
+            return JSONObject.NULL.equals(obj);
+        } catch (java.lang.IndexOutOfBoundsException iobe) {
+            return true;
+        }
+    }
+
+    /**
+     * Utility function that maps ArrayList.size() to length, for compatibility to other JSON parsers.
+     * @return The number of elements in this JSONArray.
+     */
+    public int length() {
+        return this.size();
+    }
+
+    /***************************/
+    /* End of Utility functions*/
+    /***************************/
+
+    /**
+     * Convert this object into a stream of JSON text.  Same as calling write(os,false);
+     * @param os The output stream to write data to.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public OutputStream write(OutputStream os) throws JSONException {
+        write(os,false);
+        return os;
+    }
+
+    /**
+     * Convert this object into a stream of JSON text.  Same as calling write(writer,false);
+     * @param os The output stream to write data to.  Output stream characters will be serialized as UTF-8.
+     * @param verbose Whether or not to write the JSON text in a verbose format.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public OutputStream write(OutputStream os, boolean verbose) throws JSONException {
+        Writer writer = null;
+        try {
+            //MSN reimplement BUFFERED
+            writer = new OutputStreamWriter(os, "UTF-8");
+        } catch (UnsupportedEncodingException uex) {
+            JSONException jex = new JSONException(uex.toString());
+            jex.setCause(uex);
+            throw jex;
+        }
+        write(writer, verbose);
+        return os;
+    }
+
+    /**
+     * Convert this object into a String of JSON text, specifying how many spaces should
+     * be used for each indent level.  Output stream characters will be serialized as UTF-8.
+     * @param indentDepth How many spaces to use for each indent level.  Should be one to eight.
+     * Less than one means no intending, greater than 8 and it will just use tab.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public OutputStream write(OutputStream os, int indentDepth) throws JSONException {
+        Writer writer = null;
+        try {
+            //MSN reimplement BUFFERED
+            writer = new OutputStreamWriter(os, "UTF-8");
+        } catch (UnsupportedEncodingException uex) {
+            JSONException jex = new JSONException(uex.toString());
+            jex.setCause(uex);
+            throw jex;
+        }
+        write(writer, indentDepth);
+        return os;
+    }
+
+    /**
+     * Convert this object into a stream of JSON text.  Same as calling write(writer,false);
+     * @param writer The writer which to write the JSON text to.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public Writer write(Writer writer) throws JSONException {
+        write(writer, false);
+        return writer;
+    }
+
+    /**
+     * Convert this object into a stream of JSON text, specifying verbosity.
+     * @param writer The writer which to write the JSON text to.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public Writer write(Writer writer, boolean verbose) throws JSONException {
+        Serializer serializer;
+
+        //Try to avoid double-buffering or buffering in-memory
+        //writers.
+        //Class writerClass = writer.getClass();
+        boolean flushIt = false;
+
+       //MSN reimplement BUFFERED
+        /*if (!StringWriter.class.isAssignableFrom(writerClass) &&
+            !CharArrayWriter.class.isAssignableFrom(writerClass) &&
+            !BufferedWriter.class.isAssignableFrom(writerClass)) {
+            writer = new BufferedWriter(writer);
+            flushIt = true;
+        } */
+
+        if (verbose) {
+            serializer = new SerializerVerbose(writer);
+        } else {
+            serializer = new Serializer(writer);
+        }
+
+        try {
+            serializer.writeArray(this);
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        if (flushIt) {
+            try {
+                writer.flush();
+            } catch (Exception ex) {
+                JSONException jex = new JSONException("Error during buffer flush");
+                jex.setCause(ex);
+                throw jex;
+            }
+        }
+        return writer;
+    }
+
+    /**
+     * Convert this array into a stream of JSON text, specifying verbosity.
+     * @param writer The writer which to write the JSON text to.
+     * @param indentDepth How many spaces to use for each indent level.  Should be one to eight.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public Writer write(Writer writer, int indentDepth) throws JSONException {
+        Serializer serializer;
+
+        if (indentDepth < 1) {
+            indentDepth = 0;
+        } else if (indentDepth > 8) {
+            indentDepth = 9;
+        }
+
+        //Try to avoid double-buffering or buffering in-memory
+        //writers.
+       //MSN reimplement BUFFERED
+//        Class writerClass = writer.getClass();
+//        if (!StringWriter.class.isAssignableFrom(writerClass) &&
+//            !CharArrayWriter.class.isAssignableFrom(writerClass) &&
+//            !BufferedWriter.class.isAssignableFrom(writerClass)) {
+//            writer = new BufferedWriter(writer);
+//        }
+
+        if (indentDepth > 0) {
+            serializer = new SerializerVerbose(writer, indentDepth);
+        } else {
+            serializer = new Serializer(writer);
+        }
+        try {
+            serializer.writeArray(this);
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return writer;
+    }
+
+    /**
+     * Convert this object into a String of JSON text, specifying verbosity.
+     * @param verbose Whether or not to write in compressed for formatted Strings.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public String write(boolean verbose) throws JSONException {
+        Serializer serializer;
+        JSON4JStringWriter writer = new JSON4JStringWriter();
+
+        if (verbose) {
+            serializer = new SerializerVerbose(writer);
+        } else {
+            serializer = new Serializer(writer);
+        }
+        try {
+            serializer.writeArray(this).flush();
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return writer.toString();
+    }
+
+    /**
+     * Convert this array into a String of JSON text, specifying verbosity.
+     * @param indentDepth How many spaces to use for each indent level.  Should be one to eight.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public String write(int indentDepth) throws JSONException {
+        Serializer serializer;
+        JSON4JStringWriter writer = new JSON4JStringWriter();
+
+        if (indentDepth < 1) {
+            indentDepth = 0;
+        } else if (indentDepth > 8) {
+            indentDepth = 9;
+        }
+
+        if (indentDepth > 0) {
+            serializer = new SerializerVerbose(writer, indentDepth);
+        } else {
+            serializer = new Serializer(writer);
+        }
+        try {
+            serializer.writeArray(this).flush();
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return writer.toString();
+    }
+
+    /**
+     * Convert this object into a String of JSON text.  Same as write(false);
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public String write() throws JSONException {
+        return write(false);
+    }
+
+    /**
+     * Over-ridden toString() method.  Returns the same value as write(), which is a compact JSON String.
+     * If an error occurs in the serialization, the return will be of format: JSON Generation Error: [<some error>]
+     */
+    public String toString() {
+        String str = null;
+        try {
+            str = write(false);
+        } catch (JSONException jex) {
+            str = "JSON Generation Error: [" + jex.toString() + "]";
+        }
+        return str;
+    }
+
+    /**
+     * Function to return a string of JSON text with specified indention.  Returns the same value as write(indentDepth).
+     * If an error occurs in the serialization, the return will be of format: JSON Generation Error: [<some error>]
+     * @throws JSONException Thrown if an error occurs during JSON generation.
+     */
+    public String toString(int indentDepth) throws JSONException {
+        return write(indentDepth);
+    }
+
+    /**
+     * Method to mimic the behavior of the JavaScript array join function
+     * @param str The string delimiter to place between joined array elements in the output string.
+     * @return A string of all the elements joined together.
+     */
+    public String join(String str) {
+        if (str == null) {
+            str = "";
+        }
+        StringBuffer buf = new StringBuffer();
+        for (int i = 0; i < this.size(); i++) {
+            if (i > 0) {
+                buf.append(str);
+            }
+            Object obj = this.elementAt(i);
+            if (obj == null) {
+                buf.append("null");
+            } else {
+                buf.append(obj.toString());
+            }
+        }
+        return buf.toString();
+    }
+
+    /**
+     * Methods added for compatibility to other models.
+     */
+
+    /**
+     * Method to get the object at that position, or null if outside the array range.
+     * @param index the array index to get
+     * @return - value or null
+     */
+    public Object opt(int index) {
+        try{
+            return elementAt(index);
+        } catch (Throwable th){
+            return null;
+        }
+    }
+
+    /**
+     * Method to get the object at that position, or null if outside the array range.
+     * @param index the array index to get
+     * @param defaultValue the value to return if index is outside the array.
+     * @return - value or defaultValue
+     */
+    public Object opt(int index, Object defaultValue) {
+        try{
+            return elementAt(index);
+        } catch (Throwable th){
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as an boolean, or 'false' if outside the array.
+     * @param index the array index to get
+     * @return - value or false
+     */
+    public boolean optBoolean(int index) {
+        try{
+            return getBoolean(index);
+        } catch (Throwable th){
+            return false;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as an boolean, or 'defaultValue' if outside the array.
+     * @param index The array index to get.
+     * @param defaultValue the value to return if index is outside the array.
+     * @return - value or false
+     */
+    public boolean optBoolean(int index, boolean defaultValue) {
+        try{
+            return getBoolean(index);
+        } catch (Throwable th){
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as an int, or '0' if outside the array.
+     * @param index the array index to get
+     * @return - value or 0
+     */
+    public int optInt(int index) {
+        try{
+            return getInt(index);
+        } catch (Throwable th){
+            return 0;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as an int, or defaultValue if outside the array.
+     * @param index the array index to get
+     * @param defaultValue the value to return if index is outside the array.
+     * @return - value or 0
+     */
+    public int optInt(int index, int defaultValue) {
+        try{
+            return getInt(index);
+        } catch (Throwable th){
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a long, or '0' if outside the array.
+     * @param index the array index to get
+     * @return - value or 0
+     */
+    public long optLong(int index) {
+        try{
+            return getLong(index);
+        } catch (Throwable th){
+            return (long)0;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a long, or defaultValue if outside the array.
+     * @param index the array index to get
+     * @param defaultValue the value to return if index is outside the array.
+     v* @return - value or defaultValue
+     */
+    public long optLong(int index, long defaultValue) {
+        try{
+            return getLong(index);
+        } catch (Throwable th){
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a short, or '0' if outside the array.
+     * @param index the array index to get
+     * @return - value or 0
+     */
+    public short optShort(int index) {
+        try{
+            return getShort(index);
+        } catch (Throwable th){
+            return (short)0;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a short, or '0' if outside the array.
+     * @param index the array index to get
+     * @param defaultValue the value to return if index is outside the array.
+     * @return - value or defaultValue
+     */
+    public short optShort(int index, short defaultValue) {
+        try{
+            return getShort(index);
+        } catch (Throwable th){
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a double, or Double.NaN if outside the array.
+     * @param index the array index to get
+     * @return - value or Double.NaN
+     */
+    public double optDouble(int index) {
+        try{
+            return getDouble(index);
+        } catch (Throwable th){
+            return Double.NaN;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a double, or Double.NaN if outside the array.
+     * @param index the array index to get
+     * @param defaultValue the value to return if index is outside the array.
+     * @return - value or defaultValue
+     */
+    public double optDouble(int index, double defaultValue) {
+        try{
+            return getDouble(index);
+        } catch (Throwable th){
+            return Double.NaN;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a String, or null if outside the array.
+     * @param index the array index to get
+     * @return - value or null
+     */
+    public String optString(int index) {
+        try{
+            return getString(index);
+        } catch (Exception th){
+            return null;
+        }
+    }
+
+    /**
+     * Method to obtain the value at index as a String, or defaultValue if outside the array.
+     * @param index the array index to get
+     * @param defaultValue the value to return if index is outside the array.
+     * @return - value or defaultValue
+     */
+    public String optString(int index, String defaultValue) {
+        try{
+            return getString(index);
+        } catch (Throwable th){
+            return defaultValue;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArtifact.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArtifact.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArtifact.java
new file mode 100644
index 0000000..4e8ff0c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONArtifact.java
@@ -0,0 +1,118 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+import java.io.OutputStream;
+import java.io.Writer;
+
+/**
+ * Interface class to define a set of generic APIs both JSONObject and JSONArray implement.
+ * This is namely so that functions such as write, which are common between the two, can be easily
+ * invoked without knowing the object type.
+ */
+public interface JSONArtifact
+{
+    /**
+     * Write this object to the stream as JSON text in UTF-8 encoding.  Same as calling write(os,false);
+     * Note that encoding is always written as UTF-8, as per JSON spec.
+     * @param os The output stream to write data to.
+     * @return The passed in OutputStream.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public OutputStream write(OutputStream os) throws JSONException;
+
+    /**
+     * Write this object to the stream as JSON text in UTF-8 encoding, specifying whether to use verbose (tab-indented) output or not.
+     * Note that encoding is always written as UTF-8, as per JSON spec.
+     * @param os The output stream to write data to.
+     * @param verbose Whether or not to write the JSON text in a verbose format.  If true, will indent via tab.
+     * @return The passed in OutputStream.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public OutputStream write(OutputStream os, boolean verbose) throws JSONException;
+
+    /**
+     * Write this object to the stream as JSON text in UTF-8 encoding, specifying how many spaces should be used for each indent.
+     * This is an alternate indent style to using tabs.
+     * @param indentDepth How many spaces to use for each indent.  The value should be between one to eight.
+     * Less than one means no indenting, greater than 8 and it will just use tab.
+     * @return The passed in OutputStream.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public OutputStream write(OutputStream os, int indentDepth) throws JSONException;
+
+    /**
+     * Write this object to the writer as JSON text.  Same as calling write(writer,false);
+     * @param writer The writer which to write the JSON text to.
+     * @return The passed in writer.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public Writer write(Writer writer) throws JSONException;
+
+    /**
+     * Writer this object to the writer as JSON text, specifying whether to use verbose (tab-indented) output or not.
+     * be used for each indent.  This is an alternate indent style to using tabs.
+     * @param writer The writer which to write the JSON text to.
+     * @return The passed in writer.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public Writer write(Writer writer, boolean verbose) throws JSONException;
+
+    /**
+     * Write this object to the writer as JSON text, specifying how many spaces should be used for each indent.
+     * This is an alternate indent style to using tabs.
+     * @param writer The writer which to write the JSON text to.
+     * @param indentDepth How many spaces to use for each indent.  The value should be between one to eight.
+     * @return The passed in writer.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public Writer write(Writer writer, int indentDepth) throws JSONException;
+
+    /**
+     * Convert this object into a String of JSON text, specifying whether to use verbose (tab-indented) output or not.
+     * @param verbose Whether or not to write in compressed format.
+     * Less than one means no indenting, greater than 8 and it will just use tab.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public String write(boolean verbose) throws JSONException;
+
+    /**
+     * Convert this object into a String of JSON text, specifying how many spaces should be used for each indent.
+     * This is an alternate indent style to using tabs.
+     * @param indentDepth How many spaces to use for each indent.  The value should be between one to eight.
+     * Less than one means no indenting, greater than 8 and it will just use tab.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public String write(int indentDepth) throws JSONException;
+
+    /**
+     * Convert this object into a String of JSON text.  Same as write(false);
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public String write() throws JSONException;
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONException.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONException.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONException.java
new file mode 100644
index 0000000..d79f419
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONException.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+/**
+ * Class that implements an exception type thrown by all JSON classes
+ * as a common exception when JSON handling errors occur.
+ */
+public class JSONException extends Exception {
+
+    private Throwable cause;
+
+    /**
+     * Constructor for JSON Exception
+     * @param message The error that generated the exception.
+     */
+    public JSONException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructor for JSON Exception
+     * @param t The exception that generated this exception.
+     */
+    public JSONException(Throwable t) {
+        cause = t;
+    }
+
+    public void setCause(Throwable t) {
+        cause = t;
+    }
+
+    /**
+     * Method to get the underlying cause of the JSONException
+     */
+    public Throwable getCause() {
+        return cause;
+    }
+}


[14/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/javascript/cordova.blackberry10.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/javascript/cordova.blackberry10.js b/lib/cordova-blackberry/blackberry10/javascript/cordova.blackberry10.js
new file mode 100644
index 0000000..286891b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/javascript/cordova.blackberry10.js
@@ -0,0 +1,6993 @@
+// Platform: blackberry10
+
+// commit dd02e6c9cd4121910c714e798f84fad2dc072879
+
+// File generated at :: Fri Apr 19 2013 11:54:58 GMT-0400 (EDT)
+
+/*
+ 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.
+*/
+
+;(function() {
+
+// file: lib/scripts/require.js
+
+var require,
+    define;
+
+(function () {
+    var modules = {},
+    // Stack of moduleIds currently being built.
+        requireStack = [],
+    // Map of module ID -> index into requireStack of modules currently being built.
+        inProgressModules = {},
+        SEPERATOR = ".";
+
+
+
+    function build(module) {
+        var factory = module.factory,
+            localRequire = function (id) {
+                var resultantId = id;
+                //Its a relative path, so lop off the last portion and add the id (minus "./")
+                if (id.charAt(0) === ".") {
+                    resultantId = module.id.slice(0, module.id.lastIndexOf(SEPERATOR)) + SEPERATOR + id.slice(2);
+                }
+                return require(resultantId);
+            };
+        module.exports = {};
+        delete module.factory;
+        factory(localRequire, module.exports, module);
+        return module.exports;
+    }
+
+    require = function (id) {
+        if (!modules[id]) {
+            throw "module " + id + " not found";
+        } else if (id in inProgressModules) {
+            var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
+            throw "Cycle in require graph: " + cycle;
+        }
+        if (modules[id].factory) {
+            try {
+                inProgressModules[id] = requireStack.length;
+                requireStack.push(id);
+                return build(modules[id]);
+            } finally {
+                delete inProgressModules[id];
+                requireStack.pop();
+            }
+        }
+        return modules[id].exports;
+    };
+
+    define = function (id, factory) {
+        if (modules[id]) {
+            throw "module " + id + " already defined";
+        }
+
+        modules[id] = {
+            id: id,
+            factory: factory
+        };
+    };
+
+    define.remove = function (id) {
+        delete modules[id];
+    };
+
+    define.moduleMap = modules;
+})();
+
+//Export for use in node
+if (typeof module === "object" && typeof require === "function") {
+    module.exports.require = require;
+    module.exports.define = define;
+}
+
+// file: lib/cordova.js
+define("cordova", function(require, exports, module) {
+
+
+var channel = require('cordova/channel');
+
+/**
+ * Listen for DOMContentLoaded and notify our channel subscribers.
+ */
+document.addEventListener('DOMContentLoaded', function() {
+    channel.onDOMContentLoaded.fire();
+}, false);
+if (document.readyState == 'complete' || document.readyState == 'interactive') {
+    channel.onDOMContentLoaded.fire();
+}
+
+/**
+ * Intercept calls to addEventListener + removeEventListener and handle deviceready,
+ * resume, and pause events.
+ */
+var m_document_addEventListener = document.addEventListener;
+var m_document_removeEventListener = document.removeEventListener;
+var m_window_addEventListener = window.addEventListener;
+var m_window_removeEventListener = window.removeEventListener;
+
+/**
+ * Houses custom event handlers to intercept on document + window event listeners.
+ */
+var documentEventHandlers = {},
+    windowEventHandlers = {};
+
+document.addEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    if (typeof documentEventHandlers[e] != 'undefined') {
+        documentEventHandlers[e].subscribe(handler);
+    } else {
+        m_document_addEventListener.call(document, evt, handler, capture);
+    }
+};
+
+window.addEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    if (typeof windowEventHandlers[e] != 'undefined') {
+        windowEventHandlers[e].subscribe(handler);
+    } else {
+        m_window_addEventListener.call(window, evt, handler, capture);
+    }
+};
+
+document.removeEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    // If unsubscribing from an event that is handled by a plugin
+    if (typeof documentEventHandlers[e] != "undefined") {
+        documentEventHandlers[e].unsubscribe(handler);
+    } else {
+        m_document_removeEventListener.call(document, evt, handler, capture);
+    }
+};
+
+window.removeEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    // If unsubscribing from an event that is handled by a plugin
+    if (typeof windowEventHandlers[e] != "undefined") {
+        windowEventHandlers[e].unsubscribe(handler);
+    } else {
+        m_window_removeEventListener.call(window, evt, handler, capture);
+    }
+};
+
+function createEvent(type, data) {
+    var event = document.createEvent('Events');
+    event.initEvent(type, false, false);
+    if (data) {
+        for (var i in data) {
+            if (data.hasOwnProperty(i)) {
+                event[i] = data[i];
+            }
+        }
+    }
+    return event;
+}
+
+if(typeof window.console === "undefined") {
+    window.console = {
+        log:function(){}
+    };
+}
+
+var cordova = {
+    define:define,
+    require:require,
+    /**
+     * Methods to add/remove your own addEventListener hijacking on document + window.
+     */
+    addWindowEventHandler:function(event) {
+        return (windowEventHandlers[event] = channel.create(event));
+    },
+    addStickyDocumentEventHandler:function(event) {
+        return (documentEventHandlers[event] = channel.createSticky(event));
+    },
+    addDocumentEventHandler:function(event) {
+        return (documentEventHandlers[event] = channel.create(event));
+    },
+    removeWindowEventHandler:function(event) {
+        delete windowEventHandlers[event];
+    },
+    removeDocumentEventHandler:function(event) {
+        delete documentEventHandlers[event];
+    },
+    /**
+     * Retrieve original event handlers that were replaced by Cordova
+     *
+     * @return object
+     */
+    getOriginalHandlers: function() {
+        return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
+        'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
+    },
+    /**
+     * Method to fire event from native code
+     * bNoDetach is required for events which cause an exception which needs to be caught in native code
+     */
+    fireDocumentEvent: function(type, data, bNoDetach) {
+        var evt = createEvent(type, data);
+        if (typeof documentEventHandlers[type] != 'undefined') {
+            if( bNoDetach ) {
+              documentEventHandlers[type].fire(evt);
+            }
+            else {
+              setTimeout(function() {
+                  documentEventHandlers[type].fire(evt);
+              }, 0);
+            }
+        } else {
+            document.dispatchEvent(evt);
+        }
+    },
+    fireWindowEvent: function(type, data) {
+        var evt = createEvent(type,data);
+        if (typeof windowEventHandlers[type] != 'undefined') {
+            setTimeout(function() {
+                windowEventHandlers[type].fire(evt);
+            }, 0);
+        } else {
+            window.dispatchEvent(evt);
+        }
+    },
+
+    /**
+     * Plugin callback mechanism.
+     */
+    // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
+    // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
+    callbackId: Math.floor(Math.random() * 2000000000),
+    callbacks:  {},
+    callbackStatus: {
+        NO_RESULT: 0,
+        OK: 1,
+        CLASS_NOT_FOUND_EXCEPTION: 2,
+        ILLEGAL_ACCESS_EXCEPTION: 3,
+        INSTANTIATION_EXCEPTION: 4,
+        MALFORMED_URL_EXCEPTION: 5,
+        IO_EXCEPTION: 6,
+        INVALID_ACTION: 7,
+        JSON_EXCEPTION: 8,
+        ERROR: 9
+    },
+
+    /**
+     * Called by native code when returning successful result from an action.
+     */
+    callbackSuccess: function(callbackId, args) {
+        try {
+            cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
+        } catch (e) {
+            console.log("Error in error callback: " + callbackId + " = "+e);
+        }
+    },
+
+    /**
+     * Called by native code when returning error result from an action.
+     */
+    callbackError: function(callbackId, args) {
+        // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
+        // Derive success from status.
+        try {
+            cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
+        } catch (e) {
+            console.log("Error in error callback: " + callbackId + " = "+e);
+        }
+    },
+
+    /**
+     * Called by native code when returning the result from an action.
+     */
+    callbackFromNative: function(callbackId, success, status, args, keepCallback) {
+        var callback = cordova.callbacks[callbackId];
+        if (callback) {
+            if (success && status == cordova.callbackStatus.OK) {
+                callback.success && callback.success.apply(null, args);
+            } else if (!success) {
+                callback.fail && callback.fail.apply(null, args);
+            }
+
+            // Clear callback if not expecting any more results
+            if (!keepCallback) {
+                delete cordova.callbacks[callbackId];
+            }
+        }
+    },
+    addConstructor: function(func) {
+        channel.onCordovaReady.subscribe(function() {
+            try {
+                func();
+            } catch(e) {
+                console.log("Failed to run constructor: " + e);
+            }
+        });
+    }
+};
+
+// Register pause, resume and deviceready channels as events on document.
+channel.onPause = cordova.addDocumentEventHandler('pause');
+channel.onResume = cordova.addDocumentEventHandler('resume');
+channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
+
+module.exports = cordova;
+
+});
+
+// file: lib/common/argscheck.js
+define("cordova/argscheck", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+var utils = require('cordova/utils');
+
+var moduleExports = module.exports;
+
+var typeMap = {
+    'A': 'Array',
+    'D': 'Date',
+    'N': 'Number',
+    'S': 'String',
+    'F': 'Function',
+    'O': 'Object'
+};
+
+function extractParamName(callee, argIndex) {
+  return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex];
+}
+
+function checkArgs(spec, functionName, args, opt_callee) {
+    if (!moduleExports.enableChecks) {
+        return;
+    }
+    var errMsg = null;
+    var typeName;
+    for (var i = 0; i < spec.length; ++i) {
+        var c = spec.charAt(i),
+            cUpper = c.toUpperCase(),
+            arg = args[i];
+        // Asterix means allow anything.
+        if (c == '*') {
+            continue;
+        }
+        typeName = utils.typeName(arg);
+        if ((arg === null || arg === undefined) && c == cUpper) {
+            continue;
+        }
+        if (typeName != typeMap[cUpper]) {
+            errMsg = 'Expected ' + typeMap[cUpper];
+            break;
+        }
+    }
+    if (errMsg) {
+        errMsg += ', but got ' + typeName + '.';
+        errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
+        // Don't log when running jake test.
+        if (typeof jasmine == 'undefined') {
+            console.error(errMsg);
+        }
+        throw TypeError(errMsg);
+    }
+}
+
+function getValue(value, defaultValue) {
+    return value === undefined ? defaultValue : value;
+}
+
+moduleExports.checkArgs = checkArgs;
+moduleExports.getValue = getValue;
+moduleExports.enableChecks = true;
+
+
+});
+
+// file: lib/common/builder.js
+define("cordova/builder", function(require, exports, module) {
+
+var utils = require('cordova/utils');
+
+function each(objects, func, context) {
+    for (var prop in objects) {
+        if (objects.hasOwnProperty(prop)) {
+            func.apply(context, [objects[prop], prop]);
+        }
+    }
+}
+
+function clobber(obj, key, value) {
+    exports.replaceHookForTesting(obj, key);
+    obj[key] = value;
+    // Getters can only be overridden by getters.
+    if (obj[key] !== value) {
+        utils.defineGetter(obj, key, function() {
+            return value;
+        });
+    }
+}
+
+function assignOrWrapInDeprecateGetter(obj, key, value, message) {
+    if (message) {
+        utils.defineGetter(obj, key, function() {
+            console.log(message);
+            delete obj[key];
+            clobber(obj, key, value);
+            return value;
+        });
+    } else {
+        clobber(obj, key, value);
+    }
+}
+
+function include(parent, objects, clobber, merge) {
+    each(objects, function (obj, key) {
+        try {
+          var result = obj.path ? require(obj.path) : {};
+
+          if (clobber) {
+              // Clobber if it doesn't exist.
+              if (typeof parent[key] === 'undefined') {
+                  assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+              } else if (typeof obj.path !== 'undefined') {
+                  // If merging, merge properties onto parent, otherwise, clobber.
+                  if (merge) {
+                      recursiveMerge(parent[key], result);
+                  } else {
+                      assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+                  }
+              }
+              result = parent[key];
+          } else {
+            // Overwrite if not currently defined.
+            if (typeof parent[key] == 'undefined') {
+              assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+            } else {
+              // Set result to what already exists, so we can build children into it if they exist.
+              result = parent[key];
+            }
+          }
+
+          if (obj.children) {
+            include(result, obj.children, clobber, merge);
+          }
+        } catch(e) {
+          utils.alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"');
+        }
+    });
+}
+
+/**
+ * Merge properties from one object onto another recursively.  Properties from
+ * the src object will overwrite existing target property.
+ *
+ * @param target Object to merge properties into.
+ * @param src Object to merge properties from.
+ */
+function recursiveMerge(target, src) {
+    for (var prop in src) {
+        if (src.hasOwnProperty(prop)) {
+            if (target.prototype && target.prototype.constructor === target) {
+                // If the target object is a constructor override off prototype.
+                clobber(target.prototype, prop, src[prop]);
+            } else {
+                if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+                    recursiveMerge(target[prop], src[prop]);
+                } else {
+                    clobber(target, prop, src[prop]);
+                }
+            }
+        }
+    }
+}
+
+exports.buildIntoButDoNotClobber = function(objects, target) {
+    include(target, objects, false, false);
+};
+exports.buildIntoAndClobber = function(objects, target) {
+    include(target, objects, true, false);
+};
+exports.buildIntoAndMerge = function(objects, target) {
+    include(target, objects, true, true);
+};
+exports.recursiveMerge = recursiveMerge;
+exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
+exports.replaceHookForTesting = function() {};
+
+});
+
+// file: lib/common/channel.js
+define("cordova/channel", function(require, exports, module) {
+
+var utils = require('cordova/utils'),
+    nextGuid = 1;
+
+/**
+ * Custom pub-sub "channel" that can have functions subscribed to it
+ * This object is used to define and control firing of events for
+ * cordova initialization, as well as for custom events thereafter.
+ *
+ * The order of events during page load and Cordova startup is as follows:
+ *
+ * onDOMContentLoaded*         Internal event that is received when the web page is loaded and parsed.
+ * onNativeReady*              Internal event that indicates the Cordova native side is ready.
+ * onCordovaReady*             Internal event fired when all Cordova JavaScript objects have been created.
+ * onCordovaInfoReady*         Internal event fired when device properties are available.
+ * onCordovaConnectionReady*   Internal event fired when the connection property has been set.
+ * onDeviceReady*              User event fired to indicate that Cordova is ready
+ * onResume                    User event fired to indicate a start/resume lifecycle event
+ * onPause                     User event fired to indicate a pause lifecycle event
+ * onDestroy*                  Internal event fired when app is being destroyed (User should use window.onunload event, not this one).
+ *
+ * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
+ * All listeners that subscribe after the event is fired will be executed right away.
+ *
+ * The only Cordova events that user code should register for are:
+ *      deviceready           Cordova native code is initialized and Cordova APIs can be called from JavaScript
+ *      pause                 App has moved to background
+ *      resume                App has returned to foreground
+ *
+ * Listeners can be registered as:
+ *      document.addEventListener("deviceready", myDeviceReadyListener, false);
+ *      document.addEventListener("resume", myResumeListener, false);
+ *      document.addEventListener("pause", myPauseListener, false);
+ *
+ * The DOM lifecycle events should be used for saving and restoring state
+ *      window.onload
+ *      window.onunload
+ *
+ */
+
+/**
+ * Channel
+ * @constructor
+ * @param type  String the channel name
+ */
+var Channel = function(type, sticky) {
+    this.type = type;
+    // Map of guid -> function.
+    this.handlers = {};
+    // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
+    this.state = sticky ? 1 : 0;
+    // Used in sticky mode to remember args passed to fire().
+    this.fireArgs = null;
+    // Used by onHasSubscribersChange to know if there are any listeners.
+    this.numHandlers = 0;
+    // Function that is called when the first listener is subscribed, or when
+    // the last listener is unsubscribed.
+    this.onHasSubscribersChange = null;
+},
+    channel = {
+        /**
+         * Calls the provided function only after all of the channels specified
+         * have been fired. All channels must be sticky channels.
+         */
+        join: function(h, c) {
+            var len = c.length,
+                i = len,
+                f = function() {
+                    if (!(--i)) h();
+                };
+            for (var j=0; j<len; j++) {
+                if (c[j].state === 0) {
+                    throw Error('Can only use join with sticky channels.');
+                }
+                c[j].subscribe(f);
+            }
+            if (!len) h();
+        },
+        create: function(type) {
+            return channel[type] = new Channel(type, false);
+        },
+        createSticky: function(type) {
+            return channel[type] = new Channel(type, true);
+        },
+
+        /**
+         * cordova Channels that must fire before "deviceready" is fired.
+         */
+        deviceReadyChannelsArray: [],
+        deviceReadyChannelsMap: {},
+
+        /**
+         * Indicate that a feature needs to be initialized before it is ready to be used.
+         * This holds up Cordova's "deviceready" event until the feature has been initialized
+         * and Cordova.initComplete(feature) is called.
+         *
+         * @param feature {String}     The unique feature name
+         */
+        waitForInitialization: function(feature) {
+            if (feature) {
+                var c = channel[feature] || this.createSticky(feature);
+                this.deviceReadyChannelsMap[feature] = c;
+                this.deviceReadyChannelsArray.push(c);
+            }
+        },
+
+        /**
+         * Indicate that initialization code has completed and the feature is ready to be used.
+         *
+         * @param feature {String}     The unique feature name
+         */
+        initializationComplete: function(feature) {
+            var c = this.deviceReadyChannelsMap[feature];
+            if (c) {
+                c.fire();
+            }
+        }
+    };
+
+function forceFunction(f) {
+    if (typeof f != 'function') throw "Function required as first argument!";
+}
+
+/**
+ * Subscribes the given function to the channel. Any time that
+ * Channel.fire is called so too will the function.
+ * Optionally specify an execution context for the function
+ * and a guid that can be used to stop subscribing to the channel.
+ * Returns the guid.
+ */
+Channel.prototype.subscribe = function(f, c) {
+    // need a function to call
+    forceFunction(f);
+    if (this.state == 2) {
+        f.apply(c || this, this.fireArgs);
+        return;
+    }
+
+    var func = f,
+        guid = f.observer_guid;
+    if (typeof c == "object") { func = utils.close(c, f); }
+
+    if (!guid) {
+        // first time any channel has seen this subscriber
+        guid = '' + nextGuid++;
+    }
+    func.observer_guid = guid;
+    f.observer_guid = guid;
+
+    // Don't add the same handler more than once.
+    if (!this.handlers[guid]) {
+        this.handlers[guid] = func;
+        this.numHandlers++;
+        if (this.numHandlers == 1) {
+            this.onHasSubscribersChange && this.onHasSubscribersChange();
+        }
+    }
+};
+
+/**
+ * Unsubscribes the function with the given guid from the channel.
+ */
+Channel.prototype.unsubscribe = function(f) {
+    // need a function to unsubscribe
+    forceFunction(f);
+
+    var guid = f.observer_guid,
+        handler = this.handlers[guid];
+    if (handler) {
+        delete this.handlers[guid];
+        this.numHandlers--;
+        if (this.numHandlers === 0) {
+            this.onHasSubscribersChange && this.onHasSubscribersChange();
+        }
+    }
+};
+
+/**
+ * Calls all functions subscribed to this channel.
+ */
+Channel.prototype.fire = function(e) {
+    var fail = false,
+        fireArgs = Array.prototype.slice.call(arguments);
+    // Apply stickiness.
+    if (this.state == 1) {
+        this.state = 2;
+        this.fireArgs = fireArgs;
+    }
+    if (this.numHandlers) {
+        // Copy the values first so that it is safe to modify it from within
+        // callbacks.
+        var toCall = [];
+        for (var item in this.handlers) {
+            toCall.push(this.handlers[item]);
+        }
+        for (var i = 0; i < toCall.length; ++i) {
+            toCall[i].apply(this, fireArgs);
+        }
+        if (this.state == 2 && this.numHandlers) {
+            this.numHandlers = 0;
+            this.handlers = {};
+            this.onHasSubscribersChange && this.onHasSubscribersChange();
+        }
+    }
+};
+
+
+// defining them here so they are ready super fast!
+// DOM event that is received when the web page is loaded and parsed.
+channel.createSticky('onDOMContentLoaded');
+
+// Event to indicate the Cordova native side is ready.
+channel.createSticky('onNativeReady');
+
+// Event to indicate that all Cordova JavaScript objects have been created
+// and it's time to run plugin constructors.
+channel.createSticky('onCordovaReady');
+
+// Event to indicate that device properties are available
+channel.createSticky('onCordovaInfoReady');
+
+// Event to indicate that the connection property has been set.
+channel.createSticky('onCordovaConnectionReady');
+
+// Event to indicate that all automatically loaded JS plugins are loaded and ready.
+channel.createSticky('onPluginsReady');
+
+// Event to indicate that Cordova is ready
+channel.createSticky('onDeviceReady');
+
+// Event to indicate a resume lifecycle event
+channel.create('onResume');
+
+// Event to indicate a pause lifecycle event
+channel.create('onPause');
+
+// Event to indicate a destroy lifecycle event
+channel.createSticky('onDestroy');
+
+// Channels that must fire before "deviceready" is fired.
+channel.waitForInitialization('onCordovaReady');
+channel.waitForInitialization('onCordovaConnectionReady');
+
+module.exports = channel;
+
+});
+
+// file: lib/common/commandProxy.js
+define("cordova/commandProxy", function(require, exports, module) {
+
+
+// internal map of proxy function
+var CommandProxyMap = {};
+
+module.exports = {
+
+    // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
+    add:function(id,proxyObj) {
+        console.log("adding proxy for " + id);
+        CommandProxyMap[id] = proxyObj;
+        return proxyObj;
+    },
+
+    // cordova.commandProxy.remove("Accelerometer");
+    remove:function(id) {
+        var proxy = CommandProxyMap[id];
+        delete CommandProxyMap[id];
+        CommandProxyMap[id] = null;
+        return proxy;
+    },
+
+    get:function(service,action) {
+        return ( CommandProxyMap[service] ? CommandProxyMap[service][action] : null );
+    }
+};
+});
+
+// file: lib/blackberry10/exec.js
+define("cordova/exec", function(require, exports, module) {
+
+var cordova = require('cordova'),
+    plugins = {
+        'Compass' : require('cordova/plugin/blackberry10/magnetometer'),
+        'Capture' : require('cordova/plugin/blackberry10/capture'),
+        'Media': require('cordova/plugin/blackberry10/media'),
+        'FileTransfer': require('cordova/plugin/blackberry10/fileTransfer')
+    };
+
+/**
+ * Execute a cordova command.  It is up to the native side whether this action
+ * is synchronous or asynchronous.  The native side can return:
+ *      Synchronous: PluginResult object as a JSON string
+ *      Asynchronous: Empty string ""
+ * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
+ * depending upon the result of the action.
+ *
+ * @param {Function} success    The success callback
+ * @param {Function} fail       The fail callback
+ * @param {String} service      The name of the service to use
+ * @param {String} action       Action to be run in cordova
+ * @param {String[]} [args]     Zero or more arguments to pass to the method
+ */
+module.exports = function (success, fail, service, action, args) {
+    if (plugins[service] && plugins[service][action]) {
+        return plugins[service][action](args, success, fail);
+    }
+    return webworks.exec(success, fail, service, action, args);
+};
+
+});
+
+// file: lib/common/modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+    moduleMap = define.moduleMap,
+    symbolList,
+    deprecationMap;
+
+exports.reset = function() {
+    symbolList = [];
+    deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+    if (!(moduleName in moduleMap)) {
+        throw new Error('Module ' + moduleName + ' does not exist.');
+    }
+    symbolList.push(strategy, moduleName, symbolPath);
+    if (opt_deprecationMessage) {
+        deprecationMap[symbolPath] = opt_deprecationMessage;
+    }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+    addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+    addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+    addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+    if (!symbolPath) {
+        return context;
+    }
+    var parts = symbolPath.split('.');
+    var cur = context;
+    for (var i = 0, part; part = parts[i]; ++i) {
+        cur = cur[part] = cur[part] || {};
+    }
+    return cur;
+}
+
+exports.mapModules = function(context) {
+    var origSymbols = {};
+    context.CDV_origSymbols = origSymbols;
+    for (var i = 0, len = symbolList.length; i < len; i += 3) {
+        var strategy = symbolList[i];
+        var moduleName = symbolList[i + 1];
+        var symbolPath = symbolList[i + 2];
+        var lastDot = symbolPath.lastIndexOf('.');
+        var namespace = symbolPath.substr(0, lastDot);
+        var lastName = symbolPath.substr(lastDot + 1);
+
+        var module = require(moduleName);
+        var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+        var parentObj = prepareNamespace(namespace, context);
+        var target = parentObj[lastName];
+
+        if (strategy == 'm' && target) {
+            builder.recursiveMerge(target, module);
+        } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+            if (!(symbolPath in origSymbols)) {
+                origSymbols[symbolPath] = target;
+            }
+            builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+        }
+    }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+    var origSymbols = context.CDV_origSymbols;
+    if (origSymbols && (symbolPath in origSymbols)) {
+        return origSymbols[symbolPath];
+    }
+    var parts = symbolPath.split('.');
+    var obj = context;
+    for (var i = 0; i < parts.length; ++i) {
+        obj = obj && obj[parts[i]];
+    }
+    return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+    for (var k in moduleMap) {
+        if (matchingRegExp.exec(k)) {
+            require(k);
+        }
+    }
+};
+
+exports.reset();
+
+
+});
+
+// file: lib/blackberry10/platform.js
+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);
+
+        modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+        modulemapper.loadMatchingModules(new RegExp('cordova/blackberry10/.*bbsymbols$'));
+        modulemapper.mapModules(window);
+
+        platform.initialize();
+    }
+};
+
+});
+
+// file: lib/common/plugin/Acceleration.js
+define("cordova/plugin/Acceleration", function(require, exports, module) {
+
+var Acceleration = function(x, y, z, timestamp) {
+    this.x = x;
+    this.y = y;
+    this.z = z;
+    this.timestamp = timestamp || (new Date()).getTime();
+};
+
+module.exports = Acceleration;
+
+});
+
+// file: lib/common/plugin/Camera.js
+define("cordova/plugin/Camera", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    exec = require('cordova/exec'),
+    Camera = require('cordova/plugin/CameraConstants'),
+    CameraPopoverHandle = require('cordova/plugin/CameraPopoverHandle');
+
+var cameraExport = {};
+
+// Tack on the Camera Constants to the base camera plugin.
+for (var key in Camera) {
+    cameraExport[key] = Camera[key];
+}
+
+/**
+ * Gets a picture from source defined by "options.sourceType", and returns the
+ * image as defined by the "options.destinationType" option.
+
+ * The defaults are sourceType=CAMERA and destinationType=FILE_URI.
+ *
+ * @param {Function} successCallback
+ * @param {Function} errorCallback
+ * @param {Object} options
+ */
+cameraExport.getPicture = function(successCallback, errorCallback, options) {
+    argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
+    options = options || {};
+    var getValue = argscheck.getValue;
+
+    var quality = getValue(options.quality, 50);
+    var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
+    var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
+    var targetWidth = getValue(options.targetWidth, -1);
+    var targetHeight = getValue(options.targetHeight, -1);
+    var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
+    var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
+    var allowEdit = !!options.allowEdit;
+    var correctOrientation = !!options.correctOrientation;
+    var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
+    var popoverOptions = getValue(options.popoverOptions, null);
+    var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
+
+    var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
+                mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
+
+    exec(successCallback, errorCallback, "Camera", "takePicture", args);
+    return new CameraPopoverHandle();
+};
+
+cameraExport.cleanup = function(successCallback, errorCallback) {
+    exec(successCallback, errorCallback, "Camera", "cleanup", []);
+};
+
+module.exports = cameraExport;
+
+});
+
+// file: lib/common/plugin/CameraConstants.js
+define("cordova/plugin/CameraConstants", function(require, exports, module) {
+
+module.exports = {
+  DestinationType:{
+    DATA_URL: 0,         // Return base64 encoded string
+    FILE_URI: 1,         // Return file uri (content://media/external/images/media/2 for Android)
+    NATIVE_URI: 2        // Return native uri (eg. asset-library://... for iOS)
+  },
+  EncodingType:{
+    JPEG: 0,             // Return JPEG encoded image
+    PNG: 1               // Return PNG encoded image
+  },
+  MediaType:{
+    PICTURE: 0,          // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
+    VIDEO: 1,            // allow selection of video only, ONLY RETURNS URL
+    ALLMEDIA : 2         // allow selection from all media types
+  },
+  PictureSourceType:{
+    PHOTOLIBRARY : 0,    // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)
+    CAMERA : 1,          // Take picture from camera
+    SAVEDPHOTOALBUM : 2  // Choose image from picture library (same as PHOTOLIBRARY for Android)
+  },
+  PopoverArrowDirection:{
+      ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants to specify arrow location on popover
+      ARROW_DOWN : 2,
+      ARROW_LEFT : 4,
+      ARROW_RIGHT : 8,
+      ARROW_ANY : 15
+  },
+  Direction:{
+      BACK: 0,
+      FRONT: 1
+  }
+};
+
+});
+
+// file: lib/common/plugin/CameraPopoverHandle.js
+define("cordova/plugin/CameraPopoverHandle", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+/**
+ * A handle to an image picker popover.
+ */
+var CameraPopoverHandle = function() {
+    this.setPosition = function(popoverOptions) {
+        console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
+    };
+};
+
+module.exports = CameraPopoverHandle;
+
+});
+
+// file: lib/common/plugin/CameraPopoverOptions.js
+define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) {
+
+var Camera = require('cordova/plugin/CameraConstants');
+
+/**
+ * Encapsulates options for iOS Popover image picker
+ */
+var CameraPopoverOptions = function(x,y,width,height,arrowDir){
+    // information of rectangle that popover should be anchored to
+    this.x = x || 0;
+    this.y = y || 32;
+    this.width = width || 320;
+    this.height = height || 480;
+    // The direction of the popover arrow
+    this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
+};
+
+module.exports = CameraPopoverOptions;
+
+});
+
+// file: lib/common/plugin/CaptureAudioOptions.js
+define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
+
+/**
+ * Encapsulates all audio capture operation configuration options.
+ */
+var CaptureAudioOptions = function(){
+    // Upper limit of sound clips user can record. Value must be equal or greater than 1.
+    this.limit = 1;
+    // Maximum duration of a single sound clip in seconds.
+    this.duration = 0;
+    // The selected audio mode. Must match with one of the elements in supportedAudioModes array.
+    this.mode = null;
+};
+
+module.exports = CaptureAudioOptions;
+
+});
+
+// file: lib/common/plugin/CaptureError.js
+define("cordova/plugin/CaptureError", function(require, exports, module) {
+
+/**
+ * The CaptureError interface encapsulates all errors in the Capture API.
+ */
+var CaptureError = function(c) {
+   this.code = c || null;
+};
+
+// Camera or microphone failed to capture image or sound.
+CaptureError.CAPTURE_INTERNAL_ERR = 0;
+// Camera application or audio capture application is currently serving other capture request.
+CaptureError.CAPTURE_APPLICATION_BUSY = 1;
+// Invalid use of the API (e.g. limit parameter has value less than one).
+CaptureError.CAPTURE_INVALID_ARGUMENT = 2;
+// User exited camera application or audio capture application before capturing anything.
+CaptureError.CAPTURE_NO_MEDIA_FILES = 3;
+// The requested capture operation is not supported.
+CaptureError.CAPTURE_NOT_SUPPORTED = 20;
+
+module.exports = CaptureError;
+
+});
+
+// file: lib/common/plugin/CaptureImageOptions.js
+define("cordova/plugin/CaptureImageOptions", function(require, exports, module) {
+
+/**
+ * Encapsulates all image capture operation configuration options.
+ */
+var CaptureImageOptions = function(){
+    // Upper limit of images user can take. Value must be equal or greater than 1.
+    this.limit = 1;
+    // The selected image mode. Must match with one of the elements in supportedImageModes array.
+    this.mode = null;
+};
+
+module.exports = CaptureImageOptions;
+
+});
+
+// file: lib/common/plugin/CaptureVideoOptions.js
+define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) {
+
+/**
+ * Encapsulates all video capture operation configuration options.
+ */
+var CaptureVideoOptions = function(){
+    // Upper limit of videos user can record. Value must be equal or greater than 1.
+    this.limit = 1;
+    // Maximum duration of a single video clip in seconds.
+    this.duration = 0;
+    // The selected video mode. Must match with one of the elements in supportedVideoModes array.
+    this.mode = null;
+};
+
+module.exports = CaptureVideoOptions;
+
+});
+
+// file: lib/common/plugin/CompassError.js
+define("cordova/plugin/CompassError", function(require, exports, module) {
+
+/**
+ *  CompassError.
+ *  An error code assigned by an implementation when an error has occurred
+ * @constructor
+ */
+var CompassError = function(err) {
+    this.code = (err !== undefined ? err : null);
+};
+
+CompassError.COMPASS_INTERNAL_ERR = 0;
+CompassError.COMPASS_NOT_SUPPORTED = 20;
+
+module.exports = CompassError;
+
+});
+
+// file: lib/common/plugin/CompassHeading.js
+define("cordova/plugin/CompassHeading", function(require, exports, module) {
+
+var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) {
+  this.magneticHeading = magneticHeading;
+  this.trueHeading = trueHeading;
+  this.headingAccuracy = headingAccuracy;
+  this.timestamp = timestamp || new Date().getTime();
+};
+
+module.exports = CompassHeading;
+
+});
+
+// file: lib/common/plugin/ConfigurationData.js
+define("cordova/plugin/ConfigurationData", function(require, exports, module) {
+
+/**
+ * Encapsulates a set of parameters that the capture device supports.
+ */
+function ConfigurationData() {
+    // The ASCII-encoded string in lower case representing the media type.
+    this.type = null;
+    // The height attribute represents height of the image or video in pixels.
+    // In the case of a sound clip this attribute has value 0.
+    this.height = 0;
+    // The width attribute represents width of the image or video in pixels.
+    // In the case of a sound clip this attribute has value 0
+    this.width = 0;
+}
+
+module.exports = ConfigurationData;
+
+});
+
+// file: lib/common/plugin/Connection.js
+define("cordova/plugin/Connection", function(require, exports, module) {
+
+/**
+ * Network status
+ */
+module.exports = {
+        UNKNOWN: "unknown",
+        ETHERNET: "ethernet",
+        WIFI: "wifi",
+        CELL_2G: "2g",
+        CELL_3G: "3g",
+        CELL_4G: "4g",
+        CELL:"cellular",
+        NONE: "none"
+};
+
+});
+
+// file: lib/common/plugin/Contact.js
+define("cordova/plugin/Contact", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    exec = require('cordova/exec'),
+    ContactError = require('cordova/plugin/ContactError'),
+    utils = require('cordova/utils');
+
+/**
+* Converts primitives into Complex Object
+* Currently only used for Date fields
+*/
+function convertIn(contact) {
+    var value = contact.birthday;
+    try {
+      contact.birthday = new Date(parseFloat(value));
+    } catch (exception){
+      console.log("Cordova Contact convertIn error: exception creating date.");
+    }
+    return contact;
+}
+
+/**
+* Converts Complex objects into primitives
+* Only conversion at present is for Dates.
+**/
+
+function convertOut(contact) {
+    var value = contact.birthday;
+    if (value !== null) {
+        // try to make it a Date object if it is not already
+        if (!utils.isDate(value)){
+            try {
+                value = new Date(value);
+            } catch(exception){
+                value = null;
+            }
+        }
+        if (utils.isDate(value)){
+            value = value.valueOf(); // convert to milliseconds
+        }
+        contact.birthday = value;
+    }
+    return contact;
+}
+
+/**
+* Contains information about a single contact.
+* @constructor
+* @param {DOMString} id unique identifier
+* @param {DOMString} displayName
+* @param {ContactName} name
+* @param {DOMString} nickname
+* @param {Array.<ContactField>} phoneNumbers array of phone numbers
+* @param {Array.<ContactField>} emails array of email addresses
+* @param {Array.<ContactAddress>} addresses array of addresses
+* @param {Array.<ContactField>} ims instant messaging user ids
+* @param {Array.<ContactOrganization>} organizations
+* @param {DOMString} birthday contact's birthday
+* @param {DOMString} note user notes about contact
+* @param {Array.<ContactField>} photos
+* @param {Array.<ContactField>} categories
+* @param {Array.<ContactField>} urls contact's web sites
+*/
+var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses,
+    ims, organizations, birthday, note, photos, categories, urls) {
+    this.id = id || null;
+    this.rawId = null;
+    this.displayName = displayName || null;
+    this.name = name || null; // ContactName
+    this.nickname = nickname || null;
+    this.phoneNumbers = phoneNumbers || null; // ContactField[]
+    this.emails = emails || null; // ContactField[]
+    this.addresses = addresses || null; // ContactAddress[]
+    this.ims = ims || null; // ContactField[]
+    this.organizations = organizations || null; // ContactOrganization[]
+    this.birthday = birthday || null;
+    this.note = note || null;
+    this.photos = photos || null; // ContactField[]
+    this.categories = categories || null; // ContactField[]
+    this.urls = urls || null; // ContactField[]
+};
+
+/**
+* Removes contact from device storage.
+* @param successCB success callback
+* @param errorCB error callback
+*/
+Contact.prototype.remove = function(successCB, errorCB) {
+    argscheck.checkArgs('FF', 'Contact.remove', arguments);
+    var fail = errorCB && function(code) {
+        errorCB(new ContactError(code));
+    };
+    if (this.id === null) {
+        fail(ContactError.UNKNOWN_ERROR);
+    }
+    else {
+        exec(successCB, fail, "Contacts", "remove", [this.id]);
+    }
+};
+
+/**
+* Creates a deep copy of this Contact.
+* With the contact ID set to null.
+* @return copy of this Contact
+*/
+Contact.prototype.clone = function() {
+    var clonedContact = utils.clone(this);
+    clonedContact.id = null;
+    clonedContact.rawId = null;
+
+    function nullIds(arr) {
+        if (arr) {
+            for (var i = 0; i < arr.length; ++i) {
+                arr[i].id = null;
+            }
+        }
+    }
+
+    // Loop through and clear out any id's in phones, emails, etc.
+    nullIds(clonedContact.phoneNumbers);
+    nullIds(clonedContact.emails);
+    nullIds(clonedContact.addresses);
+    nullIds(clonedContact.ims);
+    nullIds(clonedContact.organizations);
+    nullIds(clonedContact.categories);
+    nullIds(clonedContact.photos);
+    nullIds(clonedContact.urls);
+    return clonedContact;
+};
+
+/**
+* Persists contact to device storage.
+* @param successCB success callback
+* @param errorCB error callback
+*/
+Contact.prototype.save = function(successCB, errorCB) {
+    argscheck.checkArgs('FFO', 'Contact.save', arguments);
+    var fail = errorCB && function(code) {
+        errorCB(new ContactError(code));
+    };
+    var success = function(result) {
+        if (result) {
+            if (successCB) {
+                var fullContact = require('cordova/plugin/contacts').create(result);
+                successCB(convertIn(fullContact));
+            }
+        }
+        else {
+            // no Entry object returned
+            fail(ContactError.UNKNOWN_ERROR);
+        }
+    };
+    var dupContact = convertOut(utils.clone(this));
+    exec(success, fail, "Contacts", "save", [dupContact]);
+};
+
+
+module.exports = Contact;
+
+});
+
+// file: lib/common/plugin/ContactAddress.js
+define("cordova/plugin/ContactAddress", function(require, exports, module) {
+
+/**
+* Contact address.
+* @constructor
+* @param {DOMString} id unique identifier, should only be set by native code
+* @param formatted // NOTE: not a W3C standard
+* @param streetAddress
+* @param locality
+* @param region
+* @param postalCode
+* @param country
+*/
+
+var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) {
+    this.id = null;
+    this.pref = (typeof pref != 'undefined' ? pref : false);
+    this.type = type || null;
+    this.formatted = formatted || null;
+    this.streetAddress = streetAddress || null;
+    this.locality = locality || null;
+    this.region = region || null;
+    this.postalCode = postalCode || null;
+    this.country = country || null;
+};
+
+module.exports = ContactAddress;
+
+});
+
+// file: lib/common/plugin/ContactError.js
+define("cordova/plugin/ContactError", function(require, exports, module) {
+
+/**
+ *  ContactError.
+ *  An error code assigned by an implementation when an error has occurred
+ * @constructor
+ */
+var ContactError = function(err) {
+    this.code = (typeof err != 'undefined' ? err : null);
+};
+
+/**
+ * Error codes
+ */
+ContactError.UNKNOWN_ERROR = 0;
+ContactError.INVALID_ARGUMENT_ERROR = 1;
+ContactError.TIMEOUT_ERROR = 2;
+ContactError.PENDING_OPERATION_ERROR = 3;
+ContactError.IO_ERROR = 4;
+ContactError.NOT_SUPPORTED_ERROR = 5;
+ContactError.PERMISSION_DENIED_ERROR = 20;
+
+module.exports = ContactError;
+
+});
+
+// file: lib/common/plugin/ContactField.js
+define("cordova/plugin/ContactField", function(require, exports, module) {
+
+/**
+* Generic contact field.
+* @constructor
+* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard
+* @param type
+* @param value
+* @param pref
+*/
+var ContactField = function(type, value, pref) {
+    this.id = null;
+    this.type = (type && type.toString()) || null;
+    this.value = (value && value.toString()) || null;
+    this.pref = (typeof pref != 'undefined' ? pref : false);
+};
+
+module.exports = ContactField;
+
+});
+
+// file: lib/common/plugin/ContactFindOptions.js
+define("cordova/plugin/ContactFindOptions", function(require, exports, module) {
+
+/**
+ * ContactFindOptions.
+ * @constructor
+ * @param filter used to match contacts against
+ * @param multiple boolean used to determine if more than one contact should be returned
+ */
+
+var ContactFindOptions = function(filter, multiple) {
+    this.filter = filter || '';
+    this.multiple = (typeof multiple != 'undefined' ? multiple : false);
+};
+
+module.exports = ContactFindOptions;
+
+});
+
+// file: lib/common/plugin/ContactName.js
+define("cordova/plugin/ContactName", function(require, exports, module) {
+
+/**
+* Contact name.
+* @constructor
+* @param formatted // NOTE: not part of W3C standard
+* @param familyName
+* @param givenName
+* @param middle
+* @param prefix
+* @param suffix
+*/
+var ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) {
+    this.formatted = formatted || null;
+    this.familyName = familyName || null;
+    this.givenName = givenName || null;
+    this.middleName = middle || null;
+    this.honorificPrefix = prefix || null;
+    this.honorificSuffix = suffix || null;
+};
+
+module.exports = ContactName;
+
+});
+
+// file: lib/common/plugin/ContactOrganization.js
+define("cordova/plugin/ContactOrganization", function(require, exports, module) {
+
+/**
+* Contact organization.
+* @constructor
+* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard
+* @param name
+* @param dept
+* @param title
+* @param startDate
+* @param endDate
+* @param location
+* @param desc
+*/
+
+var ContactOrganization = function(pref, type, name, dept, title) {
+    this.id = null;
+    this.pref = (typeof pref != 'undefined' ? pref : false);
+    this.type = type || null;
+    this.name = name || null;
+    this.department = dept || null;
+    this.title = title || null;
+};
+
+module.exports = ContactOrganization;
+
+});
+
+// file: lib/common/plugin/Coordinates.js
+define("cordova/plugin/Coordinates", function(require, exports, module) {
+
+/**
+ * This class contains position information.
+ * @param {Object} lat
+ * @param {Object} lng
+ * @param {Object} alt
+ * @param {Object} acc
+ * @param {Object} head
+ * @param {Object} vel
+ * @param {Object} altacc
+ * @constructor
+ */
+var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {
+    /**
+     * The latitude of the position.
+     */
+    this.latitude = lat;
+    /**
+     * The longitude of the position,
+     */
+    this.longitude = lng;
+    /**
+     * The accuracy of the position.
+     */
+    this.accuracy = acc;
+    /**
+     * The altitude of the position.
+     */
+    this.altitude = (alt !== undefined ? alt : null);
+    /**
+     * The direction the device is moving at the position.
+     */
+    this.heading = (head !== undefined ? head : null);
+    /**
+     * The velocity with which the device is moving at the position.
+     */
+    this.speed = (vel !== undefined ? vel : null);
+
+    if (this.speed === 0 || this.speed === null) {
+        this.heading = NaN;
+    }
+
+    /**
+     * The altitude accuracy of the position.
+     */
+    this.altitudeAccuracy = (altacc !== undefined) ? altacc : null;
+};
+
+module.exports = Coordinates;
+
+});
+
+// file: lib/blackberry10/plugin/DirectoryEntry.js
+define("cordova/plugin/DirectoryEntry", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    utils = require('cordova/utils'),
+    Entry = require('cordova/plugin/Entry'),
+    FileError = require('cordova/plugin/FileError'),
+    DirectoryReader = require('cordova/plugin/DirectoryReader'),
+    fileUtils = require('cordova/plugin/blackberry10/fileUtils'),
+    DirectoryEntry = function (name, fullPath) {
+        DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath);
+    };
+
+utils.extend(DirectoryEntry, Entry);
+
+DirectoryEntry.prototype.createReader = function () {
+    return new DirectoryReader(this.fullPath);
+};
+
+DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
+    argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
+    this.nativeEntry.getDirectory(path, options, function (entry) {
+        successCallback(fileUtils.createEntry(entry));
+    }, errorCallback);
+};
+
+DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
+    this.nativeEntry.removeRecursively(successCallback, errorCallback);
+};
+
+DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
+    argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
+    this.nativeEntry.getFile(path, options, function (entry) {
+        successCallback(fileUtils.createEntry(entry));
+    }, errorCallback);
+};
+
+module.exports = DirectoryEntry;
+
+});
+
+// file: lib/blackberry10/plugin/DirectoryReader.js
+define("cordova/plugin/DirectoryReader", function(require, exports, module) {
+
+var FileError = require('cordova/plugin/FileError'),
+    fileUtils = require('cordova/plugin/blackberry10/fileUtils');
+
+function DirectoryReader(path) {
+    this.path = path;
+}
+
+DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) {
+    var win = typeof successCallback !== 'function' ? null : function(result) {
+            var retVal = [];
+            for (var i=0; i<result.length; i++) {
+                retVal.push(fileUtils.createEntry(result[i]));
+            }
+            successCallback(retVal);
+        },
+        fail = typeof errorCallback !== 'function' ? null : function(code) {
+            errorCallback(new FileError(code));
+        };
+    fileUtils.getEntryForURI(this.path, function (entry) {
+        entry.nativeEntry.createReader().readEntries(win, fail);
+    }, function () {
+        fail(FileError.NOT_FOUND_ERR);
+    });
+};
+
+module.exports = DirectoryReader;
+
+});
+
+// file: lib/blackberry10/plugin/Entry.js
+define("cordova/plugin/Entry", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    FileError = require('cordova/plugin/FileError'),
+    Metadata = require('cordova/plugin/Metadata'),
+    fileUtils = require('cordova/plugin/blackberry10/fileUtils');
+
+function Entry(isFile, isDirectory, name, fullPath, fileSystem) {
+    this.isFile = !!isFile;
+    this.isDirectory = !!isDirectory;
+    this.name = name || '';
+    this.fullPath = fullPath || '';
+    this.filesystem = fileSystem || null;
+}
+
+Entry.prototype.getMetadata = function(successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
+    var success = function(lastModified) {
+        var metadata = new Metadata(lastModified);
+        if (typeof successCallback === 'function') {
+            successCallback(metadata);
+        }
+    };
+    this.nativeEntry.getMetadata(success, errorCallback);
+};
+
+Entry.prototype.setMetadata = function(successCallback, errorCallback, metadataObject) {
+    argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
+    errorCallback("Not supported by platform");
+};
+
+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,
+        name = newName || this.name,
+        success = function(entry) {
+            if (entry) {
+                if (successCallback === 'function') {
+                    successCallback(fileUtils.createEntry(entry));
+                }
+            }
+            else {
+                if (typeof fail === 'function') {
+                    fail(FileError.NOT_FOUND_ERR);
+                }
+            }
+        };
+    this.nativeEntry.moveTo(parent.nativeEntry, newName, success, errorCallback);
+};
+
+
+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,
+        name = newName || this.name,
+        success = function(entry) {
+            if (entry) {
+                if (typeof successCallback === 'function') {
+                    successCallback(fileUtils.createEntry(entry));
+                }
+            }
+            else {
+                if (typeof fail === 'function') {
+                    fail(FileError.NOT_FOUND_ERR);
+                }
+            }
+        };
+    this.nativeEntry.copyTo(parent.nativeEntry, newName, success, errorCallback);
+};
+
+Entry.prototype.toURL = function() {
+    return this.fullPath;
+};
+
+Entry.prototype.toURI = function(mimeType) {
+    console.log("DEPRECATED: Update your code to use 'toURL'");
+    return this.toURL();
+};
+
+Entry.prototype.remove = function(successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'Entry.remove', arguments);
+    this.nativeEntry.remove(successCallback, errorCallback);
+};
+
+Entry.prototype.getParent = function(successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'Entry.getParent', arguments);
+    var win = successCallback && function(result) {
+        successCallback(fileUtils.createEntry(result));
+    };
+    this.nativeEntry.getParent(win, errorCallback);
+};
+
+module.exports = Entry;
+
+});
+
+// file: lib/common/plugin/File.js
+define("cordova/plugin/File", function(require, exports, module) {
+
+/**
+ * Constructor.
+ * name {DOMString} name of the file, without path information
+ * fullPath {DOMString} the full path of the file, including the name
+ * type {DOMString} mime type
+ * lastModifiedDate {Date} last modified date
+ * size {Number} size of the file in bytes
+ */
+
+var File = function(name, fullPath, type, lastModifiedDate, size){
+    this.name = name || '';
+    this.fullPath = fullPath || null;
+    this.type = type || null;
+    this.lastModifiedDate = lastModifiedDate || null;
+    this.size = size || 0;
+
+    // These store the absolute start and end for slicing the file.
+    this.start = 0;
+    this.end = this.size;
+};
+
+/**
+ * Returns a "slice" of the file. Since Cordova Files don't contain the actual
+ * content, this really returns a File with adjusted start and end.
+ * Slices of slices are supported.
+ * start {Number} The index at which to start the slice (inclusive).
+ * end {Number} The index at which to end the slice (exclusive).
+ */
+File.prototype.slice = function(start, end) {
+    var size = this.end - this.start;
+    var newStart = 0;
+    var newEnd = size;
+    if (arguments.length) {
+        if (start < 0) {
+            newStart = Math.max(size + start, 0);
+        } else {
+            newStart = Math.min(size, start);
+        }
+    }
+
+    if (arguments.length >= 2) {
+        if (end < 0) {
+            newEnd = Math.max(size + end, 0);
+        } else {
+            newEnd = Math.min(end, size);
+        }
+    }
+
+    var newFile = new File(this.name, this.fullPath, this.type, this.lastModifiedData, this.size);
+    newFile.start = this.start + newStart;
+    newFile.end = this.start + newEnd;
+    return newFile;
+};
+
+
+module.exports = File;
+
+});
+
+// file: lib/blackberry10/plugin/FileEntry.js
+define("cordova/plugin/FileEntry", function(require, exports, module) {
+
+var utils = require('cordova/utils'),
+    Entry = require('cordova/plugin/Entry'),
+    FileWriter = require('cordova/plugin/FileWriter'),
+    File = require('cordova/plugin/File'),
+    FileError = require('cordova/plugin/FileError'),
+    FileEntry = function (name, fullPath) {
+        FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath]);
+    };
+
+utils.extend(FileEntry, Entry);
+
+FileEntry.prototype.createWriter = function(successCallback, errorCallback) {
+    this.file(function (file) {
+        successCallback(new FileWriter(file));
+    }, errorCallback);
+};
+
+FileEntry.prototype.file = function(successCallback, errorCallback) {
+    var fullPath = this.fullPath,
+        success = function (file) {
+            successCallback(new File(file.name, fullPath, file.type, file.lastModifiedDate, file.size));
+        };
+    this.nativeEntry.file(success, errorCallback);
+};
+
+module.exports = FileEntry;
+
+});
+
+// file: lib/common/plugin/FileError.js
+define("cordova/plugin/FileError", function(require, exports, module) {
+
+/**
+ * FileError
+ */
+function FileError(error) {
+  this.code = error || null;
+}
+
+// File error codes
+// Found in DOMException
+FileError.NOT_FOUND_ERR = 1;
+FileError.SECURITY_ERR = 2;
+FileError.ABORT_ERR = 3;
+
+// Added by File API specification
+FileError.NOT_READABLE_ERR = 4;
+FileError.ENCODING_ERR = 5;
+FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
+FileError.INVALID_STATE_ERR = 7;
+FileError.SYNTAX_ERR = 8;
+FileError.INVALID_MODIFICATION_ERR = 9;
+FileError.QUOTA_EXCEEDED_ERR = 10;
+FileError.TYPE_MISMATCH_ERR = 11;
+FileError.PATH_EXISTS_ERR = 12;
+
+module.exports = FileError;
+
+});
+
+// file: lib/blackberry10/plugin/FileReader.js
+define("cordova/plugin/FileReader", function(require, exports, module) {
+
+var origFileReader = window.FileReader,
+    fileUtils = require('cordova/plugin/blackberry10/fileUtils'),
+    utils = require('cordova/utils');
+
+var FileReader = function() {
+    this.nativeReader = new origFileReader();
+};
+
+utils.defineGetter(FileReader.prototype, 'readyState', function() {
+    return this.nativeReader.readyState;
+});
+
+utils.defineGetter(FileReader.prototype, 'error', function() {
+    return this.nativeReader.error;
+});
+
+utils.defineGetter(FileReader.prototype, 'result', function() {
+    return this.nativeReader.result;
+});
+
+function defineEvent(eventName) {
+    utils.defineGetterSetter(FileReader.prototype, eventName, function() {
+        return this.nativeReader[eventName] || null;
+    }, function(value) {
+        this.nativeReader[eventName] = value;
+    });
+}
+
+defineEvent('onabort');
+defineEvent('onerror');
+defineEvent('onload');
+defineEvent('onloadend');
+defineEvent('onloadstart');
+defineEvent('onprogress');
+
+FileReader.prototype.abort = function() {
+    return this.nativeReader.abort();
+};
+
+function read(method, context, file, encoding) {
+    if (file.fullPath) {
+         fileUtils.getEntryForURI(file.fullPath, function (entry) {
+            entry.nativeEntry.file(function (nativeFile) {
+                context.nativeReader[method].call(context.nativeReader, nativeFile, encoding);
+            }, context.onerror);
+        }, context.onerror);
+    } else {
+        context.nativeReader[method](file, encoding);
+    }
+}
+
+FileReader.prototype.readAsText = function(file, encoding) {
+    read("readAsText", this, file, encoding);
+};
+
+FileReader.prototype.readAsDataURL = function(file) {
+    read("readAsDataURL", this, file);
+};
+
+FileReader.prototype.readAsBinaryString = function(file) {
+    read("readAsBinaryString", this, file);
+};
+
+FileReader.prototype.readAsArrayBuffer = function(file) {
+    read("readAsArrayBuffer", this, file);
+};
+
+window.FileReader = FileReader;
+module.exports = FileReader;
+
+});
+
+// file: lib/blackberry10/plugin/FileSystem.js
+define("cordova/plugin/FileSystem", function(require, exports, module) {
+
+module.exports = function(name, root) {
+    this.name = name || null;
+    if (root) {
+        this.root = root;
+    }
+};
+
+});
+
+// file: lib/common/plugin/FileTransfer.js
+define("cordova/plugin/FileTransfer", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    exec = require('cordova/exec'),
+    FileTransferError = require('cordova/plugin/FileTransferError'),
+    ProgressEvent = require('cordova/plugin/ProgressEvent');
+
+function newProgressEvent(result) {
+    var pe = new ProgressEvent();
+    pe.lengthComputable = result.lengthComputable;
+    pe.loaded = result.loaded;
+    pe.total = result.total;
+    return pe;
+}
+
+function getBasicAuthHeader(urlString) {
+    var header =  null;
+
+    if (window.btoa) {
+        // parse the url using the Location object
+        var url = document.createElement('a');
+        url.href = urlString;
+
+        var credentials = null;
+        var protocol = url.protocol + "//";
+        var origin = protocol + url.host;
+
+        // check whether there are the username:password credentials in the url
+        if (url.href.indexOf(origin) !== 0) { // credentials found
+            var atIndex = url.href.indexOf("@");
+            credentials = url.href.substring(protocol.length, atIndex);
+        }
+
+        if (credentials) {
+            var authHeader = "Authorization";
+            var authHeaderValue = "Basic " + window.btoa(credentials);
+
+            header = {
+                name : authHeader,
+                value : authHeaderValue
+            };
+        }
+    }
+
+    return header;
+}
+
+var idCounter = 0;
+
+/**
+ * FileTransfer uploads a file to a remote server.
+ * @constructor
+ */
+var FileTransfer = function() {
+    this._id = ++idCounter;
+    this.onprogress = null; // optional callback
+};
+
+/**
+* Given an absolute file path, uploads a file on the device to a remote server
+* using a multipart HTTP request.
+* @param filePath {String}           Full path of the file on the device
+* @param server {String}             URL of the server to receive the file
+* @param successCallback (Function}  Callback to be invoked when upload has completed
+* @param errorCallback {Function}    Callback to be invoked upon error
+* @param options {FileUploadOptions} Optional parameters such as file name and mimetype
+* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
+*/
+FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) {
+    argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments);
+    // check for options
+    var fileKey = null;
+    var fileName = null;
+    var mimeType = null;
+    var params = null;
+    var chunkedMode = true;
+    var headers = null;
+    var httpMethod = null;
+    var basicAuthHeader = getBasicAuthHeader(server);
+    if (basicAuthHeader) {
+        options = options || {};
+        options.headers = options.headers || {};
+        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
+    }
+
+    if (options) {
+        fileKey = options.fileKey;
+        fileName = options.fileName;
+        mimeType = options.mimeType;
+        headers = options.headers;
+        httpMethod = options.httpMethod || "POST";
+        if (httpMethod.toUpperCase() == "PUT"){
+            httpMethod = "PUT";
+        } else {
+            httpMethod = "POST";
+        }
+        if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") {
+            chunkedMode = options.chunkedMode;
+        }
+        if (options.params) {
+            params = options.params;
+        }
+        else {
+            params = {};
+        }
+    }
+
+    var fail = errorCallback && function(e) {
+        var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
+        errorCallback(error);
+    };
+
+    var self = this;
+    var win = function(result) {
+        if (typeof result.lengthComputable != "undefined") {
+            if (self.onprogress) {
+                self.onprogress(newProgressEvent(result));
+            }
+        } else {
+            successCallback && successCallback(result);
+        }
+    };
+    exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]);
+};
+
+/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String}          URL of the server to receive the file
+ * @param target {String}         Full path of the file on the device
+ * @param successCallback (Function}  Callback to be invoked when upload has completed
+ * @param errorCallback {Function}    Callback to be invoked upon error
+ * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
+ * @param options {FileDownloadOptions} Optional parameters such as headers
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) {
+    argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments);
+    var self = this;
+
+    var basicAuthHeader = getBasicAuthHeader(source);
+    if (basicAuthHeader) {
+        options = options || {};
+        options.headers = options.headers || {};
+        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
+    }
+
+    var headers = null;
+    if (options) {
+        headers = options.headers || null;
+    }
+
+    var win = function(result) {
+        if (typeof result.lengthComputable != "undefined") {
+            if (self.onprogress) {
+                return self.onprogress(newProgressEvent(result));
+            }
+        } else if (successCallback) {
+            var entry = null;
+            if (result.isDirectory) {
+                entry = new (require('cordova/plugin/DirectoryEntry'))();
+            }
+            else if (result.isFile) {
+                entry = new (require('cordova/plugin/FileEntry'))();
+            }
+            entry.isDirectory = result.isDirectory;
+            entry.isFile = result.isFile;
+            entry.name = result.name;
+            entry.fullPath = result.fullPath;
+            successCallback(entry);
+        }
+    };
+
+    var fail = errorCallback && function(e) {
+        var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
+        errorCallback(error);
+    };
+
+    exec(win, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id, headers]);
+};
+
+/**
+ * Aborts the ongoing file transfer on this object. The original error
+ * callback for the file transfer will be called if necessary.
+ */
+FileTransfer.prototype.abort = function() {
+    exec(null, null, 'FileTransfer', 'abort', [this._id]);
+};
+
+module.exports = FileTransfer;
+
+});
+
+// file: lib/common/plugin/FileTransferError.js
+define("cordova/plugin/FileTransferError", function(require, exports, module) {
+
+/**
+ * FileTransferError
+ * @constructor
+ */
+var FileTransferError = function(code, source, target, status, body) {
+    this.code = code || null;
+    this.source = source || null;
+    this.target = target || null;
+    this.http_status = status || null;
+    this.body = body || null;
+};
+
+FileTransferError.FILE_NOT_FOUND_ERR = 1;
+FileTransferError.INVALID_URL_ERR = 2;
+FileTransferError.CONNECTION_ERR = 3;
+FileTransferError.ABORT_ERR = 4;
+
+module.exports = FileTransferError;
+
+});
+
+// file: lib/common/plugin/FileUploadOptions.js
+define("cordova/plugin/FileUploadOptions", function(require, exports, module) {
+
+/**
+ * Options to customize the HTTP request used to upload files.
+ * @constructor
+ * @param fileKey {String}   Name of file request parameter.
+ * @param fileName {String}  Filename to be used by the server. Defaults to image.jpg.
+ * @param mimeType {String}  Mimetype of the uploaded file. Defaults to image/jpeg.
+ * @param params {Object}    Object with key: value params to send to the server.
+ * @param headers {Object}   Keys are header names, values are header values. Multiple
+ *                           headers of the same name are not supported.
+ */
+var FileUploadOptions = function(fileKey, fileName, mimeType, params, headers, httpMethod) {
+    this.fileKey = fileKey || null;
+    this.fileName = fileName || null;
+    this.mimeType = mimeType || null;
+    this.params = params || null;
+    this.headers = headers || null;
+    this.httpMethod = httpMethod || null;
+};
+
+module.exports = FileUploadOptions;
+
+});
+
+// file: lib/common/plugin/FileUploadResult.js
+define("cordova/plugin/FileUploadResult", function(require, exports, module) {
+
+/**
+ * FileUploadResult
+ * @constructor
+ */
+var FileUploadResult = function() {
+    this.bytesSent = 0;
+    this.responseCode = null;
+    this.response = null;
+};
+
+module.exports = FileUploadResult;
+
+});
+
+// file: lib/blackberry10/plugin/FileWriter.js
+define("cordova/plugin/FileWriter", function(require, exports, module) {
+
+var FileError = require('cordova/plugin/FileError'),
+    ProgressEvent = require('cordova/plugin/ProgressEvent'),
+    fileUtils = require('cordova/plugin/blackberry10/fileUtils'),
+    utils = require('cordova/utils');
+
+function FileWriter (file) {
+    var that = this;
+    this.file = file;
+    this.events = {};
+    this.pending = [];
+    fileUtils.getEntryForURI(file.fullPath, function (entry) {
+        entry.nativeEntry.createWriter(function (writer) {
+            var i,
+                event;
+            that.nativeWriter = writer;
+            for (event in that.events) {
+                if (that.events.hasOwnProperty(event)) {
+                    that.nativeWriter[event] = that.events[event];
+                }
+            }
+            for (i = 0; i < that.pending.length; i++) {
+                that.pending[i]();
+            }
+        });
+    });
+    this.events = {};
+    this.pending = [];
+}
+
+utils.defineGetter(FileWriter.prototype, 'error', function() {
+    return this.nativeWriter ? this.nativeWriter.error : null;
+});
+
+utils.defineGetter(FileWriter.prototype, 'fileName', function() {
+    return this.nativeWriter ? this.nativeWriter.fileName : this.file.name;
+});
+
+utils.defineGetter(FileWriter.prototype, 'length', function() {
+    return this.nativeWriter ? this.nativeWriter.length : this.file.size;
+});
+
+utils.defineGetter(FileWriter.prototype, 'position', function() {
+    return this.nativeWriter ? this.nativeWriter.position : 0;
+});
+
+utils.defineGetter(FileWriter.prototype, 'readyState', function() {
+    return this.nativeWriter ? this.nativeWriter.readyState : 0;
+});
+
+function defineEvent(eventName) {
+    utils.defineGetterSetter(FileWriter.prototype, eventName, function() {
+        return this.nativeWriter ? this.nativeWriter[eventName] || null : this.events[eventName] || null;
+    }, function(value) {
+        if (this.nativeWriter) {
+            this.nativeWriter[eventName] = value;
+        }
+        else {
+            this.events[eventName] = value;
+        }
+    });
+}
+
+defineEvent('onabort');
+defineEvent('onerror');
+defineEvent('onprogress');
+defineEvent('onwrite');
+defineEvent('onwriteend');
+defineEvent('onwritestart');
+
+FileWriter.prototype.abort = function() {
+    this.nativeWriter.abort();
+};
+
+FileWriter.prototype.write = function(text) {
+    var that = this,
+        op = function () {
+            that.nativeWriter.write(new Blob([text]));
+        };
+    this.nativeWriter ? op() : this.pending.push(op);
+
+};
+
+FileWriter.prototype.seek = function(offset) {
+    var that = this,
+        op = function () {
+            that.nativeWriter.seek(offset);
+        };
+    this.nativeWriter ? op() : this.pending.push(op);
+};
+
+FileWriter.prototype.truncate = function(size) {
+    var that = this,
+        op = function () {
+            that.nativeWriter.truncate(size);
+        };
+    this.nativeWriter ? op() : this.pending.push(op);
+};
+
+module.exports = FileWriter;
+
+});
+
+// file: lib/common/plugin/Flags.js
+define("cordova/plugin/Flags", function(require, exports, module) {
+
+/**
+ * Supplies arguments to methods that lookup or create files and directories.
+ *
+ * @param create
+ *            {boolean} file or directory if it doesn't exist
+ * @param exclusive
+ *            {boolean} used with create; if true the command will fail if
+ *            target path exists
+ */
+function Flags(create, exclusive) {
+    this.create = create || false;
+    this.exclusive = exclusive || false;
+}
+
+module.exports = Flags;
+
+});
+
+// file: lib/common/plugin/GlobalizationError.js
+define("cordova/plugin/GlobalizationError", function(require, exports, module) {
+
+
+/**
+ * Globalization error object
+ *
+ * @constructor
+ * @param code
+ * @param message
+ */
+var GlobalizationError = function(code, message) {
+    this.code = code || null;
+    this.message = message || '';
+};
+
+// Globalization error codes
+GlobalizationError.UNKNOWN_ERROR = 0;
+GlobalizationError.FORMATTING_ERROR = 1;
+GlobalizationError.PARSING_ERROR = 2;
+GlobalizationError.PATTERN_ERROR = 3;
+
+module.exports = GlobalizationError;
+
+});
+
+// file: lib/common/plugin/InAppBrowser.js
+define("cordova/plugin/InAppBrowser", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+var channel = require('cordova/channel');
+var modulemapper = require('cordova/modulemapper');
+
+function InAppBrowser() {
+   this.channels = {
+        'loadstart': channel.create('loadstart'),
+        'loadstop' : channel.create('loadstop'),
+        'loaderror' : channel.create('loaderror'),
+        'exit' : channel.create('exit')
+   };
+}
+
+InAppBrowser.prototype = {
+    _eventHandler: function (event) {
+        if (event.type in this.channels) {
+            this.channels[event.type].fire(event);
+        }
+    },
+    close: function (eventname) {
+        exec(null, null, "InAppBrowser", "close", []);
+    },
+    addEventListener: function (eventname,f) {
+        if (eventname in this.channels) {
+            this.channels[eventname].subscribe(f);
+        }
+    },
+    removeEventListener: function(eventname, f) {
+        if (eventname in this.channels) {
+            this.channels[eventname].unsubscribe(f);
+        }
+    },
+
+    executeScript: function(injectDetails, cb) {
+        if (injectDetails.code) {
+            exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]);
+        } else if (injectDetails.file) {
+            exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]);
+        } else {
+            throw new Error('executeScript requires exactly one of code or file to be specified');
+        }
+    },
+
+    insertCSS: function(injectDetails, cb) {
+        if (injectDetails.code) {
+            exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]);
+        } else if (injectDetails.file) {
+            exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]);
+        } else {
+            throw new Error('insertCSS requires exactly one of code or file to be specified');
+        }
+    }
+};
+
+module.exports = function(strUrl, strWindowName, strWindowFeatures) {
+    var iab = new InAppBrowser();
+    var cb = function(eventname) {
+       iab._eventHandler(eventname);
+    };
+
+    // Don't catch calls that write to existing frames (e.g. named iframes).
+    if (window.frames && window.frames[strWindowName]) {
+        var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
+        return origOpenFunc.apply(window, arguments);
+    }
+
+    exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
+    return iab;
+};
+
+
+});
+
+// file: lib/common/plugin/LocalFileSystem.js
+define("cordova/plugin/LocalFileSystem", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+/**
+ * Represents a local file system.
+ */
+var LocalFileSystem = function() {
+
+};
+
+LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence
+LocalFileSystem.PERSISTENT = 1; //persistent
+
+module.exports = LocalFileSystem;
+
+});
+
+// file: lib/common/plugin/Media.js
+define("cordova/plugin/Media", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    utils = require('cordova/utils'),
+    exec = require('cordova/exec');
+
+var mediaObjects = {};
+
+/**
+ * This class provides access to the device media, interfaces to both sound and video
+ *
+ * @constructor
+ * @param src                   The file name or url to play
+ * @param successCallback       The callback to be called when the file is done playing or recording.
+ *                                  successCallback()
+ * @param errorCallback         The callback to be called if there is an error.
+ *                                  errorCallback(int errorCode) - OPTIONAL
+ * @param statusCallback        The callback to be called when media status has changed.
+ *                                  statusCallback(int statusCode) - OPTIONAL
+ */
+var Media = function(src, successCallback, errorCallback, statusCallback) {
+    argscheck.checkArgs('SFFF', 'Media', arguments);
+    this.id = utils.createUUID();
+    mediaObjects[this.id] = this;
+    this.src = src;
+    this.successCallback = successCallback;
+    this.errorCallback = errorCallback;
+    this.statusCallback = statusCallback;
+    this._duration = -1;
+    this._position = -1;
+    exec(null, this.errorCallback, "Media", "create", [this.id, this.src]);
+};
+
+// Media messages
+Media.MEDIA_STATE = 1;
+Media.MEDIA_DURATION = 2;
+Media.MEDIA_POSITION = 3;
+Media.MEDIA_ERROR = 9;
+
+// Media states
+Media.MEDIA_NONE = 0;
+Media.MEDIA_STARTING = 1;
+Media.MEDIA_RUNNING = 2;
+Media.MEDIA_PAUSED = 3;
+Media.MEDIA_STOPPED = 4;
+Media.MEDIA_MSG = ["None", "Starting", "Running", "Paused", "Stopped"];
+
+// "static" function to return existing objs.
+Media.get = function(id) {
+    return mediaObjects[id];
+};
+
+/**
+ * Start or resume playing audio file.
+ */
+Media.prototype.play = function(options) {
+    exec(null, null, "Media", "startPlayingAudio", [this.id, this.src, options]);
+};
+
+/**
+ * Stop playing audio file.
+ */
+Media.prototype.stop = function() {
+    var me = this;
+    exec(function() {
+        me._position = 0;
+    }, this.errorCallback, "Media", "stopPlayingAudio", [this.id]);
+};
+
+/**
+ * Seek or jump to a new time in the track..
+ */
+Media.prototype.seekTo = function(milliseconds) {
+    var me = this;
+    exec(function(p) {
+        me._position = p;
+    }, this.errorCallback, "Media", "seekToAudio", [this.id, milliseconds]);
+};
+
+/**
+ * Pause playing audio file.
+ */
+Media.prototype.pause = function() {
+    exec(null, this.errorCallback, "Media", "pausePlayingAudio", [this.id]);
+};
+
+/**
+ * Get duration of an audio file.
+ * The duration is only set for audio that is playing, paused or stopped.
+ *
+ * @return      duration or -1 if not known.
+ */
+Media.prototype.getDuration = function() {
+    return this._duration;
+};
+
+/**
+ * Get position of audio.
+ */
+Media.prototype.getCurrentPosition = function(success, fail) {
+    var me = this;
+    exec(function(p) {
+        me._position = p;
+        success(p);
+    }, fail, "Media", "getCurrentPositionAudio", [this.id]);
+};
+
+/**
+ * Start recording audio file.
+ */
+Media.prototype.startRecord = function() {
+    exec(null, this.errorCallback, "Media", "startRecordingAudio", [this.id, this.src]);
+};
+
+/**
+ * Stop recording audio file.
+ */
+Media.prototype.stopRecord = function() {
+    exec(null, this.errorCallback, "Media", "stopRecordingAudio", [this.id]);
+};
+
+/**
+ * Release the resources.
+ */
+Media.prototype.release = function() {
+    exec(null, this.errorCallback, "Media", "release", [this.id]);
+};
+
+/**
+ * Adjust the volume.
+ */
+Media.prototype.setVolume = function(volume) {
+    exec(null, null, "Media", "setVolume", [this.id, volume]);
+};
+
+/**
+ * Audio has status update.
+ * PRIVATE
+ *
+ * @param id            The media object id (string)
+ * @param msgType       The 'type' of update this is
+ * @param value         Use of value is determined by the msgType
+ */
+Media.onStatus = function(id, msgType, value) {
+
+    var media = mediaObjects[id];
+
+    if(media) {
+        switch(msgType) {
+            case Media.MEDIA_STATE :
+                media.statusCallback && media.statusCallback(value);
+                if(value == Media.MEDIA_STOPPED) {
+                    media.successCallback && media.successCallback();
+                }
+                break;
+            case Media.MEDIA_DURATION :
+                media._duration = value;
+                break;
+            case Media.MEDIA_ERROR :
+                media.errorCallback && media.errorCallback(value);
+                break;
+            case Media.MEDIA_POSITION :
+                media._position = Number(value);
+                break;
+            default :
+                console.error && console.error("Unhandled Media.onStatus :: " + msgType);
+                break;
+        }
+    }
+    else {
+         console.error && console.error("Received Media.onStatus callback for unknown media :: " + id);
+    }
+
+};
+
+module.exports = Media;
+
+});
+
+// file: lib/common/plugin/MediaError.js
+define("cordova/plugin/MediaError", function(require, exports, module) {
+
+/**
+ * This class contains information about any Media errors.
+*/
+/*
+ According to :: http://dev.w3.org/html5/spec-author-view/video.html#mediaerror
+ We should never be creating these objects, we should just implement the interface
+ which has 1 property for an instance, 'code'
+
+ instead of doing :
+    errorCallbackFunction( new MediaError(3,'msg') );
+we should simply use a literal :
+    errorCallbackFunction( {'code':3} );
+ */
+
+ var _MediaError = window.MediaError;
+
+
+if(!_MediaError) {
+    window.MediaError = _MediaError = function(code, msg) {
+        this.code = (typeof code != 'undefined') ? code : null;
+        this.message = msg || ""; // message is NON-standard! do not use!
+    };
+}
+
+_MediaError.MEDIA_ERR_NONE_ACTIVE    = _MediaError.MEDIA_ERR_NONE_ACTIVE    || 0;
+_MediaError.MEDIA_ERR_ABORTED        = _MediaError.MEDIA_ERR_ABORTED        || 1;
+_MediaError.MEDIA_ERR_NETWORK        = _MediaError.MEDIA_ERR_NETWORK        || 2;
+_MediaError.MEDIA_ERR_DECODE         = _MediaError.MEDIA_ERR_DECODE         || 3;
+_MediaError.MEDIA_ERR_NONE_SUPPORTED = _MediaError.MEDIA_ERR_NONE_SUPPORTED || 4;
+// TODO: MediaError.MEDIA_ERR_NONE_SUPPORTED is legacy, the W3 spec now defines it as below.
+// as defined by http://dev.w3.org/html5/spec-author-view/video.html#error-codes
+_MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = _MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED || 4;
+
+module.exports = _MediaError;
+
+});
+
+// file: lib/common/plugin/MediaFile.js
+define("cordova/plugin/MediaFile", function(require, exports, module) {
+
+var utils = require('cordova/utils'),
+    exec = require('cordova/exec'),
+    File = require('cordova/plugin/File'),
+    CaptureError = require('cordova/plugin/CaptureError');
+/**
+ * Represents a single file.
+ *
+ * name {DOMString} name of the file, without path information
+ * fullPath {DOMString} the full path of the file, including the name
+ * type {DOMString} mime type
+ * lastModifiedDate {Date} last modified date
+ * size {Number} size of the file in bytes
+ */
+var MediaFile = function(name, fullPath, type, lastModifiedDate, size){
+    MediaFile.__super__.constructor.apply(this, arguments);
+};
+
+utils.extend(MediaFile, File);
+
+/**
+ * Request capture format data for a specific file and type
+ *
+ * @param {Function} successCB
+ * @param {Function} errorCB
+ */
+MediaFile.prototype.getFormatData = function(successCallback, errorCallback) {
+    if (typeof this.fullPath === "undefined" || this.fullPath === null) {
+        errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+    } else {
+        exec(s

<TRUNCATED>

[33/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringReader.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringReader.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringReader.java
new file mode 100644
index 0000000..5c3583a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringReader.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+import java.io.IOException;
+import java.io.Reader;
+
+public class JSON4JStringReader extends Reader {
+
+    private char[] _buf = null;
+    private int _mark = 0;
+    private int maxLength = 0;
+
+    public JSON4JStringReader(String str) {
+        _buf = str.toCharArray();
+        maxLength = str.length();
+        _mark = 0;
+    }
+
+    public void close() throws IOException {
+        return;
+    }
+
+    public int read(char[] cbuf, int off, int len) throws IOException {
+        if (_mark == (maxLength))
+            return -1;
+
+        int read = 0;
+        for (int x=0; x<len; x++) {
+            cbuf[x+off] = _buf[_mark];
+            read++;
+            _mark++;
+            if (_mark == (maxLength))
+                return read;
+        }
+        return read;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringWriter.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringWriter.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringWriter.java
new file mode 100644
index 0000000..ce1d2cc
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JStringWriter.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+import java.io.IOException;
+import java.io.Writer;
+
+public class JSON4JStringWriter extends Writer {
+
+    public static int BUF_SIZE = 10000;
+
+    private char[] _buffer = null;
+
+    private int _mark = 0;
+
+    public JSON4JStringWriter() {
+        _buffer = new char[BUF_SIZE];
+        _mark = 0;
+    }
+
+    // Resizes an array; doubles up every time.
+    public static char[] resizeArray(char[] expandMe) {
+        int newSize = expandMe.length * 2;
+        char[] newArray = new char[newSize];
+        System.arraycopy(expandMe, 0, newArray, 0, expandMe.length);
+        return newArray;
+    }
+
+
+    public void close() throws IOException {
+        return;
+    }
+
+    public void flush() throws IOException {
+        return;
+    }
+
+    public void write(char[] cbuf, int off, int len) throws IOException {
+        if (((len - off) + _mark) >= _buffer.length) {
+            // Resize the array first.
+            _buffer = JSON4JStringWriter.resizeArray(_buffer);
+        }
+        for (int x=0; x < len; x++) {
+            _buffer[_mark] = cbuf[off+x];
+            _mark++;
+        }
+    }
+
+    public String toString() {
+        return new String(_buffer, 0, _mark);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/NumberUtil.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/NumberUtil.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/NumberUtil.java
new file mode 100644
index 0000000..d63d4db
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/NumberUtil.java
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+public class NumberUtil {
+
+    public static  boolean isNumber(Class clazz) {
+        if ( (clazz == Integer.class) || (clazz == Long.class) || (clazz == Double.class) || (clazz == Short.class) || (clazz == Float.class)) {
+            return true;
+        }
+        return false;
+    }
+
+    public static double getDouble(Object val) {
+        if (val instanceof Double) {
+            return ((Double)val).doubleValue();
+        }
+        else if (val instanceof Long) {
+            return ((Long)val).doubleValue();
+        }
+        else if (val instanceof Short) {
+            Integer i = new Integer( ((Short)val).shortValue() );
+            return i.doubleValue();
+        }
+        else if (val instanceof Float) {
+            return ((Float)val).doubleValue();
+        }
+        else if (val instanceof Integer) {
+            return ((Integer)val).doubleValue();
+        }
+        throw new IllegalArgumentException("Not a number");
+    }
+
+    public static short getShort(Object val) {
+        if (val instanceof Double) {
+            return ((Double)val).shortValue();
+        }
+        else if (val instanceof Long) {
+            Double dg = new Double(((Long)val).longValue());
+            return dg.shortValue();
+        }
+        else if (val instanceof Short) {
+            return ((Short)val).shortValue();
+        }
+        else if (val instanceof Float) {
+            return ((Float)val).shortValue();
+        } else if (val instanceof Integer) {
+            return ((Integer)val).shortValue();
+        }
+        throw new IllegalArgumentException("Not a number");
+    }
+
+    public static int getInt(Object val) {
+        if (val instanceof Double) {
+            return ((Double)val).intValue();
+        }
+        else if (val instanceof Long) {
+            Double dg = new Double(((Long)val).longValue());
+            return dg.intValue();
+        }
+        else if (val instanceof Short) {
+            Double dg = new Double(((Short)val).shortValue());
+            return dg.intValue();
+        }
+        else if (val instanceof Float) {
+            return ((Float)val).intValue();
+        }
+        else if (val instanceof Integer) {
+            return ((Integer)val).intValue();
+        }
+        throw new IllegalArgumentException("Not a number");
+    }
+
+    public static long getLong(Object val) {
+        if (val instanceof Double) {
+            return ((Double)val).longValue();
+        }
+        else if (val instanceof Long) {
+            return ((Long)val).longValue();
+        }
+        else if (val instanceof Short) {
+            Long lg = new Long(((Short)val).shortValue());
+            return lg.longValue();
+        }
+        else if (val instanceof Float) {
+            return ((Float)val).longValue();
+        }
+        else if (val instanceof Integer) {
+            return ((Integer)val).longValue();
+        }
+        throw new IllegalArgumentException("Not a number");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Parser.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Parser.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Parser.java
new file mode 100644
index 0000000..39ddf98
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Parser.java
@@ -0,0 +1,338 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+import java.io.IOException;
+import java.io.Reader;
+
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+/**
+ * Private parser class which handles doing the parsing of the JSON string into tokens.
+ */
+public class Parser {
+
+    private Tokenizer tokenizer;
+    private Token     lastToken;
+
+    /**
+     * Contructor
+     * @param reader The Reader to use when reading in the JSON stream/string.
+     *
+     * @throws JSONException Thrown if an error occurs in tokenizing the JSON string.
+     */
+    public Parser(Reader reader) throws JSONException {
+        super();
+        try {
+            this.tokenizer = new Tokenizer(reader, false);
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+    }
+
+    /**
+     * Contructor
+     * @param reader The Reader to use when reading in the JSON stream/string.
+     * @param strict Boolean indicating if the parser should parse in strict mode, meaning unqoted strings and comments are not allowed.
+     *
+     * @throws JSONException Thrown if an error occurs in tokenizing the JSON string.
+     */
+    public Parser(Reader reader, boolean strict) throws JSONException {
+        super();
+        try {
+            this.tokenizer = new Tokenizer(reader, strict);
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+    }
+
+    /**
+     * Method to initiate the parse of the toplevel JSON object, which will in turn parse all child JSON objects contained within.
+     * Same as calling parse(false);
+     *
+     * @throws JSONException Thrown if an IO error occurd during parse of the JSON object(s).
+     */
+    public JSONObject parse() throws JSONException {
+        return parse(false, (JSONObject)null);
+    }
+
+    /**
+     * Method to initiate the parse of the toplevel JSON object, which will in turn parse all child JSON objects contained within.
+     * Same as calling parse(false);
+     *
+     * @throws JSONException Thrown if an IO error occurd during parse of the JSON object(s).
+     */
+    public JSONObject parse(JSONObject jObj) throws JSONException {
+        return parse(false, jObj);
+    }
+
+    /**
+     * Method to initiate the parse of the toplevel JSON object, which will in turn parse all child JSON objects contained within.
+     * @param ordered Flag to denote if the parse should contruct a JSON object which maintains serialization order of the attributes.
+     *
+     * @throws JSONException Thrown if an IO error occurd during parse of the JSON object(s).
+     */
+    public JSONObject parse(boolean ordered) throws JSONException {
+        try {
+            lastToken = tokenizer.next();
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return parseObject(ordered, null);
+    }
+
+    /**
+     * Method to initiate the parse of the toplevel JSON object, which will in turn parse all child JSON objects contained within.
+     * @param ordered Flag to denote if the parse should contruct a JSON object which maintains serialization order of the attributes.
+     * @param jObj The JSONObjetc to fill out from the parsing.  If null, create a new one.
+     *
+     * @throws JSONException Thrown if an IO error occurd during parse of the JSON object(s).
+     */
+    public JSONObject parse(boolean ordered, JSONObject jObj) throws JSONException {
+        try {
+            lastToken = tokenizer.next();
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return parseObject(ordered, jObj);
+    }
+
+    /**
+     * Method to initiate the parse of the toplevel JSON object, which will in turn parse all child JSON objects contained within.
+     * @param jObj The JSONArray to fill out from the parsing.  If null, create a new one.
+     *
+     * @throws JSONException Thrown if an IO error occurd during parse of the JSON object(s).
+     */
+    public JSONArray parse(JSONArray jObj) throws JSONException {
+        return parse(false, jObj);
+    }
+
+    /**
+     * Method to initiate the parse of the toplevel JSON object, which will in turn parse all child JSON objects contained within.
+     * @param ordered Flag to denote if the parse should contruct for all JSON objects encounted, a JSON object which maintains serialization order of the attributes.
+     * @param jObj The JSONArray to fill out from the parsing.  If null, create a new one.
+     *
+     * @throws JSONException Thrown if an IO error occurd during parse of the JSON object(s).
+     */
+    public JSONArray parse(boolean ordered, JSONArray jObj) throws JSONException {
+        try {
+            lastToken = tokenizer.next();
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return parseArray(ordered, jObj);
+    }
+
+    /**
+     * Method to parse a JSON object out of the current JSON string position.
+     * @return JSONObject Returns the parsed out JSON object.
+     *
+     * @throws JSONException Thrown if an IO error occurs during parse, such as a malformed JSON object.
+     */
+    public JSONObject parseObject() throws JSONException {
+        return parseObject(false, null);
+    }
+
+    /**
+     * Method to parse a JSON object out of the current JSON string position.
+     * @param ordered Flag to denote if the parse should contruct a JSON object which maintains serialization order of the attributes.
+     * @return JSONObject Returns the parsed out JSON object.
+     *
+     * @throws JSONException Thrown if an IO error occurs during parse, such as a malformed JSON object.
+     */
+    public JSONObject parseObject(boolean ordered, JSONObject rootObject) throws JSONException {
+
+        try {
+            JSONObject result = null;
+            if (rootObject != null) {
+                result = rootObject;
+            } else {
+                if (!ordered) {
+                    result = new JSONObject();
+                } else {
+                    //MSN NO ORDERED
+                    result = new JSONObject();
+                }
+            }
+
+            if (lastToken != Token.TokenBraceL) throw new JSONException("Expecting '{' " + tokenizer.onLineCol() + " instead, obtained token: '" + lastToken + "'");
+            lastToken = tokenizer.next();
+
+            while (true) {
+                if (lastToken == Token.TokenEOF) throw new JSONException("Unterminated object " + tokenizer.onLineCol());
+
+                if (lastToken == Token.TokenBraceR) {
+                    lastToken = tokenizer.next();
+                    break;
+                }
+
+                if (!lastToken.isString()) throw new JSONException("Expecting string key " + tokenizer.onLineCol());
+                String key = lastToken.getString();
+
+                lastToken = tokenizer.next();
+                if (lastToken != Token.TokenColon) throw new JSONException("Expecting colon " + tokenizer.onLineCol());
+
+                lastToken = tokenizer.next();
+                Object val = parseValue(ordered);
+
+                result.put(key, val);
+
+                if (lastToken == Token.TokenComma) {
+                    lastToken = tokenizer.next();
+                }
+
+                else if (lastToken != Token.TokenBraceR) {
+                    throw new JSONException("expecting either ',' or '}' " + tokenizer.onLineCol());
+                }
+            }
+            return result;
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during object input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+    }
+
+    /**
+     * Method to parse out a JSON array from a JSON string
+     * Same as calling parseArray(false, null)
+     *
+     * @throws JSONException Thrown if a parse error occurs, such as a malformed JSON array.
+     */
+    public JSONArray parseArray() throws JSONException {
+        return parseArray(false, null);
+    }
+
+    /**
+     * Method to parse out a JSON array from a JSON string
+     * @param ordered Flag to denote if the parse should contruct JSON objects which maintain serialization order of the attributes for all JSONOjects in the array.
+     * *param array An array instance to populate instead of creating a new one.
+     *
+     * @throws JSONException Thrown if a parse error occurs, such as a malformed JSON array.
+     */
+    public JSONArray parseArray(boolean ordered, JSONArray array) throws JSONException {
+        JSONArray result = null;
+        if(array != null){
+            result = array;
+        } else {
+            result = new JSONArray();
+        }
+
+        try {
+            if (lastToken != Token.TokenBrackL) throw new JSONException("Expecting '[' " + tokenizer.onLineCol());
+            lastToken = tokenizer.next();
+            while (true) {
+                if (lastToken == Token.TokenEOF) throw new JSONException("Unterminated array " + tokenizer.onLineCol());
+
+                /**
+                 * End of the array.
+                 */
+                if (lastToken == Token.TokenBrackR) {
+                    lastToken = tokenizer.next();
+                    break;
+                }
+
+                Object val = parseValue(ordered);
+                result.add(val);
+
+                if (lastToken == Token.TokenComma) {
+                    lastToken = tokenizer.next();
+                } else if (lastToken != Token.TokenBrackR) {
+                    throw new JSONException("expecting either ',' or ']' " + tokenizer.onLineCol());
+                }
+            }
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during array input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return result;
+    }
+
+    /**
+     * Method to parse the current JSON property value from the last token.
+     * @return The java object type that represents the JSON value.
+     *
+     * @throws JSONException Thrown if an IO error (read incomplete token) occurs.
+     */
+    public Object parseValue() throws JSONException {
+        return parseValue(false);
+    }
+
+    /**
+     * Method to parse the current JSON property value from the last token.
+     * @return The java object type that represents the JSON value.
+     * @param ordered Flag to denote if the parse should contruct JSON objects and arrays which maintain serialization order of the attributes.
+     *
+     * @throws JSONException Thrown if an IO error (read incomplete token) occurs.
+     */
+    public Object parseValue(boolean ordered) throws JSONException {
+        if (lastToken == Token.TokenEOF) throw new JSONException("Expecting property value " + tokenizer.onLineCol());
+
+        try {
+            if (lastToken.isNumber()) {
+                Object result = lastToken.getNumber();
+                lastToken = tokenizer.next();
+                return result;
+            }
+
+            if (lastToken.isString()) {
+                Object result = lastToken.getString();
+                lastToken = tokenizer.next();
+                return result;
+            }
+
+            if (lastToken == Token.TokenFalse) {
+                lastToken = tokenizer.next();
+                return Boolean.FALSE;
+            }
+
+            if (lastToken == Token.TokenTrue) {
+                lastToken = tokenizer.next();
+                return Boolean.TRUE;
+            }
+
+            if (lastToken == Token.TokenNull) {
+                lastToken = tokenizer.next();
+                return JSONObject.NULL;
+            }
+
+            if (lastToken == Token.TokenBrackL) return parseArray(ordered, null);
+            if (lastToken == Token.TokenBraceL) return parseObject(ordered, null);
+
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during value input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        throw new JSONException("Invalid token " + tokenizer.onLineCol());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Serializer.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Serializer.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Serializer.java
new file mode 100644
index 0000000..50f34d3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Serializer.java
@@ -0,0 +1,353 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.json4j.JSONString;
+
+/**
+ * Class to handle serialization of a JSON object to a JSON string.
+ */
+public class Serializer {
+
+    /**
+     * The writer to use when writing this JSON object.
+     */
+    private Writer writer;
+
+    /**
+     * Create a serializer on the specified output stream writer.
+     */
+    public Serializer(Writer writer) {
+        super();
+        this.writer = writer;
+    }
+
+    /**
+     * Method to flush the current writer.
+     * @throws IOException Thrown if an error occurs during writer flush.
+     */
+    public void flush() throws IOException {
+        writer.flush();
+    }
+
+    /**
+     * Method to close the current writer.
+     * @throws IOException Thrown if an error occurs during writer close.
+     */
+    public void close() throws IOException {
+        writer.close();
+    }
+
+    /**
+     * Method to write a raw string to the writer.
+     * @param s The String to write.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public Serializer writeRawString(String s) throws IOException {
+        writer.write(s);
+        return this;
+    }
+
+    /**
+     * Method to write the text string 'null' to the output stream (null JSON object).
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public Serializer writeNull() throws IOException {
+        writeRawString("null");
+        return this;
+    }
+
+    /**
+     * Method to write a number to the current writer.
+     * @param value The number to write to the JSON output string.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public Serializer writeNumber(Object value) throws IOException {
+        if (null == value) return writeNull();
+
+        if (value instanceof Float) {
+            if (((Float)value).isNaN()) return writeNull();
+            if (Float.NEGATIVE_INFINITY == ((Float)value).floatValue()) return writeNull();
+            if (Float.POSITIVE_INFINITY == ((Float)value).floatValue()) return writeNull();
+        }
+
+        if (value instanceof Double) {
+            if (((Double)value).isNaN()) return writeNull();
+            if (Double.NEGATIVE_INFINITY == ((Double)value).doubleValue()) return writeNull();
+            if (Double.POSITIVE_INFINITY == ((Double)value).doubleValue()) return writeNull();
+        }
+
+        writeRawString(value.toString());
+
+        return this;
+    }
+
+    /**
+     * Method to write a boolean value to the output stream.
+     * @param value The Boolean object to write out as a JSON boolean.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public Serializer writeBoolean(Boolean value) throws IOException {
+        if (null == value) return writeNull();
+
+        writeRawString(value.toString());
+
+        return this;
+    }
+
+    /**
+     * Method to generate a string with a particular width.  Alignment is done using zeroes if it does not meet the width requirements.
+     * @param s The string to write
+     * @param len The minimum length it should be, and to align with zeroes if length is smaller.
+     * @return A string properly aligned/correct width.
+     */
+    private static String rightAlignedZero(String s, int len) {
+        if (len == s.length()) return s;
+
+        StringBuffer sb = new StringBuffer(s);
+
+        while (sb.length() < len) {
+            sb.insert(0, '0');
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * Method to write a String out to the writer, encoding special characters and unicode characters properly.
+     * @param value The string to write out.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public Serializer writeString(String value) throws IOException {
+        if (null == value) return writeNull();
+
+        writer.write('"');
+
+        char[] chars = value.toCharArray();
+
+        for (int i=0; i<chars.length; i++) {
+            char c = chars[i];
+            switch (c) {
+                case  '"': writer.write("\\\""); break;
+                case '\\': writer.write("\\\\"); break;
+                case    0: writer.write("\\0"); break;
+                case '\b': writer.write("\\b"); break;
+                case '\t': writer.write("\\t"); break;
+                case '\n': writer.write("\\n"); break;
+                case '\f': writer.write("\\f"); break;
+                case '\r': writer.write("\\r"); break;
+                case '/': writer.write("\\/"); break;
+                default:
+                    if ((c >= 32) && (c <= 126)) {
+                        writer.write(c);
+                    } else {
+                        writer.write("\\u");
+                        writer.write(rightAlignedZero(Integer.toHexString(c),4));
+                    }
+            }
+        }
+
+        writer.write('"');
+
+        return this;
+    }
+
+    /**
+     * Method to write out a generic JSON type.
+     * @param object The JSON compatible object to serialize.
+     * @throws IOException Thrown if an error occurs during write, or if a nonJSON compatible Java object is passed..
+     */
+    private Serializer write(Object object) throws IOException {
+        if (null == object) return writeNull();
+
+        // Serialize the various types!
+        Class clazz = object.getClass();
+        if (NumberUtil.isNumber(clazz)) return writeNumber(object);
+        if (Boolean.class.isAssignableFrom(clazz)) return writeBoolean((Boolean) object);
+        if (JSONObject.class.isAssignableFrom(clazz)) return writeObject((JSONObject) object);
+        if (JSONArray.class.isAssignableFrom(clazz)) return writeArray((JSONArray) object);
+        if (JSONString.class.isAssignableFrom(clazz)) return writeRawString(((JSONString) object).toJSONString());
+        if (String.class.isAssignableFrom(clazz)) return writeString((String) object);
+
+        throw new IOException("Attempting to serialize unserializable object: '" + object + "'");
+    }
+
+    /**
+     * Method to write a complete JSON object to the stream.
+     * @param object The JSON object to write out.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public Serializer writeObject(JSONObject object) throws IOException {
+        if (null == object) return writeNull();
+
+        // write header
+        writeRawString("{");
+        indentPush();
+
+        Enumeration iter = getPropertyNames(object);
+
+        while ( iter.hasMoreElements() ) {
+            Object key = iter.nextElement();
+            if (!(key instanceof String)) throw new IOException("attempting to serialize object with an invalid property name: '" + key + "'" );
+
+            Object value = object.get(key);
+            if (!JSONObject.isValidObject(value)) throw new IOException("attempting to serialize object with an invalid property value: '" + value + "'");
+
+            newLine();
+            indent();
+            writeString((String)key);
+            writeRawString(":");
+            space();
+            write(value);
+
+            if (iter.hasMoreElements()) writeRawString(",");
+        }
+
+        // write trailer
+        indentPop();
+        newLine();
+        indent();
+        writeRawString("}");
+
+        return this;
+    }
+
+    /**
+     * Method to write a JSON array out to the stream.
+     * @param value The JSON array to write out.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public Serializer writeArray(JSONArray value) throws IOException {
+        if (null == value) return writeNull();
+
+        // write header
+        writeRawString("[");
+        indentPush();
+
+        for (Enumeration iter=value.elements(); iter.hasMoreElements(); ) {
+            Object element = iter.nextElement();
+            if (!JSONObject.isValidObject(element)) throw new IOException("attempting to serialize array with an invalid element: '" + value + "'");
+
+            newLine();
+            indent();
+            write(element);
+
+            if (iter.hasMoreElements()) writeRawString(",");
+        }
+
+        // write trailer
+        indentPop();
+        newLine();
+        indent();
+        writeRawString("]");
+
+        return this;
+    }
+
+    //---------------------------------------------------------------
+    // pretty printing overridables
+    //---------------------------------------------------------------
+
+    /**
+     * Method to write a space to the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void space() throws IOException {
+    }
+
+    /**
+     * Method to write a newline to the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void newLine() throws IOException {
+    }
+
+    /**
+     * Method to write an indent to the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void indent() throws IOException {
+    }
+
+    /**
+     * Method to increase the indent depth of the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void indentPush() {
+    }
+
+    /**
+     * Method to reduce the indent depth of the output writer.
+     */
+    public void indentPop() {
+    }
+
+    /**
+     * Method to get a list of all the property names stored in a map.
+     */
+    public Enumeration getPropertyNames(Hashtable map) {
+        return map.keys();
+    }
+
+    /**
+     * Method to write a String out to the writer, encoding special characters and unicode characters properly.
+     * @param value The string to write out.
+     */
+    public static String quote(String value) {
+        if (value == null || value.length() == 0) {
+            return "\"\"";
+        }
+
+        StringBuffer buf = new StringBuffer();
+        char[] chars = value.toCharArray();
+
+        buf.append('"');
+        for (int i=0; i<chars.length; i++) {
+            char c = chars[i];
+            switch (c) {
+                case  '"': buf.append("\\\""); break;
+                case '\\': buf.append("\\\\"); break;
+                case    0: buf.append("\\0"); break;
+                case '\b': buf.append("\\b"); break;
+                case '\t': buf.append("\\t"); break;
+                case '\n': buf.append("\\n"); break;
+                case '\f': buf.append("\\f"); break;
+                case '\r': buf.append("\\r"); break;
+                case '/': buf.append("\\/"); break;
+                default:
+                    if ((c >= 32) && (c <= 126)) {
+                        buf.append(c);
+                    } else {
+                        buf.append("\\u");
+                        buf.append(rightAlignedZero(Integer.toHexString(c),4));
+                    }
+            }
+        }
+        buf.append('"');
+
+        return buf.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/SerializerVerbose.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/SerializerVerbose.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/SerializerVerbose.java
new file mode 100644
index 0000000..5132591
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/SerializerVerbose.java
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * Internaql class for handling the serialization of JSON objects in a verbose
+ * format, meaning newlines and indention.
+ */
+public class SerializerVerbose extends Serializer {
+
+    /**
+     * Internal tracker keeping indent position.
+     */
+    private int indent = 0;
+
+    /**
+     * The indent string to use when serializing.
+     */
+    private String indentStr = "\t";
+
+    /**
+     * Constructor.
+     */
+    public SerializerVerbose(Writer writer) {
+        super(writer);
+    }
+
+    /**
+     * Constructor.
+     * @param Writer The writer to serialize JSON to.
+     * @param indentSpaces: How many spaces to indent by (0 to 8).
+     * The default indent is the TAB character.
+     */
+    public SerializerVerbose(Writer writer, int indentSpaces) {
+        super(writer);
+        if(indentSpaces > 0 && indentSpaces < 8){
+            this.indentStr = "";
+            for(int i = 0; i < indentSpaces; i++){
+                this.indentStr += " ";
+            }
+        }
+    }
+
+    /**
+     * Method to write a space to the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void space() throws IOException {
+        writeRawString(" ");
+    }
+
+    /**
+     * Method to write a newline to the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void newLine() throws IOException {
+        writeRawString("\n");
+    }
+
+    /**
+     * Method to write an indent to the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void indent() throws IOException {
+        for (int i=0; i<indent; i++) writeRawString(this.indentStr);
+    }
+
+    /**
+     * Method to increase the indent depth of the output writer.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    public void indentPush() {
+        indent++;
+    }
+
+    /**
+     * Method to reduce the indent depth of the output writer.
+     */
+    public void indentPop() {
+        indent--;
+        if (indent < 0) throw new IllegalStateException();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Token.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Token.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Token.java
new file mode 100644
index 0000000..1c635e9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Token.java
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+/**
+ * Class representing a JSON token.
+ */
+public class Token {
+
+    static final public Token TokenEOF    = new Token();
+    static final public Token TokenBraceL = new Token();
+    static final public Token TokenBraceR = new Token();
+    static final public Token TokenBrackL = new Token();
+    static final public Token TokenBrackR = new Token();
+    static final public Token TokenColon  = new Token();
+    static final public Token TokenComma  = new Token();
+    static final public Token TokenTrue   = new Token();
+    static final public Token TokenFalse  = new Token();
+    static final public Token TokenNull   = new Token();
+
+    private String  valueString;
+    private Object  valueNumber;
+    private boolean  isConstant;
+
+    /**
+     * Constructor
+     */
+    public Token() {
+        super();
+    }
+
+    /**
+     * Constructor
+     * @param value The value of the token as a string
+     */
+    public Token(String value) {
+        super();
+        valueString = value;
+    }
+
+    /**
+     * Constructor
+     * @param value The value of the token as a number
+     */
+    public Token(Object value) {
+        super();
+
+        valueNumber = value;
+    }
+
+    /**
+     * Method to obtain the string value of this token
+     */
+    public String getString() {
+        return valueString;
+    }
+
+    /**
+     * Method to obtain the number value of this token
+     */
+    public Object getNumber() {
+        return valueNumber;
+    }
+
+    /**
+     * Method to indicate if this token is string based or not.
+     */
+    public boolean isString() {
+        return (null != valueString) && !isConstant;
+    }
+
+    /**
+     * Method to indicate if this token is number based or not.
+     */
+    public boolean isNumber() {
+        return null != valueNumber;
+    }
+
+    /**
+     * Method to convert the token to a string representation.
+     */
+    public String toString() {
+        if (this == TokenEOF)    return "Token: EOF";
+        if (this == TokenBraceL) return "Token: {";
+        if (this == TokenBraceR) return "Token: }";
+        if (this == TokenBrackL) return "Token: [";
+        if (this == TokenBrackR) return "Token: ]";
+        if (this == TokenColon)  return "Token: :";
+        if (this == TokenComma)  return "Token: ,";
+        if (this == TokenTrue)   return "Token: true";
+        if (this == TokenFalse)  return "Token: false";
+        if (this == TokenNull)   return "Token: null";
+
+        if (this.isNumber()) return "Token: Number - " + getNumber();
+        if (this.isString()) return "Token: String - '" + getString() + "'";
+
+        return "Token: unknown.";
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Tokenizer.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Tokenizer.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Tokenizer.java
new file mode 100644
index 0000000..652106e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/Tokenizer.java
@@ -0,0 +1,619 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * Tokenizes a stream into JSON tokens.
+ */
+public class Tokenizer {
+
+    /**
+     * The reader from which the JSON string is being read.
+     */
+    private Reader reader;
+
+    /**
+     * The current line position in the JSON string.
+     */
+    private int     lineNo;
+
+    /**
+     * The current column position in the JSON string.
+     */
+    private int     colNo;
+
+    /**
+     * The last character read from the JSON string.
+     */
+    private int     lastChar;
+
+    /**
+     * Whether or not the parser should be spec strict, or allow unquoted strings and comments
+     */
+    private boolean strict = false;
+
+    /**
+     * Constructor.
+     * @param reader The reader from which the JSON string is read.  Same as Tokenizer(reader, false);
+     *
+     * @throws IOException Thrown on IOErrors such as invalid JSON or sudden reader closures.
+     */
+    public Tokenizer(Reader reader) throws IOException {
+        super();
+
+//        Class readerClass= reader.getClass();
+        //In-memory readers don't need to be buffered.  Also, skip PushbackReaders
+        //because they probably already wrap a buffered stream.  And lastly, anything
+        //that extends from a BufferedReader also doesn't need buffering!
+//        if (!StringReader.class.isAssignableFrom(readerClass) &&
+//            !CharArrayReader.class.isAssignableFrom(readerClass) &&
+//            !PushbackReader.class.isAssignableFrom(readerClass) &&
+//            !BufferedReader.class.isAssignableFrom(readerClass)) {
+//            reader = new BufferedReader(reader);
+//        }
+        this.reader    = reader;
+        this.lineNo    = 0;
+        this.colNo     = 0;
+        this.lastChar  = '\n';
+        readChar();
+    }
+
+    /**
+     * Constructor.
+     * @param reader The reader from which the JSON string is read.
+     * @param strict Whether or not the parser should be spec strict, or allow unquoted strings and comments.
+     *
+     * @throws IOException Thrown on IOErrors such as invalid JSON or sudden reader closures.
+     */
+    public Tokenizer(Reader reader, boolean strict) throws IOException {
+        super();
+
+//        Class readerClass= reader.getClass();
+        //In-memory readers don't need to be buffered.  Also, skip PushbackReaders
+        //because they probably already wrap a buffered stream.  And lastly, anything
+        //that extends from a BufferedReader also doesn't need buffering!
+//        if (!StringReader.class.isAssignableFrom(readerClass) &&
+//            !CharArrayReader.class.isAssignableFrom(readerClass) &&
+//            !PushbackReader.class.isAssignableFrom(readerClass) &&
+//            !BufferedReader.class.isAssignableFrom(readerClass)) {
+//            reader = new BufferedReader(reader);
+//        }
+        this.reader    = reader;
+        this.lineNo    = 0;
+        this.colNo     = 0;
+        this.lastChar  = '\n';
+        this.strict    = strict;
+
+        readChar();
+    }
+
+    /**
+     * Method to get the next JSON token from the JSON String
+     * @return The next token in the stream, returning Token.TokenEOF when finished.
+     *
+     * @throws IOException Thrown if unexpected read error occurs or invalid character encountered in JSON string.
+     */
+    public Token next() throws IOException {
+
+        // skip whitespace, use our own checker, it seems
+        // a bit faster than Java's default.
+        //while (Character.isWhitespace((char)lastChar)) {
+        while (isWhitespace((char)lastChar)) {
+            readChar();
+        }
+
+        // handle punctuation
+        switch (lastChar) {
+            case -1:  readChar(); return Token.TokenEOF;
+            case '{': readChar(); return Token.TokenBraceL;
+            case '}': readChar(); return Token.TokenBraceR;
+            case '[': readChar(); return Token.TokenBrackL;
+            case ']': readChar(); return Token.TokenBrackR;
+            case ':': readChar(); return Token.TokenColon;
+            case ',': readChar(); return Token.TokenComma;
+
+            case '"':
+            case '\'':
+                String stringValue = readString();
+                return new Token(stringValue);
+
+            case '-':
+            case '.':
+            case '0':
+            case '1':
+            case '2':
+            case '3':
+            case '4':
+            case '5':
+            case '6':
+            case '7':
+            case '8':
+            case '9':
+                Object numberValue = readNumber();
+                return new Token(numberValue);
+
+            case 'n':
+            case 't':
+            case 'f':
+                String ident = readIdentifier();
+
+                if (ident.equals("null"))  return Token.TokenNull;
+                if (ident.equals("true"))  return Token.TokenTrue;
+                if (ident.equals("false")) return Token.TokenFalse;
+
+                // Okay, this was some sort of unquoted string, may be okay
+                if (!this.strict) {
+                    //Unquoted string.  Non-strict mode allows this.  It's still bad input
+                    //from a spec perspective, but allowable in non-strict mode.
+                    return new Token(ident);
+                } else {
+                    throw new IOException("Unexpected unquoted string literal: [" + ident + "].  Unquoted strings are not allowed in strict mode");
+                }
+            case '/':
+                if (!this.strict) {
+                    // Comment mode and not strict.  Lets just devour the comment.
+                    readComment();
+                    return next();
+                } else {
+                    throw new IOException("Unexpected character / encountered " + onLineCol() + ".  Comments are not allowed in strict mode");
+                }
+
+            default:
+                if (!this.strict && isValidUnquotedChar((char)lastChar)) {
+                    // Unquoted string.  Bad form, but ... okay, lets accept it.
+                    // some other parsers do.
+                    String unquotedStr = readIdentifier();
+                    return new Token(unquotedStr);
+                } else {
+                    if (this.strict) {
+                        throw new IOException("Unexpected character '" + (char)lastChar + "' " + onLineCol() + ".  Unquoted strings are not allowed in strict mode.");
+                    } else {
+                        throw new IOException("Unexpected character '" + (char)lastChar + "' " + onLineCol());
+                    }
+                }
+        }
+
+    }
+
+    /**
+     * Method to read out comments in the 'JSON'.  JSON normally should not
+     * have comments, but I guess we need to be more permissive to make some Crockford code
+     * happy.
+     */
+    private void readComment() throws IOException {
+        readChar();
+        if ((char)lastChar == '/') {
+            // Okay, // comment,so just read to \n or end of line
+            while ((char)lastChar != '\n' && lastChar != -1) {
+                readChar();
+            }
+        } else if ((char)lastChar == '*') {
+            // /* comment, so read past it.
+            char[] chars = new char[2];
+            readChar();
+            if (lastChar != -1) {
+                chars[0] = (char)lastChar;
+            } else {
+                return;
+            }
+            readChar();
+            if (lastChar != -1) {
+                chars[1] = (char)lastChar;
+            } else {
+                return;
+            }
+
+            while (chars[0] != '*' || chars[1] != '/') {
+                readChar();
+                if (lastChar != -1) {
+                    chars[0] = chars[1];
+                    chars[1] = (char)lastChar;
+
+                } else {
+                    return;
+                }
+            }
+        }
+    }
+
+    /**
+     * Method to read a string from the JSON string, converting escapes accordingly.
+     * @return The parsed JSON string with all escapes properly converyed.
+     *
+     * @throws IOException Thrown on unterminated strings, invalid characters, bad escapes, and so on.  Basically, invalid JSON.
+     */
+    private String readString() throws IOException {
+        StringBuffer sb    = new StringBuffer();
+        int          delim = lastChar;
+        int          l = lineNo;
+        int          c = colNo;
+
+        readChar();
+        while ((-1 != lastChar) && (delim != lastChar)) {
+            StringBuffer digitBuffer;
+
+            if (lastChar != '\\') {
+                sb.append((char)lastChar);
+                readChar();
+                continue;
+            }
+
+            readChar();
+
+            switch (lastChar) {
+                case 'b':  readChar(); sb.append('\b'); continue;
+                case 'f':  readChar(); sb.append('\f'); continue;
+                case 'n':  readChar(); sb.append('\n'); continue;
+                case 'r':  readChar(); sb.append('\r'); continue;
+                case 't':  readChar(); sb.append('\t'); continue;
+                case '\'': readChar(); sb.append('\''); continue;
+                case '"':  readChar(); sb.append('"');  continue;
+                case '\\': readChar(); sb.append('\\'); continue;
+                case '/': readChar();  sb.append('/'); continue;
+
+                    // hex constant
+                    // unicode constant
+                case 'x':
+                case 'u':
+                    digitBuffer = new StringBuffer();
+
+                    int toRead = 2;
+                    if (lastChar == 'u') toRead = 4;
+
+                    for (int i=0; i<toRead; i++) {
+                        readChar();
+                        if (!isHexDigit(lastChar)) throw new IOException("non-hex digit " + onLineCol());
+                        digitBuffer.append((char) lastChar);
+                    }
+                    readChar();
+
+                    try {
+                        int digitValue = Integer.parseInt(digitBuffer.toString(), 16);
+                        sb.append((char) digitValue);
+                    } catch (NumberFormatException e) {
+                        throw new IOException("non-hex digit " + onLineCol());
+                    }
+
+                    break;
+
+                    // octal constant
+                default:
+                    if (!isOctalDigit(lastChar)) throw new IOException("non-hex digit " + onLineCol());
+
+                    digitBuffer = new StringBuffer();
+                    digitBuffer.append((char) lastChar);
+
+                    for (int i=0; i<2; i++) {
+                        readChar();
+                        if (!isOctalDigit(lastChar)) break;
+
+                        digitBuffer.append((char) lastChar);
+                    }
+
+                    try {
+                        int digitValue = Integer.parseInt(digitBuffer.toString(), 8);
+                        sb.append((char) digitValue);
+                    } catch (NumberFormatException e) {
+                        throw new IOException("non-hex digit " + onLineCol());
+                    }
+            }
+        }
+
+        if (-1 == lastChar) {
+            throw new IOException("String not terminated " + onLineCol(l,c));
+        }
+
+        readChar();
+
+        return sb.toString();
+    }
+
+    /**
+     * Method to read a number from the JSON string.
+     *
+     * (-)(1-9)(0-9)*            : decimal
+     * (-)0(0-7)*               : octal
+     * (-)0(x|X)(0-9|a-f|A-F)*  : hex
+     * [digits][.digits][(E|e)[(+|-)]digits]
+     *
+     * @returns The number as the wrapper Java Number type.
+     *
+     * @throws IOException Thrown in invalid numbers or unexpected end of JSON string
+     * */
+    private Object readNumber() throws IOException {
+        StringBuffer sb = new StringBuffer();
+        int          l    = lineNo;
+        int          c    = colNo;
+
+        boolean isHex = false;
+
+        if (lastChar == '-') {
+            sb.append((char)lastChar);
+            readChar();
+        }
+        if (lastChar == '0') {
+            sb.append((char)lastChar);
+            readChar();
+            if (lastChar == 'x' || lastChar == 'X') {
+                sb.append((char)lastChar);
+                readChar();
+                isHex = true;
+            }
+        }
+
+        if (isHex) {
+            while (isDigitChar(lastChar) || isHexDigit(lastChar)) {
+                sb.append((char)lastChar);
+                readChar();
+            }
+        }
+        else {
+            while (isDigitChar(lastChar)) {
+                sb.append((char)lastChar);
+                readChar();
+            }
+        }
+
+        // convert it!
+        String string = sb.toString();
+
+        try {
+            if (-1 != string.indexOf('.')) {
+                return Double.valueOf(string);
+            }
+
+            String sign = "";
+            if (string.startsWith("-")) {
+                sign = "-";
+                string = string.substring(1);
+            }
+
+//            if (isHex) {
+//            	Long value = Long.valueOf(sign + string.substring(2),16);
+//                if (value.longValue() <= Integer.MAX_VALUE  && (value.longValue() >= Integer.MIN_VALUE)) {
+//                	return new Integer(value.intValue());
+//                }
+//                else {
+//                	return value;
+//                }
+//            }
+
+            if (string.equals("0")) {
+                return new Integer(0);
+//            } else if (string.startsWith("0") && string.length() > 1) {
+//            	Long value = Long.valueOf(sign + string.substring(1),8);
+//                if (value.longValue() <= Integer.MAX_VALUE  && (value.longValue() >= Integer.MIN_VALUE)) {
+//                	return new Integer(value.intValue());
+//                }
+//                else {
+//                	return value;
+//                }
+            }
+
+            /**
+             * We have to check for the exponential and treat appropriately
+             * Exponentials should be treated as Doubles.
+             */
+            if (string.indexOf("e") != -1 || string.indexOf("E") != -1) {
+                return Double.valueOf(sign + string);
+            } else {
+                Long value = new Long(Long.parseLong(sign+ string, 10));
+                //Long value = Long.valueOf(sign + string);
+                if (value.longValue() <= Integer.MAX_VALUE  && (value.longValue() >= Integer.MIN_VALUE)) {
+                    return new Integer(Integer.parseInt(sign + string, 10));
+                }
+                else {
+                    return value;
+                }
+            }
+           // else return new Integer(0);  //MSN
+        } catch (NumberFormatException e) {
+            IOException iox = new IOException("Invalid number literal " + onLineCol(l,c));
+            //MSNiox.setCause(e);
+            throw iox;
+        }
+    }
+
+    /**
+     * Method to indicate if the character read is a HEX digit or not.
+     * @param c The character to check for being a HEX digit.
+     */
+    private boolean isHexDigit(int c) {
+        switch (c) {
+            case '0':
+            case '1':
+            case '2':
+            case '3':
+            case '4':
+            case '5':
+            case '6':
+            case '7':
+            case '8':
+            case '9':
+            case 'A':
+            case 'B':
+            case 'C':
+            case 'D':
+            case 'E':
+            case 'F':
+            case 'a':
+            case 'b':
+            case 'c':
+            case 'd':
+            case 'e':
+            case 'f':
+                return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Method to indicate if the character read is an OCTAL digit or not.
+     * @param c The character to check for being a OCTAL digit.
+     */
+    private boolean isOctalDigit(int c) {
+        switch (c) {
+            case '0':
+            case '1':
+            case '2':
+            case '3':
+            case '4':
+            case '5':
+            case '6':
+            case '7':
+                return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Method to indicate if the character read is a digit or not.
+     * @param c The character to check for being a digit.
+     */
+    private boolean isDigitChar(int c) {
+        switch (c) {
+            case '0':
+            case '1':
+            case '2':
+            case '3':
+            case '4':
+            case '5':
+            case '6':
+            case '7':
+            case '8':
+            case '9':
+            case '.':
+            case 'e':
+            case 'E':
+            case 'x':
+            case 'X':
+            case '+':
+            case '-':
+                return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Method to read a partular character string.
+     * only really need to handle 'null', 'true', and 'false'
+     */
+    private String readIdentifier() throws IOException {
+        StringBuffer sb = new StringBuffer();
+
+        if (this.strict) {
+            while ((-1 != lastChar) && ( (Character.isUpperCase((char)lastChar)) || (Character.isLowerCase((char)lastChar)) ) ){
+                sb.append((char)lastChar);
+                readChar();
+            }
+        }
+        else {
+            while ((-1 != lastChar) && isValidUnquotedChar((char)lastChar)) {
+               sb.append((char)lastChar);
+               readChar();
+           }
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * Method to read the next character from the string, keeping track of line/column position.
+     *
+     * @throws IOEXception Thrown when underlying reader throws an error.
+     */
+    private void readChar() throws IOException {
+        if ('\n' == lastChar) {
+            this.colNo = 0;
+            this.lineNo++;
+        }
+        lastChar = reader.read();
+        if (-1 == lastChar) return ;
+        colNo++;
+    }
+
+    /**
+     * Method to generate a String indicationg the current line and column position in the JSON string.
+     */
+    private String onLineCol(int line, int col) {
+        return "on line " + line + ", column " + col;
+    }
+
+    /**
+     * Method to generate a String indicationg the current line and column position in the JSON string.
+     */
+    public String onLineCol() {
+        return onLineCol(lineNo,colNo);
+    }
+
+    /**
+     * High speed test for whitespace!  Faster than the java one (from some testing).
+     * @return if the indicated character is whitespace.
+     */
+    public boolean isWhitespace(char c) {
+        switch (c) {
+            case 9:  //'unicode: 0009
+            case 10: //'unicode: 000A'
+            case 11: //'unicode: 000B'
+            case 12: //'unicode: 000C'
+            case 13: //'unicode: 000D'
+            case 28: //'unicode: 001C'
+            case 29: //'unicode: 001D'
+            case 30: //'unicode: 001E'
+            case 31: //'unicode: 001F'
+            case ' ': // Space
+                //case Character.SPACE_SEPARATOR:
+                //case Character.LINE_SEPARATOR:
+           //MSN  case Character.PARAGRAPH_SEPARATOR:
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * For non strict mode, check if char is valid when not quoted.
+     * @param c
+     * @return if character is valid unquoted character.
+     */
+    public boolean isValidUnquotedChar(char c) {
+
+        if ( (Character.isDigit(c)) || (Character.isLowerCase(c)) || (Character.isUpperCase(c)) ) {
+            return true;
+        }
+
+        switch (c) {
+        case '@':
+        case '-':
+        case '.':
+        case '$':
+        case '+':
+        case '!':
+        case '_':
+            return true;
+        }
+        return false;
+    }
+
+}


[30/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/javascript/cordova.blackberry.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/javascript/cordova.blackberry.js b/lib/cordova-blackberry/blackberry/javascript/cordova.blackberry.js
new file mode 100644
index 0000000..6df67ea
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/javascript/cordova.blackberry.js
@@ -0,0 +1,10857 @@
+// Platform: blackberry
+
+// commit 104709b2130a29e7ad8596d1a6cee1ed48138803
+
+// File generated at :: Wed Mar 27 2013 13:50:52 GMT-0700 (PDT)
+
+/*
+ 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.
+*/
+
+;(function() {
+
+// file: lib/scripts/require.js
+
+var require,
+    define;
+
+(function () {
+    var modules = {};
+    // Stack of moduleIds currently being built.
+    var requireStack = [];
+    // Map of module ID -> index into requireStack of modules currently being built.
+    var inProgressModules = {};
+
+    function build(module) {
+        var factory = module.factory;
+        module.exports = {};
+        delete module.factory;
+        factory(require, module.exports, module);
+        return module.exports;
+    }
+
+    require = function (id) {
+        if (!modules[id]) {
+            throw "module " + id + " not found";
+        } else if (id in inProgressModules) {
+            var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
+            throw "Cycle in require graph: " + cycle;
+        }
+        if (modules[id].factory) {
+            try {
+                inProgressModules[id] = requireStack.length;
+                requireStack.push(id);
+                return build(modules[id]);
+            } finally {
+                delete inProgressModules[id];
+                requireStack.pop();
+            }
+        }
+        return modules[id].exports;
+    };
+
+    define = function (id, factory) {
+        if (modules[id]) {
+            throw "module " + id + " already defined";
+        }
+
+        modules[id] = {
+            id: id,
+            factory: factory
+        };
+    };
+
+    define.remove = function (id) {
+        delete modules[id];
+    };
+
+    define.moduleMap = modules;
+})();
+
+//Export for use in node
+if (typeof module === "object" && typeof require === "function") {
+    module.exports.require = require;
+    module.exports.define = define;
+}
+
+// file: lib/cordova.js
+define("cordova", function(require, exports, module) {
+
+
+var channel = require('cordova/channel');
+
+/**
+ * Listen for DOMContentLoaded and notify our channel subscribers.
+ */
+document.addEventListener('DOMContentLoaded', function() {
+    channel.onDOMContentLoaded.fire();
+}, false);
+if (document.readyState == 'complete' || document.readyState == 'interactive') {
+    channel.onDOMContentLoaded.fire();
+}
+
+/**
+ * Intercept calls to addEventListener + removeEventListener and handle deviceready,
+ * resume, and pause events.
+ */
+var m_document_addEventListener = document.addEventListener;
+var m_document_removeEventListener = document.removeEventListener;
+var m_window_addEventListener = window.addEventListener;
+var m_window_removeEventListener = window.removeEventListener;
+
+/**
+ * Houses custom event handlers to intercept on document + window event listeners.
+ */
+var documentEventHandlers = {},
+    windowEventHandlers = {};
+
+document.addEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    if (typeof documentEventHandlers[e] != 'undefined') {
+        documentEventHandlers[e].subscribe(handler);
+    } else {
+        m_document_addEventListener.call(document, evt, handler, capture);
+    }
+};
+
+window.addEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    if (typeof windowEventHandlers[e] != 'undefined') {
+        windowEventHandlers[e].subscribe(handler);
+    } else {
+        m_window_addEventListener.call(window, evt, handler, capture);
+    }
+};
+
+document.removeEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    // If unsubscribing from an event that is handled by a plugin
+    if (typeof documentEventHandlers[e] != "undefined") {
+        documentEventHandlers[e].unsubscribe(handler);
+    } else {
+        m_document_removeEventListener.call(document, evt, handler, capture);
+    }
+};
+
+window.removeEventListener = function(evt, handler, capture) {
+    var e = evt.toLowerCase();
+    // If unsubscribing from an event that is handled by a plugin
+    if (typeof windowEventHandlers[e] != "undefined") {
+        windowEventHandlers[e].unsubscribe(handler);
+    } else {
+        m_window_removeEventListener.call(window, evt, handler, capture);
+    }
+};
+
+function createEvent(type, data) {
+    var event = document.createEvent('Events');
+    event.initEvent(type, false, false);
+    if (data) {
+        for (var i in data) {
+            if (data.hasOwnProperty(i)) {
+                event[i] = data[i];
+            }
+        }
+    }
+    return event;
+}
+
+if(typeof window.console === "undefined") {
+    window.console = {
+        log:function(){}
+    };
+}
+
+var cordova = {
+    define:define,
+    require:require,
+    /**
+     * Methods to add/remove your own addEventListener hijacking on document + window.
+     */
+    addWindowEventHandler:function(event) {
+        return (windowEventHandlers[event] = channel.create(event));
+    },
+    addStickyDocumentEventHandler:function(event) {
+        return (documentEventHandlers[event] = channel.createSticky(event));
+    },
+    addDocumentEventHandler:function(event) {
+        return (documentEventHandlers[event] = channel.create(event));
+    },
+    removeWindowEventHandler:function(event) {
+        delete windowEventHandlers[event];
+    },
+    removeDocumentEventHandler:function(event) {
+        delete documentEventHandlers[event];
+    },
+    /**
+     * Retrieve original event handlers that were replaced by Cordova
+     *
+     * @return object
+     */
+    getOriginalHandlers: function() {
+        return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
+        'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
+    },
+    /**
+     * Method to fire event from native code
+     * bNoDetach is required for events which cause an exception which needs to be caught in native code
+     */
+    fireDocumentEvent: function(type, data, bNoDetach) {
+        var evt = createEvent(type, data);
+        if (typeof documentEventHandlers[type] != 'undefined') {
+            if( bNoDetach ) {
+              documentEventHandlers[type].fire(evt);
+            }
+            else {
+              setTimeout(function() {
+                  documentEventHandlers[type].fire(evt);
+              }, 0);
+            }
+        } else {
+            document.dispatchEvent(evt);
+        }
+    },
+    fireWindowEvent: function(type, data) {
+        var evt = createEvent(type,data);
+        if (typeof windowEventHandlers[type] != 'undefined') {
+            setTimeout(function() {
+                windowEventHandlers[type].fire(evt);
+            }, 0);
+        } else {
+            window.dispatchEvent(evt);
+        }
+    },
+
+    /**
+     * Plugin callback mechanism.
+     */
+    // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
+    // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
+    callbackId: Math.floor(Math.random() * 2000000000),
+    callbacks:  {},
+    callbackStatus: {
+        NO_RESULT: 0,
+        OK: 1,
+        CLASS_NOT_FOUND_EXCEPTION: 2,
+        ILLEGAL_ACCESS_EXCEPTION: 3,
+        INSTANTIATION_EXCEPTION: 4,
+        MALFORMED_URL_EXCEPTION: 5,
+        IO_EXCEPTION: 6,
+        INVALID_ACTION: 7,
+        JSON_EXCEPTION: 8,
+        ERROR: 9
+    },
+
+    /**
+     * Called by native code when returning successful result from an action.
+     */
+    callbackSuccess: function(callbackId, args) {
+        try {
+            cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
+        } catch (e) {
+            console.log("Error in error callback: " + callbackId + " = "+e);
+        }
+    },
+
+    /**
+     * Called by native code when returning error result from an action.
+     */
+    callbackError: function(callbackId, args) {
+        // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
+        // Derive success from status.
+        try {
+            cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
+        } catch (e) {
+            console.log("Error in error callback: " + callbackId + " = "+e);
+        }
+    },
+
+    /**
+     * Called by native code when returning the result from an action.
+     */
+    callbackFromNative: function(callbackId, success, status, args, keepCallback) {
+        var callback = cordova.callbacks[callbackId];
+        if (callback) {
+            if (success && status == cordova.callbackStatus.OK) {
+                callback.success && callback.success.apply(null, args);
+            } else if (!success) {
+                callback.fail && callback.fail.apply(null, args);
+            }
+
+            // Clear callback if not expecting any more results
+            if (!keepCallback) {
+                delete cordova.callbacks[callbackId];
+            }
+        }
+    },
+    addConstructor: function(func) {
+        channel.onCordovaReady.subscribe(function() {
+            try {
+                func();
+            } catch(e) {
+                console.log("Failed to run constructor: " + e);
+            }
+        });
+    }
+};
+
+// Register pause, resume and deviceready channels as events on document.
+channel.onPause = cordova.addDocumentEventHandler('pause');
+channel.onResume = cordova.addDocumentEventHandler('resume');
+channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
+
+module.exports = cordova;
+
+});
+
+// file: lib/common/argscheck.js
+define("cordova/argscheck", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+var utils = require('cordova/utils');
+
+var moduleExports = module.exports;
+
+var typeMap = {
+    'A': 'Array',
+    'D': 'Date',
+    'N': 'Number',
+    'S': 'String',
+    'F': 'Function',
+    'O': 'Object'
+};
+
+function extractParamName(callee, argIndex) {
+  return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex];
+}
+
+function checkArgs(spec, functionName, args, opt_callee) {
+    if (!moduleExports.enableChecks) {
+        return;
+    }
+    var errMsg = null;
+    var typeName;
+    for (var i = 0; i < spec.length; ++i) {
+        var c = spec.charAt(i),
+            cUpper = c.toUpperCase(),
+            arg = args[i];
+        // Asterix means allow anything.
+        if (c == '*') {
+            continue;
+        }
+        typeName = utils.typeName(arg);
+        if ((arg === null || arg === undefined) && c == cUpper) {
+            continue;
+        }
+        if (typeName != typeMap[cUpper]) {
+            errMsg = 'Expected ' + typeMap[cUpper];
+            break;
+        }
+    }
+    if (errMsg) {
+        errMsg += ', but got ' + typeName + '.';
+        errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
+        // Don't log when running jake test.
+        if (typeof jasmine == 'undefined') {
+            console.error(errMsg);
+        }
+        throw TypeError(errMsg);
+    }
+}
+
+function getValue(value, defaultValue) {
+    return value === undefined ? defaultValue : value;
+}
+
+moduleExports.checkArgs = checkArgs;
+moduleExports.getValue = getValue;
+moduleExports.enableChecks = true;
+
+
+});
+
+// file: lib/common/builder.js
+define("cordova/builder", function(require, exports, module) {
+
+var utils = require('cordova/utils');
+
+function each(objects, func, context) {
+    for (var prop in objects) {
+        if (objects.hasOwnProperty(prop)) {
+            func.apply(context, [objects[prop], prop]);
+        }
+    }
+}
+
+function clobber(obj, key, value) {
+    exports.replaceHookForTesting(obj, key);
+    obj[key] = value;
+    // Getters can only be overridden by getters.
+    if (obj[key] !== value) {
+        utils.defineGetter(obj, key, function() {
+            return value;
+        });
+    }
+}
+
+function assignOrWrapInDeprecateGetter(obj, key, value, message) {
+    if (message) {
+        utils.defineGetter(obj, key, function() {
+            console.log(message);
+            delete obj[key];
+            clobber(obj, key, value);
+            return value;
+        });
+    } else {
+        clobber(obj, key, value);
+    }
+}
+
+function include(parent, objects, clobber, merge) {
+    each(objects, function (obj, key) {
+        try {
+          var result = obj.path ? require(obj.path) : {};
+
+          if (clobber) {
+              // Clobber if it doesn't exist.
+              if (typeof parent[key] === 'undefined') {
+                  assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+              } else if (typeof obj.path !== 'undefined') {
+                  // If merging, merge properties onto parent, otherwise, clobber.
+                  if (merge) {
+                      recursiveMerge(parent[key], result);
+                  } else {
+                      assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+                  }
+              }
+              result = parent[key];
+          } else {
+            // Overwrite if not currently defined.
+            if (typeof parent[key] == 'undefined') {
+              assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+            } else {
+              // Set result to what already exists, so we can build children into it if they exist.
+              result = parent[key];
+            }
+          }
+
+          if (obj.children) {
+            include(result, obj.children, clobber, merge);
+          }
+        } catch(e) {
+          utils.alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"');
+        }
+    });
+}
+
+/**
+ * Merge properties from one object onto another recursively.  Properties from
+ * the src object will overwrite existing target property.
+ *
+ * @param target Object to merge properties into.
+ * @param src Object to merge properties from.
+ */
+function recursiveMerge(target, src) {
+    for (var prop in src) {
+        if (src.hasOwnProperty(prop)) {
+            if (target.prototype && target.prototype.constructor === target) {
+                // If the target object is a constructor override off prototype.
+                clobber(target.prototype, prop, src[prop]);
+            } else {
+                if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+                    recursiveMerge(target[prop], src[prop]);
+                } else {
+                    clobber(target, prop, src[prop]);
+                }
+            }
+        }
+    }
+}
+
+exports.buildIntoButDoNotClobber = function(objects, target) {
+    include(target, objects, false, false);
+};
+exports.buildIntoAndClobber = function(objects, target) {
+    include(target, objects, true, false);
+};
+exports.buildIntoAndMerge = function(objects, target) {
+    include(target, objects, true, true);
+};
+exports.recursiveMerge = recursiveMerge;
+exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
+exports.replaceHookForTesting = function() {};
+
+});
+
+// file: lib/common/channel.js
+define("cordova/channel", function(require, exports, module) {
+
+var utils = require('cordova/utils'),
+    nextGuid = 1;
+
+/**
+ * Custom pub-sub "channel" that can have functions subscribed to it
+ * This object is used to define and control firing of events for
+ * cordova initialization, as well as for custom events thereafter.
+ *
+ * The order of events during page load and Cordova startup is as follows:
+ *
+ * onDOMContentLoaded*         Internal event that is received when the web page is loaded and parsed.
+ * onNativeReady*              Internal event that indicates the Cordova native side is ready.
+ * onCordovaReady*             Internal event fired when all Cordova JavaScript objects have been created.
+ * onCordovaInfoReady*         Internal event fired when device properties are available.
+ * onCordovaConnectionReady*   Internal event fired when the connection property has been set.
+ * onDeviceReady*              User event fired to indicate that Cordova is ready
+ * onResume                    User event fired to indicate a start/resume lifecycle event
+ * onPause                     User event fired to indicate a pause lifecycle event
+ * onDestroy*                  Internal event fired when app is being destroyed (User should use window.onunload event, not this one).
+ *
+ * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
+ * All listeners that subscribe after the event is fired will be executed right away.
+ *
+ * The only Cordova events that user code should register for are:
+ *      deviceready           Cordova native code is initialized and Cordova APIs can be called from JavaScript
+ *      pause                 App has moved to background
+ *      resume                App has returned to foreground
+ *
+ * Listeners can be registered as:
+ *      document.addEventListener("deviceready", myDeviceReadyListener, false);
+ *      document.addEventListener("resume", myResumeListener, false);
+ *      document.addEventListener("pause", myPauseListener, false);
+ *
+ * The DOM lifecycle events should be used for saving and restoring state
+ *      window.onload
+ *      window.onunload
+ *
+ */
+
+/**
+ * Channel
+ * @constructor
+ * @param type  String the channel name
+ */
+var Channel = function(type, sticky) {
+    this.type = type;
+    // Map of guid -> function.
+    this.handlers = {};
+    // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
+    this.state = sticky ? 1 : 0;
+    // Used in sticky mode to remember args passed to fire().
+    this.fireArgs = null;
+    // Used by onHasSubscribersChange to know if there are any listeners.
+    this.numHandlers = 0;
+    // Function that is called when the first listener is subscribed, or when
+    // the last listener is unsubscribed.
+    this.onHasSubscribersChange = null;
+},
+    channel = {
+        /**
+         * Calls the provided function only after all of the channels specified
+         * have been fired. All channels must be sticky channels.
+         */
+        join: function(h, c) {
+            var len = c.length,
+                i = len,
+                f = function() {
+                    if (!(--i)) h();
+                };
+            for (var j=0; j<len; j++) {
+                if (c[j].state === 0) {
+                    throw Error('Can only use join with sticky channels.');
+                }
+                c[j].subscribe(f);
+            }
+            if (!len) h();
+        },
+        create: function(type) {
+            return channel[type] = new Channel(type, false);
+        },
+        createSticky: function(type) {
+            return channel[type] = new Channel(type, true);
+        },
+
+        /**
+         * cordova Channels that must fire before "deviceready" is fired.
+         */
+        deviceReadyChannelsArray: [],
+        deviceReadyChannelsMap: {},
+
+        /**
+         * Indicate that a feature needs to be initialized before it is ready to be used.
+         * This holds up Cordova's "deviceready" event until the feature has been initialized
+         * and Cordova.initComplete(feature) is called.
+         *
+         * @param feature {String}     The unique feature name
+         */
+        waitForInitialization: function(feature) {
+            if (feature) {
+                var c = channel[feature] || this.createSticky(feature);
+                this.deviceReadyChannelsMap[feature] = c;
+                this.deviceReadyChannelsArray.push(c);
+            }
+        },
+
+        /**
+         * Indicate that initialization code has completed and the feature is ready to be used.
+         *
+         * @param feature {String}     The unique feature name
+         */
+        initializationComplete: function(feature) {
+            var c = this.deviceReadyChannelsMap[feature];
+            if (c) {
+                c.fire();
+            }
+        }
+    };
+
+function forceFunction(f) {
+    if (typeof f != 'function') throw "Function required as first argument!";
+}
+
+/**
+ * Subscribes the given function to the channel. Any time that
+ * Channel.fire is called so too will the function.
+ * Optionally specify an execution context for the function
+ * and a guid that can be used to stop subscribing to the channel.
+ * Returns the guid.
+ */
+Channel.prototype.subscribe = function(f, c) {
+    // need a function to call
+    forceFunction(f);
+    if (this.state == 2) {
+        f.apply(c || this, this.fireArgs);
+        return;
+    }
+
+    var func = f,
+        guid = f.observer_guid;
+    if (typeof c == "object") { func = utils.close(c, f); }
+
+    if (!guid) {
+        // first time any channel has seen this subscriber
+        guid = '' + nextGuid++;
+    }
+    func.observer_guid = guid;
+    f.observer_guid = guid;
+
+    // Don't add the same handler more than once.
+    if (!this.handlers[guid]) {
+        this.handlers[guid] = func;
+        this.numHandlers++;
+        if (this.numHandlers == 1) {
+            this.onHasSubscribersChange && this.onHasSubscribersChange();
+        }
+    }
+};
+
+/**
+ * Unsubscribes the function with the given guid from the channel.
+ */
+Channel.prototype.unsubscribe = function(f) {
+    // need a function to unsubscribe
+    forceFunction(f);
+
+    var guid = f.observer_guid,
+        handler = this.handlers[guid];
+    if (handler) {
+        delete this.handlers[guid];
+        this.numHandlers--;
+        if (this.numHandlers === 0) {
+            this.onHasSubscribersChange && this.onHasSubscribersChange();
+        }
+    }
+};
+
+/**
+ * Calls all functions subscribed to this channel.
+ */
+Channel.prototype.fire = function(e) {
+    var fail = false,
+        fireArgs = Array.prototype.slice.call(arguments);
+    // Apply stickiness.
+    if (this.state == 1) {
+        this.state = 2;
+        this.fireArgs = fireArgs;
+    }
+    if (this.numHandlers) {
+        // Copy the values first so that it is safe to modify it from within
+        // callbacks.
+        var toCall = [];
+        for (var item in this.handlers) {
+            toCall.push(this.handlers[item]);
+        }
+        for (var i = 0; i < toCall.length; ++i) {
+            toCall[i].apply(this, fireArgs);
+        }
+        if (this.state == 2 && this.numHandlers) {
+            this.numHandlers = 0;
+            this.handlers = {};
+            this.onHasSubscribersChange && this.onHasSubscribersChange();
+        }
+    }
+};
+
+
+// defining them here so they are ready super fast!
+// DOM event that is received when the web page is loaded and parsed.
+channel.createSticky('onDOMContentLoaded');
+
+// Event to indicate the Cordova native side is ready.
+channel.createSticky('onNativeReady');
+
+// Event to indicate that all Cordova JavaScript objects have been created
+// and it's time to run plugin constructors.
+channel.createSticky('onCordovaReady');
+
+// Event to indicate that device properties are available
+channel.createSticky('onCordovaInfoReady');
+
+// Event to indicate that the connection property has been set.
+channel.createSticky('onCordovaConnectionReady');
+
+// Event to indicate that all automatically loaded JS plugins are loaded and ready.
+channel.createSticky('onPluginsReady');
+
+// Event to indicate that Cordova is ready
+channel.createSticky('onDeviceReady');
+
+// Event to indicate a resume lifecycle event
+channel.create('onResume');
+
+// Event to indicate a pause lifecycle event
+channel.create('onPause');
+
+// Event to indicate a destroy lifecycle event
+channel.createSticky('onDestroy');
+
+// Channels that must fire before "deviceready" is fired.
+channel.waitForInitialization('onCordovaReady');
+channel.waitForInitialization('onCordovaConnectionReady');
+
+module.exports = channel;
+
+});
+
+// file: lib/common/commandProxy.js
+define("cordova/commandProxy", function(require, exports, module) {
+
+
+// internal map of proxy function
+var CommandProxyMap = {};
+
+module.exports = {
+
+    // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
+    add:function(id,proxyObj) {
+        console.log("adding proxy for " + id);
+        CommandProxyMap[id] = proxyObj;
+        return proxyObj;
+    },
+
+    // cordova.commandProxy.remove("Accelerometer");
+    remove:function(id) {
+        var proxy = CommandProxyMap[id];
+        delete CommandProxyMap[id];
+        CommandProxyMap[id] = null;
+        return proxy;
+    },
+
+    get:function(service,action) {
+        return ( CommandProxyMap[service] ? CommandProxyMap[service][action] : null );
+    }
+};
+});
+
+// file: lib/blackberry/exec.js
+define("cordova/exec", function(require, exports, module) {
+
+var cordova = require('cordova'),
+    platform = require('cordova/platform'),
+    utils = require('cordova/utils');
+
+/**
+ * Execute a cordova command.  It is up to the native side whether this action
+ * is synchronous or asynchronous.  The native side can return:
+ *      Synchronous: PluginResult object as a JSON string
+ *      Asynchronous: Empty string ""
+ * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
+ * depending upon the result of the action.
+ *
+ * @param {Function} success    The success callback
+ * @param {Function} fail       The fail callback
+ * @param {String} service      The name of the service to use
+ * @param {String} action       Action to be run in cordova
+ * @param {String[]} [args]     Zero or more arguments to pass to the method
+ */
+
+module.exports = function(success, fail, service, action, args) {
+    try {
+        var manager = require('cordova/plugin/' + platform.runtime() + '/manager'),
+            v = manager.exec(success, fail, service, action, args);
+
+        // If status is OK, then return value back to caller
+        if (v.status == cordova.callbackStatus.OK) {
+
+            // If there is a success callback, then call it now with returned value
+            if (success) {
+                try {
+                    success(v.message);
+                }
+                catch (e) {
+                    console.log("Error in success callback: "+cordova.callbackId+" = "+e);
+                }
+            }
+            return v.message;
+        } else if (v.status == cordova.callbackStatus.NO_RESULT) {
+
+        } else {
+            // If error, then display error
+            console.log("Error: Status="+v.status+" Message="+v.message);
+
+            // If there is a fail callback, then call it now with returned value
+            if (fail) {
+                try {
+                    fail(v.message);
+                }
+                catch (e) {
+                    console.log("Error in error callback: "+cordova.callbackId+" = "+e);
+                }
+            }
+            return null;
+        }
+    } catch (e) {
+        utils.alert("Error: "+e);
+    }
+};
+
+});
+
+// file: lib/common/modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+    moduleMap = define.moduleMap,
+    symbolList,
+    deprecationMap;
+
+exports.reset = function() {
+    symbolList = [];
+    deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+    if (!(moduleName in moduleMap)) {
+        throw new Error('Module ' + moduleName + ' does not exist.');
+    }
+    symbolList.push(strategy, moduleName, symbolPath);
+    if (opt_deprecationMessage) {
+        deprecationMap[symbolPath] = opt_deprecationMessage;
+    }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+    addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+    addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+    addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+    if (!symbolPath) {
+        return context;
+    }
+    var parts = symbolPath.split('.');
+    var cur = context;
+    for (var i = 0, part; part = parts[i]; ++i) {
+        cur = cur[part] = cur[part] || {};
+    }
+    return cur;
+}
+
+exports.mapModules = function(context) {
+    var origSymbols = {};
+    context.CDV_origSymbols = origSymbols;
+    for (var i = 0, len = symbolList.length; i < len; i += 3) {
+        var strategy = symbolList[i];
+        var moduleName = symbolList[i + 1];
+        var symbolPath = symbolList[i + 2];
+        var lastDot = symbolPath.lastIndexOf('.');
+        var namespace = symbolPath.substr(0, lastDot);
+        var lastName = symbolPath.substr(lastDot + 1);
+
+        var module = require(moduleName);
+        var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+        var parentObj = prepareNamespace(namespace, context);
+        var target = parentObj[lastName];
+
+        if (strategy == 'm' && target) {
+            builder.recursiveMerge(target, module);
+        } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+            if (!(symbolPath in origSymbols)) {
+                origSymbols[symbolPath] = target;
+            }
+            builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+        }
+    }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+    var origSymbols = context.CDV_origSymbols;
+    if (origSymbols && (symbolPath in origSymbols)) {
+        return origSymbols[symbolPath];
+    }
+    var parts = symbolPath.split('.');
+    var obj = context;
+    for (var i = 0; i < parts.length; ++i) {
+        obj = obj && obj[parts[i]];
+    }
+    return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+    for (var k in moduleMap) {
+        if (matchingRegExp.exec(k)) {
+            require(k);
+        }
+    }
+};
+
+exports.reset();
+
+
+});
+
+// file: lib/blackberry/platform.js
+define("cordova/platform", function(require, exports, module) {
+
+module.exports = {
+    id: "blackberry",
+    runtime: function () {
+        if (navigator.userAgent.indexOf("BB10") > -1) {
+            return 'qnx';
+        }
+        else if (navigator.userAgent.indexOf("PlayBook") > -1) {
+            return 'air';
+        }
+        else if (navigator.userAgent.indexOf("BlackBerry") > -1) {
+            return 'java';
+        }
+        else {
+            console.log("Unknown user agent?!?!? defaulting to java");
+            return 'java';
+        }
+    },
+    initialize: function() {
+        var modulemapper = require('cordova/modulemapper'),
+            platform = require('cordova/plugin/' + this.runtime() + '/platform');
+
+        modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+        modulemapper.loadMatchingModules(new RegExp('cordova/.*' + this.runtime() + '/.*bbsymbols$'));
+        modulemapper.mapModules(this.contextObj);
+
+        platform.initialize();
+    },
+    contextObj: this // Used for testing.
+};
+
+});
+
+// file: lib/common/plugin/Acceleration.js
+define("cordova/plugin/Acceleration", function(require, exports, module) {
+
+var Acceleration = function(x, y, z, timestamp) {
+    this.x = x;
+    this.y = y;
+    this.z = z;
+    this.timestamp = timestamp || (new Date()).getTime();
+};
+
+module.exports = Acceleration;
+
+});
+
+// file: lib/common/plugin/Camera.js
+define("cordova/plugin/Camera", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    exec = require('cordova/exec'),
+    Camera = require('cordova/plugin/CameraConstants'),
+    CameraPopoverHandle = require('cordova/plugin/CameraPopoverHandle');
+
+var cameraExport = {};
+
+// Tack on the Camera Constants to the base camera plugin.
+for (var key in Camera) {
+    cameraExport[key] = Camera[key];
+}
+
+/**
+ * Gets a picture from source defined by "options.sourceType", and returns the
+ * image as defined by the "options.destinationType" option.
+
+ * The defaults are sourceType=CAMERA and destinationType=FILE_URI.
+ *
+ * @param {Function} successCallback
+ * @param {Function} errorCallback
+ * @param {Object} options
+ */
+cameraExport.getPicture = function(successCallback, errorCallback, options) {
+    argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
+    options = options || {};
+    var getValue = argscheck.getValue;
+
+    var quality = getValue(options.quality, 50);
+    var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
+    var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
+    var targetWidth = getValue(options.targetWidth, -1);
+    var targetHeight = getValue(options.targetHeight, -1);
+    var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
+    var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
+    var allowEdit = !!options.allowEdit;
+    var correctOrientation = !!options.correctOrientation;
+    var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
+    var popoverOptions = getValue(options.popoverOptions, null);
+    var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
+
+    var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
+                mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
+
+    exec(successCallback, errorCallback, "Camera", "takePicture", args);
+    return new CameraPopoverHandle();
+};
+
+cameraExport.cleanup = function(successCallback, errorCallback) {
+    exec(successCallback, errorCallback, "Camera", "cleanup", []);
+};
+
+module.exports = cameraExport;
+
+});
+
+// file: lib/common/plugin/CameraConstants.js
+define("cordova/plugin/CameraConstants", function(require, exports, module) {
+
+module.exports = {
+  DestinationType:{
+    DATA_URL: 0,         // Return base64 encoded string
+    FILE_URI: 1,         // Return file uri (content://media/external/images/media/2 for Android)
+    NATIVE_URI: 2        // Return native uri (eg. asset-library://... for iOS)
+  },
+  EncodingType:{
+    JPEG: 0,             // Return JPEG encoded image
+    PNG: 1               // Return PNG encoded image
+  },
+  MediaType:{
+    PICTURE: 0,          // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
+    VIDEO: 1,            // allow selection of video only, ONLY RETURNS URL
+    ALLMEDIA : 2         // allow selection from all media types
+  },
+  PictureSourceType:{
+    PHOTOLIBRARY : 0,    // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)
+    CAMERA : 1,          // Take picture from camera
+    SAVEDPHOTOALBUM : 2  // Choose image from picture library (same as PHOTOLIBRARY for Android)
+  },
+  PopoverArrowDirection:{
+      ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants to specify arrow location on popover
+      ARROW_DOWN : 2,
+      ARROW_LEFT : 4,
+      ARROW_RIGHT : 8,
+      ARROW_ANY : 15
+  },
+  Direction:{
+      BACK: 0,
+      FRONT: 1
+  }
+};
+
+});
+
+// file: lib/common/plugin/CameraPopoverHandle.js
+define("cordova/plugin/CameraPopoverHandle", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+/**
+ * A handle to an image picker popover.
+ */
+var CameraPopoverHandle = function() {
+    this.setPosition = function(popoverOptions) {
+        console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
+    };
+};
+
+module.exports = CameraPopoverHandle;
+
+});
+
+// file: lib/common/plugin/CameraPopoverOptions.js
+define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) {
+
+var Camera = require('cordova/plugin/CameraConstants');
+
+/**
+ * Encapsulates options for iOS Popover image picker
+ */
+var CameraPopoverOptions = function(x,y,width,height,arrowDir){
+    // information of rectangle that popover should be anchored to
+    this.x = x || 0;
+    this.y = y || 32;
+    this.width = width || 320;
+    this.height = height || 480;
+    // The direction of the popover arrow
+    this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
+};
+
+module.exports = CameraPopoverOptions;
+
+});
+
+// file: lib/common/plugin/CaptureAudioOptions.js
+define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
+
+/**
+ * Encapsulates all audio capture operation configuration options.
+ */
+var CaptureAudioOptions = function(){
+    // Upper limit of sound clips user can record. Value must be equal or greater than 1.
+    this.limit = 1;
+    // Maximum duration of a single sound clip in seconds.
+    this.duration = 0;
+    // The selected audio mode. Must match with one of the elements in supportedAudioModes array.
+    this.mode = null;
+};
+
+module.exports = CaptureAudioOptions;
+
+});
+
+// file: lib/common/plugin/CaptureError.js
+define("cordova/plugin/CaptureError", function(require, exports, module) {
+
+/**
+ * The CaptureError interface encapsulates all errors in the Capture API.
+ */
+var CaptureError = function(c) {
+   this.code = c || null;
+};
+
+// Camera or microphone failed to capture image or sound.
+CaptureError.CAPTURE_INTERNAL_ERR = 0;
+// Camera application or audio capture application is currently serving other capture request.
+CaptureError.CAPTURE_APPLICATION_BUSY = 1;
+// Invalid use of the API (e.g. limit parameter has value less than one).
+CaptureError.CAPTURE_INVALID_ARGUMENT = 2;
+// User exited camera application or audio capture application before capturing anything.
+CaptureError.CAPTURE_NO_MEDIA_FILES = 3;
+// The requested capture operation is not supported.
+CaptureError.CAPTURE_NOT_SUPPORTED = 20;
+
+module.exports = CaptureError;
+
+});
+
+// file: lib/common/plugin/CaptureImageOptions.js
+define("cordova/plugin/CaptureImageOptions", function(require, exports, module) {
+
+/**
+ * Encapsulates all image capture operation configuration options.
+ */
+var CaptureImageOptions = function(){
+    // Upper limit of images user can take. Value must be equal or greater than 1.
+    this.limit = 1;
+    // The selected image mode. Must match with one of the elements in supportedImageModes array.
+    this.mode = null;
+};
+
+module.exports = CaptureImageOptions;
+
+});
+
+// file: lib/common/plugin/CaptureVideoOptions.js
+define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) {
+
+/**
+ * Encapsulates all video capture operation configuration options.
+ */
+var CaptureVideoOptions = function(){
+    // Upper limit of videos user can record. Value must be equal or greater than 1.
+    this.limit = 1;
+    // Maximum duration of a single video clip in seconds.
+    this.duration = 0;
+    // The selected video mode. Must match with one of the elements in supportedVideoModes array.
+    this.mode = null;
+};
+
+module.exports = CaptureVideoOptions;
+
+});
+
+// file: lib/common/plugin/CompassError.js
+define("cordova/plugin/CompassError", function(require, exports, module) {
+
+/**
+ *  CompassError.
+ *  An error code assigned by an implementation when an error has occurred
+ * @constructor
+ */
+var CompassError = function(err) {
+    this.code = (err !== undefined ? err : null);
+};
+
+CompassError.COMPASS_INTERNAL_ERR = 0;
+CompassError.COMPASS_NOT_SUPPORTED = 20;
+
+module.exports = CompassError;
+
+});
+
+// file: lib/common/plugin/CompassHeading.js
+define("cordova/plugin/CompassHeading", function(require, exports, module) {
+
+var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) {
+  this.magneticHeading = magneticHeading;
+  this.trueHeading = trueHeading;
+  this.headingAccuracy = headingAccuracy;
+  this.timestamp = timestamp || new Date().getTime();
+};
+
+module.exports = CompassHeading;
+
+});
+
+// file: lib/common/plugin/ConfigurationData.js
+define("cordova/plugin/ConfigurationData", function(require, exports, module) {
+
+/**
+ * Encapsulates a set of parameters that the capture device supports.
+ */
+function ConfigurationData() {
+    // The ASCII-encoded string in lower case representing the media type.
+    this.type = null;
+    // The height attribute represents height of the image or video in pixels.
+    // In the case of a sound clip this attribute has value 0.
+    this.height = 0;
+    // The width attribute represents width of the image or video in pixels.
+    // In the case of a sound clip this attribute has value 0
+    this.width = 0;
+}
+
+module.exports = ConfigurationData;
+
+});
+
+// file: lib/common/plugin/Connection.js
+define("cordova/plugin/Connection", function(require, exports, module) {
+
+/**
+ * Network status
+ */
+module.exports = {
+        UNKNOWN: "unknown",
+        ETHERNET: "ethernet",
+        WIFI: "wifi",
+        CELL_2G: "2g",
+        CELL_3G: "3g",
+        CELL_4G: "4g",
+        CELL:"cellular",
+        NONE: "none"
+};
+
+});
+
+// file: lib/common/plugin/Contact.js
+define("cordova/plugin/Contact", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    exec = require('cordova/exec'),
+    ContactError = require('cordova/plugin/ContactError'),
+    utils = require('cordova/utils');
+
+/**
+* Converts primitives into Complex Object
+* Currently only used for Date fields
+*/
+function convertIn(contact) {
+    var value = contact.birthday;
+    try {
+      contact.birthday = new Date(parseFloat(value));
+    } catch (exception){
+      console.log("Cordova Contact convertIn error: exception creating date.");
+    }
+    return contact;
+}
+
+/**
+* Converts Complex objects into primitives
+* Only conversion at present is for Dates.
+**/
+
+function convertOut(contact) {
+    var value = contact.birthday;
+    if (value !== null) {
+        // try to make it a Date object if it is not already
+        if (!utils.isDate(value)){
+            try {
+                value = new Date(value);
+            } catch(exception){
+                value = null;
+            }
+        }
+        if (utils.isDate(value)){
+            value = value.valueOf(); // convert to milliseconds
+        }
+        contact.birthday = value;
+    }
+    return contact;
+}
+
+/**
+* Contains information about a single contact.
+* @constructor
+* @param {DOMString} id unique identifier
+* @param {DOMString} displayName
+* @param {ContactName} name
+* @param {DOMString} nickname
+* @param {Array.<ContactField>} phoneNumbers array of phone numbers
+* @param {Array.<ContactField>} emails array of email addresses
+* @param {Array.<ContactAddress>} addresses array of addresses
+* @param {Array.<ContactField>} ims instant messaging user ids
+* @param {Array.<ContactOrganization>} organizations
+* @param {DOMString} birthday contact's birthday
+* @param {DOMString} note user notes about contact
+* @param {Array.<ContactField>} photos
+* @param {Array.<ContactField>} categories
+* @param {Array.<ContactField>} urls contact's web sites
+*/
+var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses,
+    ims, organizations, birthday, note, photos, categories, urls) {
+    this.id = id || null;
+    this.rawId = null;
+    this.displayName = displayName || null;
+    this.name = name || null; // ContactName
+    this.nickname = nickname || null;
+    this.phoneNumbers = phoneNumbers || null; // ContactField[]
+    this.emails = emails || null; // ContactField[]
+    this.addresses = addresses || null; // ContactAddress[]
+    this.ims = ims || null; // ContactField[]
+    this.organizations = organizations || null; // ContactOrganization[]
+    this.birthday = birthday || null;
+    this.note = note || null;
+    this.photos = photos || null; // ContactField[]
+    this.categories = categories || null; // ContactField[]
+    this.urls = urls || null; // ContactField[]
+};
+
+/**
+* Removes contact from device storage.
+* @param successCB success callback
+* @param errorCB error callback
+*/
+Contact.prototype.remove = function(successCB, errorCB) {
+    argscheck.checkArgs('FF', 'Contact.remove', arguments);
+    var fail = errorCB && function(code) {
+        errorCB(new ContactError(code));
+    };
+    if (this.id === null) {
+        fail(ContactError.UNKNOWN_ERROR);
+    }
+    else {
+        exec(successCB, fail, "Contacts", "remove", [this.id]);
+    }
+};
+
+/**
+* Creates a deep copy of this Contact.
+* With the contact ID set to null.
+* @return copy of this Contact
+*/
+Contact.prototype.clone = function() {
+    var clonedContact = utils.clone(this);
+    clonedContact.id = null;
+    clonedContact.rawId = null;
+
+    function nullIds(arr) {
+        if (arr) {
+            for (var i = 0; i < arr.length; ++i) {
+                arr[i].id = null;
+            }
+        }
+    }
+
+    // Loop through and clear out any id's in phones, emails, etc.
+    nullIds(clonedContact.phoneNumbers);
+    nullIds(clonedContact.emails);
+    nullIds(clonedContact.addresses);
+    nullIds(clonedContact.ims);
+    nullIds(clonedContact.organizations);
+    nullIds(clonedContact.categories);
+    nullIds(clonedContact.photos);
+    nullIds(clonedContact.urls);
+    return clonedContact;
+};
+
+/**
+* Persists contact to device storage.
+* @param successCB success callback
+* @param errorCB error callback
+*/
+Contact.prototype.save = function(successCB, errorCB) {
+    argscheck.checkArgs('FFO', 'Contact.save', arguments);
+    var fail = errorCB && function(code) {
+        errorCB(new ContactError(code));
+    };
+    var success = function(result) {
+        if (result) {
+            if (successCB) {
+                var fullContact = require('cordova/plugin/contacts').create(result);
+                successCB(convertIn(fullContact));
+            }
+        }
+        else {
+            // no Entry object returned
+            fail(ContactError.UNKNOWN_ERROR);
+        }
+    };
+    var dupContact = convertOut(utils.clone(this));
+    exec(success, fail, "Contacts", "save", [dupContact]);
+};
+
+
+module.exports = Contact;
+
+});
+
+// file: lib/common/plugin/ContactAddress.js
+define("cordova/plugin/ContactAddress", function(require, exports, module) {
+
+/**
+* Contact address.
+* @constructor
+* @param {DOMString} id unique identifier, should only be set by native code
+* @param formatted // NOTE: not a W3C standard
+* @param streetAddress
+* @param locality
+* @param region
+* @param postalCode
+* @param country
+*/
+
+var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) {
+    this.id = null;
+    this.pref = (typeof pref != 'undefined' ? pref : false);
+    this.type = type || null;
+    this.formatted = formatted || null;
+    this.streetAddress = streetAddress || null;
+    this.locality = locality || null;
+    this.region = region || null;
+    this.postalCode = postalCode || null;
+    this.country = country || null;
+};
+
+module.exports = ContactAddress;
+
+});
+
+// file: lib/common/plugin/ContactError.js
+define("cordova/plugin/ContactError", function(require, exports, module) {
+
+/**
+ *  ContactError.
+ *  An error code assigned by an implementation when an error has occurred
+ * @constructor
+ */
+var ContactError = function(err) {
+    this.code = (typeof err != 'undefined' ? err : null);
+};
+
+/**
+ * Error codes
+ */
+ContactError.UNKNOWN_ERROR = 0;
+ContactError.INVALID_ARGUMENT_ERROR = 1;
+ContactError.TIMEOUT_ERROR = 2;
+ContactError.PENDING_OPERATION_ERROR = 3;
+ContactError.IO_ERROR = 4;
+ContactError.NOT_SUPPORTED_ERROR = 5;
+ContactError.PERMISSION_DENIED_ERROR = 20;
+
+module.exports = ContactError;
+
+});
+
+// file: lib/common/plugin/ContactField.js
+define("cordova/plugin/ContactField", function(require, exports, module) {
+
+/**
+* Generic contact field.
+* @constructor
+* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard
+* @param type
+* @param value
+* @param pref
+*/
+var ContactField = function(type, value, pref) {
+    this.id = null;
+    this.type = (type && type.toString()) || null;
+    this.value = (value && value.toString()) || null;
+    this.pref = (typeof pref != 'undefined' ? pref : false);
+};
+
+module.exports = ContactField;
+
+});
+
+// file: lib/common/plugin/ContactFindOptions.js
+define("cordova/plugin/ContactFindOptions", function(require, exports, module) {
+
+/**
+ * ContactFindOptions.
+ * @constructor
+ * @param filter used to match contacts against
+ * @param multiple boolean used to determine if more than one contact should be returned
+ */
+
+var ContactFindOptions = function(filter, multiple) {
+    this.filter = filter || '';
+    this.multiple = (typeof multiple != 'undefined' ? multiple : false);
+};
+
+module.exports = ContactFindOptions;
+
+});
+
+// file: lib/common/plugin/ContactName.js
+define("cordova/plugin/ContactName", function(require, exports, module) {
+
+/**
+* Contact name.
+* @constructor
+* @param formatted // NOTE: not part of W3C standard
+* @param familyName
+* @param givenName
+* @param middle
+* @param prefix
+* @param suffix
+*/
+var ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) {
+    this.formatted = formatted || null;
+    this.familyName = familyName || null;
+    this.givenName = givenName || null;
+    this.middleName = middle || null;
+    this.honorificPrefix = prefix || null;
+    this.honorificSuffix = suffix || null;
+};
+
+module.exports = ContactName;
+
+});
+
+// file: lib/common/plugin/ContactOrganization.js
+define("cordova/plugin/ContactOrganization", function(require, exports, module) {
+
+/**
+* Contact organization.
+* @constructor
+* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard
+* @param name
+* @param dept
+* @param title
+* @param startDate
+* @param endDate
+* @param location
+* @param desc
+*/
+
+var ContactOrganization = function(pref, type, name, dept, title) {
+    this.id = null;
+    this.pref = (typeof pref != 'undefined' ? pref : false);
+    this.type = type || null;
+    this.name = name || null;
+    this.department = dept || null;
+    this.title = title || null;
+};
+
+module.exports = ContactOrganization;
+
+});
+
+// file: lib/common/plugin/Coordinates.js
+define("cordova/plugin/Coordinates", function(require, exports, module) {
+
+/**
+ * This class contains position information.
+ * @param {Object} lat
+ * @param {Object} lng
+ * @param {Object} alt
+ * @param {Object} acc
+ * @param {Object} head
+ * @param {Object} vel
+ * @param {Object} altacc
+ * @constructor
+ */
+var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {
+    /**
+     * The latitude of the position.
+     */
+    this.latitude = lat;
+    /**
+     * The longitude of the position,
+     */
+    this.longitude = lng;
+    /**
+     * The accuracy of the position.
+     */
+    this.accuracy = acc;
+    /**
+     * The altitude of the position.
+     */
+    this.altitude = (alt !== undefined ? alt : null);
+    /**
+     * The direction the device is moving at the position.
+     */
+    this.heading = (head !== undefined ? head : null);
+    /**
+     * The velocity with which the device is moving at the position.
+     */
+    this.speed = (vel !== undefined ? vel : null);
+
+    if (this.speed === 0 || this.speed === null) {
+        this.heading = NaN;
+    }
+
+    /**
+     * The altitude accuracy of the position.
+     */
+    this.altitudeAccuracy = (altacc !== undefined) ? altacc : null;
+};
+
+module.exports = Coordinates;
+
+});
+
+// file: lib/common/plugin/DirectoryEntry.js
+define("cordova/plugin/DirectoryEntry", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    utils = require('cordova/utils'),
+    exec = require('cordova/exec'),
+    Entry = require('cordova/plugin/Entry'),
+    FileError = require('cordova/plugin/FileError'),
+    DirectoryReader = require('cordova/plugin/DirectoryReader');
+
+/**
+ * An interface representing a directory on the file system.
+ *
+ * {boolean} isFile always false (readonly)
+ * {boolean} isDirectory always true (readonly)
+ * {DOMString} name of the directory, excluding the path leading to it (readonly)
+ * {DOMString} fullPath the absolute full path to the directory (readonly)
+ * TODO: implement this!!! {FileSystem} filesystem on which the directory resides (readonly)
+ */
+var DirectoryEntry = function(name, fullPath) {
+     DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath);
+};
+
+utils.extend(DirectoryEntry, Entry);
+
+/**
+ * Creates a new DirectoryReader to read entries from this directory
+ */
+DirectoryEntry.prototype.createReader = function() {
+    return new DirectoryReader(this.fullPath);
+};
+
+/**
+ * Creates or looks up a directory
+ *
+ * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory
+ * @param {Flags} options to create or exclusively create the directory
+ * @param {Function} successCallback is called with the new entry
+ * @param {Function} errorCallback is called with a FileError
+ */
+DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) {
+    argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
+    var win = successCallback && function(result) {
+        var entry = new DirectoryEntry(result.name, result.fullPath);
+        successCallback(entry);
+    };
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+    exec(win, fail, "File", "getDirectory", [this.fullPath, path, options]);
+};
+
+/**
+ * Deletes a directory and all of it's contents
+ *
+ * @param {Function} successCallback is called with no parameters
+ * @param {Function} errorCallback is called with a FileError
+ */
+DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+    exec(successCallback, fail, "File", "removeRecursively", [this.fullPath]);
+};
+
+/**
+ * Creates or looks up a file
+ *
+ * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file
+ * @param {Flags} options to create or exclusively create the file
+ * @param {Function} successCallback is called with the new entry
+ * @param {Function} errorCallback is called with a FileError
+ */
+DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) {
+    argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
+    var win = successCallback && function(result) {
+        var FileEntry = require('cordova/plugin/FileEntry');
+        var entry = new FileEntry(result.name, result.fullPath);
+        successCallback(entry);
+    };
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+    exec(win, fail, "File", "getFile", [this.fullPath, path, options]);
+};
+
+module.exports = DirectoryEntry;
+
+});
+
+// file: lib/common/plugin/DirectoryReader.js
+define("cordova/plugin/DirectoryReader", function(require, exports, module) {
+
+var exec = require('cordova/exec'),
+    FileError = require('cordova/plugin/FileError') ;
+
+/**
+ * An interface that lists the files and directories in a directory.
+ */
+function DirectoryReader(path) {
+    this.path = path || null;
+}
+
+/**
+ * Returns a list of entries from a directory.
+ *
+ * @param {Function} successCallback is called with a list of entries
+ * @param {Function} errorCallback is called with a FileError
+ */
+DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) {
+    var win = typeof successCallback !== 'function' ? null : function(result) {
+        var retVal = [];
+        for (var i=0; i<result.length; i++) {
+            var entry = null;
+            if (result[i].isDirectory) {
+                entry = new (require('cordova/plugin/DirectoryEntry'))();
+            }
+            else if (result[i].isFile) {
+                entry = new (require('cordova/plugin/FileEntry'))();
+            }
+            entry.isDirectory = result[i].isDirectory;
+            entry.isFile = result[i].isFile;
+            entry.name = result[i].name;
+            entry.fullPath = result[i].fullPath;
+            retVal.push(entry);
+        }
+        successCallback(retVal);
+    };
+    var fail = typeof errorCallback !== 'function' ? null : function(code) {
+        errorCallback(new FileError(code));
+    };
+    exec(win, fail, "File", "readEntries", [this.path]);
+};
+
+module.exports = DirectoryReader;
+
+});
+
+// file: lib/common/plugin/Entry.js
+define("cordova/plugin/Entry", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    exec = require('cordova/exec'),
+    FileError = require('cordova/plugin/FileError'),
+    Metadata = require('cordova/plugin/Metadata');
+
+/**
+ * Represents a file or directory on the local file system.
+ *
+ * @param isFile
+ *            {boolean} true if Entry is a file (readonly)
+ * @param isDirectory
+ *            {boolean} true if Entry is a directory (readonly)
+ * @param name
+ *            {DOMString} name of the file or directory, excluding the path
+ *            leading to it (readonly)
+ * @param fullPath
+ *            {DOMString} the absolute full path to the file or directory
+ *            (readonly)
+ */
+function Entry(isFile, isDirectory, name, fullPath, fileSystem) {
+    this.isFile = !!isFile;
+    this.isDirectory = !!isDirectory;
+    this.name = name || '';
+    this.fullPath = fullPath || '';
+    this.filesystem = fileSystem || null;
+}
+
+/**
+ * Look up the metadata of the entry.
+ *
+ * @param successCallback
+ *            {Function} is called with a Metadata object
+ * @param errorCallback
+ *            {Function} is called with a FileError
+ */
+Entry.prototype.getMetadata = function(successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
+    var success = successCallback && function(lastModified) {
+        var metadata = new Metadata(lastModified);
+        successCallback(metadata);
+    };
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+
+    exec(success, fail, "File", "getMetadata", [this.fullPath]);
+};
+
+/**
+ * Set the metadata of the entry.
+ *
+ * @param successCallback
+ *            {Function} is called with a Metadata object
+ * @param errorCallback
+ *            {Function} is called with a FileError
+ * @param metadataObject
+ *            {Object} keys and values to set
+ */
+Entry.prototype.setMetadata = function(successCallback, errorCallback, metadataObject) {
+    argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
+    exec(successCallback, errorCallback, "File", "setMetadata", [this.fullPath, metadataObject]);
+};
+
+/**
+ * Move a file or directory to a new location.
+ *
+ * @param parent
+ *            {DirectoryEntry} the directory to which to move this entry
+ * @param newName
+ *            {DOMString} new name of the entry, defaults to the current name
+ * @param successCallback
+ *            {Function} called with the new DirectoryEntry object
+ * @param errorCallback
+ *            {Function} called with a FileError
+ */
+Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {
+    argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+    // source path
+    var srcPath = this.fullPath,
+        // entry name
+        name = newName || this.name,
+        success = function(entry) {
+            if (entry) {
+                if (successCallback) {
+                    // create appropriate Entry object
+                    var result = (entry.isDirectory) ? new (require('cordova/plugin/DirectoryEntry'))(entry.name, entry.fullPath) : new (require('cordova/plugin/FileEntry'))(entry.name, entry.fullPath);
+                    successCallback(result);
+                }
+            }
+            else {
+                // no Entry object returned
+                fail && fail(FileError.NOT_FOUND_ERR);
+            }
+        };
+
+    // copy
+    exec(success, fail, "File", "moveTo", [srcPath, parent.fullPath, name]);
+};
+
+/**
+ * Copy a directory to a different location.
+ *
+ * @param parent
+ *            {DirectoryEntry} the directory to which to copy the entry
+ * @param newName
+ *            {DOMString} new name of the entry, defaults to the current name
+ * @param successCallback
+ *            {Function} called with the new Entry object
+ * @param errorCallback
+ *            {Function} called with a FileError
+ */
+Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {
+    argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+
+        // source path
+    var srcPath = this.fullPath,
+        // entry name
+        name = newName || this.name,
+        // success callback
+        success = function(entry) {
+            if (entry) {
+                if (successCallback) {
+                    // create appropriate Entry object
+                    var result = (entry.isDirectory) ? new (require('cordova/plugin/DirectoryEntry'))(entry.name, entry.fullPath) : new (require('cordova/plugin/FileEntry'))(entry.name, entry.fullPath);
+                    successCallback(result);
+                }
+            }
+            else {
+                // no Entry object returned
+                fail && fail(FileError.NOT_FOUND_ERR);
+            }
+        };
+
+    // copy
+    exec(success, fail, "File", "copyTo", [srcPath, parent.fullPath, name]);
+};
+
+/**
+ * Return a URL that can be used to identify this entry.
+ */
+Entry.prototype.toURL = function() {
+    // fullPath attribute contains the full URL
+    return this.fullPath;
+};
+
+/**
+ * Returns a URI that can be used to identify this entry.
+ *
+ * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.
+ * @return uri
+ */
+Entry.prototype.toURI = function(mimeType) {
+    console.log("DEPRECATED: Update your code to use 'toURL'");
+    // fullPath attribute contains the full URI
+    return this.toURL();
+};
+
+/**
+ * Remove a file or directory. It is an error to attempt to delete a
+ * directory that is not empty. It is an error to attempt to delete a
+ * root directory of a file system.
+ *
+ * @param successCallback {Function} called with no parameters
+ * @param errorCallback {Function} called with a FileError
+ */
+Entry.prototype.remove = function(successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'Entry.remove', arguments);
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+    exec(successCallback, fail, "File", "remove", [this.fullPath]);
+};
+
+/**
+ * Look up the parent DirectoryEntry of this entry.
+ *
+ * @param successCallback {Function} called with the parent DirectoryEntry object
+ * @param errorCallback {Function} called with a FileError
+ */
+Entry.prototype.getParent = function(successCallback, errorCallback) {
+    argscheck.checkArgs('FF', 'Entry.getParent', arguments);
+    var win = successCallback && function(result) {
+        var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
+        var entry = new DirectoryEntry(result.name, result.fullPath);
+        successCallback(entry);
+    };
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+    exec(win, fail, "File", "getParent", [this.fullPath]);
+};
+
+module.exports = Entry;
+
+});
+
+// file: lib/common/plugin/File.js
+define("cordova/plugin/File", function(require, exports, module) {
+
+/**
+ * Constructor.
+ * name {DOMString} name of the file, without path information
+ * fullPath {DOMString} the full path of the file, including the name
+ * type {DOMString} mime type
+ * lastModifiedDate {Date} last modified date
+ * size {Number} size of the file in bytes
+ */
+
+var File = function(name, fullPath, type, lastModifiedDate, size){
+    this.name = name || '';
+    this.fullPath = fullPath || null;
+    this.type = type || null;
+    this.lastModifiedDate = lastModifiedDate || null;
+    this.size = size || 0;
+
+    // These store the absolute start and end for slicing the file.
+    this.start = 0;
+    this.end = this.size;
+};
+
+/**
+ * Returns a "slice" of the file. Since Cordova Files don't contain the actual
+ * content, this really returns a File with adjusted start and end.
+ * Slices of slices are supported.
+ * start {Number} The index at which to start the slice (inclusive).
+ * end {Number} The index at which to end the slice (exclusive).
+ */
+File.prototype.slice = function(start, end) {
+    var size = this.end - this.start;
+    var newStart = 0;
+    var newEnd = size;
+    if (arguments.length) {
+        if (start < 0) {
+            newStart = Math.max(size + start, 0);
+        } else {
+            newStart = Math.min(size, start);
+        }
+    }
+
+    if (arguments.length >= 2) {
+        if (end < 0) {
+            newEnd = Math.max(size + end, 0);
+        } else {
+            newEnd = Math.min(end, size);
+        }
+    }
+
+    var newFile = new File(this.name, this.fullPath, this.type, this.lastModifiedData, this.size);
+    newFile.start = this.start + newStart;
+    newFile.end = this.start + newEnd;
+    return newFile;
+};
+
+
+module.exports = File;
+
+});
+
+// file: lib/common/plugin/FileEntry.js
+define("cordova/plugin/FileEntry", function(require, exports, module) {
+
+var utils = require('cordova/utils'),
+    exec = require('cordova/exec'),
+    Entry = require('cordova/plugin/Entry'),
+    FileWriter = require('cordova/plugin/FileWriter'),
+    File = require('cordova/plugin/File'),
+    FileError = require('cordova/plugin/FileError');
+
+/**
+ * An interface representing a file on the file system.
+ *
+ * {boolean} isFile always true (readonly)
+ * {boolean} isDirectory always false (readonly)
+ * {DOMString} name of the file, excluding the path leading to it (readonly)
+ * {DOMString} fullPath the absolute full path to the file (readonly)
+ * {FileSystem} filesystem on which the file resides (readonly)
+ */
+var FileEntry = function(name, fullPath) {
+     FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath]);
+};
+
+utils.extend(FileEntry, Entry);
+
+/**
+ * Creates a new FileWriter associated with the file that this FileEntry represents.
+ *
+ * @param {Function} successCallback is called with the new FileWriter
+ * @param {Function} errorCallback is called with a FileError
+ */
+FileEntry.prototype.createWriter = function(successCallback, errorCallback) {
+    this.file(function(filePointer) {
+        var writer = new FileWriter(filePointer);
+
+        if (writer.fileName === null || writer.fileName === "") {
+            errorCallback && errorCallback(new FileError(FileError.INVALID_STATE_ERR));
+        } else {
+            successCallback && successCallback(writer);
+        }
+    }, errorCallback);
+};
+
+/**
+ * Returns a File that represents the current state of the file that this FileEntry represents.
+ *
+ * @param {Function} successCallback is called with the new File object
+ * @param {Function} errorCallback is called with a FileError
+ */
+FileEntry.prototype.file = function(successCallback, errorCallback) {
+    var win = successCallback && function(f) {
+        var file = new File(f.name, f.fullPath, f.type, f.lastModifiedDate, f.size);
+        successCallback(file);
+    };
+    var fail = errorCallback && function(code) {
+        errorCallback(new FileError(code));
+    };
+    exec(win, fail, "File", "getFileMetadata", [this.fullPath]);
+};
+
+
+module.exports = FileEntry;
+
+});
+
+// file: lib/common/plugin/FileError.js
+define("cordova/plugin/FileError", function(require, exports, module) {
+
+/**
+ * FileError
+ */
+function FileError(error) {
+  this.code = error || null;
+}
+
+// File error codes
+// Found in DOMException
+FileError.NOT_FOUND_ERR = 1;
+FileError.SECURITY_ERR = 2;
+FileError.ABORT_ERR = 3;
+
+// Added by File API specification
+FileError.NOT_READABLE_ERR = 4;
+FileError.ENCODING_ERR = 5;
+FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
+FileError.INVALID_STATE_ERR = 7;
+FileError.SYNTAX_ERR = 8;
+FileError.INVALID_MODIFICATION_ERR = 9;
+FileError.QUOTA_EXCEEDED_ERR = 10;
+FileError.TYPE_MISMATCH_ERR = 11;
+FileError.PATH_EXISTS_ERR = 12;
+
+module.exports = FileError;
+
+});
+
+// file: lib/common/plugin/FileReader.js
+define("cordova/plugin/FileReader", function(require, exports, module) {
+
+var exec = require('cordova/exec'),
+    modulemapper = require('cordova/modulemapper'),
+    utils = require('cordova/utils'),
+    File = require('cordova/plugin/File'),
+    FileError = require('cordova/plugin/FileError'),
+    ProgressEvent = require('cordova/plugin/ProgressEvent'),
+    origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader');
+
+/**
+ * This class reads the mobile device file system.
+ *
+ * For Android:
+ *      The root directory is the root of the file system.
+ *      To read from the SD card, the file name is "sdcard/my_file.txt"
+ * @constructor
+ */
+var FileReader = function() {
+    this._readyState = 0;
+    this._error = null;
+    this._result = null;
+    this._fileName = '';
+    this._realReader = origFileReader ? new origFileReader() : {};
+};
+
+// States
+FileReader.EMPTY = 0;
+FileReader.LOADING = 1;
+FileReader.DONE = 2;
+
+utils.defineGetter(FileReader.prototype, 'readyState', function() {
+    return this._fileName ? this._readyState : this._realReader.readyState;
+});
+
+utils.defineGetter(FileReader.prototype, 'error', function() {
+    return this._fileName ? this._error: this._realReader.error;
+});
+
+utils.defineGetter(FileReader.prototype, 'result', function() {
+    return this._fileName ? this._result: this._realReader.result;
+});
+
+function defineEvent(eventName) {
+    utils.defineGetterSetter(FileReader.prototype, eventName, function() {
+        return this._realReader[eventName] || null;
+    }, function(value) {
+        this._realReader[eventName] = value;
+    });
+}
+defineEvent('onloadstart');    // When the read starts.
+defineEvent('onprogress');     // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
+defineEvent('onload');         // When the read has successfully completed.
+defineEvent('onerror');        // When the read has failed (see errors).
+defineEvent('onloadend');      // When the request has completed (either in success or failure).
+defineEvent('onabort');        // When the read has been aborted. For instance, by invoking the abort() method.
+
+function initRead(reader, file) {
+    // Already loading something
+    if (reader.readyState == FileReader.LOADING) {
+      throw new FileError(FileError.INVALID_STATE_ERR);
+    }
+
+    reader._result = null;
+    reader._error = null;
+    reader._readyState = FileReader.LOADING;
+
+    if (typeof file == 'string') {
+        // Deprecated in Cordova 2.4.
+        console.warning('Using a string argument with FileReader.readAs functions is deprecated.');
+        reader._fileName = file;
+    } else if (typeof file.fullPath == 'string') {
+        reader._fileName = file.fullPath;
+    } else {
+        reader._fileName = '';
+        return true;
+    }
+
+    reader.onloadstart && reader.onloadstart(new ProgressEvent("loadstart", {target:reader}));
+}
+
+/**
+ * Abort reading file.
+ */
+FileReader.prototype.abort = function() {
+    if (origFileReader && !this._fileName) {
+        return this._realReader.abort();
+    }
+    this._result = null;
+
+    if (this._readyState == FileReader.DONE || this._readyState == FileReader.EMPTY) {
+      return;
+    }
+
+    this._readyState = FileReader.DONE;
+
+    // If abort callback
+    if (typeof this.onabort === 'function') {
+        this.onabort(new ProgressEvent('abort', {target:this}));
+    }
+    // If load end callback
+    if (typeof this.onloadend === 'function') {
+        this.onloadend(new ProgressEvent('loadend', {target:this}));
+    }
+};
+
+/**
+ * Read text file.
+ *
+ * @param file          {File} File object containing file properties
+ * @param encoding      [Optional] (see http://www.iana.org/assignments/character-sets)
+ */
+FileReader.prototype.readAsText = function(file, encoding) {
+    if (initRead(this, file)) {
+        return this._realReader.readAsText(file, encoding);
+    }
+
+    // Default encoding is UTF-8
+    var enc = encoding ? encoding : "UTF-8";
+    var me = this;
+    var execArgs = [this._fileName, enc, file.start, file.end];
+
+    // Read file
+    exec(
+        // Success callback
+        function(r) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // Save result
+            me._result = r;
+
+            // If onload callback
+            if (typeof me.onload === "function") {
+                me.onload(new ProgressEvent("load", {target:me}));
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        },
+        // Error callback
+        function(e) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            // null result
+            me._result = null;
+
+            // Save error
+            me._error = new FileError(e);
+
+            // If onerror callback
+            if (typeof me.onerror === "function") {
+                me.onerror(new ProgressEvent("error", {target:me}));
+            }
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        }, "File", "readAsText", execArgs);
+};
+
+
+/**
+ * Read file and return data as a base64 encoded data url.
+ * A data url is of the form:
+ *      data:[<mediatype>][;base64],<data>
+ *
+ * @param file          {File} File object containing file properties
+ */
+FileReader.prototype.readAsDataURL = function(file) {
+    if (initRead(this, file)) {
+        return this._realReader.readAsDataURL(file);
+    }
+
+    var me = this;
+    var execArgs = [this._fileName, file.start, file.end];
+
+    // Read file
+    exec(
+        // Success callback
+        function(r) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            // Save result
+            me._result = r;
+
+            // If onload callback
+            if (typeof me.onload === "function") {
+                me.onload(new ProgressEvent("load", {target:me}));
+            }
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        },
+        // Error callback
+        function(e) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            me._result = null;
+
+            // Save error
+            me._error = new FileError(e);
+
+            // If onerror callback
+            if (typeof me.onerror === "function") {
+                me.onerror(new ProgressEvent("error", {target:me}));
+            }
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        }, "File", "readAsDataURL", execArgs);
+};
+
+/**
+ * Read file and return data as a binary data.
+ *
+ * @param file          {File} File object containing file properties
+ */
+FileReader.prototype.readAsBinaryString = function(file) {
+    if (initRead(this, file)) {
+        return this._realReader.readAsBinaryString(file);
+    }
+
+    var me = this;
+    var execArgs = [this._fileName, file.start, file.end];
+
+    // Read file
+    exec(
+        // Success callback
+        function(r) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            me._result = r;
+
+            // If onload callback
+            if (typeof me.onload === "function") {
+                me.onload(new ProgressEvent("load", {target:me}));
+            }
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        },
+        // Error callback
+        function(e) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            me._result = null;
+
+            // Save error
+            me._error = new FileError(e);
+
+            // If onerror callback
+            if (typeof me.onerror === "function") {
+                me.onerror(new ProgressEvent("error", {target:me}));
+            }
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        }, "File", "readAsBinaryString", execArgs);
+};
+
+/**
+ * Read file and return data as a binary data.
+ *
+ * @param file          {File} File object containing file properties
+ */
+FileReader.prototype.readAsArrayBuffer = function(file) {
+    if (initRead(this, file)) {
+        return this._realReader.readAsArrayBuffer(file);
+    }
+
+    var me = this;
+    var execArgs = [this._fileName, file.start, file.end];
+
+    // Read file
+    exec(
+        // Success callback
+        function(r) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            me._result = r;
+
+            // If onload callback
+            if (typeof me.onload === "function") {
+                me.onload(new ProgressEvent("load", {target:me}));
+            }
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        },
+        // Error callback
+        function(e) {
+            // If DONE (cancelled), then don't do anything
+            if (me._readyState === FileReader.DONE) {
+                return;
+            }
+
+            // DONE state
+            me._readyState = FileReader.DONE;
+
+            me._result = null;
+
+            // Save error
+            me._error = new FileError(e);
+
+            // If onerror callback
+            if (typeof me.onerror === "function") {
+                me.onerror(new ProgressEvent("error", {target:me}));
+            }
+
+            // If onloadend callback
+            if (typeof me.onloadend === "function") {
+                me.onloadend(new ProgressEvent("loadend", {target:me}));
+            }
+        }, "File", "readAsArrayBuffer", execArgs);
+};
+
+module.exports = FileReader;
+
+});
+
+// file: lib/common/plugin/FileSystem.js
+define("cordova/plugin/FileSystem", function(require, exports, module) {
+
+var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
+
+/**
+ * An interface representing a file system
+ *
+ * @constructor
+ * {DOMString} name the unique name of the file system (readonly)
+ * {DirectoryEntry} root directory of the file system (readonly)
+ */
+var FileSystem = function(name, root) {
+    this.name = name || null;
+    if (root) {
+        this.root = new DirectoryEntry(root.name, root.fullPath);
+    }
+};
+
+module.exports = FileSystem;
+
+});
+
+// file: lib/common/plugin/FileTransfer.js
+define("cordova/plugin/FileTransfer", function(require, exports, module) {
+
+var argscheck = require('cordova/argscheck'),
+    exec = require('cordova/exec'),
+    FileTransferError = require('cordova/plugin/FileTransferError'),
+    ProgressEvent = require('cordova/plugin/ProgressEvent');
+
+function newProgressEvent(result) {
+    var pe = new ProgressEvent();
+    pe.lengthComputable = result.lengthComputable;
+    pe.loaded = result.loaded;
+    pe.total = result.total;
+    return pe;
+}
+
+function getBasicAuthHeader(urlString) {
+    var header =  null;
+
+    if (window.btoa) {
+        // parse the url using the Location object
+        var url = document.createElement('a');
+        url.href = urlString;
+
+        var credentials = null;
+        var protocol = url.protocol + "//";
+        var origin = protocol + url.host;
+
+        // check whether there are the username:password credentials in the url
+        if (url.href.indexOf(origin) != 0) { // credentials found
+            var atIndex = url.href.indexOf("@");
+            credentials = url.href.substring(protocol.length, atIndex);
+        }
+
+        if (credentials) {
+            var authHeader = "Authorization";
+            var authHeaderValue = "Basic " + window.btoa(credentials);
+
+            header = {
+                name : authHeader,
+                value : authHeaderValue
+            };
+        }
+    }
+
+    return header;
+}
+
+var idCounter = 0;
+
+/**
+ * FileTransfer uploads a file to a remote server.
+ * @constructor
+ */
+var FileTransfer = function() {
+    this._id = ++idCounter;
+    this.onprogress = null; // optional callback
+};
+
+/**
+* Given an absolute file path, uploads a file on the device to a remote server
+* using a multipart HTTP request.
+* @param filePath {String}           Full path of the file on the device
+* @param server {String}             URL of the server to receive the file
+* @param successCallback (Function}  Callback to be invoked when upload has completed
+* @param errorCallback {Function}    Callback to be invoked upon error
+* @param options {FileUploadOptions} Optional parameters such as file name and mimetype
+* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
+*/
+FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) {
+    argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments);
+    // check for options
+    var fileKey = null;
+    var fileName = null;
+    var mimeType = null;
+    var params = null;
+    var chunkedMode = true;
+    var headers = null;
+
+    var basicAuthHeader = getBasicAuthHeader(server);
+    if (basicAuthHeader) {
+        if (!options) {
+            options = new FileUploadOptions();
+        }
+        if (!options.headers) {
+            options.headers = {};
+        }
+        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
+    }
+
+    if (options) {
+        fileKey = options.fileKey;
+        fileName = options.fileName;
+        mimeType = options.mimeType;
+        headers = options.headers;
+        if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") {
+            chunkedMode = options.chunkedMode;
+        }
+        if (options.params) {
+            params = options.params;
+        }
+        else {
+            params = {};
+        }
+    }
+
+    var fail = errorCallback && function(e) {
+        var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
+        errorCallback(error);
+    };
+
+    var self = this;
+    var win = function(result) {
+        if (typeof result.lengthComputable != "undefined") {
+            if (self.onprogress) {
+                self.onprogress(newProgressEvent(result));
+            }
+        } else {
+            successCallback && successCallback(result);
+        }
+    };
+    exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id]);
+};
+
+/**
+ * Downloads a file form a given URL and saves it to the specified directory.
+ * @param source {String}          URL of the server to receive the file
+ * @param target {String}         Full path of the file on the device
+ * @param successCallback (Function}  Callback to be invoked when upload has completed
+ * @param errorCallback {Function}    Callback to be invoked upon error
+ * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
+ * @param options {FileDownloadOptions} Optional parameters such as headers
+ */
+FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) {
+    argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments);
+    var self = this;
+
+    var basicAuthHeader = getBasicAuthHeader(source);
+    if (basicAuthHeader) {
+        if (!options) {
+            options = {};
+        }
+        if (!options.headers) {
+            options.headers = {};
+        }
+        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
+    }
+
+    var headers = null;
+    if (options) {
+        headers = options.headers || null;
+    }
+
+    var win = function(result) {
+        if (typeof result.lengthComputable != "undefined") {
+            if (self.onprogress) {
+                return self.onprogress(newProgressEvent(result));
+            }
+        } else if (successCallback) {
+            var entry = null;
+            if (result.isDirectory) {
+                entry = new (require('cordova/plugin/DirectoryEntry'))();
+            }
+            else if (result.isFile) {
+                entry = new (require('cordova/plugin/FileEntry'))();
+            }
+            entry.isDirectory = result.isDirectory;
+            entry.isFile = result.isFile;
+            entry.name = result.name;
+            entry.fullPath = result.fullPath;
+            successCallback(entry);
+        }
+    };
+
+    var fail = errorCallback && function(e) {
+        var error = new FileTrans

<TRUNCATED>

[13/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/.bin/jake
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/.bin/jake b/lib/cordova-blackberry/blackberry10/node_modules/.bin/jake
new file mode 120000
index 0000000..3626745
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/.bin/jake
@@ -0,0 +1 @@
+../jake/bin/cli.js
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/.bin/jasmine-node
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/.bin/jasmine-node b/lib/cordova-blackberry/blackberry10/node_modules/.bin/jasmine-node
new file mode 120000
index 0000000..a1c6532
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/.bin/jasmine-node
@@ -0,0 +1 @@
+../jasmine-node/bin/jasmine-node
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/.bin/plugman
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/.bin/plugman b/lib/cordova-blackberry/blackberry10/node_modules/.bin/plugman
new file mode 120000
index 0000000..0c2fecb
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/.bin/plugman
@@ -0,0 +1 @@
+../plugman/plugman.js
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/.bin/xlocalize
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/.bin/xlocalize b/lib/cordova-blackberry/blackberry10/node_modules/.bin/xlocalize
new file mode 120000
index 0000000..34f4a5d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/.bin/xlocalize
@@ -0,0 +1 @@
+../localize/bin/xlocalize.js
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/.npmignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/.npmignore b/lib/cordova-blackberry/blackberry10/node_modules/commander/.npmignore
new file mode 100644
index 0000000..f1250e5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/.npmignore
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/.travis.yml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/.travis.yml b/lib/cordova-blackberry/blackberry10/node_modules/commander/.travis.yml
new file mode 100644
index 0000000..f1d0f13
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - 0.4
+  - 0.6

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/History.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/History.md b/lib/cordova-blackberry/blackberry10/node_modules/commander/History.md
new file mode 100644
index 0000000..4961d2e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/History.md
@@ -0,0 +1,107 @@
+
+0.6.1 / 2012-06-01 
+==================
+
+  * Added: append (yes or no) on confirmation
+  * Added: allow node.js v0.7.x
+
+0.6.0 / 2012-04-10 
+==================
+
+  * Added `.prompt(obj, callback)` support. Closes #49
+  * Added default support to .choose(). Closes #41
+  * Fixed the choice example
+
+0.5.1 / 2011-12-20 
+==================
+
+  * Fixed `password()` for recent nodes. Closes #36
+
+0.5.0 / 2011-12-04 
+==================
+
+  * Added sub-command option support [itay]
+
+0.4.3 / 2011-12-04 
+==================
+
+  * Fixed custom help ordering. Closes #32
+
+0.4.2 / 2011-11-24 
+==================
+
+  * Added travis support
+  * Fixed: line-buffered input automatically trimmed. Closes #31
+
+0.4.1 / 2011-11-18 
+==================
+
+  * Removed listening for "close" on --help
+
+0.4.0 / 2011-11-15 
+==================
+
+  * Added support for `--`. Closes #24
+
+0.3.3 / 2011-11-14 
+==================
+
+  * Fixed: wait for close event when writing help info [Jerry Hamlet]
+
+0.3.2 / 2011-11-01 
+==================
+
+  * Fixed long flag definitions with values [felixge]
+
+0.3.1 / 2011-10-31 
+==================
+
+  * Changed `--version` short flag to `-V` from `-v`
+  * Changed `.version()` so it's configurable [felixge]
+
+0.3.0 / 2011-10-31 
+==================
+
+  * Added support for long flags only. Closes #18
+
+0.2.1 / 2011-10-24 
+==================
+
+  * "node": ">= 0.4.x < 0.7.0". Closes #20
+
+0.2.0 / 2011-09-26 
+==================
+
+  * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
+
+0.1.0 / 2011-08-24 
+==================
+
+  * Added support for custom `--help` output
+
+0.0.5 / 2011-08-18 
+==================
+
+  * Changed: when the user enters nothing prompt for password again
+  * Fixed issue with passwords beginning with numbers [NuckChorris]
+
+0.0.4 / 2011-08-15 
+==================
+
+  * Fixed `Commander#args`
+
+0.0.3 / 2011-08-15 
+==================
+
+  * Added default option value support
+
+0.0.2 / 2011-08-15 
+==================
+
+  * Added mask support to `Command#password(str[, mask], fn)`
+  * Added `Command#password(str, fn)`
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/Makefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/Makefile b/lib/cordova-blackberry/blackberry10/node_modules/commander/Makefile
new file mode 100644
index 0000000..0074625
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/Makefile
@@ -0,0 +1,7 @@
+
+TESTS = $(shell find test/test.*.js)
+
+test:
+	@./test/run $(TESTS)
+
+.PHONY: test
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/Readme.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/Readme.md b/lib/cordova-blackberry/blackberry10/node_modules/commander/Readme.md
new file mode 100644
index 0000000..b8328c3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/Readme.md
@@ -0,0 +1,262 @@
+# Commander.js
+
+  The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).
+
+ [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)
+
+## Installation
+
+    $ npm install commander
+
+## Option parsing
+
+ Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+  .version('0.0.1')
+  .option('-p, --peppers', 'Add peppers')
+  .option('-P, --pineapple', 'Add pineapple')
+  .option('-b, --bbq', 'Add bbq sauce')
+  .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
+  .parse(process.argv);
+
+console.log('you ordered a pizza with:');
+if (program.peppers) console.log('  - peppers');
+if (program.pineapple) console.log('  - pineappe');
+if (program.bbq) console.log('  - bbq');
+console.log('  - %s cheese', program.cheese);
+```
+
+ Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
+
+## Automated --help
+
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
+
+```  
+ $ ./examples/pizza --help
+
+   Usage: pizza [options]
+
+   Options:
+
+     -V, --version        output the version number
+     -p, --peppers        Add peppers
+     -P, --pineapple      Add pineappe
+     -b, --bbq            Add bbq sauce
+     -c, --cheese <type>  Add the specified type of cheese [marble]
+     -h, --help           output usage information
+
+```
+
+## Coercion
+
+```js
+function range(val) {
+  return val.split('..').map(Number);
+}
+
+function list(val) {
+  return val.split(',');
+}
+
+program
+  .version('0.0.1')
+  .usage('[options] <file ...>')
+  .option('-i, --integer <n>', 'An integer argument', parseInt)
+  .option('-f, --float <n>', 'A float argument', parseFloat)
+  .option('-r, --range <a>..<b>', 'A range', range)
+  .option('-l, --list <items>', 'A list', list)
+  .option('-o, --optional [value]', 'An optional value')
+  .parse(process.argv);
+
+console.log(' int: %j', program.integer);
+console.log(' float: %j', program.float);
+console.log(' optional: %j', program.optional);
+program.range = program.range || [];
+console.log(' range: %j..%j', program.range[0], program.range[1]);
+console.log(' list: %j', program.list);
+console.log(' args: %j', program.args);
+```
+
+## Custom help
+
+ You can display arbitrary `-h, --help` information
+ by listening for "--help". Commander will automatically
+ exit once you are done so that the remainder of your program
+ does not execute causing undesired behaviours, for example
+ in the following executable "stuff" will not output when
+ `--help` is used.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('../');
+
+function list(val) {
+  return val.split(',').map(Number);
+}
+
+program
+  .version('0.0.1')
+  .option('-f, --foo', 'enable some foo')
+  .option('-b, --bar', 'enable some bar')
+  .option('-B, --baz', 'enable some baz');
+
+// must be before .parse() since
+// node's emit() is immediate
+
+program.on('--help', function(){
+  console.log('  Examples:');
+  console.log('');
+  console.log('    $ custom-help --help');
+  console.log('    $ custom-help -h');
+  console.log('');
+});
+
+program.parse(process.argv);
+
+console.log('stuff');
+```
+
+yielding the following help output:
+
+```
+
+Usage: custom-help [options]
+
+Options:
+
+  -h, --help     output usage information
+  -V, --version  output the version number
+  -f, --foo      enable some foo
+  -b, --bar      enable some bar
+  -B, --baz      enable some baz
+
+Examples:
+
+  $ custom-help --help
+  $ custom-help -h
+
+```
+
+## .prompt(msg, fn)
+
+ Single-line prompt:
+
+```js
+program.prompt('name: ', function(name){
+  console.log('hi %s', name);
+});
+```
+
+ Multi-line prompt:
+
+```js
+program.prompt('description:', function(name){
+  console.log('hi %s', name);
+});
+```
+
+ Coercion:
+
+```js
+program.prompt('Age: ', Number, function(age){
+  console.log('age: %j', age);
+});
+```
+
+```js
+program.prompt('Birthdate: ', Date, function(date){
+  console.log('date: %s', date);
+});
+```
+
+## .password(msg[, mask], fn)
+
+Prompt for password without echoing:
+
+```js
+program.password('Password: ', function(pass){
+  console.log('got "%s"', pass);
+  process.stdin.destroy();
+});
+```
+
+Prompt for password with mask char "*":
+
+```js
+program.password('Password: ', '*', function(pass){
+  console.log('got "%s"', pass);
+  process.stdin.destroy();
+});
+```
+
+## .confirm(msg, fn)
+
+ Confirm with the given `msg`:
+
+```js
+program.confirm('continue? ', function(ok){
+  console.log(' got %j', ok);
+});
+```
+
+## .choose(list, fn)
+
+ Let the user choose from a `list`:
+
+```js
+var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
+
+console.log('Choose the coolest pet:');
+program.choose(list, function(i){
+  console.log('you chose %d "%s"', i, list[i]);
+});
+```
+
+## Links
+
+ - [API documentation](http://visionmedia.github.com/commander.js/)
+ - [ascii tables](https://github.com/LearnBoost/cli-table)
+ - [progress bars](https://github.com/visionmedia/node-progress)
+ - [more progress bars](https://github.com/substack/node-multimeter)
+ - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)
+
+## License 
+
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/index.js b/lib/cordova-blackberry/blackberry10/node_modules/commander/index.js
new file mode 100644
index 0000000..06ec1e4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/index.js
@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/commander');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/lib/commander.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/lib/commander.js b/lib/cordova-blackberry/blackberry10/node_modules/commander/lib/commander.js
new file mode 100644
index 0000000..5ba87eb
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/lib/commander.js
@@ -0,0 +1,1026 @@
+
+/*!
+ * commander
+ * Copyright(c) 2011 TJ Holowaychuk <tj...@vision-media.ca>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter
+  , path = require('path')
+  , tty = require('tty')
+  , basename = path.basename;
+
+/**
+ * Expose the root command.
+ */
+
+exports = module.exports = new Command;
+
+/**
+ * Expose `Command`.
+ */
+
+exports.Command = Command;
+
+/**
+ * Expose `Option`.
+ */
+
+exports.Option = Option;
+
+/**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @api public
+ */
+
+function Option(flags, description) {
+  this.flags = flags;
+  this.required = ~flags.indexOf('<');
+  this.optional = ~flags.indexOf('[');
+  this.bool = !~flags.indexOf('-no-');
+  flags = flags.split(/[ ,|]+/);
+  if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
+  this.long = flags.shift();
+  this.description = description;
+}
+
+/**
+ * Return option name.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.name = function(){
+  return this.long
+    .replace('--', '')
+    .replace('no-', '');
+};
+
+/**
+ * Check if `arg` matches the short or long flag.
+ *
+ * @param {String} arg
+ * @return {Boolean}
+ * @api private
+ */
+
+Option.prototype.is = function(arg){
+  return arg == this.short
+    || arg == this.long;
+};
+
+/**
+ * Initialize a new `Command`.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+function Command(name) {
+  this.commands = [];
+  this.options = [];
+  this.args = [];
+  this.name = name;
+}
+
+/**
+ * Inherit from `EventEmitter.prototype`.
+ */
+
+Command.prototype.__proto__ = EventEmitter.prototype;
+
+/**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * Examples:
+ *
+ *      program
+ *        .version('0.0.1')
+ *        .option('-C, --chdir <path>', 'change the working directory')
+ *        .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
+ *        .option('-T, --no-tests', 'ignore test hook')
+ *     
+ *      program
+ *        .command('setup')
+ *        .description('run remote setup commands')
+ *        .action(function(){
+ *          console.log('setup');
+ *        });
+ *     
+ *      program
+ *        .command('exec <cmd>')
+ *        .description('run the given remote command')
+ *        .action(function(cmd){
+ *          console.log('exec "%s"', cmd);
+ *        });
+ *     
+ *      program
+ *        .command('*')
+ *        .description('deploy the given env')
+ *        .action(function(env){
+ *          console.log('deploying "%s"', env);
+ *        });
+ *     
+ *      program.parse(process.argv);
+  *
+ * @param {String} name
+ * @return {Command} the new command
+ * @api public
+ */
+
+Command.prototype.command = function(name){
+  var args = name.split(/ +/);
+  var cmd = new Command(args.shift());
+  this.commands.push(cmd);
+  cmd.parseExpectedArgs(args);
+  cmd.parent = this;
+  return cmd;
+};
+
+/**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parseExpectedArgs = function(args){
+  if (!args.length) return;
+  var self = this;
+  args.forEach(function(arg){
+    switch (arg[0]) {
+      case '<':
+        self.args.push({ required: true, name: arg.slice(1, -1) });
+        break;
+      case '[':
+        self.args.push({ required: false, name: arg.slice(1, -1) });
+        break;
+    }
+  });
+  return this;
+};
+
+/**
+ * Register callback `fn` for the command.
+ *
+ * Examples:
+ *
+ *      program
+ *        .command('help')
+ *        .description('display verbose help')
+ *        .action(function(){
+ *           // output help here
+ *        });
+ *
+ * @param {Function} fn
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.action = function(fn){
+  var self = this;
+  this.parent.on(this.name, function(args, unknown){    
+    // Parse any so-far unknown options
+    unknown = unknown || [];
+    var parsed = self.parseOptions(unknown);
+    
+    // Output help if necessary
+    outputHelpIfNecessary(self, parsed.unknown);
+    
+    // If there are still any unknown options, then we simply 
+    // die, unless someone asked for help, in which case we give it
+    // to them, and then we die.
+    if (parsed.unknown.length > 0) {      
+      self.unknownOption(parsed.unknown[0]);
+    }
+    
+    self.args.forEach(function(arg, i){
+      if (arg.required && null == args[i]) {
+        self.missingArgument(arg.name);
+      }
+    });
+    
+    // Always append ourselves to the end of the arguments,
+    // to make sure we match the number of arguments the user
+    // expects
+    if (self.args.length) {
+      args[self.args.length] = self;
+    } else {
+      args.push(self);
+    }
+    
+    fn.apply(this, args);
+  });
+  return this;
+};
+
+/**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`. 
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ *    "-p, --pepper"
+ *    "-p|--pepper"
+ *    "-p --pepper"
+ *
+ * Examples:
+ *
+ *     // simple boolean defaulting to false
+ *     program.option('-p, --pepper', 'add pepper');
+ *
+ *     --pepper
+ *     program.pepper
+ *     // => Boolean
+ *
+ *     // simple boolean defaulting to false
+ *     program.option('-C, --no-cheese', 'remove cheese');
+ *
+ *     program.cheese
+ *     // => true
+ *
+ *     --no-cheese
+ *     program.cheese
+ *     // => true
+ *
+ *     // required argument
+ *     program.option('-C, --chdir <path>', 'change the working directory');
+ *
+ *     --chdir /tmp
+ *     program.chdir
+ *     // => "/tmp"
+ *
+ *     // optional argument
+ *     program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @param {Function|Mixed} fn or default
+ * @param {Mixed} defaultValue
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.option = function(flags, description, fn, defaultValue){
+  var self = this
+    , option = new Option(flags, description)
+    , oname = option.name()
+    , name = camelcase(oname);
+
+  // default as 3rd arg
+  if ('function' != typeof fn) defaultValue = fn, fn = null;
+
+  // preassign default value only for --no-*, [optional], or <required>
+  if (false == option.bool || option.optional || option.required) {
+    // when --no-* we make sure default is true
+    if (false == option.bool) defaultValue = true;
+    // preassign only if we have a default
+    if (undefined !== defaultValue) self[name] = defaultValue;
+  }
+
+  // register the option
+  this.options.push(option);
+
+  // when it's passed assign the value
+  // and conditionally invoke the callback
+  this.on(oname, function(val){
+    // coercion
+    if (null != val && fn) val = fn(val);
+
+    // unassigned or bool
+    if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
+      // if no value, bool true, and we have a default, then use it!
+      if (null == val) {
+        self[name] = option.bool
+          ? defaultValue || true
+          : false;
+      } else {
+        self[name] = val;
+      }
+    } else if (null !== val) {
+      // reassign
+      self[name] = val;
+    }
+  });
+
+  return this;
+};
+
+/**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {Array} argv
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parse = function(argv){
+  // store raw args
+  this.rawArgs = argv;
+
+  // guess name
+  if (!this.name) this.name = basename(argv[1]);
+
+  // process argv
+  var parsed = this.parseOptions(this.normalize(argv.slice(2)));
+  this.args = parsed.args;
+  return this.parseArgs(this.args, parsed.unknown);
+};
+
+/**
+ * Normalize `args`, splitting joined short flags. For example
+ * the arg "-abc" is equivalent to "-a -b -c".
+ *
+ * @param {Array} args
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.normalize = function(args){
+  var ret = []
+    , arg;
+
+  for (var i = 0, len = args.length; i < len; ++i) {
+    arg = args[i];
+    if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
+      arg.slice(1).split('').forEach(function(c){
+        ret.push('-' + c);
+      });
+    } else {
+      ret.push(arg);
+    }
+  }
+
+  return ret;
+};
+
+/**
+ * Parse command `args`.
+ *
+ * When listener(s) are available those
+ * callbacks are invoked, otherwise the "*"
+ * event is emitted and those actions are invoked.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api private
+ */
+
+Command.prototype.parseArgs = function(args, unknown){
+  var cmds = this.commands
+    , len = cmds.length
+    , name;
+
+  if (args.length) {
+    name = args[0];
+    if (this.listeners(name).length) {
+      this.emit(args.shift(), args, unknown);
+    } else {
+      this.emit('*', args);
+    }
+  } else {
+    outputHelpIfNecessary(this, unknown);
+    
+    // If there were no args and we have unknown options,
+    // then they are extraneous and we need to error.
+    if (unknown.length > 0) {      
+      this.unknownOption(unknown[0]);
+    }
+  }
+
+  return this;
+};
+
+/**
+ * Return an option matching `arg` if any.
+ *
+ * @param {String} arg
+ * @return {Option}
+ * @api private
+ */
+
+Command.prototype.optionFor = function(arg){
+  for (var i = 0, len = this.options.length; i < len; ++i) {
+    if (this.options[i].is(arg)) {
+      return this.options[i];
+    }
+  }
+};
+
+/**
+ * Parse options from `argv` returning `argv`
+ * void of these options.
+ *
+ * @param {Array} argv
+ * @return {Array}
+ * @api public
+ */
+
+Command.prototype.parseOptions = function(argv){
+  var args = []
+    , len = argv.length
+    , literal
+    , option
+    , arg;
+
+  var unknownOptions = [];
+
+  // parse options
+  for (var i = 0; i < len; ++i) {
+    arg = argv[i];
+
+    // literal args after --
+    if ('--' == arg) {
+      literal = true;
+      continue;
+    }
+
+    if (literal) {
+      args.push(arg);
+      continue;
+    }
+
+    // find matching Option
+    option = this.optionFor(arg);
+
+    // option is defined
+    if (option) {
+      // requires arg
+      if (option.required) {
+        arg = argv[++i];
+        if (null == arg) return this.optionMissingArgument(option);
+        if ('-' == arg[0]) return this.optionMissingArgument(option, arg);
+        this.emit(option.name(), arg);
+      // optional arg
+      } else if (option.optional) {
+        arg = argv[i+1];
+        if (null == arg || '-' == arg[0]) {
+          arg = null;
+        } else {
+          ++i;
+        }
+        this.emit(option.name(), arg);
+      // bool
+      } else {
+        this.emit(option.name());
+      }
+      continue;
+    }
+    
+    // looks like an option
+    if (arg.length > 1 && '-' == arg[0]) {
+      unknownOptions.push(arg);
+      
+      // If the next argument looks like it might be
+      // an argument for this option, we pass it on.
+      // If it isn't, then it'll simply be ignored
+      if (argv[i+1] && '-' != argv[i+1][0]) {
+        unknownOptions.push(argv[++i]);
+      }
+      continue;
+    }
+    
+    // arg
+    args.push(arg);
+  }
+  
+  return { args: args, unknown: unknownOptions };
+};
+
+/**
+ * Argument `name` is missing.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.missingArgument = function(name){
+  console.error();
+  console.error("  error: missing required argument `%s'", name);
+  console.error();
+  process.exit(1);
+};
+
+/**
+ * `Option` is missing an argument, but received `flag` or nothing.
+ *
+ * @param {String} option
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.optionMissingArgument = function(option, flag){
+  console.error();
+  if (flag) {
+    console.error("  error: option `%s' argument missing, got `%s'", option.flags, flag);
+  } else {
+    console.error("  error: option `%s' argument missing", option.flags);
+  }
+  console.error();
+  process.exit(1);
+};
+
+/**
+ * Unknown option `flag`.
+ *
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.unknownOption = function(flag){
+  console.error();
+  console.error("  error: unknown option `%s'", flag);
+  console.error();
+  process.exit(1);
+};
+
+/**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {String} str
+ * @param {String} flags
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.version = function(str, flags){
+  if (0 == arguments.length) return this._version;
+  this._version = str;
+  flags = flags || '-V, --version';
+  this.option(flags, 'output the version number');
+  this.on('version', function(){
+    console.log(str);
+    process.exit(0);
+  });
+  return this;
+};
+
+/**
+ * Set the description `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.description = function(str){
+  if (0 == arguments.length) return this._description;
+  this._description = str;
+  return this;
+};
+
+/**
+ * Set / get the command usage `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.usage = function(str){
+  var args = this.args.map(function(arg){
+    return arg.required
+      ? '<' + arg.name + '>'
+      : '[' + arg.name + ']';
+  });
+
+  var usage = '[options'
+    + (this.commands.length ? '] [command' : '')
+    + ']'
+    + (this.args.length ? ' ' + args : '');
+  if (0 == arguments.length) return this._usage || usage;
+  this._usage = str;
+
+  return this;
+};
+
+/**
+ * Return the largest option length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestOptionLength = function(){
+  return this.options.reduce(function(max, option){
+    return Math.max(max, option.flags.length);
+  }, 0);
+};
+
+/**
+ * Return help for options.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.optionHelp = function(){
+  var width = this.largestOptionLength();
+  
+  // Prepend the help information
+  return [pad('-h, --help', width) + '  ' + 'output usage information']
+    .concat(this.options.map(function(option){
+      return pad(option.flags, width)
+        + '  ' + option.description;
+      }))
+    .join('\n');
+};
+
+/**
+ * Return command help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.commandHelp = function(){
+  if (!this.commands.length) return '';
+  return [
+      ''
+    , '  Commands:'
+    , ''
+    , this.commands.map(function(cmd){
+      var args = cmd.args.map(function(arg){
+        return arg.required
+          ? '<' + arg.name + '>'
+          : '[' + arg.name + ']';
+      }).join(' ');
+
+      return cmd.name 
+        + (cmd.options.length 
+          ? ' [options]'
+          : '') + ' ' + args
+        + (cmd.description()
+          ? '\n' + cmd.description()
+          : '');
+    }).join('\n\n').replace(/^/gm, '    ')
+    , ''
+  ].join('\n');
+};
+
+/**
+ * Return program help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.helpInformation = function(){
+  return [
+      ''
+    , '  Usage: ' + this.name + ' ' + this.usage()
+    , '' + this.commandHelp()
+    , '  Options:'
+    , ''
+    , '' + this.optionHelp().replace(/^/gm, '    ')
+    , ''
+    , ''
+  ].join('\n');
+};
+
+/**
+ * Prompt for a `Number`.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptForNumber = function(str, fn){
+  var self = this;
+  this.promptSingleLine(str, function parseNumber(val){
+    val = Number(val);
+    if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber);
+    fn(val);
+  });
+};
+
+/**
+ * Prompt for a `Date`.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptForDate = function(str, fn){
+  var self = this;
+  this.promptSingleLine(str, function parseDate(val){
+    val = new Date(val);
+    if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate);
+    fn(val);
+  });
+};
+
+/**
+ * Single-line prompt.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptSingleLine = function(str, fn){
+  if ('function' == typeof arguments[2]) {
+    return this['promptFor' + (fn.name || fn)](str, arguments[2]);
+  }
+
+  process.stdout.write(str);
+  process.stdin.setEncoding('utf8');
+  process.stdin.once('data', function(val){
+    fn(val.trim());
+  }).resume();
+};
+
+/**
+ * Multi-line prompt.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptMultiLine = function(str, fn){
+  var buf = [];
+  console.log(str);
+  process.stdin.setEncoding('utf8');
+  process.stdin.on('data', function(val){
+    if ('\n' == val || '\r\n' == val) {
+      process.stdin.removeAllListeners('data');
+      fn(buf.join('\n'));
+    } else {
+      buf.push(val.trimRight());
+    }
+  }).resume();
+};
+
+/**
+ * Prompt `str` and callback `fn(val)`
+ *
+ * Commander supports single-line and multi-line prompts.
+ * To issue a single-line prompt simply add white-space
+ * to the end of `str`, something like "name: ", whereas
+ * for a multi-line prompt omit this "description:".
+ *
+ *
+ * Examples:
+ *
+ *     program.prompt('Username: ', function(name){
+ *       console.log('hi %s', name);
+ *     });
+ *     
+ *     program.prompt('Description:', function(desc){
+ *       console.log('description was "%s"', desc.trim());
+ *     });
+ *
+ * @param {String|Object} str
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.prompt = function(str, fn){
+  var self = this;
+
+  if ('string' == typeof str) {
+    if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments);
+    this.promptMultiLine(str, fn);
+  } else {
+    var keys = Object.keys(str)
+      , obj = {};
+
+    function next() {
+      var key = keys.shift()
+        , label = str[key];
+
+      if (!key) return fn(obj);
+      self.prompt(label, function(val){
+        obj[key] = val;
+        next();
+      });
+    }
+
+    next();
+  }
+};
+
+/**
+ * Prompt for password with `str`, `mask` char and callback `fn(val)`.
+ *
+ * The mask string defaults to '', aka no output is
+ * written while typing, you may want to use "*" etc.
+ *
+ * Examples:
+ *
+ *     program.password('Password: ', function(pass){
+ *       console.log('got "%s"', pass);
+ *       process.stdin.destroy();
+ *     });
+ *
+ *     program.password('Password: ', '*', function(pass){
+ *       console.log('got "%s"', pass);
+ *       process.stdin.destroy();
+ *     });
+ *
+ * @param {String} str
+ * @param {String} mask
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.password = function(str, mask, fn){
+  var self = this
+    , buf = '';
+
+  // default mask
+  if ('function' == typeof mask) {
+    fn = mask;
+    mask = '';
+  }
+
+  process.stdin.resume();
+  tty.setRawMode(true);
+  process.stdout.write(str);
+
+  // keypress
+  process.stdin.on('keypress', function(c, key){
+    if (key && 'enter' == key.name) {
+      console.log();
+      process.stdin.removeAllListeners('keypress');
+      tty.setRawMode(false);
+      if (!buf.trim().length) return self.password(str, mask, fn);
+      fn(buf);
+      return;
+    }
+
+    if (key && key.ctrl && 'c' == key.name) {
+      console.log('%s', buf);
+      process.exit();
+    }
+
+    process.stdout.write(mask);
+    buf += c;
+  }).resume();
+};
+
+/**
+ * Confirmation prompt with `str` and callback `fn(bool)`
+ *
+ * Examples:
+ *
+ *      program.confirm('continue? ', function(ok){
+ *        console.log(' got %j', ok);
+ *        process.stdin.destroy();
+ *      });
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api public
+ */
+
+
+Command.prototype.confirm = function(str, fn, verbose){
+  var self = this;
+  this.prompt(str, function(ok){
+    if (!ok.trim()) {
+      if (!verbose) str += '(yes or no) ';
+      return self.confirm(str, fn, true);
+    }
+    fn(parseBool(ok));
+  });
+};
+
+/**
+ * Choice prompt with `list` of items and callback `fn(index, item)`
+ *
+ * Examples:
+ *
+ *      var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
+ *      
+ *      console.log('Choose the coolest pet:');
+ *      program.choose(list, function(i){
+ *        console.log('you chose %d "%s"', i, list[i]);
+ *        process.stdin.destroy();
+ *      });
+ *
+ * @param {Array} list
+ * @param {Number|Function} index or fn
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.choose = function(list, index, fn){
+  var self = this
+    , hasDefault = 'number' == typeof index;
+
+  if (!hasDefault) {
+    fn = index;
+    index = null;
+  }
+
+  list.forEach(function(item, i){
+    if (hasDefault && i == index) {
+      console.log('* %d) %s', i + 1, item);
+    } else {
+      console.log('  %d) %s', i + 1, item);
+    }
+  });
+
+  function again() {
+    self.prompt('  : ', function(val){
+      val = parseInt(val, 10) - 1;
+      if (hasDefault && isNaN(val)) val = index;
+
+      if (null == list[val]) {
+        again();
+      } else {
+        fn(val, list[val]);
+      }
+    });
+  }
+
+  again();
+};
+
+/**
+ * Camel-case the given `flag`
+ *
+ * @param {String} flag
+ * @return {String}
+ * @api private
+ */
+
+function camelcase(flag) {
+  return flag.split('-').reduce(function(str, word){
+    return str + word[0].toUpperCase() + word.slice(1);
+  });
+}
+
+/**
+ * Parse a boolean `str`.
+ *
+ * @param {String} str
+ * @return {Boolean}
+ * @api private
+ */
+
+function parseBool(str) {
+  return /^y|yes|ok|true$/i.test(str);
+}
+
+/**
+ * Pad `str` to `width`.
+ *
+ * @param {String} str
+ * @param {Number} width
+ * @return {String}
+ * @api private
+ */
+
+function pad(str, width) {
+  var len = Math.max(0, width - str.length);
+  return str + Array(len + 1).join(' ');
+}
+
+/**
+ * Output help information if necessary
+ *
+ * @param {Command} command to output help for
+ * @param {Array} array of options to search for -h or --help
+ * @api private
+ */
+
+function outputHelpIfNecessary(cmd, options) {
+  options = options || [];
+  for (var i = 0; i < options.length; i++) {
+    if (options[i] == '--help' || options[i] == '-h') {
+      process.stdout.write(cmd.helpInformation());
+      cmd.emit('--help');
+      process.exit(0);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/commander/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/commander/package.json b/lib/cordova-blackberry/blackberry10/node_modules/commander/package.json
new file mode 100644
index 0000000..f27a374
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/commander/package.json
@@ -0,0 +1,38 @@
+{
+  "name": "commander",
+  "version": "0.5.2",
+  "description": "the complete solution for node.js command-line programs",
+  "keywords": [
+    "command",
+    "option",
+    "parser",
+    "prompt",
+    "stdin"
+  ],
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/visionmedia/commander.js.git"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "should": ">= 0.0.1"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "main": "index",
+  "engines": {
+    "node": ">= 0.4.x"
+  },
+  "readme": "# Commander.js\n\n  The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n    $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n  .version('0.0.1')\n  .option('-p, --peppers', 'Add peppers')\n  .option('-P, --pineapple', 'Add pineapple')\n  .option('-b, --bbq', 'Add bbq sauce')\n  .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]'
 , 'marble')\n  .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log('  - peppers');\nif (program.pineapple) console.log('  - pineappe');\nif (program.bbq) console.log('  - bbq');\nconsole.log('  - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n```  \n $ ./examples/pizza --help\n\n   Usage: pizza [options]\n\n   Options:\n\n     -V, --version        output the version number\n     -p, --peppers        Add peppers\n     -P, --pineapple      Add pineappe\n     -b, --bbq            Add bbq sauce\n     -c, --cheese <type>  Add the specified type of cheese [marble]\n     -h, --he
 lp           output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n  return val.split('..').map(Number);\n}\n\nfunction list(val) {\n  return val.split(',');\n}\n\nprogram\n  .version('0.0.1')\n  .usage('[options] <file ...>')\n  .option('-i, --integer <n>', 'An integer argument', parseInt)\n  .option('-f, --float <n>', 'A float argument', parseFloat)\n  .option('-r, --range <a>..<b>', 'A range', range)\n  .option('-l, --list <items>', 'A list', list)\n  .option('-o, --optional [value]', 'An optional value')\n  .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\"
 . Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n  return val.split(',').map(Number);\n}\n\nprogram\n  .version('0.0.1')\n  .option('-f, --foo', 'enable some foo')\n  .option('-b, --bar', 'enable some bar')\n  .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n  console.log('  Examples:');\n  console.log('');\n  console.log('    $ custom-help --help');\n  console.log('    $ custom-help -h');\n  console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n  -h, --help    
  output usage information\n  -V, --version  output the version number\n  -f, --foo      enable some foo\n  -b, --bar      enable some bar\n  -B, --baz      enable some baz\n\nExamples:\n\n  $ custom-help --help\n  $ custom-help -h\n\n```\n\n## .prompt(msg, fn)\n\n Single-line prompt:\n\n```js\nprogram.prompt('name: ', function(name){\n  console.log('hi %s', name);\n});\n```\n\n Multi-line prompt:\n\n```js\nprogram.prompt('description:', function(name){\n  console.log('hi %s', name);\n});\n```\n\n Coercion:\n\n```js\nprogram.prompt('Age: ', Number, function(age){\n  console.log('age: %j', age);\n});\n```\n\n```js\nprogram.prompt('Birthdate: ', Date, function(date){\n  console.log('date: %s', date);\n});\n```\n\n## .password(msg[, mask], fn)\n\nPrompt for password without echoing:\n\n```js\nprogram.password('Password: ', function(pass){\n  console.log('got \"%s\"', pass);\n  process.stdin.destroy();\n});\n```\n\nPrompt for password with mask char \"*\":\n\n```js\nprogram.password('Pas
 sword: ', '*', function(pass){\n  console.log('got \"%s\"', pass);\n  process.stdin.destroy();\n});\n```\n\n## .confirm(msg, fn)\n\n Confirm with the given `msg`:\n\n```js\nprogram.confirm('continue? ', function(ok){\n  console.log(' got %j', ok);\n});\n```\n\n## .choose(list, fn)\n\n Let the user choose from a `list`:\n\n```js\nvar list = ['tobi', 'loki', 'jane', 'manny', 'luna'];\n\nconsole.log('Choose the coolest pet:');\nprogram.choose(list, function(i){\n  console.log('you chose %d \"%s\"', i, list[i]);\n});\n```\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission
  is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.",
+  "readmeFilename": "Readme.md",
+  "_id": "commander@0.5.2",
+  "dist": {
+    "shasum": "f270326709a115a126cfed5623852439b8e4a3b5"
+  },
+  "_from": "commander@0.5.2"
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/.npmignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/.npmignore b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/.npmignore
new file mode 100644
index 0000000..b4a9d1d
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/.npmignore
@@ -0,0 +1 @@
+.redcar

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/LICENSE b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/LICENSE
new file mode 100644
index 0000000..b6cd384
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/LICENSE
@@ -0,0 +1,9 @@
+** Licensed Under **
+
+The MIT License
+http://www.opensource.org/licenses/mit-license.php
+
+Copyright (c) 2010 all contributors:
+
+Gord Tanner
+tinyHippos Inc.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/README.md b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/README.md
new file mode 100644
index 0000000..8f420b1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/README.md
@@ -0,0 +1,170 @@
+# jWorkflow
+Dude, where is my workflow?
+
+jWorkflow is a workflow engine for JavaScript that provides the ability to
+create workflows to chain methods together in an easy to understand syntax:
+
+    var fooodOrder = jWorkflow.order(garlicChicken)
+                              .andThen(whiteRice)
+                              .andThen(wontonSoup)
+                              .andThen(cookiesFortune)
+                              .andThen(noAndThen)
+                              .andThen(noAndThen)
+                              .andThen(noAndThen)
+                              .andThen(noAndThen);
+
+    fooodOrder.start();
+
+# Install
+
+jWorkflow can be used in node or included in the browser.  It can be installed with npm
+
+    npm install jWorkflow
+
+and used
+
+    var jWorkflow = require("jWorkflow");
+
+or just include jWorkflow.js in your webpage and use window.jWorkflow.
+
+# Usage
+
+jWorkflow orders are started with a call to jWorkflow.order:
+
+    function dude() {
+        // some of the best code in the world will live here
+    }
+
+    var order = jWorkflow.order(dude);
+
+    // orders can also be started with no initial function
+    var pizzacoli = jWorkflow.order();
+
+jWorkflow tasks at the root are just functions that will be invoked in the order they are built.
+Any number of tasks can be then appended to the order:
+
+    order.andThen(sweet).andThen(dude).andThen(sweet);
+
+The functions passed into the order will not be invoked until you call:
+
+    order.start();
+
+The context to be used when invoking the functions can be passed in while creating the order:
+
+    order.andThen(transfunctioner.photonAcceleratorAnnihilationBeam, transfunctioner);
+
+An initial value can be passed into the start method to seed the first function:
+
+    order.start({
+        initialValue: 10
+    });
+
+# Passing Values between tasks
+
+jWorkflow tasks can access the return value of the previous task with the previous parameter:
+
+    function meaningOfLife() {
+       //find the meaning of life
+       return 42; 
+    }
+    
+    function writeBook(previous) {
+       console.log("the meaning of life is " + previous);
+    }
+
+    var guide = jWorkflow.order(meaningOfLife).andThen(writeBook);
+    guide.start();
+
+# Handling Async calls
+
+Sometimes(probably all the time) you will need to do something async when working with
+tasks, jWorkflow provides the ability to control the execution of the workflow via a
+baton that is passed to the task
+
+    function procrastinate(previous, baton) {
+        //take the baton, this means the next task will not run until you pass the baton
+        baton.take();
+
+        window.setTimeout(function() {
+            //do some stuff
+
+            //please be nice and always remember to pass the baton!
+            baton.pass();
+        }, 1000);
+    }
+
+If you want to pass a return value to the next task you can pass it along with the
+baton.
+
+NOTE: if you did take the baton, the return value from your function will NOT be passed to 
+the next task:
+
+    function awesometown(previous, baton) {
+        baton.take();
+
+        window.setTimeout(function() {
+            
+            //do stuff
+            
+            baton.pass(420);    //This value will be passed to the next task
+        }, 100);
+
+        return 50; // this will NOT be passed to the next function since you took the baton.
+    }
+
+
+the start method provides a callback to execute when the workflow is finished.  The final
+return value is also passed to the callback:
+
+   order.start({
+       callback: function(review) {
+               console.log("dude!, your car is behind that mail truck!");
+               expect(review).toBe("two thumbs up");
+       }
+   });
+
+you can also pass context to use for the callback:
+
+   order.start({
+       callback: function() {
+           //do stuff
+       }, 
+       context: transfunctioner
+   });
+    
+# Waiting between tasks
+
+If you ever need to take a break and reflect on the moment you can add some time(in ms) to chill between tasks:
+
+    jWorkflow.order(seeDoubleRainbow)
+             .chill(1000)
+             .andThen(omg)
+             .andThen(omg)
+             .andThen(omg)
+             .chill(1000)
+             .andThen(freakOut);
+
+# Handling Parallel tasks
+
+If you need to handle some tasks and don't care about when they are done you can pass in an array of functions and / or other workflows to execute
+at the same time.
+
+    jWorkflow.order([man, man, halfMan])
+             .andThen([jWorkflow.order([guy, guy]).andThen(girl), pizzaPlace]);
+
+# Canceling Workflows
+
+To cancel the execution of the workflow you can call the drop method on the baton:
+
+    function (previous, baton) {
+        //the value passed to drop will be passed onto the final callback if it exists
+        baton.drop("I dropped the soap");
+        //this value will NOT be passed to the next workflow step
+        return 10;
+    }
+
+NOTE: This will force the workflow into async mode.
+
+# Contributers:
+
+    Gord Tanner <gt...@gmail.com>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/Rakefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/Rakefile b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/Rakefile
new file mode 100644
index 0000000..eb6b859
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/Rakefile
@@ -0,0 +1,12 @@
+require 'rubygems'
+require 'closure-compiler'
+
+task :default => [:build]
+
+desc "Use the Closure Compiler to compress jWorkflow.js"
+task :build do
+  js  = File.open('lib/jWorkflow.js', 'r')
+  min = Closure::Compiler.new.compile(js)
+  File.open('jworkflow-min-0.7.0.js', 'w') {|f| f.write(min) }
+end
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/jworkflow-min-0.8.0.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/jworkflow-min-0.8.0.js b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/jworkflow-min-0.8.0.js
new file mode 100644
index 0000000..a448d51
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/jworkflow-min-0.8.0.js
@@ -0,0 +1,3 @@
+var jWorkflow=function(){return{order:function(j,k){var f=[],g,h=null,i=function(){var a=false;return{take:function(){a=true},pass:function(b){var c;a=false;g.length?(c=g.shift(),b=c.func.apply(c.context,[b,i]),a||i.pass(b)):h.func&&h.func.apply(h.context,[b])},drop:function(b){a=true;g=[];setTimeout(function(){i.pass(b)},1)}}}(),e={andThen:function(a,b){if(typeof a.andThen==="function"&&typeof a.start==="function"&&typeof a.chill==="function")f.push({func:function(c,d){d.take();a.start({callback:function(a){d.pass(a)},
+context:b,initialValue:c})},context:b});else if(a.map&&a.reduce)f.push({func:function(b,d){d.take();var f=a.length,g=function(){return--f||d.pass()};a.forEach(function(a){jWorkflow.order(a).start(g)})},context:b});else{if(typeof a!=="function")throw"expected function but was "+typeof a;f.push({func:a,context:b})}return e},chill:function(a){return e.andThen(function(b,c){c.take();setTimeout(function(){c.pass(b)},a)})},start:function(a,b){var c,d,e;a&&typeof a==="object"?(c=a.callback,d=a.context,e=
+a.initialValue):(c=a,d=b);h={func:c,context:d};g=f.slice();i.pass(e)}};return j?e.andThen(j,k):e}}}();if(typeof module==="object"&&typeof require==="function")module.exports=jWorkflow;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/lib/jWorkflow.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/lib/jWorkflow.js b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/lib/jWorkflow.js
new file mode 100644
index 0000000..36380d5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/lib/jWorkflow.js
@@ -0,0 +1,140 @@
+// jWorkflow.js
+// (c) 2010 tinyHippos inc.
+// jWorkflow is freely distributable under the terms of the MIT license.
+// Portions of jWorkflow are inspired by Underscore.js
+var jWorkflow = (function () {
+    function _valid(func) {
+        if (typeof(func) !== 'function') {
+            throw "expected function but was " + typeof(func);
+        }
+    }
+
+    function _isWorkflow(func) {
+        return typeof func.andThen === 'function' &&
+               typeof func.start === 'function' &&
+               typeof func.chill === 'function';
+    }
+
+    function _isArray(func) {
+        return !!func.map && !!func.reduce;
+    }
+
+    var transfunctioner =  {
+        order: function (func, context) {
+            var _workflow = [],
+                _tasks,
+                _callback = null,
+                _baton = (function () {
+                    var _taken = false; 
+                    return {
+
+                        take: function () {
+                            _taken = true;
+                        },
+
+                        pass: function (result) {
+                            var task;
+                            _taken = false;
+
+                            if (_tasks.length) {
+                                task = _tasks.shift();
+                                result = task.func.apply(task.context, [result, _baton]);
+
+                                if (!_taken) {
+                                    _baton.pass(result);
+                                }
+                            }
+                            else { 
+                                if (_callback.func) {
+                                    _callback.func.apply(_callback.context, [result]);
+                                }
+                            }
+                        },
+
+                        drop: function (result) {
+                            _taken = true;
+                            _tasks = [];
+                            setTimeout(function () {
+                                _baton.pass(result);
+                            }, 1);
+                        }
+                    };
+                }()),
+                _self = {
+
+                    andThen: function (func, context) {
+                        if (_isWorkflow(func)) {
+                            var f = function (prev, baton) {
+                                baton.take();
+                                func.start({
+                                    callback: function (result) {
+                                        baton.pass(result);
+                                    }, 
+                                    context: context, 
+                                    initialValue: prev
+                                });
+                            };
+                            _workflow.push({func: f, context: context});
+                        }
+                        else if (_isArray(func)) {
+                            var orch = function (prev, baton) {
+                                baton.take();
+
+                                var l = func.length,
+                                    join = function () {
+                                        return --l || baton.pass();
+                                    };
+
+                                func.forEach(function (f) {
+                                    jWorkflow.order(f).start(join);
+                                });
+                            };
+                            _workflow.push({func: orch, context: context});
+                        }
+                        else {
+                            _valid(func);
+                            _workflow.push({func: func, context: context});
+                        }
+                        return _self;
+                    },
+
+                    chill: function (time) {
+                        return _self.andThen(function (prev, baton) {
+                            baton.take();
+                            setTimeout(function () {
+                                baton.pass(prev);
+                            }, time);
+                        });
+                    },
+
+                    start: function () {
+                        var callback,
+                            context,
+                            initialValue;
+
+                        if (arguments[0] && typeof arguments[0] === 'object') {
+                            callback = arguments[0].callback;
+                            context = arguments[0].context;
+                            initialValue = arguments[0].initialValue;
+                        }
+                        else {
+                            callback = arguments[0];
+                            context = arguments[1];
+                        }
+
+                        _callback = {func: callback, context: context};
+                        _tasks = _workflow.slice();
+                        _baton.pass(initialValue);
+                    }
+                };
+
+            return func ? _self.andThen(func, context) : _self;
+        }
+    };
+
+    return transfunctioner;
+}());
+
+if (typeof module === "object" && typeof require === "function") {
+    module.exports = jWorkflow;
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/package.json b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/package.json
new file mode 100644
index 0000000..7684baa
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/package.json
@@ -0,0 +1,27 @@
+{
+  "name": "jWorkflow",
+  "version": "0.8.0",
+  "description": "dude, wheres my workflow?",
+  "homepage": "https://github.com/tinyhippos/jWorkflow",
+  "author": {
+    "name": "gtanner"
+  },
+  "contributors": [
+    {
+      "name": "Gord Tanner",
+      "email": "gtanner@gmail.com",
+      "url": "http://github.com/gtanner"
+    }
+  ],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": ""
+    }
+  ],
+  "main": "./lib/jWorkflow",
+  "readme": "# jWorkflow\nDude, where is my workflow?\n\njWorkflow is a workflow engine for JavaScript that provides the ability to\ncreate workflows to chain methods together in an easy to understand syntax:\n\n    var fooodOrder = jWorkflow.order(garlicChicken)\n                              .andThen(whiteRice)\n                              .andThen(wontonSoup)\n                              .andThen(cookiesFortune)\n                              .andThen(noAndThen)\n                              .andThen(noAndThen)\n                              .andThen(noAndThen)\n                              .andThen(noAndThen);\n\n    fooodOrder.start();\n\n# Install\n\njWorkflow can be used in node or included in the browser.  It can be installed with npm\n\n    npm install jWorkflow\n\nand used\n\n    var jWorkflow = require(\"jWorkflow\");\n\nor just include jWorkflow.js in your webpage and use window.jWorkflow.\n\n# Usage\n\njWorkflow orders are started with a call to jWorkflow.order:\n
 \n    function dude() {\n        // some of the best code in the world will live here\n    }\n\n    var order = jWorkflow.order(dude);\n\n    // orders can also be started with no initial function\n    var pizzacoli = jWorkflow.order();\n\njWorkflow tasks at the root are just functions that will be invoked in the order they are built.\nAny number of tasks can be then appended to the order:\n\n    order.andThen(sweet).andThen(dude).andThen(sweet);\n\nThe functions passed into the order will not be invoked until you call:\n\n    order.start();\n\nThe context to be used when invoking the functions can be passed in while creating the order:\n\n    order.andThen(transfunctioner.photonAcceleratorAnnihilationBeam, transfunctioner);\n\nAn initial value can be passed into the start method to seed the first function:\n\n    order.start({\n        initialValue: 10\n    });\n\n# Passing Values between tasks\n\njWorkflow tasks can access the return value of the previous task with the previous pa
 rameter:\n\n    function meaningOfLife() {\n       //find the meaning of life\n       return 42; \n    }\n    \n    function writeBook(previous) {\n       console.log(\"the meaning of life is \" + previous);\n    }\n\n    var guide = jWorkflow.order(meaningOfLife).andThen(writeBook);\n    guide.start();\n\n# Handling Async calls\n\nSometimes(probably all the time) you will need to do something async when working with\ntasks, jWorkflow provides the ability to control the execution of the workflow via a\nbaton that is passed to the task\n\n    function procrastinate(previous, baton) {\n        //take the baton, this means the next task will not run until you pass the baton\n        baton.take();\n\n        window.setTimeout(function() {\n            //do some stuff\n\n            //please be nice and always remember to pass the baton!\n            baton.pass();\n        }, 1000);\n    }\n\nIf you want to pass a return value to the next task you can pass it along with the\nbaton.\n\nNO
 TE: if you did take the baton, the return value from your function will NOT be passed to \nthe next task:\n\n    function awesometown(previous, baton) {\n        baton.take();\n\n        window.setTimeout(function() {\n            \n            //do stuff\n            \n            baton.pass(420);    //This value will be passed to the next task\n        }, 100);\n\n        return 50; // this will NOT be passed to the next function since you took the baton.\n    }\n\n\nthe start method provides a callback to execute when the workflow is finished.  The final\nreturn value is also passed to the callback:\n\n   order.start({\n       callback: function(review) {\n               console.log(\"dude!, your car is behind that mail truck!\");\n               expect(review).toBe(\"two thumbs up\");\n       }\n   });\n\nyou can also pass context to use for the callback:\n\n   order.start({\n       callback: function() {\n           //do stuff\n       }, \n       context: transfunctioner\n   })
 ;\n    \n# Waiting between tasks\n\nIf you ever need to take a break and reflect on the moment you can add some time(in ms) to chill between tasks:\n\n    jWorkflow.order(seeDoubleRainbow)\n             .chill(1000)\n             .andThen(omg)\n             .andThen(omg)\n             .andThen(omg)\n             .chill(1000)\n             .andThen(freakOut);\n\n# Handling Parallel tasks\n\nIf you need to handle some tasks and don't care about when they are done you can pass in an array of functions and / or other workflows to execute\nat the same time.\n\n    jWorkflow.order([man, man, halfMan])\n             .andThen([jWorkflow.order([guy, guy]).andThen(girl), pizzaPlace]);\n\n# Canceling Workflows\n\nTo cancel the execution of the workflow you can call the drop method on the baton:\n\n    function (previous, baton) {\n        //the value passed to drop will be passed onto the final callback if it exists\n        baton.drop(\"I dropped the soap\");\n        //this value will NOT be
  passed to the next workflow step\n        return 10;\n    }\n\nNOTE: This will force the workflow into async mode.\n\n# Contributers:\n\n    Gord Tanner <gt...@gmail.com>\n",
+  "readmeFilename": "README.md",
+  "_id": "jWorkflow@0.8.0",
+  "_from": "jWorkflow@*"
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test.html b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test.html
new file mode 100644
index 0000000..75e581b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>jWorkflow Test Suite</title>
+  <link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
+  <script type="text/javascript" src="vendor/jquery.js"></script>
+  <script type="text/javascript" src="vendor/qunit.js"></script>
+  <script type="text/javascript" src="../lib/jWorkflow.js"></script>
+  <script type="text/javascript" src="test_jworkflow.js"></script>
+</head>
+    <body>
+      <h1 id="qunit-header">jWorkflow Test Suite</h1>
+      <h2 id="qunit-banner"></h2>
+      <h2 id="qunit-userAgent"></h2>
+      <ol id="qunit-tests"></ol>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test_jworkflow.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test_jworkflow.js b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test_jworkflow.js
new file mode 100644
index 0000000..afb13a2
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/test_jworkflow.js
@@ -0,0 +1,521 @@
+$(document).ready(function () {
+    module("jWorkflow ordering and starting workflows");
+
+    test("jWorkflow: we can place an order", function () {
+        expect(1);
+        var order = jWorkflow.order(function () {});
+        ok(order, "we should have an order");
+    });
+
+    test("jWorkflow: order throws an error when not given a function", function () {
+        expect(1);
+        var errored = false;
+        try {
+            jWorkflow.order(42);
+        } 
+        catch (ex) {
+            errored = true;
+        }
+
+        ok(errored, "expected an error");
+
+    });
+
+    test("jWorkflow: we can call andThen on the return value of order", function () {
+        expect(2);
+
+        var transfunctioner = function () { },
+            order = jWorkflow.order(transfunctioner);
+        
+        ok(order.andThen, "expected to be asked: 'andThen'");
+        equals(typeof(order.andThen), "function", "expected andThen to be a function");
+    });
+
+    test("jWorkflow: andThen throws an error when not given a function", function () {
+        expect(1);
+
+        var errored = false;
+        try {
+            jWorkflow.order(function () {}).andThen(42);
+        } 
+        catch (ex) {
+            errored = true;
+        }
+
+        ok(errored, "expected an error");
+        
+    });
+
+    test("jWorkflow: we can call andThen on the return value of andThen", function () {
+        expect(2);
+
+        var garlicChicken = function () {},
+            whiteRice = function () {},
+            wontonSoup = function () {},
+            cookiesFortune = function () {},
+            noAndThen = function () {},
+            order = jWorkflow.order(garlicChicken)
+                            .andThen(whiteRice)
+                            .andThen(wontonSoup)
+                            .andThen(cookiesFortune);
+        
+        order.andThen(noAndThen).andThen(noAndThen);
+
+        ok(order.andThen, "expected to be asked: 'andThen'");
+        equals(typeof(order.andThen), "function", "expected andThen to be a function");
+
+    });
+
+    test("jWorkflow: it doesnt invoke the order function when start isnt called", function () {
+        var dude = true,
+            sweet = function () { 
+                dude = false; 
+            },
+            order = jWorkflow.order(sweet);
+
+        ok(dude, "expected sweet to have not been invoked");
+        
+    });
+
+    test("jWorkflow: it calls the order function when start is called", function () {
+        var dude = false,
+            sweet = function () { 
+                dude = true; 
+            },
+            order = jWorkflow.order(sweet);
+
+        order.start();
+
+        ok(dude, "expected sweet to have been invoked");
+    });
+
+    asyncTest("jWorkflow: it can handle multiple orders without mixing them", function () {
+        expect(1);
+        var dude = false,
+            what = false,
+            sweet = function () { 
+                dude = true; 
+            },
+            whatup = function () { 
+                what = true; 
+            },
+            order = jWorkflow.order(sweet),
+            order2 = jWorkflow.order(whatup);
+
+
+        order.start(function () {
+            start();
+            ok(what === false, "whatup shouldn't have been called");
+        });
+    });
+
+    test("jWorkflow: it calls the order in the order that it was built", function () {
+        expect(1);
+
+        var result = [], 
+            garlicChicken = function () { 
+                result.push("garlicChicken"); 
+            },
+            whiteRice = function () { 
+                result.push("whiteRice"); 
+            },
+            wontonSoup = function () { 
+                result.push("wontonSoup"); 
+            },
+            cookiesFortune = function () { 
+                result.push("cookiesFortune"); 
+            },
+            noAndThen = function () { 
+                result.push("noAndThen"); 
+            },
+            order = jWorkflow.order(garlicChicken)
+                            .andThen(whiteRice)
+                            .andThen(wontonSoup)
+                            .andThen(cookiesFortune);
+        
+        order.andThen(noAndThen).andThen(noAndThen);
+
+        order.start();
+
+        same(["garlicChicken", "whiteRice", "wontonSoup", "cookiesFortune", "noAndThen", "noAndThen"], result, "expected functions to be called in order");
+    });
+
+    test("jWorkflow: it get the return value of the previous func", function () {
+
+        var dude = function () { 
+                return 42; 
+            },
+            sweet = function (previous) { 
+                equals(previous, 42, "expected previous to be return value"); 
+            },
+            order = jWorkflow.order(dude).andThen(sweet);
+
+        order.start();
+
+    });
+
+    test("jWorkflow: we get a baton play with", function () {
+        var order = jWorkflow.order(function (previous, baton) {
+            ok(baton, "expected a baton");
+            ok(baton.take, "expected to be able to take the baton");
+            ok(baton.pass, "expected to be able to pass the baton");
+        });
+
+        order.start();
+
+    });
+
+    test("jWorkflow: when I take the baton, the next methods are not called if I don't pass it", function () {
+        var transfunctioner = true,
+        dude = function () {},
+        sweet = function () {},
+        noAndThen = function (previous, baton) {
+            baton.take();
+        },
+        fortuneCookie = function () { 
+            transfunctioner = false; 
+        },
+        order = jWorkflow.order(dude).andThen(sweet).andThen(noAndThen).andThen(fortuneCookie);
+
+        order.start();
+
+        ok(transfunctioner, "fortune Cookie should not have been called because we took the baton and didn't pass it");
+    });
+
+    asyncTest("jWorkflow: when I take the baton and pass it async, the next methods are called", function () {
+        expect(1);
+        var transfunctioner = false,
+        dude = function () {},
+        sweet = function () {},
+        noAndThen = function (previous, baton) {
+            baton.take();
+            window.setTimeout(function () {
+                baton.pass();
+            }, 10);
+        },
+        fortuneCookie = function () { 
+            transfunctioner = true; 
+        },
+        order = jWorkflow.order(dude).andThen(sweet).andThen(noAndThen).andThen(fortuneCookie);
+
+        order.start(function () {
+            start();
+            ok(transfunctioner, "fortune Cookie should have been called because we passed the baton");
+        });
+
+    });
+
+    asyncTest("jWorkflow: it calls the order in the order that it was built, even with Async calls", function () {
+        expect(1);
+
+        var result = [], 
+            procrastinate = function (msg, baton) { 
+                baton.take();
+                window.setTimeout(function () {
+                    result.push(msg); 
+                    baton.pass();
+                }, 10);
+            },
+            garlicChicken = function (previous, baton) { 
+                procrastinate("garlicChicken", baton); 
+            },
+            whiteRice = function (previous, baton) { 
+                result.push("whiteRice");
+            },
+            wontonSoup = function (previous, baton) { 
+                procrastinate("wontonSoup", baton); 
+            },
+            cookiesFortune = function (previous, baton) { 
+                result.push("cookiesFortune"); 
+            },
+            noAndThen = function (previous, baton) { 
+                procrastinate("noAndThen", baton); 
+            },
+            order = jWorkflow.order(garlicChicken)
+                            .andThen(whiteRice)
+                            .andThen(wontonSoup)
+                            .andThen(cookiesFortune);
+        
+        order.andThen(noAndThen).andThen(noAndThen);
+
+        order.start(function () {
+            start();
+            same(result, ["garlicChicken", "whiteRice", "wontonSoup", "cookiesFortune", "noAndThen", "noAndThen"], "expected functions to be called in order");
+        });
+    });
+
+    test("jWorkflow: we can give context for the function passed to andThen", function () {
+        expect(1);
+
+        var zoltan = {
+                toMyParentsMinivan: function () {
+                    ok(this.getCultMembers, "expected to be able to get the cult members");
+                },
+
+                getCultMembers: function () {
+                    return ["Zarnoff", "Zabu", "Zellnor", "Zelbor", "Zelmina", "Jeff"];
+                }
+            },
+            order = jWorkflow.order(zoltan.toMyParentsMinivan, zoltan);
+
+        order.start();
+    });
+
+    test("jWorkflow, we can pass in a different context for each function", function () {
+        expect(2);
+        
+        var jesse = { 
+                smokeyMcPot: true,
+                test: function () {
+                    ok(this.smokeyMcPot, "I should be SmokeyMcPot");
+                }
+            },
+            chester = {
+                johnnyPotsmoker: true,
+                test: function () {
+                    ok(this.johnnyPotsmoker, "I should be Johnny Potsmoker");
+                }
+            },
+            order = jWorkflow.order(jesse.test, jesse)
+                             .andThen(chester.test, chester);
+
+         
+        order.start();
+
+
+    });
+
+    test("jWorkflow: we can pass context into start", function () {
+        expect(1);
+
+        var jesse = { 
+                smokeyMcPot: true,
+                test: function () {
+                    ok(this.smokeyMcPot, "I should be SmokeyMcPot");
+                }
+            },
+            order = jWorkflow.order();
+
+        order.start(jesse.test, jesse);
+    });
+
+    test("jWorkflow, we can pass null into order", function () {
+        expect(1);
+
+        var order = jWorkflow.order();
+
+        ok(order, "expected to have an order when not passing in an initial function");
+    });
+
+    test("jWorkflow, we can NOT pass null into andThen", function () {
+        expect(1);
+        var errored = false,
+            order = jWorkflow.order();
+
+        try {
+            order.andThen();
+        } 
+        catch (ex) {
+            errored = true;
+        }
+
+        ok(errored, "expected an exception when calling andThen with no order");
+    });
+
+    asyncTest("jWorkflow, we can pass a return value from an async function into a sync function via the baton", function () {
+        expect(1);
+       
+        var correct,
+            was,
+            order = jWorkflow.order(function (previous, baton) {
+                baton.take();
+                setTimeout(function () {
+                    baton.pass(420);
+                }, 10);
+
+                return 11;
+
+            }).andThen(function (answer) {
+                was = answer;
+                correct = answer === 420;
+            });
+
+        order.start(function () {
+            start();
+            ok(correct, "expected it to be 420 but was " + was);
+        });
+    });
+
+    asyncTest("jWorkflow, we can reuse an order", function () {
+        expect(1);
+
+        var sheep_teleported = 0,
+            teleport = function () {
+                sheep_teleported += 1;
+            },
+            order = jWorkflow.order(teleport).andThen(teleport);
+
+
+        order.start(function () {
+            order.start(function () {
+                start();
+                equals(sheep_teleported, 4, "expected to teleport 4 sheep");
+            });
+        });
+    });
+
+    asyncTest("jWorkflow, we can chill for a little bit between tasks", function () {
+        var time = [],
+            inhale = function () {
+                time.push(new Date());
+            },
+            exhale = inhale;
+
+        jWorkflow.order(inhale).chill(100).andThen(exhale).start(function () {
+            start();
+            var chilled = time[1] - time[0];
+            ok(chilled > 50, "expected to chill a little bit between tasks: " + chilled);
+        });
+    });
+
+    test("jWorkflow, it passes the final result to the callback passed to start", function () {
+        expect(1);
+        var plus1 = function (prev) {
+                return prev + 1;
+            };
+
+        jWorkflow.order(function () {
+                    return 0;
+                 })
+                 .andThen(plus1)
+                 .andThen(plus1)
+                 .start(function (result) {
+                     equals(2, result);
+                 });
+    });
+
+    test("jWorkflow, we can pass the initial value into start", function () {
+        expect(1);
+
+        jWorkflow.order().andThen(function (prev) {
+            equals(5, prev);
+        }).start({
+            initialValue: 5
+        });
+    });
+
+    asyncTest("jWorkflow, we can pass another workflow into andThen", function () {
+        expect(1);
+       
+        var plus1 = function (prev) {
+                return prev + 1;
+            },
+            plus4 = function (prev, baton) {
+                baton.take();
+                setTimeout(function () {
+                    baton.pass(prev + 4);
+                }, 10);
+            },
+            addTen = jWorkflow.order(plus4).andThen(plus1).andThen(plus4).andThen(plus1),
+            addFive = jWorkflow.order(plus4).andThen(plus1);
+
+        jWorkflow.order()
+                 .andThen(addTen)
+                 .andThen(addTen)
+                 .andThen(addFive)
+                 .start({
+                    callback: function (result) {
+                        start();
+                        equals(result, 25);
+                    },
+                    initialValue: 0
+                 });
+    });
+
+    asyncTest("jWorkflow, we can pass an array of functions into andThen", function () {
+        expect(1);
+
+        var x = "",
+            w = function (letter, delay) {
+                return function (prev, baton) {
+                    if (delay) {
+                        baton.take();
+                        window.setTimeout(function () {
+                            x += letter;
+                            baton.pass();
+                        }, delay);
+                    }
+                    else {
+                        x += letter;
+                    }
+                };
+            };
+
+        jWorkflow.order(w("d"))
+                 .andThen([w("U", 100), w("u", 10), w("u")])
+                 .andThen(w("de"))
+                 .start(function () {
+                     start();
+                     equals(x, "duuUde");
+                 });
+
+    });
+
+    asyncTest("jWorkflow, we can pass an array of workflows into andThen", function () {
+        expect(1);
+
+        var x = "",
+            w = function (letter, delay) {
+                return function (prev, baton) {
+                    if (delay) {
+                        baton.take();
+                        window.setTimeout(function () {
+                            x += letter;
+                            baton.pass();
+                        }, delay);
+                    }
+                    else {
+                        x += letter;
+                    }
+                };
+            };
+
+        jWorkflow.order(jWorkflow.order(w("s")))
+                 .andThen([jWorkflow.order(w("w", 1)).andThen(w("e")), jWorkflow.order(w("e", 30))])
+                 .andThen(w("et"))
+                 .start(function () {
+                     start();
+                     equals(x, "sweeet");
+                 });
+    });
+
+    asyncTest("jWorkflow, we can stop execution of a workflow with baton.drop", function () {
+        expect(2);
+
+        var inc = function (prev, baton) {
+                if (prev >= 3) {
+                    baton.drop(prev);
+                }
+                return ++prev;
+            },
+            protected = false;
+
+        jWorkflow.order(inc)
+                 .andThen(inc)
+                 .andThen(inc)
+                 .andThen(inc)
+                 .andThen(inc)
+                 .andThen(inc)
+                 .andThen(function (prev) {
+                     protected = true;
+                     return prev;
+                 }).start({
+                     initialValue: 0,
+                     callback: function (result) {
+                         start();
+                         equals(protected, false);
+                         equals(result, 3);
+                     }
+                 });
+    });
+});


[18/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/NetworkStatus/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/NetworkStatus/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/NetworkStatus/index.js
new file mode 100644
index 0000000..7d0371c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/NetworkStatus/index.js
@@ -0,0 +1,118 @@
+/*
+* 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.
+*/
+
+
+describe("NetworkStatus", function () {
+    var _apiDir = __dirname + "./../../../templates/project/plugins/NetworkStatus/",
+        index,
+        result = {
+            ok: jasmine.createSpy(),
+            error: jasmine.createSpy()
+        };
+
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+    });
+
+    afterEach(function () {
+        index = null;
+    });
+
+    describe("getConnectionInfo", function () {
+        beforeEach(function () {
+            GLOBAL.window = {
+                qnx: {
+                    webplatform: {
+                        device: {
+                        }
+                    }
+                }
+            };
+            GLOBAL.PluginResult = function () {
+                return result;
+            };
+        });
+
+        afterEach(function () {
+            delete GLOBAL.window;
+            delete GLOBAL.PluginResult;
+        });
+
+        function testConnection(expectedResult, mockedType, mockedTechnology) {
+            var mockedDevice = {
+                activeConnection: {
+                    type: mockedType,
+                    technology: mockedTechnology
+                }
+            };
+
+            if (mockedType) {
+                window.qnx.webplatform.device = mockedDevice;
+            }
+
+            index.getConnectionInfo();
+
+            expect(result.ok).toHaveBeenCalledWith(expectedResult);
+            expect(result.error).not.toHaveBeenCalled();
+        }
+
+        it("calls success with a wired connection", function () {
+            testConnection("ethernet", "wired");
+        });
+
+        it("calls success with a wifi connection", function () {
+            testConnection("wifi", "wifi");
+        });
+
+        it("calls success with no connection", function () {
+            testConnection("none", "none");
+        });
+
+        it("calls success with a cellular edge connection", function () {
+            testConnection("2g", "cellular", "edge");
+        });
+
+        it("calls success with a cellular gsm connection", function () {
+            testConnection("2g", "cellular", "gsm");
+        });
+
+        it("calls success with a cellular evdo connection", function () {
+            testConnection("3g", "cellular", "evdo");
+        });
+
+        it("calls success with a cellular umts connection", function () {
+            testConnection("3g", "cellular", "umts");
+        });
+
+        it("calls success with a lte connection", function () {
+            testConnection("4g", "cellular", "lte");
+        });
+
+        it("calls success with a cellular connection", function () {
+            testConnection("cellular", "cellular");
+        });
+
+        it("defaults to none if no connection is found", function () {
+            testConnection("none");
+        });
+
+        it("defaults to unknown if connection type doesn't exist", function () {
+            testConnection("unknown", "fakeConnectionType");
+        });
+
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/Notification/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/Notification/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Notification/index.js
new file mode 100644
index 0000000..2b585f8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Notification/index.js
@@ -0,0 +1,119 @@
+/*
+* 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 mockAndTestDialog(htmlmessage, title, dialogType, buttonLabel) {
+    GLOBAL.qnx = {
+        webplatform: {
+            getWebViews: function () {
+                var webviews = [{}, {},
+                    {//overlayWebview
+                        dialog: {
+                            show: function(messageObj, callback) {
+                                expect(messageObj.title).toEqual(title);
+                                expect(messageObj.htmlmessage).toEqual(htmlmessage);
+                                expect(messageObj.dialogType).toEqual(dialogType);
+                                expect(messageObj.optionalButtons).toEqual(buttonLabel);
+                                expect(typeof callback).toEqual("function");
+                            }
+                        }
+                    }];
+                return webviews;
+            }
+        }
+    };
+
+}
+
+describe("Notification", function () {
+    var _apiDir = __dirname + "./../../../templates/project/plugins/Notification/",
+    index,
+    success = function() {},
+    fail = function() {},
+    result = {
+        error: jasmine.createSpy(),
+        noResult: jasmine.createSpy()
+    },
+    args = {
+        0: "%22Dialog%20message.%22",
+        1: "%22Dialog%20Title%22",
+        2: "%22Continue%22"
+    };
+
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+
+        GLOBAL.PluginResult = function () {
+            return result;
+        };
+    });
+
+    afterEach(function () {
+        delete require.cache[require.resolve(_apiDir + "index")];
+        delete GLOBAL.qnx;
+        delete GLOBAL.PluginResult;
+    });
+
+    describe("alert", function () {
+        it("fails with invalid number of args", function () {
+            index.alert(success, fail, {}, {});
+            expect(result.error).toHaveBeenCalledWith("Notification action - alert arguments not found.");
+        });
+
+        it("calls dialog.show with correct params", function () {
+            mockAndTestDialog("Dialog message.", "Dialog Title", "CustomAsk", ["Continue"]);
+            index.alert(success, fail, args, {});
+            expect(result.noResult).toHaveBeenCalled();
+        });
+    });
+
+    describe("confirm", function () {
+        it("fails with invalid number of args", function () {
+            index.confirm(success, fail, {}, {});
+            expect(result.error).toHaveBeenCalledWith("Notification action - confirm arguments not found.");
+        });
+
+        it("calls dialog.show with correct params", function () {
+            mockAndTestDialog("Dialog message.", "Dialog Title", "CustomAsk", ["Continue"]);
+            index.confirm(success, fail, args, {});
+            expect(result.noResult).toHaveBeenCalled();
+        });
+
+        it("calls dialog.show with correct params [deprecated buttonArg]", function () {
+            var args = {
+                0: "%22Dialog%20message.%22",
+                1: "%22Dialog%20Title%22",
+                2: "%22Continue,Cancel%22"
+            };
+
+            mockAndTestDialog("Dialog message.", "Dialog Title", "CustomAsk", ["Continue", "Cancel"]);
+            index.confirm(success, fail, args, {});
+            expect(result.noResult).toHaveBeenCalled();
+        });
+    });
+
+    describe("prompt", function () {
+        it("fails with invalid number of args", function () {
+            index.prompt(success, fail, {}, {});
+            expect(result.error).toHaveBeenCalledWith("Notification action - prompt arguments not found.");
+        });
+
+        it("calls dialog.show with correct params", function () {
+            mockAndTestDialog("Dialog message.", "Dialog Title", "JavaScriptPrompt", ["Continue"]);
+            index.prompt(success, fail, args, {});
+            expect(result.noResult).toHaveBeenCalled();
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/SplashScreen/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/SplashScreen/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/SplashScreen/index.js
new file mode 100644
index 0000000..1dcccee
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/SplashScreen/index.js
@@ -0,0 +1,82 @@
+/*
+* 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.
+*/
+describe("SplashScreen", function () {
+    var _apiDir = __dirname + "./../../../templates/project/plugins/SplashScreen/",
+        index,
+        mockedEnv = {
+            response: {
+                send: jasmine.createSpy()
+            }
+        },
+        mockedApplication = {
+            windowVisible: undefined
+        };
+
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+        mockedEnv.response.send.reset();
+    });
+
+    afterEach(function () {
+        index = null;
+        delete require.cache[require.resolve(_apiDir + "index")];
+    });
+    describe("show", function () {
+        beforeEach(function () {
+            GLOBAL.PluginResult = function (args, env) {};
+            GLOBAL.PluginResult.prototype.error = jasmine.createSpy();
+        });
+
+        afterEach(function () {
+            delete GLOBAL.PluginResult;
+        });
+
+        it("calls PluginResult.error if show is called", function () {
+            index.show();
+
+            expect(PluginResult.prototype.error).toHaveBeenCalledWith("Not supported on platform", false);
+        });
+    });
+
+    describe("hide", function () {
+        beforeEach(function () {
+            GLOBAL.window = {
+                qnx: {
+                    webplatform: {
+                        getApplication: function () {
+                            return mockedApplication;
+                        }
+                    }
+                }
+            };
+
+            GLOBAL.PluginResult = function (args, env) {};
+            GLOBAL.PluginResult.prototype.ok = jasmine.createSpy();
+        });
+
+        afterEach(function () {
+            delete GLOBAL.window;
+            delete GLOBAL.PluginResult;
+        });
+
+        it("calls PluginResult.ok if hide is called", function () {
+            index.hide();
+
+            expect(mockedApplication.windowVisible).toBeTruthy();
+            expect(PluginResult.prototype.ok).toHaveBeenCalledWith(undefined, false);
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/bootstrap/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/bootstrap/index.html b/lib/cordova-blackberry/blackberry10/framework/bootstrap/index.html
new file mode 100644
index 0000000..6e3b028
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/bootstrap/index.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="user-scalable=no, target-densitydpi=device-dpi, width=device-width">
+    <title>WebWorks For BB10 Bootstrap</title>
+    <script src="./require.js"></script>
+    <script src="platform:///webplatform.js"></script>
+    <script src="./frameworkModules.js"></script>
+    <script>
+        function start() {
+            //Must load jnext first, as there seemed to be a race condition for if it was defined before it was used
+            require("lib/jnext.js");
+            require(frameworkModules, function () {
+                require('lib/framework').start();
+            });
+        }
+    </script>
+  </head>
+  <body onload="start();">
+      I am the man behind the curtain.
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/bootstrap/require.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/bootstrap/require.js b/lib/cordova-blackberry/blackberry10/framework/bootstrap/require.js
new file mode 100644
index 0000000..a68bfcc
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/bootstrap/require.js
@@ -0,0 +1,251 @@
+/*
+ *  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.
+ */
+
+var define,
+    require;
+
+(function () {
+    var unpreparedModules = {},
+        readyModules = {},
+        ACCEPTABLE_EXTENSIONS = [".js", ".json"],
+        DEFAULT_EXTENSION = ".js";
+
+    function hasValidExtension(moduleName) {
+        return ACCEPTABLE_EXTENSIONS.some(function (element, index, array) {
+            return moduleName.match("\\" + element + "$");
+        });
+    }
+
+
+    function normalizeName(originalName, baseName) {
+        var nameParts,
+            name = originalName.slice(0);
+        //remove ^local:// (if it exists) and .js$
+        //This will not work for local:// without a trailing js
+        name = name.replace(/(?:^local:\/\/)/, "");
+        if (name.charAt(0) === '.' && baseName) {
+            //Split the baseName and remove the final part (the module name)
+            nameParts = baseName.split('/');
+            nameParts.pop();
+            nameParts = nameParts.concat(name.split('/'));
+
+            name = nameParts.reduce(function (previous, current,  index, array) {
+                var returnValue,
+                    slashIndex;
+
+                //If previous is a dot, ignore it
+                //If previous is ever just .. we're screwed anyway
+                if (previous !== '.') {
+                    returnValue = previous;
+                }
+
+                //If we have a .. then remove a chunk of previous
+                if (current === "..") {
+                    slashIndex = previous.lastIndexOf('/');
+                    //If there's no slash we're either screwed or we remove the final token
+                    if (slashIndex !== -1) {
+                        returnValue = previous.slice(0, previous.lastIndexOf('/'));
+                    } else {
+                        returnValue = "";
+                    }
+                } else if (current !== '.') {
+                    //Otherwise simply append anything not a .
+                    //Only append a slash if we're not empty
+                    if (returnValue.length) {
+                        returnValue += "/";
+                    }
+                    returnValue += current;
+                }
+
+                return returnValue;
+            });
+
+        }
+
+        //If there is no acceptable extension tack on a .js
+        if (!hasValidExtension(name)) {
+            name = name + DEFAULT_EXTENSION;
+        }
+
+        return name;
+    }
+
+    function buildModule(name, dependencies, factory) {
+        var module = {exports: {}},
+            localRequire = function (moduleName) {
+                return require(moduleName, name);
+            },
+            args = [];
+        localRequire.toUrl = function (moduleName, baseName) {
+            return require.toUrl(moduleName, baseName || name);
+        };
+        dependencies.forEach(function (dependency) {
+            if (dependency === 'require') {
+                args.push(localRequire);
+            } else if (dependency === 'exports') {
+                args.push(module.exports);
+            } else if (dependency === 'module') {
+                args.push(module);
+            } else {
+                //This is because jshint cannot handle out of order functions
+                /*global loadModule:false */
+                args.push(loadModule(dependency));
+                /*global loadModule:true */
+            }
+        });
+
+        //No need to process dependencies, webworks only has require, exports, module
+        factory.apply(this, args);
+
+        //For full AMD we would need logic to also check the return value
+        return module.exports;
+
+    }
+
+    function getDefineString(moduleName, body) {
+        var evalString = 'define("' + moduleName + '", function (require, exports, module) {',
+            isJson = /\.json$/.test(moduleName);
+
+        evalString += isJson ? ' module.exports = ' : '';
+        evalString += body.replace(/^\s+|\s+$/g, '');
+        evalString += isJson ? ' ;' : '';
+        evalString += '});';
+
+        return evalString;
+    }
+
+    function loadModule(name, baseName) {
+        var normalizedName = normalizeName(name, baseName),
+            url,
+            xhr,
+            loadResult;
+        //Always check undefined first, this allows the user to redefine modules
+        //(Not used in WebWorks, although it is used in our unit tests)
+        if (unpreparedModules[normalizedName]) {
+            readyModules[normalizedName] = buildModule(normalizedName, unpreparedModules[normalizedName].dependencies, unpreparedModules[normalizedName].factory);
+            delete unpreparedModules[normalizedName];
+        }
+
+        //If the module does not exist, load the module from external source
+        //Webworks currently only loads APIs from across bridge
+        if (!readyModules[normalizedName]) {
+            //If the module to be loaded ends in .js then we will define it
+            //Also if baseName exists than we have a local require situation
+            if (hasValidExtension(name) || baseName) {
+                xhr = new XMLHttpRequest();
+                url = name;
+                //If the module to be loaded starts with local:// go over the bridge
+                //Else If the module to be loaded is a relative load it may not have .js extension which is needed
+                if (/^local:\/\//.test(name)) {
+                    url = "http://localhost:8472/extensions/load/" + normalizedName.replace(/(?:^ext\/)(.+)(?:\/client.js$)/, "$1");
+
+                    xhr.open("GET", url, false);
+                    xhr.send(null);
+                    try {
+                        loadResult = JSON.parse(xhr.responseText);
+
+                        loadResult.dependencies.forEach(function (dep) {
+                            /*jshint evil:true */
+                            eval(getDefineString(dep.moduleName, dep.body));
+                            /*jshint evil:false */
+                        });
+
+                        //Trimming responseText to remove EOF chars
+                        /*jshint evil:true */
+                        eval(getDefineString(normalizedName, loadResult.client));
+                        /*jshint evil:false */
+                    } catch (err1) {
+                        err1.message += ' in ' + url;
+                        throw err1;
+                    }
+                } else {
+                    if (baseName) {
+                        url = normalizedName;
+                    }
+
+                    xhr.open("GET", url, false);
+                    xhr.send(null);
+                    try {
+                        //Trimming responseText to remove EOF chars
+                        /*jshint evil:true */
+                        eval(getDefineString(normalizedName, xhr.responseText));
+                        /*jshint evil:false */
+                    } catch (err) {
+                        err.message += ' in ' + url;
+                        throw err;
+                    }
+                }
+
+                if (unpreparedModules[normalizedName]) {
+                    readyModules[normalizedName] = buildModule(normalizedName, unpreparedModules[normalizedName].dependencies, unpreparedModules[normalizedName].factory);
+                    delete unpreparedModules[normalizedName];
+                }
+            } else {
+                throw "module " + name + " cannot be found";
+            }
+
+        }
+
+        return readyModules[normalizedName];
+
+    }
+
+    //Use the AMD signature incase we ever want to change.
+    //For now we will only be using (name, baseName)
+    require = function (dependencies, callback) {
+        if (typeof dependencies === "string") {
+            //dependencies is the module name and callback is the relName
+            //relName is not part of the AMDJS spec, but we use it from localRequire
+            return loadModule(dependencies, callback);
+        } else if (Array.isArray(dependencies) && typeof callback === 'function') {
+            //Call it Asynchronously
+            setTimeout(function () {
+                buildModule(undefined, dependencies, callback);
+            }, 0);
+        }
+    };
+
+    require.toUrl = function (originalName, baseName) {
+        return normalizeName(originalName, baseName);
+    };
+
+    //Use the AMD signature incase we ever want to change.
+    //For now webworks will only be using (name, factory) signature.
+    define = function (name, dependencies, factory) {
+        if (typeof name === "string" && typeof dependencies === 'function') {
+            factory = dependencies;
+            dependencies = ['require', 'exports', 'module'];
+        }
+
+        //According to the AMDJS spec we should parse out the require statments
+        //from factory.toString and add those to the list of dependencies
+
+        //Normalize the name. Remove local:// and .js
+        name = normalizeName(name);
+        unpreparedModules[name] = {
+            dependencies: dependencies,
+            factory: factory
+        };
+    };
+}());
+
+//Export for use in node for unit tests
+if (typeof module === "object" && typeof require === "function") {
+    module.exports = {
+        require: require,
+        define: define
+    };
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/bootstrap/ui.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/bootstrap/ui.html b/lib/cordova-blackberry/blackberry10/framework/bootstrap/ui.html
new file mode 100644
index 0000000..98c94a0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/bootstrap/ui.html
@@ -0,0 +1,73 @@
+<!-- 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.
+
+ -->
+<!DOCTYPE HTML>
+<html lang="en">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
+        <title>Overlay WebView</title>
+        <link rel="stylesheet" href="platform:///ui-resources/styles/styles.css" type="text/css" media="screen" charset="utf-8">
+
+        <script src="../chrome/require.js" type="text/javascript"></script>
+        <script src="platform:///webplatform.js" type="text/javascript"></script>
+        <script src="platform:///i18n.js" type="text/javascript"></script>
+        <script src="platform:///ui-resources/index.js" type="text/javascript"></script>
+    </head>
+    <body>
+
+        <div id="contextMenuModal" style="display:none;"></div>
+<div id="contextMenu" class="hideMenu">
+    <div id="contextMenuHeader">
+        <div id="contextMenuHeadText"></div>
+        <div id="contextMenuSubheadText"></div>
+    </div>
+    <div id="contextMenuContent"></div>
+    <div id="contextMenuHandle"></div>
+    <div id="contextMenuDelete"></div>
+</div>
+
+        <div id="dialog" class="hidden">
+    <div class="dialog-top-third">
+        <div id="dialog-panel">
+        </div>
+    </div>
+    <div class="dialog-bottom-two-thirds">
+    </div>
+</div>
+
+        <div id="invocationlist" class="screenInner screenSlide removed">
+    <div id="cancelTitlebar"></div>
+    <div id="invocationListContent" class="targetList"></div>
+    <div id="targetLoader">
+        <div id="targetLoaderActivity" class="activityIndicator"></div>
+    </div>
+</div>
+
+        <div id="toaster" class="toaster"></div>
+
+
+        <div id="childwebviewcontrols"></div>
+
+        <div id="formcontrolPanel">
+            <div id="formcontrol">
+                <button id="formcontrol_previous"/>
+                <button id="formcontrol_next"/>
+                <button id="formcontrol_submit"/>
+            </div>
+        </div>
+
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/bootstrap/wwe
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/bootstrap/wwe b/lib/cordova-blackberry/blackberry10/framework/bootstrap/wwe
new file mode 100644
index 0000000..0e48b92
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/bootstrap/wwe
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec weblauncher "$@"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/PluginResult.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/PluginResult.js b/lib/cordova-blackberry/blackberry10/framework/lib/PluginResult.js
new file mode 100644
index 0000000..68acf23
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/PluginResult.js
@@ -0,0 +1,55 @@
+/*
+ * 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 PluginResult (args, env) {
+
+    var CALLBACK_STATUS_NO_RESULT = 0,
+        CALLBACK_STATUS_OK = 1,
+        CALLBACK_STATUS_ERROR = 9,
+        callbackId = JSON.parse(decodeURIComponent(args.callbackId)),
+        send = function (data) {
+            env.response.send(200, encodeURIComponent(JSON.stringify(data)));
+        },
+        callback = function (success, status, data, keepCallback) {
+            var executeString = "cordova.callbackFromNative('" + callbackId  + "', " +
+                !!success + ", " + status + ", [" + data + "], " + !!keepCallback + ");";
+            env.webview.executeJavaScript(executeString);
+        };
+
+    Object.defineProperty(this, "callbackId", {enumerable: true, value: callbackId});
+
+    this.noResult = function (keepCallback) {
+        send({ code: CALLBACK_STATUS_NO_RESULT, keepCallback: !!keepCallback });
+    };
+
+    this.error = function (msg, keepCallback) {
+        send({ code: CALLBACK_STATUS_ERROR, msg: msg, keepCallback: !!keepCallback });
+    };
+
+    this.ok = function (data, keepCallback) {
+        send({ code: CALLBACK_STATUS_OK, data: data, keepCallback: !!keepCallback });
+    };
+
+    this.callbackOk = function (data, keepCallback) {
+        callback(true, CALLBACK_STATUS_OK, JSON.stringify(data), keepCallback);
+    };
+
+    this.callbackError = function (msg, keepCallback) {
+        callback(false, CALLBACK_STATUS_ERROR, JSON.stringify(msg), keepCallback);
+    };
+}
+
+window.PluginResult = PluginResult;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/config.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/config.js b/lib/cordova-blackberry/blackberry10/framework/lib/config.js
new file mode 100644
index 0000000..6fbe527
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/config.js
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+
+var defaults = require('./config/default'),
+    user = require('./config/user'),
+    utils = require('./utils');
+
+module.exports = utils.mixin(user,
+                 utils.mixin(defaults, {}));

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/config/default.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/config/default.js b/lib/cordova-blackberry/blackberry10/framework/lib/config/default.js
new file mode 100644
index 0000000..31990b1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/config/default.js
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2010-2011 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 = {
+    configXML: "config.xml",
+    configXMLDoc: null,
+
+    backButtonBehavior: "back",
+    customHeaders: {},
+    version: "1.0.0",
+
+    author: "",
+    authorURL: "",
+    authorEmail: "",
+    copyright: "",
+    content: "index.html",
+    contentCharset: "",
+    contentType: "",
+    description: "",
+    icon: "AIRApp_72.png",
+    iconHover: "",
+    id: "",
+    license: "",
+    licenseURL: "",
+    name: "WebWorksAppTemplate",
+
+    navigationMode: "pointer",
+
+    preferredTransports: null,
+    transportTimeout: 300000,
+
+    hasMultiAccess: false,
+    widgetExtensions: null,
+    featureTable: null,
+    accessList: null,
+    permissions: null,
+
+    loadingScreenColor: "#FFFFFF",
+    backgroundImage: "",
+    foregroundImage: "",
+    onFirstLaunch: false,
+    onLocalPageLoad: false,
+    onRemotePageLoad: false,
+    transitionType: -1,
+    transitionDuration: 250,
+    transitionDirection: 128,
+
+    disableAllCache: false,
+    aggressiveCacheAge: 2592000,
+    maxCacheSizeTotal: 1024,
+    maxCacheSizeItem: 128,
+    maxStandardCacheAge: 2592000,
+
+    runOnStartUp: false,
+    allowInvokeParams: false,
+    backgroundSource: "",
+    foregroundSource: "index.html",
+    debugEnabled: false,
+    enableFormControl: true,
+    enableChildWebView: true,
+    enableWebSecurity: true,
+    enablePopupBlocker: false
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/config/user.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/config/user.js b/lib/cordova-blackberry/blackberry10/framework/lib/config/user.js
new file mode 100644
index 0000000..5e36885
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/config/user.js
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2010-2011 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 = {
+    authorEmail: "guocat@gmail.com",
+    copyright: "@Rebecca",
+    customHeaders: {
+        "rim-header": "RIM-Widget:rim/widget"
+    },
+    userAgent: "Some extremely long user agent (with) spe/cial, characters",
+    author: "Me",
+    version: "1.0.0.0",
+    hasMultiAccess: true,
+    license: "This is a license",
+    accessList: [{
+        allowSubDomain: false,
+        features: [{
+            version: "1.0.0.0",
+            required: true,
+            id: "blackberry.example.test"
+        }, {
+            version: "1.0.0.0",
+            required: true,
+            id: "blackberry.app"
+        }],
+        uri: "WIDGET_LOCAL"
+    }],
+    licenseURL: "",
+    authorURL: "http://bbtools_win7_01/yui",
+    foregroundSource: "derp.html",
+    backgroundColor: 0xFFFF9900,
+    content: "http://localhost/lib/public/testbed.html",
+    description: "this is the description",
+    configXML: "config.xml",
+    name: "wwTest"
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/controllerWebView.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/controllerWebView.js b/lib/cordova-blackberry/blackberry10/framework/lib/controllerWebView.js
new file mode 100644
index 0000000..9c05ebe
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/controllerWebView.js
@@ -0,0 +1,72 @@
+/*
+ *  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.
+ */
+
+var controllerWebView,
+    overlayWebView = require("./overlayWebView"),
+    controller,
+    invocation,
+    utils;
+
+controllerWebView = {
+    init: function (config) {
+        controller = window.qnx.webplatform.getController();
+        invocation = window.qnx.webplatform.getApplication().invocation;
+        utils = require('./utils');
+        controller.enableWebInspector = config.debugEnabled;
+        controller.enableCrossSiteXHR = true;
+        controller.visible = false;
+        controller.active = false;
+        controller.setGeometry(0, 0, screen.width, screen.height);
+        controller.setFileSystemSandbox = false;
+
+        /* Remote functions that are published to allow communication with
+         * the overlay webview, they are called via the RPC bridge
+         */
+        controller.publishRemoteFunction('webview.setSensitivity', function (args) {
+            var sensitivityType = args[0];
+            overlayWebView.setSensitivity(sensitivityType);
+        });
+
+        controller.publishRemoteFunction('webview.notifyContextMenuCancelled', function () {
+            overlayWebView.notifyContextMenuCancelled();
+        });
+    },
+
+    setGeometry: function (x, y, width, height) {
+        controller.setGeometry(x, y, width, height);
+    },
+
+    setApplicationOrientation: function (angle) {
+        controller.setApplicationOrientation(angle);
+    },
+
+    notifyApplicationOrientationDone: function () {
+        controller.notifyApplicationOrientationDone();
+    },
+
+    dispatchEvent: function (eventType, args) {
+        controller.dispatchEvent(eventType, args);
+    }
+};
+
+controllerWebView.__defineGetter__('id', function () {
+    return controller.id;
+});
+
+controllerWebView.__defineSetter__('onChildWebViewCreated', function (input) {
+    controller.onChildWebViewCreated = input;
+});
+module.exports = controllerWebView;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/event.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/event.js b/lib/cordova-blackberry/blackberry10/framework/lib/event.js
new file mode 100644
index 0000000..880e6c4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/event.js
@@ -0,0 +1,84 @@
+/*
+ *  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.
+ */
+
+var _handlers = {},
+    _webview = require("./webview");
+
+module.exports = {
+    trigger: function (actionEvent) {
+        var args = Array.prototype.slice.call(arguments),
+            executeString = "webworks.event.trigger('" + actionEvent + "', '" + escape(encodeURIComponent(JSON.stringify(args.slice(1)))) + "')";
+
+        if (_handlers.hasOwnProperty(actionEvent)) {
+            _handlers[actionEvent].forEach(function (webview) {
+                webview.executeJavaScript(executeString);
+            });
+        } else {
+            //Just dump it in the content webview for consistency
+            _webview.executeJavascript(executeString);
+        }
+    },
+
+    add: function (action, webview) {
+        var triggerEvent;
+
+        if (action) {
+            //Use action.event for old extensions that may not have triggerEvent defined
+            triggerEvent = action.triggerEvent || action.event;
+
+            if (!action.once) {
+                action.context.addEventListener(action.event, action.trigger || this.trigger);
+            }
+
+            //If there are no registered listeners for this event, create an array to hold them
+            if (!_handlers.hasOwnProperty(triggerEvent)) {
+                _handlers[triggerEvent] = [];
+            }
+            //If the webview is not in the list of webviews listening to this action then add it
+            if (!_handlers[triggerEvent].some(function (handlerWebView) {
+                    return handlerWebView.id === webview.id;
+                })) {
+                _handlers[triggerEvent].push(webview);
+            }
+
+        } else {
+            throw "Action is null or undefined";
+        }
+    },
+
+    remove: function (action, webview) {
+        if (action) {
+            action.context.removeEventListener(action.event, action.trigger || this.trigger);
+
+            //Remove the webview from the _handlers
+            if (_handlers.hasOwnProperty(action.event)) {
+
+                _handlers[action.event] = _handlers[action.event].filter(function (sourceWebview) {
+                    return sourceWebview.id !== webview.id;
+                });
+
+                //If the array is empty delete it
+                if (_handlers[action.event].length === 0) {
+                    delete _handlers[action.event];
+                }
+            }
+
+        } else {
+            throw "Action is null or undefined";
+        }
+
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/events/applicationEvents.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/events/applicationEvents.js b/lib/cordova-blackberry/blackberry10/framework/lib/events/applicationEvents.js
new file mode 100644
index 0000000..14a8f9e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/events/applicationEvents.js
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010-2011 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 = {
+    addEventListener: function (event, trigger) {
+        if (event) {
+            event = "application." + event;
+            window.qnx.webplatform.getApplication().addEventListener(event, trigger);
+        } else {
+            console.warn("Attempting to register for 'falsey' event: " + event);
+        }
+    },
+    removeEventListener: function (event, trigger) {
+        if (event) {
+            event = "application." + event;
+            window.qnx.webplatform.getApplication().removeEventListener(event, trigger);
+        } else {
+            console.warn("Attempting to un-register for 'falsey' event: " + event);
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/events/deviceEvents.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/events/deviceEvents.js b/lib/cordova-blackberry/blackberry10/framework/lib/events/deviceEvents.js
new file mode 100644
index 0000000..939357b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/events/deviceEvents.js
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010-2011 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 = {
+    addEventListener: function (event, trigger) {
+        if (event) {
+            event = "device." + event;
+            window.qnx.webplatform.device.addEventListener(event, trigger);
+        } else {
+            console.warn("Attempting to register for 'falsey' event: " + event);
+        }
+    },
+    removeEventListener: function (event, trigger) {
+        if (event) {
+            event = "device." + event;
+            window.qnx.webplatform.device.removeEventListener(event, trigger);
+        } else {
+            console.warn("Attempting to un-register for 'falsey' event: " + event);
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/exception.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/exception.js b/lib/cordova-blackberry/blackberry10/framework/lib/exception.js
new file mode 100644
index 0000000..f0a8467
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/exception.js
@@ -0,0 +1,69 @@
+/*
+ *  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.
+ */
+
+module.exports = {
+
+    types: {
+        Application: "Application",
+        ArgumentLength: "ArgumentLength",
+        ArgumentType: "ArgumentType",
+        Argument: "Argument",
+        NotificationType: "NotificationType",
+        NotificationStateType: "NotificationStateType",
+        DomObjectNotFound: "DomObjectNotFound",
+        MethodNotImplemented: "MethodNotImplemented",
+        InvalidState: "InvalidState",
+        ApplicationState: "ApplicationState"
+    },
+
+    handle: function handle(exception, reThrow) {
+        reThrow = reThrow || false;
+
+        var eMsg = exception.message || "exception caught!",
+        msg = eMsg + "\n\n" + (exception.stack || "*no stack provided*") + "\n\n";
+
+        console.error(msg);
+
+        if (reThrow) {
+            throw exception;
+        }
+    },
+
+    raise: function raise(exceptionType, message, customExceptionObject) {
+        var obj = customExceptionObject || {
+                type: "",
+                message: "",
+
+                toString: function () {
+                    var result = this.name + ': "' + this.message + '"';
+
+                    if (this.stack) {
+                        result += "\n" + this.stack;
+                    }
+                    return result;
+                }
+            };
+
+        message = message || "";
+
+        obj.name = exceptionType;
+        obj.type = exceptionType;
+        // TODO: include the exception objects original message if exists
+        obj.message = message;
+
+        throw obj;
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/framework.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/framework.js b/lib/cordova-blackberry/blackberry10/framework/lib/framework.js
new file mode 100644
index 0000000..7d02c61
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/framework.js
@@ -0,0 +1,138 @@
+/*
+ *  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.
+ */
+
+var utils = require('./utils'),
+    controllerWebView = require('./controllerWebView'),
+    webview = require('./webview'),
+    overlayWebView = require('./overlayWebView'),
+    config = require("./config");
+
+function showWebInspectorInfo() {
+    var port = window.qnx.webplatform.getApplication().webInspectorPort,
+        messageObj = {};
+
+    qnx.webplatform.device.getNetworkInterfaces(function (networkInfo) {
+        var connectedInterface;
+
+        utils.forEach(networkInfo, function (info) {
+            if (info && !connectedInterface) {
+                connectedInterface = info;
+            }
+        }, this);
+
+        messageObj.title = "Web Inspector Enabled";
+        if (connectedInterface) {
+            messageObj.htmlmessage =  "\n ip4:    " + connectedInterface.ipv4Address + ":" + port + "<br/> ip6:    " + connectedInterface.ipv6Address + ":" + port;
+        } else {
+            messageObj.message = "";
+        }
+        messageObj.dialogType = 'JavaScriptAlert';
+        overlayWebView.showDialog(messageObj);
+    });
+}
+
+var _self = {
+    start: function (url) {
+        var callback,
+            showUrlCallback;
+
+        // Set up the controller WebView
+        controllerWebView.init(config);
+
+        webview.create(function () {
+            if (config.enableFlash) {
+                //Set webview plugin directory [required for flash]
+                webview.setExtraPluginDirectory('/usr/lib/browser/plugins');
+
+                //Enable plugins for the webview [required for flash]
+                webview.setEnablePlugins(true);
+
+                //Enable flash for the childWebViews
+                controllerWebView.onChildWebViewCreated = function (child) {
+                    //Set webview plugin directory [required for flash]
+                    child.setExtraPluginDirectory('/usr/lib/browser/plugins');
+
+                    //Enable plugins for the webview [required for flash]
+                    child.pluginsEnabled = true;
+                };
+            }
+
+            if (!config.enableWebSecurity) {
+                webview.enableCrossSiteXHR = true;
+            }
+
+            if (!config.enablePopupBlocker) {
+                qnx.webplatform.nativeCall('webview.setBlockPopups', webview.id, false);
+            }
+            // Workaround for executeJavascript doing nothing for the first time
+
+            webview.executeJavascript("1 + 1");
+
+            url = url || config.content;
+
+            showUrlCallback = function () {
+                overlayWebView.removeEventListener("DocumentLoadFinished", showUrlCallback);
+                showUrlCallback = null;
+
+                // Start page
+                if (url) {
+                    webview.setURL(url);
+                }
+            };
+
+            overlayWebView.create(function () {
+                overlayWebView.addEventListener("DocumentLoadFinished", showUrlCallback);
+
+                overlayWebView.setURL("local:///chrome/ui.html");
+                overlayWebView.renderContextMenuFor(webview);
+                overlayWebView.handleDialogFor(webview);
+                controllerWebView.dispatchEvent('ui.init', null);
+                webview.setUIWebViewObj(overlayWebView.getWebViewObj());
+                if (config.enableChildWebView) {
+                    overlayWebView.bindAppWebViewToChildWebViewControls(webview);
+                } else {
+                    webview.onChildWindowOpen = function (data) {
+                        var parsedData = JSON.parse(data);
+                        utils.invokeInBrowser(parsedData.url);
+                    };
+                }
+                if (config.enableFormControl) {
+                    overlayWebView.getWebViewObj().formcontrol.subscribeTo(webview);
+                }
+            });
+        },
+        {
+            debugEnabled : config.debugEnabled
+        });
+
+        //if debugging is enabled, show the IP and port for webinspector
+        if (config.debugEnabled) {
+            callback = function () {
+                showWebInspectorInfo();
+
+                //Remove listener. Alert should only be shown once.
+                webview.removeEventListener("DocumentLoadFinished", callback);
+            };
+
+            webview.addEventListener("DocumentLoadFinished", callback);
+        }
+    },
+    stop: function () {
+        webview.destroy();
+    }
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/jnext.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/jnext.js b/lib/cordova-blackberry/blackberry10/framework/lib/jnext.js
new file mode 100755
index 0000000..d0e4d79
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/jnext.js
@@ -0,0 +1,185 @@
+/*
+ *  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.
+ */
+/*global objJSExt */
+
+function JNEXT_() {
+    var self = this;
+    var m_bFirstRequire = true;
+
+    self.m_arEvents = {};
+
+    self.onPageLoad = function() {
+    };
+
+    self.attachToDOM = function() {
+        // Make sure JNEXT onPageLoad is called when page load
+        //  completes without damaging existing onLoad handlers
+        var prevOnLoad = window.onload;
+        if( typeof window.onload != 'function') {
+            window.onload = self.onPageLoad;
+        } else {
+            window.onload = function() {
+                if(prevOnLoad) {
+                    prevOnLoad();
+                }
+
+                self.onPageLoad();
+            };
+        }
+
+        // Unobtrusively add the JNEXT plugin or ActiveX to the DOM
+        var objBody = document.getElementsByTagName("body")[0];
+        var objDiv = document.createElement('div');
+        var strHTML;
+
+        if(window.ActiveXObject) {
+            strHTML = '<object id="objJSExt" width="0" height="0" classid="CLSID:C802F39D-BF85-427a-A334-77E501DB62E9" codebase="jnext.ocx"></object>';
+            strHTML += '<script language="JavaScript" for="objJSExt" EVENT="Js2nEvent( strEvent )">JNEXT.processEvent(strEvent)</script>';
+        } else {
+            var strAddSrc = "";
+            if(navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Windows") != -1) {
+                // This hack required on Safari for Windows
+                strAddSrc = 'src="./jnext/safari.foo"';
+            }
+            strHTML = '<embed id="objJSExt" ' + strAddSrc + ' type="application/jnext-scriptable-plugin" width="0" height="0">';
+        }
+
+        objDiv.innerHTML = strHTML;
+        objBody.appendChild(objDiv);
+    };
+
+    self.getosname = function() {
+        return objJSExt.sendCmd("osname");
+    };
+
+    self.require = function(strLibrary) {
+        // Load a required JNEXT plugin
+        var strCmd;
+        var strVal;
+        var arParams;
+
+        if(m_bFirstRequire) {
+            strCmd = "userAgent " + navigator.userAgent;
+            strVal = objJSExt.sendCmd(strCmd);
+            arParams = strVal.split(" ");
+            if(arParams[0] != "Ok") {
+                alert("userAgent " + strVal);
+                return false;
+            }
+            self.m_bFirstRequire = false;
+        }
+        strCmd = "Require " + strLibrary;
+        strVal = objJSExt.sendCmd(strCmd);
+        arParams = strVal.split(" ");
+        if(arParams[0] != "Ok") {
+            alert("Require " + strVal);
+            return false;
+        }
+
+        return true;
+    };
+
+    self.createObject = function(strObjName) {
+        // Create an instance of a native object
+        var strCmd;
+        var strVal;
+        var arParams;
+        strVal = objJSExt.sendCmd("CreateObject " + strObjName);
+        arParams = strVal.split(" ");
+        if(arParams[0] != "Ok") {
+            alert("CreateObject: " + strVal);
+            return "";
+        }
+        return arParams[1];
+    };
+
+    self.invoke = function(strObjId, strMethod, strParams) {
+        // Invoke a method of a given instance of a native object
+        var strCmd = "InvokeMethod " + strObjId + " " + strMethod;
+
+        if( typeof (strParams) != "undefined") {
+            strCmd += " " + strParams;
+        }
+
+        return objJSExt.sendCmd(strCmd);
+    };
+
+    self.registerEvents = function(objNotify) {
+        var strId = objNotify.getId();
+        self.m_arEvents[strId] = objNotify;
+    };
+
+    self.unregisterEvents = function(objNotify) {
+        var strId = objNotify.getId();
+        delete self.m_arEvents[strId];
+    };
+
+    self.processEvent = function(strNativeEvt) {
+        // Process an event received from native code. The event
+        // containes the target JavaScript object id and the
+        // relevant parameters.
+
+        var arParams = strNativeEvt.split(" ");
+        var strObjId = arParams[0];
+        var strEvent = strNativeEvt.substring(strObjId.length + 1);
+
+        var objNotify = self.m_arEvents[strObjId];
+        if( typeof (objNotify) == 'undefined') {
+            alert("Warning: No object with Id " + strId + " found for event " + strEvent);
+            return;
+        }
+
+        // This will now be handled by the appropriate JavaScript
+        // JNEXT extension object
+        objNotify.onEvent(strEvent);
+    };
+
+    self.ajaxGet = function(strUrl, id) {
+        var req = false;
+        if(window.ActiveXObject) {
+            try {
+                req = new ActiveXObject("Msxml2.XMLHTTP");
+            } catch (e) {
+                try {
+                    req = new ActiveXObject("Microsoft.XMLHTTP");
+                } catch (ex) {
+                }
+            }
+        } else if(window.XMLHttpRequest) {
+            req = new XMLHttpRequest();
+        } else {
+            return false;
+        }
+
+        req.onreadystatechange = function() {
+            if(req.readyState == 4 && (req.status == 200 || window.location.href.indexOf("http") == -1)) {
+                self.onAjaxRecv(req.responseText);
+            }
+        };
+
+        req.open('GET', strUrl, true);
+        req.send(null);
+    };
+
+    self.onAjaxRecv = function(strContent) {
+        alert(strContent);
+    };
+
+    self.attachToDOM();
+}
+
+window.JNEXT = new JNEXT_();
+module.exports = JNEXT;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/overlayWebView.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/overlayWebView.js b/lib/cordova-blackberry/blackberry10/framework/lib/overlayWebView.js
new file mode 100644
index 0000000..a2bba69
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/overlayWebView.js
@@ -0,0 +1,143 @@
+/*
+ *  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.
+ */
+
+var CHROME_HEIGHT = 0,
+    webview,
+    _webviewObj;
+
+webview =
+    {
+
+    create: function (ready, configSettings) {
+        _webviewObj = window.qnx.webplatform.createUIWebView(function () {
+
+            _webviewObj.visible = true;
+            _webviewObj.active = true;
+            _webviewObj.zOrder = 2;
+            _webviewObj.enableCrossSiteXHR = true;
+            _webviewObj.setGeometry(0, 0, screen.width, screen.height);
+            _webviewObj.addEventListener("DocumentLoadFinished", function () {
+                _webviewObj.default.setDefaultFont();
+                _webviewObj.visible = true;
+            });
+
+            _webviewObj.allowRpc = true;
+            _webviewObj.backgroundColor = 0x00FFFFFF;
+            _webviewObj.sensitivity = "SensitivityTest";
+            _webviewObj.devicePixelRatio = 1;
+            _webviewObj.allowQnxObject = true;
+
+            if (ready && typeof ready === 'function') {
+                ready();
+            }
+
+            window.qnx.webplatform.getController().dispatchEvent("overlayWebView.initialized", [_webviewObj]);
+
+        });
+    },
+
+    destroy: function () {
+        _webviewObj.destroy();
+    },
+
+    setURL: function (url) {
+        _webviewObj.url = url;
+    },
+
+    setGeometry: function (x, y, width, height) {
+        _webviewObj.setGeometry(x, y, width, height);
+    },
+
+    setSensitivity : function (sensitivity) {
+        _webviewObj.sensitivity = sensitivity;
+    },
+
+    setApplicationOrientation: function (angle) {
+        _webviewObj.setApplicationOrientation(angle);
+    },
+
+    notifyApplicationOrientationDone: function () {
+        _webviewObj.notifyApplicationOrientationDone();
+    },
+
+    executeJavascript: function (js) {
+        _webviewObj.executeJavaScript(js);
+    },
+
+    windowGroup: function () {
+        return _webviewObj.windowGroup;
+    },
+
+    notifyContextMenuCancelled: function () {
+        _webviewObj.notifyContextMenuCancelled();
+    },
+
+    bindAppWebViewToChildWebViewControls: function (appWebView) {
+        if (_webviewObj && _webviewObj.childwebviewcontrols) {
+            _webviewObj.childwebviewcontrols.subscribeTo(appWebView);
+        }
+    },
+
+    renderContextMenuFor: function (targetWebView) {
+        return _webviewObj.contextMenu.subscribeTo(targetWebView);
+    },
+
+    handleDialogFor: function (targetWebView) {
+        return _webviewObj.dialog.subscribeTo(targetWebView);
+    },
+
+    showDialog: function (description, callback) {
+        return _webviewObj.dialog.show(description, callback);
+    },
+
+    getWebViewObj: function (webview) {
+        return _webviewObj;
+    },
+
+    addEventListener: function (eventName, callback) {
+        _webviewObj.addEventListener(eventName, callback);
+    },
+
+    removeEventListener: function (eventName, callback) {
+        _webviewObj.removeEventListener(eventName, callback);
+    },
+
+    showToast : function (message, options) {
+        return _webviewObj.toast.show(message, options);
+    },
+
+    showInvocationList: function (request, title, success, error) {
+        _webviewObj.invocationlist.show(request, title, success, error);
+    }
+};
+
+webview.__defineGetter__('id', function () {
+    if (_webviewObj) {
+        return _webviewObj.id;
+    }
+});
+
+webview.__defineGetter__('zOrder', function () {
+    return _webviewObj.zOrder;
+});
+
+webview.__defineGetter__('contextMenu', function () {
+    if (_webviewObj) {
+        return _webviewObj.contextMenu;
+    }
+});
+
+module.exports = webview;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/plugins/default.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/plugins/default.js b/lib/cordova-blackberry/blackberry10/framework/lib/plugins/default.js
new file mode 100644
index 0000000..8347917
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/plugins/default.js
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2010-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.
+ */
+
+var Whitelist = require("../policy/whitelist").Whitelist,
+    whitelist = new Whitelist();
+
+module.exports = {
+
+    exec: function (request, succ, fail, args, env) {
+        var extPath = "plugin/" + request.params.ext + "/index",
+            requestObj = {
+                extension: null,
+                method: null,
+                getExtension: function () {
+                    if (frameworkModules.indexOf(extPath + ".js") !== -1) {
+                        this.extension = require("../utils").loadModule("../" + extPath);
+                        return requestObj;
+                    } else {
+                        throw {code: 404, msg: "Extension " + request.params.ext + " not found"};
+                    }
+                },
+                getMethod: function () {
+                    var methodParts = request.params.method ? request.params.method.split('/') : [request.params.method],
+                        extMethod;
+
+                    try {
+                        extMethod = this.extension[methodParts.shift()];
+                        extMethod = methodParts.reduce(function (previous, current) {
+                            if (previous[current]) {
+                                return previous[current];
+                            } else {
+                                throw {code: 404, msg: "Method " + request.params.method + " for " + request.params.ext + " not found"};
+                            }
+                        }, extMethod);
+
+                        if (extMethod && typeof extMethod === "function") {
+                            this.method = extMethod;
+                            return requestObj;
+                        } else {
+                            throw {code: 404, msg: "Method " + request.params.method + " for " + request.params.ext + " not found"};
+                        }
+                    } catch (e) {
+                        throw {code: 404, msg: "Method " + request.params.method + " for " + request.params.ext + " not found"};
+                    }
+                },
+                exec: function () {
+                    this.method(succ, fail, args, env);
+                }
+            };
+
+        try {
+            requestObj.getExtension().getMethod().exec();
+        } catch (e) {
+            console.warn(e.msg);
+            fail(-1, e.msg, e.code);
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/plugins/event.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/plugins/event.js b/lib/cordova-blackberry/blackberry10/framework/lib/plugins/event.js
new file mode 100644
index 0000000..441bc70
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/plugins/event.js
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var _event = require("../../lib/event"),
+    ONCE_EVENT_ERROR = "Error occured while adding once event listener.",
+    ERROR_ID = -1;
+
+module.exports = {
+    once: function (request, success, fail, args, env) {
+        try {
+            var eventName = decodeURIComponent(args.eventName).replace(/\"/g, ""),
+                action = {
+                    once: true,
+                    event: eventName
+                };
+
+            _event.add(action, env.webview);
+
+            if (success) {
+                success();
+            }
+        }
+        catch (e) {
+            if (fail) {
+                fail(ERROR_ID, ONCE_EVENT_ERROR);
+            }
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/policy/folderAccess.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/policy/folderAccess.js b/lib/cordova-blackberry/blackberry10/framework/lib/policy/folderAccess.js
new file mode 100644
index 0000000..5cd5690
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/policy/folderAccess.js
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2010-2011 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.
+ */
+
+var util = require("../utils");
+
+// Removes the start and end slashes from the path
+function _trimSurroundingSlashes(path) {
+    // Trim starting slash
+    if (util.startsWith(path, "/")) {
+        path = path.substr(1);
+    }
+
+    // Trim ending slash
+    if (util.endsWith(path, "/")) {
+        path = path.substr(0, path.length - 1);
+    }
+
+    return path;
+}
+
+// Determines the depth of the given path
+// Folder path must not include the scheme or the host
+function _determineDepth(folderPath) {
+    var depthCount = 0;
+
+    // Replace all backslashes with forward slash
+    folderPath = folderPath.replace("\\", "/");
+
+    // Special case: "/" is the given path
+    if (folderPath === "/") {
+        return 0;
+    }
+
+    folderPath = _trimSurroundingSlashes(folderPath);
+
+    // Count slashes remaining
+    while (folderPath.indexOf("/") !== -1) {
+        depthCount = depthCount + 1;
+
+        // Add 1 to skip the slash
+        folderPath = folderPath.substring(folderPath.indexOf("/") + 1);
+    }
+
+    // Add one more for the remaining folder
+    depthCount += 1;
+
+    return depthCount;
+}
+
+// Parse a folder path up to the desired depth
+function _getPath(folderPath, desiredDepth) {
+    var depthCount = 0, builtPath = "";
+
+    // Special case: Desired depth is 0
+    if (desiredDepth === 0) {
+        return "/";
+    }
+
+    // Replace all backslashes with forward slash
+    folderPath = folderPath.replace("\\", "/");
+
+    folderPath = _trimSurroundingSlashes(folderPath);
+
+    // Count slashes remaining
+    while (depthCount < desiredDepth) {
+        depthCount += 1;
+
+        // Add 1 to skip the slash
+        builtPath += "/" + folderPath.substring(0, folderPath.indexOf('/'));
+        folderPath = folderPath.substring(folderPath.indexOf('/') + 1);
+    }
+
+    return builtPath;
+}
+
+function WebFolderAccessManager() {
+    this._pathCollection = {};
+    this._maxPathLength = 0;
+}
+
+WebFolderAccessManager.prototype.addAccess = function (folderPath, access) {
+    if (!folderPath) {
+        folderPath = "/";
+    }
+
+    // Trim surrounding slashes for consistency
+    // The root "/" is a special case that does not need this trimming
+    if (folderPath !== "/") {
+        folderPath = "/" + _trimSurroundingSlashes(folderPath);
+    }
+
+    folderPath = folderPath.toLowerCase();
+
+    this._pathCollection[folderPath] = access;
+
+    // Determine the depth of the path
+    this._maxPathLength = Math.max(this._maxPathLength, _determineDepth(folderPath));
+};
+
+WebFolderAccessManager.prototype.getAccess = function (folderPath) {
+    var depth = _determineDepth(folderPath);
+    return this.getAccessRecursively(folderPath, depth);
+};
+
+WebFolderAccessManager.prototype.fetchAccess = function (folderPath) {
+    var queryIndex, folderPathWildcard;
+
+    if (!this._pathCollection.hasOwnProperty(folderPath)) {
+        // If there isn't an exact match and folderPath contains query string,
+        // check if the path collection contains an access with the same folderPath
+        // but with wildcard query
+        if ((queryIndex = folderPath.indexOf("?")) > -1) {
+            folderPathWildcard = folderPath.slice(0, queryIndex + 1) + "*";
+
+            if (this._pathCollection.hasOwnProperty(folderPathWildcard)) {
+                return this._pathCollection[folderPathWildcard];
+            }
+        }
+
+        return null;
+    } else {
+        return this._pathCollection[folderPath];
+    }
+};
+
+WebFolderAccessManager.prototype.getAccessRecursively = function (folderPath, pathLength) {
+    var fetchedAccess,
+        newPathLength,
+        newPath;
+
+    if (!folderPath) {
+        return null;
+    }
+
+    folderPath = folderPath.toLowerCase();
+
+    if (!!(fetchedAccess = this.fetchAccess(folderPath))) {
+        return fetchedAccess;
+    } else {
+        // Truncate the end portion of the path and try again
+        newPathLength = Math.min(this._maxPathLength, pathLength - 1);
+        newPath = _getPath(folderPath, newPathLength);
+
+        return this.getAccessRecursively(newPath, newPathLength);
+    }
+};
+
+function WebFolderAccess() {
+    this._mgr = new WebFolderAccessManager();
+}
+
+// folderPath - folder path must not include the scheme or the host
+WebFolderAccess.prototype.addAccess = function (folderPath, access) {
+    this._mgr.addAccess(folderPath, access);
+};
+
+// folderPath - folder path must not include the scheme or the host
+WebFolderAccess.prototype.getAccess = function (folderPath) {
+    return this._mgr.getAccess(folderPath);
+};
+
+exports.WebFolderAccess = WebFolderAccess;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/framework/lib/policy/webkitOriginAccess.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/framework/lib/policy/webkitOriginAccess.js b/lib/cordova-blackberry/blackberry10/framework/lib/policy/webkitOriginAccess.js
new file mode 100644
index 0000000..84adb49
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/framework/lib/policy/webkitOriginAccess.js
@@ -0,0 +1,123 @@
+/*
+ *  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.
+ */
+
+var config = require('./../config'),
+    utils = require('./../utils'),
+    Whitelist = require('./whitelist').Whitelist,
+    LOCAL_URI = "local://",
+    FILE_URI = "file://",
+    WW_URI = utils.getURIPrefix(),
+    _domains = [
+        {
+            url: LOCAL_URI,
+            allowSubDomains: true
+        }
+    ],
+    _webviews = [],
+    _isInitialized = false,
+    _whitelist = new Whitelist();
+
+function addOriginAccessWhitelistEntry(webview, source, destination, allowSubDomains) {
+    webview.addOriginAccessWhitelistEntry(source, destination, !!allowSubDomains);
+}
+
+function addDomain(url, allowSubDomains) {
+    var parsedUri = utils.parseUri(url);
+
+    allowSubDomains = !!allowSubDomains;
+
+    if (utils.isLocalURI(parsedUri)) {
+        url = LOCAL_URI;
+    } else if (utils.isFileURI(parsedUri)) {
+        url = FILE_URI;
+    } else {
+        url = parsedUri.source;
+    }
+
+    if (_whitelist.isAccessAllowed(url) && !_domains.some(function (domain) {
+        return domain.url === url;
+    })) {
+        _webviews.forEach(function (webview) {
+            addOriginAccessWhitelistEntry(webview, url, WW_URI, true);
+
+            _domains.forEach(function (domain) {
+                addOriginAccessWhitelistEntry(webview, domain.url, url, allowSubDomains);
+                addOriginAccessWhitelistEntry(webview, url, domain.url, domain.allowSubDomains);
+            });
+
+        });
+
+        _domains.push({
+            url: url,
+            allowSubDomains: allowSubDomains
+        });
+    }
+}
+
+function initializeDomains() {
+    var accessElements = config.accessList;
+
+    accessElements.forEach(function (element, index, array) {
+        var uri = (element.uri === 'WIDGET_LOCAL' ? LOCAL_URI : element.uri);
+        addDomain(uri, !!element.allowSubDomain);
+    });
+}
+
+function initializaWebview(webview) {
+    //Always allow file access from local and let the OS deal with permissions
+    addOriginAccessWhitelistEntry(webview, LOCAL_URI, FILE_URI, true);
+    addOriginAccessWhitelistEntry(webview, FILE_URI, LOCAL_URI, true);
+    //Always allow LOCAL access to URIs
+    addOriginAccessWhitelistEntry(webview, LOCAL_URI, WW_URI, true);
+
+    _domains.forEach(function (domain, domainIndex, domainArray) {
+        var i,
+            nextDomain;
+
+        if (domain.uri !== LOCAL_URI) {
+            addOriginAccessWhitelistEntry(webview, domain.url, WW_URI, true);
+        }
+
+        for (i = domainIndex + 1; i < domainArray.length; i++) {
+            nextDomain = domainArray[i];
+            addOriginAccessWhitelistEntry(webview, domain.url, nextDomain.url, nextDomain.allowSubDomains);
+            addOriginAccessWhitelistEntry(webview, nextDomain.url, domain.url, domain.allowSubDomains);
+        }
+    });
+
+}
+
+module.exports = {
+
+    addWebView: function (webview) {
+        if (_webviews.indexOf(webview) === -1) {
+            _webviews.push(webview);
+            initializaWebview(webview);
+            if (!_isInitialized) {
+                initializeDomains();
+                _isInitialized = true;
+            }
+        }
+    },
+
+    addOriginAccess: function (origin, allowSubDomains) {
+        if (!_isInitialized) {
+            initializeDomains();
+            _isInitialized = true;
+        }
+        addDomain(origin, allowSubDomains);
+    }
+};


[10/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/directory_task.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/directory_task.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/directory_task.js
new file mode 100644
index 0000000..39c1b68
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/directory_task.js
@@ -0,0 +1,29 @@
+var DirectoryTask
+  , FileTask = require('./file_task').FileTask;
+
+/**
+  @name jake
+  @namespace jake
+*/
+/**
+  @name jake.DirectoryTask
+  @constructor
+  @augments EventEmitter
+  @augments jake.Task
+  @augments jake.FileTask
+  @description A Jake DirectoryTask
+
+  @param {String} name The name of the directory to create.
+ */
+DirectoryTask = function (name) {
+  this.modTime = null;
+  // Do constructor-work only on actual instances, not when used
+  // for inheritance
+  if (arguments.length) {
+    this.init.apply(this, arguments);
+  }
+};
+DirectoryTask.prototype = new FileTask();
+DirectoryTask.prototype.constructor = DirectoryTask;
+
+exports.DirectoryTask = DirectoryTask;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/file_task.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/file_task.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/file_task.js
new file mode 100644
index 0000000..4525f01
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/file_task.js
@@ -0,0 +1,134 @@
+var fs = require('fs')
+  , Task = require('./task').Task
+  , FileTask
+  , FileBase
+  , DirectoryTask
+  , utils = require('../utils');
+
+FileBase = new (function () {
+  var isFileOrDirectory = function (t) {
+        return (t instanceof FileTask ||
+            t instanceof DirectoryTask);
+      }
+    , isFile = function (t) {
+        return (t instanceof FileTask && !(t instanceof DirectoryTask));
+      };
+
+  this.shouldRunAction = function () {
+    var runAction = false
+      , prereqs = this.prereqs
+      , prereqName
+      , prereqTask;
+
+    // No repeatsies
+    if (this.done) {
+      return false;
+    }
+    // The always-make override
+    else if (jake.program.opts['always-make']) {
+      // Run if there actually is an action
+      if (typeof this.action == 'function') {
+        return true;
+      }
+      else {
+        return false;
+      }
+    }
+    // Default case
+    else {
+      // We need either an existing file, or an action to create one.
+      // First try grabbing the actual mod-time of the file
+      try {
+        this.updateModTime();
+      }
+      // Then fall back to looking for an action
+      catch(e) {
+        if (typeof this.action == 'function') {
+          return true;
+        }
+        else {
+          throw new Error('File-task ' + this.fullName + ' has no ' +
+            'existing file, and no action to create one.');
+        }
+      }
+
+      // Compare mod-time of all the prereqs with its mod-time
+      // If any prereqs are newer, need to run the action to update
+      if (prereqs && prereqs.length) {
+        for (var i = 0, ii = prereqs.length; i < ii; i++) {
+          prereqName = prereqs[i];
+          prereqTask = jake.Task[prereqName];
+          // Run the action if:
+          // 1. The prereq is a normal task (not file/dir)
+          // 2. The prereq is a file-task with a mod-date more recent than
+          // the one for this file/dir
+          if (prereqTask) {
+            if (!isFileOrDirectory(prereqTask) ||
+                (isFile(prereqTask) && prereqTask.modTime > this.modTime)) {
+              return true;
+            }
+          }
+        }
+      }
+      // File/dir has no prereqs, and exists -- no need to run
+      else {
+        return false;
+      }
+    }
+  };
+
+  this.updateModTime = function () {
+    var stats = fs.statSync(this.name);
+    this.modTime = stats.mtime;
+  };
+
+  this.complete = function () {
+    if (!this.dummy) {
+      this.updateModTime();
+    }
+    this._currentPrereqIndex = 0;
+    this.done = true;
+    this.emit('complete');
+  };
+
+})();
+
+/**
+  @name jake
+  @namespace jake
+*/
+/**
+  @name jake.FileTask
+  @constructor
+  @augments EventEmitter
+  @augments jake.Task
+  @description A Jake FileTask
+
+  @param {String} name The name of the Task
+  @param {Array} [prereqs] Prerequisites to be run before this task
+  @param {Function} [action] The action to perform to create this file
+  @param {Object} [opts]
+    @param {Array} [opts.asyc=false] Perform this task asynchronously.
+    If you flag a task with this option, you must call the global
+    `complete` method inside the task's action, for execution to proceed
+    to the next task.
+ */
+FileTask = function (name, prereqs, action, opts) {
+  this.modTime = null;
+  this.dummy = false;
+  // Do constructor-work only on actual instances, not when used
+  // for inheritance
+  if (arguments.length) {
+    this.init.apply(this, arguments);
+  }
+};
+FileTask.prototype = new Task();
+FileTask.prototype.constructor = FileTask;
+utils.mixin(FileTask.prototype, FileBase);
+
+exports.FileTask = FileTask;
+
+// DirectoryTask is a subclass of FileTask, depends on it
+// being defined
+DirectoryTask = require('./directory_task').DirectoryTask;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/index.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/index.js
new file mode 100644
index 0000000..e9bef5e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/index.js
@@ -0,0 +1,9 @@
+
+var Task = require('./task').Task
+  , FileTask = require('./file_task').FileTask
+  , DirectoryTask = require('./directory_task').DirectoryTask;
+
+exports.Task = Task;
+exports.FileTask = FileTask;
+exports.DirectoryTask = DirectoryTask;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/task.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/task.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/task.js
new file mode 100644
index 0000000..8ed4c08
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/task/task.js
@@ -0,0 +1,240 @@
+var util = require('util') // Native Node util module
+  , fs = require('fs')
+  , path = require('path')
+  , existsSync = typeof fs.existsSync == 'function' ?
+      fs.existsSync : path.existsSync
+  , EventEmitter = require('events').EventEmitter
+  , Task
+  , TaskBase
+  , utils = require('../utils');
+
+/**
+  @name jake
+  @namespace jake
+*/
+/**
+  @name jake.Task
+  @constructor
+  @augments EventEmitter
+  @description A Jake Task
+
+  @param {String} name The name of the Task
+  @param {Array} [prereqs] Prerequisites to be run before this task
+  @param {Function} [action] The action to perform for this task
+  @param {Object} [opts]
+    @param {Array} [opts.asyc=false] Perform this task asynchronously.
+    If you flag a task with this option, you must call the global
+    `complete` method inside the task's action, for execution to proceed
+    to the next task.
+ */
+Task = function () {
+  // Do constructor-work only on actual instances, not when used
+  // for inheritance
+  if (arguments.length) {
+    this.init.apply(this, arguments);
+  }
+};
+
+util.inherits(Task, EventEmitter);
+
+TaskBase = new (function () {
+
+  // Parse any positional args attached to the task-name
+  var parsePrereqName = function (name) {
+        var taskArr = name.split('[')
+          , taskName = taskArr[0]
+          , taskArgs = [];
+        if (taskArr[1]) {
+          taskArgs = taskArr[1].replace(/\]$/, '');
+          taskArgs = taskArgs.split(',');
+        }
+        return {
+          name: taskName
+        , args: taskArgs
+        };
+      };
+
+  /**
+    @name jake.Task#event:complete
+    @event
+   */
+
+  this.init = function (name, prereqs, action, options) {
+    var opts = options || {};
+
+    this._currentPrereqIndex = 0;
+
+    this.name = name;
+    this.prereqs = prereqs;
+    this.action = action;
+    this.async = false;
+    this.done = false;
+    this.fullName = null;
+    this.description = null;
+    this.args = [];
+    this.namespace = null;
+
+    // Support legacy async-flag -- if not explicitly passed or falsy, will
+    // be set to empty-object
+    if (typeof opts == 'boolean' && opts === true) {
+      this.async = true;
+    }
+    else {
+      if (opts.async) {
+        this.async = true;
+      }
+    }
+  };
+
+  /**
+    @name jake.Task#invoke
+    @function
+    @description Runs prerequisites, then this task. If the task has already
+    been run, will not run the task again.
+   */
+  this.invoke = function () {
+    jake._invocationChain.push(this);
+    this.args = Array.prototype.slice.call(arguments);
+    this.runPrereqs();
+  };
+
+  /**
+    @name jake.Task#reenable
+    @function
+    @description Runs this task, without running any prerequisites. If the task
+    has already been run, it will still run it again.
+   */
+  this.execute = function () {
+    jake._invocationChain.push(this);
+    this.reenable();
+    this.run();
+  };
+
+  this.runPrereqs = function () {
+    if (this.prereqs && this.prereqs.length) {
+      this.nextPrereq();
+    }
+    else {
+      this.run();
+    }
+  };
+
+  this.nextPrereq = function () {
+    var self = this
+      , index = this._currentPrereqIndex
+      , name = this.prereqs[index]
+      , absolute
+      , prereq
+      , parsed
+      , filePath
+      , stats;
+
+    if (name) {
+      parsed = parsePrereqName(name);
+      absolute = parsed.name[0] === '^';
+
+      if (absolute) {
+        parsed.name = parsed.name.slice(1);
+        prereq = jake.Task[parsed.name];
+      } else {
+        prereq = this.namespace.resolve(parsed.name);
+      }
+
+      // Task doesn't exist, may be a static file
+      if (!prereq) {
+        // May be namespaced
+        filePath = name.split(':').pop();
+        // Create a dummy FileTask if file actually exists
+        if (existsSync(filePath)) {
+          // If there's not already an existing dummy FileTask for it,
+          // create one
+          prereq = jake.Task[filePath];
+          if (!prereq) {
+            stats = fs.statSync(filePath);
+            prereq = new jake.FileTask(filePath);
+            prereq.modTime = stats.mtime;
+            prereq.dummy = true;
+            // Put this dummy Task in the global Tasks list so
+            // modTime will be eval'd correctly
+            jake.Task[filePath] = prereq;
+          }
+        }
+        // Otherwise it's not a valid task
+        else {
+            throw new Error('Unknown task "' + name + '"');
+        }
+      }
+
+      // Do when done
+      if (prereq.done) {
+        self.handlePrereqComplete(prereq);
+      } else {
+        prereq.once('complete', function () {
+          self.handlePrereqComplete(prereq);
+        });
+        prereq.invoke.apply(prereq, parsed.args);
+      }
+    }
+  };
+
+  this.reenable = function (deep) {
+    var prereqs
+      , prereq;
+    this.done = false;
+    if (deep && this.prereqs) {
+      prereqs = this.prereqs;
+      for (var i = 0, ii = prereqs.length; i < ii; i++) {
+        prereq = jake.Task[prereqs[i]];
+        if (prereq) {
+          prereq.reenable(deep);
+        }
+      }
+    }
+  };
+
+  this.handlePrereqComplete = function (prereq) {
+    var self = this;
+    this._currentPrereqIndex++;
+    if (this._currentPrereqIndex < this.prereqs.length) {
+      setTimeout(function () {
+        self.nextPrereq();
+      }, 0);
+    }
+    else {
+      this.run();
+    }
+  };
+
+  this.shouldRunAction = function () {
+    if (this.done || typeof this.action != 'function') {
+      return false
+    }
+    return true;
+  };
+
+  this.run = function () {
+    var runAction = this.shouldRunAction();
+    if (runAction) {
+      try {
+        this.action.apply(this, this.args);
+      }
+      catch (e) {
+        this.emit('error', e);
+        return; // Bail out, not complete
+      }
+    }
+    if (!(runAction && this.async)) {
+      complete();
+    }
+  };
+
+  this.complete = function () {
+    this._currentPrereqIndex = 0;
+    this.done = true;
+    this.emit('complete');
+  };
+
+})();
+utils.mixin(Task.prototype, TaskBase);
+
+exports.Task = Task;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/test_task.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/test_task.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/test_task.js
new file mode 100644
index 0000000..24e1ccf
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/test_task.js
@@ -0,0 +1,216 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var path = require('path')
+  , fs = require('fs')
+  , exec = require('child_process').exec
+  , currDir = process.cwd();
+
+/**
+  @name jake
+  @namespace jake
+*/
+/**
+  @name jake.TestTask
+  @constructor
+  @description Instantiating a TestTask creates a number of Jake
+  Tasks that make running tests for your software easy.
+
+  @param {String} name The name of the project
+  @param {Function} definition Defines the list of files containing the tests,
+  and the name of the namespace/task for running them. Will be executed on the
+  instantiated TestTask (i.e., 'this', will be the TestTask instance), to set
+  the various instance-propertiess.
+
+  @example
+  var t = new jake.TestTask('bij-js', function () {
+    this.testName = 'testSpecial';
+    this.testFiles.include('test/**');
+  });
+
+ */
+var TestTask = function (name, definition) {
+  var self = this;
+
+  /**
+    @name jake.TestTask#testNam
+    @public
+    @type {String}
+    @description The name of the namespace to place the tests in, and
+    the top-level task for running tests. Defaults to "test"
+   */
+  this.testName = 'test';
+
+  /**
+    @name jake.TestTask#testFiles
+    @public
+    @type {jake.FileList}
+    @description The list of files containing tests to load
+   */
+  this.testFiles = new jake.FileList();
+
+  /**
+    @name jake.TestTask#showDescription
+    @public
+    @type {Boolean}
+    @description Show the created task when doing Jake -T
+   */
+  this.showDescription = true;
+
+  if (typeof definition == 'function') {
+    definition.call(this);
+  }
+
+  if (this.showDescription) {
+    desc('Run the tests for ' + name);
+  }
+  task(this.testName, function () {
+    var t = jake.Task[self.testName + ':run'];
+    t.invoke.apply(t, arguments);
+  }, {async: true});
+
+  namespace(self.testName, function () {
+
+    task('run', function (pat) {
+      var p = pat || '.*'
+        , re
+        , testFiles;
+
+      // Don't nest; make a top-level namespace. Don't want
+      // re-calling from inside to nest infinitely
+     jake.currentNamespace = jake.defaultNamespace;
+
+      re = new RegExp(pat);
+      testFiles = self.testFiles.toArray().filter(function (f) {
+        return (re).test(f);
+      });
+
+      // Create a namespace for all the testing tasks to live in
+      namespace(self.testName + 'Exec', function () {
+        // Each test will be a prereq for the dummy top-level task
+        var prereqs = []
+        // Continuation to pass to the async tests, wrapping `continune`
+          , next = function () {
+              complete();
+            }
+        // Create the task for this test-function
+          , createTask = function (name, action) {
+              // If the test-function is defined with a continuation
+              // param, flag the task as async
+              isAsync = !!action.length;
+
+              // Define the actual namespaced task with the name, the
+              // wrapped action, and the correc async-flag
+              task(name, createAction(name, action), {
+                async: isAsync
+              });
+            }
+        // Used as the action for the defined task for each test.
+          , createAction = function (n, a) {
+              // A wrapped function that passes in the `next` function
+              // for any tasks that run asynchronously
+              return function () {
+                var cb
+                  , msg;
+                if (a.length) {
+                  cb = next;
+                }
+                if (!(n == 'before' || n == 'after')) {
+                  if (n.toLowerCase().indexOf('test') === 0) {
+                    msg = n;
+                  }
+                  else {
+                    msg = 'test ' + n;
+                  }
+                  jake.logger.log(n);
+                }
+                // 'this' will be the task when action is run
+                return a.call(this, cb);
+              };
+            }
+          // Dummy top-level task for everything to be prereqs for
+          , topLevel;
+
+        // Pull in each test-file, and iterate over any exported
+        // test-functions. Register each test-function as a prereq task
+        testFiles.forEach(function (file) {
+          var exp = require(path.join(currDir, file))
+            , name
+            , action
+            , banner
+            , isAsync;
+
+          // Create a namespace for each filename, so test-name collisions
+          // won't be a problem
+          namespace(file, function () {
+
+            // For displaying file banner
+            banner = '*** Running ' + file + ' ***';
+            prereqs.push(self.testName + 'Exec:' + file + ':' + banner);
+            // Create the task
+            createTask(banner, function () {});
+
+            if (typeof exp.before == 'function') {
+              prereqs.push(self.testName + 'Exec:' + file + ':before');
+              // Create the task
+              createTask('before', exp.before);
+            }
+
+            // Walk each exported function, and create a task for each
+            for (var p in exp) {
+              if (p == 'before' || p == 'after') {
+                continue;
+              }
+              // Add the namespace:name of this test to the list of prereqs
+              // for the dummy top-level task
+              prereqs.push(self.testName + 'Exec:' + file + ':' + p);
+              // Create the task
+              createTask(p, exp[p]);
+            }
+
+            if (typeof exp.after == 'function') {
+              prereqs.push(self.testName + 'Exec:' + file + ':after');
+              // Create the task
+              createTask('after', exp.after);
+            }
+
+          });
+        });
+
+        // Create the dummy top-level task. When calling a task internally
+        // with `invoke` that is async (or has async prereqs), have to listen
+        // for the 'complete' event to know when it's done
+        topLevel = task('__top__', prereqs);
+        topLevel.addListener('complete', function () {
+          jake.logger.log('All tests ran successfully');
+          complete();
+        });
+
+        topLevel.invoke(); // Do the thing!
+      });
+
+
+    }, {async: true});
+  });
+
+
+};
+
+jake.TestTask = TestTask;
+exports.TestTask = TestTask;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/index.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/index.js
new file mode 100644
index 0000000..389e9c3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/index.js
@@ -0,0 +1,242 @@
+/*
+ * Jake JavaScript build tool
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+
+var util = require('util') // Native Node util module
+  , exec = require('child_process').exec
+  , spawn = require('child_process').spawn
+  , EventEmitter = require('events').EventEmitter
+  , utils = require('utilities')
+  , logger = require('./logger')
+  , Exec;
+
+var parseArgs = function (argumentsObj) {
+    var args
+      , arg
+      , cmds
+      , callback
+      , opts = {
+          interactive: false
+        , printStdout: false
+        , printStderr: false
+        , breakOnError: true
+        };
+
+    args = Array.prototype.slice.call(argumentsObj);
+
+    cmds = args.shift();
+    // Arrayize if passed a single string command
+    if (typeof cmds == 'string') {
+      cmds = [cmds];
+    }
+    // Make a copy if it's an actual list
+    else {
+      cmds = cmds.slice();
+    }
+
+    // Get optional callback or opts
+    while((arg = args.shift())) {
+      if (typeof arg == 'function') {
+        callback = arg;
+      }
+      else if (typeof arg == 'object') {
+        utils.mixin(opts, arg);
+      }
+    }
+
+    // Backward-compat shim
+    if (typeof opts.stdout != 'undefined') {
+      opts.printStdout = opts.stdout;
+      delete opts.stdout;
+    }
+    if (typeof opts.stderr != 'undefined') {
+      opts.printStderr = opts.stderr;
+      delete opts.stderr;
+    }
+
+    return {
+      cmds: cmds
+    , opts: opts
+    , callback: callback
+    }
+};
+
+/**
+  @name jake
+  @namespace jake
+*/
+utils.mixin(utils, new (function () {
+  /**
+    @name jake.exec
+    @static
+    @function
+    @description Executes shell-commands asynchronously with an optional
+    final callback.
+    `
+    @param {String[]} cmds The list of shell-commands to execute
+    @param {Object} [opts]
+      @param {Boolean} [opts.printStdout=false] Print stdout from each command
+      @param {Boolean} [opts.printStderr=false] Print stderr from each command
+      @param {Boolean} [opts.breakOnError=true] Stop further execution on
+      the first error.
+    @param {Function} [callback] Callback to run after executing  the
+    commands
+
+    @example
+    var cmds = [
+          'echo "showing directories"'
+        , 'ls -al | grep ^d'
+        , 'echo "moving up a directory"'
+        , 'cd ../'
+        ]
+      , callback = function () {
+          console.log('Finished running commands.');
+        }
+    jake.exec(cmds, {stdout: true}, callback);
+   */
+  this.exec = function (a, b, c) {
+    var parsed = parseArgs(arguments)
+      , cmds = parsed.cmds
+      , opts = parsed.opts
+      , callback = parsed.callback;
+
+    var ex = new Exec(cmds, opts, callback);
+
+    if (!opts.interactive) {
+      if (opts.printStdout) {
+        ex.addListener('stdout', function (data) {
+          console.log(utils.string.rtrim(data.toString()));
+        });
+      }
+      if (opts.printStderr) {
+        ex.addListener('stderr', function (data) {
+          console.log(utils.string.rtrim(data.toString()));
+        });
+      }
+    }
+    ex.addListener('error', function (msg, code) {
+      if (opts.breakOnError) {
+        fail(msg, code);
+      }
+    });
+    ex.run();
+
+    return ex;
+  };
+
+  this.createExec = function (a, b, c) {
+    return new Exec(a, b, c);
+  };
+
+})());
+
+Exec = function () {
+  var parsed = parseArgs(arguments)
+    , cmds = parsed.cmds
+    , opts = parsed.opts
+    , callback = parsed.callback;
+
+  this._cmds = cmds;
+  this._callback = callback;
+  this._config = opts;
+};
+
+util.inherits(Exec, EventEmitter);
+
+utils.mixin(Exec.prototype, new (function () {
+
+  var _run = function () {
+        var self = this
+          , sh
+          , cmd
+          , args
+          , next = this._cmds.shift()
+          , config = this._config
+          , errData = '';
+
+        // Keep running as long as there are commands in the array
+        if (next) {
+          this.emit('cmdStart', next);
+
+          // Ganking part of Node's child_process.exec to get cmdline args parsed
+          cmd = '/bin/sh';
+          args = ['-c', next];
+
+          if (process.platform == 'win32') {
+            cmd = 'cmd';
+            args = ['/c', next];
+          }
+
+          if (config.interactive) {
+            sh = spawn(cmd, args, { stdio: [process.stdin, process.stdout, 'pipe']});
+          }
+          else {
+            sh = spawn(cmd, args, { stdio: [process.stdin, 'pipe', 'pipe'] });
+            // Out
+            sh.stdout.on('data', function (data) {
+              self.emit('stdout', data);
+            });
+          }
+
+          // Err
+          sh.stderr.on('data', function (data) {
+            var d = data.toString();
+            self.emit('stderr', data);
+            // Accumulate the error-data so we can use it as the
+            // stack if the process exits with an error
+            errData += d;
+          });
+
+          // Exit, handle err or run next
+          sh.on('exit', function (code) {
+            var msg;
+            if (code != 0) {
+              msg = errData || 'Process exited with error.';
+              msg = utils.string.trim(msg);
+              self.emit('error', msg, code);
+            }
+            if (code == 0 || !config.breakOnError) {
+              self.emit('cmdEnd', next);
+              _run.call(self);
+            }
+          });
+
+        }
+        else {
+          self.emit('end');
+          if (typeof self._callback == 'function') {
+            self._callback();
+          }
+        }
+      };
+
+  this.append = function (cmd) {
+    this._cmds.push(cmd);
+  };
+
+  this.run = function () {
+    _run.call(this);
+  };
+
+})());
+
+utils.Exec = Exec;
+utils.logger = logger;
+
+module.exports = utils;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/logger.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/logger.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/logger.js
new file mode 100644
index 0000000..71e0d13
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/lib/utils/logger.js
@@ -0,0 +1,24 @@
+var util = require('util');
+
+var logger = new (function () {
+  var _output = function (type, out) {
+    var quiet = typeof jake != 'undefined' && jake.program &&
+        jake.program.opts && jake.program.opts.quiet
+      , msg;
+    if (!quiet) {
+      msg = typeof out == 'string' ? out : util.inspect(out);
+      console[type](msg);
+    }
+  };
+
+  this.log = function (out) {
+    _output('log', out);
+  };
+
+  this.error = function (out) {
+    _output('error', out);
+  };
+
+})();
+
+module.exports = logger;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE
new file mode 100644
index 0000000..05a4010
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/README.md b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/README.md
new file mode 100644
index 0000000..6fd07d2
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/README.md
@@ -0,0 +1,218 @@
+# minimatch
+
+A minimal matching utility.
+
+[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)
+
+
+This is the matching library used internally by npm.
+
+Eventually, it will replace the C binding in node-glob.
+
+It works by converting glob expressions into JavaScript `RegExp`
+objects.
+
+## Usage
+
+```javascript
+var minimatch = require("minimatch")
+
+minimatch("bar.foo", "*.foo") // true!
+minimatch("bar.foo", "*.bar") // false!
+```
+
+## Features
+
+Supports these glob features:
+
+* Brace Expansion
+* Extended glob matching
+* "Globstar" `**` matching
+
+See:
+
+* `man sh`
+* `man bash`
+* `man 3 fnmatch`
+* `man 5 gitignore`
+
+### Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between minimatch and other
+implementations, and are intentional.
+
+If the pattern starts with a `!` character, then it is negated.  Set the
+`nonegate` flag to suppress this behavior, and treat leading `!`
+characters normally.  This is perhaps relevant if you wish to start the
+pattern with a negative extglob pattern like `!(a|B)`.  Multiple `!`
+characters at the start of a pattern will negate the pattern multiple
+times.
+
+If a pattern starts with `#`, then it is treated as a comment, and
+will not match anything.  Use `\#` to match a literal `#` at the
+start of a line, or set the `nocomment` flag to suppress this behavior.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.1, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.  **Note that this is different from the way that `**` is
+handled by ruby's `Dir` class.**
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then minimatch.match returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
+
+
+## Minimatch Class
+
+Create a minimatch object by instanting the `minimatch.Minimatch` class.
+
+```javascript
+var Minimatch = require("minimatch").Minimatch
+var mm = new Minimatch(pattern, options)
+```
+
+### Properties
+
+* `pattern` The original pattern the minimatch object represents.
+* `options` The options supplied to the constructor.
+* `set` A 2-dimensional array of regexp or string expressions.
+  Each row in the
+  array corresponds to a brace-expanded pattern.  Each item in the row
+  corresponds to a single path-part.  For example, the pattern
+  `{a,b/c}/d` would expand to a set of patterns like:
+
+        [ [ a, d ]
+        , [ b, c, d ] ]
+
+    If a portion of the pattern doesn't have any "magic" in it
+    (that is, it's something like `"foo"` rather than `fo*o?`), then it
+    will be left as a string rather than converted to a regular
+    expression.
+
+* `regexp` Created by the `makeRe` method.  A single regular expression
+  expressing the entire pattern.  This is useful in cases where you wish
+  to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
+* `negate` True if the pattern is negated.
+* `comment` True if the pattern is a comment.
+* `empty` True if the pattern is `""`.
+
+### Methods
+
+* `makeRe` Generate the `regexp` member if necessary, and return it.
+  Will return `false` if the pattern is invalid.
+* `match(fname)` Return true if the filename matches the pattern, or
+  false otherwise.
+* `matchOne(fileArray, patternArray, partial)` Take a `/`-split
+  filename, and match it against a single row in the `regExpSet`.  This
+  method is mainly for internal use, but is exposed so that it can be
+  used by a glob-walker that needs to avoid excessive filesystem calls.
+
+All other methods are internal, and will be called as necessary.
+
+## Functions
+
+The top-level exported function has a `cache` property, which is an LRU
+cache set to store 100 items.  So, calling these methods repeatedly
+with the same pattern and options will use the same Minimatch object,
+saving the cost of parsing it multiple times.
+
+### minimatch(path, pattern, options)
+
+Main export.  Tests a path against the pattern using the options.
+
+```javascript
+var isJS = minimatch(file, "*.js", { matchBase: true })
+```
+
+### minimatch.filter(pattern, options)
+
+Returns a function that tests its
+supplied argument, suitable for use with `Array.filter`.  Example:
+
+```javascript
+var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))
+```
+
+### minimatch.match(list, pattern, options)
+
+Match against the list of
+files, in the style of fnmatch or glob.  If nothing is matched, and
+options.nonull is set, then return a list containing the pattern itself.
+
+```javascript
+var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}))
+```
+
+### minimatch.makeRe(pattern, options)
+
+Make a regular expression object from the pattern.
+
+## Options
+
+All options are `false` by default.
+
+### debug
+
+Dump a ton of stuff to stderr.
+
+### nobrace
+
+Do not expand `{a,b}` and `{1..3}` brace sets.
+
+### noglobstar
+
+Disable `**` matching against multiple folder names.
+
+### dot
+
+Allow patterns to match filenames starting with a period, even if
+the pattern does not explicitly have a period in that spot.
+
+Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
+is set.
+
+### noext
+
+Disable "extglob" style patterns like `+(a|b)`.
+
+### nocase
+
+Perform a case-insensitive match.
+
+### nonull
+
+When a match is not found by `minimatch.match`, return a list containing
+the pattern itself.  When set, an empty list is returned if there are
+no matches.
+
+### matchBase
+
+If set, then patterns without slashes will be matched
+against the basename of the path if it contains slashes.  For example,
+`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
+
+### nocomment
+
+Suppress the behavior of treating `#` at the start of a pattern as a
+comment.
+
+### nonegate
+
+Suppress the behavior of treating a leading `!` character as negation.
+
+### flipNegate
+
+Returns from negate expressions the same as if they were not negated.
+(Ie, true on a hit, false on a miss.)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/minimatch.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/minimatch.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/minimatch.js
new file mode 100644
index 0000000..405746b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/minimatch.js
@@ -0,0 +1,1079 @@
+;(function (require, exports, module, platform) {
+
+if (module) module.exports = minimatch
+else exports.minimatch = minimatch
+
+if (!require) {
+  require = function (id) {
+    switch (id) {
+      case "sigmund": return function sigmund (obj) {
+        return JSON.stringify(obj)
+      }
+      case "path": return { basename: function (f) {
+        f = f.split(/[\/\\]/)
+        var e = f.pop()
+        if (!e) e = f.pop()
+        return e
+      }}
+      case "lru-cache": return function LRUCache () {
+        // not quite an LRU, but still space-limited.
+        var cache = {}
+        var cnt = 0
+        this.set = function (k, v) {
+          cnt ++
+          if (cnt >= 100) cache = {}
+          cache[k] = v
+        }
+        this.get = function (k) { return cache[k] }
+      }
+    }
+  }
+}
+
+minimatch.Minimatch = Minimatch
+
+var LRU = require("lru-cache")
+  , cache = minimatch.cache = new LRU({max: 100})
+  , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
+  , sigmund = require("sigmund")
+
+var path = require("path")
+  // any single thing other than /
+  // don't need to escape / when using new RegExp()
+  , qmark = "[^/]"
+
+  // * => any number of characters
+  , star = qmark + "*?"
+
+  // ** when dots are allowed.  Anything goes, except .. and .
+  // not (^ or / followed by one or two dots followed by $ or /),
+  // followed by anything, any number of times.
+  , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?"
+
+  // not a ^ or / followed by a dot,
+  // followed by anything, any number of times.
+  , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?"
+
+  // characters that need to be escaped in RegExp.
+  , reSpecials = charSet("().*{}+?[]^$\\!")
+
+// "abc" -> { a:true, b:true, c:true }
+function charSet (s) {
+  return s.split("").reduce(function (set, c) {
+    set[c] = true
+    return set
+  }, {})
+}
+
+// normalizes slashes.
+var slashSplit = /\/+/
+
+minimatch.monkeyPatch = monkeyPatch
+function monkeyPatch () {
+  var desc = Object.getOwnPropertyDescriptor(String.prototype, "match")
+  var orig = desc.value
+  desc.value = function (p) {
+    if (p instanceof Minimatch) return p.match(this)
+    return orig.call(this, p)
+  }
+  Object.defineProperty(String.prototype, desc)
+}
+
+minimatch.filter = filter
+function filter (pattern, options) {
+  options = options || {}
+  return function (p, i, list) {
+    return minimatch(p, pattern, options)
+  }
+}
+
+function ext (a, b) {
+  a = a || {}
+  b = b || {}
+  var t = {}
+  Object.keys(b).forEach(function (k) {
+    t[k] = b[k]
+  })
+  Object.keys(a).forEach(function (k) {
+    t[k] = a[k]
+  })
+  return t
+}
+
+minimatch.defaults = function (def) {
+  if (!def || !Object.keys(def).length) return minimatch
+
+  var orig = minimatch
+
+  var m = function minimatch (p, pattern, options) {
+    return orig.minimatch(p, pattern, ext(def, options))
+  }
+
+  m.Minimatch = function Minimatch (pattern, options) {
+    return new orig.Minimatch(pattern, ext(def, options))
+  }
+
+  return m
+}
+
+Minimatch.defaults = function (def) {
+  if (!def || !Object.keys(def).length) return Minimatch
+  return minimatch.defaults(def).Minimatch
+}
+
+
+function minimatch (p, pattern, options) {
+  if (typeof pattern !== "string") {
+    throw new TypeError("glob pattern string required")
+  }
+
+  if (!options) options = {}
+
+  // shortcut: comments match nothing.
+  if (!options.nocomment && pattern.charAt(0) === "#") {
+    return false
+  }
+
+  // "" only matches ""
+  if (pattern.trim() === "") return p === ""
+
+  return new Minimatch(pattern, options).match(p)
+}
+
+function Minimatch (pattern, options) {
+  if (!(this instanceof Minimatch)) {
+    return new Minimatch(pattern, options, cache)
+  }
+
+  if (typeof pattern !== "string") {
+    throw new TypeError("glob pattern string required")
+  }
+
+  if (!options) options = {}
+  pattern = pattern.trim()
+
+  // windows: need to use /, not \
+  // On other platforms, \ is a valid (albeit bad) filename char.
+  if (platform === "win32") {
+    pattern = pattern.split("\\").join("/")
+  }
+
+  // lru storage.
+  // these things aren't particularly big, but walking down the string
+  // and turning it into a regexp can get pretty costly.
+  var cacheKey = pattern + "\n" + sigmund(options)
+  var cached = minimatch.cache.get(cacheKey)
+  if (cached) return cached
+  minimatch.cache.set(cacheKey, this)
+
+  this.options = options
+  this.set = []
+  this.pattern = pattern
+  this.regexp = null
+  this.negate = false
+  this.comment = false
+  this.empty = false
+
+  // make the set of regexps etc.
+  this.make()
+}
+
+Minimatch.prototype.make = make
+function make () {
+  // don't do it more than once.
+  if (this._made) return
+
+  var pattern = this.pattern
+  var options = this.options
+
+  // empty patterns and comments match nothing.
+  if (!options.nocomment && pattern.charAt(0) === "#") {
+    this.comment = true
+    return
+  }
+  if (!pattern) {
+    this.empty = true
+    return
+  }
+
+  // step 1: figure out negation, etc.
+  this.parseNegate()
+
+  // step 2: expand braces
+  var set = this.globSet = this.braceExpand()
+
+  if (options.debug) console.error(this.pattern, set)
+
+  // step 3: now we have a set, so turn each one into a series of path-portion
+  // matching patterns.
+  // These will be regexps, except in the case of "**", which is
+  // set to the GLOBSTAR object for globstar behavior,
+  // and will not contain any / characters
+  set = this.globParts = set.map(function (s) {
+    return s.split(slashSplit)
+  })
+
+  if (options.debug) console.error(this.pattern, set)
+
+  // glob --> regexps
+  set = set.map(function (s, si, set) {
+    return s.map(this.parse, this)
+  }, this)
+
+  if (options.debug) console.error(this.pattern, set)
+
+  // filter out everything that didn't compile properly.
+  set = set.filter(function (s) {
+    return -1 === s.indexOf(false)
+  })
+
+  if (options.debug) console.error(this.pattern, set)
+
+  this.set = set
+}
+
+Minimatch.prototype.parseNegate = parseNegate
+function parseNegate () {
+  var pattern = this.pattern
+    , negate = false
+    , options = this.options
+    , negateOffset = 0
+
+  if (options.nonegate) return
+
+  for ( var i = 0, l = pattern.length
+      ; i < l && pattern.charAt(i) === "!"
+      ; i ++) {
+    negate = !negate
+    negateOffset ++
+  }
+
+  if (negateOffset) this.pattern = pattern.substr(negateOffset)
+  this.negate = negate
+}
+
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+minimatch.braceExpand = function (pattern, options) {
+  return new Minimatch(pattern, options).braceExpand()
+}
+
+Minimatch.prototype.braceExpand = braceExpand
+function braceExpand (pattern, options) {
+  options = options || this.options
+  pattern = typeof pattern === "undefined"
+    ? this.pattern : pattern
+
+  if (typeof pattern === "undefined") {
+    throw new Error("undefined pattern")
+  }
+
+  if (options.nobrace ||
+      !pattern.match(/\{.*\}/)) {
+    // shortcut. no need to expand.
+    return [pattern]
+  }
+
+  var escaping = false
+
+  // examples and comments refer to this crazy pattern:
+  // a{b,c{d,e},{f,g}h}x{y,z}
+  // expected:
+  // abxy
+  // abxz
+  // acdxy
+  // acdxz
+  // acexy
+  // acexz
+  // afhxy
+  // afhxz
+  // aghxy
+  // aghxz
+
+  // everything before the first \{ is just a prefix.
+  // So, we pluck that off, and work with the rest,
+  // and then prepend it to everything we find.
+  if (pattern.charAt(0) !== "{") {
+    // console.error(pattern)
+    var prefix = null
+    for (var i = 0, l = pattern.length; i < l; i ++) {
+      var c = pattern.charAt(i)
+      // console.error(i, c)
+      if (c === "\\") {
+        escaping = !escaping
+      } else if (c === "{" && !escaping) {
+        prefix = pattern.substr(0, i)
+        break
+      }
+    }
+
+    // actually no sets, all { were escaped.
+    if (prefix === null) {
+      // console.error("no sets")
+      return [pattern]
+    }
+
+    var tail = braceExpand(pattern.substr(i), options)
+    return tail.map(function (t) {
+      return prefix + t
+    })
+  }
+
+  // now we have something like:
+  // {b,c{d,e},{f,g}h}x{y,z}
+  // walk through the set, expanding each part, until
+  // the set ends.  then, we'll expand the suffix.
+  // If the set only has a single member, then'll put the {} back
+
+  // first, handle numeric sets, since they're easier
+  var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/)
+  if (numset) {
+    // console.error("numset", numset[1], numset[2])
+    var suf = braceExpand(pattern.substr(numset[0].length), options)
+      , start = +numset[1]
+      , end = +numset[2]
+      , inc = start > end ? -1 : 1
+      , set = []
+    for (var i = start; i != (end + inc); i += inc) {
+      // append all the suffixes
+      for (var ii = 0, ll = suf.length; ii < ll; ii ++) {
+        set.push(i + suf[ii])
+      }
+    }
+    return set
+  }
+
+  // ok, walk through the set
+  // We hope, somewhat optimistically, that there
+  // will be a } at the end.
+  // If the closing brace isn't found, then the pattern is
+  // interpreted as braceExpand("\\" + pattern) so that
+  // the leading \{ will be interpreted literally.
+  var i = 1 // skip the \{
+    , depth = 1
+    , set = []
+    , member = ""
+    , sawEnd = false
+    , escaping = false
+
+  function addMember () {
+    set.push(member)
+    member = ""
+  }
+
+  // console.error("Entering for")
+  FOR: for (i = 1, l = pattern.length; i < l; i ++) {
+    var c = pattern.charAt(i)
+    // console.error("", i, c)
+
+    if (escaping) {
+      escaping = false
+      member += "\\" + c
+    } else {
+      switch (c) {
+        case "\\":
+          escaping = true
+          continue
+
+        case "{":
+          depth ++
+          member += "{"
+          continue
+
+        case "}":
+          depth --
+          // if this closes the actual set, then we're done
+          if (depth === 0) {
+            addMember()
+            // pluck off the close-brace
+            i ++
+            break FOR
+          } else {
+            member += c
+            continue
+          }
+
+        case ",":
+          if (depth === 1) {
+            addMember()
+          } else {
+            member += c
+          }
+          continue
+
+        default:
+          member += c
+          continue
+      } // switch
+    } // else
+  } // for
+
+  // now we've either finished the set, and the suffix is
+  // pattern.substr(i), or we have *not* closed the set,
+  // and need to escape the leading brace
+  if (depth !== 0) {
+    // console.error("didn't close", pattern)
+    return braceExpand("\\" + pattern, options)
+  }
+
+  // x{y,z} -> ["xy", "xz"]
+  // console.error("set", set)
+  // console.error("suffix", pattern.substr(i))
+  var suf = braceExpand(pattern.substr(i), options)
+  // ["b", "c{d,e}","{f,g}h"] ->
+  //   [["b"], ["cd", "ce"], ["fh", "gh"]]
+  var addBraces = set.length === 1
+  // console.error("set pre-expanded", set)
+  set = set.map(function (p) {
+    return braceExpand(p, options)
+  })
+  // console.error("set expanded", set)
+
+
+  // [["b"], ["cd", "ce"], ["fh", "gh"]] ->
+  //   ["b", "cd", "ce", "fh", "gh"]
+  set = set.reduce(function (l, r) {
+    return l.concat(r)
+  })
+
+  if (addBraces) {
+    set = set.map(function (s) {
+      return "{" + s + "}"
+    })
+  }
+
+  // now attach the suffixes.
+  var ret = []
+  for (var i = 0, l = set.length; i < l; i ++) {
+    for (var ii = 0, ll = suf.length; ii < ll; ii ++) {
+      ret.push(set[i] + suf[ii])
+    }
+  }
+  return ret
+}
+
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+Minimatch.prototype.parse = parse
+var SUBPARSE = {}
+function parse (pattern, isSub) {
+  var options = this.options
+
+  // shortcuts
+  if (!options.noglobstar && pattern === "**") return GLOBSTAR
+  if (pattern === "") return ""
+
+  var re = ""
+    , hasMagic = !!options.nocase
+    , escaping = false
+    // ? => one single character
+    , patternListStack = []
+    , plType
+    , stateChar
+    , inClass = false
+    , reClassStart = -1
+    , classStart = -1
+    // . and .. never match anything that doesn't start with .,
+    // even when options.dot is set.
+    , patternStart = pattern.charAt(0) === "." ? "" // anything
+      // not (start or / followed by . or .. followed by / or end)
+      : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))"
+      : "(?!\\.)"
+
+  function clearStateChar () {
+    if (stateChar) {
+      // we had some state-tracking character
+      // that wasn't consumed by this pass.
+      switch (stateChar) {
+        case "*":
+          re += star
+          hasMagic = true
+          break
+        case "?":
+          re += qmark
+          hasMagic = true
+          break
+        default:
+          re += "\\"+stateChar
+          break
+      }
+      stateChar = false
+    }
+  }
+
+  for ( var i = 0, len = pattern.length, c
+      ; (i < len) && (c = pattern.charAt(i))
+      ; i ++ ) {
+
+    if (options.debug) {
+      console.error("%s\t%s %s %j", pattern, i, re, c)
+    }
+
+    // skip over any that are escaped.
+    if (escaping && reSpecials[c]) {
+      re += "\\" + c
+      escaping = false
+      continue
+    }
+
+    SWITCH: switch (c) {
+      case "/":
+        // completely not allowed, even escaped.
+        // Should already be path-split by now.
+        return false
+
+      case "\\":
+        clearStateChar()
+        escaping = true
+        continue
+
+      // the various stateChar values
+      // for the "extglob" stuff.
+      case "?":
+      case "*":
+      case "+":
+      case "@":
+      case "!":
+        if (options.debug) {
+          console.error("%s\t%s %s %j <-- stateChar", pattern, i, re, c)
+        }
+
+        // all of those are literals inside a class, except that
+        // the glob [!a] means [^a] in regexp
+        if (inClass) {
+          if (c === "!" && i === classStart + 1) c = "^"
+          re += c
+          continue
+        }
+
+        // if we already have a stateChar, then it means
+        // that there was something like ** or +? in there.
+        // Handle the stateChar, then proceed with this one.
+        clearStateChar()
+        stateChar = c
+        // if extglob is disabled, then +(asdf|foo) isn't a thing.
+        // just clear the statechar *now*, rather than even diving into
+        // the patternList stuff.
+        if (options.noext) clearStateChar()
+        continue
+
+      case "(":
+        if (inClass) {
+          re += "("
+          continue
+        }
+
+        if (!stateChar) {
+          re += "\\("
+          continue
+        }
+
+        plType = stateChar
+        patternListStack.push({ type: plType
+                              , start: i - 1
+                              , reStart: re.length })
+        // negation is (?:(?!js)[^/]*)
+        re += stateChar === "!" ? "(?:(?!" : "(?:"
+        stateChar = false
+        continue
+
+      case ")":
+        if (inClass || !patternListStack.length) {
+          re += "\\)"
+          continue
+        }
+
+        hasMagic = true
+        re += ")"
+        plType = patternListStack.pop().type
+        // negation is (?:(?!js)[^/]*)
+        // The others are (?:<pattern>)<type>
+        switch (plType) {
+          case "!":
+            re += "[^/]*?)"
+            break
+          case "?":
+          case "+":
+          case "*": re += plType
+          case "@": break // the default anyway
+        }
+        continue
+
+      case "|":
+        if (inClass || !patternListStack.length || escaping) {
+          re += "\\|"
+          escaping = false
+          continue
+        }
+
+        re += "|"
+        continue
+
+      // these are mostly the same in regexp and glob
+      case "[":
+        // swallow any state-tracking char before the [
+        clearStateChar()
+
+        if (inClass) {
+          re += "\\" + c
+          continue
+        }
+
+        inClass = true
+        classStart = i
+        reClassStart = re.length
+        re += c
+        continue
+
+      case "]":
+        //  a right bracket shall lose its special
+        //  meaning and represent itself in
+        //  a bracket expression if it occurs
+        //  first in the list.  -- POSIX.2 2.8.3.2
+        if (i === classStart + 1 || !inClass) {
+          re += "\\" + c
+          escaping = false
+          continue
+        }
+
+        // finish up the class.
+        hasMagic = true
+        inClass = false
+        re += c
+        continue
+
+      default:
+        // swallow any state char that wasn't consumed
+        clearStateChar()
+
+        if (escaping) {
+          // no need
+          escaping = false
+        } else if (reSpecials[c]
+                   && !(c === "^" && inClass)) {
+          re += "\\"
+        }
+
+        re += c
+
+    } // switch
+  } // for
+
+
+  // handle the case where we left a class open.
+  // "[abc" is valid, equivalent to "\[abc"
+  if (inClass) {
+    // split where the last [ was, and escape it
+    // this is a huge pita.  We now have to re-walk
+    // the contents of the would-be class to re-translate
+    // any characters that were passed through as-is
+    var cs = pattern.substr(classStart + 1)
+      , sp = this.parse(cs, SUBPARSE)
+    re = re.substr(0, reClassStart) + "\\[" + sp[0]
+    hasMagic = hasMagic || sp[1]
+  }
+
+  // handle the case where we had a +( thing at the *end*
+  // of the pattern.
+  // each pattern list stack adds 3 chars, and we need to go through
+  // and escape any | chars that were passed through as-is for the regexp.
+  // Go through and escape them, taking care not to double-escape any
+  // | chars that were already escaped.
+  var pl
+  while (pl = patternListStack.pop()) {
+    var tail = re.slice(pl.reStart + 3)
+    // maybe some even number of \, then maybe 1 \, followed by a |
+    tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {
+      if (!$2) {
+        // the | isn't already escaped, so escape it.
+        $2 = "\\"
+      }
+
+      // need to escape all those slashes *again*, without escaping the
+      // one that we need for escaping the | character.  As it works out,
+      // escaping an even number of slashes can be done by simply repeating
+      // it exactly after itself.  That's why this trick works.
+      //
+      // I am sorry that you have to see this.
+      return $1 + $1 + $2 + "|"
+    })
+
+    // console.error("tail=%j\n   %s", tail, tail)
+    var t = pl.type === "*" ? star
+          : pl.type === "?" ? qmark
+          : "\\" + pl.type
+
+    hasMagic = true
+    re = re.slice(0, pl.reStart)
+       + t + "\\("
+       + tail
+  }
+
+  // handle trailing things that only matter at the very end.
+  clearStateChar()
+  if (escaping) {
+    // trailing \\
+    re += "\\\\"
+  }
+
+  // only need to apply the nodot start if the re starts with
+  // something that could conceivably capture a dot
+  var addPatternStart = false
+  switch (re.charAt(0)) {
+    case ".":
+    case "[":
+    case "(": addPatternStart = true
+  }
+
+  // if the re is not "" at this point, then we need to make sure
+  // it doesn't match against an empty path part.
+  // Otherwise a/* will match a/, which it should not.
+  if (re !== "" && hasMagic) re = "(?=.)" + re
+
+  if (addPatternStart) re = patternStart + re
+
+  // parsing just a piece of a larger pattern.
+  if (isSub === SUBPARSE) {
+    return [ re, hasMagic ]
+  }
+
+  // skip the regexp for non-magical patterns
+  // unescape anything in it, though, so that it'll be
+  // an exact match against a file etc.
+  if (!hasMagic) {
+    return globUnescape(pattern)
+  }
+
+  var flags = options.nocase ? "i" : ""
+    , regExp = new RegExp("^" + re + "$", flags)
+
+  regExp._glob = pattern
+  regExp._src = re
+
+  return regExp
+}
+
+minimatch.makeRe = function (pattern, options) {
+  return new Minimatch(pattern, options || {}).makeRe()
+}
+
+Minimatch.prototype.makeRe = makeRe
+function makeRe () {
+  if (this.regexp || this.regexp === false) return this.regexp
+
+  // at this point, this.set is a 2d array of partial
+  // pattern strings, or "**".
+  //
+  // It's better to use .match().  This function shouldn't
+  // be used, really, but it's pretty convenient sometimes,
+  // when you just want to work with a regex.
+  var set = this.set
+
+  if (!set.length) return this.regexp = false
+  var options = this.options
+
+  var twoStar = options.noglobstar ? star
+      : options.dot ? twoStarDot
+      : twoStarNoDot
+    , flags = options.nocase ? "i" : ""
+
+  var re = set.map(function (pattern) {
+    return pattern.map(function (p) {
+      return (p === GLOBSTAR) ? twoStar
+           : (typeof p === "string") ? regExpEscape(p)
+           : p._src
+    }).join("\\\/")
+  }).join("|")
+
+  // must match entire pattern
+  // ending in a * or ** will make it less strict.
+  re = "^(?:" + re + ")$"
+
+  // can match anything, as long as it's not this.
+  if (this.negate) re = "^(?!" + re + ").*$"
+
+  try {
+    return this.regexp = new RegExp(re, flags)
+  } catch (ex) {
+    return this.regexp = false
+  }
+}
+
+minimatch.match = function (list, pattern, options) {
+  var mm = new Minimatch(pattern, options)
+  list = list.filter(function (f) {
+    return mm.match(f)
+  })
+  if (options.nonull && !list.length) {
+    list.push(pattern)
+  }
+  return list
+}
+
+Minimatch.prototype.match = match
+function match (f, partial) {
+  // console.error("match", f, this.pattern)
+  // short-circuit in the case of busted things.
+  // comments, etc.
+  if (this.comment) return false
+  if (this.empty) return f === ""
+
+  if (f === "/" && partial) return true
+
+  var options = this.options
+
+  // windows: need to use /, not \
+  // On other platforms, \ is a valid (albeit bad) filename char.
+  if (platform === "win32") {
+    f = f.split("\\").join("/")
+  }
+
+  // treat the test path as a set of pathparts.
+  f = f.split(slashSplit)
+  if (options.debug) {
+    console.error(this.pattern, "split", f)
+  }
+
+  // just ONE of the pattern sets in this.set needs to match
+  // in order for it to be valid.  If negating, then just one
+  // match means that we have failed.
+  // Either way, return on the first hit.
+
+  var set = this.set
+  // console.error(this.pattern, "set", set)
+
+  for (var i = 0, l = set.length; i < l; i ++) {
+    var pattern = set[i]
+    var hit = this.matchOne(f, pattern, partial)
+    if (hit) {
+      if (options.flipNegate) return true
+      return !this.negate
+    }
+  }
+
+  // didn't get any hits.  this is success if it's a negative
+  // pattern, failure otherwise.
+  if (options.flipNegate) return false
+  return this.negate
+}
+
+// set partial to true to test if, for example,
+// "/a/b" matches the start of "/*/b/*/d"
+// Partial means, if you run out of file before you run
+// out of pattern, then that's fine, as long as all
+// the parts match.
+Minimatch.prototype.matchOne = function (file, pattern, partial) {
+  var options = this.options
+
+  if (options.debug) {
+    console.error("matchOne",
+                  { "this": this
+                  , file: file
+                  , pattern: pattern })
+  }
+
+  if (options.matchBase && pattern.length === 1) {
+    file = path.basename(file.join("/")).split("/")
+  }
+
+  if (options.debug) {
+    console.error("matchOne", file.length, pattern.length)
+  }
+
+  for ( var fi = 0
+          , pi = 0
+          , fl = file.length
+          , pl = pattern.length
+      ; (fi < fl) && (pi < pl)
+      ; fi ++, pi ++ ) {
+
+    if (options.debug) {
+      console.error("matchOne loop")
+    }
+    var p = pattern[pi]
+      , f = file[fi]
+
+    if (options.debug) {
+      console.error(pattern, p, f)
+    }
+
+    // should be impossible.
+    // some invalid regexp stuff in the set.
+    if (p === false) return false
+
+    if (p === GLOBSTAR) {
+      if (options.debug)
+        console.error('GLOBSTAR', [pattern, p, f])
+
+      // "**"
+      // a/**/b/**/c would match the following:
+      // a/b/x/y/z/c
+      // a/x/y/z/b/c
+      // a/b/x/b/x/c
+      // a/b/c
+      // To do this, take the rest of the pattern after
+      // the **, and see if it would match the file remainder.
+      // If so, return success.
+      // If not, the ** "swallows" a segment, and try again.
+      // This is recursively awful.
+      //
+      // a/**/b/**/c matching a/b/x/y/z/c
+      // - a matches a
+      // - doublestar
+      //   - matchOne(b/x/y/z/c, b/**/c)
+      //     - b matches b
+      //     - doublestar
+      //       - matchOne(x/y/z/c, c) -> no
+      //       - matchOne(y/z/c, c) -> no
+      //       - matchOne(z/c, c) -> no
+      //       - matchOne(c, c) yes, hit
+      var fr = fi
+        , pr = pi + 1
+      if (pr === pl) {
+        if (options.debug)
+          console.error('** at the end')
+        // a ** at the end will just swallow the rest.
+        // We have found a match.
+        // however, it will not swallow /.x, unless
+        // options.dot is set.
+        // . and .. are *never* matched by **, for explosively
+        // exponential reasons.
+        for ( ; fi < fl; fi ++) {
+          if (file[fi] === "." || file[fi] === ".." ||
+              (!options.dot && file[fi].charAt(0) === ".")) return false
+        }
+        return true
+      }
+
+      // ok, let's see if we can swallow whatever we can.
+      WHILE: while (fr < fl) {
+        var swallowee = file[fr]
+
+        if (options.debug) {
+          console.error('\nglobstar while',
+                        file, fr, pattern, pr, swallowee)
+        }
+
+        // XXX remove this slice.  Just pass the start index.
+        if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+          if (options.debug)
+            console.error('globstar found match!', fr, fl, swallowee)
+          // found a match.
+          return true
+        } else {
+          // can't swallow "." or ".." ever.
+          // can only swallow ".foo" when explicitly asked.
+          if (swallowee === "." || swallowee === ".." ||
+              (!options.dot && swallowee.charAt(0) === ".")) {
+            if (options.debug)
+              console.error("dot detected!", file, fr, pattern, pr)
+            break WHILE
+          }
+
+          // ** swallows a segment, and continue.
+          if (options.debug)
+            console.error('globstar swallow a segment, and continue')
+          fr ++
+        }
+      }
+      // no match was found.
+      // However, in partial mode, we can't say this is necessarily over.
+      // If there's more *pattern* left, then 
+      if (partial) {
+        // ran out of file
+        // console.error("\n>>> no match, partial?", file, fr, pattern, pr)
+        if (fr === fl) return true
+      }
+      return false
+    }
+
+    // something other than **
+    // non-magic patterns just have to match exactly
+    // patterns with magic have been turned into regexps.
+    var hit
+    if (typeof p === "string") {
+      if (options.nocase) {
+        hit = f.toLowerCase() === p.toLowerCase()
+      } else {
+        hit = f === p
+      }
+      if (options.debug) {
+        console.error("string match", p, f, hit)
+      }
+    } else {
+      hit = f.match(p)
+      if (options.debug) {
+        console.error("pattern match", p, f, hit)
+      }
+    }
+
+    if (!hit) return false
+  }
+
+  // Note: ending in / means that we'll get a final ""
+  // at the end of the pattern.  This can only match a
+  // corresponding "" at the end of the file.
+  // If the file ends in /, then it can only match a
+  // a pattern that ends in /, unless the pattern just
+  // doesn't have any more for it. But, a/b/ should *not*
+  // match "a/b/*", even though "" matches against the
+  // [^/]*? pattern, except in partial mode, where it might
+  // simply not be reached yet.
+  // However, a/b/ should still satisfy a/*
+
+  // now either we fell off the end of the pattern, or we're done.
+  if (fi === fl && pi === pl) {
+    // ran out of pattern and filename at the same time.
+    // an exact hit!
+    return true
+  } else if (fi === fl) {
+    // ran out of file, but still had pattern left.
+    // this is ok if we're doing the match as part of
+    // a glob fs traversal.
+    return partial
+  } else if (pi === pl) {
+    // ran out of pattern, still have file left.
+    // this is only acceptable if we're on the very last
+    // empty segment of a file with a trailing slash.
+    // a/* should match a/b/
+    var emptyFileEnd = (fi === fl - 1) && (file[fi] === "")
+    return emptyFileEnd
+  }
+
+  // should be unreachable.
+  throw new Error("wtf?")
+}
+
+
+// replace stuff like \* with *
+function globUnescape (s) {
+  return s.replace(/\\(.)/g, "$1")
+}
+
+
+function regExpEscape (s) {
+  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")
+}
+
+})( typeof require === "function" ? require : null,
+    this,
+    typeof module === "object" ? module : null,
+    typeof process === "object" ? process.platform : "win32"
+  )

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/.npmignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/.npmignore b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/.npmignore
new file mode 100644
index 0000000..07e6e47
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/.npmignore
@@ -0,0 +1 @@
+/node_modules

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/AUTHORS
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/AUTHORS
new file mode 100644
index 0000000..016d7fb
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/AUTHORS
@@ -0,0 +1,8 @@
+# Authors, sorted by whether or not they are me
+Isaac Z. Schlueter <i...@izs.me>
+Carlos Brito Lage <ca...@carloslage.net>
+Marko Mikulicic <ma...@isti.cnr.it>
+Trent Mick <tr...@gmail.com>
+Kevin O'Hara <ke...@gmail.com>
+Marco Rogers <ma...@gmail.com>
+Jesse Dailey <je...@gmail.com>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/LICENSE b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/LICENSE
new file mode 100644
index 0000000..05a4010
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/README.md b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/README.md
new file mode 100644
index 0000000..03ee0f9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/README.md
@@ -0,0 +1,97 @@
+# lru cache
+
+A cache object that deletes the least-recently-used items.
+
+## Usage:
+
+```javascript
+var LRU = require("lru-cache")
+  , options = { max: 500
+              , length: function (n) { return n * 2 }
+              , dispose: function (key, n) { n.close() }
+              , maxAge: 1000 * 60 * 60 }
+  , cache = LRU(options)
+  , otherCache = LRU(50) // sets just the max size
+
+cache.set("key", "value")
+cache.get("key") // "value"
+
+cache.reset()    // empty the cache
+```
+
+If you put more stuff in it, then items will fall out.
+
+If you try to put an oversized thing in it, then it'll fall out right
+away.
+
+## Options
+
+* `max` The maximum size of the cache, checked by applying the length
+  function to all values in the cache.  Not setting this is kind of
+  silly, since that's the whole purpose of this lib, but it defaults
+  to `Infinity`.
+* `maxAge` Maximum age in ms.  Items are not pro-actively pruned out
+  as they age, but if you try to get an item that is too old, it'll
+  drop it and return undefined instead of giving it to you.
+* `length` Function that is used to calculate the length of stored
+  items.  If you're storing strings or buffers, then you probably want
+  to do something like `function(n){return n.length}`.  The default is
+  `function(n){return 1}`, which is fine if you want to store `n`
+  like-sized things.
+* `dispose` Function that is called on items when they are dropped
+  from the cache.  This can be handy if you want to close file
+  descriptors or do other cleanup tasks when items are no longer
+  accessible.  Called with `key, value`.  It's called *before*
+  actually removing the item from the internal cache, so if you want
+  to immediately put it back in, you'll have to do that in a
+  `nextTick` or `setTimeout` callback or it won't do anything.
+* `stale` By default, if you set a `maxAge`, it'll only actually pull
+  stale items out of the cache when you `get(key)`.  (That is, it's
+  not pre-emptively doing a `setTimeout` or anything.)  If you set
+  `stale:true`, it'll return the stale value before deleting it.  If
+  you don't set this, then it'll return `undefined` when you try to
+  get a stale entry, as if it had already been deleted.
+
+## API
+
+* `set(key, value)`
+* `get(key) => value`
+
+    Both of these will update the "recently used"-ness of the key.
+    They do what you think.
+
+* `peek(key)`
+
+    Returns the key value (or `undefined` if not found) without
+    updating the "recently used"-ness of the key.
+
+    (If you find yourself using this a lot, you *might* be using the
+    wrong sort of data structure, but there are some use cases where
+    it's handy.)
+
+* `del(key)`
+
+    Deletes a key out of the cache.
+
+* `reset()`
+
+    Clear the cache entirely, throwing away all values.
+
+* `has(key)`
+
+    Check if a key is in the cache, without updating the recent-ness
+    or deleting it for being stale.
+
+* `forEach(function(value,key,cache), [thisp])`
+
+    Just like `Array.prototype.forEach`.  Iterates over all the keys
+    in the cache, in order of recent-ness.  (Ie, more recently used
+    items are iterated over first.)
+
+* `keys()`
+
+    Return an array of the keys in the cache.
+
+* `values()`
+
+    Return an array of the values in the cache.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js
new file mode 100644
index 0000000..8c80853
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js
@@ -0,0 +1,257 @@
+;(function () { // closure for web browsers
+
+if (typeof module === 'object' && module.exports) {
+  module.exports = LRUCache
+} else {
+  // just set the global for non-node platforms.
+  this.LRUCache = LRUCache
+}
+
+function hOP (obj, key) {
+  return Object.prototype.hasOwnProperty.call(obj, key)
+}
+
+function naiveLength () { return 1 }
+
+function LRUCache (options) {
+  if (!(this instanceof LRUCache)) {
+    return new LRUCache(options)
+  }
+
+  var max
+  if (typeof options === 'number') {
+    max = options
+    options = { max: max }
+  }
+
+  if (!options) options = {}
+
+  max = options.max
+
+  var lengthCalculator = options.length || naiveLength
+
+  if (typeof lengthCalculator !== "function") {
+    lengthCalculator = naiveLength
+  }
+
+  if (!max || !(typeof max === "number") || max <= 0 ) {
+    // a little bit silly.  maybe this should throw?
+    max = Infinity
+  }
+
+  var allowStale = options.stale || false
+
+  var maxAge = options.maxAge || null
+
+  var dispose = options.dispose
+
+  var cache = Object.create(null) // hash of items by key
+    , lruList = Object.create(null) // list of items in order of use recency
+    , mru = 0 // most recently used
+    , lru = 0 // least recently used
+    , length = 0 // number of items in the list
+    , itemCount = 0
+
+
+  // resize the cache when the max changes.
+  Object.defineProperty(this, "max",
+    { set : function (mL) {
+        if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity
+        max = mL
+        // if it gets above double max, trim right away.
+        // otherwise, do it whenever it's convenient.
+        if (length > max) trim()
+      }
+    , get : function () { return max }
+    , enumerable : true
+    })
+
+  // resize the cache when the lengthCalculator changes.
+  Object.defineProperty(this, "lengthCalculator",
+    { set : function (lC) {
+        if (typeof lC !== "function") {
+          lengthCalculator = naiveLength
+          length = itemCount
+          for (var key in cache) {
+            cache[key].length = 1
+          }
+        } else {
+          lengthCalculator = lC
+          length = 0
+          for (var key in cache) {
+            cache[key].length = lengthCalculator(cache[key].value)
+            length += cache[key].length
+          }
+        }
+
+        if (length > max) trim()
+      }
+    , get : function () { return lengthCalculator }
+    , enumerable : true
+    })
+
+  Object.defineProperty(this, "length",
+    { get : function () { return length }
+    , enumerable : true
+    })
+
+
+  Object.defineProperty(this, "itemCount",
+    { get : function () { return itemCount }
+    , enumerable : true
+    })
+
+  this.forEach = function (fn, thisp) {
+    thisp = thisp || this
+    var i = 0;
+    for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) {
+      i++
+      var hit = lruList[k]
+      fn.call(thisp, hit.value, hit.key, this)
+    }
+  }
+
+  this.keys = function () {
+    var keys = new Array(itemCount)
+    var i = 0
+    for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) {
+      var hit = lruList[k]
+      keys[i++] = hit.key
+    }
+    return keys
+  }
+
+  this.values = function () {
+    var values = new Array(itemCount)
+    var i = 0
+    for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) {
+      var hit = lruList[k]
+      values[i++] = hit.value
+    }
+    return values
+  }
+
+  this.reset = function () {
+    if (dispose) {
+      for (var k in cache) {
+        dispose(k, cache[k].value)
+      }
+    }
+    cache = {}
+    lruList = {}
+    lru = 0
+    mru = 0
+    length = 0
+    itemCount = 0
+  }
+
+  // Provided for debugging/dev purposes only. No promises whatsoever that
+  // this API stays stable.
+  this.dump = function () {
+    return cache
+  }
+
+  this.dumpLru = function () {
+    return lruList
+  }
+
+  this.set = function (key, value) {
+    if (hOP(cache, key)) {
+      // dispose of the old one before overwriting
+      if (dispose) dispose(key, cache[key].value)
+      if (maxAge) cache[key].now = Date.now()
+      cache[key].value = value
+      this.get(key)
+      return true
+    }
+
+    var len = lengthCalculator(value)
+    var age = maxAge ? Date.now() : 0
+    var hit = new Entry(key, value, mru++, len, age)
+
+    // oversized objects fall out of cache automatically.
+    if (hit.length > max) {
+      if (dispose) dispose(key, value)
+      return false
+    }
+
+    length += hit.length
+    lruList[hit.lu] = cache[key] = hit
+    itemCount ++
+
+    if (length > max) trim()
+    return true
+  }
+
+  this.has = function (key) {
+    if (!hOP(cache, key)) return false
+    var hit = cache[key]
+    if (maxAge && (Date.now() - hit.now > maxAge)) {
+      return false
+    }
+    return true
+  }
+
+  this.get = function (key) {
+    return get(key, true)
+  }
+
+  this.peek = function (key) {
+    return get(key, false)
+  }
+
+  function get (key, doUse) {
+    var hit = cache[key]
+    if (hit) {
+      if (maxAge && (Date.now() - hit.now > maxAge)) {
+        del(hit)
+        if (!allowStale) hit = undefined
+      } else {
+        if (doUse) use(hit)
+      }
+      if (hit) hit = hit.value
+    }
+    return hit
+  }
+
+  function use (hit) {
+    shiftLU(hit)
+    hit.lu = mru ++
+    lruList[hit.lu] = hit
+  }
+
+  this.del = function (key) {
+    del(cache[key])
+  }
+
+  function trim () {
+    while (lru < mru && length > max)
+      del(lruList[lru])
+  }
+
+  function shiftLU(hit) {
+    delete lruList[ hit.lu ]
+    while (lru < mru && !lruList[lru]) lru ++
+  }
+
+  function del(hit) {
+    if (hit) {
+      if (dispose) dispose(hit.key, hit.value)
+      length -= hit.length
+      itemCount --
+      delete cache[ hit.key ]
+      shiftLU(hit)
+    }
+  }
+}
+
+// classy, since V8 prefers predictable objects.
+function Entry (key, value, mru, len, age) {
+  this.key = key
+  this.value = value
+  this.lu = mru
+  this.length = len
+  this.now = age
+}
+
+})()

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/package.json b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/package.json
new file mode 100644
index 0000000..111e5d7
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/package.json
@@ -0,0 +1,59 @@
+{
+  "name": "lru-cache",
+  "description": "A cache object that deletes the least-recently-used items.",
+  "version": "2.3.0",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me"
+  },
+  "scripts": {
+    "test": "tap test --gc"
+  },
+  "main": "lib/lru-cache.js",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-lru-cache.git"
+  },
+  "devDependencies": {
+    "tap": "",
+    "weak": ""
+  },
+  "license": {
+    "type": "MIT",
+    "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE"
+  },
+  "contributors": [
+    {
+      "name": "Isaac Z. Schlueter",
+      "email": "i@izs.me"
+    },
+    {
+      "name": "Carlos Brito Lage",
+      "email": "carlos@carloslage.net"
+    },
+    {
+      "name": "Marko Mikulicic",
+      "email": "marko.mikulicic@isti.cnr.it"
+    },
+    {
+      "name": "Trent Mick",
+      "email": "trentm@gmail.com"
+    },
+    {
+      "name": "Kevin O'Hara",
+      "email": "kevinohara80@gmail.com"
+    },
+    {
+      "name": "Marco Rogers",
+      "email": "marco.rogers@gmail.com"
+    },
+    {
+      "name": "Jesse Dailey",
+      "email": "jesse.dailey@gmail.com"
+    }
+  ],
+  "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n  , options = { max: 500\n              , length: function (n) { return n * 2 }\n              , dispose: function (key, n) { n.close() }\n              , maxAge: 1000 * 60 * 60 }\n  , cache = LRU(options)\n  , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset()    // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n  function to all values in the cache.  Not setting this is kind of\n  silly, since that's the whole purpose of this lib, but it defaults\n  to `Infinity`.\n* `maxAge` Maximum age in ms.  Items are not pro-actively pruned out\n  as they age, but if yo
 u try to get an item that is too old, it'll\n  drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n  items.  If you're storing strings or buffers, then you probably want\n  to do something like `function(n){return n.length}`.  The default is\n  `function(n){return 1}`, which is fine if you want to store `n`\n  like-sized things.\n* `dispose` Function that is called on items when they are dropped\n  from the cache.  This can be handy if you want to close file\n  descriptors or do other cleanup tasks when items are no longer\n  accessible.  Called with `key, value`.  It's called *before*\n  actually removing the item from the internal cache, so if you want\n  to immediately put it back in, you'll have to do that in a\n  `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n  stale items out of the cache when you `get(key)`.  (That is
 , it's\n  not pre-emptively doing a `setTimeout` or anything.)  If you set\n  `stale:true`, it'll return the stale value before deleting it.  If\n  you don't set this, then it'll return `undefined` when you try to\n  get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n    Both of these will update the \"recently used\"-ness of the key.\n    They do what you think.\n\n* `peek(key)`\n\n    Returns the key value (or `undefined` if not found) without\n    updating the \"recently used\"-ness of the key.\n\n    (If you find yourself using this a lot, you *might* be using the\n    wrong sort of data structure, but there are some use cases where\n    it's handy.)\n\n* `del(key)`\n\n    Deletes a key out of the cache.\n\n* `reset()`\n\n    Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n    Check if a key is in the cache, without updating the recent-ness\n    or deleting it for being stale.\n\n* `forEach(func
 tion(value,key,cache), [thisp])`\n\n    Just like `Array.prototype.forEach`.  Iterates over all the keys\n    in the cache, in order of recent-ness.  (Ie, more recently used\n    items are iterated over first.)\n\n* `keys()`\n\n    Return an array of the keys in the cache.\n\n* `values()`\n\n    Return an array of the values in the cache.\n",
+  "readmeFilename": "README.md",
+  "_id": "lru-cache@2.3.0",
+  "_from": "lru-cache@2"
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/s.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/s.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/s.js
new file mode 100644
index 0000000..c2a9e54
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/minimatch/node_modules/lru-cache/s.js
@@ -0,0 +1,25 @@
+var LRU = require('lru-cache');
+
+var max = +process.argv[2] || 10240;
+var more = 1024;
+
+var cache = LRU({
+  max: max, maxAge: 86400e3
+});
+
+// fill cache
+for (var i = 0; i < max; ++i) {
+  cache.set(i, {});
+}
+
+var start = process.hrtime();
+
+// adding more items
+for ( ; i < max+more; ++i) {
+  cache.set(i, {});
+}
+
+var end = process.hrtime(start);
+var msecs = end[0] * 1E3 + end[1] / 1E6;
+
+console.log('adding %d items took %d ms', more, msecs.toPrecision(5));


[49/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/project.properties
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/project.properties b/lib/cordova-blackberry/bin/templates/project/project.properties
deleted file mode 100644
index 71e5bc1..0000000
--- a/lib/cordova-blackberry/bin/templates/project/project.properties
+++ /dev/null
@@ -1,137 +0,0 @@
-# BlackBerry WebWorks Packager Directory
-#
-#   The BlackBerry WebWorks Packager (bbwp) is required for compiling and packaging
-#   BlackBerry WebWorks applications for deployment to a BlackBerry device
-#   or simulator.  The bbwp utility is installed with the standalone BlackBerry 
-#   WebWorks SDK, and as part of the BlackBerry Web Plugin for Eclipse.
-#
-#   Please specify the location of the BlackBerry WebWorks Packager in your
-#   environment.
-#
-#   Typical location of bbwp for standalone BlackBerry WebWorks SDK installation:
-#     C:\Program Files (x86)\Research In Motion\BlackBerry Widget Packager
-#
-#   Typical location of bbwp for BlackBerry Web Plugin for Eclipse installation:
-#     C:\Eclipse-3.5.2\plugins\net.rim.browser.tools.wcpc_1.0.0.201003191451-126\wcpc
-#
-#   The ANT script is brittle and requires you to escape the backslashes.
-#     e.g. C:\some\path must be C:\\some\\path
-#
-#   Please remember to:
-#     - Double escape your backslahses (i.e. \ must be \\)
-#     - Do not add a trailing slash (e.g. C:\some\path)
-#
-blackberry.bbwp.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks Packager
-playbook.bbwp.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks SDK for TabletOS 2.1.0.6\\bbwp
-qnx.bbwp.dir=/Developer/SDKs/Research In Motion/BlackBerry 10 WebWorks SDK 1.0.4.7
-
-# (Optional) Simulator Directory 
-# 
-#   If sim.dir is not specified, the build script will use the simulator directory 
-#   within the BlackBerry WebWorks Packager.
-#
-blackberry.sim.dir=C:\\Program Files\\Research In Motion\BlackBerry WebWorks Packager\\simpack\\6.0.0.227
-
-# (Optional) Simulator Binary 
-# 
-#   If sim.bin is not specified, the build script will attempt to use the default
-#   simulator in the simulator directory.  
-#
-#blackberry.sim.bin=9700.bat
-
-# (Optional) MDS Directory 
-# 
-#   If mds.dir is not specified, the build script will attempt to use the MDS that 
-#   is installed with the BlackBerry WebWorks Packager.
-#
-blackberry.mds.dir=C:\\Program Files\\Research In Motion\\BlackBerry WebWorks Packager\\mds
-
-# BlackBerry Code Signing Password
-#
-#   If you leave this field blank, then
-#   the signing tool will prompt you each time
-#
-blackberry.sigtool.password=
-
-# Playbook Code Signing Password
-#
-#   If you leave these fields blank, then
-#   signing will fail
-#
-playbook.sigtool.csk.password=
-playbook.sigtool.p12.password=
-
-# BB10 Code Signing Password
-qnx.sigtool.password=
-
-# BlackBerry Simulator Password
-#
-#   If you leave this field blank, then
-#   you cannot deploy to simulator
-#
-blackberry.sim.password=
-
-# Playbook Simulator IP
-#
-#   If you leave this field blank, then
-#   you cannot deploy to simulator
-#
-playbook.sim.ip=
-
-# Playbook Simulator Password
-#
-#   If you leave this field blank, then
-#   you cannot deploy to simulator
-#
-playbook.sim.password=
-
-# Playbook Device IP
-#
-#   If you leave this field blank, then
-#   you cannot deploy to device
-#
-playbook.device.ip=
-
-# Playbook Device Password
-#
-#   If you leave this field blank, then
-#   you cannot deploy to device
-#
-playbook.device.password=
-# PlayBook Device PIN
-#
-#   Fill this value in to use debug tokens when debuging on the device
-playbook.device.pin=
-
-# QNX Simulator IP
-#
-#   If you leave this field blank, then
-#   you cannot deploy to simulator
-#
-qnx.sim.ip=
-
-# QNX Simulator Password
-#
-#   If you leave this field blank, then
-#   you cannot deploy to simulator
-#
-qnx.sim.password=
-
-# QNX Device IP
-#
-#   If you leave this field blank, then
-#   you cannot deploy to device
-#
-qnx.device.ip=
-
-# QNX Device Password
-#
-#   If you leave this field blank, then
-#   you cannot deploy to device
-#
-qnx.device.password=
-
-# QNX Device PIN
-#
-#   Fill this value in to use debug tokens when debuging on the device
-qnx.device.pin=

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/qnx.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/qnx.xml b/lib/cordova-blackberry/bin/templates/project/qnx.xml
deleted file mode 100644
index d2e2de7..0000000
--- a/lib/cordova-blackberry/bin/templates/project/qnx.xml
+++ /dev/null
@@ -1,336 +0,0 @@
-<project default="help">
-<!-- 
-       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.
--->    
-    <!-- LOAD PROPERTIES -->
-    
-    <property prefix="properties" file="project.properties" />
-    <property name="build.dir"    location="build" />
-    <property name="widget.dir"   location="${build.dir}/widget" />
-    <property name="code.sign"    value="false" />
-    <property name="generate.ext"   value="cod" />
-    <property name="build.num.file" value="buildId.txt" />
-    
-    <!-- BlackBerry WebWorks Packager for Tablets directory is required. -->
-    <fail unless="properties.qnx.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'qnx.bbwp.dir' in your 'project.properties' file." />
-
-    <!-- OS identification -->
-    <condition property="isMacOSX" else="false">
-        <and>
-            <os family="mac" />
-            <os family="unix" />
-        </and>
-    </condition>
-
-    <condition property="bbwp" value="${properties.qnx.bbwp.dir}/bbwp" else="${properties.qnx.bbwp.dir}/bbwp.bat">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <condition property="blackberry-deploy" value="${properties.qnx.bbwp.dir}/dependencies/tools/bin/blackberry-deploy" else="${properties.qnx.bbwp.dir}/dependencies/tools/bin/blackberry-deploy.bat">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <condition property="blackberry-debugtokenrequest" value="${properties.qnx.bbwp.dir}/dependencies/tools/bin/blackberry-debugtokenrequest" else="${properties.qnx.bbwp.dir}/dependencies/tools/bin/blackberry-debugtokenrequest.bat">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <!-- LOAD DEVICE -->
-    
-    <target name="load-device" depends="package-app">
-        <bbwp code-sign="true" />
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.qnx.device.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.qnx.device.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/device/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <!-- DEBUG-LOAD DEVICE -->
-    
-    <target name="debug-device" depends="package-app">
-        <if>
-            <equals arg1="${properties.qnx.device.pin}" arg2="" />
-            <then>
-                <echo>
-                    If you fill in the qnx.device.pin value you can use debug tokens!
-                    This means you won't have to worry about having a unique version in config.xml every time.
-                </echo>
-                <bbwp code-sign="true" debug="true" />
-            </then>
-            <else>
-                <generate-debug-token />
-                <bbwp code-sign="false" debug="true" />
-            </else>
-        </if>
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.qnx.device.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.qnx.device.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/device/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <!-- LOAD SIMULATOR -->
-    
-    <target name="load-simulator" depends="build">
-
-        <echo>This tool will not open the simulator for you </echo>
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.qnx.sim.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.qnx.sim.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/simulator/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <target name="debug-simulator" depends="package-app">
-
-        <bbwp code-sign="false" debug="true" />
-        <echo>This tool will not open the simulator for you </echo>
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.qnx.sim.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.qnx.sim.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/simulator/${cod.name}.bar" />
-        </exec>
-    </target>
-
-    <!-- PACKAGE-APP -->
-    
-    <target name="package-app" depends="generate-cod-name, clean">
-        <!-- Copy the WebWorks application -->
-        <mkdir dir="${widget.dir}" />
-        <copy todir="${widget.dir}" overwrite="true">
-            <fileset dir="www" >
-                <exclude name="ext/**"/>
-                <exclude name="ext-air/**"/>
-                <exclude name="res/resourceBundles/**"/>
-            </fileset>
-        </copy>
-        
-        <!-- Update WebWorks Packager with the QNX APIs -->
-        <copy todir="${properties.qnx.bbwp.dir}\Framework\ext" overwrite="true">
-            <fileset dir="www/ext-qnx" excludes="readme.md" />
-        </copy>
-
-        <!-- Package the WebWorks app by zipping the widget dir. -->
-        <mkdir dir="${build.dir}" />
-        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
-    </target>
-    
-    <!-- BUILD -->
-
-    <target name="build" depends="package-app">
-        <bbwp code-sign="${code.sign}" />
-    </target>
-
-    <!-- BBWP MACRO -->
-
-    <macrodef name="bbwp">
-        <attribute name="code-sign" default="false" />
-        <attribute name="debug" default="false" />
-        <sequential>
-            <!-- check if debug flag was passed in and set an appropriate flag for CLI exec of bbwp -->
-            <if>
-                <equals arg1="@{debug}" arg2="true" />
-                <then>
-                    <property name="debug.flag" value="-d" />
-                </then>
-                <else>
-                    <property name="debug.flag" value="" />
-                </else>
-            </if>
-            <buildnumber file="${build.num.file}" />
-            <if>
-                <equals arg1="@{code-sign}" arg2="true" />
-                <then>
-                    <exec executable="${bbwp}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg value="-g" />
-                        <arg value="${properties.qnx.sigtool.password}" />
-                        <arg value="-o" />
-                        <arg file="${build.dir}" />
-                        <arg line="${debug.flag} -b" />
-                        <arg value="${build.number}" />
-                        <arg value="--loglevel" />
-                        <arg value="error" />
-                    </exec>
-                </then>
-                <else>
-                    <exec executable="${bbwp}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg value="-o" />
-                        <arg file="${build.dir}" />
-                        <arg line="${debug.flag}" />
-                        <arg value="--loglevel" />
-                        <arg value="error" />
-                    </exec>
-                </else>
-            </if>
-        </sequential>
-    </macrodef>
-
-    <!-- install debug token" -->
-    <macrodef name="generate-debug-token">
-        <sequential>
-            <exec executable="${blackberry-debugtokenrequest}" dir="." failonerror="true">
-                <arg value="-storepass" />
-                <arg value="${properties.qnx.sigtool.password}" />
-                <arg value="-deviceID" />
-                <arg value="0x${properties.qnx.device.pin}" />
-                <arg file="${properties.qnx.bbwp.dir}/debugtoken.bar" />
-            </exec>
-
-            <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-                <arg value="-installApp" />
-                <arg value="-device" />
-                <arg value="${properties.qnx.device.ip}" />
-                <arg value="-password" />
-                <arg value="${properties.qnx.device.password}" />
-                <arg value="-package" />
-                <arg file="${properties.qnx.bbwp.dir}/debugtoken.bar" />
-            </exec>
-        </sequential>
-    </macrodef>
-
-
-    <!-- CLEAN -->
-    
-    <target name="clean">
-        <delete dir="${build.dir}" />
-        <delete dir="${widget.dir}" />
-    </target>
-    
-    <!-- CLEAN DEVICE -->
-    
-    <target name="clean-device" depends="generate-cod-name">
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-uninstallApp" />
-            <arg value="-device" />
-            <arg value="${properties.qnx.device.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.qnx.device.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/device/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <!-- CLEAN SIMULATOR -->
-    
-    <target name="clean-simulator" depends="generate-cod-name">
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-uninstallApp" />
-            <arg value="-device" />
-            <arg value="${properties.qnx.sim.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.qnx.sim.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/simulator/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-        <!-- HELPER TASKS -->
-    
-    <target name="generate-cod-name">
-        <xmlproperty file="www/config.xml" prefix="config.xml" />
-        <propertyregex property="cod.name"
-                       input="${config.xml.widget.name}"
-                       regexp="(\W+)"
-                       replace=""
-                       casesensitive="false"
-                       global="true"
-                       defaultValue="${config.xml.widget.name}" />
-        <echo message="Generated name: ${cod.name}.bar" />
-    </target>
-
-
-    <!-- HELP -->
-
-    <target name="help">
-        <echo>
-NAME
-  ${ant.project.name}
-
-SYNOPSIS
-  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
-
-DESCRIPTION
-  You can build and deploy your project to a device or simulator.
-  
-TARGETS
-  blackberry ........ Builds a cod file and deploys to a device or simulator
- 
-  playbook .......... Builds a bar file and deploys to a device or simulator
-
-COMMANDS
-  help .............. Show this help menu.
-                        ant, ant help
-
-  load-device ....... Builds and deploys project to a connected USB device.
-                        ant load-device
-
-  load-simulator .... Builds and deploys project to default simulator.
-                        ant load-simulator
-
-  build ............. Compiles and packages the project for deployment.
-                        ant build
-
-  clean ............. Remove all files from the build/ directory.
-                        ant clean
-
-  clean-device ...... Remove this project from the connected USB device.
-                        ant clean-device
-
-  clean-simulator ... Remove this project from the simulator (takes a while).
-                        ant clean-simulator
-
-GETTING STARTED
-  1. Edit project.properties
-
-  2. &lt;ant &lt;TARGET&gt; load-simulator&gt; to run the project on the simulator
-
-  3. Customize your project by editing www/config.xml
-
-  4. To run the project on a BlackBerry device, you will need to obtain
-     code signing keys from RIM. Once you have the key, a project is
-     installed by connecting a BlackBerry via USB and running
-     &lt;ant &lt;TARGET&gt; load-device&gt;.
-        </echo>
-    </target>
-</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/LICENSE b/lib/cordova-blackberry/bin/templates/project/www/LICENSE
deleted file mode 100644
index 9f761f1..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/LICENSE
+++ /dev/null
@@ -1,296 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-
-==============================================================
-This product also include the following software:
-==============================================================
-
---------------------------------------------------------------
-jasmine from GitHub
-
-   https://github.com/pivotal/jasmine
-
-MIT-style license
-
-license available from:
-
-   https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE
-   
------------------------------
-
-Copyright (c) 2008-2011 Pivotal Labs
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
---------------------------------------------------------------
-commonjs tests from the commonjs organization at GitHub
-
-   https://github.com/commonjs/commonjs
-
-MIT-style license
-
-license available from:
-
-   https://github.com/commonjs/commonjs/blob/master/docs/license.html.markdown
-
-contributor list available from:
-
-   https://github.com/commonjs/commonjs/blob/master/docs/contributors.html.markdown
-
------------------------------
-
-Copyright 2009 Kevin Dangoor
-Copyright 2009 Ihab Awad
-Copyright 2009 Ash Berlin
-Copyright 2009 Aristid Breitkreuz
-Copyright 2009 Kevin Dangoor
-Copyright 2009 Daniel Friesen
-Copyright 2009 Wes Garland
-Copyright 2009 Kris Kowal
-Copyright 2009 Dean Landolt
-Copyright 2009 Peter Michaux
-Copyright 2009 George Moschovitis
-Copyright 2009 Michael O'Brien
-Copyright 2009 Tom Robinson
-Copyright 2009 Hannes Wallnoefer
-Copyright 2009 Mike Wilson
-Copyright 2009 Ondrej Zara
-Copyright 2009 Chris Zumbrunn
-Copyright 2009 Kris Zyp
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/NOTICE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/NOTICE b/lib/cordova-blackberry/bin/templates/project/www/NOTICE
deleted file mode 100644
index 4e02ca4..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org)
-
-This product includes software developed by
-Jasmine (https://github.com/pivotal/jasmine)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/README.md b/lib/cordova-blackberry/bin/templates/project/www/README.md
deleted file mode 100644
index 61256fe..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Apache Cordova Hello World Application
-
-> Simple Hello World application and test suite.
-
-## Run Application
-
-    /www/index.html
-
-## Run Tests
-
-    /www/spec.html
-
-## Versions and Tags
-
-The Hello World's version is directly tied to an Apache Cordova release.
-
-For example, Hello World `2.0.0` is compatible with Apache Cordova `2.0.0`.
-
-## How to Update
-
-Update to Apache Cordova x.x.x by:
-
-1. `www/index.html`
-    - Update `<script type="text/javascript" src="cordova-x.x.x.js"></script>`
-2. `VERSION`
-    - Update the version
-3. Commit and Tag
-    - `git commit -am "[app] Version x.x.x"`
-    - `git tag x.x.x`
-

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/VERSION b/lib/cordova-blackberry/bin/templates/project/www/VERSION
deleted file mode 100644
index e70b452..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.6.0

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/config.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/config.xml b/lib/cordova-blackberry/bin/templates/project/www/config.xml
deleted file mode 100644
index 0de8bb5..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/config.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-       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.
--->
-<!--
-  Widget Configuration Reference:
-    http://docs.blackberry.com/en/developers/deliverables/15274/
--->
-
-<widget xmlns="http://www.w3.org/ns/widgets"
-        xmlns:rim="http://www.blackberry.com/ns/widgets"
-	version="1.0.0.0" id="__PACKAGE__">
-
-  <name>__NAME__</name>
-
-  <author>Your Name Here</author>
-
-  <description>
-       A sample Apache Cordova application that responds to the deviceready event.
-  </description>
-    
-  <license href="http://opensource.org/licenses/alphabetical">
-  </license>
-
-  <!-- Cordova API -->
-  <feature id="blackberry.system" required="true" version="1.0.0.0" />
-  <feature id="org.apache.cordova" required="true" version="1.0.0" />
-  <feature id="blackberry.find" required="true" version="1.0.0.0" />
-  <feature id="blackberry.identity" required="true" version="1.0.0.0" />
-  <feature id="blackberry.identity.phone" required="true" version="1.0.0.0" />
-  <feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
-  <feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
-  <feature id="blackberry.io.file" required="true" version="1.0.0.0" />
-  <feature id="blackberry.utils" required="true" version="1.0.0.0" />
-  <feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
-  <feature id="blackberry.app" required="true" version="1.0.0.0" />
-  <feature id="blackberry.app.event" required="true" version="1.0.0.0" />
-  <feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
-  <feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/>
-  <feature id="blackberry.media.camera" />
-  <feature id="blackberry.ui.dialog" />
-  <feature id="blackberry.connection" />
-  <feature id="blackberry.bbm.platform" />
-  <feature id="blackberry.invoke.card" />
-  <feature id="blackberry.pim.contacts" />
-  <feature id="blackberry.ui.contextmenu" />
-  <feature id="blackberry.io.filetransfer" />
-  <feature id="blackberry.io" />
-  <feature id="blackberry.invoke" />
-  <feature id="blackberry.invoked" />
-  <feature id="blackberry.push" />
-  <feature id="blackberry.media.microphone" required="true" version="1.0.0.0"/>
-  
-  <!-- Cordova API -->
-  <access subdomains="true" uri="file:///store/home" />
-  <access subdomains="true" uri="file:///SDCard" />
-
-  <!-- Expose access to all URIs, including the file and http protocols -->
-  <access subdomains="true" uri="*" />
-
-  <icon rim:hover="false" src="res/icon/blackberry/icon-80.png" />
-  <icon rim:hover="true" src="res/icon/blackberry/icon-80.png" />
-
-  <rim:loadingScreen backgroundColor="#CFCFCF"
-                     foregroundImage="res/screen/blackberry/screen-225.png"
-		     onFirstLaunch="true">
-    <rim:transitionEffect type="fadeOut" />
-  </rim:loadingScreen>
-
-  <content src="index.html" />
-
-  <rim:permissions>
-    <rim:permit>use_camera</rim:permit>
-    <rim:permit>read_device_identifying_information</rim:permit>
-    <rim:permit>access_shared</rim:permit>
-    <rim:permit>read_geolocation</rim:permit>
-    <rim:permit>record_audio</rim:permit> 
-    <rim:permit>access_pimdomain_contacts</rim:permit> 
-  </rim:permissions>
-
-</widget>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/css/index.css
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/css/index.css b/lib/cordova-blackberry/bin/templates/project/www/css/index.css
deleted file mode 100644
index 51daa79..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/css/index.css
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.
- */
-* {
-    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
-}
-
-body {
-    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
-    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
-    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
-    background-color:#E4E4E4;
-    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
-    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
-    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
-    background-image:-webkit-gradient(
-        linear,
-        left top,
-        left bottom,
-        color-stop(0, #A7A7A7),
-        color-stop(0.51, #E4E4E4)
-    );
-    background-attachment:fixed;
-    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
-    font-size:12px;
-    height:100%;
-    margin:0px;
-    padding:0px;
-    text-transform:uppercase;
-    width:100%;
-}
-
-/* Portrait layout (default) */
-.app {
-    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
-    position:absolute;             /* position in the center of the screen */
-    left:50%;
-    top:50%;
-    height:50px;                   /* text area height */
-    width:225px;                   /* text area width */
-    text-align:center;
-    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with text) */
-    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area height */
-                                   /* offset horizontal: half of text area width */
-}
-
-/* Landscape layout (with min-width) */
-@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
-    .app {
-        background-position:left center;
-        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image height */
-        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
-                                      /* offset horizontal: half of image width and text area width */
-    }
-}
-
-h1 {
-    font-size:24px;
-    font-weight:normal;
-    margin:0px;
-    overflow:visible;
-    padding:0px;
-    text-align:center;
-}
-
-.event {
-    border-radius:4px;
-    -webkit-border-radius:4px;
-    color:#FFFFFF;
-    font-size:12px;
-    margin:0px 30px;
-    padding:2px 0px;
-}
-
-.event.listening {
-    background-color:#333333;
-    display:block;
-}
-
-.event.received {
-    background-color:#4B946A;
-    display:none;
-}
-
-@keyframes fade {
-    from { opacity: 1.0; }
-    50% { opacity: 0.4; }
-    to { opacity: 1.0; }
-}
- 
-@-webkit-keyframes fade {
-    from { opacity: 1.0; }
-    50% { opacity: 0.4; }
-    to { opacity: 1.0; }
-}
- 
-.blink {
-    animation:fade 3000ms infinite;
-    -webkit-animation:fade 3000ms infinite;
-}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/img/logo.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/img/logo.png b/lib/cordova-blackberry/bin/templates/project/www/img/logo.png
deleted file mode 100644
index 9519e7d..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/img/logo.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/index.html b/lib/cordova-blackberry/bin/templates/project/www/index.html
deleted file mode 100644
index 4d39cf3..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/index.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html>
-<!--
-    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.
--->
-<html>
-    <head>
-        <meta charset="utf-8" />
-        <meta name="format-detection" content="telephone=no" />
-        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
-        <link rel="stylesheet" type="text/css" href="css/index.css" />
-        <title>Hello World</title>
-    </head>
-    <body>
-        <div class="app">
-            <h1>Apache Cordova</h1>
-            <div id="deviceready" class="blink">
-                <p class="event listening">Connecting to Device</p>
-                <p class="event received">Device is Ready</p>
-            </div>
-        </div>
-        <script type="text/javascript" src="cordova-2.6.0.js"></script>
-        <script type="text/javascript" src="js/index.js"></script>
-        <script type="text/javascript">
-            app.initialize();
-        </script>
-    </body>
-</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/js/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/js/index.js b/lib/cordova-blackberry/bin/templates/project/www/js/index.js
deleted file mode 100644
index 31d9064..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/js/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-var app = {
-    // Application Constructor
-    initialize: function() {
-        this.bindEvents();
-    },
-    // Bind Event Listeners
-    //
-    // Bind any events that are required on startup. Common events are:
-    // 'load', 'deviceready', 'offline', and 'online'.
-    bindEvents: function() {
-        document.addEventListener('deviceready', this.onDeviceReady, false);
-    },
-    // deviceready Event Handler
-    //
-    // The scope of 'this' is the event. In order to call the 'receivedEvent'
-    // function, we must explicity call 'app.receivedEvent(...);'
-    onDeviceReady: function() {
-        app.receivedEvent('deviceready');
-    },
-    // Update DOM on a Received Event
-    receivedEvent: function(id) {
-        var parentElement = document.getElementById(id);
-        var listeningElement = parentElement.querySelector('.listening');
-        var receivedElement = parentElement.querySelector('.received');
-
-        listeningElement.setAttribute('style', 'display:none;');
-        receivedElement.setAttribute('style', 'display:block;');
-
-        console.log('Received Event: ' + id);
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/json2.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/json2.js b/lib/cordova-blackberry/bin/templates/project/www/json2.js
deleted file mode 100644
index c52b92a..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/json2.js
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
-    http://www.JSON.org/json2.js
-    2010-03-20
-
-    Public Domain.
-
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-    See http://www.JSON.org/js.html
-
-
-    This code should be minified before deployment.
-    See http://javascript.crockford.com/jsmin.html
-
-    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
-    NOT CONTROL.
-
-
-    This file creates a global JSON object containing two methods: stringify
-    and parse.
-
-        JSON.stringify(value, replacer, space)
-            value       any JavaScript value, usually an object or array.
-
-            replacer    an optional parameter that determines how object
-                        values are stringified for objects. It can be a
-                        function or an array of strings.
-
-            space       an optional parameter that specifies the indentation
-                        of nested structures. If it is omitted, the text will
-                        be packed without extra whitespace. If it is a number,
-                        it will specify the number of spaces to indent at each
-                        level. If it is a string (such as '\t' or '&nbsp;'),
-                        it contains the characters used to indent at each level.
-
-            This method produces a JSON text from a JavaScript value.
-
-            When an object value is found, if the object contains a toJSON
-            method, its toJSON method will be called and the result will be
-            stringified. A toJSON method does not serialize: it returns the
-            value represented by the name/value pair that should be serialized,
-            or undefined if nothing should be serialized. The toJSON method
-            will be passed the key associated with the value, and this will be
-            bound to the value
-
-            For example, this would serialize Dates as ISO strings.
-
-                Date.prototype.toJSON = function (key) {
-                    function f(n) {
-                        // Format integers to have at least two digits.
-                        return n < 10 ? '0' + n : n;
-                    }
-
-                    return this.getUTCFullYear()   + '-' +
-                         f(this.getUTCMonth() + 1) + '-' +
-                         f(this.getUTCDate())      + 'T' +
-                         f(this.getUTCHours())     + ':' +
-                         f(this.getUTCMinutes())   + ':' +
-                         f(this.getUTCSeconds())   + 'Z';
-                };
-
-            You can provide an optional replacer method. It will be passed the
-            key and value of each member, with this bound to the containing
-            object. The value that is returned from your method will be
-            serialized. If your method returns undefined, then the member will
-            be excluded from the serialization.
-
-            If the replacer parameter is an array of strings, then it will be
-            used to select the members to be serialized. It filters the results
-            such that only members with keys listed in the replacer array are
-            stringified.
-
-            Values that do not have JSON representations, such as undefined or
-            functions, will not be serialized. Such values in objects will be
-            dropped; in arrays they will be replaced with null. You can use
-            a replacer function to replace those with JSON values.
-            JSON.stringify(undefined) returns undefined.
-
-            The optional space parameter produces a stringification of the
-            value that is filled with line breaks and indentation to make it
-            easier to read.
-
-            If the space parameter is a non-empty string, then that string will
-            be used for indentation. If the space parameter is a number, then
-            the indentation will be that many spaces.
-
-            Example:
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}]);
-            // text is '["e",{"pluribus":"unum"}]'
-
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
-            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
-            text = JSON.stringify([new Date()], function (key, value) {
-                return this[key] instanceof Date ?
-                    'Date(' + this[key] + ')' : value;
-            });
-            // text is '["Date(---current time---)"]'
-
-
-        JSON.parse(text, reviver)
-            This method parses a JSON text to produce an object or array.
-            It can throw a SyntaxError exception.
-
-            The optional reviver parameter is a function that can filter and
-            transform the results. It receives each of the keys and values,
-            and its return value is used instead of the original value.
-            If it returns what it received, then the structure is not modified.
-            If it returns undefined then the member is deleted.
-
-            Example:
-
-            // Parse the text. Values that look like ISO date strings will
-            // be converted to Date objects.
-
-            myData = JSON.parse(text, function (key, value) {
-                var a;
-                if (typeof value === 'string') {
-                    a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
-                    if (a) {
-                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
-                            +a[5], +a[6]));
-                    }
-                }
-                return value;
-            });
-
-            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
-                var d;
-                if (typeof value === 'string' &&
-                        value.slice(0, 5) === 'Date(' &&
-                        value.slice(-1) === ')') {
-                    d = new Date(value.slice(5, -1));
-                    if (d) {
-                        return d;
-                    }
-                }
-                return value;
-            });
-
-
-    This is a reference implementation. You are free to copy, modify, or
-    redistribute.
-*/
-
-/*jslint evil: true, strict: false */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
-    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
-    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
-    lastIndex, length, parse, prototype, push, replace, slice, stringify,
-    test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-if (!this.JSON) {
-    this.JSON = {};
-}
-
-(function () {
-
-    function f(n) {
-        // Format integers to have at least two digits.
-        return n < 10 ? '0' + n : n;
-    }
-
-    if (typeof Date.prototype.toJSON !== 'function') {
-
-        Date.prototype.toJSON = function (key) {
-
-            return isFinite(this.valueOf()) ?
-                   this.getUTCFullYear()   + '-' +
-                 f(this.getUTCMonth() + 1) + '-' +
-                 f(this.getUTCDate())      + 'T' +
-                 f(this.getUTCHours())     + ':' +
-                 f(this.getUTCMinutes())   + ':' +
-                 f(this.getUTCSeconds())   + 'Z' : null;
-        };
-
-        String.prototype.toJSON =
-        Number.prototype.toJSON =
-        Boolean.prototype.toJSON = function (key) {
-            return this.valueOf();
-        };
-    }
-
-    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        gap,
-        indent,
-        meta = {    // table of character substitutions
-            '\b': '\\b',
-            '\t': '\\t',
-            '\n': '\\n',
-            '\f': '\\f',
-            '\r': '\\r',
-            '"' : '\\"',
-            '\\': '\\\\'
-        },
-        rep;
-
-
-    function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
-        escapable.lastIndex = 0;
-        return escapable.test(string) ?
-            '"' + string.replace(escapable, function (a) {
-                var c = meta[a];
-                return typeof c === 'string' ? c :
-                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-            }) + '"' :
-            '"' + string + '"';
-    }
-
-
-    function str(key, holder) {
-
-// Produce a string from holder[key].
-
-        var i,          // The loop counter.
-            k,          // The member key.
-            v,          // The member value.
-            length,
-            mind = gap,
-            partial,
-            value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
-        if (value && typeof value === 'object' &&
-                typeof value.toJSON === 'function') {
-            value = value.toJSON(key);
-        }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
-        if (typeof rep === 'function') {
-            value = rep.call(holder, key, value);
-        }
-
-// What happens next depends on the value's type.
-
-        switch (typeof value) {
-        case 'string':
-            return quote(value);
-
-        case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
-            return isFinite(value) ? String(value) : 'null';
-
-        case 'boolean':
-        case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
-            return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
-        case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
-            if (!value) {
-                return 'null';
-            }
-
-// Make an array to hold the partial results of stringifying this object value.
-
-            gap += indent;
-            partial = [];
-
-// Is the value an array?
-
-            if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
-                length = value.length;
-                for (i = 0; i < length; i += 1) {
-                    partial[i] = str(i, value) || 'null';
-                }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
-                v = partial.length === 0 ? '[]' :
-                    gap ? '[\n' + gap +
-                            partial.join(',\n' + gap) + '\n' +
-                                mind + ']' :
-                          '[' + partial.join(',') + ']';
-                gap = mind;
-                return v;
-            }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
-            if (rep && typeof rep === 'object') {
-                length = rep.length;
-                for (i = 0; i < length; i += 1) {
-                    k = rep[i];
-                    if (typeof k === 'string') {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
-                for (k in value) {
-                    if (Object.hasOwnProperty.call(value, k)) {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
-            v = partial.length === 0 ? '{}' :
-                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
-                        mind + '}' : '{' + partial.join(',') + '}';
-            gap = mind;
-            return v;
-        }
-    }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
-    if (typeof JSON.stringify !== 'function') {
-        JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
-            var i;
-            gap = '';
-            indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
-            if (typeof space === 'number') {
-                for (i = 0; i < space; i += 1) {
-                    indent += ' ';
-                }
-
-// If the space parameter is a string, it will be used as the indent string.
-
-            } else if (typeof space === 'string') {
-                indent = space;
-            }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
-            rep = replacer;
-            if (replacer && typeof replacer !== 'function' &&
-                    (typeof replacer !== 'object' ||
-                     typeof replacer.length !== 'number')) {
-                throw new Error('JSON.stringify');
-            }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
-            return str('', {'': value});
-        };
-    }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
-    if (typeof JSON.parse !== 'function') {
-        JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
-            var j;
-
-            function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
-                var k, v, value = holder[key];
-                if (value && typeof value === 'object') {
-                    for (k in value) {
-                        if (Object.hasOwnProperty.call(value, k)) {
-                            v = walk(value, k);
-                            if (v !== undefined) {
-                                value[k] = v;
-                            } else {
-                                delete value[k];
-                            }
-                        }
-                    }
-                }
-                return reviver.call(holder, key, value);
-            }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
-            text = String(text);
-            cx.lastIndex = 0;
-            if (cx.test(text)) {
-                text = text.replace(cx, function (a) {
-                    return '\\u' +
-                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-                });
-            }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
-            if (/^[\],:{}\s]*$/.
-test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
-replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
-replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
-                j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
-                return typeof reviver === 'function' ?
-                    walk({'': j}, '') : j;
-            }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
-            throw new SyntaxError('JSON.parse');
-        };
-    }
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/plugins.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/plugins.xml b/lib/cordova-blackberry/bin/templates/project/www/plugins.xml
deleted file mode 100644
index 3d41236..0000000
--- a/lib/cordova-blackberry/bin/templates/project/www/plugins.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-       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.
--->
-<plugins>
-  <plugin name="App"            value="org.apache.cordova.app.App"/>
-  <plugin name="Device"         value="org.apache.cordova.device.Device"/>
-  <plugin name="Camera"         value="org.apache.cordova.camera.Camera"/>
-  <plugin name="NetworkStatus"  value="org.apache.cordova.network.Network"/>
-  <plugin name="Notification"   value="org.apache.cordova.notification.Notification"/>
-  <plugin name="Accelerometer"  value="org.apache.cordova.accelerometer.Accelerometer"/>
-  <plugin name="Geolocation"    value="org.apache.cordova.geolocation.Geolocation"/>
-  <plugin name="File"           value="org.apache.cordova.file.FileManager"/>
-  <plugin name="FileTransfer"   value="org.apache.cordova.http.FileTransfer"/>
-  <plugin name="Contacts"       value="org.apache.cordova.pim.Contact"/>
-  <plugin name="Capture"        value="org.apache.cordova.capture.MediaCapture"/>
-  <plugin name="Battery"        value="org.apache.cordova.battery.Battery"/>
-  <plugin name="Media"          value="org.apache.cordova.media.Media"/>
-  <plugin name="Globalization"  value="org.apache.cordova.globalization.Globalization"/>
-</plugins>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png b/lib/cordova-blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png
deleted file mode 100644
index f86a27a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz
deleted file mode 100644
index 3c1fecd..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz
deleted file mode 100644
index 677a6ad..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz
deleted file mode 100644
index 602c22c..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz
deleted file mode 100644
index 485b9a2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz
deleted file mode 100644
index dfc2045..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz
deleted file mode 100644
index 9e7c5ae..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz
deleted file mode 100644
index 72d26ca..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz
deleted file mode 100644
index 1dde592..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz
deleted file mode 100644
index 640e8be..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz
deleted file mode 100644
index b7beb36..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz
deleted file mode 100644
index 3eb49f9..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz
deleted file mode 100644
index b68cf81..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz
deleted file mode 100644
index d2583d4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz
deleted file mode 100644
index aa15f88..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz
deleted file mode 100644
index 116f0e2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz
deleted file mode 100644
index 65aaeb0..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz
deleted file mode 100644
index 853cc9e..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz
deleted file mode 100644
index 841ee63..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz
deleted file mode 100644
index a0a64b8..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz
deleted file mode 100644
index fec5f32..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz
deleted file mode 100644
index 4f816d8..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz
deleted file mode 100644
index 9cc5ec3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz
deleted file mode 100644
index 3f40ba4..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz
deleted file mode 100644
index 32e04c5..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz
deleted file mode 100644
index 93d8ec3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz
deleted file mode 100644
index 69be9b1..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz
deleted file mode 100644
index 28dd3ee..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz
deleted file mode 100644
index 95d0e32..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz
deleted file mode 100644
index 9d821d6..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz
deleted file mode 100644
index 681c4b3..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz
deleted file mode 100644
index ba270ad..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz
deleted file mode 100644
index 0b9dbe2..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz b/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz
deleted file mode 100644
index 8d52b6a..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz and /dev/null differ


[37/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Geolocation.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Geolocation.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Geolocation.java
new file mode 100644
index 0000000..1226f48
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Geolocation.java
@@ -0,0 +1,372 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.geolocation;
+
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import javax.microedition.location.Criteria;
+import javax.microedition.location.Location;
+import javax.microedition.location.LocationException;
+import javax.microedition.location.LocationProvider;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+
+import net.rim.device.api.gps.BlackBerryCriteria;
+import net.rim.device.api.gps.BlackBerryLocationProvider;
+import net.rim.device.api.gps.GPSInfo;
+
+public class Geolocation extends Plugin {
+
+	/**
+	 * Possible actions.
+	 */
+	protected static final int ACTION_WATCH = 0;
+	protected static final int ACTION_CLEAR_WATCH = 1;
+	protected static final int ACTION_GET_POSITION = 2;
+	protected static final int ACTION_SHUTDOWN = 3;
+
+	/**
+	 * Callback ID argument index.
+	 */
+	protected static final int ARG_CALLBACK_ID = 0;
+
+	/**
+	 * Minimum GPS accuracy (meters).
+	 */
+	protected static final float MIN_GPS_ACCURACY = 10F; // meters
+
+	/**
+	 * Hash of all the listeners created, keyed on callback ids.
+	 */
+	protected final Hashtable geoListeners;
+
+	/**
+	 * Constructor.
+	 */
+	public Geolocation() {
+		this.geoListeners = new Hashtable();
+	}
+
+	/**
+	 * Executes the specified geolocation action.
+	 *
+	 * @param action
+	 * 	  "getCurrentPosition" - Retrieves current location.
+	 * 	  "watchPosition"      - Establishes a location provider that is keyed on specified position options
+	 *                           and attaches a listener that notifies registered callbacks of location updates.
+	 *    "stop"               - Clears the watch identified by the watch ID that must be specified in args.
+	 *    "shutdown"           - Stops all listeners and resets all location providers.
+	 * @param callbackId callback managed by the plugin manager (ignored)
+	 * @param args contains the callback id and position options
+	 */
+	public PluginResult execute(String action, JSONArray args,  String callbackId) {
+
+		/*
+		 * The geolocation plugin bypasses the plugin callback framework for
+		 * success callbacks because the current implementation of the framework
+		 * deletes the callbacks after they have been called.  The geolocation
+		 * listener callbacks need to continue listening for location changes,
+		 * and are therefore managed separately from the plugin framework.
+		 *
+		 * This means the invoking script must pass the listener callback ID in
+		 * the args parameter (along with the position options).  The callbackId
+		 * parameter (used by the plugin framework) is ignored.
+		 *
+		 * The invoking script should still provide a failure callback so the
+		 * plugin framework can handle general error reporting.
+		 */
+		String listenerCallbackId;
+		try {
+			listenerCallbackId = args.getString(ARG_CALLBACK_ID);
+		} catch (JSONException e) {
+			return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "Callback ID argument is not valid.");
+		}
+
+		if (!GPSInfo.isGPSModeAvailable(GPSInfo.GPS_DEVICE_INTERNAL)){
+			return new PluginResult(GeolocationStatus.GPS_NOT_AVAILABLE);
+		}
+
+		PositionOptions options;
+		switch (getAction(action)) {
+			case ACTION_CLEAR_WATCH:
+				clearWatch(listenerCallbackId);
+				return null;
+
+			case ACTION_WATCH:
+
+				try {
+					options = PositionOptions.fromJSONArray(args);
+				} catch (NumberFormatException e) {
+					return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "One of the position options is not a valid number.");
+				} catch (JSONException e) {
+					return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "One of the position options is not valid JSON.");
+				}
+
+				this.watchPosition(listenerCallbackId, options);
+				return null;
+
+			case ACTION_GET_POSITION:
+
+				try {
+					options = PositionOptions.fromJSONArray(args);
+				} catch (NumberFormatException e) {
+					return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "One of the position options is not a valid number.");
+				} catch (JSONException e) {
+					return new PluginResult(PluginResult.Status.JSON_EXCEPTION, "One of the position options is not valid JSON.");
+				}
+
+				this.getCurrentPosition(listenerCallbackId, options);
+				return null;
+
+			case ACTION_SHUTDOWN:
+				this.shutdown();
+				return null;
+		}
+
+		return new PluginResult(PluginResult.Status.INVALID_ACTION, "Geolocation: invalid action " + action);
+	}
+
+	/**
+	 * Checks if the provided location is valid.
+	 * @param location
+	 * @return true if the location is valid
+	 */
+	protected boolean isLocationValid(Location location) {
+		return location != null && location.isValid();
+	}
+
+	/**
+	 * Checks if the provided location is fresh or not.
+	 * @param po           position options containing maximum location age allowed
+	 * @param location     location object
+	 * @return true if the location is newer than maximum age allowed
+	 */
+	protected boolean isLocationFresh(PositionOptions po, Location location) {
+		return new Date().getTime() - location.getTimestamp() < po.maxAge;
+	}
+
+	/**
+	 * Checks if the accuracy of the location is high enough.
+	 * @param po           position options containing high accuracy flag
+	 * @param location     location object
+	 * @return true if the location accuracy is lower than MIN_GPS_ACCURACY
+	 */
+	protected boolean isLocationAccurate(PositionOptions po, Location location) {
+		return po.enableHighAccuracy && location.getQualifiedCoordinates().getHorizontalAccuracy() < MIN_GPS_ACCURACY;
+	}
+
+	/**
+	 * Retrieves a location provider with some criteria.
+	 * @param po position options
+	 */
+	protected static LocationProvider getLocationProvider(PositionOptions po) {
+		// configure criteria for location provider
+		// Note: being too restrictive will make it less likely that one will be returned
+		BlackBerryCriteria criteria = new BlackBerryCriteria();
+
+		// can we get GPS info from the wifi network?
+		if (GPSInfo.isGPSModeAvailable(GPSInfo.GPS_MODE_ASSIST))
+			criteria.setMode(GPSInfo.GPS_MODE_ASSIST);
+		// relies on device GPS receiver - not good indoors or if obstructed
+		else if (GPSInfo.isGPSModeAvailable(GPSInfo.GPS_MODE_AUTONOMOUS))
+			criteria.setMode(GPSInfo.GPS_MODE_AUTONOMOUS);
+
+		criteria.setAltitudeRequired(true);
+
+		// enable full power usage to increase location accuracy
+		if (po.enableHighAccuracy) {
+			criteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_HIGH);
+		}
+
+		// Attempt to get a location provider
+		BlackBerryLocationProvider provider;
+		try {
+			// Note: this could return an existing provider that meets above criteria
+			provider  = (BlackBerryLocationProvider) LocationProvider.getInstance(criteria);
+		} catch (LocationException e) {
+			// all LocationProviders are currently permanently unavailable :(
+			provider = null;
+		}
+
+		return provider;
+	}
+
+    /**
+     * Gets the current location, then creates a location listener to receive
+     * updates. Registers the specified callback with the listener.
+     * @param callbackId   callback to receive location updates
+     * @param options      position options
+     */
+    protected void watchPosition(String callbackId, PositionOptions options) {
+
+        // attempt to retrieve a location provider
+        LocationProvider provider = getLocationProvider(options);
+        if (provider == null) {
+            CordovaExtension.invokeErrorCallback(callbackId,
+                    new GeolocationResult(GeolocationStatus.GPS_NOT_AVAILABLE));
+            return;
+        }
+
+        // create a listener for location updates
+        GeolocationListener listener;
+        try {
+            listener = new GeolocationListener(provider, callbackId, options);
+        } catch (IllegalArgumentException e) {
+            // if 	interval < -1, or
+            // if 	(interval != -1) and
+            //		(timeout > interval or maxAge > interval or
+            //			(timeout < 1 and timeout != -1) or
+            //			(maxAge < 1 and maxAge != -1)
+            //		)
+            CordovaExtension.invokeErrorCallback(callbackId,
+                    new GeolocationResult(GeolocationStatus.GPS_JSON_EXCEPTION, e.getMessage()));
+            return;
+        }
+
+        // store the listener
+        addListener(callbackId, listener);
+    }
+
+    /**
+     * Shuts down all location listeners.
+     */
+    protected synchronized void shutdown() {
+        for (Enumeration listeners = this.geoListeners.elements(); listeners.hasMoreElements(); ) {
+            GeolocationListener listener = (GeolocationListener) listeners.nextElement();
+            listener.shutdown();
+        }
+        this.geoListeners.clear();
+    }
+
+	/**
+	 * Clears the watch for the specified callback id.
+	 * If no more watches exist for the location provider, it is shut down.
+	 * @param callbackId   identifer of the listener to shutdown
+	 */
+    protected void clearWatch(String callbackId) {
+        synchronized(this.geoListeners) {
+            GeolocationListener listener = (GeolocationListener) this.geoListeners.get(callbackId);
+            listener.shutdown();
+            this.geoListeners.remove(callbackId);
+        }
+    }
+
+    /**
+     * Returns a PluginResult with status OK and a JSON object representing the coords
+     * @param callbackId   callback to receive the the result
+     * @param po           position options
+     */
+    protected void getCurrentPosition(String callbackId, PositionOptions options) {
+
+        // Check the device for its last known location (may have come from
+        // another app on the device that has already requested a location).
+        // If it is invalid, old, or inaccurate, attempt to get a new one.
+        Location location = LocationProvider.getLastKnownLocation();
+        if (!isLocationValid(location) || !isLocationFresh(options, location) || !isLocationAccurate(options, location)) {
+            // attempt to retrieve a location provider
+            LocationProvider provider = getLocationProvider(options);
+            if (provider == null) {
+                CordovaExtension.invokeErrorCallback(callbackId,
+                        new GeolocationResult(GeolocationStatus.GPS_NOT_AVAILABLE));
+                return;
+            }
+
+            try {
+                // convert timeout from millis
+                int timeout = (options.timeout > 0) ? options.timeout/1000 : -1;
+                Logger.log(this.getClass().getName() + ": retrieving location with timeout=" + timeout);
+                location = provider.getLocation(timeout);
+            } catch(LocationException e) {
+                Logger.log(this.getClass().getName() + ": " + e.getMessage());
+                provider.reset();
+                CordovaExtension.invokeErrorCallback(callbackId,
+                        new GeolocationResult(GeolocationStatus.GPS_TIMEOUT));
+                return;
+            } catch (InterruptedException e) {
+                Logger.log(this.getClass().getName() + ": " + e.getMessage());
+                provider.reset();
+                CordovaExtension.invokeErrorCallback(callbackId,
+                        new GeolocationResult(GeolocationStatus.GPS_INTERUPTED_EXCEPTION));
+                return;
+            }
+        }
+
+        // send the location back
+        sendLocation(callbackId, location);
+    }
+
+    /**
+     * Converts the location to a geo position and sends result to JavaScript.
+     * @param callbackId   callback to receive position
+     * @param location     location to send
+     */
+    protected void sendLocation(String callbackId, Location location) {
+        // convert the location to a JSON object and return it in the PluginResult
+        JSONObject position = null;
+        try {
+            position = Position.fromLocation(location).toJSONObject();
+        } catch (JSONException e) {
+            CordovaExtension.invokeErrorCallback(callbackId,
+                    new GeolocationResult(PluginResult.Status.JSON_EXCEPTION,
+                    "Converting the location to a JSON object failed"));
+            return;
+        }
+
+        // invoke the geolocation callback
+        CordovaExtension.invokeSuccessCallback(callbackId,
+                new GeolocationResult(GeolocationResult.Status.OK, position));
+    }
+
+	/**
+	 * Returns action to perform.
+	 * @param action
+	 * @return action to perform
+	 */
+	protected static int getAction(String action) {
+		if ("watchPosition".equals(action)) return ACTION_WATCH;
+		if ("stop".equals(action)) return ACTION_CLEAR_WATCH;
+		if ("getCurrentPosition".equals(action)) return ACTION_GET_POSITION;
+		if ("shutdown".endsWith(action)) return ACTION_SHUTDOWN;
+		return -1;
+	}
+
+    /**
+     * Adds a location listener.
+     * @param callbackId    callback to receive listener updates
+     * @param listener      location listener
+     */
+    protected synchronized void addListener(String callbackId, GeolocationListener listener) {
+        this.geoListeners.put(callbackId, listener);
+    }
+
+    /**
+     * Called when Plugin is destroyed.
+     */
+    public void onDestroy() {
+        this.shutdown();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationListener.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationListener.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationListener.java
new file mode 100644
index 0000000..58ef4f0
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationListener.java
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.geolocation;
+
+import javax.microedition.location.Location;
+import javax.microedition.location.LocationListener;
+import javax.microedition.location.LocationProvider;
+
+import org.apache.cordova.CordovaExtension;
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+
+/**
+ * GeolocationListener listens for update notifications from a LocationProvider.
+ * Provides location update notifications to registered callback.
+ */
+public final class GeolocationListener implements LocationListener {
+
+	private LocationProvider locationProvider;  // location provider the listener listens to
+	private String callbackId;                  // callback that is to be notified on location updates
+
+	/**
+	 * Creates a new listener that attaches itself to the specified LocationProvider.
+	 * @param locationProvider location provider that listener will attach to
+	 * @param callbackId       callback to receive location updates
+	 * @param options          position options
+	 */
+	public GeolocationListener(LocationProvider locationProvider, String callbackId, PositionOptions options) {
+	    this.locationProvider = locationProvider;
+	    this.callbackId = callbackId;
+
+	    // Add this as a location listener to the provider.  Updates are received
+	    // at the specified interval.  This is where it gets confusing:
+	    // the setLocationListener method takes three parameters: interval, timeout,
+	    // and maxAge.  The listener only seems to work if all three are the same
+	    // value, which is probably best, since neither timeout nor maxAge can be
+	    // larger than interval.  Also, the actual timeout to wait for a valid
+	    // location is [interval + timeout]. (I told you it was confusing).
+	    // So, we do the only thing we can do, which is to divide the user timeout
+	    // in half, and set it to the interval and timeout values.  This will give
+	    // us the correct timeout value. BTW, this is exactly what RIM does in
+	    // their HTML5 implementation in the 6.0 browser.  Try it :)
+        int seconds = (options.timeout > 0) ? options.timeout/2000 : 1; // half and convert to millis
+	    this.locationProvider.setLocationListener(this,
+	            seconds,     // interval - seconds between location updates
+	            seconds,     // timeout - additional time to wait for update
+	            seconds);    // maxage - maximum age of location
+	}
+
+    /**
+     * Updated when location changes.
+     */
+    public void locationUpdated(LocationProvider provider, Location location) {
+        if (location.isValid()) {
+            Logger.log(this.getClass().getName() + ": updated with valid location");
+            this.updateLocation(location);
+        } else {
+            // This just means we couldn't get a valid location within the listener interval.
+            Logger.log(this.getClass().getName() + ": updated with invalid location");
+            CordovaExtension.invokeErrorCallback(callbackId,
+                    new GeolocationResult(GeolocationStatus.GPS_TIMEOUT));
+        }
+    }
+
+	/**
+	 * Updated when provider state changes.
+	 */
+    public void providerStateChanged(LocationProvider provider, int newState) {
+        switch (newState) {
+        case LocationProvider.AVAILABLE:
+            Logger.log(this.getClass().getName() + ": provider state changed to AVAILABLE");
+            break;
+        case LocationProvider.OUT_OF_SERVICE:
+            Logger.log(this.getClass().getName() + ": provider state changed to OUT_OF_SERVICE");
+            CordovaExtension.invokeErrorCallback(callbackId,
+                    new GeolocationResult(GeolocationStatus.GPS_OUT_OF_SERVICE));
+            this.shutdown();
+            break;
+        case LocationProvider.TEMPORARILY_UNAVAILABLE:
+            Logger.log(this.getClass().getName() + ": provider state changed to TEMPORARILY_UNAVAILABLE");
+            // This is what happens when you are inside
+            // TODO: explore possible ways to recover
+            CordovaExtension.invokeErrorCallback(callbackId,
+                    new GeolocationResult(GeolocationStatus.GPS_TEMPORARILY_UNAVAILABLE));
+            this.shutdown();
+            break;
+        }
+    }
+
+    /**
+     * Shuts down the listener by resetting the location provider.
+     */
+	public void shutdown() {
+		Logger.log(this.getClass().getName() + ": resetting location provider for callback '" + callbackId + "'");
+		this.locationProvider.setLocationListener(null, 0, 0, 0);
+		this.locationProvider.reset();
+	}
+
+	/**
+	 * Notifies callbacks of location updates.
+	 * @param location updated location
+	 */
+	protected void updateLocation(Location location) {
+		JSONObject position = null;
+		try {
+			position = Position.fromLocation(location).toJSONObject();
+		} catch (JSONException e) {
+			CordovaExtension.invokeErrorCallback(callbackId,
+				new GeolocationResult(PluginResult.Status.JSON_EXCEPTION, "Converting the location to a JSON object failed"));
+		}
+
+		CordovaExtension.invokeSuccessCallback(callbackId,
+			new GeolocationResult(GeolocationStatus.OK, position));
+	}
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationResult.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationResult.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationResult.java
new file mode 100644
index 0000000..9969701
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationResult.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.geolocation;
+
+import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.json4j.JSONObject;
+import org.apache.cordova.util.Logger;
+
+/**
+ * Extends PluginResult for the purposes of overriding the success and error
+ * callback invocations.
+ */
+public class GeolocationResult extends PluginResult {
+
+	/**
+	 * Constructor.
+	 * @param status
+	 */
+	public GeolocationResult(Status status) {
+		super(status);
+	}
+
+	/**
+	 * Constructor.
+	 * @param status
+	 * @param message
+	 */
+	public GeolocationResult(Status status, String message) {
+		super(status, message);
+	}
+
+	/**
+	 * Constructor.
+	 * @param status
+	 * @param message
+	 */
+	public GeolocationResult(Status status, JSONObject message) {
+		super(status, message);
+	}
+
+	/**
+	 * Produces the invocation string for the specified geolocation success callback.
+	 * @param callbackId callback identifier
+	 */
+	public String toSuccessCallbackString(String callbackId) {
+		Logger.log(this.getClass().getName() + ": invoking success callback: " + callbackId + ", with args: " + this.getJSONString());
+		return "try { navigator.geolocation.success('"+callbackId+"', " + this.getJSONString() + "); } catch(e) { alert('error in success callback:' + e.message); }";
+	}
+
+	/**
+	 * Produces the invocation string for the specified geolocation error callback.
+	 * @param callbackId callback identifier
+	 */
+	public String toErrorCallbackString(String callbackId) {
+		return "try { navigator.geolocation.fail('"+callbackId+"', " + this.getJSONString() + "); } catch(e) { alert('error in error callback:' + e.message); }";
+	}
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationStatus.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationStatus.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationStatus.java
new file mode 100644
index 0000000..4c70a10
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/GeolocationStatus.java
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.geolocation;
+
+import org.apache.cordova.api.PluginResult;
+
+public class GeolocationStatus extends PluginResult.Status {
+
+	protected GeolocationStatus(int status, String message) {
+		super(status, message);
+	}
+
+	public static final GeolocationStatus GPS_NOT_AVAILABLE = new GeolocationStatus(101, "GPS not available");
+	public static final GeolocationStatus GPS_OUT_OF_SERVICE = new GeolocationStatus(102, "GPS out of service");
+	public static final GeolocationStatus GPS_TEMPORARILY_UNAVAILABLE = new GeolocationStatus(103, "GPS temporarily unavailable");
+	public static final GeolocationStatus GPS_TIMEOUT = new GeolocationStatus(104, "GPS location acquisition timed out");
+	public static final GeolocationStatus GPS_INTERUPTED_EXCEPTION = new GeolocationStatus(105, "GPS location acquisition interrupted");
+	public static final GeolocationStatus GPS_INVALID_LOCATION = new GeolocationStatus(106, "GPS returned an invalid location");
+	public static final GeolocationStatus GPS_JSON_EXCEPTION = new GeolocationStatus(107, "An illegal argument was passed to the location listener");
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Position.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Position.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Position.java
new file mode 100644
index 0000000..6ce490e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/Position.java
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.geolocation;
+
+import javax.microedition.location.Location;
+
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+/**
+ * Stores geo location variables.
+ */
+public class Position {
+
+	private double _lat = 0;
+    private double _lng = 0;
+	private float altitude = 0;
+	private float accuracy = 0;
+	private float alt_accuracy = 0;
+    private float heading = 0;
+	private float velocity = 0;
+	private long timestamp = 0;
+
+	public Position(double lat, double lng, float altitude, float accuracy, float alt_accuracy,
+			float heading, float speed, long timestamp) {
+		this._lat = lat;
+		this._lng = lng;
+		this.altitude = altitude;
+		this.accuracy = accuracy;
+		this.alt_accuracy = alt_accuracy;
+		this.heading = heading;
+		this.velocity = speed;
+		this.timestamp = timestamp;
+	}
+
+	public static Position fromLocation(Location location) {
+		double latitude = location.getQualifiedCoordinates().getLatitude();
+        double longitude = location.getQualifiedCoordinates().getLongitude();
+        float altitude = location.getQualifiedCoordinates().getAltitude();
+        float accuracy = location.getQualifiedCoordinates().getHorizontalAccuracy();
+        float alt_accuracy = location.getQualifiedCoordinates().getVerticalAccuracy();
+        float heading = location.getCourse();
+        float speed = location.getSpeed();
+        long time = location.getTimestamp();
+
+		return new Position(latitude, longitude, altitude, accuracy, alt_accuracy, heading, speed, time);
+	}
+
+    public double getLatitude() {
+		return _lat;
+	}
+
+	public void setLatitude(double _lat) {
+		this._lat = _lat;
+	}
+
+	public double getLongitude() {
+		return _lng;
+	}
+
+	public void setLongitude(double _lng) {
+		this._lng = _lng;
+	}
+
+	public float getAltitude() {
+		return altitude;
+	}
+
+	public void setAltitude(float altitude) {
+		this.altitude = altitude;
+	}
+
+	public float getAccuracy() {
+		return accuracy;
+	}
+
+	public void setAccuracy(float accuracy) {
+		this.accuracy = accuracy;
+	}
+
+	public float getAltitudeAccuracy() {
+		return alt_accuracy;
+	}
+
+	public void setAltitudeAccuracy(float alt_accuracy) {
+		this.alt_accuracy = alt_accuracy;
+	}
+
+	public float getHeading() {
+		return heading;
+	}
+
+	public void setHeading(float heading) {
+		this.heading = heading;
+	}
+
+	public float getVelocity() {
+		return velocity;
+	}
+
+	public void setVelocity(float velocity) {
+		this.velocity = velocity;
+	}
+
+	public long getTimestamp() {
+		return timestamp;
+	}
+
+	public void setTimestamp(long timestamp) {
+		this.timestamp = timestamp;
+	}
+
+	public JSONObject toJSONObject() throws JSONException {
+		return new JSONObject("{latitude:" + String.valueOf(_lat) + ", longitude:" + String.valueOf(_lng) + ", altitude:" + altitude + ", accuracy:" + accuracy + ", heading:" + heading + ", speed:" + velocity + ", alt_accuracy:" + alt_accuracy + ", timestamp:" + timestamp + "}");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/PositionOptions.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/PositionOptions.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/PositionOptions.java
new file mode 100644
index 0000000..85d5853
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/geolocation/PositionOptions.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.geolocation;
+
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONException;
+
+public class PositionOptions {
+	private static final int START_ARG_MAX_AGE = 1;
+	private static final int START_ARG_TIMEOUT = 2;
+	private static final int START_ARG_HIGH_ACCURACY = 3;
+
+	public int maxAge;
+	public int timeout;
+	public boolean enableHighAccuracy;
+
+	public static PositionOptions fromJSONArray(JSONArray args) throws NumberFormatException, JSONException {
+		PositionOptions po = new PositionOptions();
+
+		po.maxAge = Integer.parseInt(args.getString(START_ARG_MAX_AGE));
+		po.timeout = Integer.parseInt(args.getString(START_ARG_TIMEOUT));
+		po.enableHighAccuracy = args.getBoolean(START_ARG_HIGH_ACCURACY);
+
+		return po;
+	}
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Globalization.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Globalization.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Globalization.java
new file mode 100644
index 0000000..e6aaae5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Globalization.java
@@ -0,0 +1,558 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.globalization;
+
+import org.apache.cordova.json4j.JSONArray;
+import org.apache.cordova.json4j.JSONObject;
+
+import org.apache.cordova.api.Plugin;
+import org.apache.cordova.api.PluginResult;
+
+import net.rim.device.api.i18n.Locale;
+import net.rim.device.api.i18n.SimpleDateFormat;
+import net.rim.device.api.util.TimeZoneUtilities;
+import javax.microedition.global.Formatter;
+
+import java.util.Date;
+import java.util.Calendar;
+import java.util.TimeZone;
+import java.lang.Long;
+
+public class Globalization extends Plugin {
+
+    /**
+     * Executes the requested action and returns a PluginResult.
+     *
+     * @param action
+     *            The action to execute.
+     * @param data
+     *            JSONArry of arguments for the action.
+     * @param callbackId
+     *            The callback ID to be invoked upon action completion
+     * @return A PluginResult object with a status and message.
+     */
+    public PluginResult execute(String action, JSONArray data, String callbackId) {
+        JSONObject obj = new JSONObject();
+
+        try {
+            if (action.equals(Resources.GETLOCALENAME)) {
+                obj = getLocaleName();
+            } else if (action.equals(Resources.GETPREFERREDLANGUAGE)) {
+                obj = getPreferredLanguage();
+            } else if (action.equalsIgnoreCase(Resources.DATETOSTRING)) {
+                obj = getDateToString(data);
+            } else if (action.equalsIgnoreCase(Resources.STRINGTODATE)) {
+                obj = getStringToDate(data);
+            } else if (action.equalsIgnoreCase(Resources.GETDATEPATTERN)) {
+                obj = getDatePattern(data);
+            } else if (action.equalsIgnoreCase(Resources.GETDATENAMES)) {
+                obj = getDateNames(data);
+            } else if (action.equalsIgnoreCase(Resources.ISDAYLIGHTSAVINGSTIME)) {
+                obj = getIsDayLightSavingsTime(data);
+            } else if (action.equalsIgnoreCase(Resources.GETFIRSTDAYOFWEEK)) {
+                obj = getFirstDayOfWeek(data);
+            } else if (action.equalsIgnoreCase(Resources.NUMBERTOSTRING)) {
+                obj = getNumberToString(data);
+            } else if (action.equalsIgnoreCase(Resources.STRINGTONUMBER)) {
+                obj = getStringToNumber(data);
+            } else if (action.equalsIgnoreCase(Resources.GETNUMBERPATTERN)) {
+                obj = getNumberPattern(data);
+            } else if (action.equalsIgnoreCase(Resources.GETCURRENCYPATTERN)) {
+                obj = getCurrencyPattern(data);
+            } else {
+                return new PluginResult(PluginResult.Status.INVALID_ACTION);
+            }
+        } catch (GlobalizationError ge) {
+            return new PluginResult(PluginResult.Status.ERROR, ge.toJson());
+        } catch (Exception e) {
+            return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
+        }
+
+        return new PluginResult(PluginResult.Status.OK, obj);
+    }
+
+    /**
+     * Returns the string identifier for the client's current locale setting.
+     *
+     * @return JSONObject Object.value {String}: The locale identifier
+     *
+     * @throws GlobalizationError.UNKNOWN_ERROR
+     */
+    private JSONObject getLocaleName() throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            return obj.put("value", Locale.getDefault().toString());
+        } catch (Exception e) {
+            throw new GlobalizationError(GlobalizationError.UNKNOWN_ERROR);
+        }
+    }
+
+    /**
+     * Returns the string identifier for the client's current language
+     *
+     * @return JSONObject Object.value {String}: The language identifier
+     *
+     * @throws GlobalizationError.UNKNOWN_ERROR
+     */
+    private JSONObject getPreferredLanguage() throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            return obj.put("value", Locale.getDefault().getDisplayLanguage()
+                    .toString());
+        } catch (Exception e) {
+            throw new GlobalizationError(GlobalizationError.UNKNOWN_ERROR);
+        }
+    }
+
+    /**
+     * Returns a date formatted as a string according to the client's user
+     * preferences and calendar using the time zone of the client.
+     *
+     * @return JSONObject Object.value {String}: The localized date string
+     *
+     * @throws GlobalizationError.FORMATTING_ERROR
+     */
+    private JSONObject getDateToString(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            Date date = new Date(Long.parseLong(options.getJSONObject(0)
+                    .get(Resources.DATE).toString()));
+            // get formatting pattern from BB device
+            SimpleDateFormat fmt = new SimpleDateFormat(
+                    Util.getBlackBerryDatePattern(options));
+
+            // return formatted date
+            return obj.put("value", fmt.format(date));
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.FORMATTING_ERROR);
+        }
+    }
+
+    /**
+     * Parses a date formatted as a string according to the client's user
+     * preferences and calendar using the time zone of the client and returns
+     * the corresponding date object
+     *
+     * @return JSONObject
+     *          Object.year {Number}: The four digit year
+     *          Object.month {Number}: The month from (0 - 11)
+     *          Object.day {Number}: The day from (1 - 31)
+     *          Object.hour {Number}: The hour from (0 - 23)
+     *          Object.minute {Number}: The minute from (0 - 59)
+     *          Object.second {Number}: The second from (0 - 59)
+     *          Object.millisecond {Number}: The milliseconds (from 0 - 999),
+     *                                      not available on all platforms
+     *
+     * @throws GlobalizationError.PARSING_ERROR
+     */
+    private JSONObject getStringToDate(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            // get formatting pattern from BB device
+            SimpleDateFormat fmt = new SimpleDateFormat(
+                    Util.getBlackBerryDatePattern(options));
+
+            // Manually parse string based on user preferences or Locale default
+            String userDate = options.getJSONObject(0)
+                    .get(Resources.DATESTRING).toString().trim();
+
+            Calendar date = Util.dateParserBB(userDate, fmt.toPattern());
+            if (date == null) { // date was unparsable
+                throw new Exception();
+            }
+
+            // return properties;
+            obj.put("year", date.get(Calendar.YEAR));
+            obj.put("month", date.get(Calendar.MONTH)); // returns 0-11
+            obj.put("day", date.get(Calendar.DAY_OF_MONTH));
+            obj.put("hour", date.get(Calendar.HOUR));
+            obj.put("minute", date.get(Calendar.MINUTE));
+            obj.put("second", date.get(Calendar.SECOND));
+            obj.put("millisecond", date.get(Calendar.MILLISECOND));
+            return obj;
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.PARSING_ERROR);
+        }
+    }
+
+    /**
+     * Returns a pattern string for formatting and parsing dates according to
+     * the client's user preferences.
+     *
+     * @return JSONObject
+     *          Object.pattern {String}: The date and time pattern for
+     *                  formatting and parsing dates. The patterns follow
+     *                  Unicode Technical Standard #35
+     *                  http://unicode.org/reports/tr35/tr35-4.html
+     *          Object.timezone {String}: The abbreviated name of the time
+     *                  zone on the client
+     *          Object.utc_offset {Number}: The current difference in seconds
+     *                  between the client's time zon and coordinated universal
+     *                  time.
+     *          Object.dst_offset {Number}: The current daylight saving time
+     *                  offset in seconds between the client's non-daylight
+     *                  saving's time zone and the client's daylight saving's
+     *                  time zone.
+     *
+     * @throws GlobalizationError.PATTERN_ERROR
+     */
+    private JSONObject getDatePattern(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            // TimeZone from users device
+            TimeZone tz = Calendar.getInstance().getTimeZone();
+
+            // Daylight
+            boolean daylight = tz.useDaylightTime();
+
+            // set dst_offset
+            int dst_offset = 0; // defaulted to zero
+            if (daylight) {
+                Calendar c = Calendar.getInstance();
+                dst_offset = (tz.getOffset(1, c.get(Calendar.YEAR),
+                        c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH),
+                        c.get(Calendar.DAY_OF_WEEK),
+                        c.get(Calendar.MILLISECOND))) / 1000;
+            }
+
+            obj.put("pattern", Util.getBlackBerryDatePattern(options));
+            obj.put("timezone", TimeZoneUtilities.getDisplayName(tz,
+                    TimeZoneUtilities.SHORT));
+            obj.put("utc_offset", tz.getRawOffset() / 1000);
+            obj.put("dst_offset", dst_offset);
+            return obj;
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.PATTERN_ERROR);
+        }
+    }
+
+    /**
+     * Returns an array of either the names of the months or days of the week
+     * according to the client's user preferences and calendar
+     *
+     * @return JSONObject
+     *          Object.value {Array{String}}: The array of names starting from
+     *                      either the first month in the year or the first day
+     *                      of the week.
+     *
+     * @throws GlobalizationError.UNKNOWN_ERROR
+     */
+    private JSONObject getDateNames(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        JSONArray value = new JSONArray();
+        try {
+            int type = 0; // default wide
+            int item = 0; // default months
+
+            // get options if available
+            if (options.getJSONObject(0).length() > 0) {
+                // get type if available
+                if (!((JSONObject) options.getJSONObject(0).get(
+                        Resources.OPTIONS)).isNull(Resources.TYPE)) {
+                    String t = (String) ((JSONObject) options.getJSONObject(0)
+                            .get(Resources.OPTIONS)).get(Resources.TYPE);
+                    if (t.equalsIgnoreCase(Resources.NARROW)) {
+                        type++;
+                    } // DateUtils.LENGTH_MEDIUM
+                }
+                // get item if available
+                if (!((JSONObject) options.getJSONObject(0).get(
+                        Resources.OPTIONS)).isNull(Resources.ITEM)) {
+                    String t = (String) ((JSONObject) options.getJSONObject(0)
+                            .get(Resources.OPTIONS)).get(Resources.ITEM);
+                    if (t.equalsIgnoreCase(Resources.DAYS)) {
+                        item += 10;
+                    } // Days of week start at 1
+                }
+            }
+            // determine return value
+
+            int method = item + type;
+            if (method == 1) {
+                value = Util.getDateNameString(Resources.MONTHS, "MMM");
+            }// months and narrow
+            else if (method == 10) {
+                value = Util.getDateNameString(Resources.DAYS, "EEEE");
+            }// days and wide
+            else if (method == 11) {
+                value = Util.getDateNameString(Resources.DAYS, "EEE");
+            }// days and narrow
+            else {
+                value = Util.getDateNameString(Resources.MONTHS, "MMMM");
+            }// default: months and wide
+
+            if (value == null) {
+                throw new Exception();
+            }
+
+            // return array of names
+            return obj.put("value", value);
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.UNKNOWN_ERROR);
+        }
+    }
+
+    /**
+     * Returns whether daylight savings time is in effect for a given date using
+     * the client's time zone and calendar.
+     *
+     * @return JSONObject
+     *          Object.dst {Boolean}: The value "true" indicates that daylight
+     *                      savings time is in effect for the given date and
+     *                      "false" indicates that it is not.
+     *
+     * @throws GlobalizationError.UNKNOWN_ERROR
+     *
+     *             Note: Functionality to determine if date is within day light
+     *             savings time is not available in this API version
+     */
+    private JSONObject getIsDayLightSavingsTime(JSONArray options)
+            throws GlobalizationError {
+        throw new GlobalizationError(GlobalizationError.UNKNOWN_ERROR);
+    }
+
+    /**
+     * Returns the first day of the week according to the client's user
+     * preferences and calendar. The days of the week are numbered starting from
+     * 1 where 1 is considered to be Sunday.
+     *
+     * @return JSONObject
+     *          Object.value {Number}: The number of the first day of the week.
+     *
+     * @throws GlobalizationError.UNKNOWN_ERROR
+     */
+    private JSONObject getFirstDayOfWeek(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            JSONObject result = Util.getLocaleData(Locale.getDefault()
+                    .toString());
+
+            if (result == null || result.length() <= 0) {
+                throw new Exception();
+            }
+            return obj.put("value", Integer.valueOf(result
+                    .getString(Resources.JSON_FIRISTDAYOFWEEK)));
+        } catch (Exception e) {
+            throw new GlobalizationError(GlobalizationError.UNKNOWN_ERROR);
+        }
+    }
+
+    /**
+     * Returns a number formatted as a string according to the client's user
+     * preferences.
+     *
+     * @return JSONObject
+     *          Object.value {String}: The formatted number string.
+     *
+     * @throws GlobalizationError.FORMATTING_ERROR
+     */
+    private JSONObject getNumberToString(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        String value;
+        try {
+            // Initialize formatter
+            Formatter fmt = new Formatter(Locale.getDefault().toString());
+
+            // obtain user supplied number
+            double num = Double.parseDouble(options.getJSONObject(0)
+                    .get(Resources.NUMBER).toString());
+            // format based on options if available
+            value = fmt.formatNumber(num);
+            if (options.getJSONObject(0).length() > 1) {
+                // options were included
+                if (!((JSONObject) options.getJSONObject(0).get(
+                        Resources.OPTIONS)).isNull(Resources.TYPE)) {
+                    String fmtOpt = (String) ((JSONObject) options
+                            .getJSONObject(0).get(Resources.OPTIONS))
+                            .get(Resources.TYPE);
+                    if (fmtOpt.equalsIgnoreCase(Resources.CURRENCY)) {
+                        value = fmt.formatCurrency(num);
+                    } else if (fmtOpt.equalsIgnoreCase(Resources.PERCENT)) {
+                        // convert double to long
+                        // used 1 decimal places as a default
+                        value = fmt.formatPercentage((float) num, 1);
+                    }
+                }
+            }
+            return obj.put("value", value);
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.FORMATTING_ERROR);
+        }
+
+    }
+
+    /**
+     * Parses a number formatted as a string according to the client's user
+     * preferences and returns the corresponding number.
+     *
+     * @return JSONObject
+     *          Object.value {Number}: The parsed number.
+     *
+     * @throws GlobalizationError.PARSING_ERROR
+     */
+    private JSONObject getStringToNumber(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        double value = 0;
+        try {
+            // format based on options if available
+            String num = options.getJSONObject(0).get(Resources.NUMBERSTRING)
+                    .toString().trim();
+            if (options.getJSONObject(0).length() > 1) {
+                // options were included
+                if (!((JSONObject) options.getJSONObject(0).get(
+                        Resources.OPTIONS)).isNull(Resources.TYPE)) {
+                    String fmtOpt = (String) ((JSONObject) options
+                            .getJSONObject(0).get(Resources.OPTIONS))
+                            .get(Resources.TYPE);
+                    // remove unwanted symbols
+                    if (fmtOpt.equalsIgnoreCase(Resources.CURRENCY)) {
+                        value = (Double.parseDouble(Util.removeSymbols(num)));
+                    } else if (fmtOpt.equalsIgnoreCase(Resources.PERCENT)) {
+                        value = (Double.parseDouble(Util.removeSymbols(num)) / 100);
+                    }
+                }
+            } else {
+                value = Double.parseDouble(num); // decimal default
+            }
+
+            return obj.put("value", value);
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.PARSING_ERROR);
+        }
+    }
+
+    /**
+     * Returns a pattern string for formatting and parsing numbers according to
+     * the client's user preferences.
+     *
+     * @return JSONObject
+     *          Object.pattern {String}: The number pattern for formatting and
+     *                      parsing numbers. The patterns follow Unicode
+     *                      Technical Standard #35.
+     *                      http://unicode.org/reports/tr35/tr35-4.html
+     *          Object.symbol {String}: The symbol to be used when formatting
+     *                      and parsing e.g., percent or currency symbol.
+     *          Object.fraction {Number}: The number of fractional digits to use
+     *                      when parsing and formatting numbers.
+     *          Object.rounding {Number}: The rounding increment to use when
+     *                      parsing and formatting.
+     *          Object.positive {String}: The symbol to use for positive numbers
+     *                      when parsing and formatting.
+     *          Object.negative: {String}: The symbol to use for negative
+     *                      numbers when parsing and formatting.
+     *          Object.decimal: {String}: The decimal symbol to use for parsing
+     *                      and formatting.
+     *          Object.grouping: {String}: The grouping symbol to use for
+     *                      parsing and formatting.
+     *
+     * @throws GlobalizationError.PATTERN_ERROR
+     */
+    private JSONObject getNumberPattern(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            JSONObject result = Util.getLocaleData(Locale.getDefault()
+                    .toString());
+
+            String symbol = Resources.JSON_DECIMALSYMBOL;
+            // get Date value + options (if available)
+            if (options.getJSONObject(0).length() > 0) {
+                // options were included
+                if (!((JSONObject) options.getJSONObject(0).get(
+                        Resources.OPTIONS)).isNull(Resources.TYPE)) {
+                    String fmtOpt = (String) ((JSONObject) options
+                            .getJSONObject(0).get(Resources.OPTIONS))
+                            .get(Resources.TYPE);
+                    if (fmtOpt.equalsIgnoreCase(Resources.CURRENCY)) {
+                        symbol = Resources.JSON_CURRENCYSYMBOL;
+                    } else if (fmtOpt.equalsIgnoreCase(Resources.PERCENT)) {
+                        symbol = Resources.JSON_PERCENTSYMBOL;
+                    }
+                }
+            }
+
+            // return properties
+            obj.put("pattern", result.getString(Resources.JSON_PATTERN));
+            obj.put("symbol", result.getString(symbol));
+            obj.put("fraction",
+                    Integer.valueOf(result.getString(Resources.JSON_FRACTION)));
+            obj.put("rounding",
+                    Integer.valueOf(result.getString(Resources.JSON_ROUNDING)));
+            obj.put("positive", result.getString(Resources.JSON_POSITIVE));
+            obj.put("negative", result.getString(Resources.JSON_NEGATIVE));
+            obj.put("decimal", result.getString(Resources.JSON_DECIMALSYMBOL));
+            obj.put("grouping", result.getString(Resources.JSON_GROUPING));
+            return obj;
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.PATTERN_ERROR);
+        }
+    }
+
+    /**
+     * Returns a pattern string for formatting and parsing currency values
+     * according to the client's user preferences and ISO 4217 currency code.
+     *
+     * @return JSONObject =
+     *          Object.pattern {String}: The currency pattern for formatting and
+     *                      parsing currency values. The patterns follow
+     *                      Unicode Technical Standard #35
+     *                      http://unicode.org/reports/tr35/tr35-4.html
+     *          Object.code {String}: The ISO 4217 currency code for the pattern.
+     *          Object.fraction {Number}: The number of fractional digits to use
+     *                      when parsing and formatting currency.
+     *          Object.rounding {Number}: The rounding increment to use when
+     *                      parsing and formatting.
+     *          Object.decimal: {String}: The decimal symbol to use for parsing
+     *                      and formatting.
+     *          Object.grouping: {String}: The grouping symbol to use for
+     *                      parsing and formatting.
+     *
+     * @throws GlobalizationError.FORMATTING_ERROR
+     */
+    private JSONObject getCurrencyPattern(JSONArray options)
+            throws GlobalizationError {
+        JSONObject obj = new JSONObject();
+        try {
+            JSONObject result = Util.getCurrencyData(Locale.getDefault()
+                    .toString(),
+                    options.getJSONObject(0).getString(Resources.CURRENCYCODE));
+
+            // return properties
+            obj.put("pattern", result.getString(Resources.JSON_CURRENCYPATTERN));
+            obj.put("code", result.getString(Resources.JSON_CURRENCYCODE));
+            obj.put("fraction", Integer.valueOf(result
+                    .getString(Resources.JSON_CURRENCYFRACTION)));
+            obj.put("rounding", Integer.valueOf(result
+                    .getString(Resources.JSON_CURRENCYROUNDING)));
+            obj.put("decimal", result.getString(Resources.JSON_CURRENCYDECIMAL));
+            obj.put("grouping",
+                    result.getString(Resources.JSON_CURRENCYGROUPING));
+            return obj;
+        } catch (Exception ge) {
+            throw new GlobalizationError(GlobalizationError.FORMATTING_ERROR);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/GlobalizationError.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/GlobalizationError.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/GlobalizationError.java
new file mode 100644
index 0000000..b2a9388
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/GlobalizationError.java
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.globalization;
+
+import org.apache.cordova.json4j.JSONException;
+import org.apache.cordova.json4j.JSONObject;
+
+/**
+ * User initiated exception. Exception class representing defined Globalization
+ * error codes.
+ *
+ * Globalization error codes:
+ *          GlobalizationError.UNKNOWN_ERROR = 0;
+ *          GlobalizationError.FORMATTING_ERROR = 1;
+ *          GlobalizationError.PARSING_ERROR = 2;
+ *          GlobalizationError.PATTERN_ERROR = 3;
+ */
+public class GlobalizationError extends Exception {
+
+    private static final long serialVersionUID = 1L;
+    public static final String UNKNOWN_ERROR = "UNKNOWN_ERROR";
+    public static final String FORMATTING_ERROR = "FORMATTING_ERROR";
+    public static final String PARSING_ERROR = "PARSING_ERROR";
+    public static final String PATTERN_ERROR = "PATTERN_ERROR";
+
+    int error = 0; // default unknown error thrown
+
+    /**
+     * Default constructor
+     */
+    public GlobalizationError() {
+    }
+
+    /**
+     * Create an exception returning an error code
+     *
+     * @param s
+     */
+    public GlobalizationError(String s) {
+        if (s.equalsIgnoreCase(FORMATTING_ERROR)) {
+            error = 1;
+        } else if (s.equalsIgnoreCase(PARSING_ERROR)) {
+            error = 2;
+        } else if (s.equalsIgnoreCase(PATTERN_ERROR)) {
+            error = 3;
+        }
+    }
+
+    /**
+     * get error string based on error code
+     *
+     * @param String
+     *            msg
+     */
+    public String getErrorString() {
+        String msg = "";
+        switch (error) {
+        case 0:
+            msg = UNKNOWN_ERROR;
+            break;
+        case 1:
+            msg = FORMATTING_ERROR;
+            break;
+        case 2:
+            msg = PARSING_ERROR;
+            break;
+        case 3:
+            msg = PATTERN_ERROR;
+            break;
+        }
+        return msg;
+    }
+
+    /**
+     * get error code
+     *
+     * @param String
+     *            msg
+     */
+    public int getErrorCode() {
+        return error;
+    }
+
+    /**
+     * get the json version of this object to return to javascript
+     *
+     * @return
+     */
+    public JSONObject toJson() {
+        JSONObject obj = new JSONObject();
+        try {
+            obj.put("code", getErrorCode());
+            obj.put("message", getErrorString());
+        } catch (JSONException e) {
+            // never happens
+        }
+        return obj;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Resources.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Resources.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Resources.java
new file mode 100644
index 0000000..02cbc8a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/globalization/Resources.java
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.globalization;
+
+public class Resources {
+    // Globalization Plugin Actions
+    public static final String GETLOCALENAME = "getLocaleName";
+    public static final String DATETOSTRING = "dateToString";
+    public static final String STRINGTODATE = "stringToDate";
+    public static final String GETDATEPATTERN = "getDatePattern";
+    public static final String GETDATENAMES = "getDateNames";
+    public static final String ISDAYLIGHTSAVINGSTIME = "isDayLightSavingsTime";
+    public static final String GETFIRSTDAYOFWEEK = "getFirstDayOfWeek";
+    public static final String NUMBERTOSTRING = "numberToString";
+    public static final String STRINGTONUMBER = "stringToNumber";
+    public static final String GETNUMBERPATTERN = "getNumberPattern";
+    public static final String GETCURRENCYPATTERN = "getCurrencyPattern";
+    public static final String GETPREFERREDLANGUAGE = "getPreferredLanguage";
+
+    // Globalization Option Parameters
+    public static final String OPTIONS = "options";
+    public static final String FORMATLENGTH = "formatLength";
+    public static final String MEDIUM = "medium";
+    public static final String LONG = "long";
+    public static final String FULL = "full";
+    public static final String SELECTOR = "selector";
+    public static final String DATE = "date";
+    public static final String TIME = "time";
+    public static final String DATESTRING = "dateString";
+    public static final String TYPE = "type";
+    public static final String ITEM = "item";
+    public static final String NARROW = "narrow";
+    public static final String WIDE = "wide";
+    public static final String MONTHS = "months";
+    public static final String DAYS = "days";
+    public static final String SPACE = " ";
+    public static final String DATEDELIMITER = "-";
+    public static final String TIMEDELIMITER = ":";
+    public static final String[] AM_PMFORMATS = { "a", "aa" };
+    public static final String NUMBER = "number";
+    public static final String NUMBERSTRING = "numberString";
+    public static final String PERCENT = "percent";
+    public static final String CURRENCY = "currency";
+    public static final String CURRENCYCODE = "currencyCode";
+
+    // JSON File: JSONObject
+    public static final String JSON_CURRENCY = "currency";
+    public static final String JSON_LOCALE = "locale";
+    public static final String JSON_NAME = "name";
+
+    // JSON File: parameters
+    // locale:
+    public static final String JSON_PATTERN = "pattern";
+    public static final String JSON_DECIMAL = "decimal";
+    public static final String JSON_FRACTION = "fraction";
+    public static final String JSON_ROUNDING = "rounding";
+    public static final String JSON_GROUPING = "grouping";
+    public static final String JSON_NEGATIVE = "negative";
+    public static final String JSON_FIRISTDAYOFWEEK = "firstDayOfWeek";
+    public static final String JSON_POSITIVE = "positive";
+    public static final String JSON_PERCENTSYMBOL = "percentSymbol";
+    public static final String JSON_CURRENCYSYMBOL = "currencySymbol";
+    public static final String JSON_DECIMALSYMBOL = "decimalSymbol";
+    public static final String JSON_DISPLAYNAME = "displayName";
+
+    // currency
+    public static final String JSON_CURRENCYCODE = "currencyCode";
+    public static final String JSON_CURRENCYPATTERN = "currencyPattern";
+    public static final String JSON_CURRENCYDECIMAL = "currencyDecimal";
+    public static final String JSON_CURRENCYFRACTION = "currencyFraction";
+    public static final String JSON_CURRENCYGROUPING = "currencyGrouping";
+    public static final String JSON_CURRENCYROUNDING = "currencyRounding";
+
+    // class paths:
+    public static final String LOCALEINFOPATH = "/res/resourceBundles/";
+    public static final String LOCALEINFOPATHEND = ".js.gz";
+
+    // locale resource key identifiers
+    public static final int LOCALENAME = 0;
+
+    // Persistent Store ID:
+    public static final long PERSISTENTSTORE_ID = 0x10001;
+}


[41/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
new file mode 100644
index 0000000..03bf89a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.js
@@ -0,0 +1,2529 @@
+var isCommonJS = typeof window == "undefined";
+
+/**
+ * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
+ *
+ * @namespace
+ */
+var jasmine = {};
+if (isCommonJS) exports.jasmine = jasmine;
+/**
+ * @private
+ */
+jasmine.unimplementedMethod_ = function() {
+  throw new Error("unimplemented method");
+};
+
+/**
+ * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
+ * a plain old variable and may be redefined by somebody else.
+ *
+ * @private
+ */
+jasmine.undefined = jasmine.___undefined___;
+
+/**
+ * Show diagnostic messages in the console if set to true
+ *
+ */
+jasmine.VERBOSE = false;
+
+/**
+ * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
+ *
+ */
+jasmine.DEFAULT_UPDATE_INTERVAL = 250;
+
+/**
+ * Default timeout interval in milliseconds for waitsFor() blocks.
+ */
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
+
+jasmine.getGlobal = function() {
+  function getGlobal() {
+    return this;
+  }
+
+  return getGlobal();
+};
+
+/**
+ * Allows for bound functions to be compared.  Internal use only.
+ *
+ * @ignore
+ * @private
+ * @param base {Object} bound 'this' for the function
+ * @param name {Function} function to find
+ */
+jasmine.bindOriginal_ = function(base, name) {
+  var original = base[name];
+  if (original.apply) {
+    return function() {
+      return original.apply(base, arguments);
+    };
+  } else {
+    // IE support
+    return jasmine.getGlobal()[name];
+  }
+};
+
+jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
+jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
+jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
+jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
+
+jasmine.MessageResult = function(values) {
+  this.type = 'log';
+  this.values = values;
+  this.trace = new Error(); // todo: test better
+};
+
+jasmine.MessageResult.prototype.toString = function() {
+  var text = "";
+  for (var i = 0; i < this.values.length; i++) {
+    if (i > 0) text += " ";
+    if (jasmine.isString_(this.values[i])) {
+      text += this.values[i];
+    } else {
+      text += jasmine.pp(this.values[i]);
+    }
+  }
+  return text;
+};
+
+jasmine.ExpectationResult = function(params) {
+  this.type = 'expect';
+  this.matcherName = params.matcherName;
+  this.passed_ = params.passed;
+  this.expected = params.expected;
+  this.actual = params.actual;
+  this.message = this.passed_ ? 'Passed.' : params.message;
+
+  var trace = (params.trace || new Error(this.message));
+  this.trace = this.passed_ ? '' : trace;
+};
+
+jasmine.ExpectationResult.prototype.toString = function () {
+  return this.message;
+};
+
+jasmine.ExpectationResult.prototype.passed = function () {
+  return this.passed_;
+};
+
+/**
+ * Getter for the Jasmine environment. Ensures one gets created
+ */
+jasmine.getEnv = function() {
+  var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
+  return env;
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isArray_ = function(value) {
+  return jasmine.isA_("Array", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isString_ = function(value) {
+  return jasmine.isA_("String", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isNumber_ = function(value) {
+  return jasmine.isA_("Number", value);
+};
+
+/**
+ * @ignore
+ * @private
+ * @param {String} typeName
+ * @param value
+ * @returns {Boolean}
+ */
+jasmine.isA_ = function(typeName, value) {
+  return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
+};
+
+/**
+ * Pretty printer for expecations.  Takes any object and turns it into a human-readable string.
+ *
+ * @param value {Object} an object to be outputted
+ * @returns {String}
+ */
+jasmine.pp = function(value) {
+  var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
+  stringPrettyPrinter.format(value);
+  return stringPrettyPrinter.string;
+};
+
+/**
+ * Returns true if the object is a DOM Node.
+ *
+ * @param {Object} obj object to check
+ * @returns {Boolean}
+ */
+jasmine.isDomNode = function(obj) {
+  return obj.nodeType > 0;
+};
+
+/**
+ * Returns a matchable 'generic' object of the class type.  For use in expecations of type when values don't matter.
+ *
+ * @example
+ * // don't care about which function is passed in, as long as it's a function
+ * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
+ *
+ * @param {Class} clazz
+ * @returns matchable object of the type clazz
+ */
+jasmine.any = function(clazz) {
+  return new jasmine.Matchers.Any(clazz);
+};
+
+/**
+ * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the
+ * attributes on the object.
+ *
+ * @example
+ * // don't care about any other attributes than foo.
+ * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"});
+ *
+ * @param sample {Object} sample
+ * @returns matchable object for the sample
+ */
+jasmine.objectContaining = function (sample) {
+    return new jasmine.Matchers.ObjectContaining(sample);
+};
+
+/**
+ * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
+ *
+ * Spies should be created in test setup, before expectations.  They can then be checked, using the standard Jasmine
+ * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
+ *
+ * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
+ *
+ * Spies are torn down at the end of every spec.
+ *
+ * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
+ *
+ * @example
+ * // a stub
+ * var myStub = jasmine.createSpy('myStub');  // can be used anywhere
+ *
+ * // spy example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ *
+ * // actual foo.not will not be called, execution stops
+ * spyOn(foo, 'not');
+
+ // foo.not spied upon, execution will continue to implementation
+ * spyOn(foo, 'not').andCallThrough();
+ *
+ * // fake example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ *
+ * // foo.not(val) will return val
+ * spyOn(foo, 'not').andCallFake(function(value) {return value;});
+ *
+ * // mock example
+ * foo.not(7 == 7);
+ * expect(foo.not).toHaveBeenCalled();
+ * expect(foo.not).toHaveBeenCalledWith(true);
+ *
+ * @constructor
+ * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
+ * @param {String} name
+ */
+jasmine.Spy = function(name) {
+  /**
+   * The name of the spy, if provided.
+   */
+  this.identity = name || 'unknown';
+  /**
+   *  Is this Object a spy?
+   */
+  this.isSpy = true;
+  /**
+   * The actual function this spy stubs.
+   */
+  this.plan = function() {
+  };
+  /**
+   * Tracking of the most recent call to the spy.
+   * @example
+   * var mySpy = jasmine.createSpy('foo');
+   * mySpy(1, 2);
+   * mySpy.mostRecentCall.args = [1, 2];
+   */
+  this.mostRecentCall = {};
+
+  /**
+   * Holds arguments for each call to the spy, indexed by call count
+   * @example
+   * var mySpy = jasmine.createSpy('foo');
+   * mySpy(1, 2);
+   * mySpy(7, 8);
+   * mySpy.mostRecentCall.args = [7, 8];
+   * mySpy.argsForCall[0] = [1, 2];
+   * mySpy.argsForCall[1] = [7, 8];
+   */
+  this.argsForCall = [];
+  this.calls = [];
+};
+
+/**
+ * Tells a spy to call through to the actual implemenatation.
+ *
+ * @example
+ * var foo = {
+ *   bar: function() { // do some stuff }
+ * }
+ *
+ * // defining a spy on an existing property: foo.bar
+ * spyOn(foo, 'bar').andCallThrough();
+ */
+jasmine.Spy.prototype.andCallThrough = function() {
+  this.plan = this.originalValue;
+  return this;
+};
+
+/**
+ * For setting the return value of a spy.
+ *
+ * @example
+ * // defining a spy from scratch: foo() returns 'baz'
+ * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
+ *
+ * // defining a spy on an existing property: foo.bar() returns 'baz'
+ * spyOn(foo, 'bar').andReturn('baz');
+ *
+ * @param {Object} value
+ */
+jasmine.Spy.prototype.andReturn = function(value) {
+  this.plan = function() {
+    return value;
+  };
+  return this;
+};
+
+/**
+ * For throwing an exception when a spy is called.
+ *
+ * @example
+ * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
+ * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
+ *
+ * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
+ * spyOn(foo, 'bar').andThrow('baz');
+ *
+ * @param {String} exceptionMsg
+ */
+jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
+  this.plan = function() {
+    throw exceptionMsg;
+  };
+  return this;
+};
+
+/**
+ * Calls an alternate implementation when a spy is called.
+ *
+ * @example
+ * var baz = function() {
+ *   // do some stuff, return something
+ * }
+ * // defining a spy from scratch: foo() calls the function baz
+ * var foo = jasmine.createSpy('spy on foo').andCall(baz);
+ *
+ * // defining a spy on an existing property: foo.bar() calls an anonymnous function
+ * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
+ *
+ * @param {Function} fakeFunc
+ */
+jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
+  this.plan = fakeFunc;
+  return this;
+};
+
+/**
+ * Resets all of a spy's the tracking variables so that it can be used again.
+ *
+ * @example
+ * spyOn(foo, 'bar');
+ *
+ * foo.bar();
+ *
+ * expect(foo.bar.callCount).toEqual(1);
+ *
+ * foo.bar.reset();
+ *
+ * expect(foo.bar.callCount).toEqual(0);
+ */
+jasmine.Spy.prototype.reset = function() {
+  this.wasCalled = false;
+  this.callCount = 0;
+  this.argsForCall = [];
+  this.calls = [];
+  this.mostRecentCall = {};
+};
+
+jasmine.createSpy = function(name) {
+
+  var spyObj = function() {
+    spyObj.wasCalled = true;
+    spyObj.callCount++;
+    var args = jasmine.util.argsToArray(arguments);
+    spyObj.mostRecentCall.object = this;
+    spyObj.mostRecentCall.args = args;
+    spyObj.argsForCall.push(args);
+    spyObj.calls.push({object: this, args: args});
+    return spyObj.plan.apply(this, arguments);
+  };
+
+  var spy = new jasmine.Spy(name);
+
+  for (var prop in spy) {
+    spyObj[prop] = spy[prop];
+  }
+
+  spyObj.reset();
+
+  return spyObj;
+};
+
+/**
+ * Determines whether an object is a spy.
+ *
+ * @param {jasmine.Spy|Object} putativeSpy
+ * @returns {Boolean}
+ */
+jasmine.isSpy = function(putativeSpy) {
+  return putativeSpy && putativeSpy.isSpy;
+};
+
+/**
+ * Creates a more complicated spy: an Object that has every property a function that is a spy.  Used for stubbing something
+ * large in one call.
+ *
+ * @param {String} baseName name of spy class
+ * @param {Array} methodNames array of names of methods to make spies
+ */
+jasmine.createSpyObj = function(baseName, methodNames) {
+  if (!jasmine.isArray_(methodNames) || methodNames.length === 0) {
+    throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
+  }
+  var obj = {};
+  for (var i = 0; i < methodNames.length; i++) {
+    obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
+  }
+  return obj;
+};
+
+/**
+ * All parameters are pretty-printed and concatenated together, then written to the current spec's output.
+ *
+ * Be careful not to leave calls to <code>jasmine.log</code> in production code.
+ */
+jasmine.log = function() {
+  var spec = jasmine.getEnv().currentSpec;
+  spec.log.apply(spec, arguments);
+};
+
+/**
+ * Function that installs a spy on an existing object's method name.  Used within a Spec to create a spy.
+ *
+ * @example
+ * // spy example
+ * var foo = {
+ *   not: function(bool) { return !bool; }
+ * }
+ * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
+ *
+ * @see jasmine.createSpy
+ * @param obj
+ * @param methodName
+ * @returns a Jasmine spy that can be chained with all spy methods
+ */
+var spyOn = function(obj, methodName) {
+  return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
+};
+if (isCommonJS) exports.spyOn = spyOn;
+
+/**
+ * Creates a Jasmine spec that will be added to the current suite.
+ *
+ * // TODO: pending tests
+ *
+ * @example
+ * it('should be true', function() {
+ *   expect(true).toEqual(true);
+ * });
+ *
+ * @param {String} desc description of this specification
+ * @param {Function} func defines the preconditions and expectations of the spec
+ */
+var it = function(desc, func) {
+  return jasmine.getEnv().it(desc, func);
+};
+if (isCommonJS) exports.it = it;
+
+/**
+ * Creates a <em>disabled</em> Jasmine spec.
+ *
+ * A convenience method that allows existing specs to be disabled temporarily during development.
+ *
+ * @param {String} desc description of this specification
+ * @param {Function} func defines the preconditions and expectations of the spec
+ */
+var xit = function(desc, func) {
+  return jasmine.getEnv().xit(desc, func);
+};
+if (isCommonJS) exports.xit = xit;
+
+/**
+ * Starts a chain for a Jasmine expectation.
+ *
+ * It is passed an Object that is the actual value and should chain to one of the many
+ * jasmine.Matchers functions.
+ *
+ * @param {Object} actual Actual value to test against and expected value
+ */
+var expect = function(actual) {
+  return jasmine.getEnv().currentSpec.expect(actual);
+};
+if (isCommonJS) exports.expect = expect;
+
+/**
+ * Defines part of a jasmine spec.  Used in cominbination with waits or waitsFor in asynchrnous specs.
+ *
+ * @param {Function} func Function that defines part of a jasmine spec.
+ */
+var runs = function(func) {
+  jasmine.getEnv().currentSpec.runs(func);
+};
+if (isCommonJS) exports.runs = runs;
+
+/**
+ * Waits a fixed time period before moving to the next block.
+ *
+ * @deprecated Use waitsFor() instead
+ * @param {Number} timeout milliseconds to wait
+ */
+var waits = function(timeout) {
+  jasmine.getEnv().currentSpec.waits(timeout);
+};
+if (isCommonJS) exports.waits = waits;
+
+/**
+ * Waits for the latchFunction to return true before proceeding to the next block.
+ *
+ * @param {Function} latchFunction
+ * @param {String} optional_timeoutMessage
+ * @param {Number} optional_timeout
+ */
+var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
+  jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
+};
+if (isCommonJS) exports.waitsFor = waitsFor;
+
+/**
+ * A function that is called before each spec in a suite.
+ *
+ * Used for spec setup, including validating assumptions.
+ *
+ * @param {Function} beforeEachFunction
+ */
+var beforeEach = function(beforeEachFunction) {
+  jasmine.getEnv().beforeEach(beforeEachFunction);
+};
+if (isCommonJS) exports.beforeEach = beforeEach;
+
+/**
+ * A function that is called after each spec in a suite.
+ *
+ * Used for restoring any state that is hijacked during spec execution.
+ *
+ * @param {Function} afterEachFunction
+ */
+var afterEach = function(afterEachFunction) {
+  jasmine.getEnv().afterEach(afterEachFunction);
+};
+if (isCommonJS) exports.afterEach = afterEach;
+
+/**
+ * Defines a suite of specifications.
+ *
+ * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
+ * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
+ * of setup in some tests.
+ *
+ * @example
+ * // TODO: a simple suite
+ *
+ * // TODO: a simple suite with a nested describe block
+ *
+ * @param {String} description A string, usually the class under test.
+ * @param {Function} specDefinitions function that defines several specs.
+ */
+var describe = function(description, specDefinitions) {
+  return jasmine.getEnv().describe(description, specDefinitions);
+};
+if (isCommonJS) exports.describe = describe;
+
+/**
+ * Disables a suite of specifications.  Used to disable some suites in a file, or files, temporarily during development.
+ *
+ * @param {String} description A string, usually the class under test.
+ * @param {Function} specDefinitions function that defines several specs.
+ */
+var xdescribe = function(description, specDefinitions) {
+  return jasmine.getEnv().xdescribe(description, specDefinitions);
+};
+if (isCommonJS) exports.xdescribe = xdescribe;
+
+
+// Provide the XMLHttpRequest class for IE 5.x-6.x:
+jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
+  function tryIt(f) {
+    try {
+      return f();
+    } catch(e) {
+    }
+    return null;
+  }
+
+  var xhr = tryIt(function() {
+    return new ActiveXObject("Msxml2.XMLHTTP.6.0");
+  }) ||
+    tryIt(function() {
+      return new ActiveXObject("Msxml2.XMLHTTP.3.0");
+    }) ||
+    tryIt(function() {
+      return new ActiveXObject("Msxml2.XMLHTTP");
+    }) ||
+    tryIt(function() {
+      return new ActiveXObject("Microsoft.XMLHTTP");
+    });
+
+  if (!xhr) throw new Error("This browser does not support XMLHttpRequest.");
+
+  return xhr;
+} : XMLHttpRequest;
+/**
+ * @namespace
+ */
+jasmine.util = {};
+
+/**
+ * Declare that a child class inherit it's prototype from the parent class.
+ *
+ * @private
+ * @param {Function} childClass
+ * @param {Function} parentClass
+ */
+jasmine.util.inherit = function(childClass, parentClass) {
+  /**
+   * @private
+   */
+  var subclass = function() {
+  };
+  subclass.prototype = parentClass.prototype;
+  childClass.prototype = new subclass();
+};
+
+jasmine.util.formatException = function(e) {
+  var lineNumber;
+  if (e.line) {
+    lineNumber = e.line;
+  }
+  else if (e.lineNumber) {
+    lineNumber = e.lineNumber;
+  }
+
+  var file;
+
+  if (e.sourceURL) {
+    file = e.sourceURL;
+  }
+  else if (e.fileName) {
+    file = e.fileName;
+  }
+
+  var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
+
+  if (file && lineNumber) {
+    message += ' in ' + file + ' (line ' + lineNumber + ')';
+  }
+
+  return message;
+};
+
+jasmine.util.htmlEscape = function(str) {
+  if (!str) return str;
+  return str.replace(/&/g, '&amp;')
+    .replace(/</g, '&lt;')
+    .replace(/>/g, '&gt;');
+};
+
+jasmine.util.argsToArray = function(args) {
+  var arrayOfArgs = [];
+  for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
+  return arrayOfArgs;
+};
+
+jasmine.util.extend = function(destination, source) {
+  for (var property in source) destination[property] = source[property];
+  return destination;
+};
+
+/**
+ * Environment for Jasmine
+ *
+ * @constructor
+ */
+jasmine.Env = function() {
+  this.currentSpec = null;
+  this.currentSuite = null;
+  this.currentRunner_ = new jasmine.Runner(this);
+
+  this.reporter = new jasmine.MultiReporter();
+
+  this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
+  this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
+  this.lastUpdate = 0;
+  this.specFilter = function() {
+    return true;
+  };
+
+  this.nextSpecId_ = 0;
+  this.nextSuiteId_ = 0;
+  this.equalityTesters_ = [];
+
+  // wrap matchers
+  this.matchersClass = function() {
+    jasmine.Matchers.apply(this, arguments);
+  };
+  jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
+
+  jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
+};
+
+
+jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
+jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
+jasmine.Env.prototype.setInterval = jasmine.setInterval;
+jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
+
+/**
+ * @returns an object containing jasmine version build info, if set.
+ */
+jasmine.Env.prototype.version = function () {
+  if (jasmine.version_) {
+    return jasmine.version_;
+  } else {
+    throw new Error('Version not set');
+  }
+};
+
+/**
+ * @returns string containing jasmine version build info, if set.
+ */
+jasmine.Env.prototype.versionString = function() {
+  if (!jasmine.version_) {
+    return "version unknown";
+  }
+
+  var version = this.version();
+  var versionString = version.major + "." + version.minor + "." + version.build;
+  if (version.release_candidate) {
+    versionString += ".rc" + version.release_candidate;
+  }
+  versionString += " revision " + version.revision;
+  return versionString;
+};
+
+/**
+ * @returns a sequential integer starting at 0
+ */
+jasmine.Env.prototype.nextSpecId = function () {
+  return this.nextSpecId_++;
+};
+
+/**
+ * @returns a sequential integer starting at 0
+ */
+jasmine.Env.prototype.nextSuiteId = function () {
+  return this.nextSuiteId_++;
+};
+
+/**
+ * Register a reporter to receive status updates from Jasmine.
+ * @param {jasmine.Reporter} reporter An object which will receive status updates.
+ */
+jasmine.Env.prototype.addReporter = function(reporter) {
+  this.reporter.addReporter(reporter);
+};
+
+jasmine.Env.prototype.execute = function() {
+  this.currentRunner_.execute();
+};
+
+jasmine.Env.prototype.describe = function(description, specDefinitions) {
+  var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
+
+  var parentSuite = this.currentSuite;
+  if (parentSuite) {
+    parentSuite.add(suite);
+  } else {
+    this.currentRunner_.add(suite);
+  }
+
+  this.currentSuite = suite;
+
+  var declarationError = null;
+  try {
+    specDefinitions.call(suite);
+  } catch(e) {
+    declarationError = e;
+  }
+
+  if (declarationError) {
+    this.it("encountered a declaration exception", function() {
+      throw declarationError;
+    });
+  }
+
+  this.currentSuite = parentSuite;
+
+  return suite;
+};
+
+jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
+  if (this.currentSuite) {
+    this.currentSuite.beforeEach(beforeEachFunction);
+  } else {
+    this.currentRunner_.beforeEach(beforeEachFunction);
+  }
+};
+
+jasmine.Env.prototype.currentRunner = function () {
+  return this.currentRunner_;
+};
+
+jasmine.Env.prototype.afterEach = function(afterEachFunction) {
+  if (this.currentSuite) {
+    this.currentSuite.afterEach(afterEachFunction);
+  } else {
+    this.currentRunner_.afterEach(afterEachFunction);
+  }
+
+};
+
+jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
+  return {
+    execute: function() {
+    }
+  };
+};
+
+jasmine.Env.prototype.it = function(description, func) {
+  var spec = new jasmine.Spec(this, this.currentSuite, description);
+  this.currentSuite.add(spec);
+  this.currentSpec = spec;
+
+  if (func) {
+    spec.runs(func);
+  }
+
+  return spec;
+};
+
+jasmine.Env.prototype.xit = function(desc, func) {
+  return {
+    id: this.nextSpecId(),
+    runs: function() {
+    }
+  };
+};
+
+jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
+  if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
+    return true;
+  }
+
+  a.__Jasmine_been_here_before__ = b;
+  b.__Jasmine_been_here_before__ = a;
+
+  var hasKey = function(obj, keyName) {
+    return obj !== null && obj[keyName] !== jasmine.undefined;
+  };
+
+  for (var property in b) {
+    if (!hasKey(a, property) && hasKey(b, property)) {
+      mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
+    }
+  }
+  for (property in a) {
+    if (!hasKey(b, property) && hasKey(a, property)) {
+      mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
+    }
+  }
+  for (property in b) {
+    if (property == '__Jasmine_been_here_before__') continue;
+    if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
+      mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
+    }
+  }
+
+  if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
+    mismatchValues.push("arrays were not the same length");
+  }
+
+  delete a.__Jasmine_been_here_before__;
+  delete b.__Jasmine_been_here_before__;
+  return (mismatchKeys.length === 0 && mismatchValues.length === 0);
+};
+
+jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
+  mismatchKeys = mismatchKeys || [];
+  mismatchValues = mismatchValues || [];
+
+  for (var i = 0; i < this.equalityTesters_.length; i++) {
+    var equalityTester = this.equalityTesters_[i];
+    var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
+    if (result !== jasmine.undefined) return result;
+  }
+
+  if (a === b) return true;
+
+  if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
+    return (a == jasmine.undefined && b == jasmine.undefined);
+  }
+
+  if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
+    return a === b;
+  }
+
+  if (a instanceof Date && b instanceof Date) {
+    return a.getTime() == b.getTime();
+  }
+
+  if (a.jasmineMatches) {
+    return a.jasmineMatches(b);
+  }
+
+  if (b.jasmineMatches) {
+    return b.jasmineMatches(a);
+  }
+
+  if (a instanceof jasmine.Matchers.ObjectContaining) {
+    return a.matches(b);
+  }
+
+  if (b instanceof jasmine.Matchers.ObjectContaining) {
+    return b.matches(a);
+  }
+
+  if (jasmine.isString_(a) && jasmine.isString_(b)) {
+    return (a == b);
+  }
+
+  if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
+    return (a == b);
+  }
+
+  if (typeof a === "object" && typeof b === "object") {
+    return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
+  }
+
+  //Straight check
+  return (a === b);
+};
+
+jasmine.Env.prototype.contains_ = function(haystack, needle) {
+  if (jasmine.isArray_(haystack)) {
+    for (var i = 0; i < haystack.length; i++) {
+      if (this.equals_(haystack[i], needle)) return true;
+    }
+    return false;
+  }
+  return haystack.indexOf(needle) >= 0;
+};
+
+jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
+  this.equalityTesters_.push(equalityTester);
+};
+/** No-op base class for Jasmine reporters.
+ *
+ * @constructor
+ */
+jasmine.Reporter = function() {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.reportSpecResults = function(spec) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.Reporter.prototype.log = function(str) {
+};
+
+/**
+ * Blocks are functions with executable code that make up a spec.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {Function} func
+ * @param {jasmine.Spec} spec
+ */
+jasmine.Block = function(env, func, spec) {
+  this.env = env;
+  this.func = func;
+  this.spec = spec;
+};
+
+jasmine.Block.prototype.execute = function(onComplete) {  
+  try {
+    this.func.apply(this.spec);
+  } catch (e) {
+    this.spec.fail(e);
+  }
+  onComplete();
+};
+/** JavaScript API reporter.
+ *
+ * @constructor
+ */
+jasmine.JsApiReporter = function() {
+  this.started = false;
+  this.finished = false;
+  this.suites_ = [];
+  this.results_ = {};
+};
+
+jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
+  this.started = true;
+  var suites = runner.topLevelSuites();
+  for (var i = 0; i < suites.length; i++) {
+    var suite = suites[i];
+    this.suites_.push(this.summarize_(suite));
+  }
+};
+
+jasmine.JsApiReporter.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
+  var isSuite = suiteOrSpec instanceof jasmine.Suite;
+  var summary = {
+    id: suiteOrSpec.id,
+    name: suiteOrSpec.description,
+    type: isSuite ? 'suite' : 'spec',
+    children: []
+  };
+  
+  if (isSuite) {
+    var children = suiteOrSpec.children();
+    for (var i = 0; i < children.length; i++) {
+      summary.children.push(this.summarize_(children[i]));
+    }
+  }
+  return summary;
+};
+
+jasmine.JsApiReporter.prototype.results = function() {
+  return this.results_;
+};
+
+jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
+  return this.results_[specId];
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
+  this.finished = true;
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
+  this.results_[spec.id] = {
+    messages: spec.results().getItems(),
+    result: spec.results().failedCount > 0 ? "failed" : "passed"
+  };
+};
+
+//noinspection JSUnusedLocalSymbols
+jasmine.JsApiReporter.prototype.log = function(str) {
+};
+
+jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
+  var results = {};
+  for (var i = 0; i < specIds.length; i++) {
+    var specId = specIds[i];
+    results[specId] = this.summarizeResult_(this.results_[specId]);
+  }
+  return results;
+};
+
+jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
+  var summaryMessages = [];
+  var messagesLength = result.messages.length;
+  for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
+    var resultMessage = result.messages[messageIndex];
+    summaryMessages.push({
+      text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
+      passed: resultMessage.passed ? resultMessage.passed() : true,
+      type: resultMessage.type,
+      message: resultMessage.message,
+      trace: {
+        stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
+      }
+    });
+  }
+
+  return {
+    result : result.result,
+    messages : summaryMessages
+  };
+};
+
+/**
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param actual
+ * @param {jasmine.Spec} spec
+ */
+jasmine.Matchers = function(env, actual, spec, opt_isNot) {
+  this.env = env;
+  this.actual = actual;
+  this.spec = spec;
+  this.isNot = opt_isNot || false;
+  this.reportWasCalled_ = false;
+};
+
+// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
+jasmine.Matchers.pp = function(str) {
+  throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
+};
+
+// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
+jasmine.Matchers.prototype.report = function(result, failing_message, details) {
+  throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
+};
+
+jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
+  for (var methodName in prototype) {
+    if (methodName == 'report') continue;
+    var orig = prototype[methodName];
+    matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
+  }
+};
+
+jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
+  return function() {
+    var matcherArgs = jasmine.util.argsToArray(arguments);
+    var result = matcherFunction.apply(this, arguments);
+
+    if (this.isNot) {
+      result = !result;
+    }
+
+    if (this.reportWasCalled_) return result;
+
+    var message;
+    if (!result) {
+      if (this.message) {
+        message = this.message.apply(this, arguments);
+        if (jasmine.isArray_(message)) {
+          message = message[this.isNot ? 1 : 0];
+        }
+      } else {
+        var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
+        message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
+        if (matcherArgs.length > 0) {
+          for (var i = 0; i < matcherArgs.length; i++) {
+            if (i > 0) message += ",";
+            message += " " + jasmine.pp(matcherArgs[i]);
+          }
+        }
+        message += ".";
+      }
+    }
+    var expectationResult = new jasmine.ExpectationResult({
+      matcherName: matcherName,
+      passed: result,
+      expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
+      actual: this.actual,
+      message: message
+    });
+    this.spec.addMatcherResult(expectationResult);
+    return jasmine.undefined;
+  };
+};
+
+
+
+
+/**
+ * toBe: compares the actual to the expected using ===
+ * @param expected
+ */
+jasmine.Matchers.prototype.toBe = function(expected) {
+  return this.actual === expected;
+};
+
+/**
+ * toNotBe: compares the actual to the expected using !==
+ * @param expected
+ * @deprecated as of 1.0. Use not.toBe() instead.
+ */
+jasmine.Matchers.prototype.toNotBe = function(expected) {
+  return this.actual !== expected;
+};
+
+/**
+ * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
+ *
+ * @param expected
+ */
+jasmine.Matchers.prototype.toEqual = function(expected) {
+  return this.env.equals_(this.actual, expected);
+};
+
+/**
+ * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
+ * @param expected
+ * @deprecated as of 1.0. Use not.toEqual() instead.
+ */
+jasmine.Matchers.prototype.toNotEqual = function(expected) {
+  return !this.env.equals_(this.actual, expected);
+};
+
+/**
+ * Matcher that compares the actual to the expected using a regular expression.  Constructs a RegExp, so takes
+ * a pattern or a String.
+ *
+ * @param expected
+ */
+jasmine.Matchers.prototype.toMatch = function(expected) {
+  return new RegExp(expected).test(this.actual);
+};
+
+/**
+ * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
+ * @param expected
+ * @deprecated as of 1.0. Use not.toMatch() instead.
+ */
+jasmine.Matchers.prototype.toNotMatch = function(expected) {
+  return !(new RegExp(expected).test(this.actual));
+};
+
+/**
+ * Matcher that compares the actual to jasmine.undefined.
+ */
+jasmine.Matchers.prototype.toBeDefined = function() {
+  return (this.actual !== jasmine.undefined);
+};
+
+/**
+ * Matcher that compares the actual to jasmine.undefined.
+ */
+jasmine.Matchers.prototype.toBeUndefined = function() {
+  return (this.actual === jasmine.undefined);
+};
+
+/**
+ * Matcher that compares the actual to null.
+ */
+jasmine.Matchers.prototype.toBeNull = function() {
+  return (this.actual === null);
+};
+
+/**
+ * Matcher that boolean not-nots the actual.
+ */
+jasmine.Matchers.prototype.toBeTruthy = function() {
+  return !!this.actual;
+};
+
+
+/**
+ * Matcher that boolean nots the actual.
+ */
+jasmine.Matchers.prototype.toBeFalsy = function() {
+  return !this.actual;
+};
+
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was called.
+ */
+jasmine.Matchers.prototype.toHaveBeenCalled = function() {
+  if (arguments.length > 0) {
+    throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
+  }
+
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy " + this.actual.identity + " to have been called.",
+      "Expected spy " + this.actual.identity + " not to have been called."
+    ];
+  };
+
+  return this.actual.wasCalled;
+};
+
+/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
+jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was not called.
+ *
+ * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
+ */
+jasmine.Matchers.prototype.wasNotCalled = function() {
+  if (arguments.length > 0) {
+    throw new Error('wasNotCalled does not take arguments');
+  }
+
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy " + this.actual.identity + " to not have been called.",
+      "Expected spy " + this.actual.identity + " to have been called."
+    ];
+  };
+
+  return !this.actual.wasCalled;
+};
+
+/**
+ * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
+ *
+ * @example
+ *
+ */
+jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
+  var expectedArgs = jasmine.util.argsToArray(arguments);
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+  this.message = function() {
+    if (this.actual.callCount === 0) {
+      // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
+      return [
+        "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
+        "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
+      ];
+    } else {
+      return [
+        "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
+        "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
+      ];
+    }
+  };
+
+  return this.env.contains_(this.actual.argsForCall, expectedArgs);
+};
+
+/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
+jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
+
+/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
+jasmine.Matchers.prototype.wasNotCalledWith = function() {
+  var expectedArgs = jasmine.util.argsToArray(arguments);
+  if (!jasmine.isSpy(this.actual)) {
+    throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
+  }
+
+  this.message = function() {
+    return [
+      "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
+      "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
+    ];
+  };
+
+  return !this.env.contains_(this.actual.argsForCall, expectedArgs);
+};
+
+/**
+ * Matcher that checks that the expected item is an element in the actual Array.
+ *
+ * @param {Object} expected
+ */
+jasmine.Matchers.prototype.toContain = function(expected) {
+  return this.env.contains_(this.actual, expected);
+};
+
+/**
+ * Matcher that checks that the expected item is NOT an element in the actual Array.
+ *
+ * @param {Object} expected
+ * @deprecated as of 1.0. Use not.toContain() instead.
+ */
+jasmine.Matchers.prototype.toNotContain = function(expected) {
+  return !this.env.contains_(this.actual, expected);
+};
+
+jasmine.Matchers.prototype.toBeLessThan = function(expected) {
+  return this.actual < expected;
+};
+
+jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
+  return this.actual > expected;
+};
+
+/**
+ * Matcher that checks that the expected item is equal to the actual item
+ * up to a given level of decimal precision (default 2).
+ *
+ * @param {Number} expected
+ * @param {Number} precision
+ */
+jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {
+  if (!(precision === 0)) {
+    precision = precision || 2;
+  }
+  var multiplier = Math.pow(10, precision);
+  var actual = Math.round(this.actual * multiplier);
+  expected = Math.round(expected * multiplier);
+  return expected == actual;
+};
+
+/**
+ * Matcher that checks that the expected exception was thrown by the actual.
+ *
+ * @param {String} expected
+ */
+jasmine.Matchers.prototype.toThrow = function(expected) {
+  var result = false;
+  var exception;
+  if (typeof this.actual != 'function') {
+    throw new Error('Actual is not a function');
+  }
+  try {
+    this.actual();
+  } catch (e) {
+    exception = e;
+  }
+  if (exception) {
+    result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
+  }
+
+  var not = this.isNot ? "not " : "";
+
+  this.message = function() {
+    if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
+      return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' ');
+    } else {
+      return "Expected function to throw an exception.";
+    }
+  };
+
+  return result;
+};
+
+jasmine.Matchers.Any = function(expectedClass) {
+  this.expectedClass = expectedClass;
+};
+
+jasmine.Matchers.Any.prototype.jasmineMatches = function(other) {
+  if (this.expectedClass == String) {
+    return typeof other == 'string' || other instanceof String;
+  }
+
+  if (this.expectedClass == Number) {
+    return typeof other == 'number' || other instanceof Number;
+  }
+
+  if (this.expectedClass == Function) {
+    return typeof other == 'function' || other instanceof Function;
+  }
+
+  if (this.expectedClass == Object) {
+    return typeof other == 'object';
+  }
+
+  return other instanceof this.expectedClass;
+};
+
+jasmine.Matchers.Any.prototype.jasmineToString = function() {
+  return '<jasmine.any(' + this.expectedClass + ')>';
+};
+
+jasmine.Matchers.ObjectContaining = function (sample) {
+  this.sample = sample;
+};
+
+jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
+  mismatchKeys = mismatchKeys || [];
+  mismatchValues = mismatchValues || [];
+
+  var env = jasmine.getEnv();
+
+  var hasKey = function(obj, keyName) {
+    return obj != null && obj[keyName] !== jasmine.undefined;
+  };
+
+  for (var property in this.sample) {
+    if (!hasKey(other, property) && hasKey(this.sample, property)) {
+      mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
+    }
+    else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
+      mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual.");
+    }
+  }
+
+  return (mismatchKeys.length === 0 && mismatchValues.length === 0);
+};
+
+jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () {
+  return "<jasmine.objectContaining(" + jasmine.pp(this.sample) + ")>";
+};
+// Mock setTimeout, clearTimeout
+// Contributed by Pivotal Computer Systems, www.pivotalsf.com
+
+jasmine.FakeTimer = function() {
+  this.reset();
+
+  var self = this;
+  self.setTimeout = function(funcToCall, millis) {
+    self.timeoutsMade++;
+    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
+    return self.timeoutsMade;
+  };
+
+  self.setInterval = function(funcToCall, millis) {
+    self.timeoutsMade++;
+    self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
+    return self.timeoutsMade;
+  };
+
+  self.clearTimeout = function(timeoutKey) {
+    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
+  };
+
+  self.clearInterval = function(timeoutKey) {
+    self.scheduledFunctions[timeoutKey] = jasmine.undefined;
+  };
+
+};
+
+jasmine.FakeTimer.prototype.reset = function() {
+  this.timeoutsMade = 0;
+  this.scheduledFunctions = {};
+  this.nowMillis = 0;
+};
+
+jasmine.FakeTimer.prototype.tick = function(millis) {
+  var oldMillis = this.nowMillis;
+  var newMillis = oldMillis + millis;
+  this.runFunctionsWithinRange(oldMillis, newMillis);
+  this.nowMillis = newMillis;
+};
+
+jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
+  var scheduledFunc;
+  var funcsToRun = [];
+  for (var timeoutKey in this.scheduledFunctions) {
+    scheduledFunc = this.scheduledFunctions[timeoutKey];
+    if (scheduledFunc != jasmine.undefined &&
+        scheduledFunc.runAtMillis >= oldMillis &&
+        scheduledFunc.runAtMillis <= nowMillis) {
+      funcsToRun.push(scheduledFunc);
+      this.scheduledFunctions[timeoutKey] = jasmine.undefined;
+    }
+  }
+
+  if (funcsToRun.length > 0) {
+    funcsToRun.sort(function(a, b) {
+      return a.runAtMillis - b.runAtMillis;
+    });
+    for (var i = 0; i < funcsToRun.length; ++i) {
+      try {
+        var funcToRun = funcsToRun[i];
+        this.nowMillis = funcToRun.runAtMillis;
+        funcToRun.funcToCall();
+        if (funcToRun.recurring) {
+          this.scheduleFunction(funcToRun.timeoutKey,
+              funcToRun.funcToCall,
+              funcToRun.millis,
+              true);
+        }
+      } catch(e) {
+      }
+    }
+    this.runFunctionsWithinRange(oldMillis, nowMillis);
+  }
+};
+
+jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
+  this.scheduledFunctions[timeoutKey] = {
+    runAtMillis: this.nowMillis + millis,
+    funcToCall: funcToCall,
+    recurring: recurring,
+    timeoutKey: timeoutKey,
+    millis: millis
+  };
+};
+
+/**
+ * @namespace
+ */
+jasmine.Clock = {
+  defaultFakeTimer: new jasmine.FakeTimer(),
+
+  reset: function() {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.defaultFakeTimer.reset();
+  },
+
+  tick: function(millis) {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.defaultFakeTimer.tick(millis);
+  },
+
+  runFunctionsWithinRange: function(oldMillis, nowMillis) {
+    jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
+  },
+
+  scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
+    jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
+  },
+
+  useMock: function() {
+    if (!jasmine.Clock.isInstalled()) {
+      var spec = jasmine.getEnv().currentSpec;
+      spec.after(jasmine.Clock.uninstallMock);
+
+      jasmine.Clock.installMock();
+    }
+  },
+
+  installMock: function() {
+    jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
+  },
+
+  uninstallMock: function() {
+    jasmine.Clock.assertInstalled();
+    jasmine.Clock.installed = jasmine.Clock.real;
+  },
+
+  real: {
+    setTimeout: jasmine.getGlobal().setTimeout,
+    clearTimeout: jasmine.getGlobal().clearTimeout,
+    setInterval: jasmine.getGlobal().setInterval,
+    clearInterval: jasmine.getGlobal().clearInterval
+  },
+
+  assertInstalled: function() {
+    if (!jasmine.Clock.isInstalled()) {
+      throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
+    }
+  },
+
+  isInstalled: function() {
+    return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
+  },
+
+  installed: null
+};
+jasmine.Clock.installed = jasmine.Clock.real;
+
+//else for IE support
+jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
+  if (jasmine.Clock.installed.setTimeout.apply) {
+    return jasmine.Clock.installed.setTimeout.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.setTimeout(funcToCall, millis);
+  }
+};
+
+jasmine.getGlobal().setInterval = function(funcToCall, millis) {
+  if (jasmine.Clock.installed.setInterval.apply) {
+    return jasmine.Clock.installed.setInterval.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.setInterval(funcToCall, millis);
+  }
+};
+
+jasmine.getGlobal().clearTimeout = function(timeoutKey) {
+  if (jasmine.Clock.installed.clearTimeout.apply) {
+    return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.clearTimeout(timeoutKey);
+  }
+};
+
+jasmine.getGlobal().clearInterval = function(timeoutKey) {
+  if (jasmine.Clock.installed.clearTimeout.apply) {
+    return jasmine.Clock.installed.clearInterval.apply(this, arguments);
+  } else {
+    return jasmine.Clock.installed.clearInterval(timeoutKey);
+  }
+};
+
+/**
+ * @constructor
+ */
+jasmine.MultiReporter = function() {
+  this.subReporters_ = [];
+};
+jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
+
+jasmine.MultiReporter.prototype.addReporter = function(reporter) {
+  this.subReporters_.push(reporter);
+};
+
+(function() {
+  var functionNames = [
+    "reportRunnerStarting",
+    "reportRunnerResults",
+    "reportSuiteResults",
+    "reportSpecStarting",
+    "reportSpecResults",
+    "log"
+  ];
+  for (var i = 0; i < functionNames.length; i++) {
+    var functionName = functionNames[i];
+    jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
+      return function() {
+        for (var j = 0; j < this.subReporters_.length; j++) {
+          var subReporter = this.subReporters_[j];
+          if (subReporter[functionName]) {
+            subReporter[functionName].apply(subReporter, arguments);
+          }
+        }
+      };
+    })(functionName);
+  }
+})();
+/**
+ * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
+ *
+ * @constructor
+ */
+jasmine.NestedResults = function() {
+  /**
+   * The total count of results
+   */
+  this.totalCount = 0;
+  /**
+   * Number of passed results
+   */
+  this.passedCount = 0;
+  /**
+   * Number of failed results
+   */
+  this.failedCount = 0;
+  /**
+   * Was this suite/spec skipped?
+   */
+  this.skipped = false;
+  /**
+   * @ignore
+   */
+  this.items_ = [];
+};
+
+/**
+ * Roll up the result counts.
+ *
+ * @param result
+ */
+jasmine.NestedResults.prototype.rollupCounts = function(result) {
+  this.totalCount += result.totalCount;
+  this.passedCount += result.passedCount;
+  this.failedCount += result.failedCount;
+};
+
+/**
+ * Adds a log message.
+ * @param values Array of message parts which will be concatenated later.
+ */
+jasmine.NestedResults.prototype.log = function(values) {
+  this.items_.push(new jasmine.MessageResult(values));
+};
+
+/**
+ * Getter for the results: message & results.
+ */
+jasmine.NestedResults.prototype.getItems = function() {
+  return this.items_;
+};
+
+/**
+ * Adds a result, tracking counts (total, passed, & failed)
+ * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
+ */
+jasmine.NestedResults.prototype.addResult = function(result) {
+  if (result.type != 'log') {
+    if (result.items_) {
+      this.rollupCounts(result);
+    } else {
+      this.totalCount++;
+      if (result.passed()) {
+        this.passedCount++;
+      } else {
+        this.failedCount++;
+      }
+    }
+  }
+  this.items_.push(result);
+};
+
+/**
+ * @returns {Boolean} True if <b>everything</b> below passed
+ */
+jasmine.NestedResults.prototype.passed = function() {
+  return this.passedCount === this.totalCount;
+};
+/**
+ * Base class for pretty printing for expectation results.
+ */
+jasmine.PrettyPrinter = function() {
+  this.ppNestLevel_ = 0;
+};
+
+/**
+ * Formats a value in a nice, human-readable string.
+ *
+ * @param value
+ */
+jasmine.PrettyPrinter.prototype.format = function(value) {
+  if (this.ppNestLevel_ > 40) {
+    throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
+  }
+
+  this.ppNestLevel_++;
+  try {
+    if (value === jasmine.undefined) {
+      this.emitScalar('undefined');
+    } else if (value === null) {
+      this.emitScalar('null');
+    } else if (value === jasmine.getGlobal()) {
+      this.emitScalar('<global>');
+    } else if (value.jasmineToString) {
+      this.emitScalar(value.jasmineToString());
+    } else if (typeof value === 'string') {
+      this.emitString(value);
+    } else if (jasmine.isSpy(value)) {
+      this.emitScalar("spy on " + value.identity);
+    } else if (value instanceof RegExp) {
+      this.emitScalar(value.toString());
+    } else if (typeof value === 'function') {
+      this.emitScalar('Function');
+    } else if (typeof value.nodeType === 'number') {
+      this.emitScalar('HTMLNode');
+    } else if (value instanceof Date) {
+      this.emitScalar('Date(' + value + ')');
+    } else if (value.__Jasmine_been_here_before__) {
+      this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
+    } else if (jasmine.isArray_(value) || typeof value == 'object') {
+      value.__Jasmine_been_here_before__ = true;
+      if (jasmine.isArray_(value)) {
+        this.emitArray(value);
+      } else {
+        this.emitObject(value);
+      }
+      delete value.__Jasmine_been_here_before__;
+    } else {
+      this.emitScalar(value.toString());
+    }
+  } finally {
+    this.ppNestLevel_--;
+  }
+};
+
+jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
+  for (var property in obj) {
+    if (property == '__Jasmine_been_here_before__') continue;
+    fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && 
+                                         obj.__lookupGetter__(property) !== null) : false);
+  }
+};
+
+jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
+jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
+
+jasmine.StringPrettyPrinter = function() {
+  jasmine.PrettyPrinter.call(this);
+
+  this.string = '';
+};
+jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
+
+jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
+  this.append(value);
+};
+
+jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
+  this.append("'" + value + "'");
+};
+
+jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
+  this.append('[ ');
+  for (var i = 0; i < array.length; i++) {
+    if (i > 0) {
+      this.append(', ');
+    }
+    this.format(array[i]);
+  }
+  this.append(' ]');
+};
+
+jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
+  var self = this;
+  this.append('{ ');
+  var first = true;
+
+  this.iterateObject(obj, function(property, isGetter) {
+    if (first) {
+      first = false;
+    } else {
+      self.append(', ');
+    }
+
+    self.append(property);
+    self.append(' : ');
+    if (isGetter) {
+      self.append('<getter>');
+    } else {
+      self.format(obj[property]);
+    }
+  });
+
+  this.append(' }');
+};
+
+jasmine.StringPrettyPrinter.prototype.append = function(value) {
+  this.string += value;
+};
+jasmine.Queue = function(env) {
+  this.env = env;
+  this.blocks = [];
+  this.running = false;
+  this.index = 0;
+  this.offset = 0;
+  this.abort = false;
+};
+
+jasmine.Queue.prototype.addBefore = function(block) {
+  this.blocks.unshift(block);
+};
+
+jasmine.Queue.prototype.add = function(block) {
+  this.blocks.push(block);
+};
+
+jasmine.Queue.prototype.insertNext = function(block) {
+  this.blocks.splice((this.index + this.offset + 1), 0, block);
+  this.offset++;
+};
+
+jasmine.Queue.prototype.start = function(onComplete) {
+  this.running = true;
+  this.onComplete = onComplete;
+  this.next_();
+};
+
+jasmine.Queue.prototype.isRunning = function() {
+  return this.running;
+};
+
+jasmine.Queue.LOOP_DONT_RECURSE = true;
+
+jasmine.Queue.prototype.next_ = function() {
+  var self = this;
+  var goAgain = true;
+
+  while (goAgain) {
+    goAgain = false;
+    
+    if (self.index < self.blocks.length && !this.abort) {
+      var calledSynchronously = true;
+      var completedSynchronously = false;
+
+      var onComplete = function () {
+        if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
+          completedSynchronously = true;
+          return;
+        }
+
+        if (self.blocks[self.index].abort) {
+          self.abort = true;
+        }
+
+        self.offset = 0;
+        self.index++;
+
+        var now = new Date().getTime();
+        if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
+          self.env.lastUpdate = now;
+          self.env.setTimeout(function() {
+            self.next_();
+          }, 0);
+        } else {
+          if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
+            goAgain = true;
+          } else {
+            self.next_();
+          }
+        }
+      };
+      self.blocks[self.index].execute(onComplete);
+
+      calledSynchronously = false;
+      if (completedSynchronously) {
+        onComplete();
+      }
+      
+    } else {
+      self.running = false;
+      if (self.onComplete) {
+        self.onComplete();
+      }
+    }
+  }
+};
+
+jasmine.Queue.prototype.results = function() {
+  var results = new jasmine.NestedResults();
+  for (var i = 0; i < this.blocks.length; i++) {
+    if (this.blocks[i].results) {
+      results.addResult(this.blocks[i].results());
+    }
+  }
+  return results;
+};
+
+
+/**
+ * Runner
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ */
+jasmine.Runner = function(env) {
+  var self = this;
+  self.env = env;
+  self.queue = new jasmine.Queue(env);
+  self.before_ = [];
+  self.after_ = [];
+  self.suites_ = [];
+};
+
+jasmine.Runner.prototype.execute = function() {
+  var self = this;
+  if (self.env.reporter.reportRunnerStarting) {
+    self.env.reporter.reportRunnerStarting(this);
+  }
+  self.queue.start(function () {
+    self.finishCallback();
+  });
+};
+
+jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
+  beforeEachFunction.typeName = 'beforeEach';
+  this.before_.splice(0,0,beforeEachFunction);
+};
+
+jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
+  afterEachFunction.typeName = 'afterEach';
+  this.after_.splice(0,0,afterEachFunction);
+};
+
+
+jasmine.Runner.prototype.finishCallback = function() {
+  this.env.reporter.reportRunnerResults(this);
+};
+
+jasmine.Runner.prototype.addSuite = function(suite) {
+  this.suites_.push(suite);
+};
+
+jasmine.Runner.prototype.add = function(block) {
+  if (block instanceof jasmine.Suite) {
+    this.addSuite(block);
+  }
+  this.queue.add(block);
+};
+
+jasmine.Runner.prototype.specs = function () {
+  var suites = this.suites();
+  var specs = [];
+  for (var i = 0; i < suites.length; i++) {
+    specs = specs.concat(suites[i].specs());
+  }
+  return specs;
+};
+
+jasmine.Runner.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.Runner.prototype.topLevelSuites = function() {
+  var topLevelSuites = [];
+  for (var i = 0; i < this.suites_.length; i++) {
+    if (!this.suites_[i].parentSuite) {
+      topLevelSuites.push(this.suites_[i]);
+    }
+  }
+  return topLevelSuites;
+};
+
+jasmine.Runner.prototype.results = function() {
+  return this.queue.results();
+};
+/**
+ * Internal representation of a Jasmine specification, or test.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {jasmine.Suite} suite
+ * @param {String} description
+ */
+jasmine.Spec = function(env, suite, description) {
+  if (!env) {
+    throw new Error('jasmine.Env() required');
+  }
+  if (!suite) {
+    throw new Error('jasmine.Suite() required');
+  }
+  var spec = this;
+  spec.id = env.nextSpecId ? env.nextSpecId() : null;
+  spec.env = env;
+  spec.suite = suite;
+  spec.description = description;
+  spec.queue = new jasmine.Queue(env);
+
+  spec.afterCallbacks = [];
+  spec.spies_ = [];
+
+  spec.results_ = new jasmine.NestedResults();
+  spec.results_.description = description;
+  spec.matchersClass = null;
+};
+
+jasmine.Spec.prototype.getFullName = function() {
+  return this.suite.getFullName() + ' ' + this.description + '.';
+};
+
+
+jasmine.Spec.prototype.results = function() {
+  return this.results_;
+};
+
+/**
+ * All parameters are pretty-printed and concatenated together, then written to the spec's output.
+ *
+ * Be careful not to leave calls to <code>jasmine.log</code> in production code.
+ */
+jasmine.Spec.prototype.log = function() {
+  return this.results_.log(arguments);
+};
+
+jasmine.Spec.prototype.runs = function (func) {
+  var block = new jasmine.Block(this.env, func, this);
+  this.addToQueue(block);
+  return this;
+};
+
+jasmine.Spec.prototype.addToQueue = function (block) {
+  if (this.queue.isRunning()) {
+    this.queue.insertNext(block);
+  } else {
+    this.queue.add(block);
+  }
+};
+
+/**
+ * @param {jasmine.ExpectationResult} result
+ */
+jasmine.Spec.prototype.addMatcherResult = function(result) {
+  this.results_.addResult(result);
+};
+
+jasmine.Spec.prototype.expect = function(actual) {
+  var positive = new (this.getMatchersClass_())(this.env, actual, this);
+  positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
+  return positive;
+};
+
+/**
+ * Waits a fixed time period before moving to the next block.
+ *
+ * @deprecated Use waitsFor() instead
+ * @param {Number} timeout milliseconds to wait
+ */
+jasmine.Spec.prototype.waits = function(timeout) {
+  var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
+  this.addToQueue(waitsFunc);
+  return this;
+};
+
+/**
+ * Waits for the latchFunction to return true before proceeding to the next block.
+ *
+ * @param {Function} latchFunction
+ * @param {String} optional_timeoutMessage
+ * @param {Number} optional_timeout
+ */
+jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
+  var latchFunction_ = null;
+  var optional_timeoutMessage_ = null;
+  var optional_timeout_ = null;
+
+  for (var i = 0; i < arguments.length; i++) {
+    var arg = arguments[i];
+    switch (typeof arg) {
+      case 'function':
+        latchFunction_ = arg;
+        break;
+      case 'string':
+        optional_timeoutMessage_ = arg;
+        break;
+      case 'number':
+        optional_timeout_ = arg;
+        break;
+    }
+  }
+
+  var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
+  this.addToQueue(waitsForFunc);
+  return this;
+};
+
+jasmine.Spec.prototype.fail = function (e) {
+  var expectationResult = new jasmine.ExpectationResult({
+    passed: false,
+    message: e ? jasmine.util.formatException(e) : 'Exception',
+    trace: { stack: e.stack }
+  });
+  this.results_.addResult(expectationResult);
+};
+
+jasmine.Spec.prototype.getMatchersClass_ = function() {
+  return this.matchersClass || this.env.matchersClass;
+};
+
+jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
+  var parent = this.getMatchersClass_();
+  var newMatchersClass = function() {
+    parent.apply(this, arguments);
+  };
+  jasmine.util.inherit(newMatchersClass, parent);
+  jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
+  this.matchersClass = newMatchersClass;
+};
+
+jasmine.Spec.prototype.finishCallback = function() {
+  this.env.reporter.reportSpecResults(this);
+};
+
+jasmine.Spec.prototype.finish = function(onComplete) {
+  this.removeAllSpies();
+  this.finishCallback();
+  if (onComplete) {
+    onComplete();
+  }
+};
+
+jasmine.Spec.prototype.after = function(doAfter) {
+  if (this.queue.isRunning()) {
+    this.queue.add(new jasmine.Block(this.env, doAfter, this));
+  } else {
+    this.afterCallbacks.unshift(doAfter);
+  }
+};
+
+jasmine.Spec.prototype.execute = function(onComplete) {
+  var spec = this;
+  if (!spec.env.specFilter(spec)) {
+    spec.results_.skipped = true;
+    spec.finish(onComplete);
+    return;
+  }
+
+  this.env.reporter.reportSpecStarting(this);
+
+  spec.env.currentSpec = spec;
+
+  spec.addBeforesAndAftersToQueue();
+
+  spec.queue.start(function () {
+    spec.finish(onComplete);
+  });
+};
+
+jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
+  var runner = this.env.currentRunner();
+  var i;
+
+  for (var suite = this.suite; suite; suite = suite.parentSuite) {
+    for (i = 0; i < suite.before_.length; i++) {
+      this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
+    }
+  }
+  for (i = 0; i < runner.before_.length; i++) {
+    this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
+  }
+  for (i = 0; i < this.afterCallbacks.length; i++) {
+    this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
+  }
+  for (suite = this.suite; suite; suite = suite.parentSuite) {
+    for (i = 0; i < suite.after_.length; i++) {
+      this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
+    }
+  }
+  for (i = 0; i < runner.after_.length; i++) {
+    this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
+  }
+};
+
+jasmine.Spec.prototype.explodes = function() {
+  throw 'explodes function should not have been called';
+};
+
+jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
+  if (obj == jasmine.undefined) {
+    throw "spyOn could not find an object to spy upon for " + methodName + "()";
+  }
+
+  if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
+    throw methodName + '() method does not exist';
+  }
+
+  if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
+    throw new Error(methodName + ' has already been spied upon');
+  }
+
+  var spyObj = jasmine.createSpy(methodName);
+
+  this.spies_.push(spyObj);
+  spyObj.baseObj = obj;
+  spyObj.methodName = methodName;
+  spyObj.originalValue = obj[methodName];
+
+  obj[methodName] = spyObj;
+
+  return spyObj;
+};
+
+jasmine.Spec.prototype.removeAllSpies = function() {
+  for (var i = 0; i < this.spies_.length; i++) {
+    var spy = this.spies_[i];
+    spy.baseObj[spy.methodName] = spy.originalValue;
+  }
+  this.spies_ = [];
+};
+
+/**
+ * Internal representation of a Jasmine suite.
+ *
+ * @constructor
+ * @param {jasmine.Env} env
+ * @param {String} description
+ * @param {Function} specDefinitions
+ * @param {jasmine.Suite} parentSuite
+ */
+jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
+  var self = this;
+  self.id = env.nextSuiteId ? env.nextSuiteId() : null;
+  self.description = description;
+  self.queue = new jasmine.Queue(env);
+  self.parentSuite = parentSuite;
+  self.env = env;
+  self.before_ = [];
+  self.after_ = [];
+  self.children_ = [];
+  self.suites_ = [];
+  self.specs_ = [];
+};
+
+jasmine.Suite.prototype.getFullName = function() {
+  var fullName = this.description;
+  for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
+    fullName = parentSuite.description + ' ' + fullName;
+  }
+  return fullName;
+};
+
+jasmine.Suite.prototype.finish = function(onComplete) {
+  this.env.reporter.reportSuiteResults(this);
+  this.finished = true;
+  if (typeof(onComplete) == 'function') {
+    onComplete();
+  }
+};
+
+jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
+  beforeEachFunction.typeName = 'beforeEach';
+  this.before_.unshift(beforeEachFunction);
+};
+
+jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
+  afterEachFunction.typeName = 'afterEach';
+  this.after_.unshift(afterEachFunction);
+};
+
+jasmine.Suite.prototype.results = function() {
+  return this.queue.results();
+};
+
+jasmine.Suite.prototype.add = function(suiteOrSpec) {
+  this.children_.push(suiteOrSpec);
+  if (suiteOrSpec instanceof jasmine.Suite) {
+    this.suites_.push(suiteOrSpec);
+    this.env.currentRunner().addSuite(suiteOrSpec);
+  } else {
+    this.specs_.push(suiteOrSpec);
+  }
+  this.queue.add(suiteOrSpec);
+};
+
+jasmine.Suite.prototype.specs = function() {
+  return this.specs_;
+};
+
+jasmine.Suite.prototype.suites = function() {
+  return this.suites_;
+};
+
+jasmine.Suite.prototype.children = function() {
+  return this.children_;
+};
+
+jasmine.Suite.prototype.execute = function(onComplete) {
+  var self = this;
+  this.queue.start(function () {
+    self.finish(onComplete);
+  });
+};
+jasmine.WaitsBlock = function(env, timeout, spec) {
+  this.timeout = timeout;
+  jasmine.Block.call(this, env, null, spec);
+};
+
+jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
+
+jasmine.WaitsBlock.prototype.execute = function (onComplete) {
+  if (jasmine.VERBOSE) {
+    this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
+  }
+  this.env.setTimeout(function () {
+    onComplete();
+  }, this.timeout);
+};
+/**
+ * A block which waits for some condition to become true, with timeout.
+ *
+ * @constructor
+ * @extends jasmine.Block
+ * @param {jasmine.Env} env The Jasmine environment.
+ * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
+ * @param {Function} latchFunction A function which returns true when the desired condition has been met.
+ * @param {String} message The message to display if the desired condition hasn't been met within the given time period.
+ * @param {jasmine.Spec} spec The Jasmine spec.
+ */
+jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
+  this.timeout = timeout || env.defaultTimeoutInterval;
+  this.latchFunction = latchFunction;
+  this.message = message;
+  this.totalTimeSpentWaitingForLatch = 0;
+  jasmine.Block.call(this, env, null, spec);
+};
+jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
+
+jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
+
+jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
+  if (jasmine.VERBOSE) {
+    this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
+  }
+  var latchFunctionResult;
+  try {
+    latchFunctionResult = this.latchFunction.apply(this.spec);
+  } catch (e) {
+    this.spec.fail(e);
+    onComplete();
+    return;
+  }
+
+  if (latchFunctionResult) {
+    onComplete();
+  } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
+    var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
+    this.spec.fail({
+      name: 'timeout',
+      message: message
+    });
+
+    this.abort = true;
+    onComplete();
+  } else {
+    this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
+    var self = this;
+    this.env.setTimeout(function() {
+      self.execute(onComplete);
+    }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
+  }
+};
+
+jasmine.version_= {
+  "major": 1,
+  "minor": 2,
+  "build": 0,
+  "revision": 1337005947
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/build.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/build.xml b/lib/cordova-blackberry/blackberry/build.xml
new file mode 100644
index 0000000..89bc31b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/build.xml
@@ -0,0 +1,317 @@
+<project name="Create &amp; Update a Cordova BlackBerry WebWorks Project" default="help">
+<!--
+   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.
+-->
+    <!-- LOAD VERSION -->
+
+    <loadfile property="version" srcFile="VERSION">
+        <filterchain>
+            <striplinebreaks/>
+        </filterchain>
+    </loadfile>
+
+    <!-- LOAD PROPERTIES -->
+
+    <property name="template.project.dir" location="bin/templates/project" />
+    <property name="template.dist.dir"    location="bin/templates/dist" />
+
+    <property name="build.dir"            location="build" />
+    <property name="update.dir"           value="lib/cordova.${version}" />
+
+    <property name="dist.path"         location="dist" />
+    <property name="dist.www.path"     location="${dist.path}/www" />
+    <property name="dist.project.path" location="${dist.path}/sample" />
+
+    <property name="jar.src"      location="framework/ext/src" />
+    <property name="jar.path"     value="ext" />
+    <property name="jar.basename" value="cordova.${version}.jar" />
+    <property name="jar.file"     value="${jar.path}/${jar.basename}" />
+
+    <property name="playbook.js.path"   value="javascript/playbook" />
+    <property name="playbook.ext.src"   location="framework/ext-air" />
+    <property name="playbook.ext.path"  value="ext-air" />
+
+    <property name="js.src"          location="javascript" />
+    <property name="js.path"         value="javascript" />
+    <property name="js.basename"     value="cordova-${version}.js" />
+    <property name="js.file"         value="${js.path}/${js.basename}" />
+
+    <!-- BUILD JAVASCRIPT -->
+
+    <target name="build-javascript">
+        <!-- BB Javascript -->
+        <mkdir dir="${build.dir}/${js.path}" />
+        <copy file="${js.src}/cordova.blackberry.js" tofile="${build.dir}/${js.file}" />
+    </target>
+
+    <!-- BUILD BLACKBERRY EXTENSION -->
+
+    <target name="build-bb-extension">
+        <mkdir dir="${build.dir}/${jar.path}" />
+
+        <zip destfile="${build.dir}/${jar.file}">
+            <fileset dir="${jar.src}" includes="library.xml" />
+            <fileset dir="${jar.src}" includes="**/*.java" />
+        </zip>
+    </target>
+
+    <!-- BUILD PLAYBOOK EXTENSION -->
+
+    <target name="build-pb-extension">
+
+        <!-- Copy Ext -->
+        <mkdir dir="${build.dir}/${playbook.ext.path}" />
+        <copy todir="${build.dir}/${playbook.ext.path}">
+            <fileset dir="${playbook.ext.src}" />
+        </copy>
+    </target>
+
+    <!-- CREATE A PROJECT -->
+    <target name="create" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
+        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
+
+        <available file="${project.path}" property="project.exists" />
+        <fail if="project.exists" message="The project path must be an empty directory." />
+
+        <!-- create project using template directory -->
+        <mkdir dir="${project.path}" />
+        <copy todir="${project.path}">
+            <fileset dir="${template.project.dir}" />
+        </copy>
+
+        <!-- change file permission for cordova scripts because ant copy doesn't preserve file permissions -->
+        <chmod dir="${project.path}/cordova" perm="700" includes="*"/>
+
+        <!-- update project files to reference cordova.x.x.x.js -->
+        <replaceregexp match="cordova\.js" replace="${js.basename}" byline="true">
+            <fileset file="${project.path}/www/index.html" />
+            <fileset file="${project.path}/build.xml" />
+        </replaceregexp>
+
+        <!-- copy cordova.js -->
+        <copy todir="${project.path}/www">
+            <fileset dir="${build.dir}/${js.path}" />
+        </copy>
+
+        <!-- copy ext/ -->
+        <copy todir="${project.path}/www/ext">
+            <fileset dir="${build.dir}/${jar.path}" />
+        </copy>
+
+        <!-- copy ext-air/ -->
+        <copy todir="${project.path}/www/ext-air">
+            <fileset dir="${build.dir}/${playbook.ext.path}" />
+        </copy>
+
+        <!-- save release -->
+        <mkdir dir="${project.path}/${update.dir}" />
+        <copy todir="${project.path}/${update.dir}">
+            <fileset dir="${build.dir}" />
+        </copy>
+
+        <echo>
+Project Creation Complete!
+==========================
+
+Getting Started:
+----------------
+
+  cd ${project.path}
+
+  ant help
+        </echo>
+    </target>
+
+    <!-- DISTRIBUTION -->
+    <target name="dist" depends="">
+        <!-- create a sample project -->
+        <antcall target="create">
+            <param name="project.path" value="${dist.project.path}" />
+        </antcall>
+
+        <!-- copy dist template (README.md) -->
+        <copy todir="${dist.path}">
+            <fileset dir="${template.dist.dir}" />
+        </copy>
+
+        <!-- change file permission for cordova scripts because ant copy doesn't preserve file permissions -->
+        <chmod dir="${dist.path}/sample/cordova" perm="700" includes="*" />
+
+        <!-- copy cordova.jar -->
+        <copy todir="${dist.www.path}/ext">
+            <fileset dir="${build.dir}/${jar.path}" />
+        </copy>
+
+        <!-- copy ext-air/ -->
+        <copy todir="${dist.www.path}/ext-air">
+            <fileset dir="${build.dir}/${playbook.ext.path}" />
+        </copy>
+
+        <!-- copy cordova.js -->
+        <copy todir="${dist.www.path}">
+            <fileset dir="${build.dir}/${js.path}" />
+        </copy>
+
+        <!-- copy config.xml -->
+        <copy todir="${dist.www.path}">
+            <fileset file="${template.project.dir}/www/config.xml" />
+        </copy>
+
+        <!-- copy plugins.xml -->
+        <copy todir="${dist.www.path}">
+            <fileset file="${template.project.dir}/www/plugins.xml" />
+        </copy>
+
+        <!-- update config.xml to have a default name-->
+        <replace file="${dist.project.path}/www/config.xml" token="__NAME__" value="cordovaExample"/>
+        <replace file="${dist.project.path}/www/config.xml" token="__PACKAGE__" value="org.apache.cordova.example"/>
+        <echo>
+Distribution Complete!
+======================
+
+Version:
+--------
+
+  ${version}
+
+Path:
+-----
+
+  ${dist.path}
+        </echo>
+    </target>
+
+    <target name="version">
+        <replace dir="." token="${version}" value="${value}" />
+
+        <echo>
+Version Update Complete!
+========================
+
+Version:
+--------
+
+  Previous: ${version}
+  Current:  ${value}
+
+Remember to:
+------------
+
+  Review and commit the version update.
+
+  $ git diff
+  $ git commit -am "Update to version ${value}"
+  $ git tag ${value}
+        </echo>
+    </target>
+
+    <!-- UPDATE A PROJECT -->
+
+    <target name="update" depends="clean, build-javascript, build-bb-extension, build-pb-extension">
+        <fail unless="project.path" message="You must give a project PATH. Use the argument -Dproject.path=&#34;C:\dev\my_project&#34;" />
+
+        <available file="${project.path}" property="project.exists" />
+        <fail unless="project.exists" message="The project path cannot be empty." />
+
+        <!-- save release -->
+        <mkdir dir="${project.path}/${update.dir}" />
+        <copy todir="${project.path}/${update.dir}">
+            <fileset dir="${build.dir}" />
+        </copy>
+
+        <echo>
+Update complete!
+================
+
+  Cordova ${version} has been created.
+
+  Update does not alter your project files.
+
+  See below for instructions to install Cordova ${version}.
+
+Where:
+------
+
+  ${project.path}/${update.dir}
+
+Install:
+--------
+
+  1. Install the Java Extension:
+
+    - delete /www/${jar.path}/cordova.jar
+
+    - copy /${update.dir}/${jar.file}
+        to /www/${jar.file}
+
+  2. Install the JavaScript library:
+
+    - delete /www/cordova.js
+
+    - copy /${update.dir}/${js.file}
+        to /www/${js.basename}
+
+  3. Update JavaScript references:
+
+    - &#60;script type=&#34;text/javascript&#34; src=&#34;${js.basename}&#34;&#62;&#60;/script&#62;
+        </echo>
+    </target>
+
+    <!-- CLEAN -->
+
+    <target name="clean">
+        <delete dir="${build.dir}" />
+        <delete dir="${dist.path}" />
+    </target>
+
+    <!-- HELP -->
+
+    <target name="help">
+        <echo>
+NAME
+  ${ant.project.name}
+
+SYNOPSIS
+  ant COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
+
+DESCRIPTION
+  This tool allows you to create and update Cordova-BlackBerry-WebWorks projects.
+  You will want to run update after you have updated the framework source.
+  In other words, when you &lt;git pull origin master&gt;.
+
+COMMANDS
+  help ............ Show this help menu.
+                      ant, ant help
+
+  create .......... Create a new project
+                      ant create PATH
+                      ant create -Dproject.path="C:\dev\my_project"
+
+  update .......... Update an existing project
+                      ant update PATH
+                      ant update -Dproject.path="C:\dev\my_project"
+
+  dist ............ Create a Cordova distribution build
+                      ant dist
+
+  version ......... Update Cordova version
+                      ant version VERSION
+                      ant version -Dvalue="1.0.0"
+        </echo>
+    </target>
+</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/library.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/library.xml b/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/library.xml
new file mode 100644
index 0000000..c1835b4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/library.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+       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.
+-->
+<library isWhitelist="true">
+	<extension>
+		<entryClass>org.apache.cordova.network.Network</entryClass>
+	</extension>
+
+	<platforms>
+		<platform value="AIR">
+			<target version="default" config="AIR_XHR" />
+		</platform>
+	</platforms>
+
+	<configurations>
+		<configuration name="AIR_XHR" version="1.0" comment="For XHR architecture for Java implementation">
+			<src type="text/actionscript" path="src" comment="ActionScript implementation" />
+		</configuration>
+	</configurations>
+
+	<features>
+		<feature id="org.apache.cordova" version="1.0.0" />
+	</features>
+</library>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as b/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as
new file mode 100644
index 0000000..d2ad030
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext-air/Cordova_Network/src/org/apache/cordova/network/Network.as
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ *
+ * Copyright (c) 2011, Research In Motion Limited.
+ */
+
+
+package org.apache.cordova.network {
+    import flash.net.NetworkInfo;
+    import flash.net.NetworkInterface;
+	import flash.events.Event;
+    import qnx.system.Device;
+
+    import webworks.extension.DefaultExtension;
+
+    public class Network extends DefaultExtension{
+
+        private var _jsFunctionCallbackIDs:Array = [];
+		private const FEATURE_ID:Array = [ "org.apache.cordova" ];
+
+		public function Network() {
+			//Attach event listener once only
+			NetworkInfo.networkInfo.addEventListener(flash.events.Event.NETWORK_CHANGE, networkChange);
+		}
+
+		override public function getFeatureList():Array {
+			return FEATURE_ID;
+		}
+
+        public function getConnectionInfo(param:String):void{
+			if(_jsFunctionCallbackIDs.indexOf(param) < 0){
+				_jsFunctionCallbackIDs.push(param);
+			}
+        }
+
+        public function getDeviceInfo(id:String):void{
+            evalJavaScriptEvent(id, [{
+                "uuid" : Device.device.pin,
+                "version": Device.device.scmBundle
+            }]);
+        }
+
+        private function networkChange( event: Event ) : void {
+
+            /**
+             * Right now, we only care if there is a connection or not, since PlayBook only has WiFi
+             * At the JS layer, we will map this from offline/online.
+             * At some point in the future where there are more connection types on PlayBook,
+             * we will want to attempt to map this to the real Cordova connection types...
+             */
+
+            var haveCoverage : Boolean = false;
+            var networkStatus : String = "offline";
+			var connectionType = "none";
+
+			NetworkInfo.networkInfo.findInterfaces().some(
+				function callback(item:NetworkInterface, index:int, vector:Vector.<NetworkInterface>):Boolean {
+					this.webView.executeJavaScript("alert('Network Interface ' + item.name)");
+					haveCoverage = item.active || haveCoverage;
+					return haveCoverage;
+				}, this);
+
+			if (haveCoverage) {
+				networkStatus = "online";
+				connectionType = "wifi";
+			}
+
+            for (var i:Number=0; i<_jsFunctionCallbackIDs.length ; i++){
+                evalJavaScriptEvent(_jsFunctionCallbackIDs[i], [{"type" : connectionType, "event" : networkStatus }] );
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/.classpath
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/.classpath b/lib/cordova-blackberry/blackberry/framework/ext/.classpath
new file mode 100644
index 0000000..8d3a567
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="res"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/net.rim.ejde.BlackBerryVMInstallType/BlackBerry JRE 5.0.0"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>


[12/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/jquery.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/jquery.js b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/jquery.js
new file mode 100644
index 0000000..a0fb883
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/jquery.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.sele
 ctor=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this
 ;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G
 ){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="st
 ring"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o
 .inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(t
 his[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Obje
 ct.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!=
 =false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="m
 argin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDoc
 ument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[
 2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J
 .parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return
  J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webk
 it/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K
 =0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache
 [H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"
 }if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ *  Copyright 2009, The Dojo Foundation
+ *  Released under the MIT, BSD, and GPL Licenses.
+ *  More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.cal
 l(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].
 exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((
 ?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:functi
 on(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[
 1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"
 ===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U
 =U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)=
 ==U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){va
 r V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagNa
 me(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElem
 entsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:f
 unction(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U=
 =T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeT
 ype==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.
 indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.tes
 t(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY
 =H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.is
 DefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F|
 |H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.sel
 ector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatecha
 nge",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;o
 pacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var 
 L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:func
 tion(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.ext
 end(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"
 ="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);
 return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.
 httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try
 {var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.conca
 t.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?
 this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return tr
 ue})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.pr
 ototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop==
 "height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J
 ,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.
 offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElem
 ent("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();va
 r G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxMod
 el&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.css
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.css b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.css
new file mode 100644
index 0000000..1d3b97e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.css
@@ -0,0 +1,17 @@
+h1#qunit-header, h1.qunit-header { padding: 15px; font-size: large; background-color: #06b; color: white; font-family: 'trebuchet ms', verdana, arial; margin: 0; }
+h1#qunit-header a { color: white; }
+
+h2#qunit-banner { height: 2em; border-bottom: 1px solid white; background-color: #eee; margin: 0; font-family: 'trebuchet ms', verdana, arial; }
+h2#qunit-banner.pass { background-color: green; }
+h2#qunit-banner.fail { background-color: red; }
+
+h2#qunit-userAgent, h2.qunit-userAgent { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal; font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; }
+
+div#qunit-testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; font-family: 'trebuchet ms', verdana, arial; margin: 0; font-size: 10pt; }
+
+ol#qunit-tests { font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; }
+ol#qunit-tests li strong { cursor:pointer; }
+ol#qunit-tests .pass { color: green; } 
+ol#qunit-tests .fail { color: red; } 
+
+p#qunit-testresult { margin-left: 1em; font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.js b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.js
new file mode 100644
index 0000000..385f1e6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jWorkflow/test/vendor/qunit.js
@@ -0,0 +1,997 @@
+/*
+ * QUnit - A JavaScript Unit Testing Framework
+ * 
+ * http://docs.jquery.com/QUnit
+ *
+ * Copyright (c) 2009 John Resig, Jörn Zaefferer
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ */
+
+(function(window) {
+
+var QUnit = {
+
+	// Initialize the configuration options
+	init: function init() {
+		config = {
+			stats: { all: 0, bad: 0 },
+			moduleStats: { all: 0, bad: 0 },
+			started: +new Date,
+			blocking: false,
+			autorun: false,
+			assertions: [],
+			filters: [],
+			queue: []
+		};
+
+		var tests = id("qunit-tests"),
+			banner = id("qunit-banner"),
+			result = id("qunit-testresult");
+
+		if ( tests ) {
+			tests.innerHTML = "";
+		}
+
+		if ( banner ) {
+			banner.className = "";
+		}
+
+		if ( result ) {
+			result.parentNode.removeChild( result );
+		}
+	},
+	
+	// call on start of module test to prepend name to all tests
+	module: function module(name, testEnvironment) {
+
+		synchronize(function() {
+			if ( config.currentModule ) {
+				QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
+			}
+
+			config.currentModule = name;
+			config.moduleTestEnvironment = testEnvironment;
+			config.moduleStats = { all: 0, bad: 0 };
+
+			QUnit.moduleStart( name, testEnvironment );
+		});
+	},
+
+	asyncTest: function asyncTest(testName, expected, callback) {
+		if ( arguments.length === 2 ) {
+			callback = expected;
+			expected = 0;
+		}
+
+		QUnit.test(testName, expected, callback, true);
+	},
+	
+	test: function test(testName, expected, callback, async) {
+		var name = testName, testEnvironment = {};
+
+		if ( arguments.length === 2 ) {
+			callback = expected;
+			expected = null;
+		}
+
+		if ( config.currentModule ) {
+			name = config.currentModule + " module: " + name;
+		}
+
+		if ( !validTest(name) ) {
+			return;
+		}
+
+		synchronize(function() {
+			QUnit.testStart( testName );
+
+			testEnvironment = extend({
+				setup: function() {},
+				teardown: function() {}
+			}, config.moduleTestEnvironment);
+
+			config.assertions = [];
+			config.expected = null;
+
+			if ( arguments.length >= 3 ) {
+				config.expected = callback;
+				callback = arguments[2];
+			}
+
+			try {
+				if ( !config.pollution ) {
+					saveGlobal();
+				}
+
+				testEnvironment.setup.call(testEnvironment);
+			} catch(e) {
+				QUnit.ok( false, "Setup failed on " + name + ": " + e.message );
+			}
+
+			if ( async ) {
+				QUnit.stop();
+			}
+
+			try {
+				callback.call(testEnvironment);
+			} catch(e) {
+				fail("Test " + name + " died, exception and test follows", e, callback);
+				QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message );
+				// else next test will carry the responsibility
+				saveGlobal();
+
+				// Restart the tests if they're blocking
+				if ( config.blocking ) {
+					start();
+				}
+			}
+		});
+
+		synchronize(function() {
+			try {
+				checkPollution();
+				testEnvironment.teardown.call(testEnvironment);
+			} catch(e) {
+				QUnit.ok( false, "Teardown failed on " + name + ": " + e.message );
+			}
+
+			try {
+				QUnit.reset();
+			} catch(e) {
+				fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset);
+			}
+
+			if ( config.expected && config.expected != config.assertions.length ) {
+				QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" );
+			}
+
+			var good = 0, bad = 0,
+				tests = id("qunit-tests");
+
+			config.stats.all += config.assertions.length;
+			config.moduleStats.all += config.assertions.length;
+
+			if ( tests ) {
+				var ol  = document.createElement("ol");
+				ol.style.display = "none";
+
+				for ( var i = 0; i < config.assertions.length; i++ ) {
+					var assertion = config.assertions[i];
+
+					var li = document.createElement("li");
+					li.className = assertion.result ? "pass" : "fail";
+					li.innerHTML = assertion.message || "(no message)";
+					ol.appendChild( li );
+
+					if ( assertion.result ) {
+						good++;
+					} else {
+						bad++;
+						config.stats.bad++;
+						config.moduleStats.bad++;
+					}
+				}
+
+				var b = document.createElement("strong");
+				b.innerHTML = name + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + config.assertions.length + ")</b>";
+				
+				addEvent(b, "click", function() {
+					var next = b.nextSibling, display = next.style.display;
+					next.style.display = display === "none" ? "block" : "none";
+				});
+				
+				addEvent(b, "dblclick", function(e) {
+					var target = (e || window.event).target;
+					if ( target.nodeName.toLowerCase() === "strong" ) {
+						var text = "", node = target.firstChild;
+
+						while ( node.nodeType === 3 ) {
+							text += node.nodeValue;
+							node = node.nextSibling;
+						}
+
+						text = text.replace(/(^\s*|\s*$)/g, "");
+
+						if ( window.location ) {
+							window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text);
+						}
+					}
+				});
+
+				var li = document.createElement("li");
+				li.className = bad ? "fail" : "pass";
+				li.appendChild( b );
+				li.appendChild( ol );
+				tests.appendChild( li );
+
+				if ( bad ) {
+					var toolbar = id("qunit-testrunner-toolbar");
+					if ( toolbar ) {
+						toolbar.style.display = "block";
+						id("qunit-filter-pass").disabled = null;
+						id("qunit-filter-missing").disabled = null;
+					}
+				}
+
+			} else {
+				for ( var i = 0; i < config.assertions.length; i++ ) {
+					if ( !config.assertions[i].result ) {
+						bad++;
+						config.stats.bad++;
+						config.moduleStats.bad++;
+					}
+				}
+			}
+
+			QUnit.testDone( testName, bad, config.assertions.length );
+
+			if ( !window.setTimeout && !config.queue.length ) {
+				done();
+			}
+		});
+
+		if ( window.setTimeout && !config.doneTimer ) {
+			config.doneTimer = window.setTimeout(function(){
+				if ( !config.queue.length ) {
+					done();
+				} else {
+					synchronize( done );
+				}
+			}, 13);
+		}
+	},
+	
+	/**
+	 * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
+	 */
+	expect: function expect(asserts) {
+		config.expected = asserts;
+	},
+
+	/**
+	 * Asserts true.
+	 * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
+	 */
+	ok: function ok(a, msg) {
+		QUnit.log(a, msg);
+
+		config.assertions.push({
+			result: !!a,
+			message: msg
+		});
+	},
+
+	/**
+	 * Checks that the first two arguments are equal, with an optional message.
+	 * Prints out both actual and expected values.
+	 *
+	 * Prefered to ok( actual == expected, message )
+	 *
+	 * @example equals( format("Received {0} bytes.", 2), "Received 2 bytes." );
+	 *
+	 * @param Object actual
+	 * @param Object expected
+	 * @param String message (optional)
+	 */
+	equals: function equals(actual, expected, message) {
+		push(expected == actual, actual, expected, message);
+	},
+	
+	same: function(a, b, message) {
+		push(QUnit.equiv(a, b), a, b, message);
+	},
+	
+	start: function start() {
+		// A slight delay, to avoid any current callbacks
+		if ( window.setTimeout ) {
+			window.setTimeout(function() {
+				if ( config.timeout ) {
+					clearTimeout(config.timeout);
+				}
+
+				config.blocking = false;
+				process();
+			}, 13);
+		} else {
+			config.blocking = false;
+			process();
+		}
+	},
+	
+	stop: function stop(timeout) {
+		config.blocking = true;
+
+		if ( timeout && window.setTimeout ) {
+			config.timeout = window.setTimeout(function() {
+				QUnit.ok( false, "Test timed out" );
+				QUnit.start();
+			}, timeout);
+		}
+	},
+	
+	/**
+	 * Resets the test setup. Useful for tests that modify the DOM.
+	 */
+	reset: function reset() {
+		if ( window.jQuery ) {
+			jQuery("#main").html( config.fixture );
+			jQuery.event.global = {};
+			jQuery.ajaxSettings = extend({}, config.ajaxSettings);
+		}
+	},
+	
+	/**
+	 * Trigger an event on an element.
+	 *
+	 * @example triggerEvent( document.body, "click" );
+	 *
+	 * @param DOMElement elem
+	 * @param String type
+	 */
+	triggerEvent: function triggerEvent( elem, type, event ) {
+		if ( document.createEvent ) {
+			event = document.createEvent("MouseEvents");
+			event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
+				0, 0, 0, 0, 0, false, false, false, false, 0, null);
+			elem.dispatchEvent( event );
+
+		} else if ( elem.fireEvent ) {
+			elem.fireEvent("on"+type);
+		}
+	},
+	
+	// Logging callbacks
+	done: function done(failures, total) {},
+	log: function log(result, message) {},
+	testStart: function testStart(name) {},
+	testDone: function testDone(name, failures, total) {},
+	moduleStart: function moduleStart(name, testEnvironment) {},
+	moduleDone: function moduleDone(name, failures, total) {}
+};
+
+// Maintain internal state
+var config = {
+	// The queue of tests to run
+	queue: [],
+
+	// block until document ready
+	blocking: true
+};
+
+// Load paramaters
+(function() {
+	var location = window.location || { search: "", protocol: "file:" },
+		GETParams = location.search.slice(1).split('&');
+
+	for ( var i = 0; i < GETParams.length; i++ ) {
+		GETParams[i] = decodeURIComponent( GETParams[i] );
+		if ( GETParams[i] === "noglobals" ) {
+			GETParams.splice( i, 1 );
+			i--;
+			config.noglobals = true;
+		}
+	}
+	
+	// restrict modules/tests by get parameters
+	config.filters = GETParams;
+	
+	// Figure out if we're running the tests from a server or not
+	QUnit.isLocal = !!(location.protocol === 'file:');
+})();
+
+// Expose the API as global variables, unless an 'exports'
+// object exists, in that case we assume we're in CommonJS
+if ( typeof exports === "undefined" || typeof require === "undefined" ) {
+	extend(window, QUnit);
+	window.QUnit = QUnit;
+} else {
+	extend(exports, QUnit);
+	exports.QUnit = QUnit;
+}
+
+if ( typeof document === "undefined" || document.readyState === "complete" ) {
+	config.autorun = true;
+}
+
+addEvent(window, "load", function() {
+	// Initialize the config, saving the execution queue
+	var oldconfig = extend({}, config);
+	QUnit.init();
+	extend(config, oldconfig);
+
+	config.blocking = false;
+
+	var userAgent = id("qunit-userAgent");
+	if ( userAgent ) {
+		userAgent.innerHTML = navigator.userAgent;
+	}
+	
+	var toolbar = id("qunit-testrunner-toolbar");
+	if ( toolbar ) {
+		toolbar.style.display = "none";
+		
+		var filter = document.createElement("input");
+		filter.type = "checkbox";
+		filter.id = "qunit-filter-pass";
+		filter.disabled = true;
+		addEvent( filter, "click", function() {
+			var li = document.getElementsByTagName("li");
+			for ( var i = 0; i < li.length; i++ ) {
+				if ( li[i].className.indexOf("pass") > -1 ) {
+					li[i].style.display = filter.checked ? "none" : "block";
+				}
+			}
+		});
+		toolbar.appendChild( filter );
+
+		var label = document.createElement("label");
+		label.setAttribute("for", "filter-pass");
+		label.innerHTML = "Hide passed tests";
+		toolbar.appendChild( label );
+
+		var missing = document.createElement("input");
+		missing.type = "checkbox";
+		missing.id = "qunit-filter-missing";
+		missing.disabled = true;
+		addEvent( missing, "click", function() {
+			var li = document.getElementsByTagName("li");
+			for ( var i = 0; i < li.length; i++ ) {
+				if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) {
+					li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block";
+				}
+			}
+		});
+		toolbar.appendChild( missing );
+
+		label = document.createElement("label");
+		label.setAttribute("for", "filter-missing");
+		label.innerHTML = "Hide missing tests (untested code is broken code)";
+		toolbar.appendChild( label );
+	}
+
+	var main = id('main');
+	if ( main ) {
+		config.fixture = main.innerHTML;
+	}
+
+	if ( window.jQuery ) {
+		config.ajaxSettings = window.jQuery.ajaxSettings;
+	}
+
+	QUnit.start();
+});
+
+function done() {
+	if ( config.doneTimer && window.clearTimeout ) {
+		window.clearTimeout( config.doneTimer );
+		config.doneTimer = null;
+	}
+
+	if ( config.queue.length ) {
+		config.doneTimer = window.setTimeout(function(){
+			if ( !config.queue.length ) {
+				done();
+			} else {
+				synchronize( done );
+			}
+		}, 13);
+
+		return;
+	}
+
+	config.autorun = true;
+
+	// Log the last module results
+	if ( config.currentModule ) {
+		QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
+	}
+
+	var banner = id("qunit-banner"),
+		tests = id("qunit-tests"),
+		html = ['Tests completed in ',
+		+new Date - config.started, ' milliseconds.<br/>',
+		'<span class="bad">', config.stats.all - config.stats.bad, '</span> tests of <span class="all">', config.stats.all, '</span> passed, ', config.stats.bad,' failed.'].join('');
+
+	if ( banner ) {
+		banner.className += " " + (config.stats.bad ? "fail" : "pass");
+	}
+
+	if ( tests ) {	
+		var result = id("qunit-testresult");
+
+		if ( !result ) {
+			result = document.createElement("p");
+			result.id = "qunit-testresult";
+			result.className = "result";
+			tests.parentNode.insertBefore( result, tests.nextSibling );
+		}
+
+		result.innerHTML = html;
+	}
+
+	QUnit.done( config.stats.bad, config.stats.all );
+}
+
+function validTest( name ) {
+	var i = config.filters.length,
+		run = false;
+
+	if ( !i ) {
+		return true;
+	}
+	
+	while ( i-- ) {
+		var filter = config.filters[i],
+			not = filter.charAt(0) == '!';
+
+		if ( not ) {
+			filter = filter.slice(1);
+		}
+
+		if ( name.indexOf(filter) !== -1 ) {
+			return !not;
+		}
+
+		if ( not ) {
+			run = true;
+		}
+	}
+
+	return run;
+}
+
+function push(result, actual, expected, message) {
+	message = message || (result ? "okay" : "failed");
+	QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) );
+}
+
+function synchronize( callback ) {
+	config.queue.push( callback );
+
+	if ( config.autorun && !config.blocking ) {
+		process();
+	}
+}
+
+function process() {
+	while ( config.queue.length && !config.blocking ) {
+		config.queue.shift()();
+	}
+}
+
+function saveGlobal() {
+	config.pollution = [];
+	
+	if ( config.noglobals ) {
+		for ( var key in window ) {
+			config.pollution.push( key );
+		}
+	}
+}
+
+function checkPollution( name ) {
+	var old = config.pollution;
+	saveGlobal();
+	
+	var newGlobals = diff( old, config.pollution );
+	if ( newGlobals.length > 0 ) {
+		ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
+		config.expected++;
+	}
+
+	var deletedGlobals = diff( config.pollution, old );
+	if ( deletedGlobals.length > 0 ) {
+		ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
+		config.expected++;
+	}
+}
+
+// returns a new Array with the elements that are in a but not in b
+function diff( a, b ) {
+	var result = a.slice();
+	for ( var i = 0; i < result.length; i++ ) {
+		for ( var j = 0; j < b.length; j++ ) {
+			if ( result[i] === b[j] ) {
+				result.splice(i, 1);
+				i--;
+				break;
+			}
+		}
+	}
+	return result;
+}
+
+function fail(message, exception, callback) {
+	if ( typeof console !== "undefined" && console.error && console.warn ) {
+		console.error(message);
+		console.error(exception);
+		console.warn(callback.toString());
+
+	} else if ( window.opera && opera.postError ) {
+		opera.postError(message, exception, callback.toString);
+	}
+}
+
+function extend(a, b) {
+	for ( var prop in b ) {
+		a[prop] = b[prop];
+	}
+
+	return a;
+}
+
+function addEvent(elem, type, fn) {
+	if ( elem.addEventListener ) {
+		elem.addEventListener( type, fn, false );
+	} else if ( elem.attachEvent ) {
+		elem.attachEvent( "on" + type, fn );
+	} else {
+		fn();
+	}
+}
+
+function id(name) {
+	return !!(typeof document !== "undefined" && document && document.getElementById) &&
+		document.getElementById( name );
+}
+
+// Test for equality any JavaScript type.
+// Discussions and reference: http://philrathe.com/articles/equiv
+// Test suites: http://philrathe.com/tests/equiv
+// Author: Philippe Rathé <pr...@gmail.com>
+QUnit.equiv = function () {
+
+    var innerEquiv; // the real equiv function
+    var callers = []; // stack to decide between skip/abort functions
+
+
+    // Determine what is o.
+    function hoozit(o) {
+        if (o.constructor === String) {
+            return "string";
+            
+        } else if (o.constructor === Boolean) {
+            return "boolean";
+
+        } else if (o.constructor === Number) {
+
+            if (isNaN(o)) {
+                return "nan";
+            } else {
+                return "number";
+            }
+
+        } else if (typeof o === "undefined") {
+            return "undefined";
+
+        // consider: typeof null === object
+        } else if (o === null) {
+            return "null";
+
+        // consider: typeof [] === object
+        } else if (o instanceof Array) {
+            return "array";
+        
+        // consider: typeof new Date() === object
+        } else if (o instanceof Date) {
+            return "date";
+
+        // consider: /./ instanceof Object;
+        //           /./ instanceof RegExp;
+        //          typeof /./ === "function"; // => false in IE and Opera,
+        //                                          true in FF and Safari
+        } else if (o instanceof RegExp) {
+            return "regexp";
+
+        } else if (typeof o === "object") {
+            return "object";
+
+        } else if (o instanceof Function) {
+            return "function";
+        } else {
+            return undefined;
+        }
+    }
+
+    // Call the o related callback with the given arguments.
+    function bindCallbacks(o, callbacks, args) {
+        var prop = hoozit(o);
+        if (prop) {
+            if (hoozit(callbacks[prop]) === "function") {
+                return callbacks[prop].apply(callbacks, args);
+            } else {
+                return callbacks[prop]; // or undefined
+            }
+        }
+    }
+    
+    var callbacks = function () {
+
+        // for string, boolean, number and null
+        function useStrictEquality(b, a) {
+            if (b instanceof a.constructor || a instanceof b.constructor) {
+                // to catch short annotaion VS 'new' annotation of a declaration
+                // e.g. var i = 1;
+                //      var j = new Number(1);
+                return a == b;
+            } else {
+                return a === b;
+            }
+        }
+
+        return {
+            "string": useStrictEquality,
+            "boolean": useStrictEquality,
+            "number": useStrictEquality,
+            "null": useStrictEquality,
+            "undefined": useStrictEquality,
+
+            "nan": function (b) {
+                return isNaN(b);
+            },
+
+            "date": function (b, a) {
+                return hoozit(b) === "date" && a.valueOf() === b.valueOf();
+            },
+
+            "regexp": function (b, a) {
+                return hoozit(b) === "regexp" &&
+                    a.source === b.source && // the regex itself
+                    a.global === b.global && // and its modifers (gmi) ...
+                    a.ignoreCase === b.ignoreCase &&
+                    a.multiline === b.multiline;
+            },
+
+            // - skip when the property is a method of an instance (OOP)
+            // - abort otherwise,
+            //   initial === would have catch identical references anyway
+            "function": function () {
+                var caller = callers[callers.length - 1];
+                return caller !== Object &&
+                        typeof caller !== "undefined";
+            },
+
+            "array": function (b, a) {
+                var i;
+                var len;
+
+                // b could be an object literal here
+                if ( ! (hoozit(b) === "array")) {
+                    return false;
+                }
+
+                len = a.length;
+                if (len !== b.length) { // safe and faster
+                    return false;
+                }
+                for (i = 0; i < len; i++) {
+                    if ( ! innerEquiv(a[i], b[i])) {
+                        return false;
+                    }
+                }
+                return true;
+            },
+
+            "object": function (b, a) {
+                var i;
+                var eq = true; // unless we can proove it
+                var aProperties = [], bProperties = []; // collection of strings
+
+                // comparing constructors is more strict than using instanceof
+                if ( a.constructor !== b.constructor) {
+                    return false;
+                }
+
+                // stack constructor before traversing properties
+                callers.push(a.constructor);
+
+                for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
+
+                    aProperties.push(i); // collect a's properties
+
+                    if ( ! innerEquiv(a[i], b[i])) {
+                        eq = false;
+                    }
+                }
+
+                callers.pop(); // unstack, we are done
+
+                for (i in b) {
+                    bProperties.push(i); // collect b's properties
+                }
+
+                // Ensures identical properties name
+                return eq && innerEquiv(aProperties.sort(), bProperties.sort());
+            }
+        };
+    }();
+
+    innerEquiv = function () { // can take multiple arguments
+        var args = Array.prototype.slice.apply(arguments);
+        if (args.length < 2) {
+            return true; // end transition
+        }
+
+        return (function (a, b) {
+            if (a === b) {
+                return true; // catch the most you can
+            } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) {
+                return false; // don't lose time with error prone cases
+            } else {
+                return bindCallbacks(a, callbacks, [b, a]);
+            }
+
+        // apply transition with (1..n) arguments
+        })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
+    };
+
+    return innerEquiv;
+
+}();
+
+/**
+ * jsDump
+ * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
+ * Date: 5/15/2008
+ * @projectDescription Advanced and extensible data dumping for Javascript.
+ * @version 1.0.0
+ * @author Ariel Flesler
+ * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
+ */
+QUnit.jsDump = (function() {
+	function quote( str ) {
+		return '"' + str.toString().replace(/"/g, '\\"') + '"';
+	};
+	function literal( o ) {
+		return o + '';	
+	};
+	function join( pre, arr, post ) {
+		var s = jsDump.separator(),
+			base = jsDump.indent(),
+			inner = jsDump.indent(1);
+		if ( arr.join )
+			arr = arr.join( ',' + s + inner );
+		if ( !arr )
+			return pre + post;
+		return [ pre, inner + arr, base + post ].join(s);
+	};
+	function array( arr ) {
+		var i = arr.length,	ret = Array(i);					
+		this.up();
+		while ( i-- )
+			ret[i] = this.parse( arr[i] );				
+		this.down();
+		return join( '[', ret, ']' );
+	};
+	
+	var reName = /^function (\w+)/;
+	
+	var jsDump = {
+		parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
+			var	parser = this.parsers[ type || this.typeOf(obj) ];
+			type = typeof parser;			
+			
+			return type == 'function' ? parser.call( this, obj ) :
+				   type == 'string' ? parser :
+				   this.parsers.error;
+		},
+		typeOf:function( obj ) {
+			var type = typeof obj,
+				f = 'function';//we'll use it 3 times, save it
+			return type != 'object' && type != f ? type :
+				!obj ? 'null' :
+				obj.exec ? 'regexp' :// some browsers (FF) consider regexps functions
+				obj.getHours ? 'date' :
+				obj.scrollBy ?  'window' :
+				obj.nodeName == '#document' ? 'document' :
+				obj.nodeName ? 'node' :
+				obj.item ? 'nodelist' : // Safari reports nodelists as functions
+				obj.callee ? 'arguments' :
+				obj.call || obj.constructor != Array && //an array would also fall on this hack
+					(obj+'').indexOf(f) != -1 ? f : //IE reports functions like alert, as objects
+				'length' in obj ? 'array' :
+				type;
+		},
+		separator:function() {
+			return this.multiline ?	this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
+		},
+		indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
+			if ( !this.multiline )
+				return '';
+			var chr = this.indentChar;
+			if ( this.HTML )
+				chr = chr.replace(/\t/g,'   ').replace(/ /g,'&nbsp;');
+			return Array( this._depth_ + (extra||0) ).join(chr);
+		},
+		up:function( a ) {
+			this._depth_ += a || 1;
+		},
+		down:function( a ) {
+			this._depth_ -= a || 1;
+		},
+		setParser:function( name, parser ) {
+			this.parsers[name] = parser;
+		},
+		// The next 3 are exposed so you can use them
+		quote:quote, 
+		literal:literal,
+		join:join,
+		//
+		_depth_: 1,
+		// This is the list of parsers, to modify them, use jsDump.setParser
+		parsers:{
+			window: '[Window]',
+			document: '[Document]',
+			error:'[ERROR]', //when no parser is found, shouldn't happen
+			unknown: '[Unknown]',
+			'null':'null',
+			undefined:'undefined',
+			'function':function( fn ) {
+				var ret = 'function',
+					name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
+				if ( name )
+					ret += ' ' + name;
+				ret += '(';
+				
+				ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join('');
+				return join( ret, this.parse(fn,'functionCode'), '}' );
+			},
+			array: array,
+			nodelist: array,
+			arguments: array,
+			object:function( map ) {
+				var ret = [ ];
+				this.up();
+				for ( var key in map )
+					ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) );
+				this.down();
+				return join( '{', ret, '}' );
+			},
+			node:function( node ) {
+				var open = this.HTML ? '&lt;' : '<',
+					close = this.HTML ? '&gt;' : '>';
+					
+				var tag = node.nodeName.toLowerCase(),
+					ret = open + tag;
+					
+				for ( var a in this.DOMAttrs ) {
+					var val = node[this.DOMAttrs[a]];
+					if ( val )
+						ret += ' ' + a + '=' + this.parse( val, 'attribute' );
+				}
+				return ret + close + open + '/' + tag + close;
+			},
+			functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
+				var l = fn.length;
+				if ( !l ) return '';				
+				
+				var args = Array(l);
+				while ( l-- )
+					args[l] = String.fromCharCode(97+l);//97 is 'a'
+				return ' ' + args.join(', ') + ' ';
+			},
+			key:quote, //object calls it internally, the key part of an item in a map
+			functionCode:'[code]', //function calls it internally, it's the content of the function
+			attribute:quote, //node calls it internally, it's an html attribute value
+			string:quote,
+			date:quote,
+			regexp:literal, //regex
+			number:literal,
+			'boolean':literal
+		},
+		DOMAttrs:{//attributes to dump from nodes, name=>realName
+			id:'id',
+			name:'name',
+			'class':'className'
+		},
+		HTML:true,//if true, entities are escaped ( <, >, \t, space and \n )
+		indentChar:'   ',//indentation unit
+		multiline:true //if true, items in a collection, are separated by a \n, else just a space.
+	};
+
+	return jsDump;
+})();
+
+})(this);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/Jakefile
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/Jakefile b/lib/cordova-blackberry/blackberry10/node_modules/jake/Jakefile
new file mode 100644
index 0000000..b7725cd
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/Jakefile
@@ -0,0 +1,43 @@
+var fs = require('fs')
+  , path = require('path');
+
+var t = new jake.TestTask('Jake', function () {
+  this.testFiles.include('test/*.js');
+  this.testFiles.exclude('test/helpers.js');
+});
+
+namespace('doc', function () {
+  task('generate', ['doc:clobber'], function () {
+    var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' +
+        '-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib';
+    jake.logger.log('Generating docs ...');
+    jake.exec([cmd], function () {
+      jake.logger.log('Done.');
+      complete();
+    });
+  }, {async: true});
+
+  task('clobber', function () {
+    var cmd = 'rm -fr ./doc/*';
+    jake.exec([cmd], function () {
+      jake.logger.log('Clobbered old docs.');
+      complete();
+    });
+  }, {async: true});
+
+});
+
+desc('Generate docs for Jake');
+task('doc', ['doc:generate']);
+
+var p = new jake.NpmPublishTask('jake', [
+  'Makefile'
+, 'Jakefile'
+, 'README.md'
+, 'package.json'
+, 'lib/**'
+, 'bin/**'
+, 'test/**'
+]);
+
+


[19/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/native-packager.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/native-packager.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/native-packager.js
new file mode 100644
index 0000000..a4ab63e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/native-packager.js
@@ -0,0 +1,347 @@
+var path = require("path"),
+    util = require("util"),
+    fs = require("fs"),
+    childProcess = require("child_process"),
+    wrench = require("wrench"),
+    srcPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    nativePkgr = require(srcPath + "/native-packager"),
+    pkgrUtils = require(srcPath + "/packager-utils"),
+    testUtils = require("./test-utilities"),
+    testData = require("./test-data"),
+    logger = require(srcPath + "logger"),
+    localize = require(srcPath + "/localize"),
+    conf = require(srcPath + "./conf"),
+    callback,
+    config,
+    session,
+    target,
+    result,
+    orgDebugEnabled,
+    orgDebugTokenPath,
+    NL = pkgrUtils.isWindows() ? "\r\n" : "\n";
+
+describe("Native packager", function () {
+    beforeEach(function () {
+        callback = jasmine.createSpy();
+        config = testData.config;
+        session = testData.session;
+        target = session.targets[0];
+        result = {
+            stdout: {
+                on: jasmine.createSpy()
+            },
+            stderr: {
+                on: jasmine.createSpy()
+            },
+            on: function (eventName, callback) {
+                callback(0);
+            }
+        };
+
+        // Store original debug token setting and later restore them in afterEach
+        // to be able to test positive and negative cases of each.
+        orgDebugEnabled = session.debug;
+        orgDebugTokenPath = session.conf.DEBUG_TOKEN;
+
+        spyOn(wrench, "readdirSyncRecursive").andReturn(["abc", "xyz"]);
+        spyOn(fs, "statSync").andReturn({
+            isDirectory: function () {
+                return false;
+            }
+        });
+        spyOn(fs, "writeFileSync");
+        spyOn(childProcess, "spawn").andReturn(result);
+        spyOn(fs, "existsSync").andCallFake(function (path) {
+            //Return true if this is the bbndk folder check
+            return path.indexOf("bbndk") !== -1;
+        });
+    });
+
+    afterEach(function () {
+        session.debug = orgDebugEnabled;
+        session.conf.DEBUG_TOKEN = orgDebugTokenPath;
+    });
+
+    it("should not display empty messages in logger", function () {
+        spyOn(pkgrUtils, "writeFile");
+        spyOn(logger, "warn");
+        spyOn(logger, "error");
+        spyOn(logger, "info");
+
+        nativePkgr.exec(session, target, testData.config, callback);
+
+        expect(logger.warn).not.toHaveBeenCalledWith("");
+        expect(logger.error).not.toHaveBeenCalledWith("");
+        expect(logger.info).not.toHaveBeenCalledWith("");
+    });
+
+    it("shows debug token warning when path to file is not valid", function () {
+        spyOn(pkgrUtils, "writeFile");
+        spyOn(logger, "warn");
+
+        session.debug = true;
+        //Current time will ensure that the file doesn't exist.
+        session.conf.DEBUG_TOKEN = new Date().getTime() + ".bar";
+
+        nativePkgr.exec(session, target, testData.config, callback);
+
+        expect(logger.warn).toHaveBeenCalledWith(localize.translate("EXCEPTION_DEBUG_TOKEN_NOT_FOUND"));
+    });
+
+    it("won't show debug token warning when -d options wasn't provided", function () {
+        spyOn(pkgrUtils, "writeFile");
+        spyOn(logger, "warn");
+
+        session.debug = false;
+        //Current time will ensure that the file doesn't exist.
+        session.conf.DEBUG_TOKEN = new Date().getTime() + ".bar";
+
+        nativePkgr.exec(session, target, testData.config, callback);
+
+        expect(logger.warn).not.toHaveBeenCalled();
+    });
+
+    it("shows debug token warning when debug token not a .bar file", function () {
+        spyOn(pkgrUtils, "writeFile");
+        spyOn(logger, "warn");
+
+        session.debug = true;
+        //Current time will ensure that the file doesn't exist.
+        session.conf.DEBUG_TOKEN = new Date().getTime() + ".xyz";
+
+        nativePkgr.exec(session, target, testData.config, callback);
+        expect(logger.warn).toHaveBeenCalledWith(localize.translate("EXCEPTION_DEBUG_TOKEN_WRONG_FILE_EXTENSION"));
+    });
+
+    it("exec blackberry-nativepackager", function () {
+        var bbTabletXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+            "<qnx><id>" + config.id + "</id>" +
+            "<versionNumber>" + config.version + "</versionNumber>" +
+            "<author>" + config.author + "</author>" +
+            "<asset entry=\"true\" type=\"qnx/elf\">wwe</asset>" +
+            "<asset>abc</asset>" +
+            "<asset>xyz</asset>" +
+            "<entryPointType>Qnx/WebKit</entryPointType>" +
+            "<cascadesTheme>" + config.theme + "</cascadesTheme>" +
+            "<initialWindow><systemChrome>none</systemChrome><transparent>true</transparent><autoOrients>true</autoOrients></initialWindow>",
+            bbTabletXML2 = "<permission system=\"true\">run_native</permission>" +
+            "<permission system=\"false\">access_internet</permission>" +
+            "<name>" + config.name['default'] + "</name>" +
+            "<description>" + config.description['default'] + "</description></qnx>",
+            cmd = path.normalize(session.conf.DEPENDENCIES_TOOLS + "/bin/blackberry-nativepackager" + (pkgrUtils.isWindows() ? ".bat" : ""));
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (sourceDir, outputDir, data) {
+            expect(sourceDir).toEqual(session.sourceDir);
+            expect(outputDir).toEqual(conf.BAR_DESCRIPTOR);
+
+            //We have to validate the xml data in 2 chucks, because the WEBWORKS_VERSION env variable
+            //has a different value for SCM builds and we can't mock the webworks-info file
+            expect(data).toContain(bbTabletXML);
+            expect(data).toContain(bbTabletXML2);
+        });
+        nativePkgr.exec(session, target, testData.config, callback);
+
+        expect(fs.writeFileSync).toHaveBeenCalledWith(jasmine.any(String), jasmine.any(String));
+        expect(childProcess.spawn).toHaveBeenCalledWith(cmd, ["@options"], {"cwd": session.sourceDir, "env": process.env});
+        expect(callback).toHaveBeenCalledWith(0);
+    });
+
+    it("makes sure slog2 logging is enabled in debug mode", function () {
+        var tabletXMLEntry = "<env value=\"slog2\" var=\"CONSOLE_MODE\"></env>";
+
+        //Silence the logger during unit tests
+        spyOn(logger, "warn").andCallFake(function () { });
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (sourceDir, outputDir, data) {
+            expect(data).toContain(tabletXMLEntry);
+        });
+
+        session.debug = true;
+        nativePkgr.exec(session, target, testData.config, callback);
+    });
+
+    it("makes sure slog2 logging is not enabled when not in debug mode", function () {
+        var tabletXMLEntry = "<env value=\"slog2\" var=\"CONSOLE_MODE\"></env>";
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (sourceDir, outputDir, data) {
+            expect(data).not.toContain(tabletXMLEntry);
+        });
+
+        session.debug = false;
+        nativePkgr.exec(session, target, testData.config, callback);
+    });
+
+    it("can process application name", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.name = {"default": "API Smoke Test"};
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain("<name>API Smoke Test</name>");
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+
+    });
+
+    it("can process localized application name", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.name = {"FR": "API Smoke Test - FR"};
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain('<name><text xml:lang="FR">API Smoke Test - FR</text></name>');
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+    });
+
+    it("can process mutiple application names", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.name = {
+            "default": "API Smoke Test",
+            "EN": "API Smoke Test - EN",
+            "FR": "API Smoke Test - FR"
+        };
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain('<name>API Smoke Test<text xml:lang="EN">API Smoke Test - EN</text><text xml:lang="FR">API Smoke Test - FR</text></name>');
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+    });
+
+    it("can process application description", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.description = {"default": "My app description"};
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain("<description>My app description</description>");
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+
+    });
+
+    it("can process localized application description", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.description = {"FR": "My app description - FR"};
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain('<description><text xml:lang="FR">My app description - FR</text></description>');
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+    });
+
+    it("can process mutiple application descriptions", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.description = {
+            "default": "My app description",
+            "EN": "My app description - EN",
+            "FR": "My app description - FR"
+        };
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain('<description>My app description<text xml:lang="EN">My app description - EN</text><text xml:lang="FR">My app description - FR</text></description>');
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+    });
+
+    it("can process permissions with no attributes", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.permissions = ['read_device_identifying_information'];
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain("<permission>read_device_identifying_information</permission>");
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+
+    });
+
+    it("can process permissions with attributes", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.permissions = [{ '#': 'systemPerm', '@': {"system": "true"}}];
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain("<permission system=\"true\">systemPerm</permission>");
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+
+    });
+
+    it("adds the mandatory permissions for webworks", function () {
+        var config = testUtils.cloneObj(testData.config);
+        config.permissions = [];
+
+        spyOn(pkgrUtils, "writeFile").andCallFake(function (fileLocation, fileName, fileData) {
+            expect(fileData).toContain("<permission system=\"false\">access_internet</permission>");
+            expect(fileData).toContain("<permission system=\"true\">run_native</permission>");
+        });
+
+        nativePkgr.exec(session, target, config, callback);
+
+    });
+
+    it("omits -devMode when signing and specifying -d", function () {
+        testUtils.mockResolve(path);
+        spyOn(pkgrUtils, "writeFile");
+
+        var session = testUtils.cloneObj(testData.session),
+            config = testUtils.cloneObj(testData.config),
+            target = "device",
+            optionsFile = "-package" + NL +
+                "-buildId" + NL +
+                "100" + NL +
+                path.normalize("c:/device/Demo.bar") + NL +
+                "-barVersion" + NL +
+                "1.5" + NL +
+                "-C" + NL +
+                path.normalize("c:/src/") + NL +
+                conf.BAR_DESCRIPTOR + NL +
+                path.normalize("c:/src/abc") + NL +
+                path.normalize("c:/src/xyz") + NL;
+
+        //Set signing params [-g --buildId]
+        session.keystore = path.normalize("c:/author.p12");
+        session.storepass = "password";
+        config.buildId = "100";
+
+        session.barPath = path.normalize("c:/%s/" + "Demo.bar");
+        session.sourceDir = path.normalize("c:/src/");
+        session.isSigningRequired = function () {
+            return true;
+        };
+
+        //Set -d param
+        session.debug = "";
+
+        nativePkgr.exec(session, target, config, callback);
+
+        //options file should NOT contain -devMode
+        expect(fs.writeFileSync).toHaveBeenCalledWith(jasmine.any(String), optionsFile);
+    });
+
+    it("exec blackberry-nativepackager with additional params", function () {
+        var cmd = path.normalize(session.conf.DEPENDENCIES_TOOLS + "/bin/blackberry-nativepackager" + (pkgrUtils.isWindows() ? ".bat" : ""));
+        spyOn(pkgrUtils, "writeFile");
+
+        session.getParams = jasmine.createSpy("session getParams").andReturn({
+            "-installApp": "",
+            "-device": "192.168.1.114",
+            "-password": "abc"
+        });
+
+        nativePkgr.exec(session, "simulator", testData.config, callback);
+
+        expect(fs.writeFileSync.mostRecentCall.args[0]).toBe(path.resolve(session.sourceDir, "options"));
+        expect(fs.writeFileSync.mostRecentCall.args[1]).toContain("-package" + NL);
+        expect(fs.writeFileSync.mostRecentCall.args[1]).toContain("-password" + NL);
+        expect(fs.writeFileSync.mostRecentCall.args[1]).toContain("abc" + NL);
+        expect(fs.writeFileSync.mostRecentCall.args[1]).toContain("-device" + NL);
+        expect(fs.writeFileSync.mostRecentCall.args[1]).toContain("192.168.1.114" + NL);
+        expect(fs.writeFileSync.mostRecentCall.args[1]).toContain("-installApp" + NL);
+        expect(childProcess.spawn).toHaveBeenCalledWith(cmd, ["@options"], {"cwd": session.sourceDir, "env": process.env});
+        expect(callback).toHaveBeenCalledWith(0);
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-utils.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-utils.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-utils.js
new file mode 100644
index 0000000..5acad8e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-utils.js
@@ -0,0 +1,65 @@
+var testData = require("./test-data"),
+    utils = require(testData.libPath + "/packager-utils"),
+    fs = require("fs"),
+    path = require("path"),
+    asciiFile = path.resolve("bin/test/cordova/unit/data/ascii_text.txt"),
+    utf8File = path.resolve("bin/test/cordova/unit/data/utf8_text.txt"),
+    ucs2beFile = path.resolve("bin/test/cordova/unit/data/ucs2be_text.txt"),
+    ucs2leFile = path.resolve("bin/test/cordova/unit/data/ucs2le_text.txt"),
+    helloWorld = "Hello World";
+
+describe("Encoded Buffer data to String", function () {
+    it("Ascii text to String", function () {
+        // Read text file encoded in ascii
+        var fileData = fs.readFileSync(asciiFile);
+        expect(utils.bufferToString(fileData)).toEqual(helloWorld);
+    });
+
+    it("Utf8 text to String", function () {
+        // Read text file encoded in utf8
+        var fileData = fs.readFileSync(utf8File);
+        expect(utils.bufferToString(fileData)).toEqual(helloWorld);
+    });
+
+    it("Ucs2BE text to String", function () {
+        // Read text file encoded in 2 byte Unicode big endian
+        var fileData = fs.readFileSync(ucs2beFile);
+        expect(utils.bufferToString(fileData)).toEqual(helloWorld);
+    });
+
+    it("Ucs2LE text to String", function () {
+        // Read text file encoded in 2 byte Unicode little endian
+        var fileData = fs.readFileSync(ucs2leFile);
+        expect(utils.bufferToString(fileData)).toEqual(helloWorld);
+    });
+});
+
+describe("property wrapper", function () {
+    it("wraps a property of an object in an array", function () {
+        var obj = {
+            prop: "value"
+        };
+
+        utils.wrapPropertyInArray(obj, "prop");
+        expect(obj.prop[0]).toEqual("value");
+    });
+
+    it("does not wrap an array object in an array", function () {
+        var obj = {
+            prop: ["value"]
+        };
+
+        utils.wrapPropertyInArray(obj, "prop");
+        expect(obj.prop[0][0]).not.toEqual("value");
+        expect(obj.prop[0]).toEqual("value");
+    });
+
+    it("does not wrap a property that doesn't esist in the object", function () {
+        var obj = {
+            prop: "value"
+        };
+
+        utils.wrapPropertyInArray(obj, "secondValue");
+        expect(obj.secondValue).not.toBeDefined();
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
new file mode 100644
index 0000000..b6ecf4c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
@@ -0,0 +1,277 @@
+var srcPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    testData = require("./test-data"),
+    testUtilities = require("./test-utilities"),
+    localize = require(srcPath + "localize"),
+    logger = require(srcPath + "logger"),
+    packagerValidator = require(srcPath + "packager-validator"),
+    fs = require("fs"),
+    cmd,
+    extManager = {
+        getExtensionBasenameByFeatureId: function (featureId) {
+            if (featureId && featureId.indexOf("blackberry.") >= 0) {
+                return featureId.substring(featureId.indexOf(".") + 1);
+            } else {
+                return null;
+            }
+        }
+    };
+
+describe("Packager Validator", function () {
+    it("throws an exception when -g set and keys were not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = undefined;
+        session.storepass = "myPassword";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", "author.p12"));
+    });
+
+    it("throws an exception when --buildId set and keys were not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = undefined;
+        session.buildId = "100";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", "author.p12"));
+    });
+
+    it("throws an exception when -g set and barsigner.csk was not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = undefined;
+        session.storepass = "myPassword";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", "barsigner.csk"));
+    });
+
+    it("throws an exception when --buildId set and barsigner.csk was not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = undefined;
+        session.buildId = "100";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", "barsigner.csk"));
+    });
+
+    it("throws an exception when -g set and barsigner.db was not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = "c:/barsigner.csk";
+        session.keystoreDb = undefined;
+        session.storepass = "myPassword";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", "barsigner.db"));
+    });
+
+    it("throws an exception when --buildId set and barsigner.db was not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = "c:/barsigner.csk";
+        session.keystoreDb = undefined;
+        session.buildId = "100";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", "barsigner.db"));
+    });
+
+    it("generated a warning when Build ID is set in config and keys were not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //Mock the logger
+        spyOn(logger, "warn");
+
+        //setup signing parameters
+        session.keystore = undefined;
+        session.buildId = undefined;
+        configObj.buildId = "100";
+
+        packagerValidator.validateSession(session, configObj);
+        expect(logger.warn).toHaveBeenCalledWith(localize.translate("WARNING_MISSING_SIGNING_KEY_FILE", "author.p12"));
+    });
+
+    it("generated a warning when Build ID is set in config and barsigner.csk was not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //Mock the logger
+        spyOn(logger, "warn");
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = undefined;
+        session.buildId = undefined;
+        configObj.buildId = "100";
+
+        packagerValidator.validateSession(session, configObj);
+        expect(logger.warn).toHaveBeenCalledWith(localize.translate("WARNING_MISSING_SIGNING_KEY_FILE", "barsigner.csk"));
+    });
+
+    it("generated a warning when Build ID is set in config and barsigner.db was not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //Mock the logger
+        spyOn(logger, "warn");
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = "c:/barsigner.csk";
+        session.keystoreDb = undefined;
+        session.buildId = undefined;
+        configObj.buildId = "100";
+
+        packagerValidator.validateSession(session, configObj);
+        expect(logger.warn).toHaveBeenCalledWith(localize.translate("WARNING_MISSING_SIGNING_KEY_FILE", "barsigner.db"));
+    });
+
+    it("throws an exception when appdesc was not found", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup appdesc which is not existing
+        session.buildId = undefined;
+        configObj.buildId = undefined;
+        session.appdesc = "c:/bardescriptor.xml";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_APPDESC_NOT_FOUND", "c:/bardescriptor.xml"));
+    });
+
+    it("throws an exception when a password [-g] was set with no buildId", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = "c:/barsigner.csk";
+        session.keystoreDb = "c:/barsigner.db";
+        session.storepass = "myPassword";
+        configObj.buildId = undefined;
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_BUILDID"));
+    });
+
+    it("throws an exception when --buildId was set with no password [-g]", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.keystoreCsk = "c:/barsigner.csk";
+        session.keystoreDb = "c:/barsigner.db";
+        session.storepass = undefined;
+        session.buildId = "100";
+
+        expect(function () {
+            packagerValidator.validateSession(session, configObj);
+        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD"));
+    });
+
+    it("generates a warning when the config contains a build id and no password was provided[-g]", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = testUtilities.cloneObj(testData.config);
+
+        //setup signing parameters
+        session.keystore = "c:/author.p12";
+        session.storepass = undefined;
+        session.buildId = undefined;
+        configObj.buildId = "100";
+
+        //Mock the logger
+        spyOn(logger, "warn");
+
+        packagerValidator.validateSession(session, configObj);
+        expect(logger.warn).toHaveBeenCalledWith(localize.translate("WARNING_SIGNING_PASSWORD_EXPECTED"));
+    });
+});
+
+describe("Packager Validator: validateConfig", function () {
+    it("does not remove APIs that do exist from features whitelist", function () {
+        var session = testUtilities.cloneObj(testData.session),
+            configObj = {
+                accessList: [{
+                    features: [{
+                        id: "blackberry.identity",
+                        required: true,
+                        version: "1.0.0.0"
+                    }, {
+                        version: "1.0.0.0",
+                        required: true,
+                        id: "blackberry.event"
+                    }],
+                    uri: "WIDGET_LOCAL",
+                    allowSubDomain: true
+                }]
+            };
+
+        spyOn(fs, "existsSync").andCallFake(function () {
+            //since both of these APIs exist, existsSync would return true
+            return true;
+        });
+
+        packagerValidator.validateConfig(session, configObj, extManager);
+        expect(configObj.accessList[0].features.length).toEqual(2);
+
+
+    });
+
+    it("does not crash if user whitelists a feature with no id", function () {
+        var session = testUtilities.cloneObj(testData.session),
+        configObj = {
+            accessList: [{
+                features: [{
+                    id: "blackberry.identity",
+                    required: true,
+                    version: "1.0.0.0"
+                }, {
+                    version: "1.0.0.0",
+                    required: true,
+                }],
+                uri: "WIDGET_LOCAL",
+                allowSubDomain: true
+            }]
+        };
+        spyOn(logger, "warn");
+
+        spyOn(fs, "existsSync").andCallFake(function () {
+            //since both of these APIs exist, existsSync would return true
+            return true;
+        });
+
+        expect(function () {
+            packagerValidator.validateConfig(session, configObj, extManager);
+        }).not.toThrow();
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/session.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/session.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/session.js
new file mode 100644
index 0000000..bbf6eb3
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/session.js
@@ -0,0 +1,209 @@
+var session = require(__dirname + "/../../../../../templates/project/cordova/lib/session"),
+    localize = require(__dirname + "/../../../../../templates/project/cordova/lib/localize"),
+    testUtils = require("./test-utilities"),
+    path = require("path"),
+    fs = require("fs"),
+    wrench = require("wrench"),
+    zipLocation = __dirname + "/../../config.xml";
+
+describe("Session", function () {
+    beforeEach(function () {
+        //Do not create the source folder
+        spyOn(wrench, "mkdirSyncRecursive");
+    });
+
+    it("sets the source directory correctly when specified [-s C:/sampleApp/mySource]", function () {
+        testUtils.mockResolve(path);
+
+        var data = {
+            args: [ 'C:/sampleApp/sample.zip' ],
+            output: 'C:/sampleApp/bin',
+            source: 'C:/sampleApp/mySource'//equivalent to [-s C:/sampleApp/mySource]
+        },
+        result = session.initialize(data);
+
+        expect(result.sourceDir).toEqual(path.normalize("C:/sampleApp/mySource/src"));
+    });
+
+    it("sets the source directory correctly when unspecified [-s] and output path set [-o]", function () {
+        testUtils.mockResolve(path);
+
+        var data = {
+            args: [ 'C:/sampleApp/sample.zip' ],
+            output: 'C:/sampleApp/bin',
+            source: true//equivalent to [-s]
+        },
+        result = session.initialize(data);
+
+        //src folder should be created in output directory
+        expect(result.sourceDir).toEqual(path.normalize("C:/sampleApp/bin/src"));
+    });
+
+    it("sets the source directory correctly when unspecified [-s] and no output path is set", function () {
+        testUtils.mockResolve(path);
+
+        var data = {
+            args: [ zipLocation ],
+            source: true//equivalent to [-s]
+        },
+        result = session.initialize(data);
+
+        //src folder should be created in output directory
+        expect(result.sourceDir).toEqual(path.join(path.dirname(zipLocation), "src"));
+    });
+
+    it("sets the password when specified using -g", function () {
+        var data = {
+            args: [ 'C:/sampleApp/sample.zip' ],
+            output: 'C:/sampleApp/bin',
+            source: 'C:/sampleApp/mySource',//equivalent to [-s C:/sampleApp/mySource]
+            password: 'myPassword'
+        },
+        result = session.initialize(data);
+        expect(result.storepass).toEqual('myPassword');
+    });
+
+    it("does not set the password when not a string", function () {
+        //Commander somtimes improperly sets password to a function, when no value provided
+        var data = {
+            args: [ 'C:/sampleApp/sample.zip' ],
+            output: 'C:/sampleApp/bin',
+            source: 'C:/sampleApp/mySource',//equivalent to [-s C:/sampleApp/mySource]
+            password: function () {}
+        },
+        result = session.initialize(data);
+        expect(result.storepass).toBeUndefined();
+    });
+
+    it("sets the buildId when specified [-buildId]", function () {
+        var data = {
+            args: [ 'C:/sampleApp/sample.zip' ],
+            output: 'C:/sampleApp/bin',
+            source: 'C:/sampleApp/mySource',//equivalent to [-s C:/sampleApp/mySource]
+            buildId: '100'
+        },
+        result = session.initialize(data);
+        expect(result.buildId).toEqual('100');
+    });
+
+    it("sets the appdesc correctly when specified [--appdesc C:/path/bardescriptor.xml]", function () {
+        testUtils.mockResolve(path);
+
+        var data = {
+            args: [ 'C:/sampleApp/sample.zip' ],
+            appdesc: 'C:/path/bardescriptor.xml' //equivalent to [--appdesc C:/path/bardescriptor.xml]
+        },
+        result = session.initialize(data);
+
+        expect(result.appdesc).toEqual(path.normalize("C:/path/bardescriptor.xml"));
+    });
+
+    it("sets the appdesc correctly when not specified", function () {
+        testUtils.mockResolve(path);
+
+        var data = {
+            args: [ 'C:/sampleApp/sample.zip' ]
+        },
+        result = session.initialize(data);
+
+        expect(result.appdesc).toBeUndefined();
+    });
+
+    it("sets the output directory correctly when specified with a relative path [-o myOutput]", function () {
+        var bbwpDir = __dirname + "/../../../../../../",
+        data = {
+            args: [ 'C:/sampleApp/sample.zip' ],
+            output: 'myOutput',
+        },
+        result = session.initialize(data);
+
+        //output should be set to bbwp location + outputFolder
+        expect(result.outputDir).toEqual(path.normalize(path.join(bbwpDir, "myOutput")));
+    });
+
+    describe("get params", function () {
+        beforeEach(function () {
+            delete require.cache[require.resolve(__dirname + "/../../../../../templates/project/cordova/lib/session")];
+            session = require(__dirname + "/../../../../../templates/project/cordova/lib/session");
+        });
+
+        it("get params from external file", function () {
+            var data = {
+                    args: [ 'C:/sampleApp/sample.zip' ],
+                    params: "params.json"
+                },
+                result;
+
+            spyOn(path, "resolve").andReturn("bin/test/cordova/unit/params.json");
+            spyOn(fs, "existsSync").andReturn(true);
+
+            result = session.initialize(data);
+
+            expect(result.getParams("blackberry-signer")).toEqual({
+                "-proxyhost": "abc.com",
+                "-proxyport": "80"
+            });
+        });
+
+        it("get params from non-existent file should throw error", function () {
+            var data = {
+                    args: [ 'C:/sampleApp/sample.zip' ],
+                    params: "blah.json"
+                },
+                result;
+
+            spyOn(fs, "existsSync").andReturn(false);
+
+            result = session.initialize(data);
+
+            expect(function () {
+                result.getParams("blackberry-signer");
+            }).toThrow(localize.translate("EXCEPTION_PARAMS_FILE_NOT_FOUND", path.resolve("blah.json")));
+        });
+
+        it("get params from bad JSON file should throw error", function () {
+            var data = {
+                    args: [ 'C:/sampleApp/sample.zip' ],
+                    params: "params-bad.json"
+                },
+                result;
+
+            spyOn(path, "resolve").andReturn("test/params-bad.json");
+            spyOn(fs, "existsSync").andReturn(true);
+
+            result = session.initialize(data);
+
+            expect(function () {
+                result.getParams("blackberry-signer");
+            }).toThrow(localize.translate("EXCEPTION_PARAMS_FILE_ERROR", path.resolve("blah.json")));
+        });
+    });
+
+    describe("when setting the log level", function () {
+        var logger = require(__dirname + "/../../../../../templates/project/cordova/lib/logger");
+
+        beforeEach(function () {
+            spyOn(logger, "level");
+        });
+
+        it("defaults to verbose with no args", function () {
+            session.initialize({args: []});
+            expect(logger.level).toHaveBeenCalledWith("verbose");
+        });
+
+        it("sets level to verbose", function () {
+            session.initialize({args: [], loglevel: 'verbose'});
+            expect(logger.level).toHaveBeenCalledWith("verbose");
+        });
+
+        it("sets level to warn", function () {
+            session.initialize({args: [], loglevel: 'warn'});
+            expect(logger.level).toHaveBeenCalledWith("warn");
+        });
+
+        it("sets level to error", function () {
+            session.initialize({args: [], loglevel: 'error'});
+            expect(logger.level).toHaveBeenCalledWith("error");
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/signing-helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/signing-helper.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/signing-helper.js
new file mode 100644
index 0000000..ad91726
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/signing-helper.js
@@ -0,0 +1,420 @@
+var testData = require('./test-data'),
+    signingHelper = require(testData.libPath + '/signing-helper'),
+    localize = require(testData.libPath + '/localize'),
+    pkgrUtils = require(testData.libPath + "/packager-utils"),
+    conf = require(testData.libPath + "/conf"),
+    path = require('path'),
+    fs = require('fs'),
+    os = require('os'),
+    childProcess = require("child_process"),
+    properties = {
+        homepath: "",
+        homedrive: ""
+    },
+    session;
+
+describe("signing-helper", function () {
+
+    describe("on windows", function () {
+
+        beforeEach(function () {
+
+            /* Preserve the value of the HOMEPATH and HOMEDRIVE environment
+             * variables if they are defined. If they are not defined, mark
+             * variable for deletion after the test.*/
+            if (typeof process.env.HOMEPATH === 'undefined') {
+                properties.homepath = "delete";
+            } else {
+                properties.homepath = process.env.HOMEPATH;
+            }
+
+            if (typeof process.env.HOMEDRIVE === 'undefined') {
+                properties.homedrive = "delete";
+            } else {
+                properties.homedrive = process.env.HOMEDRIVE;
+            }
+
+            spyOn(os, "type").andReturn("windows");
+        });
+
+        afterEach(function () {
+
+            /* Restore the value of the HOMEPATH and HOMEDRIVE environment
+             * variables if they are defined. If they are not defined, delete
+             * the property if it was defined in the test.*/
+            if (typeof process.env.HOMEPATH === 'string') {
+                if (properties.homepath === 'delete') {
+                    delete process.env.HOMEPATH;
+                } else {
+                    process.env.HOMEPATH = properties.homepath;
+                }
+            }
+
+            if (typeof process.env.HOMEDRIVE === 'string') {
+                if (properties.homedrive === 'delete') {
+                    delete process.env.HOMEDRIVE;
+                } else {
+                    process.env.HOMEDRIVE = properties.homedrive;
+                }
+            }
+        });
+
+        it("can find keys in Local Settings", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("\\Local Settings") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("\\Local Settings");
+        });
+
+        it("can find barsigner.csk in Local Settings", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("\\Local Settings") !== -1;
+            });
+
+            var result = signingHelper.getCskPath();
+            expect(result).toContain("\\Local Settings");
+        });
+
+        it("can find barsigner.db in Local Settings", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("\\Local Settings") !== -1;
+            });
+
+            var result = signingHelper.getDbPath();
+            expect(result).toContain("\\Local Settings");
+        });
+
+        it("can find keys in AppData", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("\\AppData") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("\\AppData");
+        });
+
+        it("can find barsigner.csk in AppData", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("\\AppData") !== -1;
+            });
+
+            var result = signingHelper.getCskPath();
+            expect(result).toContain("\\AppData");
+        });
+
+        it("can find barsigner.db in AppData", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("\\AppData") !== -1;
+            });
+
+            var result = signingHelper.getDbPath();
+            expect(result).toContain("\\AppData");
+        });
+
+        it("can find keys in home path", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "C:";
+
+            spyOn(fs, "existsSync").andCallFake(function (p) {
+                return p.indexOf("\\Users\\user") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("\\Users\\user");
+        });
+
+        it("can find keys on C drive", function () {
+
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "C:";
+
+            spyOn(fs, "existsSync").andCallFake(function (p) {
+                return p.indexOf("C:") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("C:");
+        });
+
+        it("can find keys on a drive other than C", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "D:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("D:") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("D:");
+        });
+
+        it("can find barsigner.csk on a drive other than C", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "D:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("D:") !== -1;
+            });
+
+            var result = signingHelper.getCskPath();
+            expect(result).toContain("D:");
+        });
+
+        it("can find barsigner.db on a drive other than C", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "D:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("D:") !== -1;
+            });
+
+            var result = signingHelper.getDbPath();
+            expect(result).toContain("D:");
+        });
+
+        it("can find keys in Local Settings on the correct drive", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "C:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("C:") !== -1 &&
+                        path.indexOf("\\Local Settings") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("C:");
+            expect(result).toContain("\\Local Settings");
+        });
+
+        it("can find barsigner.csk in Local Settings on the correct drive", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "D:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("D:") !== -1 &&
+                        path.indexOf("\\Local Settings") !== -1;
+            });
+
+            var result = signingHelper.getCskPath();
+            expect(result).toContain("D:");
+            expect(result).toContain("\\Local Settings");
+        });
+
+        it("can find barsigner.db in Local Settings on the correct drive", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "D:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("D:") !== -1 &&
+                        path.indexOf("\\Local Settings") !== -1;
+            });
+
+            var result = signingHelper.getDbPath();
+            expect(result).toContain("D:");
+            expect(result).toContain("\\Local Settings");
+        });
+
+        it("can find keys in AppData on the correct drive", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "C:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("C:") !== -1 &&
+                        path.indexOf("\\AppData") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("C:");
+            expect(result).toContain("\\AppData");
+        });
+
+        it("can find barsigner.csk in AppData on the correct drive", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "D:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("D:") !== -1 &&
+                        path.indexOf("\\AppData") !== -1;
+            });
+
+            var result = signingHelper.getCskPath();
+            expect(result).toContain("D:");
+            expect(result).toContain("\\AppData");
+        });
+
+        it("can find barsigner.db in AppData on the correct drive", function () {
+            process.env.HOMEPATH = "\\Users\\user";
+            process.env.HOMEDRIVE = "D:";
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("D:") !== -1 &&
+                        path.indexOf("\\AppData") !== -1;
+            });
+
+            var result = signingHelper.getDbPath();
+            expect(result).toContain("D:");
+            expect(result).toContain("\\AppData");
+        });
+
+        it("returns undefined when keys cannot be found", function () {
+            spyOn(fs, "existsSync").andReturn(false);
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toBeUndefined();
+        });
+
+        it("returns undefined when barsigner.csk cannot be found", function () {
+            spyOn(fs, "existsSync").andReturn(false);
+
+            var result = signingHelper.getCskPath();
+            expect(result).toBeUndefined();
+        });
+
+        it("returns undefined when barsigner.db cannot be found", function () {
+            spyOn(fs, "existsSync").andReturn(false);
+
+            var result = signingHelper.getDbPath();
+            expect(result).toBeUndefined();
+        });
+    });
+
+    describe("on mac", function () {
+
+        beforeEach(function () {
+            spyOn(os, "type").andReturn("darwin");
+        });
+
+        it("can find keys in the Library folder", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("/Library/Research In Motion/") !== -1;
+            });
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toContain("/Library/Research In Motion/");
+        });
+
+        it("can find barsigner.csk in the Library folder", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("/Library/Research In Motion/") !== -1;
+            });
+
+            var result = signingHelper.getCskPath();
+            expect(result).toContain("/Library/Research In Motion/");
+        });
+
+        it("can find barsigner.db in the Library folder", function () {
+
+            spyOn(fs, "existsSync").andCallFake(function (path) {
+                return path.indexOf("/Library/Research In Motion/") !== -1;
+            });
+
+            var result = signingHelper.getDbPath();
+            expect(result).toContain("/Library/Research In Motion/");
+        });
+
+        it("returns undefined when keys cannot be found", function () {
+
+            spyOn(fs, "existsSync").andReturn(false);
+
+            var result = signingHelper.getKeyStorePath();
+            expect(result).toBeUndefined();
+        });
+
+        it("returns undefined when barsigner.csk cannot be found", function () {
+
+            spyOn(fs, "existsSync").andReturn(false);
+
+            var result = signingHelper.getCskPath();
+            expect(result).toBeUndefined();
+        });
+
+        it("returns undefined when barsigner.db cannot be found", function () {
+
+            spyOn(fs, "existsSync").andReturn(false);
+
+            var result = signingHelper.getDbPath();
+            expect(result).toBeUndefined();
+        });
+    });
+
+    describe("Exec blackberry-signer", function () {
+        var stdoutOn = jasmine.createSpy("stdout on"),
+            stderrOn = jasmine.createSpy("stderr on");
+
+        beforeEach(function () {
+            session = testData.session;
+            session.keystore = "/blah/author.p12";
+            session.storepass = "123";
+            session.barPath = path.normalize("c:/%s/" + "Demo.bar");
+
+            spyOn(childProcess, "spawn").andReturn({
+                stdout: {
+                    on: stdoutOn
+                },
+                stderr: {
+                    on: stderrOn
+                },
+                on: jasmine.createSpy("on").andCallFake(function (event, callback) {
+                    if (callback && typeof callback === "function") {
+                        callback(0);
+                    }
+                })
+            });
+        });
+
+        it("exec blackberry-signer without extra params", function () {
+            var callback = jasmine.createSpy("callback"),
+                cmd = "blackberry-signer" + (pkgrUtils.isWindows() ? ".bat" : "");
+
+            if (!pkgrUtils.isWindows()) {
+                cmd = path.normalize(conf.DEPENDENCIES_TOOLS + "/bin/") + cmd;
+            }
+
+            session.getParams = jasmine.createSpy("session getParams").andReturn(null);
+            signingHelper.execSigner(session, "device", callback);
+            expect(childProcess.spawn).toHaveBeenCalledWith(cmd, ["-keystore", session.keystore, "-storepass", session.storepass, path.resolve("c:/device/Demo.bar")], jasmine.any(Object));
+            expect(stdoutOn).toHaveBeenCalledWith("data", pkgrUtils.handleProcessOutput);
+            expect(stderrOn).toHaveBeenCalledWith("data", pkgrUtils.handleProcessOutput);
+            expect(callback).toHaveBeenCalledWith(0);
+        });
+
+        it("exec blackberry-signer with extra params", function () {
+            var callback = jasmine.createSpy("callback"),
+                cmd = "blackberry-signer" + (pkgrUtils.isWindows() ? ".bat" : "");
+
+            if (!pkgrUtils.isWindows()) {
+                cmd = path.normalize(conf.DEPENDENCIES_TOOLS + "/bin/") + cmd;
+            }
+
+            session.getParams = jasmine.createSpy("session getParams").andReturn({
+                "-proxyhost": "abc.com",
+                "-proxyport": "80"
+            });
+            signingHelper.execSigner(session, "device", callback);
+            expect(childProcess.spawn.mostRecentCall.args[0]).toBe(cmd);
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain("-keystore");
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain(session.keystore);
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain("-storepass");
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain(session.storepass);
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain("-proxyport");
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain("80");
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain("-proxyhost");
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain("abc.com");
+            expect(childProcess.spawn.mostRecentCall.args[1]).toContain(path.resolve("c:/device/Demo.bar"));
+            expect(childProcess.spawn.mostRecentCall.args[1].length).toBe(9);
+            expect(stdoutOn).toHaveBeenCalledWith("data", pkgrUtils.handleProcessOutput);
+            expect(stderrOn).toHaveBeenCalledWith("data", pkgrUtils.handleProcessOutput);
+            expect(callback).toHaveBeenCalledWith(0);
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-data.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-data.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-data.js
new file mode 100644
index 0000000..11ec335
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-data.js
@@ -0,0 +1,87 @@
+var path = require("path"),
+    outputDir = path.resolve("../packager.test"),
+    libPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    barConf = require(libPath + "/bar-conf"),
+    configPath = path.resolve("test") + "/config.xml";
+
+module.exports = {
+    libPath: libPath,
+    configPath: configPath,
+    session: {
+        "barPath": outputDir + "/%s/" + "Demo.bar",
+        "outputDir": outputDir,
+        "sourceDir": path.resolve(outputDir + "/src"),
+        "sourcePaths": {
+            "ROOT": path.resolve(outputDir + "/src"),
+            "CHROME": path.normalize(path.resolve(outputDir + "/src") + barConf.CHROME),
+            "LIB": path.normalize(path.resolve(outputDir + "/src") + barConf.LIB),
+            "UI": path.normalize(path.resolve(outputDir + "/src") + barConf.UI),
+            "EXT": path.normalize(path.resolve(outputDir + "/src") + barConf.EXT),
+            "PLUGINS": path.normalize(path.resolve(outputDir + "/src") + barConf.PLUGINS),
+            "JNEXT_PLUGINS": path.normalize(path.resolve(outputDir + "/src") + barConf.JNEXT_PLUGINS)
+        },
+        "archivePath": path.resolve("bin/test/cordova/unit/test.zip"),
+        "conf": require(path.resolve(libPath + "/conf")),
+        "targets": ["simulator"],
+        isSigningRequired: function () {
+            return false;
+        },
+        getParams: function () {
+            return null;
+        }
+    },
+    config: {
+        "id": 'Demo',
+        "name": { 'default': 'Demo' },
+        "version": '1.0.0',
+        "author": 'Research In Motion Ltd.',
+        "description": { 'default': 'This is a test!' },
+        "image": 'test.png',
+        "autoOrientation": true,
+        "theme": "default"
+    },
+    accessList: [{
+        uri: "http://google.com",
+        allowSubDomain: false,
+        features: [{
+            id: "blackberry.app",
+            required: true,
+            version: "1.0.0"
+        }, {
+            id: "blackberry.system",
+            required:  true,
+            version: "1.0.0"
+        }]
+    }, {
+        uri: "WIDGET_LOCAL",
+        allowSubDomain: false,
+        features: [{
+            id: "blackberry.system",
+            required: true,
+            version: "1.0.0"
+        }]
+    }],
+    xml2jsConfig: {
+        "@": {
+            "xmlns": " http://www.w3.org/ns/widgets",
+            "xmlns:rim": "http://www.blackberry.com/ns/widgets",
+            "version": "1.0.0",
+            "id": "myID",
+            "rim:header" : "RIM-Widget:rim/widget",
+            "rim:userAgent" : "A Test-User-Agent/(Blackberry-Agent)"
+        },
+        "name": "Demo",
+        "content": {
+            "@": {
+                "src": "local:///startPage.html"
+            }
+        },
+        "author": "Research In Motion Ltd.",
+        "license": {
+            "#": "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.",
+            "@": {
+                "href": "http://www.apache.org/licenses/LICENSE-2.0"
+            }
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-utilities.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-utilities.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-utilities.js
new file mode 100644
index 0000000..6f0dbf9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/test-utilities.js
@@ -0,0 +1,82 @@
+var xml2js = require("xml2js");
+
+function getObjectByProperty(array, propertyName, propertyValue) {
+    for (var i = 0; i < array.length; i++) {
+        if (propertyValue === array[i][propertyName]) {
+            return array[i];
+        }
+    }
+}
+
+module.exports = {
+    getAccessListForUri: function (accessListArray, uriValue) {
+        return getObjectByProperty(accessListArray, "uri", uriValue);
+    },
+    
+    getFeatureByID: function (featureArray, featureID) {
+        return getObjectByProperty(featureArray, "id", featureID);
+    },
+    
+    mockResolve: function (path) {
+        //Mock resolve because of a weird issue where resolve would return an 
+        //invalid path on Mac if it cannot find the directory (c:/ doesnt exist on mac)
+        spyOn(path, "resolve").andCallFake(function (to) {
+            if (arguments.length === 2) {
+                //Handle optional from attribute
+                return path.normalize(path.join(arguments[0], arguments[1]));
+            } else {
+                return path.normalize(to);
+            }
+        });
+    },
+    
+    cloneObj: function (obj) {
+        var newObj = (obj instanceof Array) ? [] : {}, i;
+        
+        for (i in obj) {
+            if (i === 'clone') continue;
+            
+            if (obj[i] && typeof obj[i] === "object") {
+                newObj[i] = this.cloneObj(obj[i]);
+            } else {
+                newObj[i] = obj[i];
+            }
+        }
+    
+        return newObj;
+    },
+
+    mockParsing: function (data, error) {
+        spyOn(xml2js, "Parser").andReturn({
+            parseString: function (fileData, callback) {
+                //call callback with no error and altered xml2jsConfig data
+                callback(error, data);
+            }
+        });
+    }
+};
+
+describe("test-utilities", function () {
+    var testUtilities = require("./test-utilities");
+    
+    it("can clone objects using cloneObj", function () {
+        var obj = {
+                A: "A",
+                B: "B",
+                C: { 
+                    CA: "CA",
+                    CB: "CB",
+                    CC: {
+                        CCA: "CCA"
+                    }
+                }
+            },
+            clonedObj = testUtilities.cloneObj(obj);
+        
+        //not the same object
+        expect(clonedObj).not.toBe(obj);
+        
+        //has the same data
+        expect(clonedObj).toEqual(obj);
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/test.zip
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/test.zip b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/test.zip
new file mode 100644
index 0000000..8859a66
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/test.zip differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/Accelerometer/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/Accelerometer/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Accelerometer/index.js
new file mode 100644
index 0000000..a016219
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Accelerometer/index.js
@@ -0,0 +1,81 @@
+/*
+* 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.
+*/
+describe("Accelerometer", function () {
+    var _apiDir = __dirname + "./../../../templates/project/plugins/Accelerometer/",
+        index,
+        callback,
+        result = {
+            ok: jasmine.createSpy(),
+            error: jasmine.createSpy(),
+            noResult: jasmine.createSpy(),
+            callbackOk: jasmine.createSpy()
+        },
+        motion = {
+            timestamp: 0,
+            accelerationIncludingGravity: {
+                x: 0,
+                y: 0,
+                z: 0
+            }
+        };
+
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+        GLOBAL.window = {
+            removeEventListener: jasmine.createSpy("removeEventListener spy"),
+            addEventListener: jasmine.createSpy("addEventListener spy").andCallFake(function (evt, cb) {
+                callback = cb;
+            })
+        };
+        GLOBAL.PluginResult = function () {
+            return result;
+        };
+    });
+
+    afterEach(function () {
+        index = null;
+        delete GLOBAL.window;
+        delete GLOBAL.PluginResult;
+    });
+
+    describe("start", function () {
+        it("calls noResult and keeps callbacks", function () {
+            index.start();
+            expect(window.addEventListener).toHaveBeenCalled();
+            expect(result.noResult).toHaveBeenCalledWith(true);
+        });
+
+        it("callback calls ok and keeps callbacks", function () {
+            callback(motion);
+            expect(result.callbackOk).toHaveBeenCalled();
+        });
+
+        it("does not call error if already started", function () {
+            index.start();
+            expect(window.removeEventListener).toHaveBeenCalled();
+            expect(window.addEventListener).toHaveBeenCalled();
+            expect(result.error).not.toHaveBeenCalled();
+        });
+    });
+
+    describe("stop", function () {
+        it("calls result ok", function () {
+            index.stop();
+            expect(window.removeEventListener).toHaveBeenCalled();
+            expect(result.ok).toHaveBeenCalledWith("removed");
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/Battery/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/Battery/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Battery/index.js
new file mode 100644
index 0000000..3495629
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Battery/index.js
@@ -0,0 +1,85 @@
+/*
+* 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.
+*/
+
+describe("Battery", function () {
+
+    var _apiDir = __dirname + "./../../../templates/project/plugins/Battery/",
+        index,
+        callback,
+        result = {
+            ok: jasmine.createSpy(),
+            error: jasmine.createSpy(),
+            noResult: jasmine.createSpy(),
+            callbackOk: jasmine.createSpy()
+        };
+
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+        GLOBAL.window = {
+            qnx: {
+                webplatform: {
+                    device: {
+                        addEventListener: jasmine.createSpy().andCallFake(function (evt, cb) {
+                            callback = cb;
+                        }),
+                        removeEventListener: jasmine.createSpy()
+                    }
+                }
+            }
+        };
+        GLOBAL.PluginResult = function () {
+            return result;
+        };
+    });
+
+    afterEach(function () {
+        index = null;
+        delete GLOBAL.window;
+        delete GLOBAL.PluginResult;
+    });
+
+    describe("start", function () {
+
+        it("calls noResult and keeps callbacks", function () {
+            index.start();
+            expect(window.qnx.webplatform.device.addEventListener).toHaveBeenCalled();
+            expect(result.noResult).toHaveBeenCalledWith(true);
+        });
+
+        it("callback calls ok and keeps callbacks", function () {
+            callback("OK");
+            expect(result.callbackOk).toHaveBeenCalledWith("OK", true);
+        });
+
+        it("calls error if already started", function () {
+            index.start();
+            expect(window.qnx.webplatform.device.addEventListener).not.toHaveBeenCalled();
+            expect(result.error).toHaveBeenCalled();
+        });
+
+
+    });
+
+    describe("stop", function () {
+
+        it("calls noResult and does not keep callbacks", function () {
+            index.stop();
+            expect(window.qnx.webplatform.device.removeEventListener).toHaveBeenCalled();
+            expect(result.noResult).toHaveBeenCalledWith(false);
+        });
+
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/Camera/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/Camera/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Camera/index.js
new file mode 100644
index 0000000..e629a41
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Camera/index.js
@@ -0,0 +1,298 @@
+/*
+* 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.
+*/
+describe("Camera", function () {
+    var _apiDir = __dirname + "./../../../templates/project/plugins/Camera/",
+        index,
+        mockDone,
+        mockCancel,
+        mockError,
+        mockedEnv = {
+            response: {
+                send: jasmine.createSpy()
+            },
+            webview: {
+                executeJavaScript: jasmine.createSpy()
+            }
+        },
+        PictureSourceType = {
+            PHOTOLIBRARY : 0,    // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)
+            CAMERA : 1,          // Take picture from camera
+            SAVEDPHOTOALBUM : 2  // Choose image from picture library (same as PHOTOLIBRARY for Android)
+        },
+        DestinationType = {
+            DATA_URL: 0,         // Return base64 encoded string
+            FILE_URI: 1,         // Return file uri (content://media/external/images/media/2 for Android)
+            NATIVE_URI: 2        // Return native uri (eg. asset-library://... for iOS)
+        },
+        readFail,
+        mockBase64Data = "/9j/4QHRw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
+
+    function mockOpen(options, done, cancel, invoked) {
+        if (!mockError) {
+            invoked();
+        }
+
+        if (mockDone) {
+            done(mockDone.path);
+        } else if (mockCancel) {
+            cancel(mockCancel.reason);
+        } else if (mockError) {
+            invoked(mockError.error);
+        }
+    }
+
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+        mockedEnv.response.send.reset();
+        mockedEnv.webview.executeJavaScript.reset();
+    });
+
+    afterEach(function () {
+        index = null;
+        mockDone = null;
+        mockCancel = null;
+        mockError = null;
+        readFail = false;
+    });
+
+    describe("takePicture", function () {
+        beforeEach(function () {
+            GLOBAL.window = {
+                qnx: {
+                    webplatform: {
+                        getApplication: function () {
+                            return {
+                                cards: {
+                                    camera: {
+                                        open: jasmine.createSpy().andCallFake(mockOpen)
+                                    },
+                                    filePicker: {
+                                        open: jasmine.createSpy().andCallFake(mockOpen)
+                                    }
+                                }
+                            };
+                        },
+                        getController: function () {
+                            return {
+                                setFileSystemSandbox: true
+                            };
+                        }
+                    }
+                },
+                webkitRequestFileSystem: jasmine.createSpy().andCallFake(function (type, size, success, error) {
+                    success({
+                        root: {
+                            getFile: jasmine.createSpy().andCallFake(function (path, options, success, error) {
+                                if (readFail) {
+                                    error({
+                                        code: -1
+                                    });
+                                } else {
+                                    success({
+                                        file: jasmine.createSpy().andCallFake(function (cb) {
+                                            cb();
+                                        })
+                                    });
+                                }
+                            })
+                        }
+                    });
+                })
+            };
+
+            GLOBAL.FileReader = function () {
+                return {
+                    onloadend: jasmine.createSpy(),
+                    readAsDataURL: jasmine.createSpy().andCallFake(function (file) {
+                        this.onloadend.apply({
+                            result: "data:image/jpeg;base64," + mockBase64Data
+                        });
+                    })
+                };
+            };
+
+            GLOBAL.FileError = {
+                NOT_FOUND_ERR: 1,
+                NOT_READABLE_ERR: 4,
+                PATH_EXISTS_ERR: 12,
+                TYPE_MISMATCH_ERR: 11
+            };
+
+            GLOBAL.PluginResult = function (args, env) {};
+            GLOBAL.PluginResult.prototype.callbackOk = jasmine.createSpy();
+            GLOBAL.PluginResult.prototype.callbackError = jasmine.createSpy();
+            GLOBAL.PluginResult.prototype.noResult = jasmine.createSpy();
+        });
+
+        afterEach(function () {
+            delete GLOBAL.window;
+            delete GLOBAL.FileReader;
+            delete GLOBAL.PluginResult;
+        });
+
+        it("calls PluginResult.callbackOk if invoke camera is successful and image doesn't need encoding", function () {
+            mockDone = {
+                path: "/foo/bar/abc.jpg"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.FILE_URI.toString(),
+                "2": PictureSourceType.CAMERA.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackOk).toHaveBeenCalledWith("file://" + mockDone.path, false);
+        });
+
+        it("calls PluginResult.callbackOk if invoke camera and base64 encode image is successful", function () {
+            mockDone = {
+                path: "/foo/bar/abc.jpg"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.DATA_URL.toString(),
+                "2": PictureSourceType.CAMERA.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackOk).toHaveBeenCalledWith(mockBase64Data, false);
+        });
+
+        it("calls PluginResult.callbackError if invoke camera is successful but base64 encode image failed", function () {
+            mockDone = {
+                path: "/foo/bar/abc.jpg"
+            };
+            readFail = true;
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.DATA_URL.toString(),
+                "2": PictureSourceType.CAMERA.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackError).toHaveBeenCalledWith("An error occured: Unknown Error", false);
+        });
+
+        it("calls PluginResult.callbackError if invoke camera is cancelled by user", function () {
+            mockCancel = {
+                reason: "done"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.FILE_URI.toString(),
+                "2": PictureSourceType.CAMERA.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackError).toHaveBeenCalledWith(mockCancel.reason, false);
+        });
+
+        it("calls PluginResult.callbackError if invoke camera encounters error", function () {
+            mockError = {
+                error: "Camera error"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.FILE_URI.toString(),
+                "2": PictureSourceType.CAMERA.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackError).toHaveBeenCalledWith(mockError.error, false);
+        });
+
+        it("calls PluginResult.callbackOk if invoke file picker is successful and image doesn't need encoding", function () {
+            mockDone = {
+                path: "/foo/bar/abc.jpg"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.FILE_URI.toString(),
+                "2": PictureSourceType.PHOTOLIBRARY.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackOk).toHaveBeenCalledWith("file://" + mockDone.path, false);
+        });
+
+        it("calls PluginResult.callbackOk if invoke file picker and base64 encode image is successful", function () {
+            mockDone = {
+                path: "/foo/bar/abc.jpg"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.DATA_URL.toString(),
+                "2": PictureSourceType.PHOTOLIBRARY.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackOk).toHaveBeenCalledWith(mockBase64Data, false);
+        });
+
+        it("calls PluginResult.callbackError if invoke file picker is successful but base64 encode image failed", function () {
+            mockDone = {
+                path: "/foo/bar/abc.jpg"
+            };
+            readFail = true;
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.DATA_URL.toString(),
+                "2": PictureSourceType.PHOTOLIBRARY.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackError).toHaveBeenCalledWith("An error occured: Unknown Error", false);
+        });
+
+        it("calls PluginResult.callbackError if invoke file picker is cancelled by user", function () {
+            mockCancel = {
+                reason: "cancel"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.DATA_URL.toString(),
+                "2": PictureSourceType.PHOTOLIBRARY.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackError).toHaveBeenCalledWith(mockCancel.reason, false);
+        });
+
+        it("calls PluginResult.callbackError if invoke file picker encounters error", function () {
+            mockError = {
+                error: "File picker error"
+            };
+
+            index.takePicture(undefined, undefined, {
+                "1": DestinationType.DATA_URL.toString(),
+                "2": PictureSourceType.PHOTOLIBRARY.toString(),
+                callbackId: "123"
+            }, mockedEnv);
+
+            expect(PluginResult.prototype.noResult).toHaveBeenCalledWith(true);
+            expect(PluginResult.prototype.callbackError).toHaveBeenCalledWith(mockError.error, false);
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/Device/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/Device/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Device/index.js
new file mode 100644
index 0000000..9792b09
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Device/index.js
@@ -0,0 +1,76 @@
+/*
+* 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.
+*/
+
+describe("Device", function () {
+
+    var _apiDir = __dirname + "./../../../templates/project/plugins/Device/",
+        index,
+        result = {
+            ok: jasmine.createSpy()
+        };
+    
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+    });
+
+    afterEach(function () {
+        index = null;
+    });
+
+    describe("getDeviceInfo", function () {
+        beforeEach(function () {
+            GLOBAL.window = {
+                qnx: {
+                    webplatform: {
+                        device: {
+                        }
+                    }
+                }
+            };
+            GLOBAL.PluginResult = function () {
+                return result;
+            };
+        });
+
+        afterEach(function () {
+            delete GLOBAL.window;
+            delete GLOBAL.PluginResult;
+        });
+
+        it("calls ok with the Device info", function () {
+            var mockedDevice = {
+                scmBundle: "1.0.0.0",
+                modelName: "q10",
+                devicePin: (new Date()).getTime()
+            };
+
+            result.ok = jasmine.createSpy().andCallFake(function (deviceInfo) {
+                expect(deviceInfo.platform).toEqual("blackberry10");
+                expect(deviceInfo.version).toEqual(mockedDevice.scmBundle);
+                expect(deviceInfo.model).toEqual(mockedDevice.modelName);
+                expect(deviceInfo.name).toEqual(mockedDevice.modelName);
+                expect(deviceInfo.uuid).toEqual(mockedDevice.devicePin);
+                expect(deviceInfo.cordova).toBeDefined();
+            });
+
+            window.qnx.webplatform.device = mockedDevice;
+
+            index.getDeviceInfo();
+
+            expect(result.ok).toHaveBeenCalled();
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/plugins/Logger/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/plugins/Logger/index.js b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Logger/index.js
new file mode 100644
index 0000000..e5dc9f9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/plugins/Logger/index.js
@@ -0,0 +1,51 @@
+/*
+* 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.
+*/
+
+describe("Logger", function () {
+
+    var _apiDir = __dirname + "./../../../templates/project/plugins/Logger/",
+        index,
+        result = {
+            noResult: jasmine.createSpy("noResult")
+        };
+    
+    beforeEach(function () {
+        index = require(_apiDir + "index");
+    });
+
+    afterEach(function () {
+        index = null;
+    });
+
+    describe("logLevel", function () {
+        beforeEach(function () {
+            spyOn(console, "log"); 
+            GLOBAL.PluginResult = function () {
+                return result;
+            };
+        });
+
+        afterEach(function () {
+            delete GLOBAL.PluginResult;
+        });
+
+        it("calls console.log", function () {
+            index.logLevel(function () {}, function () {}, ["%22ERROR%22", "%22message%22"]);
+            expect(console.log).toHaveBeenCalledWith("ERROR: message");
+            expect(result.noResult).toHaveBeenCalledWith(false);
+        });
+    });
+});


[23/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th.js.gz
new file mode 100644
index 0000000..13b44cc
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH.js.gz
new file mode 100644
index 0000000..9a44dfe
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz
new file mode 100644
index 0000000..cfd9252
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/th_TH_TH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr.js.gz
new file mode 100644
index 0000000..f54579f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz
new file mode 100644
index 0000000..27e9cd3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/tr_TR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk.js.gz
new file mode 100644
index 0000000..246525c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz
new file mode 100644
index 0000000..f73c575
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/uk_UA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi.js.gz
new file mode 100644
index 0000000..7a47737
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz
new file mode 100644
index 0000000..9cdd564
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/vi_VN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh.js.gz
new file mode 100644
index 0000000..ea819e5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz
new file mode 100644
index 0000000..eeddad9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_CN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz
new file mode 100644
index 0000000..63130e3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_HK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz
new file mode 100644
index 0000000..ced2c42
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_SG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz
new file mode 100644
index 0000000..105e4fa
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/resourceBundles/zh_TW.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png
new file mode 100644
index 0000000..29873e9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec.html b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec.html
new file mode 100644
index 0000000..71f00de
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!--
+    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.
+-->
+<html>
+    <head>
+        <title>Jasmine Spec Runner</title>
+
+        <!-- jasmine source -->
+        <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png">
+        <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css">
+        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script>
+        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script>
+
+        <!-- include source files here... -->
+        <script type="text/javascript" src="js/index.js"></script>
+
+        <!-- include spec files here... -->
+        <script type="text/javascript" src="spec/helper.js"></script>
+        <script type="text/javascript" src="spec/index.js"></script>
+
+        <script type="text/javascript">
+            (function() {
+                var jasmineEnv = jasmine.getEnv();
+                jasmineEnv.updateInterval = 1000;
+
+                var htmlReporter = new jasmine.HtmlReporter();
+
+                jasmineEnv.addReporter(htmlReporter);
+
+                jasmineEnv.specFilter = function(spec) {
+                    return htmlReporter.specFilter(spec);
+                };
+
+                var currentWindowOnload = window.onload;
+
+                window.onload = function() {
+                    if (currentWindowOnload) {
+                        currentWindowOnload();
+                    }
+                    execJasmine();
+                };
+
+                function execJasmine() {
+                    jasmineEnv.execute();
+                }
+            })();
+        </script>
+    </head>
+    <body>
+        <div id="stage" style="display:none;"></div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/helper.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/helper.js
new file mode 100644
index 0000000..929f776
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/helper.js
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+afterEach(function() {
+    document.getElementById('stage').innerHTML = '';
+});
+
+var helper = {
+    trigger: function(obj, name) {
+        var e = document.createEvent('Event');
+        e.initEvent(name, true, true);
+        obj.dispatchEvent(e);
+    },
+    getComputedStyle: function(querySelector, property) {
+        var element = document.querySelector(querySelector);
+        return window.getComputedStyle(element).getPropertyValue(property);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/index.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/index.js
new file mode 100644
index 0000000..20f8be5
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/index.js
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+describe('app', function() {
+    describe('initialize', function() {
+        it('should bind deviceready', function() {
+            runs(function() {
+                spyOn(app, 'onDeviceReady');
+                app.initialize();
+                helper.trigger(window.document, 'deviceready');
+            });
+
+            waitsFor(function() {
+                return (app.onDeviceReady.calls.length > 0);
+            }, 'onDeviceReady should be called once', 500);
+
+            runs(function() {
+                expect(app.onDeviceReady).toHaveBeenCalled();
+            });
+        });
+    });
+
+    describe('onDeviceReady', function() {
+        it('should report that it fired', function() {
+            spyOn(app, 'receivedEvent');
+            app.onDeviceReady();
+            expect(app.receivedEvent).toHaveBeenCalledWith('deviceready');
+        });
+    });
+
+    describe('receivedEvent', function() {
+        beforeEach(function() {
+            var el = document.getElementById('stage');
+            el.innerHTML = ['<div id="deviceready">',
+                            '    <p class="event listening">Listening</p>',
+                            '    <p class="event received">Received</p>',
+                            '</div>'].join('\n');
+        });
+
+        it('should hide the listening element', function() {
+            app.receivedEvent('deviceready');
+            var displayStyle = helper.getComputedStyle('#deviceready .listening', 'display');
+            expect(displayStyle).toEqual('none');
+        });
+
+        it('should show the received element', function() {
+            app.receivedEvent('deviceready');
+            var displayStyle = helper.getComputedStyle('#deviceready .received', 'display');
+            expect(displayStyle).toEqual('block');
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
new file mode 100644
index 0000000..7c435ba
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/MIT.LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2008-2011 Pivotal Labs
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
new file mode 100644
index 0000000..a0b0639
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
@@ -0,0 +1,616 @@
+jasmine.HtmlReporterHelpers = {};
+
+jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
+  var el = document.createElement(type);
+
+  for (var i = 2; i < arguments.length; i++) {
+    var child = arguments[i];
+
+    if (typeof child === 'string') {
+      el.appendChild(document.createTextNode(child));
+    } else {
+      if (child) {
+        el.appendChild(child);
+      }
+    }
+  }
+
+  for (var attr in attrs) {
+    if (attr == "className") {
+      el[attr] = attrs[attr];
+    } else {
+      el.setAttribute(attr, attrs[attr]);
+    }
+  }
+
+  return el;
+};
+
+jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
+  var results = child.results();
+  var status = results.passed() ? 'passed' : 'failed';
+  if (results.skipped) {
+    status = 'skipped';
+  }
+
+  return status;
+};
+
+jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
+  var parentDiv = this.dom.summary;
+  var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
+  var parent = child[parentSuite];
+
+  if (parent) {
+    if (typeof this.views.suites[parent.id] == 'undefined') {
+      this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
+    }
+    parentDiv = this.views.suites[parent.id].element;
+  }
+
+  parentDiv.appendChild(childElement);
+};
+
+
+jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
+  for(var fn in jasmine.HtmlReporterHelpers) {
+    ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
+  }
+};
+
+jasmine.HtmlReporter = function(_doc) {
+  var self = this;
+  var doc = _doc || window.document;
+
+  var reporterView;
+
+  var dom = {};
+
+  // Jasmine Reporter Public Interface
+  self.logRunningSpecs = false;
+
+  self.reportRunnerStarting = function(runner) {
+    var specs = runner.specs() || [];
+
+    if (specs.length == 0) {
+      return;
+    }
+
+    createReporterDom(runner.env.versionString());
+    doc.body.appendChild(dom.reporter);
+
+    reporterView = new jasmine.HtmlReporter.ReporterView(dom);
+    reporterView.addSpecs(specs, self.specFilter);
+  };
+
+  self.reportRunnerResults = function(runner) {
+    reporterView && reporterView.complete();
+  };
+
+  self.reportSuiteResults = function(suite) {
+    reporterView.suiteComplete(suite);
+  };
+
+  self.reportSpecStarting = function(spec) {
+    if (self.logRunningSpecs) {
+      self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
+    }
+  };
+
+  self.reportSpecResults = function(spec) {
+    reporterView.specComplete(spec);
+  };
+
+  self.log = function() {
+    var console = jasmine.getGlobal().console;
+    if (console && console.log) {
+      if (console.log.apply) {
+        console.log.apply(console, arguments);
+      } else {
+        console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
+      }
+    }
+  };
+
+  self.specFilter = function(spec) {
+    if (!focusedSpecName()) {
+      return true;
+    }
+
+    return spec.getFullName().indexOf(focusedSpecName()) === 0;
+  };
+
+  return self;
+
+  function focusedSpecName() {
+    var specName;
+
+    (function memoizeFocusedSpec() {
+      if (specName) {
+        return;
+      }
+
+      var paramMap = [];
+      var params = doc.location.search.substring(1).split('&');
+
+      for (var i = 0; i < params.length; i++) {
+        var p = params[i].split('=');
+        paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
+      }
+
+      specName = paramMap.spec;
+    })();
+
+    return specName;
+  }
+
+  function createReporterDom(version) {
+    dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
+      dom.banner = self.createDom('div', { className: 'banner' },
+        self.createDom('span', { className: 'title' }, "Jasmine "),
+        self.createDom('span', { className: 'version' }, version)),
+
+      dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
+      dom.alert = self.createDom('div', {className: 'alert'}),
+      dom.results = self.createDom('div', {className: 'results'},
+        dom.summary = self.createDom('div', { className: 'summary' }),
+        dom.details = self.createDom('div', { id: 'details' }))
+    );
+  }
+};
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
+  this.startedAt = new Date();
+  this.runningSpecCount = 0;
+  this.completeSpecCount = 0;
+  this.passedCount = 0;
+  this.failedCount = 0;
+  this.skippedCount = 0;
+
+  this.createResultsMenu = function() {
+    this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
+      this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
+      ' | ',
+      this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
+
+    this.summaryMenuItem.onclick = function() {
+      dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
+    };
+
+    this.detailsMenuItem.onclick = function() {
+      showDetails();
+    };
+  };
+
+  this.addSpecs = function(specs, specFilter) {
+    this.totalSpecCount = specs.length;
+
+    this.views = {
+      specs: {},
+      suites: {}
+    };
+
+    for (var i = 0; i < specs.length; i++) {
+      var spec = specs[i];
+      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
+      if (specFilter(spec)) {
+        this.runningSpecCount++;
+      }
+    }
+  };
+
+  this.specComplete = function(spec) {
+    this.completeSpecCount++;
+
+    if (isUndefined(this.views.specs[spec.id])) {
+      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
+    }
+
+    var specView = this.views.specs[spec.id];
+
+    switch (specView.status()) {
+      case 'passed':
+        this.passedCount++;
+        break;
+
+      case 'failed':
+        this.failedCount++;
+        break;
+
+      case 'skipped':
+        this.skippedCount++;
+        break;
+    }
+
+    specView.refresh();
+    this.refresh();
+  };
+
+  this.suiteComplete = function(suite) {
+    var suiteView = this.views.suites[suite.id];
+    if (isUndefined(suiteView)) {
+      return;
+    }
+    suiteView.refresh();
+  };
+
+  this.refresh = function() {
+
+    if (isUndefined(this.resultsMenu)) {
+      this.createResultsMenu();
+    }
+
+    // currently running UI
+    if (isUndefined(this.runningAlert)) {
+      this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
+      dom.alert.appendChild(this.runningAlert);
+    }
+    this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
+
+    // skipped specs UI
+    if (isUndefined(this.skippedAlert)) {
+      this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
+    }
+
+    this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+    if (this.skippedCount === 1 && isDefined(dom.alert)) {
+      dom.alert.appendChild(this.skippedAlert);
+    }
+
+    // passing specs UI
+    if (isUndefined(this.passedAlert)) {
+      this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
+    }
+    this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
+
+    // failing specs UI
+    if (isUndefined(this.failedAlert)) {
+      this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
+    }
+    this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
+
+    if (this.failedCount === 1 && isDefined(dom.alert)) {
+      dom.alert.appendChild(this.failedAlert);
+      dom.alert.appendChild(this.resultsMenu);
+    }
+
+    // summary info
+    this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
+    this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
+  };
+
+  this.complete = function() {
+    dom.alert.removeChild(this.runningAlert);
+
+    this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+    if (this.failedCount === 0) {
+      dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
+    } else {
+      showDetails();
+    }
+
+    dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
+  };
+
+  return this;
+
+  function showDetails() {
+    if (dom.reporter.className.search(/showDetails/) === -1) {
+      dom.reporter.className += " showDetails";
+    }
+  }
+
+  function isUndefined(obj) {
+    return typeof obj === 'undefined';
+  }
+
+  function isDefined(obj) {
+    return !isUndefined(obj);
+  }
+
+  function specPluralizedFor(count) {
+    var str = count + " spec";
+    if (count > 1) {
+      str += "s"
+    }
+    return str;
+  }
+
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
+
+
+jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
+  this.spec = spec;
+  this.dom = dom;
+  this.views = views;
+
+  this.symbol = this.createDom('li', { className: 'pending' });
+  this.dom.symbolSummary.appendChild(this.symbol);
+
+  this.summary = this.createDom('div', { className: 'specSummary' },
+      this.createDom('a', {
+        className: 'description',
+        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
+        title: this.spec.getFullName()
+      }, this.spec.description)
+  );
+
+  this.detail = this.createDom('div', { className: 'specDetail' },
+      this.createDom('a', {
+        className: 'description',
+        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
+        title: this.spec.getFullName()
+      }, this.spec.getFullName())
+  );
+};
+
+jasmine.HtmlReporter.SpecView.prototype.status = function() {
+  return this.getSpecStatus(this.spec);
+};
+
+jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
+  this.symbol.className = this.status();
+
+  switch (this.status()) {
+    case 'skipped':
+      break;
+
+    case 'passed':
+      this.appendSummaryToSuiteDiv();
+      break;
+
+    case 'failed':
+      this.appendSummaryToSuiteDiv();
+      this.appendFailureDetail();
+      break;
+  }
+};
+
+jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
+  this.summary.className += ' ' + this.status();
+  this.appendToSummary(this.spec, this.summary);
+};
+
+jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
+  this.detail.className += ' ' + this.status();
+
+  var resultItems = this.spec.results().getItems();
+  var messagesDiv = this.createDom('div', { className: 'messages' });
+
+  for (var i = 0; i < resultItems.length; i++) {
+    var result = resultItems[i];
+
+    if (result.type == 'log') {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
+    } else if (result.type == 'expect' && result.passed && !result.passed()) {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
+
+      if (result.trace.stack) {
+        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
+      }
+    }
+  }
+
+  if (messagesDiv.childNodes.length > 0) {
+    this.detail.appendChild(messagesDiv);
+    this.dom.details.appendChild(this.detail);
+  }
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
+  this.suite = suite;
+  this.dom = dom;
+  this.views = views;
+
+  this.element = this.createDom('div', { className: 'suite' },
+      this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
+  );
+
+  this.appendToSummary(this.suite, this.element);
+};
+
+jasmine.HtmlReporter.SuiteView.prototype.status = function() {
+  return this.getSpecStatus(this.suite);
+};
+
+jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
+  this.element.className += " " + this.status();
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
+
+/* @deprecated Use jasmine.HtmlReporter instead
+ */
+jasmine.TrivialReporter = function(doc) {
+  this.document = doc || document;
+  this.suiteDivs = {};
+  this.logRunningSpecs = false;
+};
+
+jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
+  var el = document.createElement(type);
+
+  for (var i = 2; i < arguments.length; i++) {
+    var child = arguments[i];
+
+    if (typeof child === 'string') {
+      el.appendChild(document.createTextNode(child));
+    } else {
+      if (child) { el.appendChild(child); }
+    }
+  }
+
+  for (var attr in attrs) {
+    if (attr == "className") {
+      el[attr] = attrs[attr];
+    } else {
+      el.setAttribute(attr, attrs[attr]);
+    }
+  }
+
+  return el;
+};
+
+jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
+  var showPassed, showSkipped;
+
+  this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
+      this.createDom('div', { className: 'banner' },
+        this.createDom('div', { className: 'logo' },
+            this.createDom('span', { className: 'title' }, "Jasmine"),
+            this.createDom('span', { className: 'version' }, runner.env.versionString())),
+        this.createDom('div', { className: 'options' },
+            "Show ",
+            showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
+            this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
+            showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
+            this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
+            )
+          ),
+
+      this.runnerDiv = this.createDom('div', { className: 'runner running' },
+          this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
+          this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
+          this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
+      );
+
+  this.document.body.appendChild(this.outerDiv);
+
+  var suites = runner.suites();
+  for (var i = 0; i < suites.length; i++) {
+    var suite = suites[i];
+    var suiteDiv = this.createDom('div', { className: 'suite' },
+        this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
+        this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
+    this.suiteDivs[suite.id] = suiteDiv;
+    var parentDiv = this.outerDiv;
+    if (suite.parentSuite) {
+      parentDiv = this.suiteDivs[suite.parentSuite.id];
+    }
+    parentDiv.appendChild(suiteDiv);
+  }
+
+  this.startedAt = new Date();
+
+  var self = this;
+  showPassed.onclick = function(evt) {
+    if (showPassed.checked) {
+      self.outerDiv.className += ' show-passed';
+    } else {
+      self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
+    }
+  };
+
+  showSkipped.onclick = function(evt) {
+    if (showSkipped.checked) {
+      self.outerDiv.className += ' show-skipped';
+    } else {
+      self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
+    }
+  };
+};
+
+jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
+  var results = runner.results();
+  var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
+  this.runnerDiv.setAttribute("class", className);
+  //do it twice for IE
+  this.runnerDiv.setAttribute("className", className);
+  var specs = runner.specs();
+  var specCount = 0;
+  for (var i = 0; i < specs.length; i++) {
+    if (this.specFilter(specs[i])) {
+      specCount++;
+    }
+  }
+  var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
+  message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
+  this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
+
+  this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
+};
+
+jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
+  var results = suite.results();
+  var status = results.passed() ? 'passed' : 'failed';
+  if (results.totalCount === 0) { // todo: change this to check results.skipped
+    status = 'skipped';
+  }
+  this.suiteDivs[suite.id].className += " " + status;
+};
+
+jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
+  if (this.logRunningSpecs) {
+    this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
+  }
+};
+
+jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
+  var results = spec.results();
+  var status = results.passed() ? 'passed' : 'failed';
+  if (results.skipped) {
+    status = 'skipped';
+  }
+  var specDiv = this.createDom('div', { className: 'spec '  + status },
+      this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
+      this.createDom('a', {
+        className: 'description',
+        href: '?spec=' + encodeURIComponent(spec.getFullName()),
+        title: spec.getFullName()
+      }, spec.description));
+
+
+  var resultItems = results.getItems();
+  var messagesDiv = this.createDom('div', { className: 'messages' });
+  for (var i = 0; i < resultItems.length; i++) {
+    var result = resultItems[i];
+
+    if (result.type == 'log') {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
+    } else if (result.type == 'expect' && result.passed && !result.passed()) {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
+
+      if (result.trace.stack) {
+        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
+      }
+    }
+  }
+
+  if (messagesDiv.childNodes.length > 0) {
+    specDiv.appendChild(messagesDiv);
+  }
+
+  this.suiteDivs[spec.suite.id].appendChild(specDiv);
+};
+
+jasmine.TrivialReporter.prototype.log = function() {
+  var console = jasmine.getGlobal().console;
+  if (console && console.log) {
+    if (console.log.apply) {
+      console.log.apply(console, arguments);
+    } else {
+      console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
+    }
+  }
+};
+
+jasmine.TrivialReporter.prototype.getLocation = function() {
+  return this.document.location;
+};
+
+jasmine.TrivialReporter.prototype.specFilter = function(spec) {
+  var paramMap = {};
+  var params = this.getLocation().search.substring(1).split('&');
+  for (var i = 0; i < params.length; i++) {
+    var p = params[i].split('=');
+    paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
+  }
+
+  if (!paramMap.spec) {
+    return true;
+  }
+  return spec.getFullName().indexOf(paramMap.spec) === 0;
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
new file mode 100644
index 0000000..826e575
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
@@ -0,0 +1,81 @@
+body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
+
+#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
+#HTMLReporter a { text-decoration: none; }
+#HTMLReporter a:hover { text-decoration: underline; }
+#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
+#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
+#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
+#HTMLReporter .version { color: #aaaaaa; }
+#HTMLReporter .banner { margin-top: 14px; }
+#HTMLReporter .duration { color: #aaaaaa; float: right; }
+#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
+#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
+#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
+#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
+#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
+#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
+#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
+#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
+#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
+#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
+#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
+#HTMLReporter .runningAlert { background-color: #666666; }
+#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
+#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
+#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
+#HTMLReporter .passingAlert { background-color: #a6b779; }
+#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
+#HTMLReporter .failingAlert { background-color: #cf867e; }
+#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
+#HTMLReporter .results { margin-top: 14px; }
+#HTMLReporter #details { display: none; }
+#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
+#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
+#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
+#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
+#HTMLReporter.showDetails .summary { display: none; }
+#HTMLReporter.showDetails #details { display: block; }
+#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
+#HTMLReporter .summary { margin-top: 14px; }
+#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
+#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
+#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
+#HTMLReporter .description + .suite { margin-top: 0; }
+#HTMLReporter .suite { margin-top: 14px; }
+#HTMLReporter .suite a { color: #333333; }
+#HTMLReporter #details .specDetail { margin-bottom: 28px; }
+#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
+#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
+#HTMLReporter .resultMessage span.result { display: block; }
+#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
+
+#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
+#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
+#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
+#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
+#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
+#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
+#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
+#TrivialReporter .runner.running { background-color: yellow; }
+#TrivialReporter .options { text-align: right; font-size: .8em; }
+#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
+#TrivialReporter .suite .suite { margin: 5px; }
+#TrivialReporter .suite.passed { background-color: #dfd; }
+#TrivialReporter .suite.failed { background-color: #fdd; }
+#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
+#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
+#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
+#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
+#TrivialReporter .spec.skipped { background-color: #bbb; }
+#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
+#TrivialReporter .passed { background-color: #cfc; display: none; }
+#TrivialReporter .failed { background-color: #fbb; }
+#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
+#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
+#TrivialReporter .resultMessage .mismatch { color: black; }
+#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
+#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
+#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
+#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
+#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }


[07/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/sorted_collection.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/sorted_collection.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/sorted_collection.js
new file mode 100644
index 0000000..bdeca90
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/sorted_collection.js
@@ -0,0 +1,558 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+/**
+  @name SortedCollection
+  @namespace SortedCollection
+  @constructor
+*/
+
+var SortedCollection = function (d) {
+  this.count = 0;
+  this.items = {}; // Hash keys and their values
+  this.order = []; // Array for sort order
+  if (d) {
+    this.defaultValue = d;
+  };
+};
+
+SortedCollection.prototype = new (function () {
+  /**
+    @name SortedCollection#addItem
+    @public
+    @function
+    @return {Any} The given val is returned
+    @description Adds a new key/value to the collection
+    @param {String} key The key for the collection item
+    @param {Any} val The value for the collection item
+  */
+  this.addItem = function (key, val) {
+    if (typeof key != 'string') {
+      throw('Hash only allows string keys.');
+    }
+    return this.setByKey(key, val);
+  };
+
+  /**
+    @name SortedCollection#getItem
+    @public
+    @function
+    @return {Any} The value for the given identifier is returned
+    @description Retrieves the value for the given identifier that being a key or index
+    @param {String/Number} p The identifier to look in the collection for, being a key or index
+  */
+  this.getItem = function (p) {
+    if (typeof p == 'string') {
+      return this.getByKey(p);
+    }
+    else if (typeof p == 'number') {
+      return this.getByIndex(p);
+    }
+  };
+
+  /**
+    @name SortedCollection#setItem
+    @public
+    @function
+    @return {Any} The given val is returned
+    @description Sets the item in the collection with the given val, overwriting the existsing item
+      if identifier is an index
+    @param {String/Number} p The identifier set in the collection, being either a key or index
+    @param {Any} val The value for the collection item
+  */
+  this.setItem = function (p, val) {
+    if (typeof p == 'string') {
+      return this.setByKey(p, val);
+    }
+    else if (typeof p == 'number') {
+      return this.setByIndex(p, val);
+    }
+  };
+
+  /**
+    @name SortedCollection#removeItem
+    @public
+    @function
+    @return {Boolean} Returns true if the item has been removed, false otherwise
+    @description Removes the item for the given identifier
+    @param {String/Number} p The identifier to delete the item for, being a key or index
+  */
+  this.removeItem = function (p) {
+    if (typeof p == 'string') {
+      return this.removeByKey(p);
+    }
+    else if (typeof p == 'number') {
+      return this.removeByIndex(p);
+    }
+  };
+
+  /**
+    @name SortedCollection#getByKey
+    @public
+    @function
+    @return {Any} The value for the given key item is returned
+    @description Retrieves the value for the given key
+    @param {String} key The key for the item to lookup
+  */
+  this.getByKey = function (key) {
+    return this.items[key];
+  };
+
+  /**
+    @name SortedCollection#setByKey
+    @public
+    @function
+    @return {Any} The given val is returned
+    @description Sets a item by key assigning the given val
+    @param {String} key The key for the item
+    @param {Any} val The value to set for the item
+  */
+  this.setByKey = function (key, val) {
+    var v = null;
+    if (typeof val == 'undefined') {
+      v = this.defaultValue;
+    }
+    else { v = val; }
+    if (typeof this.items[key] == 'undefined') {
+      this.order[this.count] = key;
+      this.count++;
+    }
+    this.items[key] = v;
+    return this.items[key];
+  };
+
+  /**
+    @name SortedCollection#removeByKey
+    @public
+    @function
+    @return {Boolean} If the item was removed true is returned, false otherwise
+    @description Removes a collection item by key
+    @param {String} key The key for the item to remove
+  */
+  this.removeByKey = function (key) {
+    if (typeof this.items[key] != 'undefined') {
+      var pos = null;
+      delete this.items[key]; // Remove the value
+      // Find the key in the order list
+      for (var i = 0; i < this.order.length; i++) {
+        if (this.order[i] == key) {
+          pos = i;
+        }
+      }
+      this.order.splice(pos, 1); // Remove the key
+      this.count--; // Decrement the length
+      return true;
+    }
+    else {
+      return false;
+    }
+  };
+
+  /**
+    @name SortedCollection#getByIndex
+    @public
+    @function
+    @return {Any} The value for the given index item is returned
+    @description Retrieves the value for the given index
+    @param {Number} ind The index to lookup for the item
+  */
+  this.getByIndex = function (ind) {
+    return this.items[this.order[ind]];
+  };
+
+  /**
+    @name SortedCollection#setByIndex
+    @public
+    @function
+    @return {Any} The given val is returned
+    @description Sets a item by index assigning the given val
+    @param {Number} ind The index for the item
+    @param {Any} val The value to set for the item
+  */
+  this.setByIndex = function (ind, val) {
+    if (ind < 0 || ind >= this.count) {
+      throw('Index out of bounds. Hash length is ' + this.count);
+    }
+    this.items[this.order[ind]] = val;
+    return this.items[this.order[ind]];
+  };
+
+  /**
+    @name SortedCollection#removeByIndex
+    @public
+    @function
+    @return {Boolean} If the item was removed true is returned, false otherwise
+    @description Removes a collection item by index
+    @param {Number} ind The index for the item to remove
+  */
+  this.removeByIndex = function (ind) {
+    var ret = this.items[this.order[ind]];
+    if (typeof ret != 'undefined') {
+      delete this.items[this.order[ind]]
+      this.order.splice(ind, 1);
+      this.count--;
+      return true;
+    }
+    else {
+      return false;
+    }
+  };
+
+  /**
+    @name SortedCollection#hasKey
+    @public
+    @function
+    @return {Boolean} Returns true if the item exists, false otherwise
+    @description Checks if a key item exists in the collection
+    @param {String} key The key to look for in the collection
+  */
+  this.hasKey = function (key) {
+    return typeof this.items[key] != 'undefined';
+  };
+
+  /**
+    @name SortedCollection#hasValue
+    @public
+    @function
+    @return {Boolean} Returns true if a key with the given value exists, false otherwise
+    @description Checks if a key item in the collection has a given val
+    @param {Any} val The value to check for in the collection
+  */
+  this.hasValue = function (val) {
+    for (var i = 0; i < this.order.length; i++) {
+      if (this.items[this.order[i]] == val) {
+        return true;
+      }
+    }
+    return false;
+  };
+
+  /**
+    @name SortedCollection#allKeys
+    @public
+    @function
+    @return {String} Returns all the keys in a string
+    @description Joins all the keys into a string
+    @param {String} str The string to use between each key
+  */
+  this.allKeys = function (str) {
+    return this.order.join(str);
+  };
+
+  /**
+    @name SortedCollection#replaceKey
+    @public
+    @function
+    @description Joins all the keys into a string
+    @param {String} oldKey The key item to change
+    @param {String} newKey The key item to change the name to
+  */
+  this.replaceKey = function (oldKey, newKey) {
+    // If item for newKey exists, nuke it
+    if (this.hasKey(newKey)) {
+      this.removeItem(newKey);
+    }
+    this.items[newKey] = this.items[oldKey];
+    delete this.items[oldKey];
+    for (var i = 0; i < this.order.length; i++) {
+      if (this.order[i] == oldKey) {
+        this.order[i] = newKey;
+      }
+    }
+  };
+
+  /**
+    @name SortedCollection#insertAtIndex
+    @public
+    @function
+    @return {Boolean} Returns true if the item was set at the given index
+    @description Inserts a key/value at a specific index in the collection
+    @param {Number} ind The index to set the item at
+    @param {String} key The key to use at the item index
+    @param {Any} val The value to set for the item
+  */
+  this.insertAtIndex = function (ind, key, val) {
+    this.order.splice(ind, 0, key);
+    this.items[key] = val;
+    this.count++;
+    return true;
+  };
+
+  /**
+    @name SortedCollection#insertAfterKey
+    @public
+    @function
+    @return {Boolean} Returns true if the item was set for the given key
+    @description Inserts a key/value item after the given reference key in the collection
+    @param {String} refKey The key to insert the new item after
+    @param {String} key The key for the new item
+    @param {Any} val The value to set for the item
+  */
+  this.insertAfterKey = function (refKey, key, val) {
+    var pos = this.getPosition(refKey);
+    return this.insertAtIndex(pos, key, val);
+  };
+
+  /**
+    @name SortedCollection#getPosition
+    @public
+    @function
+    @return {Number} Returns the index for the item of the given key
+    @description Retrieves the index of the key item
+    @param {String} key The key to get the index for
+  */
+  this.getPosition = function (key) {
+    var order = this.order;
+    if (typeof order.indexOf == 'function') {
+      return order.indexOf(key);
+    }
+    else {
+      for (var i = 0; i < order.length; i++) {
+        if (order[i] == key) { return i;}
+      }
+    }
+  };
+
+  /**
+    @name SortedCollection#each
+    @public
+    @function
+    @return {Boolean}
+    @description Loops through the collection and calls the given function
+    @param {Function} func The function to call for each collection item, the arguments
+      are the key and value for the current item
+    @param {Object} opts The options to use
+      @param {Boolean} [opts.keyOnly] Only give the function the key
+      @param {Boolean} [opts.valueOnly] Only give the function the value
+  */
+  this.each = function (func, opts) {
+    var options = opts || {}
+      , order = this.order;
+    for (var i = 0, ii = order.length; i < ii; i++) {
+      var key = order[i];
+      var val = this.items[key];
+      if (options.keyOnly) {
+        func(key);
+      }
+      else if (options.valueOnly) {
+        func(val);
+      }
+      else {
+        func(val, key);
+      }
+    }
+    return true;
+  };
+
+  /**
+    @name SortedCollection#eachKey
+    @public
+    @function
+    @return {Boolean}
+    @description Loops through the collection and calls the given function
+    @param {Function} func The function to call for each collection item, only giving the
+      key to the function
+  */
+  this.eachKey = function (func) {
+    return this.each(func, { keyOnly: true });
+  };
+
+  /**
+    @name SortedCollection#eachValue
+    @public
+    @function
+    @return {Boolean}
+    @description Loops through the collection and calls the given function
+    @param {Function} func The function to call for each collection item, only giving the
+      value to the function
+  */
+  this.eachValue = function (func) {
+    return this.each(func, { valueOnly: true });
+  };
+
+  /**
+    @name SortedCollection#clone
+    @public
+    @function
+    @return {Object} Returns a new SortedCollection with the data of the current one
+    @description Creates a cloned version of the current collection and returns it
+  */
+  this.clone = function () {
+    var coll = new SortedCollection()
+      , key
+      , val;
+    for (var i = 0; i < this.order.length; i++) {
+      key = this.order[i];
+      val = this.items[key];
+      coll.setItem(key, val);
+    }
+    return coll;
+  };
+
+  /**
+    @name SortedCollection#concat
+    @public
+    @function
+    @description Join a given collection with the current one
+    @param {Object} hNew A SortedCollection to join from
+  */
+  this.concat = function (hNew) {
+    for (var i = 0; i < hNew.order.length; i++) {
+      var key = hNew.order[i];
+      var val = hNew.items[key];
+      this.setItem(key, val);
+    }
+  };
+
+  /**
+    @name SortedCollection#push
+    @public
+    @function
+    @return {Number} Returns the count of items
+    @description Appends a new item to the collection
+    @param {String} key The key to use for the item
+    @param {Any} val The value to use for the item
+  */
+  this.push = function (key, val) {
+    this.insertAtIndex(this.count, key, val);
+    return this.count;
+  };
+
+  /**
+    @name SortedCollection#pop
+    @public
+    @function
+    @return {Any} Returns the value for the last item in the collection
+    @description Pops off the last item in the collection and returns it's value
+  */
+  this.pop = function () {
+    var pos = this.count-1;
+    var ret = this.items[this.order[pos]];
+    if (typeof ret != 'undefined') {
+      this.removeByIndex(pos);
+      return ret;
+    }
+    else {
+      return;
+    }
+  };
+
+  /**
+    @name SortedCollection#unshift
+    @public
+    @function
+    @return {Number} Returns the count of items
+    @description Prepends a new item to the beginning of the collection
+    @param {String} key The key to use for the item
+    @param {Any} val The value to use for the item
+  */
+  this.unshift = function (key, val) {
+    this.insertAtIndex(0, key, val);
+    return this.count;
+  };
+
+  /**
+    @name SortedCollection#shift
+    @public
+    @function
+    @return {Number} Returns the removed items value
+    @description Removes the first item in the list and returns it's value
+  */
+  this.shift = function () {
+    var pos = 0;
+    var ret = this.items[this.order[pos]];
+    if (typeof ret != 'undefined') {
+      this.removeByIndex(pos);
+      return ret;
+    }
+    else {
+      return;
+    }
+  };
+
+  /**
+    @name SortedCollection#splice
+    @public
+    @function
+    @description Removes items from index to the given max and then adds the given
+      collections items
+    @param {Number} index The index to start at when removing items
+    @param {Number} numToRemove The number of items to remove before adding the new items
+    @param {Object} hash the collection of items to add
+  */
+  this.splice = function (index, numToRemove, hash) {
+    var _this = this;
+    // Removal
+    if (numToRemove > 0) {
+      // Items
+      var limit = index + numToRemove;
+      for (var i = index; i < limit; i++) {
+        delete this.items[this.order[i]];
+      }
+      // Order
+      this.order.splice(index, numToRemove);
+    }
+    // Adding
+    if (hash) {
+      // Items
+      for (var i in hash.items) {
+        this.items[i] = hash.items[i];
+      }
+      // Order
+      var args = hash.order;
+      args.unshift(0);
+      args.unshift(index);
+      this.order.splice.apply(this.order, args);
+    }
+    this.count = this.order.length;
+  };
+
+  this.sort = function (c) {
+    var arr = [];
+    // Assumes vals are comparable scalars
+    var comp = function (a, b) {
+      return c(a.val, b.val);
+    }
+    for (var i = 0; i < this.order.length; i++) {
+      var key = this.order[i];
+      arr[i] = { key: key, val: this.items[key] };
+    }
+    arr.sort(comp);
+    this.order = [];
+    for (var i = 0; i < arr.length; i++) {
+      this.order.push(arr[i].key);
+    }
+  };
+
+  this.sortByKey = function (comp) {
+    this.order.sort(comp);
+  };
+
+  /**
+    @name SortedCollection#reverse
+    @public
+    @function
+    @description Reverse the collection item list
+  */
+  this.reverse = function () {
+    this.order.reverse();
+  };
+
+})();
+
+module.exports.SortedCollection = SortedCollection;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/string.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/string.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/string.js
new file mode 100644
index 0000000..9c35a08
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/string.js
@@ -0,0 +1,791 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var core = require('./core')
+  , inflection = require('./inflection')
+  , string;
+
+
+/**
+  @name string
+  @namespace string
+*/
+
+string = new (function () {
+
+  // Regexes for trimming, and character maps for escaping
+  var _LTR = /^\s+/
+    , _RTR = /\s+$/
+    , _TR = /^\s+|\s+$/g
+    , _NL = /\n|\r|\r\n/g
+    , _CHARS = {
+          '&': '&amp;'
+        , '<': '&lt;'
+        , '>': '&gt;'
+        , '"': '&quot;'
+        , '\'': '&#39;'
+      }
+    , _UUID_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
+    , _buildEscape
+    , _buildEscapeTest;
+
+  // Builds the escape/unescape methods using a
+  // map of characters
+  _buildEscape = function (direction) {
+    return function (str) {
+      var string = str;
+
+      // If string is NaN, null or undefined then provide an empty default
+      if((typeof string === 'undefined') ||
+          string === null ||
+          (!string && isNaN(string))) {
+        string = '';
+      }
+      string = string.toString();
+
+      var from, to, p;
+      for (p in _CHARS) {
+        from = direction == 'to' ? p : _CHARS[p];
+        to = direction == 'to' ? _CHARS[p] : p;
+
+        string = string.replace(new RegExp(from, 'gm'), to);
+      }
+
+      return string;
+    }
+  };
+
+  // Builds a method that tests for any escapable
+  // characters, useful for avoiding double-scaping if
+  // you're not sure if a string has already been escaped
+  _buildEscapeTest = function (direction) {
+    return function (string) {
+      var pat = ''
+        , p;
+
+      for (p in _CHARS) {
+        pat += direction == 'to' ? p : _CHARS[p];
+        pat += '|';
+      }
+
+      pat = pat.substr(0, pat.length - 1);
+      pat = new RegExp(pat, "gm");
+      return pat.test(string)
+    }
+  };
+
+  // Escape special XMl chars
+  this.escapeXML = _buildEscape('to');
+
+  // Unescape XML chars to literal representation
+  this.unescapeXML = _buildEscape('from');
+
+  // Test if a string includes special chars
+  // that need escaping
+  this.needsEscape = _buildEscapeTest('to');
+
+  // Test if a string includes escaped chars
+  // that need unescaping
+  this.needsUnescape = _buildEscapeTest('from');
+
+  /**
+    @name string#escapeRegExpChars
+    @public
+    @function
+    @return {String} A string of escaped characters
+    @description Escapes regex control-characters in strings
+                 used to build regexes dynamically
+    @param {String} string The string of chars to escape
+  */
+  this.escapeRegExpChars = (function () {
+    var specials = [ '^', '$', '/', '.', '*', '+', '?', '|', '(', ')',
+        '[', ']', '{', '}', '\\' ];
+    sRE = new RegExp('(\\' + specials.join('|\\') + ')', 'g');
+    return function (string) {
+      var str = string || '';
+      str = String(str);
+      return str.replace(sRE, '\\$1');
+    };
+  }).call(this);
+
+  /**
+    @name string#toArray
+    @public
+    @function
+    @return {Array} Returns an array of characters
+    @description Converts a string to an array
+    @param {String} string The string to convert
+  */
+  this.toArray = function (string) {
+    var str = string || ''
+      , arr = []
+      , i = -1;
+    str = String(str);
+
+    while (++i < str.length) {
+      arr.push(str.substr(i, 1));
+    }
+
+    return arr;
+  };
+
+  /**
+    @name string#reverse
+    @public
+    @function
+    @return {String} Returns the `string` reversed
+    @description Reverses a string
+    @param {String} string The string to reverse
+  */
+  this.reverse = function (string) {
+    var str = string || '';
+    str = String(str);
+    return this.toArray(str).reverse().join('');
+  };
+
+  /**
+    @name string#ltrim
+    @public
+    @function
+    @return {String} Returns the trimmed string
+    @description Ltrim trims `char` from the left of a `string` and returns it
+                 if no `char` is given it will trim spaces
+    @param {String} string The string to trim
+    @param {String} char The character to trim
+  */
+  this.ltrim = function (string, char) {
+    var str = string || ''
+      , pat = char ? new RegExp('^' + char + '+') : _LTR;
+    str = String(str);
+
+    return str.replace(pat, '');
+  };
+
+  /**
+    @name string#rtrim
+    @public
+    @function
+    @return {String} Returns the trimmed string
+    @description Rtrim trims `char` from the right of a `string` and returns it
+                 if no `char` is given it will trim spaces
+    @param {String} string The string to trim
+    @param {String} char The character to trim
+  */
+  this.rtrim = function (string, char) {
+    var str = string || ''
+      , pat = char ? new RegExp(char + '+$') : _RTR;
+    str = String(str);
+
+    return str.replace(pat, '');
+  };
+
+  // Alias
+  this.chomp = this.rtrim;
+
+  /**
+    @name string#trim
+    @public
+    @function
+    @return {String} Returns the trimmed string
+    @description Trim trims `char` from the left and right of a `string` and returns it
+                 if no `char` is given it will trim spaces
+    @param {String} string The string to trim
+    @param {String} char The character to trim
+  */
+  this.trim = function (string, char) {
+    var str = string || ''
+      , pat = char ? new RegExp('^' + char + '+|' + char + '+$', 'g') : _TR;
+    str = String(str);
+
+    return str.replace(pat, '');
+  };
+
+  /**
+    @name string#chop
+    @public
+    @function
+    @description Returns a new String with the last character removed. If the
+                 string ends with \r\n, both characters are removed. Applying chop to an
+                 empty string returns an empty string.
+    @param {String} string to return with the last character removed.
+  */
+  this.chop = function (string) {
+    var index
+      , str = string || '';
+    str = String(str);
+
+    if (str.length) {
+      // Special-case for \r\n
+      index = str.indexOf('\r\n');
+      if (index == str.length - 2) {
+        return str.substring(0, index);
+      }
+      return str.substring(0, str.length - 1);
+    }
+    else {
+      return '';
+    }
+  };
+
+  /**
+    @name string#lpad
+    @public
+    @function
+    @return {String} Returns the padded string
+    @description Lpad adds `char` to the left of `string` until the length
+                 of `string` is more than `width`
+    @param {String} string The string to pad
+    @param {String} char The character to pad with
+    @param {Number} width the width to pad to
+  */
+  this.lpad = function (string, char, width) {
+    var str = string || ''
+      , width;
+    str = String(str);
+
+    // Should width be string.length + 1? or the same to be safe
+    width = parseInt(width, 10) || str.length;
+    char = char || ' ';
+
+    while (str.length < width) {
+      str = char + str;
+    }
+    return str;
+  };
+
+  /**
+    @name string#rpad
+    @public
+    @function
+    @return {String} Returns the padded string
+    @description Rpad adds `char` to the right of `string` until the length
+                 of `string` is more than `width`
+    @param {String} string The string to pad
+    @param {String} char The character to pad with
+    @param {Number} width the width to pad to
+  */
+  this.rpad = function (string, char, width) {
+    var str = string || ''
+      , width;
+    str = String(str);
+
+    // Should width be string.length + 1? or the same to be safe
+    width = parseInt(width, 10) || str.length;
+    char = char || ' ';
+
+    while (str.length < width) {
+      str += char;
+    }
+    return str;
+  };
+
+  /**
+    @name string#pad
+    @public
+    @function
+    @return {String} Returns the padded string
+    @description Pad adds `char` to the left and right of `string` until the length
+                 of `string` is more than `width`
+    @param {String} string The string to pad
+    @param {String} char The character to pad with
+    @param {Number} width the width to pad to
+  */
+  this.pad = function (string, char, width) {
+    var str = string || ''
+      , width;
+    str = String(str);
+
+    // Should width be string.length + 1? or the same to be safe
+    width = parseInt(width, 10) || str.length;
+    char = char || ' ';
+
+    while (str.length < width) {
+      str = char + str + char;
+    }
+    return str;
+  };
+
+  /**
+    @name string#truncate
+    @public
+    @function
+    @return {String} Returns the truncated string
+    @description Truncates a given `string` after a specified `length` if `string` is longer than
+                 `length`. The last characters will be replaced with an `omission` for a total length
+                 not exceeding `length`. If `callback` is given it will fire if `string` is truncated.
+    @param {String} string The string to truncate
+    @param {Integer/Object} options Options for truncation, If options is an Integer it will be length
+      @param {Integer} [options.length=string.length] Length the output string will be
+      @param {Integer} [options.len] Alias for `length`
+      @param {String} [options.omission='...'] Replace last characters with an omission
+      @param {String} [options.ellipsis='...'] Alias for `omission`
+      @param {String/RegExp} [options.seperator] Break the truncated test at the nearest `seperator`
+    @param {Function} callback Callback is called only if a truncation is done
+  */
+  this.truncate = function (string, options, callback) {
+    var str = string || ''
+      , stringLen
+      , opts
+      , stringLenWithOmission
+      , last
+      , ignoreCase
+      , multiLine
+      , stringToWorkWith
+      , lastIndexOf
+      , nextStop
+      , result
+      , returnString;
+
+    str = String(str);
+    stringLen = str.length
+
+    // If `options` is a number, assume it's the length and
+    // create a options object with length
+    if (typeof options === 'number') {
+      opts = {
+        length: options
+      };
+    }
+    else {
+      opts = options || {};
+    }
+
+    // Set `opts` defaults
+    opts.length = opts.length || stringLen;
+    opts.omission = opts.omission || opts.ellipsis || '...';
+
+    stringLenWithOmission = opts.length - opts.omission.length;
+
+    // Set the index to stop at for `string`
+    if (opts.seperator) {
+      if (opts.seperator instanceof RegExp) {
+        // If `seperator` is a regex
+        if (opts.seperator.global) {
+          opts.seperator = opts.seperator;
+        } else {
+          ignoreCase = opts.seperator.ignoreCase ? 'i' : ''
+          multiLine = opts.seperator.multiLine ? 'm' : '';
+          opts.seperator = new RegExp(opts.seperator.source,
+              'g' + ignoreCase + multiLine);
+        }
+        stringToWorkWith = str.substring(0, stringLenWithOmission + 1)
+        lastIndexOf = -1
+        nextStop = 0
+
+        while ((result = opts.seperator.exec(stringToWorkWith))) {
+          lastIndexOf = result.index;
+          opts.seperator.lastIndex = ++nextStop;
+        }
+        last = lastIndexOf;
+      }
+      else {
+        // Seperator is a String
+        last = str.lastIndexOf(opts.seperator, stringLenWithOmission);
+      }
+
+      // If the above couldn't be found, they'll default to -1 so,
+      // we need to just set it as `stringLenWithOmission`
+      if (last === -1) {
+        last = stringLenWithOmission;
+      }
+    }
+    else {
+      last = stringLenWithOmission;
+    }
+
+    if (stringLen < opts.length) {
+      return str;
+    }
+    else {
+      returnString = str.substring(0, last) + opts.omission;
+      returnString += callback && typeof callback === 'function' ? callback() : '';
+      return returnString;
+    }
+  };
+
+  /**
+    @name string#truncateHTML
+    @public
+    @function
+    @return {String} Returns the HTML safe truncated string
+    @description Truncates a given `string` inside HTML tags after a specified `length` if string`
+                 is longer than `length`. The last characters will be replaced with an `omission`
+                 for a total length not exceeding `length`. If `callback` is given it will fire if
+                 `string` is truncated. If `once` is true only the first string in the first HTML
+                 tags will be truncated leaving the others as they were
+    @param {String} string The string to truncate
+    @param {Integer/Object} options Options for truncation, If options is an Integer it will be length
+                            all Object options are the same as `truncate`
+      @param {Boolean} [options.once=false] If true, it will only be truncated once, otherwise the
+                                            truncation will loop through all text inside HTML tags
+    @param {Function} callback Callback is called only if a truncation is done
+  */
+  this.truncateHTML = function (string, options, callback) {
+    var str = string || ''
+      , returnString = ''
+      , opts = options;
+
+    str = String(str);
+
+    // If `options` is a number assume it's the length and create a options object with length
+    if (typeof opts === 'number') {
+      var num = opts;
+
+      opts = {};
+      opts.length = num;
+    } else opts = opts || {};
+
+    // Set `default` options for HTML specifics
+    opts.once = opts.once || false;
+
+    var pat = /(<[^>]*>)/ // Patter for matching HTML tags
+      , arr = [] // Holds the HTML tags and content seperately
+      , truncated = false
+      , result = pat.exec(str)
+      , item
+      , firstPos
+      , lastPos
+      , i;
+
+    // Gather the HTML tags and content into the array
+    while (result) {
+      firstPos = result.index;
+      lastPos = pat.lastIndex;
+
+      if (firstPos !== 0) {
+        // Should be content not HTML tags
+        arr.push(str.substring(0, firstPos));
+        // Slice content from string
+        str = str.slice(firstPos);
+      }
+
+      arr.push(result[0]); // Push HTML tags
+      str = str.slice(result[0].length);
+
+      // Re-run the pattern on the new string
+      result = pat.exec(str);
+    }
+    if (str !== '') {
+      arr.push(str);
+    }
+
+    // Loop through array items appending the tags to the string,
+    // - and truncating the text then appending it to content
+    i = -1;
+    while (++i < arr.length) {
+      item = arr[i];
+      switch (true) {
+        // Closing tag
+        case item.indexOf('</') == 0:
+          returnString += item;
+          openTag = null;
+          break;
+        // Opening tag
+        case item.indexOf('<') == 0:
+          returnString += item;
+          openTag = item;
+          break;
+        // Normal text
+        default:
+          if (opts.once && truncated) {
+            returnString += item;
+          } else {
+            returnString += this.truncate(item, opts, callback);
+            truncated = true;
+          }
+          break;
+      }
+    }
+
+    return returnString;
+  };
+
+  /**
+    @name string#nl2br
+    @public
+    @function
+    @return {String} The string with converted newlines chars to br tags
+    @description Nl2br returns a string where all newline chars are turned
+                 into line break HTML tags
+    @param {String} string The string to convert
+  */
+  this.nl2br = function (string) {
+    var str = string || '';
+    str = String(str);
+
+    return str.replace(_NL,'<br />');
+  };
+
+  /**
+    @name string#snakeize
+    @public
+    @function
+    @return {String} The string in a snake_case version
+    @description Snakeize converts camelCase and CamelCase strings to snake_case strings
+    @param {String} string The string to convert to snake_case
+    @param {String} separ='_' The seperator to use
+  */
+  this.snakeize = (function () {
+    // Only create regexes once on initial load
+    var repl = /([A-Z]+)/g
+      , lead = /^_/g;
+    return function (string, separ) {
+      var str = string || ''
+        , sep = separ || '_'
+        , leading = separ ? new RegExp('^' + sep, 'g') : lead;
+      str = String(str);
+      return str.replace(repl, sep + '$1').toLowerCase().
+        replace(leading, '');
+    };
+  }).call(this);
+
+  // Aliases
+  /**
+    @name string#underscorize
+    @public
+    @function
+    @return {String} The string in a underscorized version
+    @description Underscorize returns the given `string` converting camelCase and snakeCase to underscores
+    @param {String} string The string to underscorize
+  */
+  this.underscorize = this.snakeize;
+  this.underscoreize = this.snakeize;
+  this.decamelize = this.snakeize;
+
+  /**
+    @name string#camelize
+    @public
+    @function
+    @return {String} The string in a camelCase version
+    @description Camelize takes a string and optional options and
+                 returns a camelCase version of the given `string`
+    @param {String} string The string to convert to camelCase
+    @param {Object} options
+      @param {Boolean} [options.initialCap] If initialCap is true the returned
+                                            string will have a capitalized first letter
+      @param {Boolean} [options.leadingUnderscore] If leadingUnderscore os true then if
+                                                   an underscore exists at the beggining
+                                                   of the string, it will stay there.
+                                                   Otherwise it'll be removed.
+  */
+  this.camelize = (function () {
+    // Only create regex once on initial load
+    var repl = /[-_](\w)/g;
+    return function (string, options) {
+      var str = string || ''
+        , ret
+        , config = {
+            initialCap: false
+          , leadingUnderscore: false
+          }
+        , opts = options || {};
+
+      str = String(str);
+
+      // Backward-compat
+      if (typeof opts == 'boolean') {
+        config = {
+          initialCap: true
+        };
+      }
+      else {
+        core.mixin(config, opts);
+      }
+
+      ret = str.replace(repl, function (m, m1) {
+        return m1.toUpperCase();
+      });
+
+      if (config.leadingUnderscore & str.indexOf('_') === 0) {
+        ret = '_' + this.decapitalize(ret);
+      }
+      // If initialCap is true capitalize it
+      ret = config.initialCap ? this.capitalize(ret) : this.decapitalize(ret);
+
+      return ret;
+    };
+  }).call(this);
+
+  /**
+    @name string#decapitalize
+    @public
+    @function
+    @return {String} The string with the first letter decapitalized
+    @description Decapitalize returns the given string with the first letter uncapitalized.
+    @param {String} string The string to decapitalize
+  */
+  this.decapitalize = function (string) {
+    var str = string || '';
+    str = String(str);
+
+    return str.substr(0, 1).toLowerCase() + str.substr(1);
+  };
+
+  /**
+    @name string#capitalize
+    @public
+    @function
+    @return {String} The string with the first letter capitalized
+    @description capitalize returns the given string with the first letter capitalized.
+    @param {String} string The string to capitalize
+  */
+  this.capitalize = function (string) {
+    var str = string || '';
+    str = String(str);
+
+    return str.substr(0, 1).toUpperCase() + str.substr(1);
+  };
+
+  /**
+    @name string#dasherize
+    @public
+    @function
+    @return {String} The string in a dashed version
+    @description Dasherize returns the given `string` converting camelCase and snakeCase
+                 to dashes or replace them with the `replace` character.
+    @param {String} string The string to dasherize
+    @param {String} replace='-' The character to replace with
+  */
+  this.dasherize = function (string, replace) {
+    var repl = replace || '-'
+    return this.snakeize(string, repl);
+  };
+
+  /**
+    @name string#include
+    @public
+    @function
+    @return {Boolean} Returns true if the string is found in the string to search
+    @description Searches for a particular string in another string
+    @param {String} searchIn The string to search for the other string in
+    @param {String} searchFor The string to search for
+  */
+  this.include = function (searchIn, searchFor) {
+    var str = searchFor;
+    if (!str && typeof string != 'string') {
+      return false;
+    }
+    str = String(str);
+    return (searchIn.indexOf(str) > -1);
+  };
+
+  /*
+   * getInflections(name<String>, initialCap<String>)
+   *
+   * Inflection returns an object that contains different inflections
+   * created from the given `name`
+  */
+
+  /**
+    @name string#getInflections
+    @public
+    @function
+    @return {Object} A Object containing multiple different inflects for the given `name`
+    @description Inflection returns an object that contains different inflections
+                 created from the given `name`
+    @param {String} name The string to create inflections from
+  */
+  this.getInflections = function (name) {
+    if (!name) {
+      return;
+    }
+
+    var self = this
+        // Use plural version to fix possible mistakes(e,g,. thingie instead of thingy)
+      , normalizedName = this.snakeize(inflection.pluralize(name))
+      , nameSingular = inflection.singularize(normalizedName)
+      , namePlural = inflection.pluralize(normalizedName);
+
+    return {
+      // For filepaths or URLs
+      filename: {
+        // neil_peart
+        singular: nameSingular
+        // neil_pearts
+      , plural: namePlural
+      }
+      // Constructor names
+    , constructor: {
+        // NeilPeart
+        singular: self.camelize(nameSingular, {initialCap: true})
+        // NeilPearts
+      , plural: self.camelize(namePlural, {initialCap: true})
+      }
+    , property: {
+        // neilPeart
+        singular: self.camelize(nameSingular)
+        // neilPearts
+      , plural: self.camelize(namePlural)
+      }
+    };
+  };
+
+  /**
+    @name string#getInflection
+    @public
+    @function
+    @return {Object} A Object containing multiple different inflects for the given `name`
+    @description Inflection returns an object that contains different inflections
+                 created from the given `name`
+    @param {String} name The string to create inflections from
+  */
+  this.getInflection = function (name, key, pluralization) {
+    var infl = this.getInflections(name);
+    return infl[key][pluralization];
+  };
+
+  // From Math.uuid.js, https://github.com/broofa/node-uuid
+  // Robert Kieffer (robert@broofa.com), MIT license
+  this.uuid = function (length, radix) {
+    var chars = _UUID_CHARS
+      , uuid = []
+      , r
+      , i;
+
+    radix = radix || chars.length;
+
+    if (length) {
+      // Compact form
+      i = -1;
+      while (++i < length) {
+        uuid[i] = chars[0 | Math.random()*radix];
+      }
+    } else {
+      // rfc4122, version 4 form
+
+      // rfc4122 requires these characters
+      uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
+      uuid[14] = '4';
+
+      // Fill in random data.  At i==19 set the high bits of clock sequence as
+      // per rfc4122, sec. 4.1.5
+      i = -1;
+      while (++i < 36) {
+        if (!uuid[i]) {
+          r = 0 | Math.random()*16;
+          uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
+        }
+      }
+    }
+
+    return uuid.join('');
+  };
+
+})();
+
+module.exports = string;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/uri.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/uri.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/uri.js
new file mode 100644
index 0000000..92f086f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/uri.js
@@ -0,0 +1,177 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var uri
+  , string = require('./string');
+
+/**
+  @name uri
+  @namespace uri
+*/
+
+uri = new (function () {
+  var _isArray = function (obj) {
+    return obj &&
+      typeof obj === 'object' &&
+      typeof obj.length === 'number' &&
+      typeof obj.splice === 'function' &&
+      !(obj.propertyIsEnumerable('length'));
+  };
+
+  /**
+    @name uri#getFileExtension
+    @public
+    @function
+    @return {String} Returns the file extension for a given path
+    @description Gets the file extension for a path and returns it
+    @param {String} path The path to get the extension for
+  */
+  this.getFileExtension = function (path) {
+    var match;
+    if (path) {
+      match = /.+\.(\w{2,4}$)/.exec(path);
+    }
+    return (match && match[1]) || '';
+  };
+
+  /**
+    @name uri#paramify
+    @public
+    @function
+    @return {String} Returns a querystring contains the given values
+    @description Convert a JS Object to a querystring (key=val&key=val). Values in arrays
+      will be added as multiple parameters
+    @param {Object} obj An Object containing only scalars and arrays
+    @param {Object} o The options to use for formatting
+      @param {Boolean} [o.consolidate=false] take values from elements that can return
+        multiple values (multi-select, checkbox groups) and collapse into a single,
+        comman-delimited value.
+      @param {Boolean} [o.includeEmpty=false] include keys in the string for all elements, even
+        they have no value set (e.g., even if elemB has no value: elemA=foo&elemB=&elemC=bar).
+        Note that some false-y values are always valid even without this option, [0, ''].
+        This option extends coverage to [null, undefined, NaN]
+      @param {Boolean} [o.snakeize=false] change param names from camelCase to snake_case.
+      @param {Boolean} [o.escapeVals=false] escape the values for XML entities.
+  */
+  this.paramify = function (obj, o) {
+    var opts = o || {},
+        str = '',
+        key,
+        val,
+        isValid,
+        itemArray,
+        arr = [],
+        arrVal;
+
+    for (var p in obj) {
+      if (Object.prototype.hasOwnProperty.call(obj, p)) {
+        val = obj[p];
+
+        // This keeps valid falsy values like false and 0
+        // It's duplicated in the array block below. Could
+        // put it in a function but don't want the overhead
+        isValid = !( val === null || val === undefined ||
+                    (typeof val === 'number' && isNaN(val)) );
+
+        key = opts.snakeize ? string.snakeize(p) : p;
+        if (isValid) {
+          // Multiple vals -- array
+          if (_isArray(val) && val.length) {
+            itemArray = [];
+            for (var i = 0, ii = val.length; i < ii; i++) {
+              arrVal = val[i];
+              // This keeps valid falsy values like false and 0
+              isValid = !( arrVal === null || arrVal === undefined ||
+                           (typeof arrVal === 'number' && isNaN(arrVal)) );
+
+              itemArray[i] = isValid ? encodeURIComponent(arrVal) : '';
+              if (opts.escapeVals) {
+                itemArray[i] = string.escapeXML(itemArray[i]);
+              }
+            }
+            // Consolidation mode -- single value joined on comma
+            if (opts.consolidate) {
+              arr.push(key + '=' + itemArray.join(','));
+            }
+            // Normal mode -- multiple, same-named params with each val
+            else {
+              // {foo: [1, 2, 3]} => 'foo=1&foo=2&foo=3'
+              // Add into results array, as this just ends up getting
+              // joined on ampersand at the end anyhow
+              arr.push(key + '=' + itemArray.join('&' + key + '='));
+            }
+          }
+          // Single val -- string
+          else {
+            if (opts.escapeVals) {
+              val = string.escapeXML(val);
+            }
+            arr.push(key + '=' + encodeURIComponent(val));
+          }
+          str += '&';
+        }
+        else {
+          if (opts.includeEmpty) { arr.push(key + '='); }
+        }
+      }
+    }
+    return arr.join('&');
+  };
+
+  /**
+    @name uri#objectify
+    @public
+    @function
+    @return {Object} JavaScript key/val object with the values from the querystring
+    @description Convert the values in a query string (key=val&key=val) to an Object
+    @param {String} str The querystring to convert to an object
+    @param {Object} o The options to use for formatting
+      @param {Boolean} [o.consolidate=true] Convert multiple instances of the same
+        key into an array of values instead of overwriting
+  */
+  this.objectify = function (str, o) {
+    var opts = o || {};
+    var d = {};
+    var consolidate = typeof opts.consolidate == 'undefined' ?
+        true : opts.consolidate;
+    if (str) {
+      var arr = str.split('&');
+      for (var i = 0; i < arr.length; i++) {
+        var pair = arr[i].split('=');
+        var name = pair[0];
+        var val = decodeURIComponent(pair[1] || '');
+        // "We've already got one!" -- arrayize if the flag
+        // is set
+        if (typeof d[name] != 'undefined' && consolidate) {
+          if (typeof d[name] == 'string') {
+            d[name] = [d[name]];
+          }
+          d[name].push(val);
+        }
+        // Otherwise just set the value
+        else {
+          d[name] = val;
+        }
+      }
+    }
+    return d;
+  };
+
+})();
+
+module.exports = uri;
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/xml.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/xml.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/xml.js
new file mode 100644
index 0000000..42b0f39
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/lib/xml.js
@@ -0,0 +1,282 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var core = require('./core')
+  , inflection = require('./inflection')
+
+/**
+  @name xml
+  @namespace xml
+*/
+
+exports.XML = new (function () {
+
+  // Default indention level
+  var indentLevel = 4
+    , tagFromType
+    , obj2xml;
+
+  tagFromType = function (item, prev) {
+    var ret
+      , type
+      , types;
+
+    if (item instanceof Array) {
+      ret = 'array';
+    } else {
+      types = ['string', 'number', 'boolean', 'object'];
+      for (var i = 0, ii = types.length; i < ii; i++) {
+        type = types[i];
+        if (typeof item == type) {
+          ret = type;
+        }
+      }
+    }
+
+    if (prev && ret != prev) {
+      return 'record'
+    } else {
+      return ret;
+    }
+  };
+
+  obj2xml = function (o, opts) {
+    var name = opts.name
+      , level = opts.level
+      , arrayRoot = opts.arrayRoot
+      , pack
+      , item
+      , n
+      , currentIndent = (new Array(level * indentLevel)).join(' ')
+      , nextIndent = (new Array((level + 1) * indentLevel)).join(' ')
+      , xml = '';
+
+    switch (typeof o) {
+      case 'string':
+      case 'number':
+      case 'boolean':
+        xml = o.toString();
+        break;
+      case 'object':
+        // Arrays
+        if (o instanceof Array) {
+
+          // Pack the processed version of each item into an array that
+          // can be turned into a tag-list with a `join` method below
+          // As the list gets iterated, if all items are the same type,
+          // that's the tag-name for the individual tags. If the items are
+          // a mixed, the tag-name is 'record'
+          pack = [];
+          for (var i = 0, ii = o.length; i < ii; i++) {
+            item = o[i];
+            if (!name) {
+              // Pass any previous tag-name, so it's possible to know if
+              // all items are the same type, or it's mixed types
+              n = tagFromType(item, n);
+            }
+            pack.push(obj2xml(item, {
+              name: name
+            , level: level + 1
+            , arrayRoot: arrayRoot
+            }));
+          }
+
+          // If this thing is attached to a named property on an object,
+          // use the name for the containing tag-name
+          if (name) {
+            n = name;
+          }
+
+          // If this is a top-level item, wrap in a top-level containing tag
+          if (level == 0) {
+            xml += currentIndent + '<' + inflection.pluralize(n) + ' type="array">\n'
+          }
+          xml += nextIndent + '<' + n + '>' +
+              pack.join('</' + n + '>\n' + nextIndent +
+                  '<' + n + '>') + '</' + n + '>\n';
+
+          // If this is a top-level item, close the top-level containing tag
+          if (level == 0) {
+            xml += currentIndent + '</' + inflection.pluralize(n) + '>';
+          }
+        }
+        // Generic objects
+        else {
+          n = name || 'object';
+
+          // If this is a top-level item, wrap in a top-level containing tag
+          if (level == 0) {
+            xml += currentIndent + '<' + n;
+            // Lookahead hack to allow tags to have attributes
+            for (var p in o) {
+              if (p.indexOf('attr:') == 0) {
+                xml += ' ' + p.replace(/^attr:/, '') + '="' +
+                    o[p] + '"'
+              }
+            }
+            xml += '>\n';
+          }
+          for (var p in o) {
+            item = o[p];
+
+            // Data properties only
+            if (typeof item == 'function') {
+              continue;
+            }
+            // No attr hack properties
+            if (p.indexOf('attr:') == 0) {
+              continue;
+            }
+
+            xml += nextIndent;
+
+            if (p == '#cdata') {
+              xml += '<![CDATA[' + item + ']]>\n';
+            }
+            else {
+
+              // Complex values, going to have items with multiple tags
+              // inside
+              if (typeof item == 'object') {
+                if (item instanceof Array) {
+                  if (arrayRoot) {
+                    xml += '<' + p + ' type="array">\n'
+                  }
+                }
+                else {
+                  xml += '<' + p;
+                  // Lookahead hack to allow tags to have attributes
+                  for (var q in item) {
+                    if (q.indexOf('attr:') == 0) {
+                      xml += ' ' + q.replace(/^attr:/, '') + '="' +
+                          item[q] + '"'
+                    }
+                  }
+                  xml += '>\n';
+                }
+              }
+              // Scalars, just a value and closing tag
+              else {
+                xml += '<' + p + '>'
+              }
+              xml += obj2xml(item, {
+                name: p
+              , level: level + 1
+              , arrayRoot: arrayRoot
+              });
+
+              // Objects and Arrays, need indentation before closing tag
+              if (typeof item == 'object') {
+                if (item instanceof Array) {
+                  if (arrayRoot) {
+                    xml += nextIndent;
+                    xml += '</' + p + '>\n';
+                  }
+                }
+                else {
+                  xml += nextIndent;
+                  xml += '</' + p + '>\n';
+                }
+              }
+              // Scalars, just close
+              else {
+                xml += '</' + p + '>\n';
+              }
+            }
+          }
+          // If this is a top-level item, close the top-level containing tag
+          if (level == 0) {
+            xml += currentIndent + '</' + n + '>\n';
+          }
+        }
+        break;
+      default:
+        // No default
+    }
+    return xml;
+  }
+
+  /*
+   * XML configuration
+   *
+  */
+  this.config = {
+      whitespace: true
+    , name: null
+    , fragment: false
+    , level: 0
+    , arrayRoot: true
+  };
+
+  /**
+    @name xml#setIndentLevel
+    @public
+    @function
+    @return {Number} Return the given `level`
+    @description SetIndentLevel changes the indent level for XML.stringify and returns it
+    @param {Number} level The indent level to use
+  */
+  this.setIndentLevel = function (level) {
+    if(!level) {
+      return;
+    }
+
+    return indentLevel = level;
+  };
+
+  /**
+    @name xml#stringify
+    @public
+    @function
+    @return {String} Return the XML entities of the given `obj`
+    @description Stringify returns an XML representation of the given `obj`
+    @param {Object} obj The object containing the XML entities to use
+    @param {Object} opts
+      @param {Boolean} [opts.whitespace=true] Don't insert indents and newlines after xml entities
+      @param {String} [opts.name=typeof obj] Use custom name as global namespace
+      @param {Boolean} [opts.fragment=false] If true no header fragment is added to the top
+      @param {Number} [opts.level=0] Remove this many levels from the output
+      @param {Boolean} [opts.arrayRoot=true]
+  */
+  this.stringify = function (obj, opts) {
+    var config = core.mixin({}, this.config)
+      , xml = '';
+    core.mixin(config, (opts || {}));
+
+    if (!config.whitespace) {
+      indentLevel = 0;
+    }
+
+    if (!config.fragment) {
+      xml += '<?xml version="1.0" encoding="UTF-8"?>\n';
+    }
+
+    xml += obj2xml(obj, {
+      name: config.name
+    , level: config.level
+    , arrayRoot: config.arrayRoot
+    });
+
+    if (!config.whitespace) {
+      xml = xml.replace(/>\n/g, '>');
+    }
+
+    return xml;
+  };
+
+})();
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/package.json b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/package.json
new file mode 100644
index 0000000..54bbd06
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/package.json
@@ -0,0 +1,34 @@
+{
+  "name": "utilities",
+  "description": "A classic collection of JavaScript utilities",
+  "keywords": [
+    "utilities",
+    "utils",
+    "jake",
+    "geddy"
+  ],
+  "version": "0.0.23",
+  "author": {
+    "name": "Matthew Eernisse",
+    "email": "mde@fleegix.org",
+    "url": "http://fleegix.org"
+  },
+  "main": "./lib/index.js",
+  "scripts": {
+    "test": "jake test"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/mde/utilities.git"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "readme": "utilities\n=========\n\n[![build status](https://secure.travis-ci.org/mde/utilities.png)](http://travis-ci.org/mde/utilities)\n\nA classic collection of JavaScript utilities",
+  "readmeFilename": "README.md",
+  "_id": "utilities@0.0.23",
+  "dist": {
+    "shasum": "467fbf8a8e5c33f60c81919698c7f33a175dc4fa"
+  },
+  "_from": "utilities@0.0.x"
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/array.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/array.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/array.js
new file mode 100644
index 0000000..07ad592
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/array.js
@@ -0,0 +1,71 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var assert = require('assert')
+  , array = require('../lib/array')
+  , tests;
+
+tests = {
+
+  'test basic humanize for array': function () {
+    var actual = array.humanize(["array", "array", "array"])
+      , expected = "array, array and array";
+    assert.equal(expected, actual);
+  }
+
+, 'test humanize with two items for array': function () {
+    var actual = array.humanize(["array", "array"])
+      , expected = "array and array";
+    assert.equal(expected, actual);
+  }
+
+, 'test humanize with a single item for array': function () {
+    var actual = array.humanize(["array"])
+      , expected = "array";
+    assert.equal(expected, actual);
+  }
+
+, 'test humanize with no items for array': function () {
+    var actual = array.humanize([])
+      , expected = "";
+    assert.equal(expected, actual);
+  }
+
+, 'test basic include for array': function () {
+    var test = ["array"]
+      , actual = array.include(test, "array");
+    assert.equal(true, actual);
+  }
+
+, 'test false include for array': function () {
+    var test = ["array"]
+      , actual = array.include(test, 'nope');
+    assert.equal(false, actual);
+  }
+
+, 'test false boolean include for array': function () {
+    var test = ["array", false]
+      , actual = array.include(test, false);
+    assert.equal(true, actual);
+  }
+
+};
+
+module.exports = tests;
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/core.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/core.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/core.js
new file mode 100644
index 0000000..18e73b1
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/core.js
@@ -0,0 +1,75 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var assert = require('assert')
+  , core = require('../lib/core')
+  , tests;
+
+tests = {
+
+  'simple mixin for core': function () {
+    var expected = {secret: 'asdf', geddy: 'geddyKey'}
+      , result = core.mixin({secret: 'asdf'}, {geddy: 'geddyKey'});
+    assert.deepEqual(expected, result);
+  }
+
+, 'mixin with overiding key for core': function () {
+    var expected = {secret: 'geddySecret', geddy: 'geddyKey'}
+      , result = core.mixin({secret: 'asdf'}, {geddy: 'geddyKey', secret: 'geddySecret'});
+    assert.deepEqual(expected, result);
+  }
+
+, 'simple enhance for core': function () {
+    var expected = {secret: 'asdf', geddy: 'geddyKey'}
+      , result = core.enhance({secret: 'asdf'}, {geddy: 'geddyKey'});
+    assert.deepEqual(expected, result);
+  }
+
+, 'enhance with overiding key for core': function () {
+    var expected = {secret: 'geddySecret', geddy: 'geddyKey'}
+      , result = core.enhance({secret: 'asdf'}, {geddy: 'geddyKey', secret: 'geddySecret'});
+    assert.deepEqual(expected, result);
+  }
+
+, 'isEmpty, empty string (true)': function () {
+    assert.ok(core.isEmpty(''));
+  }
+
+, 'isEmpty, null (true)': function () {
+    assert.ok(core.isEmpty(null));
+  }
+
+, 'isEmpty, undefined (true)': function () {
+    assert.ok(core.isEmpty(null));
+  }
+
+, 'isEmpty, NaN (true)': function () {
+    assert.ok(core.isEmpty(NaN));
+  }
+
+, 'isEmpty, invalid Date (true)': function () {
+    assert.ok(core.isEmpty(new Date(NaN)));
+  }
+
+, 'isEmpty, zero (false)': function () {
+    assert.ok(!core.isEmpty(0));
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/date.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/date.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/date.js
new file mode 100644
index 0000000..535562f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/date.js
@@ -0,0 +1,75 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+var date = require('../lib/date')
+  , assert = require('assert')
+  , tests = {}
+  , _date = new Date();
+
+tests = {
+
+  'test strftime for date': function () {
+    var data = date.strftime(_date, "%w")
+      , actual = _date.getDay();
+    assert.equal(actual, data);
+  }
+
+, 'test calcCentury using current year for date': function () {
+    var data = date.calcCentury()
+      , actual = '21';
+    assert.equal(actual, data);
+  }
+
+, 'test calcCentury using 20th century year for date': function () {
+    var data = date.calcCentury(2000)
+      , actual = '20';
+    assert.equal(actual, data);
+  }
+
+, 'test calcCentury using 1st century year for date': function () {
+    var data = date.calcCentury(10)
+      , actual = '1';
+    assert.equal(actual, data);
+  }
+
+, 'test getMeridiem for date': function () {
+    var data = date.getMeridiem(_date.getHours())
+      , actual = (_date.getHours() > 11) ? 'PM' : 'AM';
+    assert.equal(actual, data);
+  }
+
+, 'test relativeTime week/weeks switchover': function () {
+    var dtA = new Date()
+      , dtB
+      , res;
+
+      dtB = date.add(dtA, 'day', 10);
+      dtB = date.add(dtB, 'hour', 23);
+      dtB = date.add(dtB, 'minute', 59);
+      dtB = date.add(dtB, 'second', 59);
+      dtB = date.add(dtB, 'millisecond', 999);
+    res = date.relativeTime(dtA, {now: dtB});
+    assert.equal('one week ago', res);
+
+    dtB = date.add(dtB, 'millisecond', 1);
+    res = date.relativeTime(dtA, {now: dtB});
+    assert.equal('about 2 weeks ago', res);
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/event_buffer.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/event_buffer.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/event_buffer.js
new file mode 100644
index 0000000..61dcc30
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/event_buffer.js
@@ -0,0 +1,45 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var Stream = require('stream').Stream
+  , EventEmitter = require('events').EventEmitter
+  , EventBuffer = require('../lib/event_buffer.js').EventBuffer
+  , assert = require('assert')
+  , tests;
+
+tests = {
+
+  'test basic event buffer functionality': function () {
+    var source = new Stream()
+      , dest = new EventEmitter()
+      , buff = new EventBuffer(source)
+      , data = '';
+    dest.on('data', function (d) { data += d; });
+    source.writeable = true;
+    source.readable = true;
+    source.emit('data', 'abcdef');
+    source.emit('data', '123456');
+    buff.sync(dest);
+    assert.equal('abcdef123456', data);
+    source.emit('data', '---');
+    assert.equal('abcdef123456---', data);
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/file.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/file.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/file.js
new file mode 100644
index 0000000..183373a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/file.js
@@ -0,0 +1,218 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var assert = require('assert')
+  , fs = require('fs')
+  , path = require('path')
+  , file = require('../lib/file')
+  , existsSync = fs.existsSync || path.existsSync
+  , tests;
+
+tests = {
+
+  'before': function () {
+    process.chdir('./test');
+  }
+
+, 'after': function () {
+    process.chdir('../');
+  }
+
+, 'test mkdirP': function () {
+    var expected = [
+          ['foo']
+        , ['foo', 'bar']
+        , ['foo', 'bar', 'baz']
+        , ['foo', 'bar', 'baz', 'qux']
+        ]
+      , res;
+    file.mkdirP('foo/bar/baz/qux');
+    res = file.readdirR('foo');
+    for (var i = 0, ii = res.length; i < ii; i++) {
+      assert.equal(path.join.apply(path, expected[i]), res[i]);
+    }
+    file.rmRf('foo', {silent: true});
+  }
+
+, 'test rmRf': function () {
+    file.mkdirP('foo/bar/baz/qux', {silent: true});
+    file.rmRf('foo/bar', {silent: true});
+    res = file.readdirR('foo');
+    assert.equal(1, res.length);
+    assert.equal('foo', res[0]);
+    fs.rmdirSync('foo');
+  }
+
+, 'test cpR with same to and from will throw': function () {
+    assert.throws(function () {
+      file.cpR('foo.txt', 'foo.txt', {silent: true});
+    });
+  }
+
+, 'test cpR rename via copy in directory': function () {
+    file.mkdirP('foo', {silent: true});
+    fs.writeFileSync('foo/bar.txt', 'w00t');
+    file.cpR('foo/bar.txt', 'foo/baz.txt', {silent: true});
+    assert.ok(existsSync('foo/baz.txt'));
+    file.rmRf('foo', {silent: true});
+  }
+
+, 'test cpR rename via copy in base': function () {
+    fs.writeFileSync('bar.txt', 'w00t');
+    file.cpR('bar.txt', 'baz.txt', {silent: true});
+    assert.ok(existsSync('baz.txt'));
+    file.rmRf('bar.txt', {silent: true});
+    file.rmRf('baz.txt', {silent: true});
+  }
+
+, 'test readdirR': function () {
+    var expected = [
+          ['foo']
+        , ['foo', 'bar']
+        , ['foo', 'bar', 'baz']
+        , ['foo', 'bar', 'baz', 'qux']
+        ]
+      , res;
+
+    file.mkdirP('foo/bar/baz/qux', {silent: true});
+    res = file.readdirR('foo');
+
+    for (var i = 0, ii = res.length; i < ii; i++) {
+      assert.equal(path.join.apply(path, expected[i]), res[i]);
+    }
+    file.rmRf('foo', {silent: true});
+  }
+
+, 'test isAbsolute with Unix absolute path': function () {
+    var p = '/foo/bar/baz';
+    assert.equal('/', file.isAbsolute(p));
+  }
+
+, 'test isAbsolute with Unix relative path': function () {
+    var p = 'foo/bar/baz';
+    assert.equal(false, file.isAbsolute(p));
+  }
+
+, 'test isAbsolute with Win absolute path': function () {
+    var p = 'C:\\foo\\bar\\baz';
+    assert.equal('C:\\', file.isAbsolute(p));
+  }
+
+, 'test isAbsolute with Win relative path': function () {
+    var p = 'foo\\bar\\baz';
+    assert.equal(false, file.isAbsolute(p));
+  }
+
+, 'test absolutize with Unix absolute path': function () {
+    var expected = '/foo/bar/baz'
+      , actual = file.absolutize('/foo/bar/baz');
+    assert.equal(expected, actual);
+  }
+
+, 'test absolutize with Win absolute path': function () {
+    var expected = 'C:\\foo\\bar\\baz'
+      , actual = file.absolutize('C:\\foo\\bar\\baz');
+    assert.equal(expected, actual);
+  }
+
+, 'test absolutize with relative path': function () {
+    var expected = process.cwd()
+      , actual = '';
+
+    // We can't just create two different tests here
+    // because file.absolutize uses process.cwd()
+    // to get absolute path which is platform
+    // specific
+    if (process.platform === 'win32') {
+      expected += '\\foo\\bar\\baz'
+      actual = file.absolutize('foo\\bar\\baz')
+    }
+    else {
+      expected += '/foo/bar/baz'
+      actual = file.absolutize('foo/bar/baz');
+    }
+
+    assert.equal(expected, actual);
+  }
+
+, 'test basedir with Unix absolute path': function () {
+    var p = '/foo/bar/baz';
+    assert.equal('/foo/bar', file.basedir(p));
+  }
+
+, 'test basedir with Win absolute path': function () {
+    var p = 'C:\\foo\\bar\\baz';
+    assert.equal('C:\\foo\\bar', file.basedir(p));
+  }
+
+, 'test basedir with Unix root path': function () {
+    var p = '/';
+    assert.equal('/', file.basedir(p));
+  }
+
+, 'test basedir with Unix absolute path and double-asterisk': function () {
+    var p = '/**/foo/bar/baz';
+    assert.equal('/', file.basedir(p));
+  }
+
+, 'test basedir with leading double-asterisk': function () {
+    var p = '**/foo';
+    assert.equal('.', file.basedir(p));
+  }
+
+, 'test basedir with leading asterisk': function () {
+    var p = '*.js';
+    assert.equal('.', file.basedir(p));
+  }
+
+, 'test basedir with leading dot-slash and double-asterisk': function () {
+    var p = './**/foo';
+    assert.equal('.', file.basedir(p));
+  }
+
+, 'test basedir with leading dirname and double-asterisk': function () {
+    var p = 'a/**/*.js';
+    assert.equal('a', file.basedir(p));
+  }
+
+, 'test basedir with leading dot-dot-slash and double-asterisk': function () {
+    var p = '../../test/**/*.js';
+    assert.equal('../../test', file.basedir(p));
+  }
+
+, 'test basedir with single-asterisk in dirname': function () {
+    var p = 'a/test*/file';
+    assert.equal('a', file.basedir(p));
+  }
+
+, 'test basedir with single filename': function () {
+    var p = 'filename';
+    assert.equal('.', file.basedir(p));
+  }
+
+, 'test basedir with empty path': function () {
+    var p = '';
+    assert.equal('.', file.basedir(p));
+    assert.equal('.', file.basedir());
+  }
+
+};
+
+module.exports = tests;
+
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/i18n.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/i18n.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/i18n.js
new file mode 100644
index 0000000..ba3e972
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/i18n.js
@@ -0,0 +1,60 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var i18n = require('../lib/i18n')
+  , assert = require('assert')
+  , tests
+  , inst = {};
+
+tests = {
+
+  'before': function () {
+    i18n.loadLocale('en-us', {foo: 'FOO', bar: 'BAR', baz: 'BAZ'});
+    i18n.loadLocale('ja-jp', {foo: 'フー', bar: 'バー'});
+    inst.en = new i18n.I18n('en-us');
+    inst.jp = new i18n.I18n('ja-jp');
+    inst.de = new i18n.I18n('de-de');
+  }
+
+, 'test default-locale fallback, defined strings': function () {
+    var expected = 'BAZ'
+      , actual = inst.jp.t('baz');
+    assert.equal(expected, actual);
+  }
+
+, 'test default-locale fallback, no defined strings': function () {
+    var expected = 'BAZ'
+      , actual = inst.de.t('baz');
+    assert.equal(expected, actual);
+  }
+
+, 'test key lookup, default-locale': function () {
+    var expected = 'FOO'
+      , actual = inst.en.t('foo');
+    assert.equal(expected, actual);
+  }
+
+, 'test key lookup, non-default-locale': function () {
+    var expected = 'フー'
+      , actual = inst.jp.t('foo');
+    assert.equal(expected, actual);
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/inflection.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/inflection.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/inflection.js
new file mode 100644
index 0000000..2a4cfe6
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/inflection.js
@@ -0,0 +1,388 @@
+/*
+ * Utilities: A classic collection of JavaScript utilities
+ * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+ *
+ * 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.
+ *
+*/
+
+var inflection = require('../lib/inflection')
+  , assert = require('assert')
+  , esInflections
+  , sInflections
+  , iesInflections
+  , vesInflections
+  , icesInflections
+  , renInflections
+  , oesInflections
+  , iInflections
+  , genInflections
+  , irregularInflections
+  , noInflections
+  , tests;
+
+/**
+ * Most test inflections are from Ruby on Rails:
+ *   https://github.com/rails/rails/blob/master/activesupport/test/inflector_test_cases.rb
+ *
+ * Ruby on Rails is MIT licensed: http://www.opensource.org/licenses/MIT
+*/
+esInflections = [
+    ["search", "searches"]
+  , ["switch", "switches"]
+  , ["fix", "fixes"]
+  , ["box", "boxes"]
+  , ["process", "processes"]
+  , ["address", "addresses"]
+  , ["wish", "wishes"]
+  , ["status", "statuses"]
+  , ["alias", "aliases"]
+  , ["basis", "bases"]
+  , ["diagnosis", "diagnoses"]
+  , ["bus", "buses"]
+];
+
+sInflections = [
+    ["stack", "stacks"]
+  , ["shoe", "shoes"]
+  , ["status_code", "status_codes"]
+  , ["case", "cases"]
+  , ["edge", "edges"]
+  , ["archive", "archives"]
+  , ["experience", "experiences"]
+  , ["day", "days"]
+  , ["comment", "comments"]
+  , ["foobar", "foobars"]
+  , ["newsletter", "newsletters"]
+  , ["old_news", "old_news"]
+  , ["perspective", "perspectives"]
+  , ["diagnosis_a", "diagnosis_as"]
+  , ["horse", "horses"]
+  , ["prize", "prizes"]
+];
+
+iesInflections = [
+    ["category", "categories"]
+  , ["query", "queries"]
+  , ["ability", "abilities"]
+  , ["agency", "agencies"]
+];
+
+vesInflections = [
+    ["wife", "wives"]
+  , ["safe", "saves"]
+  , ["half", "halves"]
+  , ["elf", "elves"]
+  , ["dwarf", "dwarves"]
+];
+
+icesInflections = [
+    ["index", "indices"]
+  , ["vertex", "vertices"]
+  , ["matrix", "matrices"]
+];
+
+renInflections = [
+    ["node_child", "node_children"]
+  , ["child", "children"]
+];
+
+oesInflections = [
+    ["buffalo", "buffaloes"]
+  , ["tomato", "tomatoes"]
+];
+
+iInflections = [
+    ["octopus", "octopi"]
+  , ["virus", "viri"]
+];
+
+genInflections = [
+    ["salesperson", "salespeople"]
+  , ["person", "people"]
+  , ["spokesman", "spokesmen"]
+  , ["man", "men"]
+  , ["woman", "women"]
+];
+
+irregularInflections = [
+    ["datum", "data"]
+  , ["medium", "media"]
+  , ["ox", "oxen"]
+  , ["cow", "kine"]
+  , ["mouse", "mice"]
+  , ["louse", "lice"]
+  , ["axis", "axes"]
+  , ["testis", "testes"]
+  , ["crisis", "crises"]
+  , ["analysis", "analyses"]
+  , ["quiz", "quizzes"]
+];
+
+noInflections = [
+    ["fish", "fish"]
+  , ["news", "news"]
+  , ["series", "series"]
+  , ["species", "species"]
+  , ["rice", "rice"]
+  , ["information", "information"]
+  , ["equipment", "equipment"]
+];
+
+tests = {
+
+  'test es plural words for inflection': function () {
+    var i = esInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = esInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test es singular words for inflection': function () {
+    var i = esInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = esInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test s plural words for inflection': function () {
+    var i = sInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = sInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test s singular words for inflection': function () {
+    var i = sInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = sInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test ies plural words for inflection': function () {
+    var i = iesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = iesInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test ies singular words for inflection': function () {
+    var i = iesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = iesInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test ves plural words for inflection': function () {
+    var i = vesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = vesInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test ves singular words for inflection': function () {
+    var i = vesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = vesInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test ices plural words for inflection': function () {
+    var i = icesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = icesInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test ices singular words for inflection': function () {
+    var i = icesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = icesInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test ren plural words for inflection': function () {
+    var i = renInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = renInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test ren singular words for inflection': function () {
+    var i = renInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = renInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test oes plural words for inflection': function () {
+    var i = oesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = oesInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test oes singular words for inflection': function () {
+    var i = oesInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = oesInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test i plural words for inflection': function () {
+    var i = iInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = iInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test i singular words for inflection': function () {
+    var i = iInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = iInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test gender and people plural words for inflection': function () {
+    var i = genInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = genInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test gender and people singular words for inflection': function () {
+    var i = genInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = genInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test irregular plural words for inflection': function () {
+    var i = irregularInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = irregularInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test irregular singular words for inflection': function () {
+    var i = irregularInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = irregularInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+, 'test no change plural words for inflection': function () {
+    var i = noInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = noInflections[i];
+
+      assert.equal(value[1], inflection.pluralize(value[0]))
+    }
+  }
+
+, 'test no change singular words for inflection': function () {
+    var i = noInflections.length
+      , value;
+
+    while (--i >= 0) {
+      value = noInflections[i];
+
+      assert.equal(value[0], inflection.singularize(value[1]))
+    }
+  }
+
+};
+
+module.exports = tests;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/network.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/network.js b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/network.js
new file mode 100644
index 0000000..5ed437e
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/node_modules/jake/node_modules/utilities/test/network.js
@@ -0,0 +1,41 @@
+var assert = require('assert')
+  , sys = require('sys')
+  , net = require('net')
+  , network = require('../lib/network')
+  , tests;
+
+tests = {
+
+  'test a port is open': function (next) {
+    var expected = false
+      , port = 49152;
+
+    network.isPortOpen(port, null, function (err, isOpen) {
+      assert.ifError(err);
+      assert.equal(expected, isOpen);
+
+      next();
+    });
+    
+  }
+
+, 'test a port is closed': function (next) {
+    
+    var expected = true
+      , port = 49153
+      , server = net.createServer();
+
+    server.listen(port, function () { 
+      network.isPortOpen(port, null, function (err, isOpen) {
+        assert.ifError(err);
+        assert.equal(expected, isOpen);
+
+        server.close(function () {
+          next();  
+        });
+      });
+    });  
+  }
+}
+
+module.exports = tests;
\ No newline at end of file


[34/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONObject.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONObject.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONObject.java
new file mode 100644
index 0000000..28c6216
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONObject.java
@@ -0,0 +1,1367 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import org.apache.cordova.json4j.internal.JSON4JStringReader;
+import org.apache.cordova.json4j.internal.JSON4JStringWriter;
+import org.apache.cordova.json4j.internal.NumberUtil;
+import org.apache.cordova.json4j.internal.Parser;
+import org.apache.cordova.json4j.internal.Serializer;
+import org.apache.cordova.json4j.internal.SerializerVerbose;
+
+/**
+ * Models a JSON Object.
+ *
+ * Extension of Hashtable that only allows String keys, and values which are JSON-able (such as a Java Bean).
+ * <BR><BR>
+ * JSON-able values are: null, and instances of String, Boolean, Number, JSONObject and JSONArray.
+ * <BR><BR>
+ * Instances of this class are not thread-safe.
+ */
+public class JSONObject extends Hashtable implements JSONArtifact {
+
+    private static final long serialVersionUID = -3269263069889337298L;
+
+    /**
+     * A constant definition reference to Java null.
+     * Provided for API compatibility with other JSON parsers.
+     */
+    public static final Object NULL = new Null();
+
+    /**
+     * Return whether the object is a valid value for a property.
+     * @param object The object to check for validity as a JSON property value.
+     * @return boolean indicating if the provided object is directly convertable to JSON.
+     */
+    public static boolean isValidObject(Object object) {
+        if (null == object) return true;
+        return isValidType(object.getClass());
+    }
+
+    /**
+     * Return whether the class is a valid type of value for a property.
+     * @param clazz The class type to check for validity as a JSON object type.
+     * @return boolean indicating if the provided class is directly convertable to JSON.
+     */
+    public static boolean isValidType(Class clazz) {
+        if (null == clazz) throw new IllegalArgumentException();
+
+        if (String.class  == clazz) return true;
+        if (Boolean.class == clazz) return true;
+        if (JSONObject.class.isAssignableFrom(clazz)) return true;
+        if (JSONArray.class == clazz) return true;
+        if (NumberUtil.isNumber(clazz)) return true;
+        if (JSONObject.NULL == clazz) return true;
+        if (JSONString.class.isAssignableFrom(clazz)) return true;
+
+        return false;
+    }
+
+    /**
+     * Create a new instance of this class.
+     */
+    public JSONObject() {
+        super();
+    }
+
+    /**
+     * Create a new instance of this class taking selected values from the underlying one.
+     * @param obj The JSONObject to extract values from.
+     * @param keys The keys to take from the JSONObject and apply to this instance.
+     * @throws JSONException Thrown if a key is duplicated in the string[] keys
+     */
+    public JSONObject(JSONObject obj, String[] keys) throws JSONException{
+        super();
+        if (keys != null && keys.length > 0) {
+            for (int i = 0; i < keys.length; i++) {
+                if (this.containsKey(keys[i])) {
+                    throw new JSONException("Duplicate key: " + keys[i]);
+                }
+                try {
+                    this.put(keys[i], obj.get(keys[i]));
+                } catch (Exception ex) {
+                    JSONException jex = new JSONException("Error occurred during JSONObject creation");
+                    jex.setCause(ex);
+                    throw jex;
+                }
+            }
+        }
+    }
+
+    /**
+     * Create a new instance of this class from the provided JSON object string.
+     * Note:  This is the same as new JSONObject(str, false);  Parsing in non-strict mode.
+     * @param str The JSON string to parse.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONObject(String str) throws JSONException {
+        super();
+        JSON4JStringReader reader = new JSON4JStringReader(str);
+        (new Parser(reader)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the provided JSON object string.
+     * @param str The JSON string to parse.
+     * @param strict Whether or not to parse in 'strict' mode, meaning all strings must be quoted (including identifiers), and comments are not allowed.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONObject(String str, boolean strict) throws JSONException {
+        super();
+        JSON4JStringReader reader = new JSON4JStringReader(str);
+        (new Parser(reader, strict)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the reader.  The reader content must be a JSON object string.
+     * Note:  The reader will not be closed, that is left to the caller.
+     * Note:  This is the same as new JSONObject(rdr, false);  Parsing in non-strict mode.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONObject(Reader rdr) throws JSONException {
+        (new Parser(rdr)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the reader.  The reader content must be a JSON object string.
+     * Note:  The reader will not be closed, that is left to the caller.
+     * @param rdr The reader from which to read the JSON.
+     * @param strict Whether or not to parse in 'strict' mode, meaning all strings must be quoted (including identifiers), and comments are not allowed.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONObject(Reader rdr, boolean strict) throws JSONException {
+        (new Parser(rdr, strict)).parse(this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the input stream.  The stream content must be a JSON object string.
+     * Note:  The input stream content is assumed to be UTF-8 encoded.
+     * Note:  The InputStream will not be closed, that is left to the caller.
+     * Note:  This is the same as new JSONObject(is, false);  Parsing in non-strict mode.
+     * @param is The InputStream from which to read the JSON.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONObject (InputStream is) throws JSONException {
+        InputStreamReader isr = null;
+        if (is != null) {
+            try {
+                isr = new InputStreamReader(is, "UTF-8");
+            } catch (Exception ex) {
+                isr = new InputStreamReader(is);
+            }
+        } else {
+            throw new JSONException("InputStream cannot be null");
+        }
+        (new Parser(isr)).parse(true, this);
+    }
+
+    /**
+     * Create a new instance of this class from the data provided from the input stream.  The stream content must be a JSON object string.
+     * Note:  The input stream content is assumed to be UTF-8 encoded.
+     * Note:  The InputStream will not be closed, that is left to the caller.
+     * @param is The InputStream from which to read the JSON.
+     * @param strict Whether or not to parse in 'strict' mode, meaning all strings must be quoted (including identifiers), and comments are not allowed.
+     * @throws JSONException Thrown when the string passed is null, or malformed JSON..
+     */
+    public JSONObject (InputStream is, boolean strict) throws JSONException {
+        InputStreamReader isr = null;
+        if (is != null) {
+            try {
+                isr = new InputStreamReader(is, "UTF-8");
+            } catch (Exception ex) {
+                isr = new InputStreamReader(is);
+            }
+        } else {
+            throw new JSONException("InputStream cannot be null");
+        }
+        (new Parser(isr, strict)).parse(true, this);
+    }
+
+    /**
+     * Write this object to the stream as JSON text in UTF-8 encoding.  Same as calling write(os,false);
+     * Note that encoding is always written as UTF-8, as per JSON spec.
+     * @param os The output stream to write data to.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public OutputStream write(OutputStream os) throws JSONException {
+        write(os,false);
+        return os;
+    }
+
+    /**
+     * Convert this object into a stream of JSON text.  Same as calling write(writer,false);
+     * Note that encoding is always written as UTF-8, as per JSON spec.
+     * @param os The output stream to write data to.
+     * @param verbose Whether or not to write the JSON text in a verbose format.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public OutputStream write(OutputStream os, boolean verbose) throws JSONException {
+        Writer writer = null;
+        try {
+            //MSN BUFFERED
+            writer = new OutputStreamWriter(os, "UTF-8");
+        } catch (UnsupportedEncodingException uex) {
+            JSONException jex = new JSONException(uex.toString());
+            jex.setCause(uex);
+            throw jex;
+        }
+        write(writer, verbose);
+        try {
+            writer.flush();
+        } catch (Exception ex) {
+            JSONException jex = new JSONException("Error during buffer flush");
+            jex.setCause(ex);
+            throw jex;
+        }
+        return os;
+    }
+
+    /**
+     * Write this object to the stream as JSON text in UTF-8 encoding, specifying how many spaces should be used for each indent.
+     * @param indentDepth How many spaces to use for each indent level.  Should be one to eight.
+     * Less than one means no intending, greater than 8 and it will just use tab.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public OutputStream write(OutputStream os, int indentDepth) throws JSONException {
+        Writer writer = null;
+        try {
+            //MSN BUFFERED
+            writer = new OutputStreamWriter(os, "UTF-8");
+        } catch (UnsupportedEncodingException uex) {
+            JSONException jex = new JSONException(uex.toString());
+            jex.setCause(uex);
+            throw jex;
+        }
+        write(writer, indentDepth);
+        try {
+            writer.flush();
+        } catch (Exception ex) {
+            JSONException jex = new JSONException("Error during buffer flush");
+            jex.setCause(ex);
+            throw jex;
+        }
+        return os;
+    }
+
+    /**
+     * Write this object to the writer as JSON text. Same as calling write(writer,false);
+     * @param writer The writer which to write the JSON text to.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public Writer write(Writer writer) throws JSONException {
+        write(writer, false);
+        return writer;
+    }
+
+    /**
+     * Write this object to the writer as JSON text in UTF-8 encoding, specifying whether to use verbose (tab-indented) output or not.
+     * @param writer The writer which to write the JSON text to.
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public Writer write(Writer writer, boolean verbose) throws JSONException {
+        Serializer serializer;
+
+        //Try to avoid double-buffering or buffering in-memory
+        //writers.
+//        Class writerClass = writer.getClass();
+        boolean flushIt = false;
+//        if (!StringWriter.class.isAssignableFrom(writerClass) &&
+//            !CharArrayWriter.class.isAssignableFrom(writerClass) &&
+//            !BufferedWriter.class.isAssignableFrom(writerClass)) {
+//            writer = new BufferedWriter(writer);
+//            flushIt = true;
+//        }
+
+        if (verbose) {
+            serializer = new SerializerVerbose(writer);
+        } else {
+            serializer = new Serializer(writer);
+        }
+
+        try {
+            serializer.writeObject(this);
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        if (flushIt) {
+            try {
+                writer.flush();
+            } catch (Exception ex) {
+                JSONException jex = new JSONException("Error during buffer flush");
+                jex.setCause(ex);
+                throw jex;
+            }
+        }
+        return writer;
+    }
+
+    /**
+     * Write this object to the writer as JSON text, specifying how many spaces should be used for each indent.
+     * This is an alternate indent style to using tabs.
+     * @param writer The writer which to write the JSON text to.
+     * @param indentDepth How many spaces to use for each indent.  The value should be between one to eight.
+     */
+    public Writer write(Writer writer, int indentDepth) throws JSONException {
+        Serializer serializer;
+
+        if (indentDepth < 1) {
+            indentDepth = 0;
+        } else if (indentDepth > 8) {
+            indentDepth = 9;
+        }
+
+        //Try to avoid double-buffering or buffering in-memory
+        //writers.
+//        Class writerClass = writer.getClass();
+        boolean flushIt = false;
+//        if (!StringWriter.class.isAssignableFrom(writerClass) &&
+//            !CharArrayWriter.class.isAssignableFrom(writerClass) &&
+//            !BufferedWriter.class.isAssignableFrom(writerClass)) {
+//            writer = new BufferedWriter(writer);
+//            flushIt = true;
+//        }
+
+        if (indentDepth > 0) {
+            serializer = new SerializerVerbose(writer, indentDepth);
+        } else {
+            serializer = new Serializer(writer);
+        }
+        try {
+            serializer.writeObject(this);
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during input read.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        if (flushIt) {
+            try {
+                writer.flush();
+            } catch (Exception ex) {
+                JSONException jex = new JSONException("Error during buffer flush");
+                jex.setCause(ex);
+                throw jex;
+            }
+        }
+        return writer;
+    }
+
+    /**
+     * Convert this object into a String of JSON text, specifying how many spaces should be used for each indent.
+     * This is an alternate indent style to using tabs.
+     * @param indentDepth How many spaces to use for each indent.  The value should be between one to eight.
+     * Less than one means no indenting, greater than 8 and it will just use tab.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public String write(int indentDepth) throws JSONException {
+        Serializer serializer;
+        JSON4JStringWriter writer = new JSON4JStringWriter();
+
+        if (indentDepth < 1) {
+            indentDepth = 0;
+        } else if (indentDepth > 8) {
+            indentDepth = 9;
+        }
+
+        if (indentDepth > 0) {
+            serializer = new SerializerVerbose(writer, indentDepth);
+        } else {
+            serializer = new Serializer(writer);
+        }
+        try {
+            serializer.writeObject(this).flush();
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during write.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return writer.toString();
+    }
+
+    /**
+     * Convert this object into a String of JSON text, specifying whether to use verbose (tab-indented) output or not.
+     * @param verbose Whether or not to write in compressed format.
+     *
+     * @throws JSONException Thrown on errors during serialization.
+     */
+    public String write(boolean verbose) throws JSONException {
+        Serializer serializer;
+        JSON4JStringWriter writer = new JSON4JStringWriter();
+
+        if (verbose) {
+            serializer = new SerializerVerbose(writer);
+        } else {
+            serializer = new Serializer(writer);
+        }
+        try {
+            serializer.writeObject(this).flush();
+        } catch (IOException iox) {
+            JSONException jex = new JSONException("Error occurred during write.");
+            jex.setCause(iox);
+            throw jex;
+        }
+        return writer.toString();
+    }
+
+    /**
+     * Convert this object into a String of JSON text.  Same as write(false);
+     *
+     * @throws JSONException Thrown on IO errors during serialization.
+     */
+    public String write() throws JSONException {
+        return write(false);
+    }
+
+    /**
+     * Method to obtain the object value for a key.
+     * This string-based method is provided for API compatibility to other JSON models.
+     * @param key The key  (attribute) name to obtain the value for.
+     * @throws JSONException Thrown if the noted key is not in the map of key/value pairs.
+     */
+    public Object get(String key) throws JSONException {
+        Object val = this.get((Object)key);
+        if (val == null) {
+            if (!this.containsKey(key)) {
+                throw new JSONException("The key [" + key + "] was not in the map");
+            }
+        }
+        return val;
+    }
+
+    /**
+     * Method to obtain the object value for a key.  If the key is not in the map, null is returned.
+     * This string-based method is provided for API compatibility to other JSON models.
+     * @param key The key  (attribute) name to obtain the value for.
+     */
+    public Object opt(String key) {
+        return this.get((Object)key);
+    }
+
+    /**
+     * (non-Javadoc)
+     * @see java.util.HashMap#put(java.lang.Object, java.lang.Object)
+     * @param key The key to put in the JSONObject
+     * @param value The value to put in the JSONObject
+     * @param includeSuperclass Boolean indicating that if the object is a JavaBean, include superclass getter properties.
+     * @throws JSONException.  Thrown if key is null, not a string, or the value could not be converted.
+     */
+    public Object put(Object key, Object value, boolean includeSuperclass) throws JSONException{
+        if (null == key) throw new JSONException("key must not be null");
+        if (!(key instanceof String)) throw new JSONException("key must be a String");
+        if (!isValidObject(value)) {
+            throw new JSONException("Invalid type of value.  Could not convert type: [" + value.getClass().getName() + "]");
+        }
+        if (null == value) {
+            value = NULL;
+        }
+        return super.put(key, value);
+    }
+
+    /**
+     * (non-Javadoc)
+     * @see java.util.HashMap#put(java.lang.Object, java.lang.Object)
+     * This is the same as calling put(key, value, true);
+     */
+    public Object put(Object key, Object value) {
+        try {
+            return put(key, value, true);
+        } catch (Exception e) {
+            IllegalArgumentException iae = new IllegalArgumentException("Error occurred during JSON conversion");
+           //MSN iae.setCause(e);
+            throw iae;
+        }
+    }
+
+    /**
+     * Convenience functions, to help map from other JSON parsers.
+     */
+
+    /**
+     * Similar to default HashMap put, except it returns JSONObject instead of Object.
+     * @see java.util.HashMap#put(java.lang.Object, java.lang.Object)
+     * @return A reference to this object instance.
+     * @throws JSONException.  Thrown if key is null, not a string, or the value could not be converted to JSON.
+     */
+    public JSONObject put(String key, Object value) throws JSONException{
+        this.put((Object)key, value);
+        return this;
+    }
+
+    /**
+     * Method to add an atomic boolean to the JSONObject.
+     * param key The key/attribute name to set the boolean at.
+     * @param value The boolean value.
+     * @throws JSONException.  Thrown if key is null or not a string.
+     * @return A reference to this object instance.
+     */
+    public JSONObject put(String key, boolean value) throws JSONException{
+        this.put(key,new Boolean(value));
+        return this;
+    }
+
+    /**
+     * Method to add an atomic double to the JSONObject.
+     * param key The key/attribute name to set the double at.
+     * @param value The double value.
+     * @throws JSONException.  Thrown if key is null or not a string.
+     * @return A reference to this object instance.
+     */
+    public JSONObject put(String key, double value) throws JSONException{
+        this.put(key, new Double(value));
+        return this;
+    }
+
+    /**
+     * Method to add an atomic integer to the JSONObject.
+     * param key The key/attribute name to set the integer at.
+     * @param value The integer value.
+     * @throws JSONException.  Thrown if key is null or not a string.
+     * @return A reference to this object instance.
+     */
+    public JSONObject put(String key, int value) throws JSONException{
+        this.put(key, new Integer(value));
+        return this;
+    }
+
+    /**
+     * Method to add an atomic short to the JSONObject.
+     * param key The key/attribute name to set the integer at.
+     * @param value The integer value.
+     * @throws JSONException.  Thrown if key is null or not a string.
+     * @return A reference to this object instance.
+     */
+    public JSONObject put(String key, short value) throws JSONException{
+        this.put(key, new Short(value));
+        return this;
+    }
+
+    /**
+     * Method to add an atomic long to the JSONObject.
+     * @param key The key/attribute name to set the long to.
+     * @param value The long value.
+     * @throws JSONException.  Thrown if key is null or not a string.
+     * @return A reference to this object instance.
+     */
+    public JSONObject put(String key, long value) throws JSONException{
+        this.put(key, new Long(value));
+        return this;
+    }
+
+    /**
+     * Method to add an Object array as a new JSONArray contained in this JSONObject
+     * @param key The key/attribute name to set the collection to.
+     * @param value The Object array to convert to a JSONArray and store.
+     * @throws JSONException Thrown when contents in the Collection cannot be converted to something JSONable.
+     * @return A reference to this object instance.
+     */
+     public JSONObject put(String key, Object[] value) throws JSONException {
+         return put (key, new JSONArray(value));
+     }
+
+     /**
+      * Method to add an Object array as a new JSONArray contained in this JSONObject
+      * @param key The key/attribute name to set the collection to.
+      * @param value The Object array to convert to a JSONArray and store.
+      * @param includeSuperclass For values of the Object array which are JavaBeans and are converted, include superclass getter properties.
+      * @throws JSONException Thrown when contents in the Collection cannot be converted to something JSONable.
+      * @return A reference to this object instance.
+      *
+      public JSONObject put(String key, Object[] value, boolean includeSuperclass) throws JSONException {
+          return put (key, new JSONArray(value), includeSuperclass);
+      } */
+
+    /**
+     * Utility method to obtain the specified key as a 'boolean' value
+     * Only boolean true, false, and the String true and false will return.  In this case null, the number 0, and empty string should be treated as false.
+     * everything else is true.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a boolean instance, or the strings 'true' or 'false'.
+     * @return A boolean value (true or false), if the value stored for key is a Boolean, or the strings 'true' or 'false'.
+     */
+    public boolean getBoolean(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (val instanceof Boolean) {
+                return((Boolean)val).booleanValue();
+            } else if (NumberUtil.isNumber(val.getClass())) {
+                throw new JSONException("Value at key: [" + key + "] was not a boolean or string value of 'true' or 'false'.");
+            } else if (String.class.isAssignableFrom(val.getClass())) {
+                String str = (String)val;
+                if (str.equals("true")) {
+                    return true;
+                } else if (str.equals("false")) {
+                    return false;
+                } else {
+                    throw new JSONException("The value for key: [" + key + "]: [" + str + "] was not 'true' or 'false'");
+                }
+            } else {
+                throw new JSONException("The value for key: [" + key + "] was not a type that can be converted to boolean");
+            }
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'boolean' value
+     * Only returns true if the value is boolean true or the string 'true'.  All other values return false.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @return A boolean value (true or false), if the value stored for key is a Boolean, or the strings 'true' or 'false'.
+     */
+    public boolean optBoolean(String key) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (val instanceof Boolean) {
+                return((Boolean)val).booleanValue();
+            } else if (NumberUtil.isNumber(val.getClass())) {
+                return false;
+            } else if (String.class.isAssignableFrom(val.getClass())) {
+                String str = (String)val;
+                if (str.equals("true")) {
+                    return true;
+                } else {
+                    return false;
+                }
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'boolean' value
+     * Only returns true if the value is boolean true or the string 'true'.  All other values return false.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @param defaultValue The default value to return.
+     * @return A boolean value (true or false), if the value stored for key is a Boolean, or the strings 'true' or 'false'.
+     */
+    public boolean optBoolean(String key, boolean defaultValue) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (val instanceof Boolean) {
+                return((Boolean)val).booleanValue();
+            } else if (NumberUtil.isNumber(val.getClass())) {
+                return false;
+            } else if (String.class.isAssignableFrom(val.getClass())) {
+                String str = (String)val;
+                if (str.equals("true")) {
+                    return true;
+                } else if (str.equals("false")) {
+                    return false;
+                } else {
+                    return defaultValue;
+                }
+            } else {
+                return defaultValue;
+            }
+        } else {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'double' value
+     * Only values of Number will be converted to double, all other types will generate an exception
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a Double instance, or cannot be converted to a double.
+     * @return A double value if the value stored for key is an instance of Number.
+     */
+    public double getDouble(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getDouble(val);
+            }
+            else {
+                throw new JSONException("The value for key: [" + key + "] was not a type that can be converted to double");
+            }
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null.  Number required.");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'double' value
+     * Only values of Number will be converted to double.  all other values will return Double.NaN.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @return A double value if the value stored for key is an instance of Number.
+     */
+    public double optDouble(String key) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getDouble(val);
+            }
+        }
+        return Double.NaN;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'double' value
+     * Only values of Number will be converted to double.  all other values will return Double.NaN.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @param defaultValue The default double value to return in case of NaN/null values in map.
+     * @return A double value if the value stored for key is an instance of Number.
+     */
+    public double optDouble(String key, double defaultValue) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getDouble(val);
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'short' value
+     * Only values of Number will be converted to short, all other types will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a Short instance, or cannot be converted to a short.
+     * @return A short value if the value stored for key is an instance of Number.
+     */
+    public short getShort(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getShort(val);
+            } else {
+                throw new JSONException("The value for key: [" + key + "] was not a type that can be converted to short");
+            }
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null.  Number required.");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'short' value
+     * Only values of Number will be converted to short.  All other types return 0.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @return A short value if the value stored for key is an instance of Number.  0 otherwise.
+     */
+    public short optShort(String key) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getShort(val);
+            }
+        }
+        return(short)0;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'short' value
+     * Only values of Number will be converted to short.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @param defaultValue The default value to return in the case of null/nonNumber values in the map.
+     * @return A short value if the value stored for key is an instance of Number.  0 otherwise.
+     */
+    public short optShort(String key, short defaultValue) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getShort(val);
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'int' value
+     * Only values of Number will be converted to integer, all other types will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a Double instance, or cannot be converted to a double.
+     * @return A int value if the value stored for key is an instance of Number.
+     */
+    public int getInt(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getInt(val);
+            } else {
+                throw new JSONException("The value for key: [" + key + "] was not a type that can be converted to integer");
+            }
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null.  Number required.");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'int' value
+     * Provided for compatibility to other JSON models.
+     * Only values of Number will be converted to integer, all other types will return 0.
+     * @param key The key to look up.
+     * @return A int value if the value stored for key is an instance of Number.  0 otherwise.
+     */
+    public int optInt(String key) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getInt(val);
+            }
+        }
+        return 0;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'int' value
+     * Provided for compatibility to other JSON models.
+     * Only values of Number will be converted to integer
+     * @param key The key to look up.
+     * @param defaultValue The default int value to return in case of null/non-number values in the map.
+     * @return A int value if the value stored for key is an instance of Number.
+     */
+    public int optInt(String key, int defaultValue) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getInt(val);
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'long' value
+     * Only values of Number will be converted to long, all other types will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a Long instance, or cannot be converted to a long..
+     * @return A long value if the value stored for key is an instance of Number.
+     */
+    public long getLong(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getLong(val);
+            } else {
+                throw new JSONException("The value for key: [" + key + "] was not a type that can be converted to long");
+            }
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null.  Number required.");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'long' value
+     * Only values of Number will be converted to long.  all other types return 0.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @return A long value if the value stored for key is an instance of Number, 0 otherwise.
+     */
+    public long optLong(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getLong(val);
+            }
+        }
+        return(long)0;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'long' value
+     * Only values of Number will be converted to long.  all other types return 0.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @param defaultValue The default long value to return in case of null/non Number values in the map.
+     * @return A long value if the value stored for key is an instance of Number, defaultValue otherwise.
+     */
+    public long optLong(String key, long defaultValue) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (NumberUtil.isNumber(val.getClass())) {
+                return NumberUtil.getLong(val);
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'string' value
+     * Only values that can be easily converted to string will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is null.
+     * @return A string value if the value if the value stored for key is not null.
+     */
+    public String getString(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            return val.toString();
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null.  Object required.");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'string' value
+     * Only values that can be easily converted to string will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is null.
+     * @return A string value if the value if the value stored for key is not null.
+     */
+    public String optString(String key) {
+        Object val = this.opt(key);
+        if (val != null) {
+            return val.toString();
+        }
+        return null;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a 'string' value
+     * Only values that can be easily converted to string will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @param defaultValue The default String value to return in the case of null values in the map.
+     * @return A string value if the value if the value stored for key is not null, defaultValue otherwise.
+     */
+    public String optString(String key, String defaultValue) {
+        Object val = this.opt(key);
+        if (val != null) {
+            return val.toString();
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a JSONObject
+     * Only values that are instances of JSONObject will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a JSONObject instance.
+     * @return A JSONObject value if the value stored for key is an instance or subclass of JSONObject.
+     */
+    public JSONObject getJSONObject(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (JSONObject.class.isAssignableFrom(val.getClass())) {
+                return(JSONObject)val;
+            } else {
+                throw new JSONException("The value for key: [" + key + "] was not a JSONObject");
+            }
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null.  Object required.");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a JSONObject
+     * Only values that are instances of JSONObject will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @return A JSONObject value if the value stored for key is an instance or subclass of JSONObject, null otherwise.
+     */
+    public JSONObject optJSONObject(String key) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (JSONObject.class.isAssignableFrom(val.getClass())) {
+                return(JSONObject)val;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a JSONObject
+     * Only values that are instances of JSONObject will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @param defaultValue The default JSONObject to return in the case of null/non JSONObject values in the map.
+     * @return A JSONObject value if the value stored for key is an instance or subclass of JSONObject, defaultValue otherwise.
+     */
+    public JSONObject optJSONObject(String key, JSONObject defaultValue) {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (JSONObject.class.isAssignableFrom(val.getClass())) {
+                return(JSONObject)val;
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a JSONArray
+     * Only values that are instances of JSONArray will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * throws JSONException Thrown when the type returned by get(key) is not a Long instance, or cannot be converted to a long..
+     * @return A JSONArray value if the value stored for key is an instance or subclass of JSONArray.
+     */
+    public JSONArray getJSONArray(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (JSONArray.class.isAssignableFrom(val.getClass())) {
+                return(JSONArray)val;
+            } else {
+                throw new JSONException("The value for key: [" + key + "] was not a JSONObject");
+            }
+        } else {
+            throw new JSONException("The value for key: [" + key + "] was null.  Object required.");
+        }
+    }
+
+    /**
+     * Utility method to obtain the specified key as a JSONArray
+     * Only values that are instances of JSONArray will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @return A JSONArray value if the value stored for key is an instance or subclass of JSONArray, null otherwise.
+     */
+    public JSONArray optJSONArray(String key) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (JSONArray.class.isAssignableFrom(val.getClass())) {
+                return(JSONArray)val;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Utility method to obtain the specified key as a JSONArray
+     * Only values that are instances of JSONArray will be returned.  A null will generate an exception.
+     * Provided for compatibility to other JSON models.
+     * @param key The key to look up.
+     * @param defaultValue The default value to return if the value in the map is null/not a JSONArray.
+     * @return A JSONArray value if the value stored for key is an instance or subclass of JSONArray, defaultValue otherwise.
+     */
+    public JSONArray optJSONArray(String key, JSONArray defaultValue) throws JSONException {
+        Object val = this.opt(key);
+        if (val != null) {
+            if (JSONArray.class.isAssignableFrom(val.getClass())) {
+                return(JSONArray)val;
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Put a key/value pair into the JSONObject, but only if key/value are both not null, and only if the key is not present already.
+     * Provided for compatibility to existing models.
+     * @param key The ket to place in the array
+     * @param value The value to place in the array
+     * @return Reference to the current JSONObject.
+     * @throws JSONException - Thrown if the key already exists or if key or value is null
+     */
+    public JSONObject putOnce(String key, Object value) throws JSONException {
+        if (key == null) {
+            throw new JSONException("Key cannot be null");
+        }
+        if (value == null) {
+            throw new JSONException("Value cannot be null");
+        }
+        if (this.containsKey(key)) {
+            throw new JSONException("Key [" + key + "] already exists in the map");
+        }
+        this.put(key,value);
+        return this;
+    }
+
+    /**
+     * Put a key/value pair into the JSONObject, but only if the key and value are non-null.
+     * @param key The keey (attribute) name to assign to the value.
+     * @param value The value to put into the JSONObject.
+     * @return Reference to the current JSONObject.
+     * @throws JSONException - if the value is a non-finite number
+     */
+    public JSONObject putOpt(String key, Object value) throws JSONException {
+        if (key == null) {
+            throw new JSONException("Key cannot be null");
+        }
+        if (value == null) {
+            throw new JSONException("Value cannot be null");
+        }
+        this.put(key,value);
+        return this;
+    }
+
+    /**
+     * Method to return the number of keys in this JSONObject.
+     * This function merely maps to HashMap.size().  Provided for API compatibility.
+     * @return returns the number of keys in the JSONObject.
+     */
+    public int length() {
+        return this.size();
+    }
+
+    /**
+     * Method to append the 'value' object to the element at entry 'key'.
+     * If JSONObject.has(key) returns false, a new array is created and the value is appended to it.
+     * If the object as position key is not an array, then a new JSONArray is created
+     * and both current and new values are appended to it, then the value of the attribute is set to the new
+     * array.  If the current value is already an array, then 'value' is added to it.
+     *
+     * @param key The key/attribute name to append to.
+     * @param value The value to append to it.
+     *
+     * @throws JSONException Thrown if the value to append is not JSONAble.
+     * @return A reference to this object instance.
+     */
+    public JSONObject append(String key, Object value) throws JSONException {
+        JSONArray array = null;
+        if (!this.has(key)) {
+            array = new JSONArray();
+        }
+        else {
+            Object oldVal = this.get(key);
+            array = new JSONArray();
+            if (oldVal == null) {
+                // Add a null if the key was actually there, but just
+                // had value of null.
+                array.add(null);
+            }
+            else  if (JSONArray.class.isAssignableFrom(oldVal.getClass())) {
+                array = (JSONArray)oldVal;
+            } else {
+                array = new JSONArray();
+                array.add(oldVal);
+            }
+        }
+        array.add(value);
+        return put(key,array);
+    }
+
+    /**
+     * Produce a JSONArray containing the values of the members of this JSONObject
+     * @param names - A JSONArray containing the a list of key strings.  This determines the sequence of values in the result.
+     * @return A JSONArray of the values found for the names provided.
+     * @throws JSONException - if errors occur during storing the values in a JSONArray
+     */
+    public JSONArray toJSONArray(JSONArray names) throws JSONException {
+        Enumeration itr = names.elements();
+        JSONArray array = new JSONArray();
+        //MSN WAS IF, SHOULD BE WHILE?
+        while (itr != null && itr.hasMoreElements()) {
+            array.put(this.get(itr.nextElement()));
+        }
+        return array;
+    }
+
+
+    /**
+     * Method to test if a key exists in the JSONObject.
+     * @param key The key to test.
+     * @return true if the key is defined in the JSONObject (regardless of value), or false if the key is not in the JSONObject
+     */
+    public boolean has(String key) {
+        if (key != null) {
+            return this.containsKey(key);
+        }
+        return false;
+    }
+
+  /**
+   * Method to test if a key is mapped to null. This method will also return
+   * true if the key has not been put in the JSONObject yet,
+   *
+   * @param key   The key to test for null.
+   * @return true if the key is not in the map or if the value referenced by the
+   *         key is null, or if the value is the JSONObject.NULL object.
+   */
+    public boolean isNull(String key) {
+        Object obj = this.opt(key);
+        return JSONObject.NULL.equals(obj);
+    }
+
+    /**
+     * Utility function that returns an iterator of all the keys (attributes) of this JSONObject
+     * @return An iterator of all keys in the object.
+     *
+    public Enumeration keys() {
+        return this.keys();
+
+    } */
+
+    /**
+     * Utility function that returns a JSONArray of all the names of the keys (attributes) of this JSONObject
+     * @return All the keys in the JSONObject as a JSONArray.
+     */
+    public JSONArray names() {
+        Enumeration itr = this.keys();
+        if (itr != null) {
+            JSONArray array = new JSONArray();
+            while (itr.hasMoreElements()) {
+                array.add(itr.nextElement());
+            }
+            return array;
+        }
+        return null;
+    }
+
+    /**
+     * Utility function that returns a String[] of all the names of the keys (attributes) of this JSONObject
+     * @return All the keys in the JSONObject as a String[].
+     */
+    public static String[] getNames(JSONObject obj) {
+        String[] array = null;
+        if (obj != null) {
+            if (obj.size() > 0) {
+                array = new String[obj.size()];
+                int pos = 0;
+                Enumeration itr = obj.keys();
+                if (itr != null) {
+                    while (itr.hasMoreElements()) {
+                        array[pos] = (String)itr.nextElement();
+                        pos++;
+                    }
+                }
+            }
+        }
+        return array;
+    }
+
+//    /**
+//     * Utility function that returns an iterator of all the keys (attributes) of this JSONObject sorted in lexicographic manner (String.compareTo).
+//     * @return An iterator of all keys in the object in lexicographic (character code) sorted order.
+//     */
+//    public Enumeration sortedKeys() {
+//        Enumeration itr = this.keys();
+//        if (itr != null && itr.hasMoreElements()) {
+//            Vector vect = new Vector();
+//            while (itr.hasMoreElements()) {
+//                vect.addElement(itr.nextElement());
+//            }
+//            String[] strs = new String[vect.size()];
+//            vect.copyInto(strs);
+//           // java.util.Arrays.sort(strs);
+//            vect.clear();
+//            for (int i = 0; i < strs.length; i++) {
+//                vect.add(strs[i]);
+//            }
+//            return vect.iterator();
+//        }
+//        return null;
+//    }
+
+    /**
+     * End of convenience methods.
+     */
+
+    /**
+     * Over-ridden toString() method.  Returns the same value as write(), which is a compact JSON String.
+     * If an error occurs in the serialization, the return will be of format: JSON Generation Error: [<some error>]
+     * @return A string of JSON text, if possible.
+     */
+    public String toString() {
+        return toString(false);
+    }
+
+    /**
+     * Verbose capable toString method.
+     * If an error occurs in the serialization, the return will be of format: JSON Generation Error: [<some error>]
+     * @param verbose Whether or not to tab-indent the output.
+     * @return A string of JSON text, if possible.
+     */
+    public String toString(boolean verbose) {
+        String str = null;
+        try {
+            str = write(verbose);
+        } catch (JSONException jex) {
+            str = "JSON Generation Error: [" + jex.toString() + "]";
+        }
+        return str;
+    }
+
+    /**
+     * Function to return a string of JSON text with specified indention.  Returns the same value as write(indentDepth).
+     * If an error occurs in the serialization, a JSONException is thrown.
+     * @return A string of JSON text, if possible.
+     */
+    public String toString(int indentDepth) throws JSONException {
+        return write(indentDepth);
+    }
+
+    public static String quote(String string) {
+        return Serializer.quote(string);
+    }
+
+    /**
+     * An simple class provided for API compatibility to other JSON models that 'represents'
+     * 'null' in an actual object.
+     */
+    private static class Null implements JSONString {
+
+        /**
+         * Equals function that returns true for comparisons to null.
+         */
+        public boolean equals(Object obj) {
+            if (obj == null || obj == this) {
+                return true;
+            }
+            else {
+                return false;
+            }
+        }
+
+        /**
+         * Ensure only one Null object.
+         */
+        protected Object clone() {
+            return this;
+        }
+
+        /**
+         * toString method that just returns 'null' as the string.
+         */
+        public String toString() {
+            return "null";
+        }
+
+        /**
+         * Method to return a JSON compliant representation of this object.
+         * @return a JSON formatted string.
+         */
+        public String toJSONString() {
+            return this.toString();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONString.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONString.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONString.java
new file mode 100644
index 0000000..b887adb
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONString.java
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+/**
+ * An interface that can be implemented to make a
+ * particular object have an easy to use JSON representation.  Objects that implement this
+ * can be inserted into JSONObject and JSONArray and serialized.
+ */
+public interface JSONString {
+    /**
+     * Method to return a JSON compliant representation of this object.
+     * @return a JSON formatted string.
+     */
+    public String toJSONString();
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONStringer.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONStringer.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONStringer.java
new file mode 100644
index 0000000..10fb7a8
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONStringer.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+import java.io.IOException;
+
+import org.apache.cordova.json4j.internal.JSON4JStringWriter;
+
+/**
+ * This class implements a JSONSringer, a basic convenience subclass of JSONWriter to allow for
+ * generating JSON strings quickly.   This class exists for API compatibility to other popular
+ * JSON parsers.
+ */
+public class JSONStringer extends JSONWriter {
+
+    public JSONStringer() {
+        super(new JSON4JStringWriter());
+    }
+
+    /**
+     * Return a string of the stringer contents.  This also terminates the
+     * Stringer and it cannot be used again.  If any errors occur while trying to generate the JSON
+     * it returns an empty string.
+     */
+    public String toString() {
+        try {
+            super.flush();
+            super.close();
+            return ((JSON4JStringWriter)writer).toString();
+        } catch (Exception ex) {
+            /* Squelch */
+            return "";
+        }
+    }
+
+    /**
+     * Over-ride to do nothing for the stringer.  Only toString() terminates the stringer object.
+     */
+    public void close() throws IOException, IllegalStateException {
+        // Do nothing.
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONWriter.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONWriter.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONWriter.java
new file mode 100644
index 0000000..1914f58
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/JSONWriter.java
@@ -0,0 +1,586 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Stack;
+
+import org.apache.cordova.json4j.internal.NumberUtil;
+
+/**
+ * This class implements a JSONWrier, a convenience function for writing out JSON
+ * to a writer or underlying stream.
+ */
+public class JSONWriter {
+
+    /**
+     * The writer to use to output JSON in a semi-streaming fashion.
+     */
+    protected Writer writer = null;
+
+    /**
+     * Flag to denote that the writer is in an object.
+     */
+    private boolean inObject = false;
+
+    /**
+     * Flag to denote that the writer is in an array.
+     */
+    private boolean inArray = false;
+
+    /**
+     * Flag for state checking that a key was placed (if inside an object)
+     * Required to be true for a value to be placed in that situation
+     */
+    private boolean keyPlaced = false;
+
+    /**
+     * Flag denoting if in an array or object, if the first entry has been placed or not.
+     */
+    private boolean firstEntry = false;
+
+    /**
+     * A stack to keep track of all the closures.
+     */
+    private Stack closures = null;
+
+    /**
+     * Flag used to check the state of this writer, if it has been closed, all
+     * operations will throw an IllegalStateException.
+     */
+    private boolean closed = false;
+
+    /**
+     * Constructor.
+     * @param writer The writer to use to do 'streaming' JSON writing.
+     * @throws NullPointerException Thrown if writer is null.
+     */
+    public JSONWriter(Writer writer) throws NullPointerException {
+        //Try to avoid double-buffering or buffering in-memory writers.
+//        Class writerClass = writer.getClass();
+//        if (!StringWriter.class.isAssignableFrom(writerClass) &&
+//            !CharArrayWriter.class.isAssignableFrom(writerClass) &&
+//            !BufferedWriter.class.isAssignableFrom(writerClass)) {
+//            writer = new BufferedWriter(writer);
+//        }
+        this.writer = writer;
+        this.closures = new Stack();
+    }
+
+    /**
+     * Open a new JSON Array in the output stream.
+     * @throws IOException Thrown if an error occurs on the underlying writer.
+     * @throws IllegalstateException Thrown if the current writer position does not permit an array.
+     * @return A reference to this writer.
+     */
+    public JSONWriter array() throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inObject) {
+            if (!keyPlaced) {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified to contain a new array");
+            }
+        } else if (inArray) {
+            if (!firstEntry) {
+                writer.write(",");
+            }
+        }
+        writer.write("[");
+        inArray = true;
+        inObject = false;
+        keyPlaced = false;
+        firstEntry = true;
+        closures.push("]");
+        return this;
+    }
+
+    /**
+     * Method to close the current JSON Array in the stream.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the writer position is not inside an array.
+     * @return A reference to this writer.
+     */
+    public JSONWriter endArray() throws IOException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (!inArray) {
+            throw new IllegalStateException("Current writer position is not within a JSON array");
+        } else {
+            writer.write(((String)closures.pop()));
+            // Set our current positional/control state.
+            if (!closures.isEmpty()) {
+                String nextClosure = (String)closures.peek();
+                if (nextClosure.equals("}")) {
+                    inObject = true;
+                    inArray = false;
+                } else {
+                    inObject = false;
+                    inArray = true;
+                }
+                firstEntry = false;
+            } else {
+                inArray = false;
+                inObject = false;
+                firstEntry = true;
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Method to close a current JSON object in the stream.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the writer position is not inside an object, or if the object has a key placed, but no value.
+     * @return A reference to this writer.
+     */
+    public JSONWriter endObject() throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (!inObject) {
+            throw new IllegalStateException("Current writer position is not within a JSON object");
+        } else {
+            if (keyPlaced) {
+                throw new IllegalStateException("Current writer position in an object and has a key placed, but no value has been assigned to the key.  Cannot end.");
+            } else {
+                writer.write((String)closures.pop());
+                // Set our current positional/control state.
+                if (!closures.isEmpty()) {
+                    String nextClosure = (String)closures.peek();
+                    if (nextClosure.equals("}")) {
+                        inObject = true;
+                        inArray = false;
+                    } else {
+                        inObject = false;
+                        inArray = true;
+                    }
+                    firstEntry = false;
+                } else {
+                    inArray = false;
+                    inObject = false;
+                    firstEntry = true;
+                }
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Place a key in the current JSON Object.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the current writer position is not within an object.
+     * @return A reference to this writer.
+     */
+    public JSONWriter key(String s) throws IOException, IllegalStateException, NullPointerException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (s == null) {
+            throw new NullPointerException("Key cannot be null");
+        } else {
+            if (!inObject) {
+                throw new IllegalStateException("Current writer position is not inside a JSON Object, a key cannot be placed.");
+            } else {
+                if (!keyPlaced) {
+                    if (firstEntry) {
+                        firstEntry = false;
+                    } else {
+                        writer.write(",");
+                    }
+                    keyPlaced = true;
+                    writeString(s);
+                    writer.write(":");
+                } else {
+                    throw new IllegalStateException("Current writer position is inside a JSON Object an with an open key waiting for a value.  Another key cannot be placed.");
+                }
+            }
+        }
+        return this;
+    }
+
+    /**
+     * Open a new JSON Object in the output stream.
+     * @throws IllegalStateException Thrown if an object cannot currently be created in the stream.
+     * @throws IOException Thrown if an IO error occurs in the underlying writer.
+     * @return A reference to this writer.
+     */
+    public JSONWriter object() throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inObject) {
+            if (!keyPlaced) {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified to contain a new object");
+            }
+        } else if (inArray) {
+            if (!firstEntry) {
+                writer.write(",");
+            }
+        }
+        writer.write("{");
+        inObject = true;
+        inArray = false;
+        keyPlaced = false;
+        firstEntry = true;
+        closures.push("}");
+        return this;
+    }
+
+    /**
+     * Method to write a boolean to the current writer position.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the current writer position will not accept a boolean value.
+     * @return A reference to this writer.
+     */
+    public JSONWriter value(boolean b) throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inArray) {
+            if (firstEntry) {
+                firstEntry = false;
+            } else {
+                writer.write(",");
+            }
+            if (b)
+                writer.write("true");
+            else
+                writer.write("false");
+
+        } else if (inObject) {
+            if (keyPlaced) {
+                if (b)
+                    writer.write("true");
+                else
+                    writer.write("false");
+                keyPlaced = false;
+            } else {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified for the boolean value.");
+            }
+        } else {
+            throw new IllegalStateException("Writer is currently not in an array or object, cannot write value");
+        }
+        return this;
+    }
+
+    /**
+     * Method to write a double to the current writer position.
+     * @param d The Double to write.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the current writer position will not accept a double value.
+     * @return A reference to this writer.
+     */
+    public JSONWriter value(double d) throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inArray) {
+            if (firstEntry) {
+                firstEntry = false;
+            } else {
+                writer.write(",");
+            }
+            writer.write(Double.toString(d));
+        } else if (inObject) {
+            if (keyPlaced) {
+                writer.write(Double.toString(d));
+                keyPlaced = false;
+            } else {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified for the double value.");
+            }
+        } else {
+            throw new IllegalStateException("Writer is currently not in an array or object, cannot write value");
+        }
+        return this;
+    }
+
+    /**
+     * Method to write a double to the current writer position.
+     * @param l The long to write.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the current writer position will not accept a double value.
+     * @return A reference to this writer.
+     */
+    public JSONWriter value(long l) throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inArray) {
+            if (firstEntry) {
+                firstEntry = false;
+            } else {
+                writer.write(",");
+            }
+            writer.write(Long.toString(l));
+        } else if (inObject) {
+            if (keyPlaced) {
+                writer.write(Long.toString(l));
+                keyPlaced = false;
+            } else {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified for the long value.");
+            }
+        } else {
+            throw new IllegalStateException("Writer is currently not in an array or object, cannot write value");
+        }
+        return this;
+    }
+
+    /**
+     * Method to write an int to the current writer position.
+     * @param i The int to write.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the current writer position will not accept a double value.
+     * @return A reference to this writer.
+     */
+    public JSONWriter value(int i) throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inArray) {
+            if (firstEntry) {
+                firstEntry = false;
+            } else {
+                writer.write(",");
+            }
+            writer.write(Integer.toString(i));
+        } else if (inObject) {
+            if (keyPlaced) {
+                writer.write(Integer.toString(i));
+                keyPlaced = false;
+            } else {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified for the int value.");
+            }
+        } else {
+            throw new IllegalStateException("Writer is currently not in an array or object, cannot write value");
+        }
+        return this;
+    }
+
+    /**
+     * Method to write a short to the current writer position.
+     * @param s The short to write.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the current writer position will not accept a double value.
+     * @return A reference to this writer.
+     */
+    public JSONWriter value(short s) throws IOException, IllegalStateException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inArray) {
+            if (firstEntry) {
+                firstEntry = false;
+            } else {
+                writer.write(",");
+            }
+            writer.write(Integer.toString(s));
+        } else if (inObject) {
+            if (keyPlaced) {
+                writer.write(Integer.toString(s));
+                keyPlaced = false;
+            } else {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified for the short value.");
+            }
+        } else {
+            throw new IllegalStateException("Writer is currently not in an array or object, cannot write value");
+        }
+        return this;
+    }
+
+    /**
+     * Method to write an Object to the current writer position.
+     * @param o The object to write.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws JSONException Thrown if the object is not JSONAble.
+     * @return A reference to this writer.
+     */
+    public JSONWriter value(Object o) throws IOException, IllegalStateException, JSONException {
+        if (closed) {
+            throw new IllegalStateException("The writer has been closed.  No further operations allowed.");
+        }
+        if (inArray) {
+            if (firstEntry) {
+                firstEntry = false;
+            } else {
+                writer.write(",");
+            }
+            writeObject(o);
+        } else if (inObject) {
+            if (keyPlaced) {
+                writeObject(o);
+                keyPlaced = false;
+            } else {
+                throw new IllegalStateException("Current containment is a JSONObject, but a key has not been specified for the boolean value.");
+            }
+        } else {
+            throw new IllegalStateException("Writer is currently not in an array or object, cannot write value");
+        }
+        return this;
+    }
+
+    /**
+     * Method to close the JSON Writer.  All current object depths will be closed out and the writer closed.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws IllegalStateException Thrown if the writer position is in an object and a key has been placed, but a value has not been assigned or if the writer was already closed.
+     */
+    public void close() throws IOException, IllegalStateException {
+        if (!closed) {
+            if (inObject && keyPlaced) {
+                throw new IllegalStateException("Object has key without value.  Cannot close.");
+            } else {
+                while (!closures.isEmpty()) {
+                    writer.write((String)closures.pop());
+                }
+                writer.flush();
+                writer.close();
+                closed = true;
+            }
+        }
+    }
+
+    /**
+     * Method to flush the underlying writer so that all buffered content, if any, is written out.
+     * @return A reference to this writer.
+     */
+    public JSONWriter flush() throws IOException {
+        writer.flush();
+        return this;
+    }
+
+    /**
+     * Method to write a String out to the writer, encoding special characters and unicode characters properly.
+     * @param value The string to write out.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    private void writeString(String value) throws IOException {
+        writer.write('"');
+        char[] chars = value.toCharArray();
+        for (int i=0; i<chars.length; i++) {
+            char c = chars[i];
+            switch (c) {
+                case  '"': writer.write("\\\""); break;
+                case '\\': writer.write("\\\\"); break;
+                case    0: writer.write("\\0"); break;
+                case '\b': writer.write("\\b"); break;
+                case '\t': writer.write("\\t"); break;
+                case '\n': writer.write("\\n"); break;
+                case '\f': writer.write("\\f"); break;
+                case '\r': writer.write("\\r"); break;
+                case '/': writer.write("\\/"); break;
+                default:
+                    if ((c >= 32) && (c <= 126)) {
+                        writer.write(c);
+                    } else {
+                        writer.write("\\u");
+                        writer.write(rightAlignedZero(Integer.toHexString(c),4));
+                    }
+            }
+        }
+        writer.write('"');
+    }
+
+    /**
+     * Method to generate a string with a particular width.  Alignment is done using zeroes if it does not meet the width requirements.
+     * @param s The string to write
+     * @param len The minimum length it should be, and to align with zeroes if length is smaller.
+     * @return A string properly aligned/correct width.
+     */
+    private String rightAlignedZero(String s, int len) {
+        if (len == s.length()) return s;
+        StringBuffer sb = new StringBuffer(s);
+        while (sb.length() < len) {
+            sb.insert(0, '0');
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Method to write a number to the current writer.
+     * @param value The number to write to the JSON output string.
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    private void writeNumber(Object value) throws IOException {
+        if (null == value) {
+            writeNull();
+        }
+        if (value instanceof Float) {
+            if (((Float)value).isNaN()) {
+                writeNull();
+            }
+            if (Float.NEGATIVE_INFINITY == ((Float)value).floatValue()) {
+                writeNull();
+            }
+            if (Float.POSITIVE_INFINITY == ((Float)value).floatValue()) {
+                writeNull();
+            }
+        }
+        if (value instanceof Double) {
+            if (((Double)value).isNaN()) {
+                writeNull();
+            }
+            if (Double.NEGATIVE_INFINITY == ((Double)value).doubleValue()) {
+                writeNull();
+            }
+            if (Double.POSITIVE_INFINITY == ((Double)value).doubleValue()) {
+                writeNull();
+            }
+        }
+        writer.write(value.toString());
+    }
+
+    /**
+     * Method to write an object to the current writer.
+     * @param o The object to write.
+     * @throws IOException Thrown if an IO error occurs on the underlying writer.
+     * @throws JSONException Thrown if the specified object is not JSONAble.
+     */
+    private void writeObject(Object o) throws IOException, JSONException {
+        // Handle the object!
+        if (o == null) {
+            writeNull();
+        } else {
+            Class clazz = o.getClass();
+            if (JSONArtifact.class.isAssignableFrom(clazz)) {
+                writer.write(((JSONArtifact)o).toString());
+            } else if (NumberUtil.isNumber(clazz)) {
+                writeNumber(o);
+            } else if (Boolean.class.isAssignableFrom(clazz)) {
+                writer.write(((Boolean)o).toString());
+            } else if (String.class.isAssignableFrom(clazz)) {
+                writeString((String)o);
+            } else if (JSONString.class.isAssignableFrom(clazz)) {
+                writer.write(((JSONString)o).toJSONString());
+            }// else {
+             //   // Unknown type, we'll just try to serialize it like a Java Bean.
+             //   writer.write(BeanSerializer.toJson(o, true).write());
+           // }
+        }
+    }
+
+    /**
+     * Method to write the text string 'null' to the output stream (null JSON object).
+     * @throws IOException Thrown if an error occurs during write.
+     */
+    private void writeNull() throws IOException {
+        writer.write("null");
+    }
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JNumber.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JNumber.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JNumber.java
new file mode 100644
index 0000000..99d244c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JNumber.java
@@ -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.
+ */
+package org.apache.cordova.json4j.internal;
+
+public class JSON4JNumber {
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JPBackReader.java
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JPBackReader.java b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JPBackReader.java
new file mode 100644
index 0000000..a2ed87b
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/framework/ext/src/org/apache/cordova/json4j/internal/JSON4JPBackReader.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+package org.apache.cordova.json4j.internal;
+
+import java.io.IOException;
+import java.io.Reader;
+
+public class JSON4JPBackReader extends Reader {
+
+    private Reader _reader = null;
+
+    private int _lastChar = 0;
+
+    public JSON4JPBackReader(Reader reader) {
+        _reader = reader;
+    }
+
+    public void close() throws IOException {
+        _reader.close();
+    }
+
+    public void unread(int c) {
+    }
+
+    public int read(char[] cbuf, int off, int len) throws IOException {
+        cbuf[off] = (char)_lastChar;
+        _reader.read(cbuf, off + 1, len -1);
+        _lastChar = cbuf[off + len];
+        return 0;
+    }
+}


[50/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/bootstrap.js
----------------------------------------------------------------------
diff --git a/bootstrap.js b/bootstrap.js
index f96df76..b4db442 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -20,22 +20,22 @@
  * Runs through any bs to make sure the libraries and tests are good to go.
  **/
 
-var util      = require('./src/util'),
-    create    = require('./src/create'),
-    a_parser  = require('./src/metadata/android_parser'),
-    b_parser  = require('./src/metadata/blackberry_parser'),
-    i_parser  = require('./src/metadata/ios_parser'),
-    n         = require('ncallbacks'),
-    path      = require('path'),
-    fs        = require('fs'),
-    shell     = require('shelljs'),
-    platforms = require('./platforms');
+var util       = require('./src/util'),
+    create     = require('./src/create'),
+    a_parser   = require('./src/metadata/android_parser'),
+    b10_parser = require('./src/metadata/blackberry10_parser'),
+    i_parser   = require('./src/metadata/ios_parser'),
+    n          = require('ncallbacks'),
+    path       = require('path'),
+    fs         = require('fs'),
+    shell      = require('shelljs'),
+    platforms  = require('./platforms');
 
 // Library requirements checkers
 var min_reqs = {
     "android":a_parser.check_requirements,
     "ios":i_parser.check_requirements,
-    "blackberry":b_parser.check_requirements
+    "blackberry10":b10_parser.check_requirements
 }
 
 // Create native projects using bin/create
@@ -74,10 +74,12 @@ platforms.forEach(function(platform) {
         } else {
             console.log('SUCCESS: Minimum requirements for ' + platform + ' met.');
             var fix_path = path.join(tempDir, platform + '_fixture');
-            var create = path.join(util.libDirectory, 'cordova-' + platform, 'bin', 'create'); 
+            var create = path.join(util.libDirectory,
+                    'cordova-' + (platform === 'blackberry10' ? 'blackberry/blackberry10' : platform),
+                    'bin',
+                    'create');
             console.log('BOOTSTRAPPING ' + platform + '...');
             var cmd = create + ' "' + fix_path + '" org.apache.cordova.cordovaExample cordovaExample';
-            if (platform == 'blackberry') cmd = create + ' "' + fix_path + '" cordovaExample';
             shell.exec(cmd, {silent:true, async:true}, function(code, output) {
                 if (code > 0) {
                     console.error('ERROR! Could not create a native ' + platform + ' project test fixture. See below for error output.');

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/.gitignore
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/.gitignore b/lib/cordova-blackberry/.gitignore
new file mode 100644
index 0000000..a79ee27
--- /dev/null
+++ b/lib/cordova-blackberry/.gitignore
@@ -0,0 +1,27 @@
+# OS X
+
+.DS_Store
+
+# Eclipse
+
+deliverables/
+.preprocessed/
+
+# Text Editor Tmp
+
+._*
+
+# Generated libraries
+
+build/
+dist/
+bin/node_modules
+bin/templates/project/lib
+example/
+ant-contrib-1.0b3.jar
+
+# OS X
+
+.DS_Store
+
+tags

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/LICENSE b/lib/cordova-blackberry/LICENSE
deleted file mode 100644
index ee6a935..0000000
--- a/lib/cordova-blackberry/LICENSE
+++ /dev/null
@@ -1,268 +0,0 @@
-
-                               Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-
-For the template/project/lib/ant-contrib/ant-contrib-1.0b3.jar component:
-
-   The Apache Software License, Version 1.1
-
-   Copyright (c) 2001-2003 Ant-Contrib project.  All rights reserved.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-
-   2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in
-      the documentation and/or other materials provided with the
-      distribution.
-
-   3. The end-user documentation included with the redistribution, if
-      any, must include the following acknowlegement:
-         "This product includes software developed by the
-          Ant-Contrib project (http://sourceforge.net/projects/ant-contrib)."
-      Alternately, this acknowlegement may appear in the software itself,
-      if and wherever such third-party acknowlegements normally appear.
-
-   4. The name Ant-Contrib must not be used to endorse or promote products
-      derived from this software without prior written permission. For
-      written permission, please contact
-      ant-contrib-developers@lists.sourceforge.net.
-
-   5. Products derived from this software may not be called "Ant-Contrib"
-      nor may "Ant-Contrib" appear in their names without prior written
-      permission of the Ant-Contrib project.
-
-   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-   DISCLAIMED.  IN NO EVENT SHALL THE ANT-CONTRIB PROJECT OR ITS
-   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-   SUCH DAMAGE.
-   ====================================================================
-
-For the template/project/www/json2.js component:
-
-    http://www.JSON.org/json2.js
-    2010-03-20
-
-    Public Domain.
-
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-    See http://www.JSON.org/js.html
-
-
-    This code should be minified before deployment.
-    See http://javascript.crockford.com/jsmin.html
-
-    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
-    NOT CONTROL.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/NOTICE
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/NOTICE b/lib/cordova-blackberry/NOTICE
deleted file mode 100644
index 23360ce..0000000
--- a/lib/cordova-blackberry/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org)
-
-This product includes software developed by
-Ant-Contrib project (http://sourceforge.net/projects/ant-contrib).

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/README.md b/lib/cordova-blackberry/README.md
index e2f9896..8aaf204 100644
--- a/lib/cordova-blackberry/README.md
+++ b/lib/cordova-blackberry/README.md
@@ -1,183 +1,7 @@
-Cordova BlackBerry WebWorks
-============================
+Cordova BlackBerry
 
-[Cordova framework](http://incubator.apache.org/cordova/) for __BlackBerry Tablet OS, Smartphones and BlackBerry 10 devices__. The framework is implemented using the [BlackBerry WebWorks SDK](http://us.blackberry.com/developers/tablet/webworks.jsp).
+This repo contains cordova projects for the BlackBerry platforms:
 
-Directory Structure
--------------------
+blackberry - BBOS 5+ and Tablet OS
 
-    framework/ ... BlackBerry WebWorks JavaScript Extension (Cordova native code)
-    javascript/ .. Cordova JavaScript (concatenated, non-minified)
-    bin/ ......... Scripts for project creation
-
-Introduction
-------------
-
-BlackBerry WebWorks is a framework for developing web-based applications for BlackBerry SmartPhones (BlackBerry OS 5.0 and higher) and the TabletOS.  Creating a web application is one of the easiest ways to have an application that runs on both platforms.
-
-The WebWorks framework allows developers to create applications using web content and resources (HTML/CSS/JavaScript) that are able to access device features through the [BlackBerry WebWorks API](http://www.blackberry.com/developers/docs/widgetapi/).  In addition, the framework allows developers to create their own WebWorks JavaScript Extensions to expose additional device capabilities through JavaScript APIs.  These extensions are written using either the BlackBerry Java API for SmartPhones, or Adobe AIR for the Tablet OS.
-
-The cordova-blackberry-webworks platform allows web developers to develop applications targeting BlackBerry 5.0 and higher devices using the common [Cordova API](http://docs.cordova.io).  When possible, Cordova makes use of the WebWorks JavaScript API; however, most Cordova features are implemented in the native Java or AIR environment as a WebWorks JavaScript Extension.
-
-
-Getting Started
-===============
-
-Several guides are available on the [Cordova Documentation site](http://docs.cordova.io/) (Getting Started Guides - on the left side near the bottom) to help you get started developing for the cordova-blackberry-webworks platform.  This guide will help you install and configure the BlackBerry WebWorks development environment, and the cordova-blackberry-webworks platform.  It will also step you through the process of creating a Cordova project.
-
-[Getting Started with Cordova BlackBerry WebWorks](http://docs.cordova.io/guide_getting-started_blackberry_index.md.html)
-
-This guide is for advanced developers who wish to develop their own cordova-blackberry-webworks plugin.
-
-[How To Create a Cordova Plugin for Cordova BlackBerry WebWorks](http://docs.cordova.io/guide_plugin-development_blackberry_index.md.html)
-
-
-Installing the cordova-blackberry-webworks Framework
-=====================================================
-
-Cloning the cordova-blackberry-webworks repository always provides you with the latest (EDGE) version of the Cordova code.  To clone the repository, do the following:
-
-    $ cd C:\some\path\
-    $ git clone git://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks.git
-
-Cordova BlackBerry Developer Tools
----
-
-The Cordova developer tooling is split between general tooling and project level tooling. If you are on Windows, please run the equivalent .bat files instead of the shell scripts :)
-
-### General Commands
-
-    ./bin/create [path appname packagename] ............ creates a sample app with the specified application name, to the specified path
-
-Please note that once you `create` a Cordova BlackBerry project, you
-will need to edit the `project.properties` file that resides inside your
-generated application directory to set up your environment properly. You
-will need to specify things like the location of the BlackBerry Widget
-Packager(s), device and signing key passwords, simulator executables,
-and device IPs (if applicable).
-
-The ./bin/create command is also required to be called in order to automatically download 
-the bin/template/project/lib/ant-contrib.jar file. Please be aware that without running
-this command first, your project will not have this important file! Once that ant-contrib.jar
-file is downloaded, there is no need to update that file or download again.
-
-#### Running the Example Project
-
-Create the example project and build it to the first device:
-
-    ./bin/create
-    cd example
-    ./cordova/run blackberry
-
-#### Creating a new Cordova BlackBerry Project
-
-    ./bin/create ~/Desktop/myapp MyAppName MyAppPackageName
-
-### Project Commands
-
-These commands live in a generated Cordova BlackBerry project. As per
-the note above, please make sure you edit the `project.properties` file
-inside your application directory appropriately otherwise these commands
-will not work!
-
-    ./cordova/run ............................ install to a connected device or simulator
-    ./cordova/build .......................... build project, but do not deploy to simulator or device
-
-
-(Legacy) Creating a New Cordova Project
--------------------------------
-
-The (legacy) Cordova ant build scripts enable you to create multiple, independent Cordova projects.
-
-(Note: The Cordova build script requires Apache ANT 1.8 or higher. Also, these scripts won't work without
-the bin/template/project/lib/ant-contrib.jar file so please run the ./bin/create command to automatically
-download that file or manually download it and place it in the bin/template/lib/ directory.
-
-The build script packages the Cordova source code and resources into each project you create.  This allows you to easily distribute the project to other BlackBerry WebWorks developers.  To create a Cordova project:
-
-    $ cd cordova-blackberry-webworks
-    $ ant help
-
-    $ ant create -Dproject.path="C:\development\my_new_project"
-
-    $ cd C:\development\my_new_project
-    $ ant help
-
-For each project, you need to tell ANT where you installed the BlackBerry WebWorks SDK, which packages and compiles your code into a deployable application.  You can specify the location of the BlackBerry WebWorks Packager (BBWP) by editing __project.properties__ in the project directory.
-
-    [edit project.properties]
-
-Building and Deploying a Project
---------------------------------
-
-The Cordova build scripts automate common tasks, such as compiling your project, and deploying it to simulators or devices.  To see what options are available, use:
-
-    $ cd C:\development\my_new_project
-    $ ant help
-
-Every command is in the form `ant TARGET COMMAND [options]`, where
-target is either `blackberry`, `playbook` or `qnx`.
-
-To build your project into a deployable application (.cod/.jad) file:
-
-    $ ant TARGET build
-
-To build your project and load it in a BlackBerry simulator:
-
-    $ ant TARGET load-simulator
-
-To build your project and load it onto a USB-attached device:
-
-    $ ant TARGET load-device
-
-Updating the Cordova Framework
--------------------------------
-
-As you develop your application, there may be updates made to the Cordova source code.  To incorporate Cordova changes into your project, use the build script as follows:
-
-    $ cd cordova-blackberry-webworks
-    $ git pull origin master
-
-    $ ant update -Dproject.path="C:\development\my_new_project"
-
-Customizing Cordova
---------------------
-
-By default, Cordova gives access to all the core Cordova APIs as detailed at docs.cordova.io.
-If you want to remove some of those APIs you can do so by editing the plugins.xml document in your 
-application root. You need to edit the plugins.xml file to add third-party plugins to your application 
-as well.
-
-Creating a Distribution
------------------------
-
-### Update Version
-
-    $ ant version -Dvalue="1.0.0"
-
-    $ git diff
-    $ git commit -am "Update to version 1.0.0"
-    $ git tag 1.0.0
-
-### Create distribution
-
-    $ ant dist
-
-Troubleshooting
-===============
-
-__Q: I uploaded my application to the BlackBerry device, but it will not open or run.__
-
-__A:__ Try hard resetting the device by pressing and hold ALT + CAPS LOCK + DEL. You must press and hold each key in sequence and not all at once.  Some devices require _either_ the right or left CAPS LOCK key to be pressed.  Some devices also require this combination to be pressed twice.
-
-__Q: My simulator screen is not refreshing and I see blocks on a clicked position.__
-
-__A:__ Windows 7 and the simulator's graphics acceleration do not mix. On the simulator, set View -> Graphics Acceleration to Off.
-
-__Q: When I use the Cordova [Camera.getPicture API](http://docs.cordova.io/cordova_camera_camera.md.html#camera.getPicture) on my device, the camera never returns to my application.  Why does this happen?__
-
-__A:__ Cordova uses a JavaScript Extension to invoke the native camera application so the user can take a picture.  When the picture is taken, Cordova will close the native camera application by emulating a key injection (pressing the back/escape button).  On a physical device, users will have to set permissions to allow the application to simulate key injections.  Setting application permissions is device-specific.  On a Storm2 (9550), for example, select the BlackBerry button from the Home screen to get to All Applications screen, then Options > Applications > Your Application.  Then select Edit Default Permissions > Interactions > Input Simulation and set it to 'Allow'.  Save your changes.
-
-__Q: None of the Cordova APIs are working, why is that?__
-
-__A:__ You probably need to update your plugins.xml file in the root of your application.
+blackberry10 - BB10

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/VERSION b/lib/cordova-blackberry/VERSION
deleted file mode 100644
index e70b452..0000000
--- a/lib/cordova-blackberry/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.6.0

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/create
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create b/lib/cordova-blackberry/bin/create
deleted file mode 100755
index b7e719b..0000000
--- a/lib/cordova-blackberry/bin/create
+++ /dev/null
@@ -1,104 +0,0 @@
-#! /bin/sh
-#       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.
-#
-# create a cordova/blackberry project
-# 
-# USAGE
-#   ./create [path package appname]
-#
-set -e
-
-if [ -n "$1" ] && [ "$1" == "-h" ]
-then
-    echo 'usage: create path package appname'
-    echo 'After you have created your application, make sure to customize the project.properties file inside your app directory with your environment specifics!'
-    exit 0
-fi
-
-BUILD_PATH="$( cd "$( dirname "$0" )/.." && pwd )"
-VERSION=$(cat "$BUILD_PATH/VERSION")
-
-PROJECT_PATH="${1:-"./example"}"
-PACKAGE=${2:-"org.apache.cordova.example"}
-NAME=${3:-"cordovaExample"}
-
-# clobber any existing example
-if [ -d "$PROJECT_PATH" ]
-then
-    echo "Project already exists! Delete and recreate"
-    exit 1
-fi
-
-# cleanup after exit and/or on error
-function on_exit {
-    echo "Cleaning up ..."
-    [ -d "$BUILD_PATH/build" ] && rm -rf "$BUILD_PATH/build"
-    echo "Remember to update the project.properties file inside your application directory!"
-}
-
-function on_error {
-    echo "An error occured. Deleting project..."
-    [ -d "$PROJECT_PATH" ] && rm -rf "$PROJECT_PATH"
-}
-
-function replace {
-    local pattern=$1
-    local filename=$2
-    # Mac OS X requires -i argument
-    if [[ "$OSTYPE" =~ "darwin" ]]
-    then
-        /usr/bin/sed -i '' -e $pattern "$filename"
-    elif [[ "$OSTYPE" =~ "linux" ]]
-    then
-        /bin/sed -i -e $pattern "$filename"
-    fi
-}
-
-# we do not want the script to silently fail
-trap on_error ERR
-trap on_exit EXIT
-
-ANT="$(which ant)"
-
-MANIFEST_PATH="$PROJECT_PATH/www/config.xml"
-
-# compile cordova.js and cordova.jar if in source, ignore if in distribution
-if [ ! -e "$BUILD_PATH/www/ext/cordova-$VERSION.jar" ] && [ -d "$BUILD_PATH/framework" ]
-then
-    if [ ! -e "$BUILD_PATH"/bin/templates/project/lib/ant-contrib/ant-contrib-1.0b3.jar ]; then
-        echo "Downloading ant-contrib"
-        # Use curl to get the jar
-        curl -OL http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar &> /dev/null
-        mkdir -p "$BUILD_PATH"/bin/templates/project/lib/ant-contrib
-        mv ant-contrib-1.0b3.jar "$BUILD_PATH"/bin/templates/project/lib/ant-contrib
-    fi
-    
-	echo "Creating BlackBerry project..."
-	(cd "$BUILD_PATH" && "$ANT" create -Dproject.path="$PROJECT_PATH" &> /dev/null )
-    # interpolate the activity and package into config.xml
-    echo "Updating config.xml ..."
-    replace "s/__NAME__/${NAME}/g" "$MANIFEST_PATH"
-    replace "s/__PACKAGE__/${PACKAGE}/g" "$MANIFEST_PATH"
-else
-	# copy project template if in distribution
-	echo "Copying assets and resources ..."
-	cp -r "$BUILD_PATH/sample/." "$PROJECT_PATH"
-    echo "Updating config.xml ..."
-    replace "s/cordovaExample/${NAME}/g" "$MANIFEST_PATH"
-    replace "s/org.apache.cordova.example/${PACKAGE}/g" "$MANIFEST_PATH"
-fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/create.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create.bat b/lib/cordova-blackberry/bin/create.bat
deleted file mode 100644
index ecb039a..0000000
--- a/lib/cordova-blackberry/bin/create.bat
+++ /dev/null
@@ -1,33 +0,0 @@
-@ECHO OFF
-goto comment
-       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.
-:comment
-
-IF NOT DEFINED JAVA_HOME GOTO MISSING
-FOR %%X in (ant.bat) do (
-    SET FOUND=%%~$PATH:X
-    IF NOT DEFINED FOUND GOTO MISSING
-)
-cscript %~dp0\create.js %*
-GOTO END
-:MISSING
-ECHO Missing one of the following:
-ECHO JDK: http://java.oracle.com
-ECHO Apache ant: http://ant.apache.org
-EXIT /B 1
-:END

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/create.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create.js b/lib/cordova-blackberry/bin/create.js
deleted file mode 100644
index ac4b083..0000000
--- a/lib/cordova-blackberry/bin/create.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-       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.
-*/
-
-/*
- * create a cordova/blackberry project
- *
- * USAGE
- *  ./create [path package appname]
- */
-
-var fso = WScript.CreateObject('Scripting.FileSystemObject');
-
-function read(filename) {
-    var fso=WScript.CreateObject("Scripting.FileSystemObject");
-    var f=fso.OpenTextFile(filename, 1);
-    var s=f.ReadAll();
-    f.Close();
-    return s;
-}
-function write(filename, contents) {
-    var fso=WScript.CreateObject("Scripting.FileSystemObject");
-    var f=fso.OpenTextFile(filename, 2, true);
-    f.Write(contents);
-    f.Close();
-}
-function replaceInFile(filename, regexp, replacement) {
-    write(filename, read(filename).replace(regexp, replacement));
-}
-function downloadAntContrib(){
-    if (!fso.FileExists(ROOT + '\\bin\\templates\\project\\lib\\ant-contrib\\ant-contrib-1.0b3.jar')) {
-      // We need the .jar
-      var url = 'http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar';
-      var libsPath = ROOT + '\\bin\\templates\\project\\lib\\ant-contrib';
-      var savePath = libsPath + '\\ant-contrib-1.0b3.jar';
-      if (!fso.FileExists(savePath)) {
-        if(!fso.FolderExists(libsPath)) {
-            fso.CreateFolder(libsPath);
-        }
-        // We need the zip to get the jar
-        var xhr = WScript.CreateObject('MSXML2.XMLHTTP');
-        xhr.open('GET', url, false);
-        xhr.send();
-        if (xhr.status == 200) {
-          var stream = WScript.CreateObject('ADODB.Stream');
-          stream.Open();
-          stream.Type = 1;
-          stream.Write(xhr.ResponseBody);
-          stream.Position = 0;
-          stream.SaveToFile(savePath);
-          stream.Close();
-        } else {
-          WScript.Echo('Could not retrieve the antcontrib. Please download it yourself and put into the bin/templates/project/lib directory. This process may fail now. Sorry.');
-        }
-      }
-      var app = WScript.CreateObject('Shell.Application');
-      var source = app.NameSpace(savePath).Items();
-      var target = app.NameSpace(libsPath);
-      target.CopyHere(source, 256);
-    }
-}
-function exec(s, output) {
-    var o=shell.Exec(s);
-    while (o.Status == 0) {
-        WScript.Sleep(100);
-    }
-    //WScript.Echo("Command exited with code " + o.Status);
-}
-
-function cleanup() {
-    // Cleanup
-    if(fso.FolderExists(ROOT + '\\dist')) {
-        fso.DeleteFolder(ROOT + '\\dist', true);
-    }
-    if(fso.FolderExists(ROOT + '\\build')) {
-        fso.DeleteFolder(ROOT + '\\build');
-    }
-}
-
-var args = WScript.Arguments, PROJECT_PATH="example", 
-    PACKAGE="org.apache.cordova.example",
-    NAME="cordovaExample",
-    shell=WScript.CreateObject("WScript.Shell");
-    
-// working dir
-var ROOT = WScript.ScriptFullName.split('\\bin\\create.js').join('');
-
-if (args.Count() == 3) {
-    PROJECT_PATH=args(0);
-    PACKAGE=args(1);
-    NAME=args(2);
-}
-
-if(fso.FolderExists(PROJECT_PATH)) {
-    WScript.Echo("Project directory already exists! Please remove it first.");
-    WScript.Quit(1);
-}
-
-var MANIFEST_PATH=PROJECT_PATH+'\\www\\config.xml';
-var VERSION=read(ROOT+'\\VERSION').replace(/\r\n/,'').replace(/\n/,'');
-
-if(fso.FolderExists(ROOT+'\\framework')){
-    downloadAntContrib();
-    exec('ant.bat -f '+ ROOT +'\\build.xml create -Dproject.path="' + PROJECT_PATH + '"');
-    replaceInFile(MANIFEST_PATH, /__PACKAGE__/, PACKAGE);
-    replaceInFile(MANIFEST_PATH, /__ACTIVITY__/, NAME);
-}else{
-    // copy in the project template
-    exec('cmd /c xcopy '+ ROOT + '\\sample\\* '+PROJECT_PATH+' /I /S /Y');    
-    replaceInFile(MANIFEST_PATH, /org.apache.cordova.example/, PACKAGE);
-    replaceInFile(MANIFEST_PATH, /cordovaExample/, NAME);
-}
-
-cleanup();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/dist/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/dist/README.md b/lib/cordova-blackberry/bin/templates/dist/README.md
deleted file mode 100644
index 35a8393..0000000
--- a/lib/cordova-blackberry/bin/templates/dist/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-Cordova BlackBerry Distribution
-===============================
-
-Cordova BlackBerry is a framework that allows for Cordova based projects to be built for the [BlackBerry WebWorks Platform](https://bdsc.webapps.blackberry.com/html5/). Cordova based applications are, at the core, an application written with web technology: HTML, CSS and JavaScript.  The Cordova BlackBerry project allows web developers to develop applications targeting BlackBerry OS 5.0+ and PlayBook devices using the common [Cordova API](http://docs.phonegap.com).
-
-Apache Cordova is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator project. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
-
-Pre-requisites
---------------
-
-- Windows XP (32-bit) or Windows 7 (32-bit and 64-bit) or Mac OSX 10.6.4+
-- Java JDK 1.5
-- Apache ANT
-- [BlackBerry WebWorks SDK](https://bdsc.webapps.blackberry.com/html5/download/sdk)
-- PlayBook development requires [Adobe Air SDK](http://www.adobe.com/devnet/air/air-sdk-download.html)
-
-Directory Structure
--------------------
-
-    sample/ ... Ready-to-run sample project
-    www/ ...... Barebones project assets
-
-### Ready-to-Run Sample Project
-
-The quickest way to get started with Cordova BlackBerry is to make a copy of the `sample` folder. The `sample` folder is a complete Cordova BlackBerry project including build scripts. Copy the `sample` folder to a desired location to create a new Cordova BlackBerry project.
-
-#### Building and Deploying a Project
-
-The build scripts included in the `sample` folder automate common tasks, such as compiling your project, and deploying it to simulators or devices.  To see what options are available, use:
-
-    $ cd C:\development\my_new_project
-    $ ant help
-
-Every command is in the form `ant TARGET COMMAND [options]`, where
-target is either `blackberry` or `playbook`.
-
-To build your project into a deployable application (.cod/.jad) file:
-
-    $ ant TARGET build
-
-To build your project and load it in a BlackBerry simulator:
-
-    $ ant TARGET load-simulator
-
-To build your project and load it onto a USB-attached device:
-
-    $ ant TARGET load-device
-
-### Barebones Project Assets
-
-The `www` folder contains the Cordova specific assets that must be available in a BlackBerry WebWorks project.  If you have an existing BlackBerry WebWorks project, copy/merge these files into your project to enable the project for Cordova.
-
-    ext/cordova.jar     - Native Cordova API implementations for smartphones.
-    ext-air/            - PlayBook Adobe Air extensions for Cordova API.
-    playbook/cordova.js - PlayBook Cordova JavaScript API.
-    cordova.js          - Smartphone Cordova JavaScript API.
-    config.xml          - BlackBerry WebWorks configuration file.
-    plugins.xml         - Cordova plugin configuration file.
-
-`config.xml` is a sample that you are free to alter or merge with an existing BlackBerry WebWorks configuration file. The necessary Cordova sections are contained in the `<feature>` and `<access>` sections:
-
-    <!-- Cordova API -->
-    <feature ... />
-    <feature ... />
-    
-    <!-- Cordova API -->
-    <access ... />
-    <access ... />
-
-Frequently Asked Questions
---------------------------
-
-__Q: My simulator screen is not refreshing and I see blocks on a clicked position.__
-
-__A:__ Windows 7 and the simulator's graphics acceleration do not mix. On the simulator, set View -> Graphics Acceleration to Off.
-
-__Q: When I use the Cordova [Camera.getPicture API](http://docs.phonegap.com/phonegap_camera_camera.md.html#camera.getPicture) on my device, the camera never returns to my application.  Why does this happen?__
-
-__A:__ Cordova uses a JavaScript Extension to invoke the native camera application so the user can take a picture.  When the picture is taken, Cordova will close the native camera application by emulating a key injection (pressing the back/escape button).  On a physical device, users will have to set permissions to allow the application to simulate key injections.  Setting application permissions is device-specific.  On a Storm2 (9550), for example, select the BlackBerry button from the Home screen to get to All Applications screen, then Options > Applications > Your Application.  Then select Edit Default Permissions > Interactions > Input Simulation and set it to 'Allow'.  Save your changes.
-
-__Q: None of the Cordova APIs are working, why is that?__
-
-__A:__ You probably need to update your plugins.xml file in the root of your application.
-
-Additional Information
-----------------------
-- [Cordova home](http://incubator.apache.org/cordova/)
-- [Cordova Documentation](http://docs.phonegap.com)
-- [Cordova Issue Tracker](https://issues.apache.org/jira/browse/CB)
-- [BlackBerry WebWorks Framework](https://bdsc.webapps.blackberry.com/html5/)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/blackberry.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/blackberry.xml b/lib/cordova-blackberry/bin/templates/project/blackberry.xml
deleted file mode 100644
index ce3099f..0000000
--- a/lib/cordova-blackberry/bin/templates/project/blackberry.xml
+++ /dev/null
@@ -1,456 +0,0 @@
-<project default="help">
-<!-- 
-       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.
--->    
-    <!-- LOAD PROPERTIES -->
-    
-    <property prefix="properties" file="project.properties" />
-    <property name="build.dir"    location="build" />
-    <property name="widget.dir"   location="${build.dir}/widget" />
-    <property name="code.sign"    value="false" />
-    <property name="generate.ext" value="cod" />
-    <property name="globalization" value="false" />
-    
-    <!-- BlackBerry WebWorks Packager directory is required. -->
-    <fail unless="properties.blackberry.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'blackberry.bbwp.dir' in your 'project.properties' file." />
-
-    <!-- OS identification -->
-    <condition property="isMacOSX" else="false">
-        <and>
-            <os family="mac" />
-            <os family="unix" />
-        </and>
-    </condition>
-
-    <condition property="javaloader" value="${properties.blackberry.bbwp.dir}/bin/javaloader" else="${properties.blackberry.bbwp.dir}/bin/JavaLoader.exe">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <condition property="bbwp" value="${properties.blackberry.bbwp.dir}/bbwp" else="${properties.blackberry.bbwp.dir}/bbwp.exe">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-
-    <!-- LOAD DEVICE -->
-    
-    <target name="load-device" depends="package-app">
-        <bbwp code-sign="true" />
-        <exec executable="${javaloader}" dir="." failonerror="true">
-            <arg value="-u" />
-            <arg value="-w${properties.blackberry.sim.password}" />
-            <arg value="load" />
-            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
-        </exec>
-    </target>
-
-    <!-- DEBUG-LOAD DEVICE -->
-    
-    <target name="debug-device" depends="package-app">
-        <bbwp code-sign="true" debug="true" />
-        <exec executable="${javaloader}" dir="." failonerror="true">
-            <arg value="-u" />
-            <arg value="-w${properties.blackberry.sim.password}" />
-            <arg value="load" />
-            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
-        </exec>
-    </target>
-
-    <!-- LOAD SIMULATOR -->
-    
-    <target name="load-simulator" depends="build">
-    
-        <!-- Find the simulator directory -->
-        <set-simulator-dir />
-
-        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
-        <path id="bbwp.sim.path">
-            <first>
-                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
-                    <include name="**/handhelds.manifest.txt" />
-                </fileset>
-            </first>
-        </path>
-        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
-
-        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
-             Otherwise, use bbwp simulator directory. -->
-        <condition 
-            property="simulator.dir" 
-            value="${properties.blackberry.sim.dir}" 
-            else="${bbwp.sim.dir}">
-                <available file="${properties.blackberry.sim.dir}" type="dir" />
-        </condition>
-        <echo message="Simulator directory=${simulator.dir}" />
-
-        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
-             or try setting to 'defaultSimulator.bat' in simulator directory. -->
-        <condition 
-            property="sim.bin" 
-            value="${properties.blackberry.sim.bin}" 
-            else="defaultSimulator.bat">
-                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
-        </condition>
-
-        <!-- If simulator executable does not exist, use the first device listed 
-             in the 'handhelds.manifest.txt' file in the simulator directory. -->
-        <loadfile 
-            property="device.list"
-            srcFile="${simulator.dir}/handhelds.manifest.txt">
-            <filterchain>
-                <tokenFilter>
-                    <stringtokenizer/>
-                </tokenFilter>
-            </filterchain>
-        </loadfile>
-
-        <propertyregex property="device"
-            input="${device.list}"
-            regexp="^\d{4}"
-            select="\0"
-            override="true" />
-        <property name="device.bin" value="${device}.bat" />
-
-        <condition
-            property="simulator.bin" 
-            value="${sim.bin}"
-            else="${device.bin}">
-                <available file="${simulator.dir}/${sim.bin}" />
-        </condition>
-        
-        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
-
-        <!-- Close running simulators -->
-        <echo message="Closing all running simulators..." />
-        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
-            <arg value="/execute=kill" />
-        </exec>
-
-        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
-             Otherwise, use bbwp MDS directory. -->
-        <condition 
-            property="mds.dir" 
-            value="${properties.blackberry.mds.dir}" 
-            else="${properties.blackberry.bbwp.dir}/mds">
-                <available file="${properties.blackberry.mds.dir}" type="dir" />
-        </condition>
-        <echo message="MDS directory=${mds.dir}" />
-        
-        <copy todir="${simulator.dir}">
-            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
-        </copy>
-        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
-        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
-
-        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
-             WebWorks SDK do not include it. -->
-        <if>
-            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
-            <then>
-                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
-            </then>
-        </if>
-    </target>
-
-    <target name="debug-simulator" depends="package-app">
-        <bbwp code-sign="false" debug="true" />
-    
-        <!-- Find the simulator directory -->
-        <set-simulator-dir />
-
-        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
-        <path id="bbwp.sim.path">
-            <first>
-                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
-                    <include name="**/handhelds.manifest.txt" />
-                </fileset>
-            </first>
-        </path>
-        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
-
-        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
-             Otherwise, use bbwp simulator directory. -->
-        <condition 
-            property="simulator.dir" 
-            value="${properties.blackberry.sim.dir}" 
-            else="${bbwp.sim.dir}">
-                <available file="${properties.blackberry.sim.dir}" type="dir" />
-        </condition>
-        <echo message="Simulator directory=${simulator.dir}" />
-
-        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
-             or try setting to 'defaultSimulator.bat' in simulator directory. -->
-        <condition 
-            property="sim.bin" 
-            value="${properties.blackberry.sim.bin}" 
-            else="defaultSimulator.bat">
-                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
-        </condition>
-
-        <!-- If simulator executable does not exist, use the first device listed 
-             in the 'handhelds.manifest.txt' file in the simulator directory. -->
-        <loadfile 
-            property="device.list"
-            srcFile="${simulator.dir}/handhelds.manifest.txt">
-            <filterchain>
-                <tokenFilter>
-                    <stringtokenizer/>
-                </tokenFilter>
-            </filterchain>
-        </loadfile>
-
-        <propertyregex property="device"
-            input="${device.list}"
-            regexp="^\d{4}"
-            select="\0"
-            override="true" />
-        <property name="device.bin" value="${device}.bat" />
-
-        <condition
-            property="simulator.bin" 
-            value="${sim.bin}"
-            else="${device.bin}">
-                <available file="${simulator.dir}/${sim.bin}" />
-        </condition>
-        
-        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
-
-        <!-- Close running simulators -->
-        <echo message="Closing all running simulators..." />
-        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
-            <arg value="/execute=kill" />
-        </exec>
-
-        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
-             Otherwise, use bbwp MDS directory. -->
-        <condition 
-            property="mds.dir" 
-            value="${properties.blackberry.mds.dir}" 
-            else="${properties.blackberry.bbwp.dir}/mds">
-                <available file="${properties.blackberry.mds.dir}" type="dir" />
-        </condition>
-        <echo message="MDS directory=${mds.dir}" />
-        
-        <copy todir="${simulator.dir}">
-            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
-        </copy>
-        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
-        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
-
-        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
-             WebWorks SDK do not include it. -->
-        <if>
-            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
-            <then>
-                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
-            </then>
-        </if>
-    </target>
-    
-    <!-- PACKAGE-APP -->
-    
-    <target name="package-app" depends="generate-cod-name, clean">
-        <!-- Copy the WebWorks application -->
-        <mkdir dir="${widget.dir}" />
-        <copy todir="${widget.dir}" overwrite="true">
-            <fileset dir="www" >
-                <exclude name="ext-air/**"/>
-                <exclude name="ext-qnx/**"/>
-                <exclude name="res/resourceBundles/**" unless="${globalization}"/>
-            </fileset>
-        </copy>
-        
-        <!-- Package the WebWorks app by zipping the widget dir. -->
-        <mkdir dir="${build.dir}" />
-        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
-    </target>
-    
-    <!-- BUILD -->
-
-    <target name="build" depends="package-app">
-        <bbwp code-sign="${code.sign}" />
-    </target>
-
-    <!-- BBWP MACRO -->
-
-    <macrodef name="bbwp">
-        <attribute name="code-sign" default="false" />
-        <attribute name="debug" default="false" />
-        <sequential>
-            <!-- check if debug flag was passed in and set an appropriate flag for CLI exec of bbwp -->
-            <if>
-                <equals arg1="@{debug}" arg2="true" />
-                <then>
-                    <property name="debug.flag" value="/d" />
-                </then>
-                <else>
-                    <property name="debug.flag" value="" />
-                </else>
-            </if>
-
-            <!-- Ensure bbwp executable exists. -->
-            <property name="properties.blackberry.bbwp.bin" location="${bbwp}" /> 
-            <available file="${properties.blackberry.bbwp.bin}" property="properties.blackberry.bbwp.exists" />
-            <fail unless="properties.blackberry.bbwp.exists" message="Cannot find ${properties.blackberry.bbwp.bin}. Please edit 'blackberry.bbwp.dir' in your 'project.properties' file." />
-
-            <if>
-                <equals arg1="@{code-sign}" arg2="true" />
-                <then>
-                    <exec executable="${properties.blackberry.bbwp.bin}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg value="/g" />
-                        <arg value="${properties.blackberry.sigtool.password}" />
-                        <arg line="${debug.flag} /o" />
-                        <arg file="${build.dir}" />
-                    </exec>
-                </then>
-                <else>
-                    <exec executable="${properties.blackberry.bbwp.bin}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg line="${debug.flag} /o" />
-                        <arg file="${build.dir}" />
-                    </exec>
-                </else>
-            </if>
-        </sequential>
-    </macrodef>
-
-    <!-- CLEAN -->
-    
-    <target name="clean">
-        <delete dir="${build.dir}" />
-        <delete dir="${widget.dir}" />
-    </target>
-    
-    <!-- CLEAN DEVICE -->
-    
-    <target name="clean-device" depends="generate-cod-name">
-        <exec executable="${javaloader}">
-            <arg value="-usb" />
-            <arg value="erase" />
-            <arg value="-f" />
-            <arg value="${cod.name}.cod" />
-        </exec>
-    </target>
-    
-    <!-- CLEAN SIMULATOR -->
-    
-    <target name="clean-simulator">
-        <!-- Find the simulator directory -->
-        <set-simulator-dir />
-        
-        <exec executable="${simulator.dir}/clean.bat" dir="${simulator.dir}" />
-        
-        <delete>
-            <fileset dir="${simulator.dir}" includes="*.cod,*.csl,*.cso,*.debug,*.jar" />
-        </delete>
-    </target>
-    
-        <!-- HELPER TASKS -->
-    
-    <target name="generate-cod-name">
-        <xmlproperty file="www/config.xml" prefix="config.xml" />
-        <propertyregex property="cod.name"
-                       input="${config.xml.widget.name}"
-                       regexp="(\W+)"
-                       replace=""
-                       casesensitive="false"
-                       global="true"
-                       defaultValue="${config.xml.widget.name}" />
-        <echo message="Generated name: ${cod.name}.cod" />
-    </target>
-    
-        <!-- MACRO: SET SIMULATOR DIRECTORY -->
-    
-    <macrodef name="set-simulator-dir">
-        <sequential>
-            <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
-            <path id="bbwp.sim.path">
-                <first>
-                    <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
-                        <include name="**/handhelds.manifest.txt" />
-                    </fileset>
-                </first>
-            </path>
-            <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
-
-            <!-- Simulator directory: Use sim.dir property if set in project.properties file.
-                 Otherwise, use bbwp simulator directory. -->
-            <condition
-                property="simulator.dir"
-                value="${properties.blackberry.sim.dir}"
-                else="${bbwp.sim.dir}">
-                    <available file="${properties.blackberry.sim.dir}" type="dir" />
-            </condition>
-            <echo message="Simulator directory=${simulator.dir}" />
-        </sequential>
-    </macrodef>
-	
-	    <!-- HELP -->
-    
-    <target name="help">
-        <echo>
-NAME
-  ${ant.project.name}
-
-SYNOPSIS
-  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
-
-DESCRIPTION
-  You can build and deploy your project to a device or simulator.
-  
-TARGETS
-  blackberry ........ Builds a cod file and deploys to a device or simulator
- 
-  playbook .......... Builds a bar file and deploys to a device or simulator
-
-COMMANDS
-  help .............. Show this help menu.
-                        ant, ant help
-
-  load-device ....... Builds and deploys project to a connected USB device.
-                        ant load-device
-
-  load-simulator .... Builds and deploys project to default simulator.
-                        ant load-simulator
-
-  build ............. Compiles and packages the project for deployment.
-                        ant build
-                                              
-  clean ............. Remove all files from the build/ directory.
-                        ant clean
-
-  clean-device ...... Remove this project from the connected USB device.
-                        ant clean-device
-
-  clean-simulator ... Remove this project from the simulator (takes a while).
-                        ant clean-simulator
-
-GETTING STARTED
-  1. Edit project.properties
-
-  2. &lt;ant load-simulator&gt; to run the project on the simulator
-
-  3. Customize your project by editing www/config.xml
-
-  4. To run the project on a BlackBerry device, you will need to obtain
-     code signing keys from RIM. Once you have the key, a project is
-     installed by connecting a BlackBerry via USB and running
-     &lt;ant load-device&gt;.
-        </echo>
-    </target>
-</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/build.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/build.xml b/lib/cordova-blackberry/bin/templates/project/build.xml
deleted file mode 100644
index d1fb939..0000000
--- a/lib/cordova-blackberry/bin/templates/project/build.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-<project name="Build and Deploy a Cordova BlackBerry WebWorks Project" default="help">
-<!-- 
-       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.
--->    
-    <!-- LOAD ANT-CONTRIB LIBRARY -->
-    
-    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
-      <classpath>
-        <pathelement location="./lib/ant-contrib/ant-contrib-1.0b3.jar" />
-      </classpath>
-    </taskdef>
-
-    <!-- LOAD PROPERTIES -->
-    
-    <property prefix="properties" file="project.properties" />
-    <property name="build.dir"    location="build" />
-    <property name="widget.dir"   location="${build.dir}/widget" />
-    <property name="code.sign"    value="false" />
-    <property name="globalization" value="false" />
-        
-    <target name="blackberry" >
-        <property name="subant.file"  value="blackberry.xml" />
-    </target>
-    
-    <target name="playbook" >
-        <property name="subant.file"  value="playbook.xml" />
-    </target>
-
-    <target name="qnx" >
-        <property name="subant.file"  value="qnx.xml" />
-    </target>
-    
-    <target name="load-device">
-        <subant target="load-device">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="load-simulator">
-        <subant target="load-simulator">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-
-    <target name="debug-simulator">
-        <subant target="debug-simulator">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-
-    <target name="debug-device">
-        <subant target="debug-device">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="build">
-        <subant target="build">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-
-    <target name="clean">
-        <subant target="clean">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="clean-device">
-        <subant target="clean-device">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="package-app">
-        <subant target="package-app">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="clean-simulator">
-        <subant target="clean-simulator">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <!-- HELP -->
-    
-    <target name="help">
-        <echo>
-NAME
-  ${ant.project.name}
-
-SYNOPSIS
-  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
-
-DESCRIPTION
-  You can build and deploy your project to a device or simulator.
-  
-TARGETS
-  blackberry ........ Builds a cod file and deploys to a device or simulator
- 
-  playbook .......... Builds a bar file and deploys to a device or simulator
-
-  qnx ............... Builds a bar file and deploys to a device or simulator
-
-COMMANDS
-  help .............. Show this help menu.
-                        ant, ant help
-
-  load-device ....... Builds and deploys project to a connected USB device.
-                        ant TARGET load-device
-
-  load-simulator .... Builds and deploys project to default simulator.
-                        ant TARGET load-simulator
-
-  build ............. Compiles and packages the project for deployment.
-                        ant TARGET build
-
-  package-app ....... Packages the app into a WebWorks-compatible .zip file.
-                        ant TARGET package-app
-
-  clean ............. Remove all files from the build/ directory.
-                        ant TARGET clean
-
-  clean-device ...... Remove this project from the connected USB device.
-                        ant TARGET clean-device
-
-  clean-simulator ... Remove this project from the simulator (takes a while).
-                        ant TARGET clean-simulator
-
-GETTING STARTED
-  1. Edit project.properties
-
-  2. &lt;ant load-simulator&gt; to run the project on the simulator
-
-  3. Customize your project by editing www/config.xml
-
-  4. To run the project on a BlackBerry device, you will need to obtain
-     code signing keys from RIM. Once you have the key, a project is
-     installed by connecting a BlackBerry via USB and running
-     &lt;ant load-device&gt;.
-        </echo>
-    </target>
-</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/cordova/build
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/build b/lib/cordova-blackberry/bin/templates/project/cordova/build
deleted file mode 100755
index d788360..0000000
--- a/lib/cordova-blackberry/bin/templates/project/cordova/build
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/sh
-#       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.
-
-ANT=$(which ant)
-
-if [ -z "$1" ]
-then
-  echo 'usage: build <platform>'
-  echo 'where <platform> can be one of "blackberry", "playbook" or "qnx"'
-  echo 'NOTE: please customize the project.properties file first before using this command!'
-  exit 0
-fi
-
-if [ "$1" == "blackberry" -o "$1" == "playbook" -o "$1" == "qnx" ]
-then
-  $ANT $1 build
-else
-  echo 'Platform not recognized! Please use one of "blackberry", "playbook", or "qnx" for the platform parameter.'
-fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/run b/lib/cordova-blackberry/bin/templates/project/cordova/run
deleted file mode 100755
index 260ff24..0000000
--- a/lib/cordova-blackberry/bin/templates/project/cordova/run
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-#       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.
-
-ANT=$(which ant)
-
-if [ -z "$1" ]
-then
-  echo 'usage: run <platform>'
-  echo 'where <platform> can be one of "blackberry", "playbook" or "qnx"'
-  echo 'NOTE: please customize the project.properties file first before using this command!'
-  exit 0
-fi
-
-if [ "$1" == "blackberry" -o "$1" == "playbook" -o "$1" == "qnx" ]
-then
-  echo 'Do you have a BlackBerry device connected to your computer? (y/n)'
-  read DEVICE
-  if [ $DEVICE == "y" ]
-  then
-    $ANT $1 debug-device
-  else
-    $ANT $1 load-simulator
-  fi
-else
-  echo 'Platform not recognized! Please use one of "blackberry", "playbook", or "qnx" for the platform parameter.'
-fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/lib/ant-contrib/ant-contrib-1.0b3.jar
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/lib/ant-contrib/ant-contrib-1.0b3.jar b/lib/cordova-blackberry/bin/templates/project/lib/ant-contrib/ant-contrib-1.0b3.jar
deleted file mode 100644
index 0625376..0000000
Binary files a/lib/cordova-blackberry/bin/templates/project/lib/ant-contrib/ant-contrib-1.0b3.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/bin/templates/project/playbook.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/playbook.xml b/lib/cordova-blackberry/bin/templates/project/playbook.xml
deleted file mode 100644
index 7250cbc..0000000
--- a/lib/cordova-blackberry/bin/templates/project/playbook.xml
+++ /dev/null
@@ -1,338 +0,0 @@
-<project default="help">
-<!-- 
-       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.
--->    
-    <!-- LOAD PROPERTIES -->
-    
-    <property prefix="properties" file="project.properties" />
-    <property name="build.dir"    location="build" />
-    <property name="widget.dir"   location="${build.dir}/widget" />
-    <property name="code.sign"    value="false" />
-    <property name="generate.ext"   value="cod" />
-    <property name="build.num.file" value="buildId.txt" />
-    
-    <!-- BlackBerry WebWorks Packager for Tablets directory is required. -->
-    <fail unless="properties.playbook.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'playbook.bbwp.dir' in your 'project.properties' file." />
-
-    <!-- OS identification -->
-    <condition property="isMacOSX" else="false">
-        <and>
-            <os family="mac" />
-            <os family="unix" />
-        </and>
-    </condition>
-
-    <condition property="bbwp" value="${properties.playbook.bbwp.dir}/bbwp" else="${properties.playbook.bbwp.dir}/bbwp.exe">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <condition property="blackberry-deploy" value="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-deploy" else="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-deploy.bat">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <condition property="blackberry-debugtokenrequest" value="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-debugtokenrequest" else="${properties.playbook.bbwp.dir}/blackberry-tablet-sdk/bin/blackberry-debugtokenrequest.bat">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <!-- LOAD DEVICE -->
-    
-    <target name="load-device" depends="package-app">
-        <bbwp code-sign="true" />
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.playbook.device.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.playbook.device.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <!-- DEBUG-LOAD DEVICE -->
-    
-    <target name="debug-device" depends="package-app">
-        <if>
-            <equals arg1="${properties.playbook.device.pin}" arg2="" />
-            <then>
-                <echo>
-                    If you fill in the playbook.device.pin value you can use debug tokens!
-                    This means you won't have to worry about having a unique version in config.xml every time.
-                </echo>
-                <bbwp code-sign="true" debug="true" />
-            </then>
-            <else>
-                <generate-debug-token />
-                <bbwp code-sign="false" debug="true" />
-            </else>
-        </if>
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.playbook.device.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.playbook.device.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <!-- LOAD SIMULATOR -->
-    
-    <target name="load-simulator" depends="build">
-
-        <echo>This tool will not open the simulator for you </echo>
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.playbook.sim.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.playbook.sim.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <target name="debug-simulator" depends="package-app">
-        <bbwp code-sign="false" debug="true" />
-        <echo>This tool will not open the simulator for you </echo>
-
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-installApp" />
-            <arg value="-launchApp" />
-            <arg value="-device" />
-            <arg value="${properties.playbook.sim.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.playbook.sim.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/${cod.name}.bar" />
-        </exec>
-    </target>
-    <!-- PACKAGE-APP -->
-    
-    <target name="package-app" depends="generate-cod-name, clean">
-        <!-- Copy the WebWorks application -->
-        <mkdir dir="${widget.dir}" />
-        <copy todir="${widget.dir}" overwrite="true">
-            <fileset dir="www" >
-                <exclude name="ext/**"/>
-                <exclude name="ext-air/**"/>
-                <exclude name="res/resourceBundles/**"/>
-            </fileset>
-        </copy>
-        
-        <!-- Update WebWorks Packager with the AIR APIs -->
-        <copy todir="${properties.playbook.bbwp.dir}\ext" overwrite="true">
-            <fileset dir="www/ext-air" excludes="README.md" />
-        </copy>
-        
-        <!-- Package the WebWorks app by zipping the widget dir. -->
-        <mkdir dir="${build.dir}" />
-        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
-    </target>
-    
-    <!-- BUILD -->
-
-    <target name="build" depends="package-app">
-        <bbwp code-sign="${code.sign}" />
-    </target>
-
-    <!-- BBWP MACRO -->
-
-    <macrodef name="bbwp">
-        <attribute name="code-sign" default="false" />
-        <attribute name="debug" default="false" />
-        <sequential>
-            <!-- check if debug flag was passed in and set an appropriate flag for CLI exec of bbwp -->
-            <if>
-                <equals arg1="@{debug}" arg2="true" />
-                <then>
-                    <property name="debug.flag" value="-d" />
-                </then>
-                <else>
-                    <property name="debug.flag" value="" />
-                </else>
-            </if>
-            <buildnumber file="${build.num.file}" />
-            <if>
-                <equals arg1="@{code-sign}" arg2="true" />
-                <then>
-                    <exec executable="${bbwp}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg value="-gcsk" />
-                        <arg value="${properties.playbook.sigtool.csk.password}" />
-                        <arg value="-gp12" />
-                        <arg value="${properties.playbook.sigtool.p12.password}" />
-                        <arg value="-o" />
-                        <arg file="${build.dir}" />
-                        <arg line="${debug.flag} -buildId" />
-                        <arg value="${build.number}" />
-                    </exec>
-                </then>
-                <else>
-                    <exec executable="${bbwp}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg value="-o" />
-                        <arg file="${build.dir}" />
-                        <arg line="${debug.flag} -buildId" />
-                        <arg value="${build.number}" />
-                    </exec>
-                </else>
-            </if>
-        </sequential>
-    </macrodef>
-
-    <!-- install debug token" -->
-    <macrodef name="generate-debug-token">
-        <sequential>
-            <exec executable="${blackberry-debugtokenrequest}" dir="." failonerror="true">
-                <arg value="-storepass" />
-                <arg value="${properties.playbook.sigtool.csk.password}" />
-                <arg value="-deviceID" />
-                <arg value="0x${properties.playbook.device.pin}" />
-                <arg file="${properties.playbook.bbwp.dir}/debugtoken.bar" />
-            </exec>
-
-            <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-                <arg value="-installApp" />
-                <arg value="-launchApp" />
-                <arg value="-device" />
-                <arg value="${properties.playbook.device.ip}" />
-                <arg value="-password" />
-                <arg value="${properties.playbook.device.password}" />
-                <arg value="-package" />
-                <arg file="${properties.playbook.bbwp.dir}/debugtoken.bar" />
-            </exec>
-
-            <replaceregexp 
-                file="${properties.playbook.bbwp.dir}/bin/bbwp.properties" 
-                match='&lt;debug_token&gt;.*&lt;\/debug_token&gt;'
-                replace='&lt;debug_token&gt;${properties.playbook.bbwp.dir}/debugtoken.bar&lt;/debug_token&gt;'
-                byline='true'/>
-        </sequential>
-    </macrodef>
-
-    <!-- CLEAN -->
-    
-    <target name="clean">
-        <delete dir="${build.dir}" />
-        <delete dir="${widget.dir}" />
-    </target>
-    
-    <!-- CLEAN DEVICE -->
-    
-    <target name="clean-device" depends="generate-cod-name">
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-uninstallApp" />
-            <arg value="-device" />
-            <arg value="${properties.playbook.device.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.playbook.device.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-    <!-- CLEAN SIMULATOR -->
-    
-    <target name="clean-simulator" depends="generate-cod-name">
-        <exec executable="${blackberry-deploy}" dir="." failonerror="true">
-            <arg value="-uninstallApp" />
-            <arg value="-device" />
-            <arg value="${properties.playbook.sim.ip}" />
-            <arg value="-password" />
-            <arg value="${properties.playbook.sim.password}" />
-            <arg value="-package" />
-            <arg file="${build.dir}/${cod.name}.bar" />
-        </exec>
-    </target>
-    
-        <!-- HELPER TASKS -->
-    
-    <target name="generate-cod-name">
-        <xmlproperty file="www/config.xml" prefix="config.xml" />
-        <propertyregex property="cod.name"
-                       input="${config.xml.widget.name}"
-                       regexp="(\W+)"
-                       replace=""
-                       casesensitive="false"
-                       global="true"
-                       defaultValue="${config.xml.widget.name}" />
-        <echo message="Generated name: ${cod.name}.bar" />
-    </target>
-
-    <!-- HELP -->
-
-    <target name="help">
-        <echo>
-NAME
-  ${ant.project.name}
-
-SYNOPSIS
-  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
-
-DESCRIPTION
-  You can build and deploy your project to a device or simulator.
-  
-TARGETS
-  blackberry ........ Builds a cod file and deploys to a device or simulator
- 
-  playbook .......... Builds a bar file and deploys to a device or simulator
-
-COMMANDS
-  help .............. Show this help menu.
-                        ant, ant help
-
-  load-device ....... Builds and deploys project to a connected USB device.
-                        ant load-device
-
-  load-simulator .... Builds and deploys project to default simulator.
-                        ant load-simulator
-
-  build ............. Compiles and packages the project for deployment.
-                        ant build
-
-  clean ............. Remove all files from the build/ directory.
-                        ant clean
-
-  clean-device ...... Remove this project from the connected USB device.
-                        ant clean-device
-
-  clean-simulator ... Remove this project from the simulator (takes a while).
-                        ant clean-simulator
-
-GETTING STARTED
-  1. Edit project.properties
-
-  2. &lt;ant &lt;TARGET&gt; load-simulator&gt; to run the project on the simulator
-
-  3. Customize your project by editing www/config.xml
-
-  4. To run the project on a BlackBerry device, you will need to obtain
-     code signing keys from RIM. Once you have the key, a project is
-     installed by connecting a BlackBerry via USB and running
-     &lt;ant &lt;TARGET&gt; load-device&gt;.
-        </echo>
-    </target>
-</project>


[44/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/config.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/config.xml b/lib/cordova-blackberry/blackberry/bin/templates/project/www/config.xml
new file mode 100644
index 0000000..0dc6aaa
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/config.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+       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.
+-->
+<!--
+  Widget Configuration Reference:
+    http://docs.blackberry.com/en/developers/deliverables/15274/
+-->
+
+<widget xmlns="http://www.w3.org/ns/widgets"
+        xmlns:rim="http://www.blackberry.com/ns/widgets"
+	version="1.0.0.0">
+
+  <name>__NAME__</name>
+
+  <author>Your Name Here</author>
+
+  <description>
+       A sample Apache Cordova application that responds to the deviceready event.
+  </description>
+
+  <license href="http://opensource.org/licenses/alphabetical">
+  </license>
+
+  <!-- Cordova API -->
+  <feature id="blackberry.system" required="true" version="1.0.0.0" />
+  <feature id="org.apache.cordova" required="true" version="1.0.0" />
+  <feature id="blackberry.find" required="true" version="1.0.0.0" />
+  <feature id="blackberry.identity" required="true" version="1.0.0.0" />
+  <feature id="blackberry.identity.phone" required="true" version="1.0.0.0" />
+  <feature id="blackberry.pim.Address" required="true" version="1.0.0.0" />
+  <feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" />
+  <feature id="blackberry.io.file" required="true" version="1.0.0.0" />
+  <feature id="blackberry.utils" required="true" version="1.0.0.0" />
+  <feature id="blackberry.io.dir" required="true" version="1.0.0.0" />
+  <feature id="blackberry.app" required="true" version="1.0.0.0" />
+  <feature id="blackberry.app.event" required="true" version="1.0.0.0" />
+  <feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
+  <feature id="blackberry.widgetcache" required="true" version="1.0.0.0"/>
+  <feature id="blackberry.media.camera" />
+  <feature id="blackberry.ui.dialog" />
+  <feature id="blackberry.connection" />
+  <feature id="blackberry.bbm.platform" />
+  <feature id="blackberry.invoke.card" />
+  <feature id="blackberry.pim.contacts" />
+  <feature id="blackberry.ui.contextmenu" />
+  <feature id="blackberry.io.filetransfer" />
+  <feature id="blackberry.io" />
+  <feature id="blackberry.invoke" />
+  <feature id="blackberry.invoked" />
+  <feature id="blackberry.push" />
+  <feature id="blackberry.media.microphone" required="true" version="1.0.0.0"/>
+
+  <!-- Cordova API -->
+  <access subdomains="true" uri="file:///store/home" />
+  <access subdomains="true" uri="file:///SDCard" />
+
+  <!-- Expose access to all URIs, including the file and http protocols -->
+  <access subdomains="true" uri="*" />
+
+  <icon rim:hover="false" src="res/icon/blackberry/icon-80.png" />
+  <icon rim:hover="true" src="res/icon/blackberry/icon-80.png" />
+
+  <rim:loadingScreen backgroundColor="#CFCFCF"
+                     foregroundImage="res/screen/blackberry/screen-225.png"
+		     onFirstLaunch="true">
+    <rim:transitionEffect type="fadeOut" />
+  </rim:loadingScreen>
+
+  <content src="index.html" />
+
+  <rim:permissions>
+    <rim:permit>use_camera</rim:permit>
+    <rim:permit>read_device_identifying_information</rim:permit>
+    <rim:permit>access_shared</rim:permit>
+    <rim:permit>read_geolocation</rim:permit>
+    <rim:permit>record_audio</rim:permit>
+    <rim:permit>access_pimdomain_contacts</rim:permit>
+  </rim:permissions>
+
+</widget>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/css/index.css
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/css/index.css b/lib/cordova-blackberry/blackberry/bin/templates/project/www/css/index.css
new file mode 100644
index 0000000..51daa79
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/css/index.css
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+* {
+    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+}
+
+body {
+    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
+    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
+    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
+    background-color:#E4E4E4;
+    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        color-stop(0, #A7A7A7),
+        color-stop(0.51, #E4E4E4)
+    );
+    background-attachment:fixed;
+    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+    font-size:12px;
+    height:100%;
+    margin:0px;
+    padding:0px;
+    text-transform:uppercase;
+    width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+    position:absolute;             /* position in the center of the screen */
+    left:50%;
+    top:50%;
+    height:50px;                   /* text area height */
+    width:225px;                   /* text area width */
+    text-align:center;
+    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with text) */
+    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area height */
+                                   /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+    .app {
+        background-position:left center;
+        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image height */
+        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
+                                      /* offset horizontal: half of image width and text area width */
+    }
+}
+
+h1 {
+    font-size:24px;
+    font-weight:normal;
+    margin:0px;
+    overflow:visible;
+    padding:0px;
+    text-align:center;
+}
+
+.event {
+    border-radius:4px;
+    -webkit-border-radius:4px;
+    color:#FFFFFF;
+    font-size:12px;
+    margin:0px 30px;
+    padding:2px 0px;
+}
+
+.event.listening {
+    background-color:#333333;
+    display:block;
+}
+
+.event.received {
+    background-color:#4B946A;
+    display:none;
+}
+
+@keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+@-webkit-keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+.blink {
+    animation:fade 3000ms infinite;
+    -webkit-animation:fade 3000ms infinite;
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/img/logo.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/img/logo.png b/lib/cordova-blackberry/blackberry/bin/templates/project/www/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/img/logo.png differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/index.html b/lib/cordova-blackberry/blackberry/bin/templates/project/www/index.html
new file mode 100644
index 0000000..15abf33
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/index.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!--
+    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.
+-->
+<html>
+    <head>
+        <meta charset="utf-8" />
+        <meta name="format-detection" content="telephone=no" />
+        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
+        <link rel="stylesheet" type="text/css" href="css/index.css" />
+        <title>Hello World</title>
+    </head>
+    <body>
+        <div class="app">
+            <h1>Apache Cordova</h1>
+            <div id="deviceready" class="blink">
+                <p class="event listening">Connecting to Device</p>
+                <p class="event received">Device is Ready</p>
+            </div>
+        </div>
+        <script type="text/javascript" src="cordova-2.6.0rc1.js"></script>
+        <script type="text/javascript" src="js/index.js"></script>
+        <script type="text/javascript">
+            app.initialize();
+        </script>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/js/index.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/js/index.js b/lib/cordova-blackberry/blackberry/bin/templates/project/www/js/index.js
new file mode 100644
index 0000000..31d9064
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/js/index.js
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+var app = {
+    // Application Constructor
+    initialize: function() {
+        this.bindEvents();
+    },
+    // Bind Event Listeners
+    //
+    // Bind any events that are required on startup. Common events are:
+    // 'load', 'deviceready', 'offline', and 'online'.
+    bindEvents: function() {
+        document.addEventListener('deviceready', this.onDeviceReady, false);
+    },
+    // deviceready Event Handler
+    //
+    // The scope of 'this' is the event. In order to call the 'receivedEvent'
+    // function, we must explicity call 'app.receivedEvent(...);'
+    onDeviceReady: function() {
+        app.receivedEvent('deviceready');
+    },
+    // Update DOM on a Received Event
+    receivedEvent: function(id) {
+        var parentElement = document.getElementById(id);
+        var listeningElement = parentElement.querySelector('.listening');
+        var receivedElement = parentElement.querySelector('.received');
+
+        listeningElement.setAttribute('style', 'display:none;');
+        receivedElement.setAttribute('style', 'display:block;');
+
+        console.log('Received Event: ' + id);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/json2.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/json2.js b/lib/cordova-blackberry/blackberry/bin/templates/project/www/json2.js
new file mode 100644
index 0000000..c52b92a
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/json2.js
@@ -0,0 +1,482 @@
+/*
+    http://www.JSON.org/json2.js
+    2010-03-20
+
+    Public Domain.
+
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+    See http://www.JSON.org/js.html
+
+
+    This code should be minified before deployment.
+    See http://javascript.crockford.com/jsmin.html
+
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+    NOT CONTROL.
+
+
+    This file creates a global JSON object containing two methods: stringify
+    and parse.
+
+        JSON.stringify(value, replacer, space)
+            value       any JavaScript value, usually an object or array.
+
+            replacer    an optional parameter that determines how object
+                        values are stringified for objects. It can be a
+                        function or an array of strings.
+
+            space       an optional parameter that specifies the indentation
+                        of nested structures. If it is omitted, the text will
+                        be packed without extra whitespace. If it is a number,
+                        it will specify the number of spaces to indent at each
+                        level. If it is a string (such as '\t' or '&nbsp;'),
+                        it contains the characters used to indent at each level.
+
+            This method produces a JSON text from a JavaScript value.
+
+            When an object value is found, if the object contains a toJSON
+            method, its toJSON method will be called and the result will be
+            stringified. A toJSON method does not serialize: it returns the
+            value represented by the name/value pair that should be serialized,
+            or undefined if nothing should be serialized. The toJSON method
+            will be passed the key associated with the value, and this will be
+            bound to the value
+
+            For example, this would serialize Dates as ISO strings.
+
+                Date.prototype.toJSON = function (key) {
+                    function f(n) {
+                        // Format integers to have at least two digits.
+                        return n < 10 ? '0' + n : n;
+                    }
+
+                    return this.getUTCFullYear()   + '-' +
+                         f(this.getUTCMonth() + 1) + '-' +
+                         f(this.getUTCDate())      + 'T' +
+                         f(this.getUTCHours())     + ':' +
+                         f(this.getUTCMinutes())   + ':' +
+                         f(this.getUTCSeconds())   + 'Z';
+                };
+
+            You can provide an optional replacer method. It will be passed the
+            key and value of each member, with this bound to the containing
+            object. The value that is returned from your method will be
+            serialized. If your method returns undefined, then the member will
+            be excluded from the serialization.
+
+            If the replacer parameter is an array of strings, then it will be
+            used to select the members to be serialized. It filters the results
+            such that only members with keys listed in the replacer array are
+            stringified.
+
+            Values that do not have JSON representations, such as undefined or
+            functions, will not be serialized. Such values in objects will be
+            dropped; in arrays they will be replaced with null. You can use
+            a replacer function to replace those with JSON values.
+            JSON.stringify(undefined) returns undefined.
+
+            The optional space parameter produces a stringification of the
+            value that is filled with line breaks and indentation to make it
+            easier to read.
+
+            If the space parameter is a non-empty string, then that string will
+            be used for indentation. If the space parameter is a number, then
+            the indentation will be that many spaces.
+
+            Example:
+
+            text = JSON.stringify(['e', {pluribus: 'unum'}]);
+            // text is '["e",{"pluribus":"unum"}]'
+
+
+            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+            text = JSON.stringify([new Date()], function (key, value) {
+                return this[key] instanceof Date ?
+                    'Date(' + this[key] + ')' : value;
+            });
+            // text is '["Date(---current time---)"]'
+
+
+        JSON.parse(text, reviver)
+            This method parses a JSON text to produce an object or array.
+            It can throw a SyntaxError exception.
+
+            The optional reviver parameter is a function that can filter and
+            transform the results. It receives each of the keys and values,
+            and its return value is used instead of the original value.
+            If it returns what it received, then the structure is not modified.
+            If it returns undefined then the member is deleted.
+
+            Example:
+
+            // Parse the text. Values that look like ISO date strings will
+            // be converted to Date objects.
+
+            myData = JSON.parse(text, function (key, value) {
+                var a;
+                if (typeof value === 'string') {
+                    a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+                    if (a) {
+                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+                            +a[5], +a[6]));
+                    }
+                }
+                return value;
+            });
+
+            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+                var d;
+                if (typeof value === 'string' &&
+                        value.slice(0, 5) === 'Date(' &&
+                        value.slice(-1) === ')') {
+                    d = new Date(value.slice(5, -1));
+                    if (d) {
+                        return d;
+                    }
+                }
+                return value;
+            });
+
+
+    This is a reference implementation. You are free to copy, modify, or
+    redistribute.
+*/
+
+/*jslint evil: true, strict: false */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+    lastIndex, length, parse, prototype, push, replace, slice, stringify,
+    test, toJSON, toString, valueOf
+*/
+
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+if (!this.JSON) {
+    this.JSON = {};
+}
+
+(function () {
+
+    function f(n) {
+        // Format integers to have at least two digits.
+        return n < 10 ? '0' + n : n;
+    }
+
+    if (typeof Date.prototype.toJSON !== 'function') {
+
+        Date.prototype.toJSON = function (key) {
+
+            return isFinite(this.valueOf()) ?
+                   this.getUTCFullYear()   + '-' +
+                 f(this.getUTCMonth() + 1) + '-' +
+                 f(this.getUTCDate())      + 'T' +
+                 f(this.getUTCHours())     + ':' +
+                 f(this.getUTCMinutes())   + ':' +
+                 f(this.getUTCSeconds())   + 'Z' : null;
+        };
+
+        String.prototype.toJSON =
+        Number.prototype.toJSON =
+        Boolean.prototype.toJSON = function (key) {
+            return this.valueOf();
+        };
+    }
+
+    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+        gap,
+        indent,
+        meta = {    // table of character substitutions
+            '\b': '\\b',
+            '\t': '\\t',
+            '\n': '\\n',
+            '\f': '\\f',
+            '\r': '\\r',
+            '"' : '\\"',
+            '\\': '\\\\'
+        },
+        rep;
+
+
+    function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+        escapable.lastIndex = 0;
+        return escapable.test(string) ?
+            '"' + string.replace(escapable, function (a) {
+                var c = meta[a];
+                return typeof c === 'string' ? c :
+                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+            }) + '"' :
+            '"' + string + '"';
+    }
+
+
+    function str(key, holder) {
+
+// Produce a string from holder[key].
+
+        var i,          // The loop counter.
+            k,          // The member key.
+            v,          // The member value.
+            length,
+            mind = gap,
+            partial,
+            value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+        if (value && typeof value === 'object' &&
+                typeof value.toJSON === 'function') {
+            value = value.toJSON(key);
+        }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+        if (typeof rep === 'function') {
+            value = rep.call(holder, key, value);
+        }
+
+// What happens next depends on the value's type.
+
+        switch (typeof value) {
+        case 'string':
+            return quote(value);
+
+        case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+            return isFinite(value) ? String(value) : 'null';
+
+        case 'boolean':
+        case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+            return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+        case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+            if (!value) {
+                return 'null';
+            }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+            gap += indent;
+            partial = [];
+
+// Is the value an array?
+
+            if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+                length = value.length;
+                for (i = 0; i < length; i += 1) {
+                    partial[i] = str(i, value) || 'null';
+                }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+                v = partial.length === 0 ? '[]' :
+                    gap ? '[\n' + gap +
+                            partial.join(',\n' + gap) + '\n' +
+                                mind + ']' :
+                          '[' + partial.join(',') + ']';
+                gap = mind;
+                return v;
+            }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+            if (rep && typeof rep === 'object') {
+                length = rep.length;
+                for (i = 0; i < length; i += 1) {
+                    k = rep[i];
+                    if (typeof k === 'string') {
+                        v = str(k, value);
+                        if (v) {
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
+                        }
+                    }
+                }
+            } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+                for (k in value) {
+                    if (Object.hasOwnProperty.call(value, k)) {
+                        v = str(k, value);
+                        if (v) {
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
+                        }
+                    }
+                }
+            }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+            v = partial.length === 0 ? '{}' :
+                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
+                        mind + '}' : '{' + partial.join(',') + '}';
+            gap = mind;
+            return v;
+        }
+    }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+    if (typeof JSON.stringify !== 'function') {
+        JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+            var i;
+            gap = '';
+            indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+            if (typeof space === 'number') {
+                for (i = 0; i < space; i += 1) {
+                    indent += ' ';
+                }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+            } else if (typeof space === 'string') {
+                indent = space;
+            }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+            rep = replacer;
+            if (replacer && typeof replacer !== 'function' &&
+                    (typeof replacer !== 'object' ||
+                     typeof replacer.length !== 'number')) {
+                throw new Error('JSON.stringify');
+            }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+            return str('', {'': value});
+        };
+    }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+    if (typeof JSON.parse !== 'function') {
+        JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+            var j;
+
+            function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+                var k, v, value = holder[key];
+                if (value && typeof value === 'object') {
+                    for (k in value) {
+                        if (Object.hasOwnProperty.call(value, k)) {
+                            v = walk(value, k);
+                            if (v !== undefined) {
+                                value[k] = v;
+                            } else {
+                                delete value[k];
+                            }
+                        }
+                    }
+                }
+                return reviver.call(holder, key, value);
+            }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+            text = String(text);
+            cx.lastIndex = 0;
+            if (cx.test(text)) {
+                text = text.replace(cx, function (a) {
+                    return '\\u' +
+                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+                });
+            }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+            if (/^[\],:{}\s]*$/.
+test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
+replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
+replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+                j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+                return typeof reviver === 'function' ?
+                    walk({'': j}, '') : j;
+            }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+            throw new SyntaxError('JSON.parse');
+        };
+    }
+}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/plugins.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/plugins.xml b/lib/cordova-blackberry/blackberry/bin/templates/project/www/plugins.xml
new file mode 100644
index 0000000..3d41236
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/plugins.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+       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.
+-->
+<plugins>
+  <plugin name="App"            value="org.apache.cordova.app.App"/>
+  <plugin name="Device"         value="org.apache.cordova.device.Device"/>
+  <plugin name="Camera"         value="org.apache.cordova.camera.Camera"/>
+  <plugin name="NetworkStatus"  value="org.apache.cordova.network.Network"/>
+  <plugin name="Notification"   value="org.apache.cordova.notification.Notification"/>
+  <plugin name="Accelerometer"  value="org.apache.cordova.accelerometer.Accelerometer"/>
+  <plugin name="Geolocation"    value="org.apache.cordova.geolocation.Geolocation"/>
+  <plugin name="File"           value="org.apache.cordova.file.FileManager"/>
+  <plugin name="FileTransfer"   value="org.apache.cordova.http.FileTransfer"/>
+  <plugin name="Contacts"       value="org.apache.cordova.pim.Contact"/>
+  <plugin name="Capture"        value="org.apache.cordova.capture.MediaCapture"/>
+  <plugin name="Battery"        value="org.apache.cordova.battery.Battery"/>
+  <plugin name="Media"          value="org.apache.cordova.media.Media"/>
+  <plugin name="Globalization"  value="org.apache.cordova.globalization.Globalization"/>
+</plugins>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/icon/blackberry/icon-80.png differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz
new file mode 100644
index 0000000..3c1fecd
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz
new file mode 100644
index 0000000..677a6ad
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_AE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz
new file mode 100644
index 0000000..602c22c
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_BH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz
new file mode 100644
index 0000000..485b9a2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_DZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz
new file mode 100644
index 0000000..dfc2045
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_EG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz
new file mode 100644
index 0000000..9e7c5ae
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_IQ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz
new file mode 100644
index 0000000..72d26ca
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_JO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz
new file mode 100644
index 0000000..1dde592
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_KW.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz
new file mode 100644
index 0000000..640e8be
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LB.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz
new file mode 100644
index 0000000..b7beb36
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_LY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz
new file mode 100644
index 0000000..3eb49f9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_MA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz
new file mode 100644
index 0000000..b68cf81
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_OM.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz
new file mode 100644
index 0000000..d2583d4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_QA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz
new file mode 100644
index 0000000..aa15f88
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz
new file mode 100644
index 0000000..116f0e2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SD.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz
new file mode 100644
index 0000000..65aaeb0
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_SY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz
new file mode 100644
index 0000000..853cc9e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_TN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz
new file mode 100644
index 0000000..841ee63
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ar_YE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz
new file mode 100644
index 0000000..a0a64b8
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz
new file mode 100644
index 0000000..fec5f32
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/be_BY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz
new file mode 100644
index 0000000..4f816d8
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz
new file mode 100644
index 0000000..9cc5ec3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bg_BG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz
new file mode 100644
index 0000000..3f40ba4
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/bn_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz
new file mode 100644
index 0000000..32e04c5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz
new file mode 100644
index 0000000..93d8ec3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz
new file mode 100644
index 0000000..69be9b1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/ca_ES_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz
new file mode 100644
index 0000000..28dd3ee
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz
new file mode 100644
index 0000000..95d0e32
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz
new file mode 100644
index 0000000..9d821d6
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz
new file mode 100644
index 0000000..681c4b3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/cs_CZ_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz
new file mode 100644
index 0000000..ba270ad
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz
new file mode 100644
index 0000000..0b9dbe2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz
new file mode 100644
index 0000000..8d52b6a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/da_DK_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz
new file mode 100644
index 0000000..a65adda
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz
new file mode 100644
index 0000000..fb693c2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz
new file mode 100644
index 0000000..e61b9d9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_AT_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz
new file mode 100644
index 0000000..1b906e7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_CH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz
new file mode 100644
index 0000000..dc73b68
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz
new file mode 100644
index 0000000..76e1b0d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_DE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz
new file mode 100644
index 0000000..f1f85b9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz
new file mode 100644
index 0000000..c00d5de
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/de_LU_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz
new file mode 100644
index 0000000..0cdbf53
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz
new file mode 100644
index 0000000..5405116
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz
new file mode 100644
index 0000000..79c2841
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz
new file mode 100644
index 0000000..35a134a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_CY_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz
new file mode 100644
index 0000000..6c30687
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz
new file mode 100644
index 0000000..e6f2529
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/el_GR_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz
new file mode 100644
index 0000000..146dee3
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz
new file mode 100644
index 0000000..8cb1758
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_AU.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz
new file mode 100644
index 0000000..e327a14
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz
new file mode 100644
index 0000000..eaa6076
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_BE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz
new file mode 100644
index 0000000..65ce247
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_CA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz
new file mode 100644
index 0000000..9e647a7
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz
new file mode 100644
index 0000000..0e6d09b
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_GB_EURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz
new file mode 100644
index 0000000..cda0352
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_HK.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz
new file mode 100644
index 0000000..91efb10
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz
new file mode 100644
index 0000000..8933e3d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IE_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz
new file mode 100644
index 0000000..db66e86
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_IN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz
new file mode 100644
index 0000000..ea0a479
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_MT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz
new file mode 100644
index 0000000..720baad
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_NZ.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz
new file mode 100644
index 0000000..7e860ff
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_PH.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz
new file mode 100644
index 0000000..5ffc7ba
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_SG.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz
new file mode 100644
index 0000000..5e7ed2f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_US.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz
new file mode 100644
index 0000000..c1221b5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/en_ZA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz
new file mode 100644
index 0000000..f233e90
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz
new file mode 100644
index 0000000..0ca8ffa
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_AR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz
new file mode 100644
index 0000000..1b3c306
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_BO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz
new file mode 100644
index 0000000..92a324a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CL.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz
new file mode 100644
index 0000000..362232d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz
new file mode 100644
index 0000000..53e9e23
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_CR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz
new file mode 100644
index 0000000..26c6fff
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_DO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz
new file mode 100644
index 0000000..559db9e
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_EC.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz
new file mode 100644
index 0000000..819e45d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz
new file mode 100644
index 0000000..589d775
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_ES_PREEURO.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz
new file mode 100644
index 0000000..e1aba86
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_GT.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz
new file mode 100644
index 0000000..43ce67a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_HN.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz
new file mode 100644
index 0000000..76a40da
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_MX.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz
new file mode 100644
index 0000000..86302a5
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_NI.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz
new file mode 100644
index 0000000..5f3a6d2
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PA.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz
new file mode 100644
index 0000000..44a20ec
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz
new file mode 100644
index 0000000..3d60ce9
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PR.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz
new file mode 100644
index 0000000..c928b88
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_PY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz
new file mode 100644
index 0000000..0d3800a
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_SV.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz
new file mode 100644
index 0000000..2243584
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_US.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz
new file mode 100644
index 0000000..db5ce23
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_UY.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz
new file mode 100644
index 0000000..b57e2e1
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/es_VE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz
new file mode 100644
index 0000000..e685c40
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz
new file mode 100644
index 0000000..8ceff8f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE.js.gz differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz
new file mode 100644
index 0000000..9b4617d
Binary files /dev/null and b/lib/cordova-blackberry/blackberry/bin/templates/project/www/res/resourceBundles/et_EE_EURO.js.gz differ


[21/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/create.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/create.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/create.js
new file mode 100644
index 0000000..d193580
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/create.js
@@ -0,0 +1,158 @@
+/**
+    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.
+*/
+
+var childProcess = require('child_process'),
+    tempFolder = '.tmp/',
+    appFolder = tempFolder + 'tempCordovaApp/',
+    projectFile = 'project.json',
+    wrench = require('wrench'),
+    fs = require('fs'),
+    flag = false,
+    _stdout = "",
+    _stderr = "";
+
+function executeScript(shellCommand) {
+    childProcess.exec(shellCommand, function (error, stdout, stderr) {
+        if (error) {
+            console.log("Error executing command: " + error);
+        }
+        _stdout = stdout.toString().trim();
+        _stderr = stderr.toString().trim();
+        flag = true;
+    });
+}
+
+describe("create tests", function () {
+    it("creates project", function () {
+        var project,
+            appIdRegExp = /id="default\.app\.id"/g;
+        executeScript("bin/create " + appFolder);
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            project = JSON.parse(fs.readFileSync(appFolder + projectFile, "utf-8"));
+            expect(appIdRegExp.test(fs.readFileSync(appFolder + "www/config.xml", "utf-8"))).toEqual(true);
+            expect(fs.existsSync(appFolder)).toEqual(true);
+            expect(fs.existsSync(appFolder + "/plugins")).toEqual(true);
+            expect(fs.existsSync(appFolder + "/cordova")).toEqual(true);
+            expect(fs.existsSync(appFolder + "/cordova/node_modules")).toEqual(true);
+            expect(fs.existsSync(appFolder + "/cordova/lib")).toEqual(true);
+            expect(fs.existsSync(appFolder + "/cordova/third_party")).toEqual(true);
+            expect(fs.existsSync(appFolder + "/www")).toEqual(true);
+            expect(project.barName).toEqual("cordova-BB10-app");
+            expect(project.keystorepass).toEqual("password");
+            expect(project.defaultTarget).toEqual("");
+            expect(project.targets).toEqual({});
+            expect(fs.existsSync("./build")).toEqual(false);
+            expect(_stdout).toEqual("");
+            expect(_stderr).toEqual("");
+        });
+        this.after(function () {
+            wrench.rmdirSyncRecursive(tempFolder);
+        });
+    });
+
+    it("sets appId", function () {
+        var configEt,
+            appIdRegExp = /id="com\.example\.bb10app"/g;
+        executeScript("bin/create " + appFolder + " com.example.bb10app");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(appIdRegExp.test(fs.readFileSync(appFolder + "www/config.xml", "utf-8"))).toEqual(true);
+            expect(_stdout).toEqual("");
+            expect(_stderr).toEqual("");
+        });
+        this.after(function () {
+            wrench.rmdirSyncRecursive(tempFolder);
+        });
+    });
+
+    it("sets appId and barName", function () {
+        var project,
+            appIdRegExp = /id="com\.example\.bb10app"/g;
+        executeScript("bin/create " + appFolder + " com.example.bb10app bb10appV1");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            project = JSON.parse(fs.readFileSync(appFolder + projectFile, "utf-8"));
+            expect(appIdRegExp.test(fs.readFileSync(appFolder + "www/config.xml", "utf-8"))).toEqual(true);
+            expect(project.barName).toEqual("bb10appV1");
+            expect(_stdout).toEqual("");
+            expect(_stderr).toEqual("");
+        });
+        this.after(function () {
+            wrench.rmdirSyncRecursive(tempFolder);
+        });
+    });
+
+    it("No args", function () {
+        executeScript("bin/create");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("You must give a project PATH");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("Empty dir error", function () {
+        executeScript("bin/create ./");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("The project path must be an empty directory");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("Invalid appId error", function () {
+        executeScript("bin/create " + appFolder + " 23.21#$");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("App ID must be sequence of alpha-numeric (optionally seperated by '.') characters, no longer than 50 characters");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("Invalid barName error", function () {
+        executeScript("bin/create " + appFolder + " com.example.app %bad@bar^name");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("BAR filename can only contain alpha-numeric, '.', '-' and '_' characters");
+            expect(_stderr).toEqual("");
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/target.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/target.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/target.js
new file mode 100644
index 0000000..e948a87
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/integration/target.js
@@ -0,0 +1,237 @@
+/**
+    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.
+*/
+
+var childProcess = require('child_process'),
+    tempFolder = '.tmp/',
+    appFolder = tempFolder + 'tempCordovaApp/',
+    projectFile = 'project.json',
+    wrench = require('wrench'),
+    fs = require('fs'),
+    flag = false,
+    _stdout = "",
+    _stderr = "";
+
+function executeScript(shellCommand) {
+    childProcess.exec(shellCommand, function (error, stdout, stderr) {
+        if (error) {
+            console.log("Error executing command: " + error);
+        }
+        _stdout = stdout.toString().trim();
+        _stderr = stderr.toString().trim();
+        flag = true;
+    });
+}
+
+describe("cordova/target tests", function () {
+    beforeEach(function () {
+        executeScript("bin/create " + appFolder);
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+        });
+    });
+
+    afterEach(function () {
+        wrench.rmdirSyncRecursive(tempFolder);
+    });
+
+    it("should add a target", function () {
+        var project,
+            target;
+        executeScript(appFolder + "cordova/target add z10 169.254.0.1 device -p pass --pin DEADBEEF");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            project = JSON.parse(fs.readFileSync(appFolder + projectFile, 'utf-8'));
+            expect(project.defaultTarget).toEqual("z10");
+            expect(Object.keys(project.targets).length).toEqual(1);
+            target = project.targets.z10;
+            expect(target.ip).toEqual("169.254.0.1");
+            expect(target.type).toEqual("device");
+            expect(target.password).toEqual("pass");
+            expect(target.pin).toEqual("DEADBEEF");
+            expect(_stdout).toEqual("");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("should remove a target", function () {
+        var project;
+        executeScript(appFolder + "cordova/target add z10 169.254.0.1 device -p pass --pin DEADBEEF");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            executeScript(appFolder + "cordova/target remove z10");
+            waitsFor(function () {
+                return flag;
+            });
+            runs(function () {
+                flag = false;
+                project = JSON.parse(fs.readFileSync(appFolder + projectFile, 'utf-8'));
+                expect(project.defaultTarget).toEqual("");
+                expect(Object.keys(project.targets).length).toEqual(0);
+                expect(_stdout).toEqual("Deleting default target, please set a new default target");
+                expect(_stderr).toEqual("");
+            });
+        });
+    });
+
+    it("should set default target", function () {
+        var project;
+        executeScript(appFolder + "cordova/target add z10 169.254.0.1 device -p pass --pin DEADBEEF");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            executeScript(appFolder + "cordova/target add q10 169.254.0.2 device -p p455w02D --pin FACEFACE");
+            waitsFor(function () {
+                return flag;
+            });
+            runs(function () {
+                flag = false;
+                executeScript(appFolder + "cordova/target default q10");
+                waitsFor(function () {
+                    return flag;
+                });
+                runs(function () {
+                    flag = false;
+                    project = JSON.parse(fs.readFileSync(appFolder + projectFile, 'utf-8'));
+                    expect(project.defaultTarget).toEqual("q10");
+                });
+            });
+        });
+    });
+
+    it("should list targets", function () {
+        executeScript(appFolder + "cordova/target add z10 169.254.0.1 device -p pass --pin DEADBEEF");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            executeScript(appFolder + "cordova/target add q10 169.254.0.2 device -p p455w02D --pin FACEFACE");
+            waitsFor(function () {
+                return flag;
+            });
+            runs(function () {
+                flag = false;
+                executeScript(appFolder + "cordova/target");
+                waitsFor(function () {
+                    return flag;
+                });
+                runs(function () {
+                    flag = false;
+                    expect(_stdout).toEqual("* z10\n  q10");
+                    expect(_stderr).toEqual("");
+                });
+            });
+        });
+    });
+
+    it("should require name for add/remove", function () {
+        executeScript(appFolder + "cordova/target add");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("Target details not specified");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("should require ip for add", function () {
+        executeScript(appFolder + "cordova/target add z10");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("IP is required");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("should require type for add ", function () {
+        executeScript(appFolder + "cordova/target add z10 169.254.0.1");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("target type is required");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("should warn unregonized command", function () {
+        executeScript(appFolder + "cordova/target bleh");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("Unrecognized command");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("should warn invalid ip", function () {
+        executeScript(appFolder + "cordova/target add z10 256.254.0.1");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("Invalid IP: 256.254.0.1");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("should warn invalid type", function () {
+        executeScript(appFolder + "cordova/target add z10 169.254.0.1 bleh");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("Invalid target type: bleh");
+            expect(_stderr).toEqual("");
+        });
+    });
+
+    it("should warn invalid pin", function () {
+        executeScript(appFolder + "cordova/target add z10 169.254.0.1 device --pin NOTAPIN!");
+        waitsFor(function () {
+            return flag;
+        });
+        runs(function () {
+            flag = false;
+            expect(_stdout).toEqual("Invalid PIN: NOTAPIN!");
+            expect(_stderr).toEqual("");
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-bare-minimum.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-bare-minimum.xml b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-bare-minimum.xml
new file mode 100644
index 0000000..90572f4
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-bare-minimum.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widget xmlns=" http://www.w3.org/ns/widgets"
+        xmlns:rim="http://www.blackberry.com/ns/widgets"
+        version="1.0.0"
+        id="myID">
+    <name>Demo</name>
+    <content src="local:///startPage.html"/>
+    <author>Research In Motion Ltd.</author>
+    <license href="http://www.apache.org/licenses/LICENSE-2.0">
+        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.
+    </license>
+</widget>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-license.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-license.xml b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-license.xml
new file mode 100644
index 0000000..ac4ffe9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config-license.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widget xmlns=" http://www.w3.org/ns/widgets"
+        xmlns:rim="http://www.blackberry.com/ns/widgets"
+        version="1.0.0"
+        id="myID">
+    <name>Demo</name>
+    <content src="local:///startPage.html"/>
+    <author>Research In Motion Ltd.</author>
+    <license href="http://www.apache.org/licenses/LICENSE-2.0"></license>
+</widget>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config.xml b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config.xml
new file mode 100644
index 0000000..8650a90
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/config.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widget xmlns=" http://www.w3.org/ns/widgets"
+        xmlns:rim="http://www.blackberry.com/ns/widgets"
+        version="1.0.0"
+        id="My WidgetId"
+        rim:header="RIM-Widget:rim/widget"
+        rim:userAgent="A Test-User-Agent/(Blackberry-Agent)">
+    <name>Demo</name>
+    <content src="local:///startPage.html"/>
+    <author rim:copyright="No Copyright"
+            href="http://www.rim.com/"
+            email = "author@rim.com">Research In Motion Ltd.</author>
+    <description>This app does everything.</description>
+    <license href="http://www.apache.org/licenses/LICENSE-2.0">My License</license>
+    <icon src="test.png" />
+    <rim:permissions>
+        <rim:permit>access_shared</rim:permit>
+        <rim:permit>read_geolocation</rim:permit>
+        <rim:permit>use_camera</rim:permit>
+    </rim:permissions>
+    <feature id="blackberry.app.orientation">
+        <param name="mode" value="portrait" />
+        <param name="other" value="portrait" />
+      </feature>
+    <feature id="blackberry.app" required="true" version="1.0.0.0">
+        <param name="childBrowser" value="disable" />
+        <param name="websecurity" value="disable" />
+        <param name="popupBlocker" value="enable" />
+    </feature>
+    <feature id="blackberry.system" required="true" version="1.0.0.3"/>
+    <access uri="http://www.somedomain1.com" subdomains="true">
+        <feature id="blackberry.app" required="true" version="1.0.0.0"/>
+        <feature id="blackberry.app.event" required="false" version="2.0.0.0"/>
+    </access>
+    <rim:invoke-target id="com.domain.subdomain.appname.app1">
+	<type>APPLICATION</type>
+        <require-source-permissions>invoke_accross_perimeters,access_shared</require-source-permissions>
+        <filter>
+            <action>bb.action.OPEN</action>
+            <action>bb.action.SET</action>
+            <action>bb.action.VIEW</action>
+            <mime-type>image/*</mime-type>
+            <mime-type>text/*</mime-type>
+            <property var="uris" value="ftp://" />
+            <property var="uris" value="http://" />
+            <property var="uris" value="https://" />
+            <property var="exts" value="jpg" />
+            <property var="exts" value="png" />
+            <property var="exts" value="txt" />
+            <property var="exts" value="doc" />
+        </filter>
+    </rim:invoke-target>
+</widget>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ascii_text.txt
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ascii_text.txt b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ascii_text.txt
new file mode 100644
index 0000000..5e1c309
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ascii_text.txt
@@ -0,0 +1 @@
+Hello World
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2be_text.txt
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2be_text.txt b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2be_text.txt
new file mode 100644
index 0000000..f999e5f
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2be_text.txt differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2le_text.txt
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2le_text.txt b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2le_text.txt
new file mode 100644
index 0000000..088fa80
Binary files /dev/null and b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/ucs2le_text.txt differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/utf8_text.txt
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/utf8_text.txt b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/utf8_text.txt
new file mode 100644
index 0000000..05eac02
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/data/utf8_text.txt
@@ -0,0 +1 @@
+Hello World
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params-bad.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params-bad.json b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params-bad.json
new file mode 100644
index 0000000..16c75eb
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params-bad.json
@@ -0,0 +1,10 @@
+{
+EVIL!
+	"blackberry-signer": {
+		"-proxyhost": "abc.com",
+		"-proxyport": "80"
+	},
+	"blackberry-nativepackager": {
+
+	}
+}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params.json b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params.json
new file mode 100644
index 0000000..6a3506f
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/params.json
@@ -0,0 +1,9 @@
+{
+	"blackberry-signer": {
+		"-proxyhost": "abc.com",
+		"-proxyport": "80"
+	},
+	"blackberry-nativepackager": {
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bar-builder.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bar-builder.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bar-builder.js
new file mode 100644
index 0000000..7c99d2c
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bar-builder.js
@@ -0,0 +1,40 @@
+var srcPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    path = require("path"),
+    wrench = require("wrench"),
+    barBuilder = require(srcPath + "bar-builder"),
+    fileMgr = require(srcPath + "file-manager"),
+    nativePkgr = require(srcPath + "native-packager"),
+    logger = require(srcPath + "logger"),
+    testData = require("./test-data"),
+    extManager = null;
+
+describe("BAR builder", function () {
+    it("build() create BAR for specified session", function () {
+        var callback = jasmine.createSpy(),
+            session = testData.session,
+            config = testData.config,
+            target = session.targets[0];
+
+        spyOn(wrench, "mkdirSyncRecursive");
+        spyOn(fileMgr, "copyWWE");
+        spyOn(fileMgr, "copyWebplatform");
+        spyOn(fileMgr, "copyWebworks");
+        spyOn(fileMgr, "copyJnextDependencies");
+        spyOn(fileMgr, "copyExtensions");
+        spyOn(fileMgr, "generateFrameworkModulesJS");
+        spyOn(nativePkgr, "exec").andCallFake(function (session, target, config, callback) {
+            callback(0);
+        });
+
+        barBuilder.build(session, testData.config, callback);
+
+        expect(wrench.mkdirSyncRecursive).toHaveBeenCalledWith(session.outputDir + "/" + target);
+        expect(fileMgr.copyWWE).toHaveBeenCalledWith(session, target);
+        expect(fileMgr.copyWebplatform).toHaveBeenCalledWith(session, target);
+        expect(fileMgr.copyJnextDependencies).toHaveBeenCalledWith(session);
+        expect(fileMgr.copyExtensions).toHaveBeenCalledWith(session, target);
+        expect(fileMgr.generateFrameworkModulesJS).toHaveBeenCalledWith(session);
+        expect(nativePkgr.exec).toHaveBeenCalledWith(session, target, config, jasmine.any(Function));
+        expect(callback).toHaveBeenCalledWith(0);
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bbwpignore.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bbwpignore.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bbwpignore.js
new file mode 100644
index 0000000..7c68ee9
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/bbwpignore.js
@@ -0,0 +1,135 @@
+/*
+ *  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.
+ */
+
+var srcPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    BBWPignore = require(srcPath + "bbwpignore"),
+    fs = require('fs');
+
+describe("bbwpignore can match", function () {
+    it("a basic file set", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("abc.js\n" +
+                                           "x/y/def.js");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["d/e/abc.js", "abc.js", "ted.js", ".DS_Store",
+                                        "x/y/def.js", "x/def.js", "a/b/x/y/def.js"]);
+        expect(bbwpignore.matchedFiles.length).toBe(4);
+        expect(bbwpignore.matchedFiles.indexOf("d/e/abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("x/y/def.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("a/b/x/y/def.js")).not.toBe(-1);
+    });
+
+    it("a basic file set with directories", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("abc.js\n" +
+                                           "x/y/");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["d/e/abc.js", "abc.js", "ted.js", ".DS_Store",
+                                        "x/y/def.js", "x/def.js", "a/b/x/y/def.js"]);
+
+        expect(bbwpignore.matchedFiles.length).toBe(4);
+        expect(bbwpignore.matchedFiles.indexOf("d/e/abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("x/y/def.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("a/b/x/y/def.js")).not.toBe(-1);
+    });
+
+    it("a basic file set with directories that being with slash", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("abc.js\n" +
+                                           "/x/y/");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["d/e/abc.js", "abc.js", "ted.js", ".DS_Store",
+                                        "x/y/def.js", "x/def.js", "a/b/x/y/def.js"]);
+        expect(bbwpignore.matchedFiles.length).toBe(4);
+        expect(bbwpignore.matchedFiles.indexOf("d/e/abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("/x/y")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("x/y/def.js")).not.toBe(-1);
+
+    });
+
+    it("a basic file set that begin with a slash on the directory", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("abc.js\n" +
+                                           "/x/y/def.js");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["d/e/abc.js", "abc.js", "ted.js", ".DS_Store",
+                                        "x/y/def.js", "x/def.js", "a/b/x/y/def.js"]);
+
+        expect(bbwpignore.matchedFiles.length).toBe(3);
+        expect(bbwpignore.matchedFiles.indexOf("d/e/abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("x/y/def.js")).not.toBe(-1);
+
+    });
+
+    it("a basic file set that begin with a slash", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("abc.js\n" +
+                                           "/def.js");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["d/e/abc.js", "abc.js", "ted.js", ".DS_Store",
+                                        "x/y/def.js", "x/def.js", "a/b/x/y/def.js"]);
+
+        expect(bbwpignore.matchedFiles.length).toBe(2);
+        expect(bbwpignore.matchedFiles.indexOf("d/e/abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("abc.js")).not.toBe(-1);
+
+    });
+
+    it("a basic file set that begin with a slash and has a wildcard", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("abcd.js\n" +
+                                           "/*.js");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["d/e/abc.js", "abc.js", "ted.js", ".DS_Store",
+                                        "x/y/def.js", "x/def.js", "a/b/x/y/def.js"]);
+
+        expect(bbwpignore.matchedFiles.length).toBe(2);
+        expect(bbwpignore.matchedFiles.indexOf("abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("ted.js")).not.toBe(-1);
+
+    });
+
+    it("a basic file set that begin with a slash and has a wildcard", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("abcd.js\n" +
+                                           "a*.js");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["d/e/abc.js", "abc.js", "ted.js", ".DS_Store",
+                                        "x/y/def.js", "x/def.js", "a/b/x/y/def.js"]);
+
+        expect(bbwpignore.matchedFiles.length).toBe(2);
+        expect(bbwpignore.matchedFiles.indexOf("d/e/abc.js")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("abc.js")).not.toBe(-1);
+
+    });
+
+    it("a basic directory set that begin with a slash", function () {
+        var bbwpignore;
+        spyOn(fs, "readFileSync").andReturn("/simulator/\n" +
+                                           "banana.js");
+        bbwpignore = new BBWPignore("FileNameIgnoreForTests",
+                                    ["simulator/a.js"]);
+
+        expect(bbwpignore.matchedFiles.length).toBe(2);
+        expect(bbwpignore.matchedFiles.indexOf("/simulator")).not.toBe(-1);
+        expect(bbwpignore.matchedFiles.indexOf("simulator/a.js")).not.toBe(-1);
+
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/cmdline.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/cmdline.js b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/cmdline.js
new file mode 100644
index 0000000..03eda58
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry10/bin/test/cordova/unit/spec/lib/cmdline.js
@@ -0,0 +1,77 @@
+var srcPath = __dirname + "/../../../../../templates/project/cordova/lib/",
+    localize = require(srcPath + "localize"),
+    cmdline = require(srcPath + "cmdline"),
+    cmd;
+
+describe("Command line", function () {
+    beforeEach(function () {
+        cmd = cmdline
+                .parse(process.argv)
+                .commander;
+    });
+
+    it("accepts -o with argument", function () {
+        cmd.parseOptions(["-o", "outdir"]);
+        expect(cmd.output).toEqual("outdir");
+    });
+
+    it("arg following -o is required", function () {
+        spyOn(process, "exit");
+        spyOn(console, "error");
+        cmd.parseOptions(["-o"]);
+        expect(console.error).toHaveBeenCalled();
+        expect(process.exit).toHaveBeenCalled();
+    });
+
+    it("accepts -s without argument", function () {
+        cmd.parseOptions(["-s"]);
+        expect(cmd.source).toBeTruthy();
+    });
+
+    it("accepts -s with argument", function () {
+        cmd.parseOptions(["-s", "mySourceDir"]);
+        expect(cmd.source).toEqual("mySourceDir");
+    });
+
+    it("accepts -d", function () {
+        cmd.parseOptions(["-d"]);
+        expect(cmd.debug).toBeTruthy();
+    });
+
+    it("accepts --loglevel with argument", function () {
+        cmd.parseOptions(["--loglevel", "warn"]);
+        expect(cmd.loglevel).toBe("warn");
+    });
+
+    it("accepts -ll", function () {
+        cmd.parseOptions(["-ll", "error"]);
+        expect(cmd.loglevel).toBe("error");
+    });
+
+    it("accepts -g with argument", function () {
+        cmd.parseOptions(["-g", "myPassword"]);
+        expect(cmd.password).toEqual("myPassword");
+    });
+
+    it("accepts --buildId with argument", function () {
+        cmd.parseOptions(["--buildId", "100"]);
+        expect(cmd.buildId).toEqual("100");
+    });
+
+    it("accepts -buildId with argument", function () {
+        cmd.parseOptions(["-buildId", "100"]);
+        expect(cmd.buildId).toEqual("100");
+    });
+
+    it("accepts --appdesc with argument", function () {
+        cmd.parseOptions(["--appdesc", "bardescriptor"]);
+        expect(cmd.appdesc).toEqual("bardescriptor");
+    });
+
+    it("throws an error for invalid multi-word arguments", function () {
+        expect(function () {
+            require(srcPath + "cmdline").parse(["--src"]);
+        }).toThrow(localize.translate("EXCEPTION_CMDLINE_ARG_INVALID", "--src"));
+    });
+
+});


[42/51] [partial] [BlackBerry10] Added support for new platform

Posted by lo...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
new file mode 100644
index 0000000..a0b0639
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine-html.js
@@ -0,0 +1,616 @@
+jasmine.HtmlReporterHelpers = {};
+
+jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
+  var el = document.createElement(type);
+
+  for (var i = 2; i < arguments.length; i++) {
+    var child = arguments[i];
+
+    if (typeof child === 'string') {
+      el.appendChild(document.createTextNode(child));
+    } else {
+      if (child) {
+        el.appendChild(child);
+      }
+    }
+  }
+
+  for (var attr in attrs) {
+    if (attr == "className") {
+      el[attr] = attrs[attr];
+    } else {
+      el.setAttribute(attr, attrs[attr]);
+    }
+  }
+
+  return el;
+};
+
+jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
+  var results = child.results();
+  var status = results.passed() ? 'passed' : 'failed';
+  if (results.skipped) {
+    status = 'skipped';
+  }
+
+  return status;
+};
+
+jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
+  var parentDiv = this.dom.summary;
+  var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
+  var parent = child[parentSuite];
+
+  if (parent) {
+    if (typeof this.views.suites[parent.id] == 'undefined') {
+      this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
+    }
+    parentDiv = this.views.suites[parent.id].element;
+  }
+
+  parentDiv.appendChild(childElement);
+};
+
+
+jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
+  for(var fn in jasmine.HtmlReporterHelpers) {
+    ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
+  }
+};
+
+jasmine.HtmlReporter = function(_doc) {
+  var self = this;
+  var doc = _doc || window.document;
+
+  var reporterView;
+
+  var dom = {};
+
+  // Jasmine Reporter Public Interface
+  self.logRunningSpecs = false;
+
+  self.reportRunnerStarting = function(runner) {
+    var specs = runner.specs() || [];
+
+    if (specs.length == 0) {
+      return;
+    }
+
+    createReporterDom(runner.env.versionString());
+    doc.body.appendChild(dom.reporter);
+
+    reporterView = new jasmine.HtmlReporter.ReporterView(dom);
+    reporterView.addSpecs(specs, self.specFilter);
+  };
+
+  self.reportRunnerResults = function(runner) {
+    reporterView && reporterView.complete();
+  };
+
+  self.reportSuiteResults = function(suite) {
+    reporterView.suiteComplete(suite);
+  };
+
+  self.reportSpecStarting = function(spec) {
+    if (self.logRunningSpecs) {
+      self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
+    }
+  };
+
+  self.reportSpecResults = function(spec) {
+    reporterView.specComplete(spec);
+  };
+
+  self.log = function() {
+    var console = jasmine.getGlobal().console;
+    if (console && console.log) {
+      if (console.log.apply) {
+        console.log.apply(console, arguments);
+      } else {
+        console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
+      }
+    }
+  };
+
+  self.specFilter = function(spec) {
+    if (!focusedSpecName()) {
+      return true;
+    }
+
+    return spec.getFullName().indexOf(focusedSpecName()) === 0;
+  };
+
+  return self;
+
+  function focusedSpecName() {
+    var specName;
+
+    (function memoizeFocusedSpec() {
+      if (specName) {
+        return;
+      }
+
+      var paramMap = [];
+      var params = doc.location.search.substring(1).split('&');
+
+      for (var i = 0; i < params.length; i++) {
+        var p = params[i].split('=');
+        paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
+      }
+
+      specName = paramMap.spec;
+    })();
+
+    return specName;
+  }
+
+  function createReporterDom(version) {
+    dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
+      dom.banner = self.createDom('div', { className: 'banner' },
+        self.createDom('span', { className: 'title' }, "Jasmine "),
+        self.createDom('span', { className: 'version' }, version)),
+
+      dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
+      dom.alert = self.createDom('div', {className: 'alert'}),
+      dom.results = self.createDom('div', {className: 'results'},
+        dom.summary = self.createDom('div', { className: 'summary' }),
+        dom.details = self.createDom('div', { id: 'details' }))
+    );
+  }
+};
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
+  this.startedAt = new Date();
+  this.runningSpecCount = 0;
+  this.completeSpecCount = 0;
+  this.passedCount = 0;
+  this.failedCount = 0;
+  this.skippedCount = 0;
+
+  this.createResultsMenu = function() {
+    this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
+      this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
+      ' | ',
+      this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
+
+    this.summaryMenuItem.onclick = function() {
+      dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
+    };
+
+    this.detailsMenuItem.onclick = function() {
+      showDetails();
+    };
+  };
+
+  this.addSpecs = function(specs, specFilter) {
+    this.totalSpecCount = specs.length;
+
+    this.views = {
+      specs: {},
+      suites: {}
+    };
+
+    for (var i = 0; i < specs.length; i++) {
+      var spec = specs[i];
+      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
+      if (specFilter(spec)) {
+        this.runningSpecCount++;
+      }
+    }
+  };
+
+  this.specComplete = function(spec) {
+    this.completeSpecCount++;
+
+    if (isUndefined(this.views.specs[spec.id])) {
+      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
+    }
+
+    var specView = this.views.specs[spec.id];
+
+    switch (specView.status()) {
+      case 'passed':
+        this.passedCount++;
+        break;
+
+      case 'failed':
+        this.failedCount++;
+        break;
+
+      case 'skipped':
+        this.skippedCount++;
+        break;
+    }
+
+    specView.refresh();
+    this.refresh();
+  };
+
+  this.suiteComplete = function(suite) {
+    var suiteView = this.views.suites[suite.id];
+    if (isUndefined(suiteView)) {
+      return;
+    }
+    suiteView.refresh();
+  };
+
+  this.refresh = function() {
+
+    if (isUndefined(this.resultsMenu)) {
+      this.createResultsMenu();
+    }
+
+    // currently running UI
+    if (isUndefined(this.runningAlert)) {
+      this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
+      dom.alert.appendChild(this.runningAlert);
+    }
+    this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
+
+    // skipped specs UI
+    if (isUndefined(this.skippedAlert)) {
+      this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
+    }
+
+    this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+    if (this.skippedCount === 1 && isDefined(dom.alert)) {
+      dom.alert.appendChild(this.skippedAlert);
+    }
+
+    // passing specs UI
+    if (isUndefined(this.passedAlert)) {
+      this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
+    }
+    this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
+
+    // failing specs UI
+    if (isUndefined(this.failedAlert)) {
+      this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
+    }
+    this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
+
+    if (this.failedCount === 1 && isDefined(dom.alert)) {
+      dom.alert.appendChild(this.failedAlert);
+      dom.alert.appendChild(this.resultsMenu);
+    }
+
+    // summary info
+    this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
+    this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
+  };
+
+  this.complete = function() {
+    dom.alert.removeChild(this.runningAlert);
+
+    this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
+
+    if (this.failedCount === 0) {
+      dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
+    } else {
+      showDetails();
+    }
+
+    dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
+  };
+
+  return this;
+
+  function showDetails() {
+    if (dom.reporter.className.search(/showDetails/) === -1) {
+      dom.reporter.className += " showDetails";
+    }
+  }
+
+  function isUndefined(obj) {
+    return typeof obj === 'undefined';
+  }
+
+  function isDefined(obj) {
+    return !isUndefined(obj);
+  }
+
+  function specPluralizedFor(count) {
+    var str = count + " spec";
+    if (count > 1) {
+      str += "s"
+    }
+    return str;
+  }
+
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
+
+
+jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
+  this.spec = spec;
+  this.dom = dom;
+  this.views = views;
+
+  this.symbol = this.createDom('li', { className: 'pending' });
+  this.dom.symbolSummary.appendChild(this.symbol);
+
+  this.summary = this.createDom('div', { className: 'specSummary' },
+      this.createDom('a', {
+        className: 'description',
+        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
+        title: this.spec.getFullName()
+      }, this.spec.description)
+  );
+
+  this.detail = this.createDom('div', { className: 'specDetail' },
+      this.createDom('a', {
+        className: 'description',
+        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
+        title: this.spec.getFullName()
+      }, this.spec.getFullName())
+  );
+};
+
+jasmine.HtmlReporter.SpecView.prototype.status = function() {
+  return this.getSpecStatus(this.spec);
+};
+
+jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
+  this.symbol.className = this.status();
+
+  switch (this.status()) {
+    case 'skipped':
+      break;
+
+    case 'passed':
+      this.appendSummaryToSuiteDiv();
+      break;
+
+    case 'failed':
+      this.appendSummaryToSuiteDiv();
+      this.appendFailureDetail();
+      break;
+  }
+};
+
+jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
+  this.summary.className += ' ' + this.status();
+  this.appendToSummary(this.spec, this.summary);
+};
+
+jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
+  this.detail.className += ' ' + this.status();
+
+  var resultItems = this.spec.results().getItems();
+  var messagesDiv = this.createDom('div', { className: 'messages' });
+
+  for (var i = 0; i < resultItems.length; i++) {
+    var result = resultItems[i];
+
+    if (result.type == 'log') {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
+    } else if (result.type == 'expect' && result.passed && !result.passed()) {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
+
+      if (result.trace.stack) {
+        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
+      }
+    }
+  }
+
+  if (messagesDiv.childNodes.length > 0) {
+    this.detail.appendChild(messagesDiv);
+    this.dom.details.appendChild(this.detail);
+  }
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
+  this.suite = suite;
+  this.dom = dom;
+  this.views = views;
+
+  this.element = this.createDom('div', { className: 'suite' },
+      this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
+  );
+
+  this.appendToSummary(this.suite, this.element);
+};
+
+jasmine.HtmlReporter.SuiteView.prototype.status = function() {
+  return this.getSpecStatus(this.suite);
+};
+
+jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
+  this.element.className += " " + this.status();
+};
+
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
+
+/* @deprecated Use jasmine.HtmlReporter instead
+ */
+jasmine.TrivialReporter = function(doc) {
+  this.document = doc || document;
+  this.suiteDivs = {};
+  this.logRunningSpecs = false;
+};
+
+jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
+  var el = document.createElement(type);
+
+  for (var i = 2; i < arguments.length; i++) {
+    var child = arguments[i];
+
+    if (typeof child === 'string') {
+      el.appendChild(document.createTextNode(child));
+    } else {
+      if (child) { el.appendChild(child); }
+    }
+  }
+
+  for (var attr in attrs) {
+    if (attr == "className") {
+      el[attr] = attrs[attr];
+    } else {
+      el.setAttribute(attr, attrs[attr]);
+    }
+  }
+
+  return el;
+};
+
+jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
+  var showPassed, showSkipped;
+
+  this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
+      this.createDom('div', { className: 'banner' },
+        this.createDom('div', { className: 'logo' },
+            this.createDom('span', { className: 'title' }, "Jasmine"),
+            this.createDom('span', { className: 'version' }, runner.env.versionString())),
+        this.createDom('div', { className: 'options' },
+            "Show ",
+            showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
+            this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
+            showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
+            this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
+            )
+          ),
+
+      this.runnerDiv = this.createDom('div', { className: 'runner running' },
+          this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
+          this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
+          this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
+      );
+
+  this.document.body.appendChild(this.outerDiv);
+
+  var suites = runner.suites();
+  for (var i = 0; i < suites.length; i++) {
+    var suite = suites[i];
+    var suiteDiv = this.createDom('div', { className: 'suite' },
+        this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
+        this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
+    this.suiteDivs[suite.id] = suiteDiv;
+    var parentDiv = this.outerDiv;
+    if (suite.parentSuite) {
+      parentDiv = this.suiteDivs[suite.parentSuite.id];
+    }
+    parentDiv.appendChild(suiteDiv);
+  }
+
+  this.startedAt = new Date();
+
+  var self = this;
+  showPassed.onclick = function(evt) {
+    if (showPassed.checked) {
+      self.outerDiv.className += ' show-passed';
+    } else {
+      self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
+    }
+  };
+
+  showSkipped.onclick = function(evt) {
+    if (showSkipped.checked) {
+      self.outerDiv.className += ' show-skipped';
+    } else {
+      self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
+    }
+  };
+};
+
+jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
+  var results = runner.results();
+  var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
+  this.runnerDiv.setAttribute("class", className);
+  //do it twice for IE
+  this.runnerDiv.setAttribute("className", className);
+  var specs = runner.specs();
+  var specCount = 0;
+  for (var i = 0; i < specs.length; i++) {
+    if (this.specFilter(specs[i])) {
+      specCount++;
+    }
+  }
+  var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
+  message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
+  this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
+
+  this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
+};
+
+jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
+  var results = suite.results();
+  var status = results.passed() ? 'passed' : 'failed';
+  if (results.totalCount === 0) { // todo: change this to check results.skipped
+    status = 'skipped';
+  }
+  this.suiteDivs[suite.id].className += " " + status;
+};
+
+jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
+  if (this.logRunningSpecs) {
+    this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
+  }
+};
+
+jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
+  var results = spec.results();
+  var status = results.passed() ? 'passed' : 'failed';
+  if (results.skipped) {
+    status = 'skipped';
+  }
+  var specDiv = this.createDom('div', { className: 'spec '  + status },
+      this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
+      this.createDom('a', {
+        className: 'description',
+        href: '?spec=' + encodeURIComponent(spec.getFullName()),
+        title: spec.getFullName()
+      }, spec.description));
+
+
+  var resultItems = results.getItems();
+  var messagesDiv = this.createDom('div', { className: 'messages' });
+  for (var i = 0; i < resultItems.length; i++) {
+    var result = resultItems[i];
+
+    if (result.type == 'log') {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
+    } else if (result.type == 'expect' && result.passed && !result.passed()) {
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
+
+      if (result.trace.stack) {
+        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
+      }
+    }
+  }
+
+  if (messagesDiv.childNodes.length > 0) {
+    specDiv.appendChild(messagesDiv);
+  }
+
+  this.suiteDivs[spec.suite.id].appendChild(specDiv);
+};
+
+jasmine.TrivialReporter.prototype.log = function() {
+  var console = jasmine.getGlobal().console;
+  if (console && console.log) {
+    if (console.log.apply) {
+      console.log.apply(console, arguments);
+    } else {
+      console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
+    }
+  }
+};
+
+jasmine.TrivialReporter.prototype.getLocation = function() {
+  return this.document.location;
+};
+
+jasmine.TrivialReporter.prototype.specFilter = function(spec) {
+  var paramMap = {};
+  var params = this.getLocation().search.substring(1).split('&');
+  for (var i = 0; i < params.length; i++) {
+    var p = params[i].split('=');
+    paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
+  }
+
+  if (!paramMap.spec) {
+    return true;
+  }
+  return spec.getFullName().indexOf(paramMap.spec) === 0;
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/6831bed4/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
new file mode 100644
index 0000000..826e575
--- /dev/null
+++ b/lib/cordova-blackberry/blackberry/bin/templates/project/www/spec/lib/jasmine-1.2.0/jasmine.css
@@ -0,0 +1,81 @@
+body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
+
+#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
+#HTMLReporter a { text-decoration: none; }
+#HTMLReporter a:hover { text-decoration: underline; }
+#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
+#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
+#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
+#HTMLReporter .version { color: #aaaaaa; }
+#HTMLReporter .banner { margin-top: 14px; }
+#HTMLReporter .duration { color: #aaaaaa; float: right; }
+#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
+#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
+#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
+#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
+#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
+#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
+#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
+#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
+#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
+#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
+#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
+#HTMLReporter .runningAlert { background-color: #666666; }
+#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
+#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
+#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
+#HTMLReporter .passingAlert { background-color: #a6b779; }
+#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
+#HTMLReporter .failingAlert { background-color: #cf867e; }
+#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
+#HTMLReporter .results { margin-top: 14px; }
+#HTMLReporter #details { display: none; }
+#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
+#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
+#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
+#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
+#HTMLReporter.showDetails .summary { display: none; }
+#HTMLReporter.showDetails #details { display: block; }
+#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
+#HTMLReporter .summary { margin-top: 14px; }
+#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
+#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
+#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
+#HTMLReporter .description + .suite { margin-top: 0; }
+#HTMLReporter .suite { margin-top: 14px; }
+#HTMLReporter .suite a { color: #333333; }
+#HTMLReporter #details .specDetail { margin-bottom: 28px; }
+#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
+#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
+#HTMLReporter .resultMessage span.result { display: block; }
+#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
+
+#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
+#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
+#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
+#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
+#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
+#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
+#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
+#TrivialReporter .runner.running { background-color: yellow; }
+#TrivialReporter .options { text-align: right; font-size: .8em; }
+#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
+#TrivialReporter .suite .suite { margin: 5px; }
+#TrivialReporter .suite.passed { background-color: #dfd; }
+#TrivialReporter .suite.failed { background-color: #fdd; }
+#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
+#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
+#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
+#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
+#TrivialReporter .spec.skipped { background-color: #bbb; }
+#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
+#TrivialReporter .passed { background-color: #cfc; display: none; }
+#TrivialReporter .failed { background-color: #fbb; }
+#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
+#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
+#TrivialReporter .resultMessage .mismatch { color: black; }
+#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
+#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
+#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
+#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
+#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }