summaryrefslogtreecommitdiff
path: root/src/node/db
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2014-12-16 00:41:41 +0000
committerJohn McLear <john@mclear.co.uk>2014-12-16 00:41:41 +0000
commitcfa3f15f94e7e38dcb7dda9a5224416ee409b41a (patch)
treef26ad9b4c4445f988078a6cebd909f8495e8b0db /src/node/db
parente57c8fa763d231b2bf97dcfe62425ed5a42cd7b9 (diff)
parent5d15f655f0d697995e221c19e707fc9ff05faaa2 (diff)
downloadetherpad-lite-cfa3f15f94e7e38dcb7dda9a5224416ee409b41a.zip
Merge pull request #2373 from webzwo0i/avoid-global-vairables
dont make local variables global
Diffstat (limited to 'src/node/db')
-rw-r--r--src/node/db/API.js6
-rw-r--r--src/node/db/Pad.js2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/node/db/API.js b/src/node/db/API.js
index 07d3703c..a9df2a12 100644
--- a/src/node/db/API.js
+++ b/src/node/db/API.js
@@ -263,7 +263,7 @@ exports.getText = function(padID, rev, callback)
{
if(ERR(err, callback)) return;
- data = {text: atext.text};
+ var data = {text: atext.text};
callback(null, data);
})
@@ -368,7 +368,7 @@ exports.getHTML = function(padID, rev, callback)
if(ERR(err, callback)) return;
html = "<!DOCTYPE HTML><html><body>" +html; // adds HTML head
html += "</body></html>";
- data = {html: html};
+ var data = {html: html};
callback(null, data);
});
}
@@ -380,7 +380,7 @@ exports.getHTML = function(padID, rev, callback)
if(ERR(err, callback)) return;
html = "<!DOCTYPE HTML><html><body>" +html; // adds HTML head
html += "</body></html>";
- data = {html: html};
+ var data = {html: html};
callback(null, data);
});
}
diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js
index 4670696a..2791334b 100644
--- a/src/node/db/Pad.js
+++ b/src/node/db/Pad.js
@@ -135,7 +135,7 @@ Pad.prototype.getRevisionDate = function getRevisionDate(revNum, callback) {
Pad.prototype.getAllAuthors = function getAllAuthors() {
var authors = [];
- for(key in this.pool.numToAttrib)
+ for(var key in this.pool.numToAttrib)
{
if(this.pool.numToAttrib[key][0] == "author" && this.pool.numToAttrib[key][1] != "")
{