diff --git a/common/modules/config.jsm b/common/modules/config.jsm index 138cfe5c..981ad662 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -451,21 +451,22 @@ var ConfigBase = Class("ConfigBase", { init: function init() { this.loadConfig(document.documentURI); - let append = - - - ; + let append = [ + ["menupopup", { id: "viewSidebarMenu", xmlns: "xul" }], + ["broadcasterset", { id: "mainBroadcasterSet", xmlns: "xul" }]]; + for each (let [id, [name, key, uri]] in Iterator(this.sidebars)) { - append.XUL::menupopup[0].* += - ; - append.XUL::broadcasterset[0].* += - ; + append[0].push( + ["menuitem", { observes: "pentadactyl-" + id + "Sidebar", label: name, + accesskey: key }]); + append[1].push( + ["broadcaster", { id: "pentadactyl-" + id + "Sidebar", autoCheck: "false", + type: "checkbox", group: "sidebar", sidebartitle: name, + sidebarurl: uri, + oncommand: "toggleSidebar(this.id || this.observes);" }]); } - util.overlayWindow(window, { append: append.elements() }); + util.overlayWindow(window, { append: append }); }, get window() window, diff --git a/common/modules/downloads.jsm b/common/modules/downloads.jsm index b0e7ba86..15db1bc3 100644 --- a/common/modules/downloads.jsm +++ b/common/modules/downloads.jsm @@ -2,7 +2,7 @@ // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. -/* use strict */ +"use strict"; defineModule("downloads", { exports: ["Download", "Downloads", "downloads"], @@ -28,35 +28,32 @@ var Download = Class("Download", { this.nodes = { commandTarget: self }; - XML.ignoreWhitespace = true; - XML.prettyPrinting = false; - util.xmlToDom( - - - - {self.displayName} - {self.targetFile.path} - - - - - {_("download.action.Pause")} - {_("download.action.Remove")} - {_("download.action.Resume")} - {_("download.action.Retry")} - {_("download.action.Cancel")} - {_("download.action.Delete")} - - - / - - - - - {self.source.spec} - , + DOM.fromJSON( + ["tr", { highlight: "Download", key: "row" }, + ["td", { highlight: "DownloadTitle" }, + ["span", { highlight: "Link" }, + ["a", { key: "launch", href: self.target.spec, path: self.targetFile.path }, + self.displayName], + ["span", { highlight: "LinkInfo" }, + self.targetFile.path]]], + ["td", { highlight: "DownloadState", key: "state" }], + ["td", { highlight: "DownloadButtons Buttons" }, + ["a", { highlight: "Button", href: "javascript:0", key: "pause" }, _("download.action.Pause")], + ["a", { highlight: "Button", href: "javascript:0", key: "remove" }, _("download.action.Remove")], + ["a", { highlight: "Button", href: "javascript:0", key: "resume" }, _("download.action.Resume")], + ["a", { highlight: "Button", href: "javascript:0", key: "retry" }, _("download.action.Retry")], + ["a", { highlight: "Button", href: "javascript:0", key: "cancel" }, _("download.action.Cancel")], + ["a", { highlight: "Button", href: "javascript:0", key: "delete" }, _("download.action.Delete")]], + ["td", { highlight: "DownloadProgress", key: "progress" }, + ["span", { highlight: "DownloadProgressHave", key: "progressHave" }], + "/", + ["span", { highlight: "DownloadProgressTotal", key: "progressTotal" }]],, + ["td", { highlight: "DownloadPercent", key: "percent" }], + ["td", { highlight: "DownloadSpeed", key: "speed" }], + ["td", { highlight: "DownloadTime", key: "time" }], + ["td", {}, + ["a", { highlight: "DownloadSource", key: "source", href: self.source.spec }, + self.source.spec]]], this.list.document, this.nodes); this.nodes.launch.addEventListener("click", function (event) { @@ -228,34 +225,37 @@ var DownloadList = Class("DownloadList", XML.ignoreWhitespace = true; XML.prettyPrinting = false; - util.xmlToDom( - - {_("title.Title")} - {_("title.Status")} - - {_("title.Progress")} - - {_("title.Speed")} - {_("title.Time remaining")} - {_("title.Source")} - -
- - - - - -
{_("title.Totals")}:  - - {_("download.action.Clear")} - - / - - - - -
, this.document, this.nodes); + DOM.fromJSON(["table", { highlight: "Downloads", key: "list" }, + ["tr", { highlight: "DownloadHead", key: "head" }, + ["span", {}, _("title.Title")], + ["span", {}, _("title.Status")], + ["span"], + ["span", {}, _("title.Progress")], + ["span"], + ["span", {}, _("title.Speed")], + ["span", {}, _("title.Time remaining")], + ["span", {}, _("title.Source")]], + ["tr", { highlight: "Download" }, + ["span", {}, + ["div", { style: "min-height: 1ex; /* FIXME */" }]]], + ["tr", { highlight: "Download", key: "totals", active: "true" }, + ["td", {}, + ["span", { highlight: "Title" }, + _("title.Totals") + ":"], + " ", + ["span", { key: "total" }]], + ["td"], + ["td", { highlight: "DownloadButtons" }, + ["a", { highlight: "Button", href: "javascript:0", key: "clear" }, _("download.action.Clear")]], + ["td", { highlight: "DownloadProgress", key: "progress" }, + ["span", { highlight: "DownloadProgressHave", key: "progressHave" }], + "/", + ["span", { highlight: "DownloadProgressTotal", key: "progressTotal" }]], + ["td", { highlight: "DownloadPercent", key: "percent" }], + ["td", { highlight: "DownloadSpeed", key: "speed" }], + ["td", { highlight: "DownloadTime", key: "time" }], + ["td"]]], + this.document, this.nodes); this.index = Array.indexOf(this.nodes.list.childNodes, this.nodes.head); diff --git a/common/modules/finder.jsm b/common/modules/finder.jsm index 5117909a..5743666c 100644 --- a/common/modules/finder.jsm +++ b/common/modules/finder.jsm @@ -2,7 +2,7 @@ // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. -/* use strict */ +"use strict"; defineModule("finder", { exports: ["RangeFind", "RangeFinder", "rangefinder"],