Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 72E78C40F for ; Sat, 12 May 2012 01:17:18 +0000 (UTC) Received: (qmail 77879 invoked by uid 500); 12 May 2012 01:17:18 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 77829 invoked by uid 500); 12 May 2012 01:17:18 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 77809 invoked by uid 99); 12 May 2012 01:17:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 May 2012 01:17:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1E3CC1589E; Sat, 12 May 2012 01:17:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [2/3] js commit: removed platform specific override for WP7 filesytem calls Message-Id: <20120512011718.1E3CC1589E@tyr.zones.apache.org> Date: Sat, 12 May 2012 01:17:18 +0000 (UTC) removed platform specific override for WP7 filesytem calls Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/cc609ca7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/cc609ca7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/cc609ca7 Branch: refs/heads/master Commit: cc609ca72a57a85658023cc4388af312d6991f30 Parents: 1638f52 Author: Jesse MacFadyen Authored: Fri May 11 18:14:25 2012 -0700 Committer: Jesse MacFadyen Committed: Fri May 11 18:15:50 2012 -0700 ---------------------------------------------------------------------- lib/wp7/exec.js | 4 +- lib/wp7/plugin/wp7/requestFileSystem.js | 42 ------------------ lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js | 38 ---------------- 3 files changed, 3 insertions(+), 81 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/cc609ca7/lib/wp7/exec.js ---------------------------------------------------------------------- diff --git a/lib/wp7/exec.js b/lib/wp7/exec.js index 092543d..a58f013 100644 --- a/lib/wp7/exec.js +++ b/lib/wp7/exec.js @@ -21,7 +21,9 @@ var NamedArgs = { write:["fileName","data","position"], truncate:["fileName","size"], copyTo:["fullPath","parent", "newName"], - moveTo:["fullPath","parent", "newName"] + moveTo:["fullPath","parent", "newName"], + requestFileSystem:["type","size"], + resolveLocalFileSystemURI:["uri"] }, FileTransfer:{ upload:["filePath", "server", "fileKey", "fileName", "mimeType", "params", "debug", "chunkedMode"], http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/cc609ca7/lib/wp7/plugin/wp7/requestFileSystem.js ---------------------------------------------------------------------- diff --git a/lib/wp7/plugin/wp7/requestFileSystem.js b/lib/wp7/plugin/wp7/requestFileSystem.js deleted file mode 100644 index 2634b16..0000000 --- a/lib/wp7/plugin/wp7/requestFileSystem.js +++ /dev/null @@ -1,42 +0,0 @@ - -var FileError = require('cordova/plugin/FileError'), - FileSystem = require('cordova/plugin/FileSystem'), - exec = require('cordova/exec'); - -/** - * Request a file system in which to store application data. - * @param type local file system type - * @param size indicates how much storage space, in bytes, the application expects to need - * @param successCallback invoked with a FileSystem object - * @param errorCallback invoked if error occurs retrieving file system - */ -var requestFileSystem = function(type, size, successCallback, errorCallback) { - // wp7 custom imp - var fail = function(code) { - if (typeof errorCallback === 'function') { - errorCallback(new FileError(code)); - } - }; - - if (type < 0 || type > 3) { - fail(FileError.SYNTAX_ERR); - } else { - // if successful, return a FileSystem object - var success = function(file_system) { - if (file_system) { - if (typeof successCallback === 'function') { - // grab the name and root from the file system object - var result = new FileSystem(file_system.name, file_system.root); - successCallback(result); - } - } - else { - // no FileSystem object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - exec(success, fail, "File", "requestFileSystem", {type:type,size:size}); - } -}; - -module.exports = requestFileSystem; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/cc609ca7/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js ---------------------------------------------------------------------- diff --git a/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js b/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js deleted file mode 100644 index 32d591d..0000000 --- a/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js +++ /dev/null @@ -1,38 +0,0 @@ - - -var DirectoryEntry = require('cordova/plugin/DirectoryEntry'), - FileEntry = require('cordova/plugin/FileEntry'), - FileError = require('cordova/plugin/FileError'), - exec = require('cordova/exec'); - -module.exports = function(uri, successCallback, errorCallback) { - // error callback - var fail = function(error) { - if (typeof errorCallback === 'function') { - errorCallback(new FileError(error)); - } - }; - // if successful, return either a file or directory entry - var success = function(entry) { - var result; - - if (entry) { - if (typeof successCallback === 'function') { - // create appropriate Entry object - result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath) : new FileEntry(entry.name, entry.fullPath); - try { - successCallback(result); - } - catch (e) { - console.log('Error invoking callback: ' + e); - } - } - } - else { - // no Entry object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - - exec(success, fail, "File", "resolveLocalFileSystemURI", {uri:uri}); -};