Index: lib/storage/io.js |
=================================================================== |
--- a/lib/storage/io.js |
+++ b/lib/storage/io.js |
@@ -33,8 +33,8 @@ |
_setFileContents: function(path, contents, lastModified) |
{ |
- ext.storage[path] = contents; |
- ext.storage[path + "/lastModified"] = lastModified || 0; |
+ safari.extension.settings[path] = contents; |
+ safari.extension.settings[path + "/lastModified"] = lastModified || 0; |
}, |
lineBreak: "\n", |
@@ -50,13 +50,13 @@ |
Utils.runAsync(function() |
{ |
var path = this._getFilePath(file); |
- if (!(path in ext.storage)) |
+ if (!(path in safari.extension.settings)) |
{ |
callback(new Error("File doesn't exist")) |
return; |
} |
- var lines = ext.storage[path].split(/[\r\n]+/); |
+ var lines = safari.extension.settings[path].split(/[\r\n]+/); |
for (var i = 0; i < lines.length; i++) |
listener.process(lines[i]); |
listener.process(null); |
@@ -95,21 +95,21 @@ |
renameFile: function(fromFile, newName, callback) |
{ |
var path = this._getFilePath(fromFile); |
- if (!(path in ext.storage)) |
+ if (!(path in safari.extension.settings)) |
{ |
callback(new Error("File doesn't exist")) |
return; |
} |
- this._setFileContents(newName, ext.storage[path], ext.storage[path + "/lastModified"]); |
+ this._setFileContents(newName, safari.extension.settings[path], safari.extension.settings[path + "/lastModified"]); |
this.removeFile(fromFile, callback); |
}, |
removeFile: function(file, callback) |
{ |
var path = this._getFilePath(file); |
- delete ext.storage[path]; |
- delete ext.storage[path + "/lastModified"]; |
+ delete safari.extension.settings[path]; |
+ delete safari.extension.settings[path + "/lastModified"]; |
callback(null); |
}, |
@@ -120,10 +120,10 @@ |
// This needs to use Utils.runAsync(), otherwise FilterStorage might |
// initialize too early - see #337. |
require("utils").Utils.runAsync(callback.bind(null, null, { |
- exists: path in ext.storage, |
+ exists: path in safari.extension.settings, |
isDirectory: false, |
isFile: true, |
- lastModified: parseInt(ext.storage[path + "/lastModified"], 10) || 0 |
+ lastModified: parseInt(safari.extension.settings[path + "/lastModified"], 10) || 0 |
})); |
} |
}; |