cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject js commit: [ios] Remove %-escaping version of FileReader.
Date Fri, 11 Jan 2013 17:22:34 GMT
Updated Branches:
  refs/heads/master 50bf9441d -> f9bcabb68


[ios] Remove %-escaping version of FileReader.

https://issues.apache.org/jira/browse/CB-2168


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

Branch: refs/heads/master
Commit: f9bcabb68f3139458192f34a71ed3c6ae8a25123
Parents: 50bf944
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Jan 11 12:21:46 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jan 11 12:21:46 2013 -0500

----------------------------------------------------------------------
 lib/ios/platform.js              |    3 -
 lib/ios/plugin/ios/FileReader.js |  108 ---------------------------------
 2 files changed, 0 insertions(+), 111 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f9bcabb6/lib/ios/platform.js
----------------------------------------------------------------------
diff --git a/lib/ios/platform.js b/lib/ios/platform.js
index 7edcbdd..eb62df5 100644
--- a/lib/ios/platform.js
+++ b/lib/ios/platform.js
@@ -47,9 +47,6 @@ module.exports = {
         Entry:{
             path: "cordova/plugin/ios/Entry"
         },
-        FileReader:{
-            path: "cordova/plugin/ios/FileReader"
-        },
         navigator:{
             children:{
                 notification:{

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f9bcabb6/lib/ios/plugin/ios/FileReader.js
----------------------------------------------------------------------
diff --git a/lib/ios/plugin/ios/FileReader.js b/lib/ios/plugin/ios/FileReader.js
deleted file mode 100644
index 52cb7f9..0000000
--- a/lib/ios/plugin/ios/FileReader.js
+++ /dev/null
@@ -1,108 +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 exec = require('cordova/exec'),
-    FileError = require('cordova/plugin/FileError'),
-    FileReader = require('cordova/plugin/FileReader'),
-    ProgressEvent = require('cordova/plugin/ProgressEvent');
-
-module.exports = {
-    readAsText:function(file, encoding) {
-        // Figure out pathing
-        this.fileName = '';
-        if (typeof file.fullPath === 'undefined') {
-            this.fileName = file;
-        } else {
-            this.fileName = file.fullPath;
-        }
-
-        // Already loading something
-        if (this.readyState == FileReader.LOADING) {
-            throw new FileError(FileError.INVALID_STATE_ERR);
-        }
-
-        // LOADING state
-        this.readyState = FileReader.LOADING;
-
-        // If loadstart callback
-        if (typeof this.onloadstart === "function") {
-            this.onloadstart(new ProgressEvent("loadstart", {target:this}));
-        }
-
-        // Default encoding is UTF-8
-        var enc = encoding ? encoding : "UTF-8";
-
-        var me = this;
-
-        // 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 = decodeURIComponent(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", [this.fileName, enc]);
-    }
-};


Mime
View raw message