1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-06 09:35:47 +01:00

Some minor improvements to the previous changeset.

--HG--
branch : bootstrapped
This commit is contained in:
Kris Maglione
2010-12-23 20:25:09 -05:00
parent c66701339f
commit 909a658338
3 changed files with 39 additions and 43 deletions

View File

@@ -9,12 +9,9 @@
-->
<?xml-stylesheet href="chrome://dactyl/skin/dactyl.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "dactyl.dtd" [
<!ENTITY and "&amp;&amp;">
<!ENTITY dactyl.content "chrome://dactyl/content/">
<!ENTITY commandline "if (window.dactyl) return dactyl.modules.commandline">
<!ENTITY events "if (window.dactyl &and; dactyl.modules.loaded.events) return dactyl.modules.events">
<!ENTITY status "dactyl-statusline-field-">
]>
<overlay id="dactyl"

View File

@@ -12,52 +12,51 @@ const StatusLine = Module("statusline", {
init: function () {
let _commandline = "if (window.dactyl) return dactyl.modules.commandline";
let _status = "dactyl-statusline-field-";
let append = <e4x xmlns={XUL} xmlns:dactyl={NS}>
<statusbar id="status-bar" dactyl:highlight="StatusLine StatusNormal">
<!-- insertbefore="dactyl.statusBefore;" insertafter="dactyl.statusAfter;" -->
<hbox
style="background: inherit;" key="container" flex="1" hidden="false" align="center">
<stack orient="horizontal" align="stretch" flex="1" class="dactyl-container" dactyl:highlight="CmdLine StatusCmdLine">
<hbox class="dactyl-container" dactyl:highlight="CmdLine StatusCmdLine">
<label class="plain" key="mode" crop="end" collapsed="true"/>
<stack flex="1" class="dactyl-container" dactyl:highlight="CmdLine StatusCmdLine">
<textbox class="plain" key="url" crop="end" flex="1" readonly="true"/>
<textbox class="plain" key="message" crop="end" flex="1" readonly="true" dactyl:highlight="Normal StatusNormal"/>
</stack>
</hbox>
<hbox key="commandline" hidden="false" class="dactyl-container" dactyl:highlight="Normal StatusNormal" collapsed="true">
<label key="commandline-prompt" class="dactyl-commandline-prompt plain" flex="0" crop="end" value="" collapsed="true"/>
<textbox key="commandline-command" class="dactyl-commandline-command plain" flex="1" type="text" timeout="100"
oninput={_commandline + ".onEvent(event);"} onkeyup={_commandline + ".onEvent(event);"}
onfocus={_commandline + ".onEvent(event);"} onblur={_commandline + ".onEvent(event);"}/>
</hbox>
</stack>
<label class="plain" key="inputbuffer" flex="0"/>
<label class="plain" key="progress" flex="0"/>
<label class="plain" key="tabcount" flex="0"/>
<label class="plain" key="bufferposition" flex="0"/>
<label class="plain" key="zoomlevel" flex="0"/>
</hbox>
<!-- just hide them since other elements expect them -->
<statusbarpanel id="statusbar-display" hidden="true"/>
<statusbarpanel id="statusbar-progresspanel" hidden="true"/>
</statusbar>
</e4x>;
for each (let attr in append..@key)
attr.parent().@id = "dactyl-statusline-field-" + attr;
util.overlayWindow(window, {
append: <e4x xmlns={XUL} xmlns:dactyl={NS}>
<statusbar id="status-bar" dactyl:highlight="StatusLine StatusNormal">
<!-- insertbefore="dactyl.statusBefore;" insertafter="dactyl.statusAfter;" -->
<hbox
style="background: inherit;" id={_status + "container"} flex="1" hidden="false" align="center">
<stack orient="horizontal" align="stretch" flex="1" class="dactyl-container" dactyl:highlight="CmdLine StatusCmdLine">
<hbox class="dactyl-container" dactyl:highlight="CmdLine StatusCmdLine">
<label class="plain" id={_status + "mode"} crop="end" collapsed="true"/>
<stack flex="1" class="dactyl-container" dactyl:highlight="CmdLine StatusCmdLine">
<textbox class="plain" id={_status + "url"} crop="end" flex="1" readonly="true"/>
<textbox class="plain" id={_status + "message"} crop="end" flex="1" readonly="true" dactyl:highlight="Normal StatusNormal"/>
</stack>
</hbox>
<hbox id={_status + "commandline"} hidden="false" class="dactyl-container" dactyl:highlight="Normal StatusNormal" collapsed="true">
<label id={_status + "commandline-prompt"} class="dactyl-commandline-prompt plain" flex="0" crop="end" value="" collapsed="true"/>
<textbox id={_status + "commandline-command"} class="dactyl-commandline-command plain" flex="1" type="text" timeout="100"
oninput={_commandline + ".onEvent(event);"} onkeyup={_commandline + ".onEvent(event);"}
onfocus={_commandline + ".onEvent(event);"} onblur={_commandline + ".onEvent(event);"}/>
</hbox>
</stack>
<label class="plain" id={_status + "inputbuffer"} flex="0"/>
<label class="plain" id={_status + "progress"} flex="0"/>
<label class="plain" id={_status + "tabcount"} flex="0"/>
<label class="plain" id={_status + "bufferposition"} flex="0"/>
<label class="plain" id={_status + "zoomlevel"} flex="0"/>
</hbox>
<!-- just hide them since other elements expect them -->
<statusbarpanel id="statusbar-display" hidden="true"/>
<statusbarpanel id="statusbar-progresspanel" hidden="true"/>
</statusbar>
</e4x>.*
objects: this.widgets = { get status() this.container },
append: append.*
});
this._statusLine = document.getElementById("status-bar");
this.statusBar = document.getElementById("addon-bar") || this._statusLine;
this.statusBar.collapsed = true; // it is later restored unless the user sets laststatus=0
// our status bar fields
this.widgets = array(["container", "url", "inputbuffer", "progress", "tabcount", "bufferposition", "zoomlevel"]
.map(function (field) [field, document.getElementById("dactyl-statusline-field-" + field)]))
.toObject();
this.widgets.status = this.widgets.container;
if (this.statusBar.localName == "toolbar") {
styles.system.add("addon-bar", config.styleableChrome, <css><![CDATA[

View File

@@ -916,7 +916,7 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
for (let [elem, xml, attr] in iterator) {
if (elem = window.document.getElementById(elem)) {
fn(elem, util.xmlToDom(xml, window.document));
fn(elem, util.xmlToDom(xml, window.document, obj.objects));
for each (let attr in attr || [])
elem.setAttributeNS(attr.namespace(), attr.localName(), attr);
}