1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 17:47:59 +01:00

Death to E4X and stuff.

This commit is contained in:
Kris Maglione
2012-11-27 23:34:16 -08:00
parent df81bcb1f9
commit 621ff6a37a
12 changed files with 44 additions and 43 deletions

View File

@@ -4,7 +4,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";
/** @scope modules */

View File

@@ -4,7 +4,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";
// also includes methods for dealing with keywords and search engines
var Bookmarks = Module("bookmarks", {

View File

@@ -4,7 +4,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";
/** @scope modules */

View File

@@ -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";
function checkFragment() {
document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent;

View File

@@ -4,7 +4,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";
/** @scope modules */
/** @instance hints */
@@ -312,11 +312,11 @@ var HintSession = Class("HintSession", CommandMode, {
let body = doc.body || doc.querySelector("body");
if (body) {
let fragment = DOM(<div highlight="hints"/>, doc).appendTo(body);
let fragment = DOM(["div", { highlight: "hints" }], doc).appendTo(body);
fragment.style.height; // Force application of binding.
let container = doc.getAnonymousElementByAttribute(fragment[0], "anonid", "hints") || fragment[0];
let baseNode = DOM(<span highlight="Hint" style="display: none;"/>, doc)[0];
let baseNode = DOM(["span", { highlight: "Hint", style: "display: none;" }], doc)[0];
let mode = this.hintMode;
let res = mode.matcher(doc);
@@ -593,7 +593,7 @@ var HintSession = Class("HintSession", CommandMode, {
if (!rect)
continue;
hint.imgSpan = DOM(<span highlight="Hint" dactyl:hl="HintImage" xmlns:dactyl={NS}/>, doc).css({
hint.imgSpan = DOM(["span", { highlight: "Hint", "dactyl:hl": "HintImage" }], doc).css({
display: "none",
left: (rect.left + offsetX) + "px",
top: (rect.top + offsetY) + "px",

View File

@@ -4,7 +4,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";
var History = Module("history", {
SORT_DEFAULT: "-date",

View File

@@ -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";
/** @scope modules */

View File

@@ -480,33 +480,29 @@ var Mappings = Module("mappings", {
return maps;
}
let list = <table>
<tr highlight="Title">
<td/>
<td style="padding-right: 1em;">{_("title.Mode")}</td>
<td style="padding-right: 1em;">{_("title.Command")}</td>
<td style="padding-right: 1em;">{_("title.Action")}</td>
</tr>
<col style="min-width: 6em; padding-right: 1em;"/>
{
template.map(hives, function ([hive, maps]) let (i = 0)
<tr style="height: .5ex;"/> +
template.map(maps, function (map)
template.map(map.names, function (name)
<tr>
<td highlight="Title">{!i++ ? hive.name : ""}</td>
<td>{modeSign}</td>
<td>{name}</td>
<td>{map.rhs || map.action.toSource()}</td>
</tr>)) +
<tr style="height: .5ex;"/>)
}
</table>;
let list = ["table", {},
["tr", { highlight: "Title" },
["td", {}],
["td", { style: "padding-right: 1em;" }, _("title.Mode")],
["td", { style: "padding-right: 1em;" }, _("title.Command")],
["td", { style: "padding-right: 1em;" }, _("title.Action")]],
["col", { style: "min-width: 6em; padding-right: 1em;" }],
hives.map(function ([hive, maps]) let (i = 0) [
["tr", { style: "height: .5ex;" }],
maps.map(function (map)
map.names.map(function (name)
["tr", {},
["td", { highlight: "Title" }, !i++ ? hive.name : ""],
["td", {}, modeSign],
["td", {}, name],
["td", {}, map.rhs || map.action.toSource()]])),
["tr", { style: "height: .5ex;" }]])]
// TODO: Move this to an ItemList to show this automatically
if (list.*.length() === list.text().length() + 2)
dactyl.echomsg(_("map.none"));
else
// E4X-FIXME
// // TODO: Move this to an ItemList to show this automatically
// if (list.*.length() === list.text().length() + 2)
// dactyl.echomsg(_("map.none"));
// else
commandline.commandOutput(list);
}
}, {

View File

@@ -4,7 +4,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";
/**
* @scope modules

View File

@@ -4,7 +4,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";
/** @scope modules */

View File

@@ -78,10 +78,14 @@ var Tabs = Module("tabs", {
if (!node("dactyl-tab-number")) {
let img = node("tab-icon-image");
if (img) {
let dom = DOM(<xul xmlns:xul={XUL} xmlns:html={XHTML}>
<xul:hbox highlight="tab-number"><xul:label key="icon" align="center" highlight="TabIconNumber" class="dactyl-tab-icon-number"/></xul:hbox>
<xul:hbox highlight="tab-number"><html:div key="label" highlight="TabNumber" class="dactyl-tab-number"/></xul:hbox>
</xul>.elements(), document).appendTo(img.parentNode);
let dom = DOM([
["xul:hbox", { highlight: "tab-number" },
["xul:label", { key: "icon", align: "center", highlight: "TabIconNumber",
class: "dactyl-tab-icon-number" }]],
["xul:hbox", { highlight: "tab-number" },
["html:div", { key: "label", highlight: "TabNumber",
class: "dactyl-tab-number" }]]],
document).appendTo(img.parentNode);
update(tab, {
get dactylOrdinal() Number(dom.nodes.icon.value),

View File

@@ -1629,6 +1629,7 @@ var DOM = Class("DOM", {
}, {
namespaces: {
"": "http://www.w3.org/1999/xhtml",
dactyl: String(NS),
html: "http://www.w3.org/1999/xhtml",
xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
}