X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Fmodules%2Ftemplate.jsm;fp=common%2Fmodules%2Ftemplate.jsm;h=5b89f187524e336eb95e7c2899c01a1c686d996d;hb=354a049cce8415487552ce405cce167b7071fe1f;hp=b9f5fda9b7ba6a7f7010be5e09a402038467b306;hpb=3d837eb266a3a01d424192aa4ec1a167366178c5;p=dactyl.git diff --git a/common/modules/template.jsm b/common/modules/template.jsm index b9f5fda..5b89f18 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -172,7 +172,7 @@ var Template = Module("Template", { !(item.extra && item.extra.length) ? [] : ["span", { highlight: "URLExtra" }, " (", - template.map(item.extra, function (e) + template.map(item.extra, e => ["", e[0], ": ", ["span", { highlight: e[2] }, e[1]]], "\u00a0"), @@ -278,8 +278,8 @@ var Template = Module("Template", { } }, - _sandbox: Class.Memoize(function () Cu.Sandbox(Cu.getGlobalForObject(global), - { wantXrays: false })), + _sandbox: Class.Memoize(() => Cu.Sandbox(Cu.getGlobalForObject(global), + { wantXrays: false })), // if "processStrings" is true, any passed strings will be surrounded by " and // any line breaks are displayed as \n @@ -403,7 +403,7 @@ var Template = Module("Template", { ["th", {}, _("title.VPos")], ["th", {}, _("title.Title")], ["th", {}, _("title.URI")]], - this.map(Iterator(elems), function ([idx, val]) + this.map(Iterator(elems), ([idx, val]) => ["tr", {}, ["td", { class: "indicator" }, idx == index ? ">" : ""], ["td", {}, Math.abs(idx - index)], @@ -419,7 +419,7 @@ var Template = Module("Template", { return ["table", {}, ["tr", { highlight: "Title", align: "left" }, ["th", {}, "--- " + title + " ---"]], - this.map(opts, function (opt) + this.map(opts, opt => ["tr", {}, ["td", {}, ["div", { highlight: "Message" }, @@ -446,7 +446,7 @@ var Template = Module("Template", { let table = ["table", {}, ["tr", { highlight: "Title", align: "left" }, ["th", { colspan: "2" }, title]], - this.map(data, function (datum) + this.map(data, datum => ["tr", {}, ["td", { style: "font-weight: bold; min-width: 150px; padding-left: " + (indent || "2ex") }, datum[0]], ["td", {}, datum[1]]])]; @@ -463,13 +463,11 @@ var Template = Module("Template", { ["th", {}, h])], this.map(iter, (row) => ["tr", {}, - this.map(Iterator(row), function ([i, d]) + this.map(Iterator(row), ([i, d]) => ["td", { style: style[i] || "" }, d])])]; }, - usage: function usage(iter, format) { - - format = format || {}; + usage: function usage(iter, format = {}) { let desc = format.description || (item => this.linkifyHelp(item.description)); let help = format.help || (item => item.name); let sourceLink = (frame) => {