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

merge those pesky missing semicolons

This commit is contained in:
Doug Kearns
2007-11-01 09:56:33 +00:00
parent 9f46180257
commit 14e4cf2f56
14 changed files with 86 additions and 78 deletions

View File

@@ -32,7 +32,7 @@ vimperator.Buffer = function() //{{{
////////////////////// PRIVATE SECTION /////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
// used for the "B" mapping to remember the last :buffer[!] command
var lastBufferSwitchArgs = "";
var lastBufferSwitchArgs = "";
var lastBufferSwitchSpecial = true;
var zoom_manager = ZoomManager.prototype.getInstance();

View File

@@ -113,10 +113,14 @@ vimperator.Command.prototype.hasName = function(name)
for (var i = 0; i < this.specs.length; i++)
{
if (this.specs[i] == name) // literal command name
{
return true;
}
else if (this.specs[i].match(/^(\w+|!)\[\w+\]$/)) // abbreviation spec
{
if (matchAbbreviation(name, this.specs[i]))
return true;
}
}
return false;
}
@@ -413,7 +417,7 @@ vimperator.Commands = function() //{{{
if (special && args)
{
vimperator.echoerr("E474: Invalid argument");
return
return;
}
var matches;
if (matches = args.match(/(?:(?:^|[^a-zA-Z0-9])-|-(?:$|[^a-zA-Z0-9])|[^a-zA-Z0-9 -]).*/))
@@ -467,7 +471,7 @@ vimperator.Commands = function() //{{{
if (special && args)
{
vimperator.echoerr("E474: Invalid argument");
return
return;
}
if (special)
@@ -788,7 +792,7 @@ vimperator.Commands = function() //{{{
return;
}
var matches = args.match(/^([^\s]+)(?:\s+(.+))?$/)
var matches = args.match(/^([^\s]+)(?:\s+(.+))?$/);
var [lhs, rhs] = [matches[1], matches[2]];
var leader_reg = /<Leader>/i;
@@ -874,7 +878,7 @@ vimperator.Commands = function() //{{{
}
var filter = args.replace(/[^a-zA-Z]/g, '');
vimperator.marks.list(filter)
vimperator.marks.list(filter);
},
{
usage: ["marks [arg]"],
@@ -884,20 +888,20 @@ vimperator.Commands = function() //{{{
));
addDefaultCommand(new vimperator.Command(["mkv[imperatorrc]"],
function(args, special)
{
{
var filename;
// TODO: "E172: Only one file name allowed"
if (args)
filename = args;
else
filename = vimperator.io.expandPath(navigator.platform == "Win32" ? "~/_vimperatorrc" : "~/.vimperatorrc");
var file = vimperator.io.getFile(filename);
if (file.exists() && !special)
{
vimperator.echoerr("E189: \".vimperatorrc\" exists (add ! to override)");
return
return;
}
var line = "\" " + vimperator.version + "\n";
@@ -910,7 +914,7 @@ vimperator.Commands = function() //{{{
}
for (var option in vimperator.options)
{
{
// TODO: options should be queried for this info
// TODO: string/list options might need escaping in future
if (!/fullscreen|usermode/.test(option.name) && option.value != option.default_value)
@@ -926,7 +930,7 @@ vimperator.Commands = function() //{{{
vimperator.io.writeFile(file, line);
},
{
{
usage: ["mkv[imperatorrc] [file]"],
short_help: "Write current keymappings and changed options to [file]",
help: "If no <code class=\"argument\">[file]</code> is specified then ~/.vimperatorrc is written unless this file already exists. " +
@@ -1207,7 +1211,7 @@ vimperator.Commands = function() //{{{
var only_non_default = false; //used for :set to print non-default options
if (!args)
{
args = "all?"
args = "all?";
only_non_default = true;
}
@@ -1389,14 +1393,14 @@ vimperator.Commands = function() //{{{
// do nothing if the requested sidebar is already open
if (document.getElementById("sidebar-title").value == args)
return;
var menu = document.getElementById("viewSidebarMenu")
var menu = document.getElementById("viewSidebarMenu");
for (var i = 0; i < menu.childNodes.length; i++)
{
if (menu.childNodes[i].label == args)
{
eval(menu.childNodes[i].getAttribute('oncommand'))
eval(menu.childNodes[i].getAttribute('oncommand'));
break;
}
}
@@ -1557,11 +1561,15 @@ vimperator.Commands = function() //{{{
var before_time = Date.now();
if (args && args[0] == ":")
{
while (i--)
vimperator.execute(args);
}
else
{
while (i--)
eval(args);
}
if (special)
return;
@@ -1700,7 +1708,7 @@ vimperator.Commands = function() //{{{
short_help: "Undo closing of all closed tabs",
help: "Firefox stores up to 10 closed tabs, even after a browser restart."
}
)),
));
addDefaultCommand(new vimperator.Command(["unl[et]"],
function(args, special)
{
@@ -1780,7 +1788,7 @@ vimperator.Commands = function() //{{{
},
{
usage: ["winc[ose] [url] [, url]"],
short_help: "Close window",
short_help: "Close window"
}
));
addDefaultCommand(new vimperator.Command(["wino[pen]", "wo[pen]", "wine[dit]"],
@@ -1862,7 +1870,7 @@ vimperator.Commands = function() //{{{
args = args.replace(/(^|[^\\])!/g, "$1" + last_run_command);
last_run_command = args;
var output = vimperator.system(args)
var output = vimperator.system(args);
if (output)
vimperator.echo(vimperator.util.escapeHTML(output));
},
@@ -1910,7 +1918,7 @@ String.prototype.toURLArray = function() // {{{
{
var location = window.content.document.location;
var tail = matches[1] ? matches[1] : "";
urls[url] = location.protocol + "//" + location.host + "/" + tail
urls[url] = location.protocol + "//" + location.host + "/" + tail;
continue;
}
@@ -1919,7 +1927,7 @@ String.prototype.toURLArray = function() // {{{
// or keyword bookmark
if (/\s/.test(urls[url]) || !/[.:\/]/.test(urls[url]))
{
matches = urls[url].match(/^(\S+)(?:\s+(.+))?$/)
matches = urls[url].match(/^(\S+)(?:\s+(.+))?$/);
var alias = matches[1];
var text = matches[2] ? matches[2] : null;

View File

@@ -278,12 +278,7 @@ 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($_) {
return [
@@ -292,7 +287,7 @@ vimperator.Completion = function() // {{{
];
}));
for (var map in vimperator.mappings)
help_array.push([map.names, map.short_help])
help_array.push([map.names, map.short_help]);
if (!filter) return help_array.map(function($_) {
return [$_[0][0], $_[1]]; // unfiltered, use the first command
@@ -304,7 +299,7 @@ vimperator.Completion = function() // {{{
get_command_completions: function(filter) //{{{
{
g_substrings = [];
var completions = []
var completions = [];
if (!filter)
{
for (var command in vimperator.commands)
@@ -333,7 +328,7 @@ vimperator.Completion = function() // {{{
{
if (prefix && option.type != "boolean")
continue;
options.push([option.names, option.short_help])
options.push([option.names, option.short_help]);
}
return options;
}
@@ -345,7 +340,7 @@ vimperator.Completion = function() // {{{
{
if (prefix && option.type != "boolean")
continue;
options.push([prefix + option.name, option.short_help])
options.push([prefix + option.name, option.short_help]);
}
return options;
}
@@ -447,7 +442,7 @@ vimperator.Completion = function() // {{{
var mapped = nodes.map(function(node) {
return [[node[0]], node[1]];
});
return build_longest_common_substring(mapped, filter);
}, //}}}
@@ -489,7 +484,7 @@ vimperator.Completion = function() // {{{
}
object = matches[1].substr(start+1) || "window";
var completions = [];
var completions = [];
try
{
completions = eval(
@@ -513,7 +508,11 @@ vimperator.Completion = function() // {{{
" else {" +
" comp.push([[i], type]); }" +
"} comp;");
} catch (e) { completions = []; };
}
catch (e)
{
completions = [];
}
return build_longest_starting_substring(completions, filter);
}, // }}}

View File

@@ -40,7 +40,7 @@ vimperator.Events = function() //{{{
// any tab related events
var tabcontainer = getBrowser().tabContainer;
tabcontainer.addEventListener("TabMove", function(event) {
vimperator.statusline.updateTabCount()
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
tabcontainer.addEventListener("TabOpen", function(event) {
@@ -48,7 +48,7 @@ vimperator.Events = function() //{{{
vimperator.buffer.updateBufferList();
}, false);
tabcontainer.addEventListener("TabClose", function(event) {
vimperator.statusline.updateTabCount()
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
tabcontainer.addEventListener("TabSelect", function(event) {
@@ -152,7 +152,7 @@ vimperator.Events = function() //{{{
[ KeyEvent.DOM_VK_F21, ["F21"] ],
[ KeyEvent.DOM_VK_F22, ["F22"] ],
[ KeyEvent.DOM_VK_F23, ["F23"] ],
[ KeyEvent.DOM_VK_F24, ["F24"] ],
[ KeyEvent.DOM_VK_F24, ["F24"] ]
];
function getKeyCode(str)
@@ -372,13 +372,13 @@ vimperator.Events = function() //{{{
switch (event.button)
{
case 0:
key = "LeftMouse"
key = "LeftMouse";
break;
case 1:
key = "MiddleMouse"
key = "MiddleMouse";
break;
case 2:
key = "RightMouse"
key = "RightMouse";
break;
}
}
@@ -774,9 +774,9 @@ vimperator.Events = function() //{{{
},
// stub functions for the interfaces
setJSStatus : function(status) { ; },
setJSDefaultStatus : function(status) { ; },
setDefaultStatus : function(status) { ; },
setJSStatus: function(status) { ; },
setJSDefaultStatus: function(status) { ; },
setDefaultStatus: function(status) { ; },
onLinkIconAvailable: function() { ; }
};

View File

@@ -81,7 +81,7 @@ vimperator.Search = function() //{{{
links_only = false;
// strip links-only modifiers
pattern = pattern.replace(/(\\)?\\[uU]/g, function($0, $1) { return $1 ? $0 : "" });
pattern = pattern.replace(/(\\)?\\[uU]/g, function($0, $1) { return $1 ? $0 : ""; });
// case sensitivity - \c wins if both modifiers specified
if (/\c/.test(pattern))
@@ -96,10 +96,10 @@ vimperator.Search = function() //{{{
case_sensitive = true;
// strip case-sensitive modifiers
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 \
pattern = pattern.replace(/\\(\\[cCuU])/g, '$1')
pattern = pattern.replace(/\\(\\[cCuU])/g, '$1');
search_string = pattern;
}
@@ -246,8 +246,8 @@ vimperator.Search = function() //{{{
(function(win)
{
for (var i = 0; i < win.frames.length; i++)
arguments.callee(win.frames[i])
var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]', win.document)
arguments.callee(win.frames[i]);
var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]', win.document);
for (var i = 0; i < spans.snapshotLength; i++)
spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]);
})(window.content);

View File

@@ -131,7 +131,7 @@ vimperator.help = function(section, easter) //{{{
return ret;
}
var header = '<h1><img src="chrome://vimperator/content/logo_white.png" alt="Vimperator"/></h1>' +
var header = '<h1><img src="chrome://vimperator/content/logo_white.png" alt="Vimperator"/></h1>' +
'<p class="tagline">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 :)</p>';
@@ -155,7 +155,7 @@ vimperator.help = function(section, easter) //{{{
'<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----"/>' +
'</fieldset></form>' +
'<p>Of course as a believer in free open source software, only make a donation if you really like Vimperator and the money doesn\'t hurt - otherwise just use it, recommend it and like it :)</p>'
'<p>Of course as a believer in free open source software, only make a donation if you really like Vimperator and the money doesn\'t hurt - otherwise just use it, recommend it and like it :)</p>';
var initialization = '<span style="float: right"><code class="tag">initialization</code></span><h2 id="initialization">Initialization</h2>' +
'<p>At startup Vimperator sources a user RC file, containing Ex commands, and any JavaScript files found in the plugin directory.</p>' +
@@ -178,7 +178,7 @@ vimperator.help = function(section, easter) //{{{
var mappings = '<span style="float: right"><code class="tag">mappings</code></span><h2 id="mappings">Mappings</h2>' +
'<p>The denotion of modifier keys is like in Vim, so C- means the Control key, M- the Meta key, A- the Alt key and S- the Shift key.</p>'+
'<table class="vimperator mappings">'
'<table class="vimperator mappings">';
mappings += makeHelpString(vimperator.mappings, "", "", null);
mappings += '</table>';
if (section && section == 'holy-grail')

View File

@@ -412,7 +412,7 @@ vimperator.Hints = function() //{{{
showHints(null, 0);
return true;
};
}
/**
* Disables the HaH-mode by hiding the hints and disabling the input mode

View File

@@ -27,7 +27,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.IO = function()
vimperator.IO = function()
{
var environment_service = Components.classes["@mozilla.org/process/environment;1"]
.getService(Components.interfaces.nsIEnvironment);

View File

@@ -143,7 +143,7 @@ vimperator.Mappings = function() //{{{
{
if (names[j] == cmd)
{
names.splice(j, 1)
names.splice(j, 1);
if (names.length == 0)
maps.splice(i, 1);
@@ -260,7 +260,7 @@ vimperator.Mappings = function() //{{{
for (var j = 0; j < map.names.length; j++)
{
if (map.names[j].indexOf(cmd) == 0)
matches.push(map)
matches.push(map);
}
}
@@ -284,7 +284,7 @@ vimperator.Mappings = function() //{{{
for (var j = 0; j < maps[i].names.length; j++)
{
list += "<tr>";
list += "<td> " + vimperator.util.escapeHTML(maps[i].names[j]) + "</td>"
list += "<td> " + vimperator.util.escapeHTML(maps[i].names[j]) + "</td>";
if (maps[i].rhs)
list += "<td> " + vimperator.util.escapeHTML(maps[i].rhs) + "</td>"
list += "</tr>";
@@ -446,7 +446,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}"],
@@ -516,7 +516,7 @@ vimperator.Mappings = function() //{{{
// should probably reopen the closed tab when a 'deleted'
// alternate is selected
if (index == -1)
vimperator.echoerr("E86: Buffer does not exist") // TODO: This should read "Buffer N does not exist"
vimperator.echoerr("E86: Buffer does not exist"); // TODO: This should read "Buffer N does not exist"
else
vimperator.tabs.select(index);
},
@@ -535,7 +535,7 @@ vimperator.Mappings = function() //{{{
return;
}
vimperator.marks.add(arg)
vimperator.marks.add(arg);
},
{
short_help: "Set mark at the cursor position",
@@ -545,7 +545,7 @@ vimperator.Mappings = function() //{{{
}
));
addDefaultMap(new vimperator.Map(vimperator.modes.NORMAL, ["'", "`"],
function(arg) { vimperator.marks.jumpTo(arg) },
function(arg) { vimperator.marks.jumpTo(arg); },
{
short_help: "Jump to the mark in the current buffer",
usage: ["'{a-zA-Z}"],
@@ -562,7 +562,7 @@ vimperator.Mappings = function() //{{{
return;
}
vimperator.quickmarks.add(arg, vimperator.buffer.URL)
vimperator.quickmarks.add(arg, vimperator.buffer.URL);
},
{
short_help: "Add new QuickMark for current URL",

View File

@@ -439,7 +439,7 @@ vimperator.Options = function() //{{{
"</ul>" +
"The order matters",
default_value: "gm",
validator: function (value) { if (/[^gm]/.test(value) || value.length > 2 ||
validator: function (value) { if (/[^gm]/.test(value) || value.length > 2 ||
value.length < 1) return false; else return true; }
}
));

View File

@@ -256,7 +256,8 @@ vimperator.Tabs = function() //{{{
{
this.reload(getBrowser().mTabs[i], bypass_cache)
}
catch (e) {
catch (e)
{
// FIXME: can we do anything useful here without stopping the
// other tabs from reloading?
}

View File

@@ -93,7 +93,7 @@ vimperator.CommandLine = function() //{{{
// for the example command "open sometext| othertext" (| is the cursor pos):
var completion_start_index = 0; // will be 5 because we want to complete arguments for the :open command
var completion_prefix = "" // will be: "open sometext"
var completion_prefix = ""; // will be: "open sometext"
var completion_postfix = ""; // will be: " othertext"
var wild_index = 0; // keep track how often we press <Tab> in a row
@@ -682,7 +682,7 @@ vimperator.CommandLine = function() //{{{
if (vimperator.options["more"] && isScrollable() && !atEnd())
win.scrollByLines(1);
else
close_window = true;; // don't propagate the event for accept keys
close_window = true; // don't propagate the event for accept keys
break;
// up a line
@@ -807,7 +807,7 @@ vimperator.CommandLine = function() //{{{
// close the window
case "q":
close_window = true;;
close_window = true;
break;
// unmapped key

View File

@@ -28,7 +28,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
vimperator.util = {
escapeHTML: function(str)
{
{
var e = window.content.document.createElement("div");
e.appendChild(window.content.document.createTextNode(str));
return e.innerHTML;
@@ -51,7 +51,7 @@ vimperator.util = {
arg = '"' + vimperator.util.escapeHTML(arg.replace(/\n/, "\\n")) + '"';
return "<span style=\"color: green;\">" + arg + "</span>";
}
}
else if (type == "boolean")
{
return "<span style=\"color: blue;\">" + arg + "</span>";
@@ -62,9 +62,9 @@ vimperator.util = {
}
else if (type == "object" || type == "function")
{
// for java packages value.toString() would crash so badly
// for java packages value.toString() would crash so badly
// that we cannot even try/catch it
if (/^\[JavaPackage.*\]$/.test(arg))
if (/^\[JavaPackage.*\]$/.test(arg))
return "[JavaPackage]";
var str = arg.toString();

View File

@@ -456,7 +456,7 @@ const vimperator = (function() //{{{
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
whichwindow = wm.getMostRecentWindow("navigator:browser");
whichwindow.loadURI(url, null, postdata)
whichwindow.loadURI(url, null, postdata);
break;
default:
@@ -559,7 +559,7 @@ const vimperator = (function() //{{{
var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
process.init(file);
var ec = process.run(blocking, args, args.length);
return ec;
},
@@ -801,16 +801,16 @@ const vimperator = (function() //{{{
sleep: function(ms)
{
var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
var mainThread = threadManager.mainThread;
var threadManager = Cc["@mozilla.org/thread-manager;1"].getService(Ci.nsIThreadManager);
var mainThread = threadManager.mainThread;
var then = new Date().getTime(), now = then;
for (; now - then < ms; now = new Date().getTime()) {
mainThread.processNextEvent(true);
}
var then = new Date().getTime(), now = then;
for (; now - then < ms; now = new Date().getTime()) {
mainThread.processNextEvent(true);
}
},
get windows()
get windows()
{
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var wa = [];