diff --git a/content/hints.js b/content/hints.js index fce12ab7..8e085345 100644 --- a/content/hints.js +++ b/content/hints.js @@ -75,15 +75,15 @@ vimperator.Hints = function() //{{{ x = Number(coords[0]); y = Number(coords[1]); } - doc = window.content.document; - view = window.document.defaultView; + var doc = window.content.document; + var view = window.document.defaultView; var evt = doc.createEvent('MouseEvents'); - evt.initMouseEvent('mousedown', true, true, view, 1, x+1, y+1, 0, 0, /*ctrl*/ new_tab, /*event.altKey*/0, /*event.shiftKey*/ new_window, /*event.metaKey*/ new_tab, 0, null); + evt.initMouseEvent('mousedown', true, true, view, 1, x + 1, y + 1, 0, 0, /*ctrl*/ new_tab, /*event.altKey*/0, /*event.shiftKey*/ new_window, /*event.metaKey*/ new_tab, 0, null); elem.dispatchEvent(evt); var evt = doc.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, view, 1, x+1, y+1, 0, 0, /*ctrl*/ new_tab, /*event.altKey*/0, /*event.shiftKey*/ new_window, /*event.metaKey*/ new_tab, 0, null); + evt.initMouseEvent('click', true, true, view, 1, x + 1, y + 1, 0, 0, /*ctrl*/ new_tab, /*event.altKey*/0, /*event.shiftKey*/ new_window, /*event.metaKey*/ new_tab, 0, null); elem.dispatchEvent(evt); return true; @@ -519,8 +519,8 @@ outer: if (!hintsGenerated) return; - doc = docs.pop(); - if(doc); + var doc = docs.pop(); + if (doc); removeHints(doc, 0); }; @@ -561,13 +561,13 @@ outer: case "": if (hintNumber > 0 && !usedTabKey) { - hintNumber = Math.floor(hintNumber/10); + hintNumber = Math.floor(hintNumber / 10); } else if (hintString != "") { usedTabKey = false; hintNumber = 0; - hintString = hintString.substr(0, hintString.length-1); + hintString = hintString.substr(0, hintString.length - 1); } else { diff --git a/content/options.js b/content/options.js index 3b00ce8c..0f0e125b 100644 --- a/content/options.js +++ b/content/options.js @@ -135,6 +135,8 @@ vimperator.Options = function() //{{{ function storePreference(name, value, vimperator_branch) { + var branch; + if (vimperator_branch) branch = vimperator_prefs; else diff --git a/content/ui.js b/content/ui.js index ee1b7a3e..241acee8 100644 --- a/content/ui.js +++ b/content/ui.js @@ -1154,12 +1154,12 @@ vimperator.StatusLine = function() //{{{ { progress_str = "["; var done = Math.floor(progress * 20); - for (i=0; i < done; i++) + for (var i = 0; i < done; i++) progress_str += "="; progress_str += ">"; - for (i=19; i > done; i--) + for (var i = 19; i > done; i--) progress_str += " "; progress_str += "]"; diff --git a/content/vimperator.js b/content/vimperator.js index 77633d07..0c97d3cd 100644 --- a/content/vimperator.js +++ b/content/vimperator.js @@ -212,7 +212,8 @@ const vimperator = (function() //{{{ if (!string) return [null, null, null]; - if (match = string.match(/^([bwtglsv]):(\w+)/)) // Variable + var match = string.match(/^([bwtglsv]):(\w+)/); + if (match) // Variable { // Other variables should be implemented if (match[1] == "g")