1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 18:37:58 +01:00

Add missing semicolons.

This commit is contained in:
Doug Kearns
2009-06-02 16:56:28 +10:00
parent 95dffaf95a
commit 6d7b94daa6
17 changed files with 56 additions and 55 deletions

View File

@@ -334,7 +334,7 @@ function Buffer() //{{{
if (util.newURI(buffer.URL).scheme == scheme) if (util.newURI(buffer.URL).scheme == scheme)
liberator.open(buffer.URL.substr(scheme.length + 1)); liberator.open(buffer.URL.substr(scheme.length + 1));
else else
liberator.open(scheme + ":" + buffer.URL) liberator.open(scheme + ":" + buffer.URL);
}); });
mappings.add(myModes, ["gi"], mappings.add(myModes, ["gi"],

View File

@@ -1047,7 +1047,7 @@ function Commands() //{{{
return undefined; return undefined;
} }
return completer.apply(this, Array.slice(arguments)); return completer.apply(this, Array.slice(arguments));
} };
} }
else else
completeFunc = completion[completeOptionMap[completeOpt]]; completeFunc = completion[completeOptionMap[completeOpt]];

View File

@@ -109,7 +109,7 @@ const configbase = { //{{{
* application namespaces which should be loaded before liberator * application namespaces which should be loaded before liberator
* initialization. * initialization.
*/ */
scripts: [], scripts: []
}; //}}} }; //}}}
// vim: set fdm=marker sw=4 ts=4 et: // vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -419,7 +419,7 @@ function Editor() //{{{
mappings.add([modes.VISUAL], mappings.add([modes.VISUAL],
["v"], "End visual mode", ["v"], "End visual mode",
function (count) { events.onEscape() }); function (count) { events.onEscape(); });
mappings.add([modes.TEXTAREA], mappings.add([modes.TEXTAREA],
["V"], "Start visual line mode", ["V"], "Start visual line mode",
@@ -601,7 +601,8 @@ function Editor() //{{{
{ {
let elem = liberator.focus; let elem = liberator.focus;
// A error occurs if the element has been removed when "elem.selectionStart" is executed. // A error occurs if the element has been removed when "elem.selectionStart" is executed.
try { try
{
if (elem && elem.selectionEnd) if (elem && elem.selectionEnd)
elem.selectionEnd = elem.selectionStart; elem.selectionEnd = elem.selectionStart;
} }

View File

@@ -431,7 +431,7 @@ function Events() //{{{
return: ["Return", "CR", "Enter"], return: ["Return", "CR", "Enter"],
right_shift: [">"], right_shift: [">"],
space: ["Space", " "], space: ["Space", " "],
subtract: ["Minus", "Subtract"], subtract: ["Minus", "Subtract"]
}; };
const code_key = {}; const code_key = {};
@@ -874,7 +874,7 @@ function Events() //{{{
if (keyname) if (keyname)
{ {
modifier = modifier.toUpperCase(); modifier = modifier.toUpperCase();
key = [k + "-" for ([i, k] in Iterator("CASM")) if (modifier.indexOf(k + "-") >= 0)] key = [k + "-" for ([i, k] in Iterator("CASM")) if (modifier.indexOf(k + "-") >= 0)];
keyCode = key_code[keyname]; keyCode = key_code[keyname];
let c = String.fromCharCode(keyCode); let c = String.fromCharCode(keyCode);
@@ -927,7 +927,7 @@ function Events() //{{{
{ {
let charCode = key.charCodeAt(0); let charCode = key.charCodeAt(0);
let keyCode = 0; let keyCode = 0;
let [shift, ctrl, alt, meta] = [false, false, false, false] let [shift, ctrl, alt, meta] = [false, false, false, false];
let string = null; let string = null;
if (key[0] == "<") if (key[0] == "<")

View File

@@ -223,7 +223,7 @@ function Finder() //{{{
var parent = before.parentNode; var parent = before.parentNode;
aNode.appendChild(docfrag); aNode.appendChild(docfrag);
parent.insertBefore(aNode, before); parent.insertBefore(aNode, before);
this.spans.push(aNode) this.spans.push(aNode);
return aNode; return aNode;
}, },
@@ -236,17 +236,17 @@ function Finder() //{{{
{ {
if (span.parentNode) if (span.parentNode)
{ {
let el = span.firstChild let el = span.firstChild;
while (el) while (el)
{ {
span.removeChild(el) span.removeChild(el);
span.parentNode.insertBefore(el, span) span.parentNode.insertBefore(el, span);
el = span.firstChild; el = span.firstChild;
} }
span.parentNode.removeChild(span); span.parentNode.removeChild(span);
} }
}) });
this.spans = [] this.spans = [];
}, },
getSpans: function (doc) this.spans getSpans: function (doc) this.spans
@@ -318,7 +318,7 @@ function Finder() //{{{
let word = buffer.getCurrentWord(); let word = buffer.getCurrentWord();
// A hacky way to move after the current match before searching forwards // A hacky way to move after the current match before searching forwards
window.content.getSelection().getRangeAt(0).collapse(false); window.content.getSelection().getRangeAt(0).collapse(false);
finder.onSubmit(word, false) finder.onSubmit(word, false);
}); });
mappings.add(myModes.concat([modes.CARET, modes.TEXTAREA]), ["#"], mappings.add(myModes.concat([modes.CARET, modes.TEXTAREA]), ["#"],
@@ -329,7 +329,7 @@ function Finder() //{{{
let word = buffer.getCurrentWord(); let word = buffer.getCurrentWord();
// A hacky way to move before the current match before searching backwards // A hacky way to move before the current match before searching backwards
window.content.getSelection().getRangeAt(0).collapse(true); window.content.getSelection().getRangeAt(0).collapse(true);
finder.onSubmit(word, true) finder.onSubmit(word, true);
}); });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
@@ -519,7 +519,7 @@ function Finder() //{{{
*/ */
clear: function () clear: function ()
{ {
highlightObj.clear() highlightObj.clear();
} }
}; };
//}}} //}}}

View File

@@ -161,7 +161,7 @@ function Hints() //{{{
let type = elem.type ? elem.type.toLowerCase() : ""; let type = elem.type ? elem.type.toLowerCase() : "";
if (tagname == "input" && (type == "submit" || type == "button" || type == "reset")) if (tagname == "input" && (type == "submit" || type == "button" || type == "reset"))
return [elem.value, false] return [elem.value, false];
else else
{ {
for each (let option in options["hintinputs"].split(",")) for each (let option in options["hintinputs"].split(","))
@@ -171,18 +171,18 @@ function Hints() //{{{
if (tagname == "select") if (tagname == "select")
{ {
if (elem.selectedIndex >= 0) if (elem.selectedIndex >= 0)
return [elem.item(elem.selectedIndex).text.toLowerCase(), false] return [elem.item(elem.selectedIndex).text.toLowerCase(), false];
} }
else if (type == "image") else if (type == "image")
{ {
if (elem.alt) if (elem.alt)
return [elem.alt.toLowerCase(), true] return [elem.alt.toLowerCase(), true];
} }
else if (elem.value && type != "password") else if (elem.value && type != "password")
{ {
// radio's and checkboxes often use internal ids as values - maybe make this an option too... // radio's and checkboxes often use internal ids as values - maybe make this an option too...
if (! ((type == "radio" || type == "checkbox") && !isNaN(elem.value))) if (! ((type == "radio" || type == "checkbox") && !isNaN(elem.value)))
return [elem.value.toLowerCase(), (type == "radio" || type == "checkbox")] return [elem.value.toLowerCase(), (type == "radio" || type == "checkbox")];
} }
} }
else if (option == "label") else if (option == "label")
@@ -192,14 +192,14 @@ function Hints() //{{{
//TODO: (possibly) do some guess work for label-like objects //TODO: (possibly) do some guess work for label-like objects
let label = buffer.evaluateXPath("//label[@for='" + elem.id + "']", doc).snapshotItem(0); let label = buffer.evaluateXPath("//label[@for='" + elem.id + "']", doc).snapshotItem(0);
if (label) if (label)
return [label.textContent.toLowerCase(), true] return [label.textContent.toLowerCase(), true];
} }
} }
else if (option == "name") else if (option == "name")
return [elem.name.toLowerCase(), true] return [elem.name.toLowerCase(), true];
} }
} }
return ["", false] return ["", false];
} }
/** /**
@@ -266,11 +266,11 @@ function Hints() //{{{
// If we found a satisfactory offset, let's use it. // If we found a satisfactory offset, let's use it.
if (curdist < Infinity) if (curdist < Infinity)
return [leftpos + curleft, toppos + curtop] return [leftpos + curleft, toppos + curtop];
} }
} }
catch (e) {} //badly formed document, or shape == "default" in which case we don't move the hint catch (e) {} //badly formed document, or shape == "default" in which case we don't move the hint
return [leftpos, toppos] return [leftpos, toppos];
} }
/** /**
@@ -674,7 +674,7 @@ function Hints() //{{{
let beyondLastWord = (nextWordIdx == words.length); let beyondLastWord = (nextWordIdx == words.length);
let charMatched = false; let charMatched = false;
if (beyondLastWord == false) if (beyondLastWord == false)
charMatched = charMatches(nextCharIdx, chars, nextWordIdx, words, 0, allowWordOverleaping) charMatched = charMatches(nextCharIdx, chars, nextWordIdx, words, 0, allowWordOverleaping);
if (charMatched) if (charMatched)
return true; return true;
@@ -874,7 +874,7 @@ function Hints() //{{{
context.compare = function () 0; context.compare = function () 0;
context.completions = [[k, v.prompt] for ([k, v] in Iterator(hintModes))]; context.completions = [[k, v.prompt] for ([k, v] in Iterator(hintModes))];
}, },
onChange: function () { modes.pop() }, onChange: function () { modes.pop(); },
onCancel: function (arg) { arg && setTimeout(function () hints.show(arg), 0); } onCancel: function (arg) { arg && setTimeout(function () hints.show(arg), 0); }
}); });
}, { flags: Mappings.flags.COUNT }); }, { flags: Mappings.flags.COUNT });

View File

@@ -56,6 +56,6 @@
prefix.unshift("chrome://" + modules.config.name.toLowerCase() + "/content/"); prefix.unshift("chrome://" + modules.config.name.toLowerCase() + "/content/");
modules.config.scripts.forEach(load); modules.config.scripts.forEach(load);
})() })();
// vim: set fdm=marker sw=4 ts=4 et: // vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -307,12 +307,12 @@ function Mappings() //{{{
null, null,
function (context, obj, args) function (context, obj, args)
{ {
let mode = args[0] let mode = args[0];
return util.Array.flatten( return util.Array.flatten(
[ [
[[name, map.description] for ([i, name] in Iterator(map.names))] [[name, map.description] for ([i, name] in Iterator(map.names))]
for ([i, map] in Iterator(user[mode].concat(main[mode]))) for ([i, map] in Iterator(user[mode].concat(main[mode])))
]) ]);
} }
]); ]);
}); });

View File

@@ -288,7 +288,7 @@ const modes = (function () //{{{
self.addMode("LINE", true); // linewise visual mode self.addMode("LINE", true); // linewise visual mode
self.addMode("PROMPT", true); self.addMode("PROMPT", true);
config.modes.forEach(function (mode) { self.addMode.apply(self, mode) }); config.modes.forEach(function (mode) { self.addMode.apply(self, mode); });
return self; return self;
//}}} //}}}

View File

@@ -27,7 +27,7 @@ function Services()
ifaces = Array.concat(ifaces); ifaces = Array.concat(ifaces);
try try
{ {
let res = Cc[classes][meth || "getService"](ifaces.shift()) let res = Cc[classes][meth || "getService"](ifaces.shift());
ifaces.forEach(function (iface) res.QueryInterface(iface)); ifaces.forEach(function (iface) res.QueryInterface(iface));
return res; return res;
} }

View File

@@ -472,7 +472,7 @@ function CommandLine() //{{{
} }
// Fallthrough // Fallthrough
case "full": case "full":
this.select(reverse ? this.UP : this.DOWN) this.select(reverse ? this.UP : this.DOWN);
break; break;
} }
@@ -1765,7 +1765,7 @@ function ItemList(id) //{{{
div.style.minWidth = ""; div.style.minWidth = "";
// FIXME: Belongs elsewhere. // FIXME: Belongs elsewhere.
commandline.updateOutputHeight(false); commandline.updateOutputHeight(false);
setTimeout(function () { container.height -= commandline.getSpaceNeeded() }, 0) setTimeout(function () { container.height -= commandline.getSpaceNeeded() }, 0);
} }
function getCompletion(index) completionElements.snapshotItem(index - startIndex); function getCompletion(index) completionElements.snapshotItem(index - startIndex);
@@ -1847,7 +1847,7 @@ function ItemList(id) //{{{
return; return;
haveCompletions = true; haveCompletions = true;
let root = nodes.root let root = nodes.root;
let items = nodes.items; let items = nodes.items;
let [start, end, waiting] = getRows(context); let [start, end, waiting] = getRows(context);
@@ -1883,9 +1883,9 @@ function ItemList(id) //{{{
return; return;
nodes.up.style.opacity = (start == 0) ? "0" : "1"; nodes.up.style.opacity = (start == 0) ? "0" : "1";
if (end != context.items.length) if (end != context.items.length)
nodes.down.style.display = "block" nodes.down.style.display = "block";
else else
nodes.up.style.display = "block" nodes.up.style.display = "block";
}); });
divNodes.noCompletions.style.display = haveCompletions ? "none" : "block"; divNodes.noCompletions.style.display = haveCompletions ? "none" : "block";

View File

@@ -334,8 +334,8 @@ const util = { //{{{
{ {
xmlhttp.onreadystatechange = function () { xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) if (xmlhttp.readyState == 4)
callback(xmlhttp) callback(xmlhttp);
} };
} }
xmlhttp.open("GET", url, !!callback); xmlhttp.open("GET", url, !!callback);
xmlhttp.send(null); xmlhttp.send(null);
@@ -442,7 +442,7 @@ const util = { //{{{
const NAMESPACES = util.Array.toObject([ const NAMESPACES = util.Array.toObject([
[NS, 'liberator'], [NS, 'liberator'],
[XHTML, 'html'], [XHTML, 'html'],
[XUL, 'xul'], [XUL, 'xul']
]); ]);
if (object instanceof Node && !(object instanceof Document)) if (object instanceof Node && !(object instanceof Document))
{ {
@@ -735,7 +735,7 @@ util.Array.isinstance = function isinstance(obj) {
util.Array.toObject = function toObject(assoc) util.Array.toObject = function toObject(assoc)
{ {
let obj = {}; let obj = {};
assoc.forEach(function ([k, v]) { obj[k] = v }); assoc.forEach(function ([k, v]) { obj[k] = v; });
return obj; return obj;
}; };
@@ -857,7 +857,7 @@ Struct.prototype = {
let self = this; let self = this;
return ([v, self[v]] for ([k, v] in Iterator(self.members))) return ([v, self[v]] for ([k, v] in Iterator(self.members)))
} }
} };
// Add no-sideeffect array methods. Can't set new Array() as the prototype or // Add no-sideeffect array methods. Can't set new Array() as the prototype or
// get length() won't work. // get length() won't work.

View File

@@ -259,7 +259,7 @@ function Bookmarks() //{{{
{ {
completer: function completer(context) completer: function completer(context)
{ {
completion.search(context, true) completion.search(context, true);
context.completions = [["", "Don't perform searches by default"]].concat(context.completions); context.completions = [["", "Don't perform searches by default"]].concat(context.completions);
}, },
validator: Option.validateCompleter validator: Option.validateCompleter

View File

@@ -131,13 +131,13 @@ const config = { //{{{
"<Return>": modes.NORMAL | modes.INSERT, "<Return>": modes.NORMAL | modes.INSERT,
"<Space>": modes.NORMAL | modes.INSERT, "<Space>": modes.NORMAL | modes.INSERT,
"<Up>": modes.NORMAL | modes.INSERT, "<Up>": modes.NORMAL | modes.INSERT,
"<Down>": modes.NORMAL | modes.INSERT, "<Down>": modes.NORMAL | modes.INSERT
} };
}, },
scripts: [ scripts: [
"bookmarks.js", "bookmarks.js",
"tabs.js", "tabs.js"
], ],
init: function () init: function ()
@@ -369,8 +369,8 @@ const config = { //{{{
"Redraw the screen", "Redraw the screen",
function () function ()
{ {
let wu = window.QueryInterface(Ci.nsIInterfaceRequestor). let wu = window.QueryInterface(Ci.nsIInterfaceRequestor)
getInterface(Ci.nsIDOMWindowUtils); .getInterface(Ci.nsIDOMWindowUtils);
wu.redraw(); wu.redraw();
modes.show(); modes.show();
}, },

View File

@@ -257,7 +257,7 @@ function Bookmarks() //{{{
{ {
completer: function completer(context) completer: function completer(context)
{ {
completion.search(context, true) completion.search(context, true);
context.completions = [["", "Don't perform searches by default"]].concat(context.completions); context.completions = [["", "Don't perform searches by default"]].concat(context.completions);
}, },
validator: Option.validateCompleter validator: Option.validateCompleter

View File

@@ -174,8 +174,8 @@ const config = { //{{{
"<Return>": modes.NORMAL | modes.INSERT, "<Return>": modes.NORMAL | modes.INSERT,
"<Space>": modes.NORMAL | modes.INSERT, "<Space>": modes.NORMAL | modes.INSERT,
"<Up>": modes.NORMAL | modes.INSERT, "<Up>": modes.NORMAL | modes.INSERT,
"<Down>": modes.NORMAL | modes.INSERT, "<Down>": modes.NORMAL | modes.INSERT
} };
}, },
scripts: [ scripts: [
@@ -504,7 +504,7 @@ const config = { //{{{
let arg = args.literalArg; let arg = args.literalArg;
if (arg in displayPanes) if (arg in displayPanes)
openDisplayPane(displayPanes[arg]) openDisplayPane(displayPanes[arg]);
// TODO: focus when we have better key handling of these extended modes // TODO: focus when we have better key handling of these extended modes
else else
liberator.echoerr("E475: Invalid argument: " + arg); liberator.echoerr("E475: Invalid argument: " + arg);
@@ -567,11 +567,11 @@ const config = { //{{{
// functions to make porting from FF as simple as possible. // functions to make porting from FF as simple as possible.
window.toJavaScriptConsole = function () { window.toJavaScriptConsole = function () {
toOpenWindowByType("global:console", "chrome://global/content/console.xul"); toOpenWindowByType("global:console", "chrome://global/content/console.xul");
} };
window.BrowserStop = function () { window.BrowserStop = function () {
SBGetBrowser().mCurrentBrowser.stop(); SBGetBrowser().mCurrentBrowser.stop();
} };
} }
}; //}}} }; //}}}