From 9ecff0c16fed46a68cde28697ee40de9fb548c89 Mon Sep 17 00:00:00 2001 From: Lyle Underwood Date: Sun, 14 Oct 2012 23:21:36 -0700 Subject: [PATCH] don't set cwd_ in ls --- src/filer.js | 23 ++++++++++------------- src/filer.min.js | 8 ++++---- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/filer.js b/src/filer.js index 996c2ee..ded3b55 100755 --- a/src/filer.js +++ b/src/filer.js @@ -1,22 +1,22 @@ -/** +/** * Copyright 2012 - Eric Bidelman - * + * * 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. - + * @fileoverview * Convenient wrapper library for the HTML5 Filesystem API, implementing * familiar UNIX commands (cp, mv, ls) for its API. - * + * * @author Eric Bidelman (ebidel@gmail.com) * @version: 0.4 */ @@ -84,7 +84,7 @@ var Util = { strToObjectURL: function(binStr, opt_contentType) { var ui8a = new Uint8Array(binStr.length); - for (var i = 0; i < ui8a.length; ++i) { + for (var i = 0; i < ui8a.length; ++i) { ui8a[i] = binStr.charCodeAt(i); } @@ -446,7 +446,7 @@ var Filer = new function() { opt_successCallback && opt_successCallback(fs); }; - + if (this.type == self.PERSISTENT && !!self.storageInfo) { self.storageInfo.requestQuota(this.type, size, function(grantedBytes) { self.requestFileSystem( @@ -475,14 +475,11 @@ var Filer = new function() { } var callback = function(dirEntry) { - - cwd_ = dirEntry; - - // Read contents of current working directory. According to spec, need to + // Read contents of directory. According to spec, need to // keep calling readEntries() until length of result array is 0. We're // guarenteed the same entry won't be returned again. var entries_ = []; - var reader = cwd_.createReader(); + var reader = dirEntry.createReader(); var readEntries = function() { reader.readEntries(function(results) { diff --git a/src/filer.min.js b/src/filer.min.js index 3b3ce15..646126f 100644 --- a/src/filer.min.js +++ b/src/filer.min.js @@ -3,11 +3,11 @@ var Util={toArray:function(a){return Array.prototype.slice.call(a||[],0)},strToD d.onerror=function(a){c&&c(a)};d.readAsArrayBuffer(a)},dataURLToBlob:function(a){if(-1==a.indexOf(";base64,")){var b=a.split(","),a=b[0].split(":")[1],b=b[1];return new Blob([b],{type:a})}for(var b=a.split(";base64,"),a=b[0].split(":")[1],b=window.atob(b[1]),c=b.length,d=new Uint8Array(c),i=0;i