mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 20:17:59 +01:00
Death to E4X and stuff.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
/** @scope modules */
|
/** @scope modules */
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
// also includes methods for dealing with keywords and search engines
|
// also includes methods for dealing with keywords and search engines
|
||||||
var Bookmarks = Module("bookmarks", {
|
var Bookmarks = Module("bookmarks", {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
/** @scope modules */
|
/** @scope modules */
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
function checkFragment() {
|
function checkFragment() {
|
||||||
document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent;
|
document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
/** @scope modules */
|
/** @scope modules */
|
||||||
/** @instance hints */
|
/** @instance hints */
|
||||||
@@ -312,11 +312,11 @@ var HintSession = Class("HintSession", CommandMode, {
|
|||||||
|
|
||||||
let body = doc.body || doc.querySelector("body");
|
let body = doc.body || doc.querySelector("body");
|
||||||
if (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.
|
fragment.style.height; // Force application of binding.
|
||||||
let container = doc.getAnonymousElementByAttribute(fragment[0], "anonid", "hints") || fragment[0];
|
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 mode = this.hintMode;
|
||||||
let res = mode.matcher(doc);
|
let res = mode.matcher(doc);
|
||||||
@@ -593,7 +593,7 @@ var HintSession = Class("HintSession", CommandMode, {
|
|||||||
if (!rect)
|
if (!rect)
|
||||||
continue;
|
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",
|
display: "none",
|
||||||
left: (rect.left + offsetX) + "px",
|
left: (rect.left + offsetX) + "px",
|
||||||
top: (rect.top + offsetY) + "px",
|
top: (rect.top + offsetY) + "px",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
var History = Module("history", {
|
var History = Module("history", {
|
||||||
SORT_DEFAULT: "-date",
|
SORT_DEFAULT: "-date",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
/** @scope modules */
|
/** @scope modules */
|
||||||
|
|
||||||
|
|||||||
@@ -480,34 +480,30 @@ var Mappings = Module("mappings", {
|
|||||||
return maps;
|
return maps;
|
||||||
}
|
}
|
||||||
|
|
||||||
let list = <table>
|
let list = ["table", {},
|
||||||
<tr highlight="Title">
|
["tr", { highlight: "Title" },
|
||||||
<td/>
|
["td", {}],
|
||||||
<td style="padding-right: 1em;">{_("title.Mode")}</td>
|
["td", { style: "padding-right: 1em;" }, _("title.Mode")],
|
||||||
<td style="padding-right: 1em;">{_("title.Command")}</td>
|
["td", { style: "padding-right: 1em;" }, _("title.Command")],
|
||||||
<td style="padding-right: 1em;">{_("title.Action")}</td>
|
["td", { style: "padding-right: 1em;" }, _("title.Action")]],
|
||||||
</tr>
|
["col", { style: "min-width: 6em; padding-right: 1em;" }],
|
||||||
<col style="min-width: 6em; padding-right: 1em;"/>
|
hives.map(function ([hive, maps]) let (i = 0) [
|
||||||
{
|
["tr", { style: "height: .5ex;" }],
|
||||||
template.map(hives, function ([hive, maps]) let (i = 0)
|
maps.map(function (map)
|
||||||
<tr style="height: .5ex;"/> +
|
map.names.map(function (name)
|
||||||
template.map(maps, function (map)
|
["tr", {},
|
||||||
template.map(map.names, function (name)
|
["td", { highlight: "Title" }, !i++ ? hive.name : ""],
|
||||||
<tr>
|
["td", {}, modeSign],
|
||||||
<td highlight="Title">{!i++ ? hive.name : ""}</td>
|
["td", {}, name],
|
||||||
<td>{modeSign}</td>
|
["td", {}, map.rhs || map.action.toSource()]])),
|
||||||
<td>{name}</td>
|
["tr", { style: "height: .5ex;" }]])]
|
||||||
<td>{map.rhs || map.action.toSource()}</td>
|
|
||||||
</tr>)) +
|
|
||||||
<tr style="height: .5ex;"/>)
|
|
||||||
}
|
|
||||||
</table>;
|
|
||||||
|
|
||||||
// TODO: Move this to an ItemList to show this automatically
|
// E4X-FIXME
|
||||||
if (list.*.length() === list.text().length() + 2)
|
// // TODO: Move this to an ItemList to show this automatically
|
||||||
dactyl.echomsg(_("map.none"));
|
// if (list.*.length() === list.text().length() + 2)
|
||||||
else
|
// dactyl.echomsg(_("map.none"));
|
||||||
commandline.commandOutput(list);
|
// else
|
||||||
|
commandline.commandOutput(list);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @scope modules
|
* @scope modules
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
/* use strict */
|
"use strict";
|
||||||
|
|
||||||
/** @scope modules */
|
/** @scope modules */
|
||||||
|
|
||||||
|
|||||||
@@ -78,10 +78,14 @@ var Tabs = Module("tabs", {
|
|||||||
if (!node("dactyl-tab-number")) {
|
if (!node("dactyl-tab-number")) {
|
||||||
let img = node("tab-icon-image");
|
let img = node("tab-icon-image");
|
||||||
if (img) {
|
if (img) {
|
||||||
let dom = DOM(<xul xmlns:xul={XUL} xmlns:html={XHTML}>
|
let dom = DOM([
|
||||||
<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" },
|
||||||
<xul:hbox highlight="tab-number"><html:div key="label" highlight="TabNumber" class="dactyl-tab-number"/></xul:hbox>
|
["xul:label", { key: "icon", align: "center", highlight: "TabIconNumber",
|
||||||
</xul>.elements(), document).appendTo(img.parentNode);
|
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, {
|
update(tab, {
|
||||||
get dactylOrdinal() Number(dom.nodes.icon.value),
|
get dactylOrdinal() Number(dom.nodes.icon.value),
|
||||||
|
|||||||
@@ -1629,6 +1629,7 @@ var DOM = Class("DOM", {
|
|||||||
}, {
|
}, {
|
||||||
namespaces: {
|
namespaces: {
|
||||||
"": "http://www.w3.org/1999/xhtml",
|
"": "http://www.w3.org/1999/xhtml",
|
||||||
|
dactyl: String(NS),
|
||||||
html: "http://www.w3.org/1999/xhtml",
|
html: "http://www.w3.org/1999/xhtml",
|
||||||
xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user