cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [14/22] git commit: npm version 2.8.8. Should resolve [CB-3614]. Updated bundled android lib to 2.8.0 tag.
Date Fri, 07 Jun 2013 01:31:21 GMT
npm version 2.8.8. Should resolve [CB-3614]. Updated bundled android lib to 2.8.0 tag.


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

Branch: refs/heads/2.8.x
Commit: 2c4112ec114f8f61ef1a53f6eb32d9f8a8bdcc2f
Parents: ca42474
Author: Fil Maj <maj.fil@gmail.com>
Authored: Wed Jun 5 14:10:09 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Thu Jun 6 18:29:25 2013 -0700

----------------------------------------------------------------------
 lib/cordova-android/VERSION                        |    2 +-
 .../framework/assets/www/cordova.js                |   26 ++-
 .../src/org/apache/cordova/api/DataResource.java   |  141 ---------------
 .../apache/cordova/api/DataResourceContext.java    |   31 ----
 package.json                                       |    2 +-
 5 files changed, 19 insertions(+), 183 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2c4112ec/lib/cordova-android/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-android/VERSION b/lib/cordova-android/VERSION
index 1277c83..834f262 100644
--- a/lib/cordova-android/VERSION
+++ b/lib/cordova-android/VERSION
@@ -1 +1 @@
-2.8.0rc1
+2.8.0

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2c4112ec/lib/cordova-android/framework/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/lib/cordova-android/framework/assets/www/cordova.js b/lib/cordova-android/framework/assets/www/cordova.js
index 3730047..5e460e4 100644
--- a/lib/cordova-android/framework/assets/www/cordova.js
+++ b/lib/cordova-android/framework/assets/www/cordova.js
@@ -1,5 +1,5 @@
 // Platform: android
-// 2.8.0rc1-0-g22bc4d8
+// 2.8.0-0-g6208c95
 /*
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -19,7 +19,7 @@
  under the License.
 */
 ;(function() {
-var CORDOVA_JS_BUILD_LABEL = '2.8.0rc1-0-g22bc4d8';
+var CORDOVA_JS_BUILD_LABEL = '2.8.0-0-g6208c95';
 // file: lib/scripts/require.js
 
 var require,
@@ -2396,11 +2396,7 @@ function initRead(reader, file) {
     reader._error = null;
     reader._readyState = FileReader.LOADING;
 
-    if (typeof file == 'string') {
-        // Deprecated in Cordova 2.4.
-        console.warn('Using a string argument with FileReader.readAs functions is deprecated.');
-        reader._fileName = file;
-    } else if (typeof file.fullPath == 'string') {
+    if (typeof file.fullPath == 'string') {
         reader._fileName = file.fullPath;
     } else {
         reader._fileName = '';
@@ -4071,6 +4067,10 @@ module.exports = {
 // file: lib/android/plugin/android/nativeapiprovider.js
 define("cordova/plugin/android/nativeapiprovider", function(require, exports, module) {
 
+/**
+ * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
+ */
+
 var nativeApi = this._cordovaNative || require('cordova/plugin/android/promptbasednativeapi');
 var currentApi = nativeApi;
 
@@ -4149,6 +4149,11 @@ module.exports = {
 // file: lib/android/plugin/android/promptbasednativeapi.js
 define("cordova/plugin/android/promptbasednativeapi", function(require, exports, module)
{
 
+/**
+ * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
+ * This is used only on the 2.3 simulator, where addJavascriptInterface() is broken.
+ */
+
 module.exports = {
     exec: function(service, action, callbackId, argsJson) {
         return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId]));
@@ -5072,7 +5077,6 @@ function Device() {
     this.available = false;
     this.platform = null;
     this.version = null;
-    this.name = null;
     this.uuid = null;
     this.cordova = null;
     this.model = null;
@@ -5088,7 +5092,6 @@ function Device() {
             me.available = true;
             me.platform = info.platform;
             me.version = info.version;
-            me.name = info.name;
             me.uuid = info.uuid;
             me.cordova = buildLabel;
             me.model = info.model;
@@ -6676,6 +6679,11 @@ window.cordova = require('cordova');
 // file: lib/scripts/bootstrap.js
 
 (function (context) {
+    if (context._cordovaJsLoaded) {
+        throw new Error('cordova.js included multiple times.');
+    }
+    context._cordovaJsLoaded = true;
+
     var channel = require('cordova/channel');
     var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2c4112ec/lib/cordova-android/framework/src/org/apache/cordova/api/DataResource.java
----------------------------------------------------------------------
diff --git a/lib/cordova-android/framework/src/org/apache/cordova/api/DataResource.java b/lib/cordova-android/framework/src/org/apache/cordova/api/DataResource.java
deleted file mode 100644
index 3e6ead8..0000000
--- a/lib/cordova-android/framework/src/org/apache/cordova/api/DataResource.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.apache.cordova.api;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.apache.cordova.FileHelper;
-
-import android.net.Uri;
-
-/*
- * All requests to access files, browser network requests etc have to go through this class.
- */
-public class DataResource {
-    private CordovaInterface cordova;
-
-    // Uri of the request. Always required.
-    private Uri uri;
-    // Remaining fields may or may not be null
-    private InputStream is;
-    private OutputStream os;
-    private String mimeType;
-    private Boolean writable;
-    private File realFile;
-    private boolean retryIsLoad = true;
-    private boolean retryOsLoad = true;
-    private boolean retryMimeTypeLoad = true;
-    private boolean retryWritableLoad = true;
-    private boolean retryRealFileLoad = true;
-
-    public DataResource(CordovaInterface cordova, Uri uri) {
-        this.cordova = cordova;
-        this.uri = uri;
-    }
-    public DataResource(CordovaInterface cordova, Uri uri, InputStream is,
-            OutputStream os, String mimeType, boolean writable, File realFile) {
-        this(cordova, uri);
-        this.is = is;
-        this.mimeType = mimeType;
-        this.writable = Boolean.valueOf(writable);
-        this.realFile = realFile;
-    }
-    public Uri getUri() {
-        // Uri is always provided
-        return uri;
-    }
-    public InputStream getInputStream() throws IOException {
-        if(is == null && retryIsLoad) {
-            try {
-                is = FileHelper.getInputStreamFromUriString(uri.toString(), cordova);
-            } finally {
-                // We failed loading once, don't try loading anymore
-                if(is == null) {
-                    retryIsLoad = false;
-                }
-            }
-        }
-        return is;
-    }
-    public OutputStream getOutputStream() throws FileNotFoundException {
-        if(os == null && retryOsLoad) {
-            try {
-                os = FileHelper.getOutputStreamFromUriString(uri.toString(), cordova);
-            } finally {
-                // We failed loading once, don't try loading anymore
-                if(os == null) {
-                    retryOsLoad = false;
-                }
-            }
-        }
-        return os;
-    }
-    public String getMimeType() {
-        if(mimeType == null && retryMimeTypeLoad) {
-            try {
-                mimeType = FileHelper.getMimeType(uri.toString(), cordova);
-            } finally {
-                // We failed loading once, don't try loading anymore
-                if(mimeType == null) {
-                    retryMimeTypeLoad = false;
-                }
-            }
-        }
-        return mimeType;
-    }
-    public boolean isWritable() {
-        if(writable == null && retryWritableLoad) {
-            try {
-                writable = FileHelper.isUriWritable(uri.toString());
-            } finally {
-                // We failed loading once, don't try loading anymore
-                if(writable == null) {
-                    retryWritableLoad = false;
-                }
-            }
-        }
-        // default to false
-        return writable != null && writable.booleanValue();
-    }
-    public File getRealFile() {
-        if(realFile == null && retryRealFileLoad) {
-            try {
-                String realPath = FileHelper.getRealPath(uri, cordova);
-                if(realPath != null) {
-                    realFile = new File(realPath);
-                }
-            } finally {
-                // We failed loading once, don't try loading anymore
-                if(realFile == null) {
-                    retryRealFileLoad = false;
-                }
-            }
-        }
-        return realFile;
-    }
-
-    // static instantiation methods
-    public static DataResource initiateNewDataRequestForUri(String uriString, PluginManager
pluginManager, CordovaInterface cordova, String requestSourceTag){
-        // if no protocol is specified, assume its file:
-        uriString = FileHelper.insertFileProtocol(uriString);
-        return initiateNewDataRequestForUri(Uri.parse(uriString), pluginManager, cordova,
requestSourceTag);
-    }
-    public static DataResource initiateNewDataRequestForUri(Uri uri, PluginManager pluginManager,
CordovaInterface cordova, String requestSourceTag){
-        return initiateNewDataRequestForUri(uri, pluginManager, cordova, new DataResourceContext(requestSourceTag));
-    }
-    public static DataResource initiateNewDataRequestForUri(String uriString, PluginManager
pluginManager, CordovaInterface cordova, DataResourceContext dataResourceContext){
-     // if no protocol is specified, assume its file:
-        uriString = FileHelper.insertFileProtocol(uriString);
-        return initiateNewDataRequestForUri(Uri.parse(uriString), pluginManager, cordova,
dataResourceContext);
-    }
-    public static DataResource initiateNewDataRequestForUri(Uri uri, PluginManager pluginManager,
CordovaInterface cordova, DataResourceContext dataResourceContext){
-        DataResource dataResource = new DataResource(cordova, uri);
-        if (pluginManager != null) {
-            // get the resource as returned by plugins
-            dataResource = pluginManager.handleDataResourceRequestWithPlugins(dataResource,
dataResourceContext);
-        }
-        return dataResource;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2c4112ec/lib/cordova-android/framework/src/org/apache/cordova/api/DataResourceContext.java
----------------------------------------------------------------------
diff --git a/lib/cordova-android/framework/src/org/apache/cordova/api/DataResourceContext.java
b/lib/cordova-android/framework/src/org/apache/cordova/api/DataResourceContext.java
deleted file mode 100644
index 310586b..0000000
--- a/lib/cordova-android/framework/src/org/apache/cordova/api/DataResourceContext.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.cordova.api;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Random;
-/*
- * Some context information associated with a DataRequest.
- */
-public class DataResourceContext {
-    // A random id that is unique for a particular request.
-    private int requestId;
-    // A tag associated with the source of this dataResourceContext
-    private String source;
-    // If needed, any data associated with core plugins can be a part of the context object
-    // If needed, any data associated with non core plugins  should store data in a Map so
as to not clutter the context object
-    private Map<String, Object> dataMap;
-    public DataResourceContext(String source) {
-        this.requestId = new Random().nextInt();
-        this.source = source;
-        this.dataMap = new HashMap<String, Object>();
-    }
-    public int getRequestId() {
-        return requestId;
-    }
-    public String getSource() {
-        return source;
-    }
-    public Map<String, Object> getDataMap() {
-        return dataMap;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2c4112ec/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2ab9de2..315374f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova",
-  "version": "2.8.7",
+  "version": "2.8.8",
   "preferGlobal": "true",
   "description": "Cordova command line interface tool",
   "main": "cordova",


Mime
View raw message