- message: Class.memoize(function () {
-
- util.xmlToDom(<table highlight="Downloads" key="list" xmlns={XHTML}>
- <tr highlight="DownloadHead">
- <span>{_("title.Title")}</span>
- <span>{_("title.Status")}</span>
- <span/>
- <span>{_("title.Progress")}</span>
- <span/>
- <span>{_("title.Speed")}</span>
- <span>{_("title.Time remaining")}</span>
- <span>{_("title.Source")}</span>
- </tr>
- <tr highlight="Download"><span><div style="min-height: 1ex; /* FIXME */"/></span></tr>
- <tr highlight="Download" key="totals" active="true">
- <td><span highlight="Title">{_("title.Totals")}:</span> <span key="total"/></td>
- <td/>
- <td highlight="DownloadButtons">
- <a highlight="Button" href="javascript:0" key="clear">{_("download.action.Clear")}</a>
- </td>
- <td highlight="DownloadProgress" key="progress">
- <span highlight="DownloadProgressHave" key="progressHave"
- />/<span highlight="DownloadProgressTotal" key="progressTotal"/>
- </td>
- <td highlight="DownloadPercent" key="percent"/>
- <td highlight="DownloadSpeed" key="speed"/>
- <td highlight="DownloadTime" key="time"/>
- <td/>
- </tr>
- </table>, this.document, this.nodes);
-
+ message: Class.Memoize(function () {
+
+ 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);
+
+ let start = Date.now();