diff options
Diffstat (limited to 'common')
-rwxr-xr-x | common/bootstrap.js | 1 | ||||
-rw-r--r-- | common/content/bookmarks.js | 4 | ||||
-rw-r--r-- | common/content/buffer.js | 16 | ||||
-rw-r--r-- | common/content/commandline.js | 2 | ||||
-rw-r--r-- | common/content/dactyl.js | 88 | ||||
-rw-r--r-- | common/content/editor.js | 8 | ||||
-rw-r--r-- | common/content/hints.js | 2 | ||||
-rw-r--r-- | common/content/statusline.js | 8 | ||||
-rw-r--r-- | common/modules/commands.jsm | 2 | ||||
-rw-r--r-- | common/modules/util.jsm | 2 |
10 files changed, 66 insertions, 67 deletions
diff --git a/common/bootstrap.js b/common/bootstrap.js index b17cba4c..8e88c3f4 100755 --- a/common/bootstrap.js +++ b/common/bootstrap.js @@ -41,7 +41,6 @@ if (!JSMLoader && "@mozilla.org/fuel/application;1" in Components.classes) .getService(Components.interfaces.extIApplication) .storage.get("dactyl.JSMLoader", null); - function reportError(e) { dump("\ndactyl: bootstrap: " + e + "\n" + (e.stack || Error().stack) + "\n"); Cu.reportError(e); diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 4e7ded7f..a7e9bbad 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -403,7 +403,7 @@ var Bookmarks = Module("bookmarks", { completer: function title(context, args) { let frames = buffer.allFrames(); if (!args.bang) - return [ + return [ [win.document.title, frames.length == 1 ? "Current Location" : "Frame: " + win.location.href] for ([, win] in Iterator(frames))]; context.keys.text = "title"; @@ -521,7 +521,7 @@ var Bookmarks = Module("bookmarks", { let context = CompletionContext(args.join(" ")); context.fork("bookmark", 0, completion, "bookmark", args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); - var deletedCount = bookmarks.remove(context.allItems.items.map(function (item) item.item.id)); + deletedCount = bookmarks.remove(context.allItems.items.map(function (item) item.item.id)); } dactyl.echomsg({ message: _("bookmark.deleted", deletedCount) }); diff --git a/common/content/buffer.js b/common/content/buffer.js index 6c18ef0a..7ea61625 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -742,7 +742,7 @@ var Buffer = Module("buffer", { * Shifts the focus to another frame within the buffer. Each buffer * contains at least one frame. * - * @param {number} count The number of frames to skip through. A negative + * @param {number} count The number of frames to skip through. A negative * count skips backwards. */ shiftFrameFocus: function shiftFrameFocus(count) { @@ -1006,14 +1006,14 @@ var Buffer = Module("buffer", { * Adjusts the page zoom of the current buffer relative to the * current zoom level. * - * @param {number} steps The integral number of natural fractions by - * which to adjust the current page zoom. If positive, the zoom - * level is increased, if negative it is decreased. + * @param {number} steps The integral number of natural fractions by which + * to adjust the current page zoom. If positive, the zoom level is + * increased, if negative it is decreased. * @param {boolean} fullZoom If true, zoom all content of the page, - * including raster images. If false, zoom only text. If omitted, - * use the current zoom function. @optional - * @throws {FailedAssertion} if the buffer's zoom level is already - * at its extreme in the given direction. + * including raster images. If false, zoom only text. If omitted, use + * the current zoom function. @optional + * @throws {FailedAssertion} if the buffer's zoom level is already at its + * extreme in the given direction. */ bumpZoomLevel: function bumpZoomLevel(steps, fullZoom) { if (fullZoom === undefined) diff --git a/common/content/commandline.js b/common/content/commandline.js index 5685c9da..c64df4c2 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -175,7 +175,7 @@ var CommandWidgets = Class("CommandWidgets", { if (obj.value != null) return [obj.value[0], obj.get ? obj.get.call(this, elem) : elem.value] - .concat(obj.value.slice(2)) + .concat(obj.value.slice(2)); return null; }, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 7a8ac25a..7f0a4930 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -732,7 +732,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { if (!list) res += list = <ul/>; let li = <li/>; - li.* += rec(match.content.replace(RegExp("^" + match.space, "gm"), ""), level + 1, li) + li.* += rec(match.content.replace(RegExp("^" + match.space, "gm"), ""), level + 1, li); list.* += li; } else if (match.par) { @@ -853,51 +853,51 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { .split(" ")); function fix(node) { switch(node.nodeType) { - case Node.ELEMENT_NODE: - if (isinstance(node, [HTMLBaseElement])) - return; - - data.push("<"); data.push(node.localName); - if (node instanceof HTMLHtmlElement) - data.push(" xmlns=" + XHTML.uri.quote()); - - for (let { name, value } in array.iterValues(node.attributes)) { - if (name == "dactyl:highlight") { - set.add(styles, value); - name = "class"; - value = "hl-" + value; - } - if (name == "href") { - value = node.href || value; - if (value.indexOf("dactyl://help-tag/") == 0) { - let uri = services.io.newChannel(value, null, null).originalURI; - value = uri.spec == value ? "javascript:;" : uri.path.substr(1); - } - if (!/^#|[\/](#|$)|^[a-z]+:/.test(value)) - value = value.replace(/(#|$)/, ".xhtml$1"); - } - if (name == "src" && value.indexOf(":") > 0) { - chromeFiles[value] = value.replace(/.*\//, ""); - value = value.replace(/.*\//, ""); + case Node.ELEMENT_NODE: + if (isinstance(node, [HTMLBaseElement])) + return; + + data.push("<"); data.push(node.localName); + if (node instanceof HTMLHtmlElement) + data.push(" xmlns=" + XHTML.uri.quote()); + + for (let { name, value } in array.iterValues(node.attributes)) { + if (name == "dactyl:highlight") { + set.add(styles, value); + name = "class"; + value = "hl-" + value; + } + if (name == "href") { + value = node.href || value; + if (value.indexOf("dactyl://help-tag/") == 0) { + let uri = services.io.newChannel(value, null, null).originalURI; + value = uri.spec == value ? "javascript:;" : uri.path.substr(1); } - data.push(" "); - data.push(name); - data.push('="'); - data.push(<>{value}</>.toXMLString().replace(/"/g, """)); - data.push('"'); + if (!/^#|[\/](#|$)|^[a-z]+:/.test(value)) + value = value.replace(/(#|$)/, ".xhtml$1"); } - if (node.localName in empty) - data.push(" />"); - else { - data.push(">"); - if (node instanceof HTMLHeadElement) - data.push(<link rel="stylesheet" type="text/css" href="help.css"/>.toXMLString()); - Array.map(node.childNodes, fix); - data.push("</"); data.push(node.localName); data.push(">"); + if (name == "src" && value.indexOf(":") > 0) { + chromeFiles[value] = value.replace(/.*\//, ""); + value = value.replace(/.*\//, ""); } - break; - case Node.TEXT_NODE: - data.push(<>{node.textContent}</>.toXMLString()); + data.push(" "); + data.push(name); + data.push('="'); + data.push(<>{value}</>.toXMLString().replace(/"/g, """)); + data.push('"'); + } + if (node.localName in empty) + data.push(" />"); + else { + data.push(">"); + if (node instanceof HTMLHeadElement) + data.push(<link rel="stylesheet" type="text/css" href="help.css"/>.toXMLString()); + Array.map(node.childNodes, fix); + data.push("</"); data.push(node.localName); data.push(">"); + } + break; + case Node.TEXT_NODE: + data.push(<>{node.textContent}</>.toXMLString()); } } @@ -1811,7 +1811,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { bang: true, keepQuotes: true, serialGroup: 10, - serialize: function () [ + serialize: function () [ { command: this.name, literalArg: options["loadplugins"].join(" ") diff --git a/common/content/editor.js b/common/content/editor.js index ae88a8f9..6e9069ef 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -230,11 +230,11 @@ var Editor = Module("editor", { * Edits the given file in the external editor as specified by the * 'editor' option. * - * @param {object|File|string} args An object specifying the file, - * line, and column to edit. If a non-object is specified, it is - * treated as the file parameter of the object. + * @param {object|File|string} args An object specifying the file, line, + * and column to edit. If a non-object is specified, it is treated as + * the file parameter of the object. * @param {boolean} blocking If true, this function does not return - * until the editor exits. + * until the editor exits. */ editFileExternally: function (args, blocking) { if (!isObject(args) || args instanceof File) diff --git a/common/content/hints.js b/common/content/hints.js index 1459198f..53582cf9 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -837,7 +837,7 @@ var Hints = Module("hints", { * returns true if each set of characters typed can be found, in any * order, in the link. * - * @param {string} hintString The string typed by the user. + * @param {string} hintString The string typed by the user. * @returns {function(String):boolean} A function that takes the text * of a hint and returns true if all the (space-delimited) sets of * characters typed by the user can be found in it. diff --git a/common/content/statusline.js b/common/content/statusline.js index 062c6c65..a4b3280c 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -26,13 +26,13 @@ var StatusLine = Module("statusline", { util.overlayWindow(window, { append: <><statusbar id="status-bar" ordinal="0"/></> }); highlight.loadCSS(util.compileMacro(<![CDATA[ - !AddonBar;#addon-bar { + !AddonBar;#addon-bar { padding-left: 0 !important; min-height: 18px !important; -moz-appearance: none !important; <padding> } - !AddonButton;#addon-bar xul|toolbarbutton { + !AddonButton;#addon-bar xul|toolbarbutton { -moz-appearance: none !important; padding: 0 !important; border-width: 0px !important; @@ -149,7 +149,7 @@ var StatusLine = Module("statusline", { this.timeout(function () { this.status = message || buffer.uri; }); - }, + } }, /** @@ -300,7 +300,7 @@ var StatusLine = Module("statusline", { */ progress: Modes.boundProperty({ get: function progress() this._progress, - set: function progress(progress) { + set: function progress(progress) { this._progress = progress || ""; if (typeof progress == "string") diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index 06e11881..e422a908 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -1398,7 +1398,7 @@ var Commands = Module("commands", { util.assert(args["-group"].modifiable, _("group.cantChangeBuiltin", _("command.commands"))); - let completer = args["-complete"]; + let completer = args["-complete"]; let completerFunc = null; // default to no completion for user commands if (completer) { diff --git a/common/modules/util.jsm b/common/modules/util.jsm index b5572d3e..52a768b2 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -1056,7 +1056,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), }</span>; let tag = "<" + [namespaced(elem)].concat( - [namespaced(a) + "=" + template.highlight(a.value, true) + [namespaced(a) + "=" + template.highlight(a.value, true) for ([i, a] in array.iterItems(elem.attributes))]).join(" "); return tag + (!hasChildren ? "/>" : ">...</" + namespaced(elem) + ">"); } |