1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 21:27:58 +01:00

convert single quotes to double quotes

This commit is contained in:
Doug Kearns
2007-11-09 11:46:40 +00:00
parent d97b2bf942
commit 9dc9b7e49c
14 changed files with 95 additions and 95 deletions

View File

@@ -665,7 +665,7 @@ vimperator.Marks = function() //{{{
} }
else else
{ {
var pattern = new RegExp("[" + filter.replace(/\s+/g, '') + "]"); var pattern = new RegExp("[" + filter.replace(/\s+/g, "") + "]");
for (var mark in url_marks) for (var mark in url_marks)
{ {
if (pattern.test(mark)) if (pattern.test(mark))
@@ -800,7 +800,7 @@ vimperator.QuickMarks = function() //{{{
this.remove = function(filter) 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) for (var qmark in qmarks)
{ {

View File

@@ -154,8 +154,8 @@ vimperator.Buffer = function() //{{{
var result = doc.evaluate(expression, elem, var result = doc.evaluate(expression, elem,
function lookupNamespaceURI(prefix) { function lookupNamespaceURI(prefix) {
switch (prefix) { switch (prefix) {
case 'xhtml': case "xhtml":
return 'http://www.w3.org/1999/xhtml'; return "http://www.w3.org/1999/xhtml";
default: default:
return null; return null;
} }

View File

@@ -102,8 +102,8 @@ vimperator.Command.prototype.hasName = function(name)
// true if the candidate matches unambiguously // true if the candidate matches unambiguously
function matchAbbreviation(name, format) function matchAbbreviation(name, format)
{ {
var minimum = format.indexOf('['); // minumum number of characters for a command name match var minimum = format.indexOf("["); // minumum number of characters for a command name match
var fullname = format.replace(/\[(\w+)\]$/, '$1'); // full command name var fullname = format.replace(/\[(\w+)\]$/, "$1"); // full command name
if (fullname.indexOf(name) == 0 && name.length >= minimum) if (fullname.indexOf(name) == 0 && name.length >= minimum)
return true; return true;
else else
@@ -189,7 +189,7 @@ vimperator.Commands = function() //{{{
this.parseCommand = function(str, tag) this.parseCommand = function(str, tag)
{ {
// remove comments // remove comments
str.replace(/\s*".*$/, ''); str.replace(/\s*".*$/, "");
if (tag) // we already have a multiline heredoc construct if (tag) // we already have a multiline heredoc construct
{ {
@@ -220,7 +220,7 @@ vimperator.Commands = function() //{{{
matches[4] = tag[1]; matches[4] = tag[1];
} }
else else
matches[3] = ''; matches[3] = "";
return matches; return matches;
} }
@@ -734,7 +734,7 @@ vimperator.Commands = function() //{{{
else else
{ {
if (!reference[0]) { if (!reference[0]) {
if (reference[2] == 'g') if (reference[2] == "g")
reference[0] = vimperator.globalVariables; reference[0] = vimperator.globalVariables;
else else
return; // for now return; // for now
@@ -742,11 +742,11 @@ vimperator.Commands = function() //{{{
if (match[3]) if (match[3])
{ {
if (match[3] == '+') if (match[3] == "+")
reference[0][reference[1]] += expr; reference[0][reference[1]] += expr;
else if (match[3] == '-') else if (match[3] == "-")
reference[0][reference[1]] -= expr; reference[0][reference[1]] -= expr;
else if (match[3] == '.') else if (match[3] == ".")
reference[0][reference[1]] += expr.toString(); reference[0][reference[1]] += expr.toString();
} }
else else
@@ -762,13 +762,13 @@ vimperator.Commands = function() //{{{
return vimperator.echoerr("E121: Undefined variable: " + match[1]); return vimperator.echoerr("E121: Undefined variable: " + match[1]);
var value = reference[0][reference[1]]; var value = reference[0][reference[1]];
if (typeof value == 'number') if (typeof value == "number")
var prefix = '#'; var prefix = "#";
else if (typeof value == 'function') else if (typeof value == "function")
var prefix = '*'; var prefix = "*";
else else
var prefix = ''; var prefix = "";
vimperator.echo(reference[1] + '\t\t' + prefix + value); vimperator.echo(reference[1] + "\t\t" + prefix + value);
} }
}, },
{ {
@@ -798,8 +798,8 @@ vimperator.Commands = function() //{{{
if (leader_reg.test(lhs)) if (leader_reg.test(lhs))
{ {
var leader_ref = vimperator.variableReference('mapleader'); var leader_ref = vimperator.variableReference("mapleader");
var leader = leader_ref[0] ? leader_ref[0][leader_ref[1]] : '\\'; var leader = leader_ref[0] ? leader_ref[0][leader_ref[1]] : "\\";
lhs = lhs.replace(leader_reg, leader); lhs = lhs.replace(leader_reg, leader);
} }
@@ -877,7 +877,7 @@ vimperator.Commands = function() //{{{
return; return;
} }
var filter = args.replace(/[^a-zA-Z]/g, ''); var filter = args.replace(/[^a-zA-Z]/g, "");
vimperator.marks.list(filter); vimperator.marks.list(filter);
}, },
{ {
@@ -1142,7 +1142,7 @@ vimperator.Commands = function() //{{{
return; return;
} }
var filter = args.replace(/[^a-zA-Z0-9]/g, ''); var filter = args.replace(/[^a-zA-Z0-9]/g, "");
vimperator.quickmarks.list(filter); vimperator.quickmarks.list(filter);
}, },
{ {
@@ -1449,7 +1449,7 @@ vimperator.Commands = function() //{{{
{ {
if (menu.childNodes[i].label == args) if (menu.childNodes[i].label == args)
{ {
eval(menu.childNodes[i].getAttribute('oncommand')); eval(menu.childNodes[i].getAttribute("oncommand"));
break; break;
} }
} }
@@ -1765,7 +1765,7 @@ vimperator.Commands = function() //{{{
return vimperator.echoerr("E471: Argument required"); return vimperator.echoerr("E471: Argument required");
var names = args.split(/ /); var names = args.split(/ /);
if (typeof names == 'string') names = [names]; if (typeof names == "string") names = [names];
var length = names.length; var length = names.length;
for (var i = 0, name = names[i]; i < length; name = names[++i]) for (var i = 0, name = names[i]; i < length; name = names[++i])
{ {

View File

@@ -171,7 +171,7 @@ vimperator.Completion = function() // {{{
get_longest_substring: function() //{{{ get_longest_substring: function() //{{{
{ {
if (g_substrings.length == 0) if (g_substrings.length == 0)
return ''; return "";
var longest = g_substrings[0]; var longest = g_substrings[0];
for (var i = 1; i < g_substrings.length; i++) for (var i = 1; i < g_substrings.length; i++)
@@ -198,13 +198,13 @@ vimperator.Completion = function() // {{{
// join all completion arrays together // join all completion arrays together
for (var i = 0; i < cpt.length; i++) for (var i = 0; i < cpt.length; i++)
{ {
if (cpt[i] == 's') if (cpt[i] == "s")
completions = completions.concat(this.get_search_completions(filter)); completions = completions.concat(this.get_search_completions(filter));
else if (cpt[i] == 'b') else if (cpt[i] == "b")
completions = completions.concat(this.get_bookmark_completions(filter)); completions = completions.concat(this.get_bookmark_completions(filter));
else if (cpt[i] == 'h') else if (cpt[i] == "h")
completions = completions.concat(this.get_history_completions(filter)); completions = completions.concat(this.get_history_completions(filter));
else if (cpt[i] == 'f') else if (cpt[i] == "f")
completions = completions.concat(this.get_file_completions(filter, true)); completions = completions.concat(this.get_file_completions(filter, true));
} }
@@ -402,7 +402,7 @@ vimperator.Completion = function() // {{{
{ {
try try
{ {
title = getBrowser().getBrowserAtIndex(i).contentDocument.getElementsByTagName('title')[0].text; title = getBrowser().getBrowserAtIndex(i).contentDocument.getElementsByTagName("title")[0].text;
} }
catch (e) catch (e)
{ {

View File

@@ -598,7 +598,7 @@ vimperator.Events = function() //{{{
} }
var count_str = vimperator.input.buffer.match(/^[0-9]*/)[0]; 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; var map;
// counts must be at the start of a complete mapping (10j -> go 10 lines down) // counts must be at the start of a complete mapping (10j -> go 10 lines down)

View File

@@ -99,7 +99,7 @@ vimperator.Search = function() //{{{
pattern = pattern.replace(/(\\)?\\[cC]/g, function($0, $1) { return $1 ? $0 : ""; }); pattern = pattern.replace(/(\\)?\\[cC]/g, function($0, $1) { return $1 ? $0 : ""; });
// remove any modifer escape \ // remove any modifer escape \
pattern = pattern.replace(/\\(\\[cCuU])/g, '$1'); pattern = pattern.replace(/\\(\\[cCuU])/g, "$1");
search_string = pattern; search_string = pattern;
} }
@@ -247,7 +247,7 @@ vimperator.Search = function() //{{{
{ {
for (var i = 0; i < win.frames.length; i++) for (var i = 0; i < win.frames.length; i++)
arguments.callee(win.frames[i]); arguments.callee(win.frames[i]);
var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]', win.document); var spans = vimperator.buffer.evaluateXPath("//span[@id='__firefox-findbar-search-id']", win.document);
for (var i = 0; i < spans.snapshotLength; i++) for (var i = 0; i < spans.snapshotLength; i++)
spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]); spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]);
})(window.content); })(window.content);

View File

@@ -104,7 +104,7 @@ vimperator.help = function(section, easter) //{{{
// add more space between entries // add more space between entries
ret += separator; ret += separator;
} }
ret = ret.replace(new RegExp(separator + '$'), ''); // FIXME: far too tasty! ret = ret.replace(new RegExp(separator + "$"), ""); // FIXME: far too tasty!
return ret; return ret;
} }
@@ -121,7 +121,7 @@ vimperator.help = function(section, easter) //{{{
} }
else else
{ {
if (typeof command.default_value == 'string' && command.default_value.length == 0) if (typeof command.default_value == "string" && command.default_value.length == 0)
ret += "''"; ret += "''";
else else
ret += command.default_value; ret += command.default_value;
@@ -181,14 +181,14 @@ vimperator.help = function(section, easter) //{{{
'<table class="vimperator mappings">'; '<table class="vimperator mappings">';
mappings += makeHelpString(vimperator.mappings, "", "", null); mappings += makeHelpString(vimperator.mappings, "", "", null);
mappings += '</table>'; mappings += '</table>';
if (section && section == 'holy-grail') if (section && section == "holy-grail")
mappings += '<div><p id="holy-grail">You found it, Arthur!</p></div>\n'; mappings += '<div><p id="holy-grail">You found it, Arthur!</p></div>\n';
var commands = '<span style="float: right"><code class="tag">commands</code></span><h2 id="commands">Commands</h2>' + var commands = '<span style="float: right"><code class="tag">commands</code></span><h2 id="commands">Commands</h2>' +
'<table class="vimperator commands">\n'; '<table class="vimperator commands">\n';
commands += makeHelpString(vimperator.commands, ":", "", null); commands += makeHelpString(vimperator.commands, ":", "", null);
commands += '</table>'; commands += '</table>';
if (section && section == '42') if (section && section == "42")
commands += '<div><p id="42">What is the meaning of life, the universe and everything?<br/>' + commands += '<div><p id="42">What is the meaning of life, the universe and everything?<br/>' +
'Douglas Adams, the only person who knew what this question really was about is<br/>' + 'Douglas Adams, the only person who knew what this question really was about is<br/>' +
'now dead, unfortunately. So now you might wonder what the meaning of death<br/>' + 'now dead, unfortunately. So now you might wonder what the meaning of death<br/>' +
@@ -268,9 +268,9 @@ vimperator.help = function(section, easter) //{{{
if (!element) if (!element)
{ {
var firstChar = section.charAt(0); var firstChar = section.charAt(0);
if (firstChar != ':' && firstChar != "'") if (firstChar != ":" && firstChar != "'")
{ {
element = findSectionElement(':' + section); element = findSectionElement(":" + section);
if (!element) if (!element)
element = findSectionElement("'" + section + "'"); element = findSectionElement("'" + section + "'");
} }

View File

@@ -24,7 +24,7 @@
vimperator.Hints = function() //{{{ vimperator.Hints = function() //{{{
{ {
const HINT_PREFIX = 'hah_hint_'; // prefix for the hint id const HINT_PREFIX = "hah_hint_"; // prefix for the hint id
this.hintedElements = function() { return hintedElems; }; this.hintedElements = function() { return hintedElems; };
this.currentState = function() { return state;}; this.currentState = function() { return state;};
@@ -145,15 +145,15 @@ vimperator.Hints = function() //{{{
var elem, i; var elem, i;
hintElemSpan = doc.createElement('SPAN'); hintElemSpan = doc.createElement("SPAN");
hintElemSpan.style.cssText = vimperator.options["hintstyle"]; hintElemSpan.style.cssText = vimperator.options["hintstyle"];
hintElemSpan.setAttribute('name', 'hah_hint'); hintElemSpan.setAttribute("name", "hah_hint");
var hintContainer = doc.getElementById('hah_hints'); var hintContainer = doc.getElementById("hah_hints");
if (hintContainer == null) if (hintContainer == null)
{ {
genHintContainer(doc); genHintContainer(doc);
hintContainer = doc.getElementById('hah_hints'); hintContainer = doc.getElementById("hah_hints");
if (!hintContainer) if (!hintContainer)
return false; return false;
} }
@@ -192,7 +192,7 @@ vimperator.Hints = function() //{{{
hintContainer.appendChild(hintElem); hintContainer.appendChild(hintElem);
} }
hintElem.style.display = 'none'; hintElem.style.display = "none";
hintElem.style.top = elem.absoTop + "px"; hintElem.style.top = elem.absoTop + "px";
hintElem.style.left = elem.absoLeft + "px"; hintElem.style.left = elem.absoLeft + "px";
hintElem.refElem = elem; hintElem.refElem = elem;
@@ -223,7 +223,7 @@ vimperator.Hints = function() //{{{
// FIXME: this.disableHahMode(win); // FIXME: this.disableHahMode(win);
vimperator.setMode(vimperator.modes.NORMAL); vimperator.setMode(vimperator.modes.NORMAL);
isHahModeEnabled = false; isHahModeEnabled = false;
linkNumString = ''; linkNumString = "";
hintedElems = []; hintedElems = [];
return; return;
@@ -231,7 +231,7 @@ vimperator.Hints = function() //{{{
var doc = win.document; var doc = win.document;
var hintElem = null; var hintElem = null;
var hintContainer = doc.getElementById('hah_hints'); var hintContainer = doc.getElementById("hah_hints");
var hints = hintContainer.childNodes; var hints = hintContainer.childNodes;
var i, j; var i, j;
@@ -239,8 +239,8 @@ vimperator.Hints = function() //{{{
{ {
hintText = formatHint(offset+i); hintText = formatHint(offset+i);
hintElem = hints[i]; hintElem = hints[i];
hintElem.style.display = 'inline'; hintElem.style.display = "inline";
//hintElem.style.position = 'absolute'; //hintElem.style.position = "absolute";
hintElem.innerHTML = hintText; hintElem.innerHTML = hintText;
hintElem.id = HINT_PREFIX + hintText; hintElem.id = HINT_PREFIX + hintText;
} }
@@ -267,7 +267,7 @@ vimperator.Hints = function() //{{{
{ {
elem = res.snapshotItem(i); elem = res.snapshotItem(i);
setHintStyle(elem, vimperator.options["hintstyle"]); setHintStyle(elem, vimperator.options["hintstyle"]);
elem.style.display = 'none'; elem.style.display = "none";
} }
for (i = 0; i < win.frames.length; i++) for (i = 0; i < win.frames.length; i++)
@@ -337,7 +337,7 @@ vimperator.Hints = function() //{{{
var str = hintNum.toString(hintCharacters.length); // turn hintNum into a base(length) number var str = hintNum.toString(hintCharacters.length); // turn hintNum into a base(length) number
// map the number onto the chars in the numbers string // map the number onto the chars in the numbers string
var result = ''; var result = "";
// make all links the same length // make all links the same length
var hintLength = 1; var hintLength = 1;
var tmp = linkCount; var tmp = linkCount;
@@ -405,7 +405,7 @@ vimperator.Hints = function() //{{{
vimperator.setMode(vimperator.modes.HINTS, mode); vimperator.setMode(vimperator.modes.HINTS, mode);
state = 0; state = 0;
linkCount = 0; linkCount = 0;
linkNumString = ''; linkNumString = "";
isHahModeEnabled = true; isHahModeEnabled = true;
createHints(); createHints();
@@ -431,7 +431,7 @@ vimperator.Hints = function() //{{{
vimperator.setMode(vimperator.modes.NORMAL); vimperator.setMode(vimperator.modes.NORMAL);
isHahModeEnabled = false; isHahModeEnabled = false;
linkNumString = ''; linkNumString = "";
hintedElems = []; hintedElems = [];
removeHints(win); removeHints(win);
@@ -440,7 +440,7 @@ vimperator.Hints = function() //{{{
this.resetHintedElements = function() this.resetHintedElements = function()
{ {
linkNumString = ''; linkNumString = "";
state = 0; state = 0;
while (hintedElems.length > 0) while (hintedElems.length > 0)
@@ -486,11 +486,11 @@ vimperator.Hints = function() //{{{
var elemTagName = elem.localName.toLowerCase(); var elemTagName = elem.localName.toLowerCase();
elem.focus(); elem.focus();
if (elemTagName == 'frame' || elemTagName == 'iframe') if (elemTagName == "frame" || elemTagName == "iframe")
return 0; return 0;
// for imagemap // for imagemap
if (elemTagName == 'area') if (elemTagName == "area")
{ {
var coords = elem.getAttribute("coords").split(","); var coords = elem.getAttribute("coords").split(",");
x = Number(coords[0]); x = Number(coords[0]);
@@ -499,12 +499,12 @@ vimperator.Hints = function() //{{{
var doc = window.content.document; var doc = window.content.document;
var view = window.document.defaultView; var view = window.document.defaultView;
var evt = doc.createEvent('MouseEvents'); 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); elem.dispatchEvent(evt);
var evt = doc.createEvent('MouseEvents'); 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); elem.dispatchEvent(evt);
// for 'pure' open calls without a new tab or window it doesn't // for 'pure' open calls without a new tab or window it doesn't
@@ -525,7 +525,7 @@ vimperator.Hints = function() //{{{
for (var i = 0; i < elems.length; i++) for (var i = 0; i < elems.length; i++)
{ {
tmp = elems[i].refElem.href; tmp = elems[i].refElem.href;
if (typeof(tmp) != 'undefined' && tmp.length > 0) if (typeof(tmp) != "undefined" && tmp.length > 0)
{ {
if (i > 0) if (i > 0)
loc += "\n"; loc += "\n";
@@ -548,7 +548,7 @@ vimperator.Hints = function() //{{{
for (var i = 0; i < elems.length; i++) for (var i = 0; i < elems.length; i++)
{ {
tmp = elems[i].refElem.textContent; tmp = elems[i].refElem.textContent;
if (typeof(tmp) != 'undefined' && tmp.length > 0) if (typeof(tmp) != "undefined" && tmp.length > 0)
{ {
if (i > 0) if (i > 0)
loc += "\n"; loc += "\n";
@@ -590,7 +590,7 @@ vimperator.Hints = function() //{{{
var doc = window.document; var doc = window.document;
var elemTagName = elem.localName.toLowerCase(); var elemTagName = elem.localName.toLowerCase();
if (elemTagName == 'frame' || elemTagName == 'iframe') if (elemTagName == "frame" || elemTagName == "iframe")
{ {
elem.contentWindow.focus(); elem.contentWindow.focus();
return; return;
@@ -600,18 +600,18 @@ vimperator.Hints = function() //{{{
// elem.focus(); // elem.focus();
//} //}
var evt = doc.createEvent('MouseEvents'); var evt = doc.createEvent("MouseEvents");
var x = 0; var x = 0;
var y = 0; var y = 0;
// for imagemap // for imagemap
if (elemTagName == 'area') if (elemTagName == "area")
{ {
var coords = elem.getAttribute("coords").split(","); var coords = elem.getAttribute("coords").split(",");
x = Number(coords[0]); x = Number(coords[0]);
y = Number(coords[1]); 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); elem.dispatchEvent(evt);
} }
@@ -635,7 +635,7 @@ vimperator.Hints = function() //{{{
if (num != null && hintCharacters.toUpperCase().indexOf(num) > -1) if (num != null && hintCharacters.toUpperCase().indexOf(num) > -1)
{ {
var oldLinkNumString = linkNumString; var oldLinkNumString = linkNumString;
linkNumString += '' + num; linkNumString += "" + num;
// update reference to currently selected node; // update reference to currently selected node;
var elem = getHintById(linkNumString); var elem = getHintById(linkNumString);
changeHintFocus(linkNumString, oldLinkNumString); changeHintFocus(linkNumString, oldLinkNumString);
@@ -644,7 +644,7 @@ vimperator.Hints = function() //{{{
if (elem) if (elem)
{ {
hintedElems.push(elem); hintedElems.push(elem);
linkNumString = ''; linkNumString = "";
state = 1; state = 1;
return hintedElems.length; return hintedElems.length;
} }
@@ -666,10 +666,10 @@ vimperator.Hints = function() //{{{
function genHintContainer(doc) function genHintContainer(doc)
{ {
if (doc.getElementsByTagName('HINTS').length > 0) if (doc.getElementsByTagName("HINTS").length > 0)
return; return;
hints = doc.createElement('HINTS'); hints = doc.createElement("HINTS");
hints.id = "hah_hints"; hints.id = "hah_hints";
hints.valid_hint_count = 0; // initially 0 elements are usable as hints hints.valid_hint_count = 0; // initially 0 elements are usable as hints
@@ -703,7 +703,7 @@ vimperator.Hints = function() //{{{
{ {
state = 0; state = 0;
linkCount = 0; linkCount = 0;
linkNumString = ''; linkNumString = "";
isHahModeEnabled = true; isHahModeEnabled = true;
setTimeout( function() { setTimeout( function() {

View File

@@ -49,7 +49,7 @@ vimperator.IO = function()
// TODO: proper pathname separator translation like Vim // TODO: proper pathname separator translation like Vim
if (WINDOWS) 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) // expand "~" to VIMPERATOR_HOME or HOME (USERPROFILE or HOMEDRIVE\HOMEPATH on Windows if HOME is not set)
if (/^~/.test(path)) if (/^~/.test(path))

View File

@@ -499,7 +499,7 @@ vimperator.Mappings = function() //{{{
flags: vimperator.Mappings.flags.COUNT flags: vimperator.Mappings.flags.COUNT
} }
)); ));
addDefaultMap(new vimperator.Map(vimperator.modes.NORMAL, ['<C-^>', '<C-6>'], addDefaultMap(new vimperator.Map(vimperator.modes.NORMAL, ["<C-^>", "<C-6>"],
function() function()
{ {
if (vimperator.tabs.getTab() == vimperator.tabs.alternate) if (vimperator.tabs.getTab() == vimperator.tabs.alternate)
@@ -522,7 +522,7 @@ vimperator.Mappings = function() //{{{
}, },
{ {
short_help: "Select the alternate tab", short_help: "Select the alternate tab",
usage: ['<C-^>'], usage: ["<C-^>"],
help: "The alternate tab is the last selected tab. This provides a quick method of toggling between two tabs." help: "The alternate tab is the last selected tab. This provides a quick method of toggling between two tabs."
} }
)); ));
@@ -1077,14 +1077,14 @@ vimperator.Mappings = function() //{{{
} }
)); ));
addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, [","], addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, [","],
function() { vimperator.input.buffer += ','; vimperator.hints.setCurrentState(0); }, function() { vimperator.input.buffer += ","; vimperator.hints.setCurrentState(0); },
{ {
cancel_mode: false, cancel_mode: false,
always_active: true always_active: true
} }
)); ));
addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, [":"], addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, [":"],
function() { vimperator.commandline.open(':', '', vimperator.modes.EX); }, function() { vimperator.commandline.open(":", "", vimperator.modes.EX); },
{ {
cancel_mode: false, cancel_mode: false,
always_active: true always_active: true
@@ -1173,14 +1173,14 @@ vimperator.Mappings = function() //{{{
// tab management // tab management
addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, ["<C-n>"], addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, ["<C-n>"],
function() { vimperator.tabs.select('+1', true); }, function() { vimperator.tabs.select("+1", true); },
{ {
cancel_mode: true, cancel_mode: true,
always_active: true always_active: true
} }
)); // same as gt, but no count supported )); // same as gt, but no count supported
addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, ["<C-p>"], addDefaultMap(new vimperator.Map(vimperator.modes.HINTS, ["<C-p>"],
function() { vimperator.tabs.select('-1', true); }, function() { vimperator.tabs.select("-1", true); },
{ {
cancel_mode: true, cancel_mode: true,
always_active: true always_active: true

View File

@@ -296,14 +296,14 @@ vimperator.Options = function() //{{{
// //
// work around firefox popup blocker // work around firefox popup blocker
var popup_allowed_events = loadPreference('dom.popup_allowed_events', 'change click dblclick mouseup reset submit'); var popup_allowed_events = loadPreference("dom.popup_allowed_events", "change click dblclick mouseup reset submit");
if (!popup_allowed_events.match("keypress")) if (!popup_allowed_events.match("keypress"))
storePreference('dom.popup_allowed_events', popup_allowed_events + " keypress"); storePreference("dom.popup_allowed_events", popup_allowed_events + " keypress");
// TODO: shouldn't we be resetting these in destroy() as well? // TODO: shouldn't we be resetting these in destroy() as well?
// we have our own typeahead find implementation // we have our own typeahead find implementation
storePreference('accessibility.typeaheadfind.autostart', false); storePreference("accessibility.typeaheadfind.autostart", false);
storePreference('accessibility.typeaheadfind', false); // actually the above setting should do it, but has no effect in firefox storePreference("accessibility.typeaheadfind", false); // actually the above setting should do it, but has no effect in firefox
// start with saved session // start with saved session
storePreference("browser.startup.page", 3); storePreference("browser.startup.page", 3);
@@ -337,9 +337,9 @@ vimperator.Options = function() //{{{
this.destroy = function() this.destroy = function()
{ {
// reset some modified firefox prefs // reset some modified firefox prefs
if (loadPreference('dom.popup_allowed_events', 'change click dblclick mouseup reset submit') if (loadPreference("dom.popup_allowed_events", "change click dblclick mouseup reset submit")
== popup_allowed_events + " keypress") == popup_allowed_events + " keypress")
storePreference('dom.popup_allowed_events', popup_allowed_events); storePreference("dom.popup_allowed_events", popup_allowed_events);
} }
this.list = function(only_non_default) this.list = function(only_non_default)

View File

@@ -100,11 +100,11 @@ vimperator.CommandLine = function() //{{{
var completion_index = UNINITIALIZED; var completion_index = UNINITIALIZED;
// the containing box for the prompt_widget and command_widget // the containing box for the prompt_widget and command_widget
var commandline_widget = document.getElementById('vimperator-commandline'); var commandline_widget = document.getElementById("vimperator-commandline");
// the prompt for the current command, for example : or /. Can be blank // the prompt for the current command, for example : or /. Can be blank
var prompt_widget = document.getElementById('vimperator-commandline-prompt'); var prompt_widget = document.getElementById("vimperator-commandline-prompt");
// the command bar which contains the current command // the command bar which contains the current command
var command_widget = document.getElementById('vimperator-commandline-command'); var command_widget = document.getElementById("vimperator-commandline-command");
// the widget used for multiline output // the widget used for multiline output
var multiline_output_widget = document.getElementById("vimperator-multiline-output"); var multiline_output_widget = document.getElementById("vimperator-multiline-output");
@@ -520,11 +520,11 @@ vimperator.CommandLine = function() //{{{
var longest = false; var longest = false;
var full = false; var full = false;
var wildtype = wim[wild_index++] || wim[wim.length - 1]; var wildtype = wim[wild_index++] || wim[wim.length - 1];
if (wildtype == 'list' || wildtype == 'list:full' || wildtype == 'list:longest') if (wildtype == "list" || wildtype == "list:full" || wildtype == "list:longest")
has_list = true; has_list = true;
if (wildtype == 'longest' || wildtype == 'list:longest') if (wildtype == "longest" || wildtype == "list:longest")
longest = true; longest = true;
else if (wildtype == 'full' || wildtype == 'list:full') else if (wildtype == "full" || wildtype == "list:full")
full = true; full = true;
// show the list // show the list

View File

@@ -93,7 +93,7 @@ vimperator.util = {
var matches; var matches;
// strip each 'URL' - makes things simpler later on // strip each 'URL' - makes things simpler later on
urls[url] = urls[url].replace(/^\s+/, '').replace(/\s+$/, ''); urls[url] = urls[url].replace(/^\s+/, "").replace(/\s+$/, "");
// FIXME: not really that good (doesn't handle .. in the middle) // FIXME: not really that good (doesn't handle .. in the middle)
// check for ./ and ../ (or even .../) to go to a file in the upper directory // check for ./ and ../ (or even .../) to go to a file in the upper directory

View File

@@ -73,9 +73,9 @@ const vimperator = (function() //{{{
var callbacks = []; var callbacks = [];
// our services // our services
var sound_service = Components.classes['@mozilla.org/sound;1'] var sound_service = Components.classes["@mozilla.org/sound;1"]
.getService(Components.interfaces.nsISound); .getService(Components.interfaces.nsISound);
var console_service = Components.classes['@mozilla.org/consoleservice;1'] var console_service = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService); .getService(Components.interfaces.nsIConsoleService);
var environment_service = Components.classes["@mozilla.org/process/environment;1"] var environment_service = Components.classes["@mozilla.org/process/environment;1"]
.getService(Components.interfaces.nsIEnvironment); .getService(Components.interfaces.nsIEnvironment);
@@ -243,7 +243,7 @@ const vimperator = (function() //{{{
if (!modifiers) if (!modifiers)
modifiers = {}; modifiers = {};
var [count, cmd, special, args] = vimperator.commands.parseCommand(str.replace(/^'(.*)'$/, '$1')); var [count, cmd, special, args] = vimperator.commands.parseCommand(str.replace(/^'(.*)'$/, "$1"));
var command = vimperator.commands.get(cmd); var command = vimperator.commands.get(cmd);
if (command === null) if (command === null)
@@ -406,7 +406,7 @@ const vimperator = (function() //{{{
if (typeof msg == "object") if (typeof msg == "object")
msg = this.objectToString(msg, false); msg = this.objectToString(msg, false);
console_service.logStringMessage('vimperator: ' + msg); console_service.logStringMessage("vimperator: " + msg);
}, },
// open one or more URLs // open one or more URLs