diff --git a/core/modules/savers/upload.js b/core/modules/savers/upload.js index 68a9b690e..2e1ff9c20 100644 --- a/core/modules/savers/upload.js +++ b/core/modules/savers/upload.js @@ -24,24 +24,24 @@ var UploadSaver = function(wiki) { UploadSaver.prototype.save = function(text) { // Get the various parameters we need var backupDir = ".", - userName = this.wiki.getTextReference("$:/UploadName"), + username = this.wiki.getTextReference("$:/UploadName"), password = $tw.utils.getPassword("upload"), uploadDir = ".", url = this.wiki.getTextReference("$:/UploadURL"); // Bail out if we don't have the bits we need - if(!userName || userName.toString().trim() === "" || !password || password.toString().trim() === "") { + if(!username || username.toString().trim() === "" || !password || password.toString().trim() === "") { return false; } // Construct the url if not provided if(!url) { - url = "http://" + userName + ".tiddlyspot.com/store.cgi"; + url = "http://" + username + ".tiddlyspot.com/store.cgi"; } // Assemble the header var boundary = "---------------------------" + "AaB03x"; var uploadFormName = "UploadPlugin"; var head = []; head.push("--" + boundary + "\r\nContent-disposition: form-data; name=\"UploadPlugin\"\r\n"); - head.push("backupDir=" + backupDir + ";user=" + userName + ";password=" + password + ";uploaddir=" + uploadDir + ";;"); + head.push("backupDir=" + backupDir + ";user=" + username + ";password=" + password + ";uploaddir=" + uploadDir + ";;"); head.push("\r\n" + "--" + boundary); head.push("Content-disposition: form-data; name=\"userfile\"; filename=\"index.html\""); head.push("Content-Type: text/html;charset=UTF-8"); @@ -52,7 +52,7 @@ UploadSaver.prototype.save = function(text) { data = head.join("\r\n") + text + tail; // Do the HTTP post var http = new XMLHttpRequest(); - http.open("POST",url,true,userName,password); + http.open("POST",url,true,username,password); http.setRequestHeader("Content-Type","multipart/form-data; ;charset=UTF-8; boundary=" + boundary); http.onreadystatechange = function() { if(http.readyState == 4 && http.status == 200) { diff --git a/core/modules/syncer.js b/core/modules/syncer.js index 7cbda34e1..32648186f 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -127,7 +127,7 @@ Syncer.prototype.storeTiddler = function(tiddlerFields) { Syncer.prototype.getStatus = function(callback) { var self = this; - this.syncadaptor.getStatus(function(err,isLoggedIn,userName) { + this.syncadaptor.getStatus(function(err,isLoggedIn,username) { if(err) { self.showError(err); return; @@ -135,13 +135,13 @@ Syncer.prototype.getStatus = function(callback) { // Set the various status tiddlers self.wiki.addTiddler({title: self.titleIsLoggedIn,text: isLoggedIn ? "yes" : "no"}); if(isLoggedIn) { - self.wiki.addTiddler({title: self.titleUserName,text: userName}); + self.wiki.addTiddler({title: self.titleUserName,text: username}); } else { self.wiki.deleteTiddler(self.titleUserName); } // Invoke the callback if(callback) { - callback(err,isLoggedIn,userName); + callback(err,isLoggedIn,username); } }); }; @@ -224,7 +224,7 @@ Dispay a password prompt and allow the user to login */ Syncer.prototype.handleLoginEvent = function() { var self = this; - this.getStatus(function(err,isLoggedIn,userName) { + this.getStatus(function(err,isLoggedIn,username) { if(!isLoggedIn) { $tw.passwordPrompt.createPrompt({ serviceName: "Login to TiddlySpace", @@ -252,7 +252,7 @@ Syncer.prototype.login = function(username,password,callback) { if(err) { return callback(err); } - self.getStatus(function(err,isLoggedIn,userName) { + self.getStatus(function(err,isLoggedIn,username) { if(callback) { callback(null,isLoggedIn); } diff --git a/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid b/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid index 39dbe270a..51053cd0d 100644 --- a/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid +++ b/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid @@ -45,7 +45,7 @@ Returns an object storing any additional information required by the adaptor. Retrieves status information from the server. |!Parameter |!Description | -|callback |Callback function invoked with parameters `err,isLoggedIn,userName` | +|callback |Callback function invoked with parameters `err,isLoggedIn,username` | !! `login(username,password,callback)`