1. Luke Plant
  2. lukeplant_python

Commits

Luke Plant  committed 1d686e5

Fixed accidental global vars

  • Participants
  • Parent commits 0f60521
  • Branches default

Comments (0)

Files changed (1)

File lukeplant_me_uk/bibleverses/web/js/bibleverses.js

View file
 function encodeObj(obj) {
     var ks = keys(obj);
     var val = "";
-    for (i = 0; i < ks.length; i++) {
+    for (var i = 0; i < ks.length; i++) {
 	val = val + ks[i] + "=" + encodeURIComponent(obj[ks[i]]) + "&";
     }
     return val;
 }
 
 function updateControls() {
-    email = get_email();
+    var email = get_email();
     if (email != null && email != '') {
 	addUserBar2(email);
 	showCheckBoxes();
 }
 
 function verseAdded(req) {
-    json = evalJSONRequest(req);
+    var json = evalJSONRequest(req);
     if (json.success) {
 	indicateFinishedVerse(json.verse);
     }
 }
 
 function verseRemoved(req) {
-    json = evalJSONRequest(req);
+    var json = evalJSONRequest(req);
     if (json.success) {
 	indicateUnfinishedVerse(json.verse);
     }
 
 function connectCheckBoxes() {
     var vbtns = getElementsByTagAndClassName("span", "versebtns");
+    var cb, show, hide;
     for (var i = 0; i < vbtns.length; i++) {
 	cb = getFirstElementByTagAndClassName("input", "versecb", vbtns[i]);
 	connect(cb, 'onclick', toggleVerseCheckBox);