s/us/this/

This commit is contained in:
Ondrej Zara
2015-06-16 12:57:26 +02:00
parent 36cd5e5acd
commit 9ff7bfe0ff
+29 -33
View File
@@ -76,54 +76,51 @@ SQL.Storage.Dropbox.prototype.authenticate = function(connectedCallBack) {
this.dropboxClient.authDriver(new Dropbox.AuthDriver.Popup({ receiverUrl: prefix+"dropbox-oauth-receiver.html" })); this.dropboxClient.authDriver(new Dropbox.AuthDriver.Popup({ receiverUrl: prefix+"dropbox-oauth-receiver.html" }));
// Now let's authenticate us // Now let's authenticate us
var us = this;
this.dropboxClient.authenticate( function(error, client) { this.dropboxClient.authenticate( function(error, client) {
if (error) { if (error) {
us.showDropboxError(error); this.showDropboxError(error);
} else { } else {
// We're authenticated // We're authenticated
connectedCallBack(); connectedCallBack();
} }
}); }.bind(this));
return true; return true;
} }
SQL.Storage.Dropbox.prototype._save = function(keyword) { SQL.Storage.Dropbox.prototype._save = function(keyword) {
var us = this; this.authenticate( function() {
us.authenticate( function() { var xml = this.owner.owner.toXML();
var xml = us.owner.owner.toXML();
var filename = keyword + ".xml"; var filename = keyword + ".xml";
us.owner.owner.window.showThrobber(); this.owner.owner.window.showThrobber();
us.dropboxClient.writeFile(filename, xml, function(error, stat) { this.dropboxClient.writeFile(filename, xml, function(error, stat) {
us.owner.owner.window.hideThrobber(); this.owner.owner.window.hideThrobber();
if (error) { if (error) {
us.showDropboxError(error); this.showDropboxError(error);
} else { } else {
us._keyword = keyword; this._keyword = keyword;
us.owner.getArea().value = filename+" "+_("was saved to Dropbox"); this.owner.getArea().value = filename+" "+_("was saved to Dropbox");
} }
}.bind(us)); }.bind(this));
}); }.bind(this));
} }
SQL.Storage.Dropbox.prototype._load = function(keyword) { SQL.Storage.Dropbox.prototype._load = function(keyword) {
var us = this; this.authenticate( function() {
us.authenticate( function() {
var filename = keyword + ".xml"; var filename = keyword + ".xml";
us.owner.owner.window.showThrobber(); this.owner.owner.window.showThrobber();
us.dropboxClient.readFile(filename, function(error, data) { this.dropboxClient.readFile(filename, function(error, data) {
us.owner.owner.window.hideThrobber(); this.owner.owner.window.hideThrobber();
if (error) { if (error) {
us.showDropboxError(error); this.showDropboxError(error);
} else { } else {
us.owner.fromXMLText(data); this.owner.fromXMLText(data);
us._keyword = keyword; this._keyword = keyword;
} }
}.bind(us)); }.bind(this));
}); }.bind(this));
} }
SQL.Storage.Dropbox.prototype._clickSave = function(e) { SQL.Storage.Dropbox.prototype._clickSave = function(e) {
@@ -139,16 +136,15 @@ SQL.Storage.Dropbox.prototype._clickLoad = function(e) {
} }
SQL.Storage.Dropbox.prototype._clickList = function(e) { SQL.Storage.Dropbox.prototype._clickList = function(e) {
var us = this; this.authenticate( function() {
us.authenticate( function() { this.owner.owner.window.showThrobber();
us.owner.owner.window.showThrobber(); this.dropboxClient.readdir("/", function(error, entries) {
us.dropboxClient.readdir("/", function(error, entries) { this.owner.owner.window.hideThrobber();
us.owner.owner.window.hideThrobber();
if (error) { if (error) {
us.showDropboxError(error); this.showDropboxError(error);
} else { } else {
us.owner.getArea().value = entries.join("\n")+"\n" this.owner.getArea().value = entries.join("\n")+"\n";
} }
}.bind(us)); }.bind(this));
}); }.bind(this));
} }