diff options
author | Kris Maglione <maglione.k@gmail.com> | 2010-12-23 20:25:09 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2010-12-23 20:25:09 -0500 |
commit | 909a6583386203d54d4222c5c552a52303b8e2fb (patch) | |
tree | 952651c25847e79fbf7dc7852a185c2cab34a5b6 /common/content/statusline.js | |
parent | c66701339fe5a375b0d609ae1b9b731ac2430ca3 (diff) | |
download | pentadactyl-909a6583386203d54d4222c5c552a52303b8e2fb.tar.gz |
Some minor improvements to the previous changeset.
--HG--
branch : bootstrapped
Diffstat (limited to 'common/content/statusline.js')
-rw-r--r-- | common/content/statusline.js | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/common/content/statusline.js b/common/content/statusline.js index acd906ed..0d1a2f9d 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -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[ |