diff --git a/content/bookmarks.js b/content/bookmarks.js index 601fb846..967fb989 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -40,7 +40,7 @@ vimperator.Bookmarks = function() //{{{ .getService(Components.interfaces.nsITaggingService); const search_service = Components.classes["@mozilla.org/browser/search-service;1"] .getService(Components.interfaces.nsIBrowserSearchService); - const io_service = Components.classes['@mozilla.org/network/io-service;1'] + const io_service = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var bookmarks = null; @@ -623,7 +623,7 @@ vimperator.Marks = function() //{{{ } else { - var pattern = new RegExp("[" + filter.replace(/\s+/g, '') + "]"); + var pattern = new RegExp("[" + filter.replace(/\s+/g, "") + "]"); for (var mark in url_marks) { if (pattern.test(mark)) @@ -758,7 +758,7 @@ vimperator.QuickMarks = function() //{{{ this.remove = function(filter) { - var pattern = new RegExp("[" + filter.replace(/\s+/g, '') + "]"); + var pattern = new RegExp("[" + filter.replace(/\s+/g, "") + "]"); for (var qmark in qmarks) { diff --git a/content/buffers.js b/content/buffers.js index f4632dfe..dfdbd11d 100644 --- a/content/buffers.js +++ b/content/buffers.js @@ -175,8 +175,8 @@ vimperator.Buffer = function() //{{{ var result = doc.evaluate(expression, elem, function lookupNamespaceURI(prefix) { switch (prefix) { - case 'xhtml': - return 'http://www.w3.org/1999/xhtml'; + case "xhtml": + return "http://www.w3.org/1999/xhtml"; default: return null; } @@ -625,7 +625,7 @@ vimperator.Buffer = function() //{{{ if (!verbose) { var info = []; // tmp array for joining later - var file = window.content.document.location.pathname.split('/').pop() || "[No Name]"; + var file = window.content.document.location.pathname.split("/").pop() || "[No Name]"; var title = window.content.document.title || "[No Title]"; if (pageSize[1]) diff --git a/content/commands.js b/content/commands.js index 174c3a6d..64a7ee11 100644 --- a/content/commands.js +++ b/content/commands.js @@ -103,8 +103,8 @@ vimperator.Command.prototype.hasName = function(name) // true if the candidate matches unambiguously function matchAbbreviation(name, format) { - var minimum = format.indexOf('['); // minumum number of characters for a command name match - var fullname = format.replace(/\[(\w+)\]$/, '$1'); // full command name + var minimum = format.indexOf("["); // minumum number of characters for a command name match + var fullname = format.replace(/\[(\w+)\]$/, "$1"); // full command name if (fullname.indexOf(name) == 0 && name.length >= minimum) return true; else @@ -485,7 +485,7 @@ vimperator.Commands = function() //{{{ this.parseCommand = function(str, tag) { // remove comments - str.replace(/\s*".*$/, ''); + str.replace(/\s*".*$/, ""); if (tag) // we already have a multiline heredoc construct { @@ -516,7 +516,7 @@ vimperator.Commands = function() //{{{ matches[4] = tag[1]; } else - matches[3] = ''; + matches[3] = ""; return matches; } @@ -1052,7 +1052,7 @@ vimperator.Commands = function() //{{{ else { if (!reference[0]) { - if (reference[2] == 'g') + if (reference[2] == "g") reference[0] = vimperator.globalVariables; else return; // for now @@ -1060,11 +1060,11 @@ vimperator.Commands = function() //{{{ if (match[3]) { - if (match[3] == '+') + if (match[3] == "+") reference[0][reference[1]] += expr; - else if (match[3] == '-') + else if (match[3] == "-") reference[0][reference[1]] -= expr; - else if (match[3] == '.') + else if (match[3] == ".") reference[0][reference[1]] += expr.toString(); } else @@ -1080,13 +1080,13 @@ vimperator.Commands = function() //{{{ return vimperator.echoerr("E121: Undefined variable: " + match[1]); var value = reference[0][reference[1]]; - if (typeof value == 'number') - var prefix = '#'; - else if (typeof value == 'function') - var prefix = '*'; + if (typeof value == "number") + var prefix = "#"; + else if (typeof value == "function") + var prefix = "*"; else - var prefix = ''; - vimperator.echo(reference[1] + '\t\t' + prefix + value); + var prefix = ""; + vimperator.echo(reference[1] + "\t\t" + prefix + value); } }, { @@ -1220,8 +1220,8 @@ vimperator.Commands = function() //{{{ if (leader_reg.test(lhs)) { - var leader_ref = vimperator.variableReference('mapleader'); - var leader = leader_ref[0] ? leader_ref[0][leader_ref[1]] : '\\'; + var leader_ref = vimperator.variableReference("mapleader"); + var leader = leader_ref[0] ? leader_ref[0][leader_ref[1]] : "\\"; lhs = lhs.replace(leader_reg, leader); } @@ -1299,7 +1299,7 @@ vimperator.Commands = function() //{{{ return; } - var filter = args.replace(/[^a-zA-Z]/g, ''); + var filter = args.replace(/[^a-zA-Z]/g, ""); vimperator.marks.list(filter); }, { @@ -1571,7 +1571,7 @@ vimperator.Commands = function() //{{{ return; } - var filter = args.replace(/[^a-zA-Z0-9]/g, ''); + var filter = args.replace(/[^a-zA-Z0-9]/g, ""); vimperator.quickmarks.list(filter); }, { @@ -1893,7 +1893,7 @@ vimperator.Commands = function() //{{{ { if (menu.childNodes[i].label == args) { - eval(menu.childNodes[i].getAttribute('oncommand')); + eval(menu.childNodes[i].getAttribute("oncommand")); break; } } @@ -2209,7 +2209,7 @@ vimperator.Commands = function() //{{{ return vimperator.echoerr("E471: Argument required"); var names = args.split(/ /); - if (typeof names == 'string') names = [names]; + if (typeof names == "string") names = [names]; var length = names.length; for (var i = 0, name = names[i]; i < length; name = names[++i]) { diff --git a/content/completion.js b/content/completion.js index a750ace9..e6a037bf 100644 --- a/content/completion.js +++ b/content/completion.js @@ -112,7 +112,7 @@ vimperator.Completion = function() // {{{ get_longest_substring: function() //{{{ { if (g_substrings.length == 0) - return ''; + return ""; var longest = g_substrings[0]; for (var i = 1; i < g_substrings.length; i++) @@ -139,13 +139,13 @@ vimperator.Completion = function() // {{{ // join all completion arrays together for (var i = 0; i < cpt.length; i++) { - if (cpt[i] == 's') + if (cpt[i] == "s") completions = completions.concat(this.get_search_completions(filter)); - else if (cpt[i] == 'b') + else if (cpt[i] == "b") completions = completions.concat(vimperator.bookmarks.get(filter)); - else if (cpt[i] == 'h') + else if (cpt[i] == "h") completions = completions.concat(vimperator.history.get(filter)); - else if (cpt[i] == 'f') + else if (cpt[i] == "f") completions = completions.concat(this.get_file_completions(filter, true)); } diff --git a/content/editor.js b/content/editor.js index 70499648..3f6aa338 100644 --- a/content/editor.js +++ b/content/editor.js @@ -578,7 +578,7 @@ vimperator.Editor = function() //{{{ if (abbrev[lhs][0][0] == "c" && filter == "c") abbrev[lhs][0] = abbrev[lhs][1]; - abbrev[lhs][1] = ''; + abbrev[lhs][1] = ""; return true; } diff --git a/content/events.js b/content/events.js index e5ee599e..abd74bb2 100644 --- a/content/events.js +++ b/content/events.js @@ -634,7 +634,7 @@ vimperator.Events = function() //{{{ } var count_str = vimperator.input.buffer.match(/^[0-9]*/)[0]; - var candidate_command = (vimperator.input.buffer + key).replace(count_str, ''); + var candidate_command = (vimperator.input.buffer + key).replace(count_str, ""); var map; // counts must be at the start of a complete mapping (10j -> go 10 lines down) diff --git a/content/find.js b/content/find.js index a8252149..115c598e 100644 --- a/content/find.js +++ b/content/find.js @@ -99,7 +99,7 @@ vimperator.Search = function() //{{{ pattern = pattern.replace(/(\\)?\\[cC]/g, function($0, $1) { return $1 ? $0 : ""; }); // remove any modifer escape \ - pattern = pattern.replace(/\\(\\[cCuU])/g, '$1'); + pattern = pattern.replace(/\\(\\[cCuU])/g, "$1"); search_string = pattern; } diff --git a/content/help.js b/content/help.js index a538b674..49ae08ca 100644 --- a/content/help.js +++ b/content/help.js @@ -104,7 +104,7 @@ vimperator.help = function(section, easter) //{{{ // add more space between entries ret += separator; } - ret = ret.replace(new RegExp(separator + '$'), ''); // FIXME: far too tasty! + ret = ret.replace(new RegExp(separator + "$"), ""); // FIXME: far too tasty! return ret; } @@ -121,7 +121,7 @@ vimperator.help = function(section, easter) //{{{ } else { - if (typeof command.default_value == 'string' && command.default_value.length == 0) + if (typeof command.default_value == "string" && command.default_value.length == 0) ret += "''"; else ret += command.default_value; @@ -181,14 +181,14 @@ vimperator.help = function(section, easter) //{{{ '
You found it, Arthur!
commandsWhat is the meaning of life, the universe and everything?
' +
'Douglas Adams, the only person who knew what this question really was about is
' +
'now dead, unfortunately. So now you might wonder what the meaning of death
' +
@@ -268,9 +268,9 @@ vimperator.help = function(section, easter) //{{{
if (!element)
{
var firstChar = section.charAt(0);
- if (firstChar != ':' && firstChar != "'")
+ if (firstChar != ":" && firstChar != "'")
{
- element = findSectionElement(':' + section);
+ element = findSectionElement(":" + section);
if (!element)
element = findSectionElement("'" + section + "'");
}
diff --git a/content/hints.js b/content/hints.js
index 2a904ac8..3165c883 100644
--- a/content/hints.js
+++ b/content/hints.js
@@ -65,11 +65,11 @@ vimperator.Hints = function() //{{{
var elem = valid_hints[hintNumber - 1] || valid_hints[0];
var elemTagName = elem.localName.toLowerCase();
elem.focus();
- if (elemTagName == 'frame' || elemTagName == 'iframe')
+ if (elemTagName == "frame" || elemTagName == "iframe")
return 0;
// for imagemap
- if (elemTagName == 'area')
+ if (elemTagName == "area")
{
var coords = elem.getAttribute("coords").split(",");
x = Number(coords[0]);
@@ -78,12 +78,12 @@ vimperator.Hints = function() //{{{
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);
+ 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);
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);
+ 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);
elem.dispatchEvent(evt);
return true;
@@ -97,7 +97,7 @@ vimperator.Hints = function() //{{{
var elem = valid_hints[hintNumber - 1] || valid_hints[0];
var doc = window.content.document;
var elemTagName = elem.localName.toLowerCase();
- if (elemTagName == 'frame' || elemTagName == 'iframe')
+ if (elemTagName == "frame" || elemTagName == "iframe")
{
elem.contentWindow.focus();
return;
@@ -107,18 +107,18 @@ vimperator.Hints = function() //{{{
elem.focus();
}
- var evt = doc.createEvent('MouseEvents');
+ var evt = doc.createEvent("MouseEvents");
var x = 0;
var y = 0;
// for imagemap
- if (elemTagName == 'area')
+ if (elemTagName == "area")
{
var coords = elem.getAttribute("coords").split(",");
x = Number(coords[0]);
y = Number(coords[1]);
}
- evt.initMouseEvent('mouseover', true, true, doc.defaultView, 1, x, y, 0, 0, 0, 0, 0, 0, 0, null);
+ evt.initMouseEvent("mouseover", true, true, doc.defaultView, 1, x, y, 0, 0, 0, 0, 0, 0, 0, null);
elem.dispatchEvent(evt);
}
@@ -492,7 +492,7 @@ outer:
generate();
// get all keys from the input queue
- var mt = Components.classes['@mozilla.org/thread-manager;1'].getService().mainThread;
+ var mt = Components.classes["@mozilla.org/thread-manager;1"].getService().mainThread;
while (mt.hasPendingEvents())
mt.processNextEvent(true);
diff --git a/content/io.js b/content/io.js
index b861652a..490fbd7c 100644
--- a/content/io.js
+++ b/content/io.js
@@ -49,7 +49,7 @@ vimperator.IO = function()
// TODO: proper pathname separator translation like Vim
if (WINDOWS)
- path = path.replace('/', '\\', 'g');
+ path = path.replace("/", "\\", "g");
// expand "~" to VIMPERATOR_HOME or HOME (USERPROFILE or HOMEDRIVE\HOMEPATH on Windows if HOME is not set)
if (/^~/.test(path))
diff --git a/content/mappings.js b/content/mappings.js
index bd7ac07f..152ae8fc 100644
--- a/content/mappings.js
+++ b/content/mappings.js
@@ -549,7 +549,7 @@ vimperator.Mappings = function() //{{{
flags: vimperator.Mappings.flags.COUNT
}
));
- addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ['