diff --git a/content/bookmarks.js b/content/bookmarks.js
index 967fb989..16f3bb55 100644
--- a/content/bookmarks.js
+++ b/content/bookmarks.js
@@ -27,7 +27,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
// also includes methods for dealing with keywords and search engines
-vimperator.Bookmarks = function() //{{{
+vimperator.Bookmarks = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -47,7 +47,7 @@ vimperator.Bookmarks = function() //{{{
var keywords = null;
if (vimperator.options["preload"])
- setTimeout(function() { load(); } , 100);
+ setTimeout(function () { load(); } , 100);
function load()
{
@@ -102,7 +102,7 @@ vimperator.Bookmarks = function() //{{{
// if "bypass_cache" is true, it will force a reload of the bookmarks database
// on my PC, it takes about 1ms for each bookmark to load, so loading 1000 bookmarks
// takes about 1 sec
- this.get = function(filter, tags, bypass_cache)
+ this.get = function (filter, tags, bypass_cache)
{
if (!bookmarks || bypass_cache)
load();
@@ -147,7 +147,7 @@ vimperator.Bookmarks = function() //{{{
}
// returns number of deleted bookmarks
- this.remove = function(url)
+ this.remove = function (url)
{
if (!url)
return 0;
@@ -178,7 +178,7 @@ vimperator.Bookmarks = function() //{{{
// TODO: add filtering
// also ensures that each search engine has a Vimperator-friendly alias
- this.getSearchEngines = function()
+ this.getSearchEngines = function ()
{
var search_engines = [];
var firefox_engines = search_service.getVisibleEngines({ });
@@ -194,7 +194,7 @@ vimperator.Bookmarks = function() //{{{
var newalias = alias;
for (var j = 1; j <= 10; j++) // <=10 is intentional
{
- if (!search_engines.some(function(item) { return (item[0] == newalias); }))
+ if (!search_engines.some(function (item) { return (item[0] == newalias); }))
break;
newalias = alias + j;
@@ -212,7 +212,7 @@ vimperator.Bookmarks = function() //{{{
// TODO: add filtering
// format of returned array:
// [keyword, helptext, url]
- this.getKeywords = function()
+ this.getKeywords = function ()
{
if (!keywords)
load();
@@ -223,7 +223,7 @@ vimperator.Bookmarks = function() //{{{
// if @param engine_name is null, it uses the default search engine
// @returns the url for the search string
// if the search also requires a postdata, [url, postdata] is returned
- this.getSearchURL = function(text, engine_name)
+ this.getSearchURL = function (text, engine_name)
{
var url = null;
var postdata = null;
@@ -271,7 +271,7 @@ vimperator.Bookmarks = function() //{{{
return url; // can be null
}
- this.list = function(filter, tags, fullmode)
+ this.list = function (filter, tags, fullmode)
{
if (fullmode)
{
@@ -328,7 +328,7 @@ vimperator.Bookmarks = function() //{{{
//}}}
} //}}}
-vimperator.History = function() //{{{
+vimperator.History = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -339,7 +339,7 @@ vimperator.History = function() //{{{
var history = null;
if (vimperator.options["preload"])
- setTimeout(function() { load(); } , 100);
+ setTimeout(function () { load(); } , 100);
function load()
{
@@ -374,7 +374,7 @@ vimperator.History = function() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
- this.get = function(filter)
+ this.get = function (filter)
{
if (!history)
load();
@@ -389,7 +389,7 @@ vimperator.History = function() //{{{
if (!history)
load();
- history = history.filter(function(elem) {
+ history = history.filter(function (elem) {
return elem[0] != url;
});
@@ -399,7 +399,7 @@ vimperator.History = function() //{{{
// TODO: better names?
// and move to vimperator.buffer.?
- this.stepTo = function(steps)
+ this.stepTo = function (steps)
{
var index = getWebNavigation().sessionHistory.index + steps;
@@ -413,7 +413,7 @@ vimperator.History = function() //{{{
}
}
- this.goToStart = function()
+ this.goToStart = function ()
{
var index = getWebNavigation().sessionHistory.index;
@@ -426,7 +426,7 @@ vimperator.History = function() //{{{
getWebNavigation().gotoIndex(0);
}
- this.goToEnd = function()
+ this.goToEnd = function ()
{
var index = getWebNavigation().sessionHistory.index;
var max = getWebNavigation().sessionHistory.count - 1;
@@ -440,7 +440,7 @@ vimperator.History = function() //{{{
getWebNavigation().gotoIndex(max);
}
- this.list = function(filter, fullmode)
+ this.list = function (filter, fullmode)
{
if (fullmode)
{
@@ -477,7 +477,7 @@ vimperator.History = function() //{{{
//}}}
} //}}}
-vimperator.Marks = function() //{{{
+vimperator.Marks = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -566,7 +566,7 @@ vimperator.Marks = function() //{{{
umarks.push([mark, url_marks[mark]]);
// FIXME: why does umarks.sort() cause a "Component is not available =
// NS_ERROR_NOT_AVAILABLE" exception when used here?
- umarks.sort(function(a, b) {
+ umarks.sort(function (a, b) {
if (a[0] < b[0])
return -1;
else if (a[0] > b[0])
@@ -583,7 +583,7 @@ vimperator.Marks = function() //{{{
/////////////////////////////////////////////////////////////////////////////{{{
// TODO: add support for frameset pages
- this.add = function(mark)
+ this.add = function (mark)
{
var win = window.content;
@@ -613,7 +613,7 @@ vimperator.Marks = function() //{{{
}
}
- this.remove = function(filter, special)
+ this.remove = function (filter, special)
{
if (special)
{
@@ -637,7 +637,7 @@ vimperator.Marks = function() //{{{
}
}
- this.jumpTo = function(mark)
+ this.jumpTo = function (mark)
{
var ok = false;
@@ -691,7 +691,7 @@ vimperator.Marks = function() //{{{
vimperator.echoerr("E20: Mark not set"); // FIXME: move up?
}
- this.list = function(filter)
+ this.list = function (filter)
{
var marks = getSortedMarks();
@@ -703,7 +703,7 @@ vimperator.Marks = function() //{{{
if (filter.length > 0)
{
- marks = marks.filter(function(mark) {
+ marks = marks.filter(function (mark) {
if (filter.indexOf(mark[0]) > -1)
return mark;
});
@@ -732,7 +732,7 @@ vimperator.Marks = function() //{{{
//}}}
} //}}}
-vimperator.QuickMarks = function() //{{{
+vimperator.QuickMarks = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -751,12 +751,12 @@ vimperator.QuickMarks = function() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
- this.add = function(qmark, location)
+ this.add = function (qmark, location)
{
qmarks[qmark] = location;
}
- this.remove = function(filter)
+ this.remove = function (filter)
{
var pattern = new RegExp("[" + filter.replace(/\s+/g, "") + "]");
@@ -767,12 +767,12 @@ vimperator.QuickMarks = function() //{{{
}
}
- this.removeAll = function()
+ this.removeAll = function ()
{
qmarks = {};
}
- this.jumpTo = function(qmark, where)
+ this.jumpTo = function (qmark, where)
{
var url = qmarks[qmark];
@@ -782,7 +782,7 @@ vimperator.QuickMarks = function() //{{{
vimperator.echoerr("E20: QuickMark not set");
}
- this.list = function(filter)
+ this.list = function (filter)
{
var marks = [];
@@ -799,7 +799,7 @@ vimperator.QuickMarks = function() //{{{
if (filter.length > 0)
{
- marks = marks.filter(function(mark) {
+ marks = marks.filter(function (mark) {
if (filter.indexOf(mark[0]) > -1)
return mark;
});
@@ -822,7 +822,7 @@ vimperator.QuickMarks = function() //{{{
vimperator.commandline.echo(list, vimperator.commandline.HL_NORMAL, vimperator.commandline.FORCE_MULTILINE);
}
- this.destroy = function()
+ this.destroy = function ()
{
// save the quickmarks
var saved_qmarks = "";
diff --git a/content/buffers.js b/content/buffers.js
index 5205547d..c00591bd 100644
--- a/content/buffers.js
+++ b/content/buffers.js
@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
-vimperator.Buffer = function() //{{{
+vimperator.Buffer = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -129,43 +129,43 @@ vimperator.Buffer = function() //{{{
this.lastInputField = null; // used to keep track of the right field for "gi"
- this.__defineGetter__("URL", function()
+ this.__defineGetter__("URL", function ()
{
// TODO: .URL is not defined for XUL documents
//return window.content.document.URL;
return window.content.document.location.href;
});
- this.__defineGetter__("pageHeight", function()
+ this.__defineGetter__("pageHeight", function ()
{
return window.content.innerHeight;
});
- this.__defineGetter__("textZoom", function()
+ this.__defineGetter__("textZoom", function ()
{
return getBrowser().mCurrentBrowser.markupDocumentViewer.textZoom * 100;
});
- this.__defineSetter__("textZoom", function(value)
+ this.__defineSetter__("textZoom", function (value)
{
setZoom(value, false);
});
- this.__defineGetter__("fullZoom", function()
+ this.__defineGetter__("fullZoom", function ()
{
return getBrowser().mCurrentBrowser.markupDocumentViewer.fullZoom * 100;
});
- this.__defineSetter__("fullZoom", function(value)
+ this.__defineSetter__("fullZoom", function (value)
{
setZoom(value, true);
});
- this.__defineGetter__("title", function()
+ this.__defineGetter__("title", function ()
{
return window.content.document.title;
});
// returns an XPathResult object
- this.evaluateXPath = function(expression, doc, elem, asIterator)
+ this.evaluateXPath = function (expression, doc, elem, asIterator)
{
if (!doc)
doc = window.content.document;
@@ -191,7 +191,7 @@ vimperator.Buffer = function() //{{{
// in contrast to vim, returns the selection if one is made,
// otherwise tries to guess the current word unter the text cursor
// NOTE: might change the selection
- this.getCurrentWord = function()
+ this.getCurrentWord = function ()
{
var selection = window.content.getSelection().toString();
@@ -211,7 +211,7 @@ vimperator.Buffer = function() //{{{
return selection;
}
- this.list = function(fullmode)
+ this.list = function (fullmode)
{
if (fullmode)
{
@@ -258,12 +258,12 @@ vimperator.Buffer = function() //{{{
}
}
- this.scrollBottom = function()
+ this.scrollBottom = function ()
{
scrollToPercentiles(-1, 100);
}
- this.scrollColumns = function(cols)
+ this.scrollColumns = function (cols)
{
var win = window.document.commandDispatcher.focusedWindow;
const COL_WIDTH = 20;
@@ -274,42 +274,42 @@ vimperator.Buffer = function() //{{{
win.scrollBy(COL_WIDTH * cols, 0);
}
- this.scrollEnd = function()
+ this.scrollEnd = function ()
{
scrollToPercentiles(100, -1);
}
- this.scrollLines = function(lines)
+ this.scrollLines = function (lines)
{
var win = window.document.commandDispatcher.focusedWindow;
checkScrollYBounds(win, lines);
win.scrollByLines(lines);
}
- this.scrollPages = function(pages)
+ this.scrollPages = function (pages)
{
var win = window.document.commandDispatcher.focusedWindow;
checkScrollYBounds(win, pages);
win.scrollByPages(pages);
}
- this.scrollToPercentile = function(percentage)
+ this.scrollToPercentile = function (percentage)
{
scrollToPercentiles(-1, percentage);
}
- this.scrollStart = function()
+ this.scrollStart = function ()
{
scrollToPercentiles(0, -1);
}
- this.scrollTop = function()
+ this.scrollTop = function ()
{
scrollToPercentiles(-1, 0);
}
// TODO: allow callback for filtering out unwanted frames? User defined?
- this.shiftFrameFocus = function(count, forward)
+ this.shiftFrameFocus = function (count, forward)
{
if (!window.content.document instanceof HTMLDocument)
return;
@@ -317,7 +317,7 @@ vimperator.Buffer = function() //{{{
var frames = [];
// find all frames - depth-first search
- (function(frame)
+ (function (frame)
{
if (frame.document.body.localName.toLowerCase() == "body")
frames.push(frame);
@@ -331,7 +331,7 @@ vimperator.Buffer = function() //{{{
// remove all unfocusable frames
// TODO: find a better way to do this - walking the tree is too slow
var start = document.commandDispatcher.focusedWindow;
- frames = frames.filter(function(frame) {
+ frames = frames.filter(function (frame) {
frame.focus();
if (document.commandDispatcher.focusedWindow == frame)
return frame;
@@ -404,11 +404,11 @@ vimperator.Buffer = function() //{{{
doc.body.appendChild(indicator);
// remove the frame indicator
- setTimeout(function() { doc.body.removeChild(indicator); }, 500);
+ setTimeout(function () { doc.body.removeChild(indicator); }, 500);
}
// updates the buffer preview in place only if list is visible
- this.updateBufferList = function()
+ this.updateBufferList = function ()
{
if (!vimperator.bufferwindow.visible())
return false;
@@ -421,7 +421,7 @@ vimperator.Buffer = function() //{{{
// XXX: should this be in v.buffers. or v.tabs.?
// "buffer" is a string which matches the URL or title of a buffer, if it
// is null, the last used string is used again
- this.switchTo = function(buffer, allowNonUnique, count, reverse)
+ this.switchTo = function (buffer, allowNonUnique, count, reverse)
{
if (buffer != null)
{
@@ -472,23 +472,23 @@ vimperator.Buffer = function() //{{{
index += matches.length;
}
else
- index = (count-1) % matches.length;
+ index = (count - 1) % matches.length;
vimperator.tabs.select(matches[index], false);
}
};
- this.zoomIn = function(steps, full_zoom)
+ this.zoomIn = function (steps, full_zoom)
{
bumpZoomLevel(steps, full_zoom);
};
- this.zoomOut = function(steps, full_zoom)
+ this.zoomOut = function (steps, full_zoom)
{
bumpZoomLevel(-steps, full_zoom);
};
- this.pageInfo = function(verbose)
+ this.pageInfo = function (verbose)
{
// TODO: copied from firefox. Needs some review/work...
// const feedTypes = {
diff --git a/content/commands.js b/content/commands.js
index c9731373..cab6939d 100644
--- a/content/commands.js
+++ b/content/commands.js
@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
-vimperator.Command = function(specs, action, extra_info) //{{{
+vimperator.Command = function (specs, action, extra_info) //{{{
{
if (!specs || !action)
return null;
@@ -34,7 +34,7 @@ vimperator.Command = function(specs, action, extra_info) //{{{
// convert command name abbreviation specs of the form
// 'shortname[optional-tail]' to short and long versions Eg. 'abc[def]' ->
// 'abc', 'abcdef'
- var parseSpecs = function(specs)
+ var parseSpecs = function (specs)
{
var short_names = [];
var long_names = [];
@@ -90,14 +90,14 @@ vimperator.Command = function(specs, action, extra_info) //{{{
}
-vimperator.Command.prototype.execute = function(args, special, count, modifiers)
+vimperator.Command.prototype.execute = function (args, special, count, modifiers)
{
return this.action.call(this, args, special, count, modifiers);
}
// return true if the candidate name matches one of the command's aliases
// (including all acceptable abbreviations)
-vimperator.Command.prototype.hasName = function(name)
+vimperator.Command.prototype.hasName = function (name)
{
// match a candidate name against a command name abbreviation spec - returning
// true if the candidate matches unambiguously
@@ -127,7 +127,7 @@ vimperator.Command.prototype.hasName = function(name)
}
//}}}
-vimperator.Commands = function() //{{{
+vimperator.Commands = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -148,7 +148,7 @@ vimperator.Commands = function() //{{{
function addDefaultCommand(command)
{
ex_commands.push(command);
- vimperator.Commands.prototype[command.name] = function(args, special, count, modifiers)
+ vimperator.Commands.prototype[command.name] = function (args, special, count, modifiers)
{
command.execute(args, special, count, modifiers);
}
@@ -452,12 +452,12 @@ vimperator.Commands = function() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
- this.__iterator__ = function()
+ this.__iterator__ = function ()
{
return commandsIterator();
}
- this.add = function(command)
+ this.add = function (command)
{
if (!command)
return false;
@@ -467,7 +467,7 @@ vimperator.Commands = function() //{{{
return true;
}
- this.get = function(name)
+ this.get = function (name)
{
for (var i = 0; i < ex_commands.length; i++)
{
@@ -482,7 +482,7 @@ vimperator.Commands = function() //{{{
// FIXME: doesn't really belong here...
// return [null, null, null, null, heredoc_tag || false];
// [count, cmd, special, args] = match;
- this.parseCommand = function(str, tag)
+ this.parseCommand = function (str, tag)
{
// remove comments
str.replace(/\s*".*$/, "");
@@ -526,14 +526,14 @@ vimperator.Commands = function() //{{{
/////////////////////////////////////////////////////////////////////////////{{{
addDefaultCommand(new vimperator.Command(["addo[ns]"],
- function() { vimperator.open("chrome://mozapps/content/extensions/extensions.xul", vimperator.NEW_TAB); },
+ function () { vimperator.open("chrome://mozapps/content/extensions/extensions.xul", vimperator.NEW_TAB); },
{
short_help: "Show available Browser Extensions and Themes",
help: "You can add/remove/disable browser extensions from this dialog.
Be aware that not all Firefox extensions work, because Vimperator overrides some key bindings and changes Firefox's GUI."
}
));
addDefaultCommand(new vimperator.Command(["ba[ck]"],
- function(args, special, count)
+ function (args, special, count)
{
if (special)
vimperator.history.goToStart();
@@ -559,7 +559,7 @@ vimperator.Commands = function() //{{{
short_help: "Go back in the browser history",
help: "Count is supported, :3back goes back 3 pages in the browser history.
" +
"The special version :back! goes to the beginning of the browser history.",
- completer: function(filter)
+ completer: function (filter)
{
var sh = getWebNavigation().sessionHistory;
var completions = [];
@@ -576,7 +576,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"],
- function(args, special, count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count > 0 ? count : 1, special, 0); },
+ function (args, special, count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count > 0 ? count : 1, special, 0); },
{
usage: ["[count]bd[elete][!]"],
short_help: "Delete current buffer (=tab)",
@@ -585,13 +585,13 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["beep"],
- function() { vimperator.beep(); },
+ function () { vimperator.beep(); },
{
short_help: "Play a system beep"
}
));
addDefaultCommand(new vimperator.Command(["bma[rk]"],
- function(args)
+ function (args)
{
var res = parseArgs(args, this.args);
if (!res)
@@ -620,11 +620,11 @@ vimperator.Commands = function() //{{{
" -keyword=keyword
",
args: [[["-title", "-t"], OPTION_STRING],
[["-tags", "-T"], OPTION_LIST],
- [["-keyword", "-k"], OPTION_STRING, function(arg) { return /\w/.test(arg); } ]]
+ [["-keyword", "-k"], OPTION_STRING, function (arg) { return /\w/.test(arg); } ]]
}
));
addDefaultCommand(new vimperator.Command(["bmarks"],
- function(args, special)
+ function (args, special)
{
var res = parseArgs(args, this.args);
if (!res)
@@ -640,12 +640,12 @@ vimperator.Commands = function() //{{{
"The special version :bmarks! opens the default Firefox bookmarks window.
" +
"Filter can also contain the following options:
" +
"-tags=comma,separated,tag,list
",
- completer: function(filter) { return vimperator.bookmarks.get(filter); },
+ completer: function (filter) { return vimperator.bookmarks.get(filter); },
args: [[["-tags", "-T"], OPTION_LIST]]
}
));
addDefaultCommand(new vimperator.Command(["b[uffer]"],
- function(args, special) { vimperator.buffer.switchTo(args, special); },
+ function (args, special) { vimperator.buffer.switchTo(args, special); },
{
usage: ["b[uffer][!] {url|index}"],
short_help: "Go to buffer from buffer list",
@@ -654,11 +654,11 @@ vimperator.Commands = function() //{{{
"it is selected. With [!] the next buffer matching the argument " +
"is selected, even if it cannot be identified uniquely.
" +
"Use b as a shortcut to open this prompt.",
- completer: function(filter) { return vimperator.completion.get_buffer_completions(filter); }
+ completer: function (filter) { return vimperator.completion.get_buffer_completions(filter); }
}
));
addDefaultCommand(new vimperator.Command(["buffers", "files", "ls", "tabs"],
- function(args, special)
+ function (args, special)
{
if (args)
{
@@ -676,7 +676,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["delbm[arks]"],
- function(args, special)
+ function (args, special)
{
var url = args;
if (!url)
@@ -693,11 +693,11 @@ vimperator.Commands = function() //{{{
"Use <Tab> key on a string to complete the URL which you want to delete.
" +
"The following options WILL be interpreted in the future:
" +
" [!] a special version to delete ALL bookmarks
",
- completer: function(filter) { return vimperator.bookmarks.get(filter); }
+ completer: function (filter) { return vimperator.bookmarks.get(filter); }
}
));
addDefaultCommand(new vimperator.Command(["com[mand]"],
- function(args)
+ function (args)
{
var res = parseArgs(args, this.args);
if (!res)
@@ -709,13 +709,13 @@ vimperator.Commands = function() //{{{
usage: ["com[mand][!] [{attr}...] {cmd} {rep}"],
short_help: "Temporarily used for testing args parser",
help: "",
- args: [[["-nargs"], OPTION_STRING, function(arg) { return /^(0|1|\*|\?|\+)$/.test(arg); } ],
+ args: [[["-nargs"], OPTION_STRING, function (arg) { return /^(0|1|\*|\?|\+)$/.test(arg); } ],
[["-bang"], OPTION_NOARG],
[["-bar"], OPTION_NOARG]]
}
));
addDefaultCommand(new vimperator.Command(["delm[arks]"],
- function(args, special)
+ function (args, special)
{
if (!special && !args)
{
@@ -768,7 +768,7 @@ vimperator.Commands = function() //{{{
));
addDefaultCommand(new vimperator.Command(["delqm[arks]"],
- function(args, special)
+ function (args, special)
{
// TODO: finish arg parsing - we really need a proper way to do this. :)
if (!special && !args)
@@ -797,7 +797,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["downl[oads]", "dl"],
- function() { vimperator.open("chrome://mozapps/content/downloads/downloads.xul", vimperator.NEW_TAB); },
+ function () { vimperator.open("chrome://mozapps/content/downloads/downloads.xul", vimperator.NEW_TAB); },
{
short_help: "Show progress of current downloads",
help: "Open the original Firefox download dialog in a new tab.
" +
@@ -833,7 +833,7 @@ vimperator.Commands = function() //{{{
return arg;
}
addDefaultCommand(new vimperator.Command(["ec[ho]"],
- function(args)
+ function (args)
{
var res = argToString(args, true);
if (res != null)
@@ -845,11 +845,11 @@ vimperator.Commands = function() //{{{
help: "Useful for showing informational messages. Multiple lines can be separated by \\n.
" +
"{expr} can either be a quoted string, or any expression which can be fed to eval() like 4+5. " +
"You can also view the source code of objects and functions if the return value of {expr} is an object or function.",
- completer: function(filter) { return vimperator.completion.javascript(filter); }
+ completer: function (filter) { return vimperator.completion.javascript(filter); }
}
));
addDefaultCommand(new vimperator.Command(["echoe[rr]"],
- function(args)
+ function (args)
{
var res = argToString(args, false);
if (res != null)
@@ -859,11 +859,11 @@ vimperator.Commands = function() //{{{
usage: ["echoe[rr] {expr}"],
short_help: "Display an error string at the bottom of the window",
help: "Just like :ec[ho], but echoes the result highlighted in red. Useful for showing important messages.",
- completer: function(filter) { return vimperator.completion.javascript(filter); }
+ completer: function (filter) { return vimperator.completion.javascript(filter); }
}
));
addDefaultCommand(new vimperator.Command(["exe[cute]"],
- function(args)
+ function (args)
{
// TODO: :exec has some difficult semantics -> later
// var res = parseArgs(args, this.args);
@@ -881,13 +881,13 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["exu[sage]"],
- function(args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
+ function (args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
{
short_help: "Show help for Ex commands"
}
));
addDefaultCommand(new vimperator.Command(["fo[rward]", "fw"],
- function(args, special, count)
+ function (args, special, count)
{
if (special)
vimperator.history.goToEnd();
@@ -913,7 +913,7 @@ vimperator.Commands = function() //{{{
short_help: "Go forward in the browser history",
help: "Count is supported, :3forward goes forward 3 pages in the browser history.
" +
"The special version :forward! goes to the end of the browser history.",
- completer: function(filter)
+ completer: function (filter)
{
var sh = getWebNavigation().sessionHistory;
var completions = [];
@@ -930,14 +930,14 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["ha[rdcopy]"],
- function() { getBrowser().contentWindow.print(); },
+ function () { getBrowser().contentWindow.print(); },
{
short_help: "Print current document",
help: "Open a GUI dialog where you can select the printer, number of copies, orientation, etc."
}
));
addDefaultCommand(new vimperator.Command(["h[elp]"],
- function(args, special, count, modifiers) { vimperator.help(args, special, null, modifiers); },
+ function (args, special, count, modifiers) { vimperator.help(args, special, null, modifiers); },
{
usage: ["h[elp] {subject}"],
short_help: "Open the help window",
@@ -949,21 +949,21 @@ vimperator.Commands = function() //{{{
"
:help o for mappings (no pre- or postfix):help he<Tab> completes :help :help.",
- completer: function(filter) { return vimperator.completion.get_help_completions(filter); }
+ completer: function (filter) { return vimperator.completion.get_help_completions(filter); }
}
));
addDefaultCommand(new vimperator.Command(["hist[ory]", "hs"],
- function(args, special) { vimperator.history.list(args, special); },
+ function (args, special) { vimperator.history.list(args, special); },
{
usage: ["hist[ory] [filter]", "history!"],
short_help: "Show recently visited URLs",
help: "Open the message window at the bottom of the screen with all history items which match [filter] either in the title or URL.:history! opens the default Firefox history window.",
- completer: function(filter) { return vimperator.history.get(filter); }
+ completer: function (filter) { return vimperator.history.get(filter); }
}
));
addDefaultCommand(new vimperator.Command(["javas[cript]", "js"],
- function(args, special)
+ function (args, special)
{
if (special) // open javascript console
vimperator.open("chrome://global/content/console.xul", vimperator.NEW_TAB);
@@ -974,7 +974,7 @@ vimperator.Commands = function() //{{{
if (matches && matches[2])
{
vimperator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),
- function(code) {
+ function (code) {
try
{
eval(matches[1] + "\n" + code);
@@ -1008,11 +1008,11 @@ vimperator.Commands = function() //{{{
"Rudimentary <Tab> completion is available for :javascript {cmd}<Tab> (but not yet for the " +
":js <<EOF multiline widget). Be aware that Vimperator needs to run {cmd} through eval() " +
"to get the completions, which could have unwanted side effects.",
- completer: function(filter) { return vimperator.completion.javascript(filter); }
+ completer: function (filter) { return vimperator.completion.javascript(filter); }
}
));
addDefaultCommand(new vimperator.Command(["let"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -1100,7 +1100,7 @@ vimperator.Commands = function() //{{{
));
// code for abbreviations
addDefaultCommand(new vimperator.Command(["ab[breviate]"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -1124,7 +1124,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["ca[bbrev]"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -1146,7 +1146,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["ia[bbrev]"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -1168,14 +1168,14 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["una[bbreviate]"],
- function(args) { vimperator.editor.removeAbbreviation("!", args); },
+ function (args) { vimperator.editor.removeAbbreviation("!", args); },
{
usage: ["una[bbreviate] {lhs}"],
short_help: "Remove an abbreviation"
}
));
addDefaultCommand(new vimperator.Command(["cuna[bbrev]"],
- function(args) { vimperator.editor.removeAbbreviation("c", args); },
+ function (args) { vimperator.editor.removeAbbreviation("c", args); },
{
usage: ["cuna[bbrev] {lhs}"],
short_help: "Remove an abbreviation for Command-line mode",
@@ -1183,7 +1183,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["iuna[bbrev]"],
- function(args) { vimperator.editor.removeAbbreviation("i", args); },
+ function (args) { vimperator.editor.removeAbbreviation("i", args); },
{
usage: ["iuna[bbrev] {lhs}"],
short_help: "Remove an abbreviation for Insert mode",
@@ -1191,15 +1191,15 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["ab[clear]"],
- function(args) { vimperator.editor.removeAllAbbreviations("!"); },
+ function (args) { vimperator.editor.removeAllAbbreviations("!"); },
{ short_help: "Remove all abbreviations" }
));
addDefaultCommand(new vimperator.Command(["cab[clear]"],
- function(args) { vimperator.editor.removeAllAbbreviations("c"); },
+ function (args) { vimperator.editor.removeAllAbbreviations("c"); },
{ short_help: "Remove all abbreviations for Command-line mode" }
));
addDefaultCommand(new vimperator.Command(["iab[clear]"],
- function(args) { vimperator.editor.removeAllAbbreviations("i"); },
+ function (args) { vimperator.editor.removeAllAbbreviations("i"); },
{ short_help: "Remove all abbreviations for Insert mode" }
));
// 0 args -> list all maps
@@ -1228,7 +1228,7 @@ vimperator.Commands = function() //{{{
if (rhs)
{
vimperator.mappings.add(new vimperator.Map([vimperator.modes.NORMAL], [lhs],
- function(count) { vimperator.events.feedkeys((count > 1 ? count : "") + rhs, noremap); },
+ function (count) { vimperator.events.feedkeys((count > 1 ? count : "") + rhs, noremap); },
{ flags: vimperator.Mappings.flags.COUNT, rhs: rhs }
));
}
@@ -1239,7 +1239,7 @@ vimperator.Commands = function() //{{{
}
}
addDefaultCommand(new vimperator.Command(["map"],
- function(args) { map(args, false) },
+ function (args) { map(args, false) },
{
usage: ["map {lhs} {rhs}", "map {lhs}", "map"],
short_help: "Map the key sequence {lhs} to {rhs}",
@@ -1248,7 +1248,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["mapc[lear]"],
- function(args)
+ function (args)
{
if (args)
{
@@ -1265,7 +1265,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["ma[rk]"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -1291,7 +1291,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["marks"],
- function(args)
+ function (args)
{
// ignore invalid mark characters unless there are no valid mark chars
if (args && !/[a-zA-Z]/.test(args))
@@ -1310,7 +1310,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["mkv[imperatorrc]"],
- function(args, special)
+ function (args, special)
{
// TODO: "E172: Only one file name allowed"
var filename;
@@ -1369,7 +1369,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["noh[lsearch]"],
- function(args)
+ function (args)
{
vimperator.search.clear();
},
@@ -1380,7 +1380,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["norm[al]"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -1398,7 +1398,7 @@ vimperator.Commands = function() //{{{
));
// TODO: remove duplication in :map
addDefaultCommand(new vimperator.Command(["no[remap]"],
- function(args) { map(args, true) },
+ function (args) { map(args, true) },
{
usage: ["no[remap] {lhs} {rhs}", "no[remap] {lhs}", "no[remap]"],
short_help: "Map the key sequence {lhs} to {rhs}",
@@ -1406,7 +1406,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["o[pen]", "e[dit]"],
- function(args, special)
+ function (args, special)
{
if (args)
{
@@ -1445,7 +1445,7 @@ vimperator.Commands = function() //{{{
"The items which are completed on <Tab> are specified in the 'complete' option.!, reloads the current page skipping the cache.",
- completer: function(filter) { return vimperator.completion.get_url_completions(filter); }
+ completer: function (filter) { return vimperator.completion.get_url_completions(filter); }
}
));
addDefaultCommand(new vimperator.Command(["pa[geinfo]"],
@@ -1456,13 +1456,13 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["pc[lose]"],
- function() { vimperator.previewwindow.hide(); },
+ function () { vimperator.previewwindow.hide(); },
{
short_help: "Close preview window on bottom of screen"
}
));
addDefaultCommand(new vimperator.Command(["pref[erences]", "prefs"],
- function(args, special, count, modifiers)
+ function (args, special, count, modifiers)
{
if (!args)
{
@@ -1494,7 +1494,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["qma[rk]"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -1518,7 +1518,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["qmarks"],
- function(args)
+ function (args)
{
// ignore invalid mark characters unless there are no valid mark chars
if (args && !/[a-zA-Z0-9]/.test(args))
@@ -1537,7 +1537,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["q[uit]"],
- function() { vimperator.tabs.remove(getBrowser().mCurrentTab, 1, false, 1); },
+ function () { vimperator.tabs.remove(getBrowser().mCurrentTab, 1, false, 1); },
{
short_help: "Quit current tab",
help: "If this is the last tab in the window, close the window. If this was the " +
@@ -1545,14 +1545,14 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["quita[ll]", "qa[ll]"],
- function() { vimperator.quit(false); },
+ function () { vimperator.quit(false); },
{
short_help: "Quit Vimperator",
help: "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored."
}
));
addDefaultCommand(new vimperator.Command(["redr[aw]"],
- function()
+ function ()
{
var wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
@@ -1564,7 +1564,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["re[load]"],
- function(args, special) { vimperator.tabs.reload(getBrowser().mCurrentTab, special); },
+ function (args, special) { vimperator.tabs.reload(getBrowser().mCurrentTab, special); },
{
usage: ["re[load][!]"],
short_help: "Reload current page",
@@ -1572,7 +1572,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["reloada[ll]"],
- function(args, special) { vimperator.tabs.reloadAll(special); },
+ function (args, special) { vimperator.tabs.reloadAll(special); },
{
usage: ["reloada[ll][!]"],
short_help: "Reload all pages",
@@ -1580,14 +1580,14 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["res[tart]"],
- function() { vimperator.restart(); },
+ function () { vimperator.restart(); },
{
short_help: "Force the browser to restart",
help: "Useful when installing extensions."
}
));
addDefaultCommand(new vimperator.Command(["sav[eas]", "w[rite]"],
- function() { saveDocument(window.content.document); },
+ function () { saveDocument(window.content.document); },
{
short_help: "Save current web page to disk",
help: "Opens the original Firefox \"Save page as...\" dialog.:set option+={value}, :set option^={value} and :set option-={value} " +
"adds/multiplies/subtracts {value} from a number option and appends/prepends/removes {value} from a string option.:set all shows the current value of all options and :set all& resets all options to their default values.{name} is any of the menu items listed under the standard Firefox View->Sidebar " +
"menu. Add-ons, Preferences and Downloads are also available in the sidebar.",
- completer: function(filter) { return vimperator.completion.get_sidebar_completions(filter); }
+ completer: function (filter) { return vimperator.completion.get_sidebar_completions(filter); }
}
));
addDefaultCommand(new vimperator.Command(["so[urce]"],
- function(args, special)
+ function (args, special)
{
// FIXME: implement proper filename quoting
//if (/[^\\]\s/.test(args))
@@ -1879,14 +1879,14 @@ vimperator.Commands = function() //{{{
short_help: "Read Ex commands from {file}",
help: "You can either source files which mostly contain Ex commands like map < gt " +
"and put JavaScript code within a:" +
- "js <<EOF
hello = function() {
alert(\"Hello world\");
}
EOF
section.function hello2() {
alert(\"Hello world\");
}
are only available within the scope of the script. ! is specified, errors are not printed.",
- completer: function(filter) { return vimperator.completion.get_file_completions(filter); }
+ completer: function (filter) { return vimperator.completion.get_file_completions(filter); }
}
));
addDefaultCommand(new vimperator.Command(["st[op]"],
@@ -1897,24 +1897,24 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["tab"],
- function(args) { vimperator.execute(args, { inTab: true }); },
+ function (args) { vimperator.execute(args, { inTab: true }); },
{
usage: ["tab {cmd}"],
short_help: "Execute {cmd} and tell it to output in a new tab",
help: "Works only for commands that support it, currently:" +
":open but open URLs in a new tab.!, the 'tabopen' value of the 'activate' option is negated.",
- completer: function(filter) { return vimperator.completion.get_url_completions(filter); }
+ completer: function (filter) { return vimperator.completion.get_url_completions(filter); }
}
));
addDefaultCommand(new vimperator.Command(["tabp[revious]", "tp[revious]", "tabN[ext]", "tN[ext]"],
// TODO: count support
- function(args)
+ function (args)
{
if (!args)
vimperator.tabs.select("-1", true);
@@ -1993,14 +1993,14 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["tabr[ewind]", "tabfir[st]"],
- function() { vimperator.tabs.select(0, false); },
+ function () { vimperator.tabs.select(0, false); },
{
usage: ["tabr[ewind]", "tabfir[st]"],
short_help: "Switch to the first tab"
}
));
addDefaultCommand(new vimperator.Command(["time"],
- function(args, special, count)
+ function (args, special, count)
{
try
{
@@ -2091,7 +2091,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["u[ndo]"],
- function(args, special, count)
+ function (args, special, count)
{
if (count < 1)
count = 1;
@@ -2116,7 +2116,7 @@ vimperator.Commands = function() //{{{
short_help: "Undo closing of a tab",
help: "If a count is given, don't close the last but the [count]th last tab. " +
"With [url] restores the tab matching the url.",
- completer: function(filter)
+ completer: function (filter)
{
// get closed-tabs from nsSessionStore
var ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
@@ -2135,7 +2135,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["undoa[ll]"],
- function(args, special, count)
+ function (args, special, count)
{
if (count > -1)
{
@@ -2159,7 +2159,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["unl[et]"],
- function(args, special)
+ function (args, special)
{
if (!args)
return vimperator.echoerr("E471: Argument required");
@@ -2188,7 +2188,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["unm[ap]"],
- function(args)
+ function (args)
{
if (!args)
{
@@ -2210,7 +2210,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["ve[rsion]"],
- function(args, special)
+ function (args, special)
{
if (special)
vimperator.open("about:");
@@ -2225,13 +2225,13 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["viu[sage]"],
- function(args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
+ function (args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
{
short_help: "Show help for normal mode commands"
}
));
addDefaultCommand(new vimperator.Command(["winc[lose]", "wc[lose]"],
- function(args)
+ function (args)
{
window.close();
},
@@ -2241,7 +2241,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["wino[pen]", "wo[pen]", "wine[dit]"],
- function(args)
+ function (args)
{
if (args)
vimperator.open(args, vimperator.NEW_WINDOW);
@@ -2255,7 +2255,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["wqa[ll]", "wq", "xa[ll]"],
- function() { vimperator.quit(true); },
+ function () { vimperator.quit(true); },
{
usage: ["wqa[ll]", "xa[ll]"],
short_help: "Save the session and quit",
@@ -2264,7 +2264,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["zo[om]"],
- function(args, special)
+ function (args, special)
{
var level;
@@ -2309,7 +2309,7 @@ vimperator.Commands = function() //{{{
}
));
addDefaultCommand(new vimperator.Command(["!", "run"],
- function(args, special)
+ function (args, special)
{
// :!! needs to be treated specially as the command parser sets the special flag but removes the ! from args
if (special)
diff --git a/content/completion.js b/content/completion.js
index e6a037bf..8eeeca25 100644
--- a/content/completion.js
+++ b/content/completion.js
@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
-vimperator.Completion = function() // {{{
+vimperator.Completion = function () // {{{
{
// The completion substrings, used for showing the longest common match
var g_substrings = [];
@@ -63,7 +63,7 @@ vimperator.Completion = function() // {{{
}
else
{
- g_substrings = g_substrings.filter(function($_) {
+ g_substrings = g_substrings.filter(function ($_) {
return list[i][0][j].indexOf($_) >= 0;
});
}
@@ -93,7 +93,7 @@ vimperator.Completion = function() // {{{
}
else
{
- g_substrings = g_substrings.filter(function($_) {
+ g_substrings = g_substrings.filter(function ($_) {
return list[i][0][j].indexOf($_) == 0;
});
}
@@ -109,7 +109,7 @@ vimperator.Completion = function() // {{{
* returns the longest common substring
* used for the 'longest' setting for wildmode
*/
- get_longest_substring: function() //{{{
+ get_longest_substring: function () //{{{
{
if (g_substrings.length == 0)
return "";
@@ -130,7 +130,7 @@ vimperator.Completion = function() // {{{
* depending on the 'complete' option
* if the 'complete' argument is passed like "h", it temporarily overrides the complete option
*/
- get_url_completions: function(filter, complete) //{{{
+ get_url_completions: function (filter, complete) //{{{
{
var completions = [];
g_substrings = [];
@@ -152,21 +152,21 @@ vimperator.Completion = function() // {{{
return completions;
}, //}}}
- get_search_completions: function(filter) //{{{
+ get_search_completions: function (filter) //{{{
{
var engines = vimperator.bookmarks.getSearchEngines().concat(vimperator.bookmarks.getKeywords());
- if (!filter) return engines.map(function(engine) {
+ if (!filter) return engines.map(function (engine) {
return [engine[0], engine[1]];
});
- var mapped = engines.map(function(engine) {
+ var mapped = engines.map(function (engine) {
return [[engine[0]], engine[1]];
});
return build_longest_common_substring(mapped, filter);
}, //}}}
// TODO: support file:// and \ or / path separators on both platforms
- get_file_completions: function(filter)
+ get_file_completions: function (filter)
{
// this is now also used as part of the url completion, so the
// substrings shouldn't be cleared for that case
@@ -185,7 +185,7 @@ vimperator.Completion = function() // {{{
try
{
files = vimperator.io.readDirectory(dir);
- mapped = files.map(function(file) {
+ mapped = files.map(function (file) {
return [[file.path], file.isDirectory() ? "Directory" : "File"];
});
}
@@ -198,7 +198,7 @@ vimperator.Completion = function() // {{{
return build_longest_starting_substring(mapped, filter);
},
- get_help_completions: function(filter) //{{{
+ get_help_completions: function (filter) //{{{
{
var help_array = [[["introduction"], "Introductory text"],
[["initialization"], "Initialization and startup"],
@@ -207,25 +207,25 @@ vimperator.Completion = function() // {{{
[["options"], "Configuration options"]]; // TODO: hardcoded until we have proper 'pages'
g_substrings = [];
for (var command in vimperator.commands)
- help_array.push([command.long_names.map(function($_) { return ":" + $_; }), command.short_help]);
+ help_array.push([command.long_names.map(function ($_) { return ":" + $_; }), command.short_help]);
options = this.get_options_completions(filter, true);
- help_array = help_array.concat(options.map(function($_) {
+ help_array = help_array.concat(options.map(function ($_) {
return [
- $_[0].map(function($_) { return "'" + $_ + "'"; }),
+ $_[0].map(function ($_) { return "'" + $_ + "'"; }),
$_[1]
];
}));
for (var map in vimperator.mappings)
help_array.push([map.names, map.short_help]);
- if (!filter) return help_array.map(function($_) {
+ if (!filter) return help_array.map(function ($_) {
return [$_[0][0], $_[1]]; // unfiltered, use the first command
});
return build_longest_common_substring(help_array, filter);
}, //}}}
- get_command_completions: function(filter) //{{{
+ get_command_completions: function (filter) //{{{
{
g_substrings = [];
var completions = [];
@@ -241,7 +241,7 @@ vimperator.Completion = function() // {{{
return build_longest_starting_substring(completions, filter);
}, //}}}
- get_options_completions: function(filter, unfiltered) //{{{
+ get_options_completions: function (filter, unfiltered) //{{{
{
g_substrings = [];
var options_completions = [];
@@ -308,7 +308,7 @@ vimperator.Completion = function() // {{{
}
else
{
- g_substrings = g_substrings.filter(function($_) {
+ g_substrings = g_substrings.filter(function ($_) {
return option.names[j].indexOf($_) == 0;
});
}
@@ -320,7 +320,7 @@ vimperator.Completion = function() // {{{
return options_completions;
}, //}}}
- get_buffer_completions: function(filter) //{{{
+ get_buffer_completions: function (filter) //{{{
{
g_substrings = [];
var items = [];
@@ -350,13 +350,13 @@ vimperator.Completion = function() // {{{
items.push([[(i + 1) + ": " + title, (i + 1) + ": " + url], url]);
}
}
- if (!filter) return items.map(function($_) {
+ if (!filter) return items.map(function ($_) {
return [$_[0][0], $_[1]];
});
return build_longest_common_substring(items, filter);
}, //}}}
- get_sidebar_completions: function(filter) //{{{
+ get_sidebar_completions: function (filter) //{{{
{
g_substrings = [];
var menu = document.getElementById("viewSidebarMenu")
@@ -368,20 +368,20 @@ vimperator.Completion = function() // {{{
if (!filter)
return nodes;
- var mapped = nodes.map(function(node) {
+ var mapped = nodes.map(function (node) {
return [[node[0]], node[1]];
});
-
+
return build_longest_common_substring(mapped, filter);
}, //}}}
- javascript: function(str) // {{{
+ javascript: function (str) // {{{
{
g_substrings = [];
var matches = str.match(/^(.*?)(\s*\.\s*)?(\w*)$/);
var object = "window";
var filter = matches[3] || "";
- var start = matches[1].length-1;
+ var start = matches[1].length - 1;
if (matches[2])
{
var brackets = 0, parentheses = 0;
@@ -413,7 +413,7 @@ vimperator.Completion = function() // {{{
}
object = matches[1].substr(start+1) || "window";
- var completions = [];
+ var completions = [];
try
{
completions = eval(
@@ -449,7 +449,7 @@ vimperator.Completion = function() // {{{
// discard all entries in the 'urls' array, which don't match 'filter
// urls must be of type [["url", "title"], [...]] or optionally
// [["url", "title", keyword, [tags]], [...]]
- filterURLArray: function(urls, filter, tags) //{{{
+ filterURLArray: function (urls, filter, tags) //{{{
{
var filtered = [];
// completions which don't match the url but just the description
@@ -474,7 +474,7 @@ vimperator.Completion = function() // {{{
if (ignorecase)
{
filter = filter.toLowerCase();
- tags = tags.map(function(t) { return t.toLowerCase(); });
+ tags = tags.map(function (t) { return t.toLowerCase(); });
}
/*
@@ -493,7 +493,7 @@ vimperator.Completion = function() // {{{
{
url = url.toLowerCase();
title = title.toLowerCase();
- tag = tag.map(function(t) { return t.toLowerCase(); });
+ tag = tag.map(function (t) { return t.toLowerCase(); });
}
// filter on tags
@@ -510,7 +510,7 @@ vimperator.Completion = function() // {{{
{
// no direct match of filter in the url, but still accept this item
// if _all_ tokens of filter match either the url or the title
- if (filter.split(/\s+/).every(function(token) {
+ if (filter.split(/\s+/).every(function (token) {
return (url.indexOf(token) > -1 || title.indexOf(token) > -1);
}))
additional_completions.push(urls[i]);
@@ -534,7 +534,7 @@ vimperator.Completion = function() // {{{
}
else
{
- g_substrings = g_substrings.filter(function($_) {
+ g_substrings = g_substrings.filter(function ($_) {
return url.indexOf($_) >= 0;
});
}
@@ -547,7 +547,7 @@ vimperator.Completion = function() // {{{
// generic helper function which checks if the given "items" array pass "filter"
// items must be an array of strings
- match: function(items, filter, case_sensitive)
+ match: function (items, filter, case_sensitive)
{
if (typeof(filter) != "string" || !items)
return false;
@@ -559,13 +559,13 @@ vimperator.Completion = function() // {{{
items_str = items_str.toLowerCase();
}
- if (filter.split(/\s+/).every(function(str) { return items_str.indexOf(str) > -1; }))
+ if (filter.split(/\s+/).every(function (str) { return items_str.indexOf(str) > -1; }))
return true;
return false;
},
- exTabCompletion: function(str) //{{{
+ exTabCompletion: function (str) //{{{
{
var [count, cmd, special, args] = vimperator.commands.parseCommand(str);
var completions = [];
diff --git a/content/editor.js b/content/editor.js
index 3f6aa338..0008e506 100644
--- a/content/editor.js
+++ b/content/editor.js
@@ -29,7 +29,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
// command names taken from:
// http://developer.mozilla.org/en/docs/Editor_Embedding_Guide
-vimperator.Editor = function() //{{{
+vimperator.Editor = function () //{{{
{
// store our last search with f, F, t or T
var last_findChar = null;
@@ -50,7 +50,7 @@ vimperator.Editor = function() //{{{
return ed.controllers.getControllerForCommand("cmd_beginLine");
}
- this.line = function()
+ this.line = function ()
{
var line = 1;
var text = editor().value;
@@ -60,7 +60,7 @@ vimperator.Editor = function() //{{{
return line;
}
- this.col = function()
+ this.col = function ()
{
var col = 1;
var text = editor().value;
@@ -73,20 +73,20 @@ vimperator.Editor = function() //{{{
return col;
}
- this.unselectText = function()
+ this.unselectText = function ()
{
var elt = window.document.commandDispatcher.focusedElement;
if (elt && elt.selectionEnd)
elt.selectionEnd = elt.selectionStart;
}
- this.selectedText = function()
+ this.selectedText = function ()
{
var text = editor().value;
return text.substring(editor().selectionStart, editor().selectionEnd);
}
- this.pasteClipboard = function()
+ this.pasteClipboard = function ()
{
var elt = window.document.commandDispatcher.focusedElement;
@@ -106,7 +106,7 @@ vimperator.Editor = function() //{{{
}
// count is optional, defaults to 1
- this.executeCommand = function(cmd, count)
+ this.executeCommand = function (cmd, count)
{
var controller = getController();
if (!controller || !controller.supportsCommand(cmd) || !controller.isCommandEnabled(cmd))
@@ -142,7 +142,7 @@ vimperator.Editor = function() //{{{
// cmd = y, d, c
// motion = b, 0, gg, G, etc.
- this.executeCommandWithMotion = function(cmd, motion, count)
+ this.executeCommandWithMotion = function (cmd, motion, count)
{
if (!typeof count == "number" || count < 1)
count = 1;
@@ -229,7 +229,7 @@ vimperator.Editor = function() //{{{
// Simple setSelectionRange() would be better, but we want to maintain the correct
// order of selectionStart/End (a firefox bug always makes selectionStart <= selectionEnd)
// Use only for small movements!
- this.moveToPosition = function(pos, forward, select)
+ this.moveToPosition = function (pos, forward, select)
{
if (!select)
{
@@ -262,7 +262,7 @@ vimperator.Editor = function() //{{{
}
// returns the position of char
- this.findCharForward = function(char, count)
+ this.findCharForward = function (char, count)
{
if (!editor())
return -1;
@@ -288,7 +288,7 @@ vimperator.Editor = function() //{{{
return -1;
}
// returns the position of char
- this.findCharBackward = function(char, count)
+ this.findCharBackward = function (char, count)
{
if (!editor())
return -1;
@@ -314,7 +314,7 @@ vimperator.Editor = function() //{{{
return -1;
}
- this.editWithExternalEditor = function()
+ this.editWithExternalEditor = function ()
{
var textBox = document.commandDispatcher.focusedElement;
var editor = vimperator.options["editor"];
@@ -380,11 +380,11 @@ vimperator.Editor = function() //{{{
// blink the textbox after returning
var timeout = 100;
textBox.style.backgroundColor = tmpBg;
- setTimeout( function() {
+ setTimeout( function () {
textBox.style.backgroundColor = oldBg;
- setTimeout( function() {
+ setTimeout( function () {
textBox.style.backgroundColor = tmpBg;
- setTimeout( function() {
+ setTimeout( function () {
textBox.style.backgroundColor = oldBg;
}, timeout);
}, timeout);
@@ -397,9 +397,9 @@ vimperator.Editor = function() //{{{
this.abbreviations = {};
this.abbreviations.__iterator__ = function ()
- {
+ {
var tmpCmd;
- for (var lhs in abbrev)
+ for (var lhs in abbrev)
{
for (var i = 0; i < abbrev[lhs].length; i++)
{
@@ -410,7 +410,7 @@ vimperator.Editor = function() //{{{
}
// filter is i, c or "!" (insert or command abbreviations or both)
- this.listAbbreviations = function(filter, lhs)
+ this.listAbbreviations = function (filter, lhs)
{
if (lhs) // list only that one
{
@@ -425,7 +425,7 @@ vimperator.Editor = function() //{{{
}
vimperator.echoerr("No abbreviations found");
return false;
- }
+ }
else // list all (for that filter {i,c,!})
{
var flagFound = false;
@@ -459,7 +459,7 @@ vimperator.Editor = function() //{{{
}
}
- this.addAbbreviation = function(filter, lhs, rhs)
+ this.addAbbreviation = function (filter, lhs, rhs)
{
if (!abbrev[lhs])
{
@@ -523,8 +523,8 @@ vimperator.Editor = function() //{{{
// if filter == ! remove all and add it as only END
//
// variant 1: rhs matches anywere in loop
- //
- // 1 mod matches anywhere in loop
+ //
+ // 1 mod matches anywhere in loop
// a) simple replace and
// I) (maybe there's another rhs that matches? not possible)
// (when there's another item, it's opposite mod with different rhs)
@@ -533,7 +533,7 @@ vimperator.Editor = function() //{{{
// 2 mod does not match
// a) the opposite is there -> make a ! and put it as only and END
// (b) a ! is there. do nothing END)
- //
+ //
// variant 2: rhs matches *no*were in loop and filter is c or i
// everykind of current combo is possible to 1 {c,i,!} or two {c and i}
//
@@ -543,7 +543,7 @@ vimperator.Editor = function() //{{{
//
}
- this.removeAbbreviation = function(filter, lhs)
+ this.removeAbbreviation = function (filter, lhs)
{
if (!lhs)
{
@@ -568,7 +568,7 @@ vimperator.Editor = function() //{{{
return true;
}
else if (abbrev[lhs][0][0] == filter)
- {
+ {
abbrev[lhs] = "";
return true;
}
@@ -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;
}
@@ -589,7 +589,7 @@ vimperator.Editor = function() //{{{
return false;
}
- this.removeAllAbbreviations = function(filter)
+ this.removeAllAbbreviations = function (filter)
{
if (filter == "!")
{
@@ -608,7 +608,7 @@ vimperator.Editor = function() //{{{
}
}
- this.expandAbbreviation = function(filter) // try to find an candidate and replace accordingly
+ this.expandAbbreviation = function (filter) // try to find an candidate and replace accordingly
{
var textbox = editor();
var text = textbox.value;
@@ -617,7 +617,7 @@ vimperator.Editor = function() //{{{
var foundWord = text.substring(0, currStart).replace(/^(.|\n)*?(\S+)$/m, "$2"); // get last word \b word boundary
if (!foundWord)
return true;
-
+
for (var lhs in abbrev)
{
for (var i = 0; i < abbrev[lhs].length; i++)
diff --git a/content/events.js b/content/events.js
index bf3cde7c..7da34154 100644
--- a/content/events.js
+++ b/content/events.js
@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
-vimperator.Events = function() //{{{
+vimperator.Events = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -35,23 +35,23 @@ vimperator.Events = function() //{{{
// this handler is for middle click only in the content
//window.addEventListener("mousedown", onVimperatorKeypress, true);
//content.mPanelContainer.addEventListener("mousedown", onVimperatorKeypress, true);
- //document.getElementById("content").onclick = function(event) { alert("foo"); };
+ //document.getElementById("content").onclick = function (event) { alert("foo"); };
// any tab related events
var tabcontainer = getBrowser().tabContainer;
- tabcontainer.addEventListener("TabMove", function(event) {
+ tabcontainer.addEventListener("TabMove", function (event) {
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
- tabcontainer.addEventListener("TabOpen", function(event) {
+ tabcontainer.addEventListener("TabOpen", function (event) {
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
- tabcontainer.addEventListener("TabClose", function(event) {
+ tabcontainer.addEventListener("TabClose", function (event) {
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
- tabcontainer.addEventListener("TabSelect", function(event) {
+ tabcontainer.addEventListener("TabSelect", function (event) {
if (vimperator.mode == vimperator.modes.HINTS)
vimperator.modes.reset();
@@ -61,7 +61,7 @@ vimperator.Events = function() //{{{
vimperator.buffer.updateBufferList();
vimperator.tabs.updateSelectionHistory();
- setTimeout(function() { vimperator.focusContent(true); }, 10); // just make sure, that no widget has focus
+ setTimeout(function () { vimperator.focusContent(true); }, 10); // just make sure, that no widget has focus
}, false);
// this adds an event which is is called on each page load, even if the
@@ -107,7 +107,7 @@ vimperator.Events = function() //{{{
window.addEventListener("DOMMenuBarActive", enterMenuMode, true);
window.addEventListener("DOMMenuBarInactive", exitMenuMode, true);
- // window.document.addEventListener("DOMTitleChanged", function(event)
+ // window.document.addEventListener("DOMTitleChanged", function (event)
// {
// vimperator.log("titlechanged");
// }, null);
@@ -231,7 +231,7 @@ vimperator.Events = function() //{{{
// // FIXME: this currently causes window map events which is _very_ annoying
// // we want to stay in command mode after a page has loaded
// //setTimeout(vimperator.focusContent, 10);
- // // setTimeout(function() {
+ // // setTimeout(function () {
// // if (doc.commandDispatcher.focusedElement)
// // doc.commandDispatcher.focusedElement.blur();
// // alert(doc.commandDispatcher.focusedElement);
@@ -246,7 +246,7 @@ vimperator.Events = function() //{{{
/////////////////////////////////////////////////////////////////////////////{{{
this.wantsModeReset = true; // used in onFocusChange since Firefox is so buggy here
- this.destroy = function()
+ this.destroy = function ()
{
// removeEventListeners() to avoid mem leaks
window.dump("TODO: remove all eventlisteners\n");
@@ -268,7 +268,7 @@ vimperator.Events = function() //{{{
//
// @param keys: a string like "2

First there was a Navigator, then there was an Explorer.\n' + 'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)
'; @@ -255,7 +255,7 @@ vimperator.help = function(section, easter) //{{{ } // FIXME - setTimeout(function() { + setTimeout(function () { if (section) { function findSectionElement(section) diff --git a/content/hints.js b/content/hints.js index 1fa14487..be374b3e 100644 --- a/content/hints.js +++ b/content/hints.js @@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under the terms of any one of the MPL, the GPL or the LGPL. }}} ***** END LICENSE BLOCK *****/ -vimperator.Hints = function() //{{{ +vimperator.Hints = function () //{{{ { var submode = ""; // used for extended mode, can be "o", "t", "y", etc. var hintString = ""; // the typed string part of the hint is in this string @@ -36,14 +36,14 @@ vimperator.Hints = function() //{{{ // hints[] = [elem, text, span, imgspan, elem.style.backgroundColor, elem.style.color] var hints = []; var valid_hints = []; // store the indices of the "hints" array with valid elements - + var escapeNumbers = false ; // escape mode for numbers. true -> treated as hint-text var activeTimeout = null; // needed for hinttimeout > 0 var canUpdate = false; // keep track of the documents which we generated the hints for // docs = { doc: document, start: start_index in hints[], end: end_index in hints[] } - var docs = []; + var docs = []; // reset all important variables function reset() @@ -173,7 +173,7 @@ vimperator.Hints = function() //{{{ vimperator.echoerr(e); } } - + function generate(win) { var startDate = Date.now(); @@ -383,13 +383,13 @@ vimperator.Hints = function() //{{{ // USE THIS FOR MAKING THE SELECTED ELEM RED // firstElem.style.backgroundColor = "red"; // firstElem.style.color = "white"; - // setTimeout(function() { + // setTimeout(function () { // firstElem.style.backgroundColor = firstElemBgColor; // firstElem.style.color = firstElemColor; // }, 200); // OR USE THIS FOR BLINKING: // var counter = 0; - // var id = setInterval(function() { + // var id = setInterval(function () { // firstElem.style.backgroundColor = "red"; // if (counter % 2 == 0) // firstElem.style.backgroundColor = "yellow"; @@ -403,7 +403,7 @@ vimperator.Hints = function() //{{{ // clearTimeout(id); // } // }, 100); - setTimeout(function() { + setTimeout(function () { firstElem.style.backgroundColor = firstElemBgColor; firstElem.style.color = firstElemColor; }, timeout); @@ -427,7 +427,7 @@ vimperator.Hints = function() //{{{ var first_href = valid_hints[0].getAttribute("href") || null; if (first_href) { - if (valid_hints.some( function(e) { return e.getAttribute("href") != first_href; } )) + if (valid_hints.some( function (e) { return e.getAttribute("href") != first_href; } )) return false; } else if (valid_hints.length > 1) @@ -458,7 +458,7 @@ vimperator.Hints = function() //{{{ if (vimperator.modes.extended & vimperator.modes.ALWAYS_HINT) { - setTimeout(function() { + setTimeout(function () { canUpdate = true; hintString = ""; hintNumber = 0; @@ -467,7 +467,7 @@ vimperator.Hints = function() //{{{ } else { - setTimeout( function() { + setTimeout( function () { if (vimperator.mode == vimperator.modes.HINTS) vimperator.modes.reset(false); }, timeout); @@ -481,7 +481,7 @@ vimperator.Hints = function() //{{{ //////////////////////////////////////////////////////////////////////////////// // TODO: implement framesets - this.show = function(mode, minor, filter) + this.show = function (mode, minor, filter) { if (mode == vimperator.modes.EXTENDED_HINT && !/^[;asoOtTwWyY]$/.test(minor)) { @@ -501,7 +501,7 @@ vimperator.Hints = function() //{{{ var mt = Components.classes["@mozilla.org/thread-manager;1"].getService().mainThread; while (mt.hasPendingEvents()) mt.processNextEvent(true); - + canUpdate = true; showHints(); @@ -520,12 +520,12 @@ vimperator.Hints = function() //{{{ return true; }; - this.hide = function() + this.hide = function () { removeHints(0); }; - this.onEvent = function(event) + this.onEvent = function (event) { var key = vimperator.events.toString(event); var followFirst = false; @@ -598,7 +598,7 @@ vimperator.Hints = function() //{{{ escapeNumbers = !escapeNumbers; if (escapeNumbers && usedTabKey) // hintNumber not used normally, but someone may wants to toggle hintNumber = 0; //:help <F1>."
@@ -344,14 +344,14 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map(any_non_insertmode, [":"],
- function() { vimperator.commandline.open(":", "", vimperator.modes.EX); },
+ function () { vimperator.commandline.open(":", "", vimperator.modes.EX); },
{
short_help: "Start command line mode",
help: "In command line mode, you can perform extended commands, which may require arguments."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["i", "<Esc> and pass them to the next event handler.<C-v>.[count]th next frame in order. The newly focused frame is briefly colored red. Does not wrap.",
@@ -407,7 +407,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["[f"],
- function(count) { vimperator.buffer.shiftFrameFocus(count > 1 ? count : 1, false); },
+ function (count) { vimperator.buffer.shiftFrameFocus(count > 1 ? count : 1, false); },
{
short_help: "Focus previous frame",
help: "Transfers keyboard focus to the [count]th previous frame in order. The newly focused frame is briefly colored red. Does not wrap.",
@@ -415,14 +415,14 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["b"],
- function() { vimperator.commandline.open(":", "buffer! ", vimperator.modes.EX); },
+ function () { vimperator.commandline.open(":", "buffer! ", vimperator.modes.EX); },
{
short_help: "Open a prompt to switch buffers",
help: "Typing the corresponding number switches to this buffer."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["B"],
- function() { vimperator.buffer.list(true); },
+ function () { vimperator.buffer.list(true); },
{
short_help: "Toggle buffer list",
help: "Toggles the display of the buffer list which shows all opened tabs.gb but in the other direction.",
@@ -446,7 +446,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["d"],
- function(count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, false, 0); },
+ function (count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, false, 0); },
{
short_help: "Delete current buffer (=tab)",
help: "Count is supported, 2d removes the current and next tab and the one to the right is selected. " +
@@ -455,7 +455,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["D"],
- function(count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, true, 0); },
+ function (count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, true, 0); },
{
short_help: "Delete current buffer (=tab)",
help: "Count is supported, 2D removes the current and previous tab and the one to the left is selected. " +
@@ -471,7 +471,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gH"],
- function()
+ function ()
{
var homepages = gHomeButton.getHomePage();
vimperator.open(homepages, /\bhomepage\b/.test(vimperator.options["activate"]) ?
@@ -484,7 +484,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gi"],
- function()
+ function ()
{
if (vimperator.buffer.lastInputField)
vimperator.buffer.lastInputField.focus();
@@ -496,7 +496,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["go"],
- function(arg) { vimperator.quickmarks.jumpTo(arg, vimperator.CURRENT_TAB); },
+ function (arg) { vimperator.quickmarks.jumpTo(arg, vimperator.CURRENT_TAB); },
{
short_help: "Jump to a QuickMark in the current tab",
usage: ["go{a-zA-Z0-9}"],
@@ -506,7 +506,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gn"],
- function(arg)
+ function (arg)
{
vimperator.quickmarks.jumpTo(arg,
/\bquickmark\b/.test(vimperator.options["activate"]) ?
@@ -522,7 +522,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gP"],
- function()
+ function ()
{
vimperator.open(readFromClipboard(),
/\bpaste\b/.test(vimperator.options["activate"]) ?
@@ -534,7 +534,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gt", "3gt goes to the third tab.",
@@ -542,7 +542,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gT", "3gT goes three tabs back.",
@@ -550,7 +550,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [":open for more details."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["O"],
- function() { vimperator.commandline.open(":", "open " + vimperator.buffer.URL, vimperator.modes.EX); },
+ function () { vimperator.commandline.open(":", "open " + vimperator.buffer.URL, vimperator.modes.EX); },
{
short_help: "Open one or more URLs in the current tab, based on current location",
help: "Works like o, but preselects current URL in the :open query."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["p", "'defsearch' option) with p."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["P"],
- function()
+ function ()
{
vimperator.open(readFromClipboard(),
/\bpaste\b/.test(vimperator.options["activate"]) ?
@@ -657,7 +657,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [":redraw.",
@@ -665,21 +665,21 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["r"],
- function() { vimperator.tabs.reload(getBrowser().mCurrentTab, false); },
+ function () { vimperator.tabs.reload(getBrowser().mCurrentTab, false); },
{
short_help: "Reload",
help: "Forces reloading of the current page."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["R"],
- function() { vimperator.tabs.reload(getBrowser().mCurrentTab, true); },
+ function () { vimperator.tabs.reload(getBrowser().mCurrentTab, true); },
{
short_help: "Reload while skipping the cache",
help: "Forces reloading of the current page skipping the cache."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["t"],
- function() { vimperator.commandline.open(":", "tabopen ", vimperator.modes.EX); },
+ function () { vimperator.commandline.open(":", "tabopen ", vimperator.modes.EX); },
{
short_help: "Open one or more URLs in a new tab",
help: "Like o but open URLs in a new tab.t, but preselects current URL in the :tabopen query."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["u"],
- function(count) { vimperator.commands.undo("", false, count); },
+ function (count) { vimperator.commands.undo("", false, count); },
{
short_help: "Undo closing of a tab",
help: "If a count is given, don't close the last but the [count]th last tab.",
@@ -702,7 +702,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["y"],
- function()
+ function ()
{
var url = vimperator.buffer.URL;
vimperator.copyToClipboard(url);
@@ -714,7 +714,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["Y"],
- function()
+ function ()
{
var sel = window.content.document.getSelection();
vimperator.copyToClipboard(sel);
@@ -726,7 +726,7 @@ vimperator.Mappings = function() //{{{
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zi", "+"],
- function(count) { vimperator.buffer.zoomIn(count > 1 ? count : 1, false); },
+ function (count) { vimperator.buffer.zoomIn(count > 1 ? count : 1, false); },
{
short_help: "Enlarge text zoom of current web page",
help: "Mnemonic: zoom in",
@@ -734,7 +734,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zm"],
- function(count) { vimperator.buffer.zoomIn((count > 1 ? count : 1) * 3, false); },
+ function (count) { vimperator.buffer.zoomIn((count > 1 ? count : 1) * 3, false); },
{
short_help: "Enlarge text zoom of current web page by a larger amount",
help: "Mnemonic: zoom more",
@@ -742,7 +742,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zo", "-"],
- function(count) { vimperator.buffer.zoomOut(count > 1 ? count : 1, false); },
+ function (count) { vimperator.buffer.zoomOut(count > 1 ? count : 1, false); },
{
short_help: "Reduce text zoom of current web page",
help: "Mnemonic: zoom out",
@@ -750,7 +750,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zr"],
- function(count) { vimperator.buffer.zoomOut((count > 1 ? count : 1) * 3, false); },
+ function (count) { vimperator.buffer.zoomOut((count > 1 ? count : 1) * 3, false); },
{
short_help: "Reduce text zoom of current web page by a larger amount",
help: "Mnemonic: zoom reduce",
@@ -758,7 +758,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zz"],
- function(count) { vimperator.buffer.textZoom = count > 1 ? count : 100; },
+ function (count) { vimperator.buffer.textZoom = count > 1 ? count : 100; },
{
short_help: "Set text zoom value of current web page",
help: "Zoom value can be between 1 and 2000%. If it is omitted, text zoom is reset to 100%.",
@@ -766,7 +766,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zI"],
- function(count) { vimperator.buffer.zoomIn(count > 1 ? count : 1, true); },
+ function (count) { vimperator.buffer.zoomIn(count > 1 ? count : 1, true); },
{
short_help: "Enlarge full zoom of current web page",
help: "Mnemonic: zoom in",
@@ -774,7 +774,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zM"],
- function(count) { vimperator.buffer.zoomIn((count > 1 ? count : 1) * 3, true); },
+ function (count) { vimperator.buffer.zoomIn((count > 1 ? count : 1) * 3, true); },
{
short_help: "Enlarge full zoom of current web page by a larger amount",
help: "Mnemonic: zoom more",
@@ -782,7 +782,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zO"],
- function(count) { vimperator.buffer.zoomOut(count > 1 ? count : 1, true); },
+ function (count) { vimperator.buffer.zoomOut(count > 1 ? count : 1, true); },
{
short_help: "Reduce full zoom of current web page",
help: "Mnemonic: zoom out",
@@ -790,7 +790,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zR"],
- function(count) { vimperator.buffer.zoomOut((count > 1 ? count : 1) * 3, true); },
+ function (count) { vimperator.buffer.zoomOut((count > 1 ? count : 1) * 3, true); },
{
short_help: "Reduce full zoom of current web page by a larger amount",
help: "Mnemonic: zoom reduce",
@@ -798,7 +798,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zZ"],
- function(count) { vimperator.buffer.fullZoom = count > 1 ? count : 100; },
+ function (count) { vimperator.buffer.fullZoom = count > 1 ? count : 100; },
{
short_help: "Set full zoom value of current web page",
help: "Zoom value can be between 1 and 2000%. If it is omitted, full zoom is reset to 100%.",
@@ -807,14 +807,14 @@ vimperator.Mappings = function() //{{{
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["ZQ"],
- function() { vimperator.quit(false); },
+ function () { vimperator.quit(false); },
{
short_help: "Quit and don't save the session",
help: "Works like :qall."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["ZZ"],
- function() { vimperator.quit(true); },
+ function () { vimperator.quit(true); },
{
short_help: "Quit and save the session",
help: "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.0 and ^ work exactly the same way."
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["$"],
- function() { vimperator.buffer.scrollEnd(); },
+ function () { vimperator.buffer.scrollEnd(); },
{
short_help: "Scroll to the absolute right of the document"
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gg", "[count] like in 35gg, it scrolls to 35% of the document.",
@@ -845,7 +845,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["G", "[count] like in 35G, it scrolls to 35% of the document.",
@@ -853,7 +853,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["h", "10h will move 10 times as much to the left.10j will move 10 times as much down.10k will move 10 times as much up.'scroll' option which defaults to half a page. " +
@@ -905,7 +905,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["'scroll' option which defaults to half a page. " +
@@ -914,7 +914,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["l", "10l will move 10 times as much to the right.[count] pages Backwards (upwards) in the buffer.",
@@ -931,7 +931,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["[count] pages Forwards (downwards) in the buffer.",
@@ -941,7 +941,7 @@ vimperator.Mappings = function() //{{{
// page info
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [":pa[geinfo]."
@@ -960,7 +960,7 @@ vimperator.Mappings = function() //{{{
// history manipulation and jumplist
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["3H goes back 3 steps.",
@@ -984,7 +984,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["L", "3L goes forward 3 steps.",
@@ -1009,7 +1009,7 @@ vimperator.Mappings = function() //{{{
return false;
}
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gu", "gU on http://www.example.com/dir1/dir2/file.htm opens http://www.example.com/.'hinttags' XPath query) is assigned a label.P and gP mappings:set complete=bs would list bookmarks first, and then any available quick searches.'sort' to the 'wildoptions' option if you want all entries sorted.",
default_value: "sfbh",
- validator: function(value) { return !/[^sfbh]/.test(value); }
+ validator: function (value) { return !/[^sfbh]/.test(value); }
}
));
this.add(new vimperator.Option(["defsearch", "ds"], "string",
@@ -464,7 +464,7 @@ vimperator.Options = function() //{{{
short_help: "Set the default search engine",
help: "The default search engine is used in the :[tab]open [arg] command " +
"if [arg] neither looks like a URL or like a specified search engine/keyword.",
- completer: function() { return [["foo", "bar"], ["shit", "blub"]]; },
+ completer: function () { return [["foo", "bar"], ["shit", "blub"]]; },
default_value: "google"
}
));
@@ -494,8 +494,8 @@ vimperator.Options = function() //{{{
this.add(new vimperator.Option(["fullscreen", "fs"], "boolean",
{
short_help: "Show the current window fullscreen",
- setter: function(value) { window.fullScreen = value; },
- getter: function() { return window.fullScreen; },
+ setter: function (value) { window.fullScreen = value; },
+ getter: function () { return window.fullScreen; },
default_value: false
}
));
@@ -508,9 +508,9 @@ vimperator.Options = function() //{{{
":pclose.{count} is specified to the <C-u> or <C-d> commands this is used to set the value of 'scroll' and also used for the current command. " +
"The value can be reset to half the window height with :set scroll=0.",
default_value: 0,
- validator: function(value) { return value >= 0; }
+ validator: function (value) { return value >= 0; }
}
));
this.add(new vimperator.Option(["showmode", "smd"], "boolean",
@@ -673,7 +673,7 @@ vimperator.Options = function() //{{{
":set titlestring=Mozilla Firefox.",
- setter: function(value) { setTitleString(value); },
+ setter: function (value) { setTitleString(value); },
default_value: "Vimperator"
}
));
@@ -711,8 +711,8 @@ vimperator.Options = function() //{{{
{
short_help: "Show current website with a minimal style sheet to make it easily accessible",
help: "Note that this is a local option for now, later it may be split into a global and :setlocal part",
- setter: function(value) { getMarkupDocumentViewer().authorStyleDisabled = value; },
- getter: function() { return getMarkupDocumentViewer().authorStyleDisabled; },
+ setter: function (value) { getMarkupDocumentViewer().authorStyleDisabled = value; },
+ getter: function () { return getMarkupDocumentViewer().authorStyleDisabled; },
default_value: false
}
));
@@ -722,13 +722,13 @@ vimperator.Options = function() //{{{
help: "When bigger than zero, Vimperator will give messages about what it is doing. They are printed to the error console which can be shown with :javascript!.'complete' option.