Skip to content

Instantly share code, notes, and snippets.

@teramako
Created March 26, 2011 14:16
Show Gist options
  • Save teramako/888309 to your computer and use it in GitHub Desktop.
Save teramako/888309 to your computer and use it in GitHub Desktop.
Vimperator のステータスラインにツールバーを導入するパッチ(caisuiさんのに+αしてCSSを追加したバージョン)
diff -r a9f2a2b7c47e common/content/commandline.js
--- a/common/content/commandline.js Fri Mar 25 23:04:39 2011 +0900
+++ b/common/content/commandline.js Sat Mar 26 23:14:58 2011 +0900
@@ -130,6 +130,7 @@
this._promptWidget = document.getElementById("liberator-commandline-prompt-text");
// the command bar which contains the current command
this._commandWidget = document.getElementById("liberator-commandline-command");
+ this._bottombarWidget = document.getElementById("liberator-bottombar");
this._messageBox = document.getElementById("liberator-message");
this._messageBox.addEventListener("transitionend", this.close.bind(this), false);
@@ -170,7 +171,7 @@
commands.repeat = command;
liberator.trapErrors(function () liberator.execute(command));
if (!(modes.main == modes.COMMAND_LINE && modes.extended == modes.PROMPT) &&
- commandline._commandlineWidget.style.opacity == "1" && options["messagetimeout"] != -1)
+ !commandline._bottombarWidget.classList.contains("commandhide") && options["messagetimeout"] != -1)
this.close();
//self._commandlineDisplayTimeoutID = self.setTimeout(function() { this.close(); }, 0);
});
@@ -493,7 +494,7 @@
* are under it.
*/
hide: function hide() {
- this._commandlineWidget.style.opacity = "0";
+ this._bottombarWidget.classList.add("commandhide");
this._setPrompt("");
this._commandWidget.blur();
},
@@ -502,7 +503,7 @@
* Make the command line visible, hiding the status messages below
*/
show: function () {
- this._commandlineWidget.style.opacity = "1";
+ this._bottombarWidget.classList.remove("commandhide");
this._commandWidget.focus();
},
diff -r a9f2a2b7c47e common/content/liberator.xul
--- a/common/content/liberator.xul Fri Mar 25 23:04:39 2011 +0900
+++ b/common/content/liberator.xul Sat Mar 26 23:14:58 2011 +0900
@@ -68,12 +68,26 @@
<hbox id="liberator-bottombar">
<stack orient="horizontal" align="stretch" class="liberator-container" flex="1">
- <hbox id="liberator-statusline" hidden="false" collapsed="false" class="liberator-container">
+ <toolbar id="liberator-statusline" hidden="false" collapsed="false" class="liberator-container"
+ toolbarname = "Liberator Statusline Toolbar"
+ toolboxid = "navigator-toolbox"
+ mode = "icons"
+ iconsize = "small"
+ defaulticonsize = "small"
+ lockiconsize = "small"
+ customizable = "true"
+ context = "toolbar-context-menu"
+ defaultset = "liberator-message-toolbar,liberator-status-toolbar"
+ >
<!-- the flex values are like they are to make sure the liberator-message always gets
maximum size up to the screen size, but still do not enlarge the whole window for very, very long strings-->
- <label class="plain" collapsed="false" id="liberator-message" flex="1" crop="end" liberator:highlight="Normal"/>
- <label class="plain" id="liberator-status" flex="10000000" crop="center" style="text-align: end;" liberator:highlight="StatusLine"/>
- </hbox>
+ <toolbaritem id="liberator-message-toolbar" flex="1">
+ <label class="plain" collapsed="false" id="liberator-message" flex="1" crop="end" liberator:highlight="Normal"/>
+ </toolbaritem>
+ <toolbaritem id="liberator-status-toolbar" flex="10000000" >
+ <label flex="1" class="plain" id="liberator-status" crop="center" style="text-align: end;" liberator:highlight="StatusLine"/>
+ </toolbaritem>
+ </toolbar>
<hbox id="liberator-commandline" class="liberator-container" liberator:highlight="CmdLine">
<label class="plain" id="liberator-commandline-prompt-text" liberator:highlight="PromptText" flex="0" crop="end" value="" collapsed="false"/>
<label class="plain" id="liberator-commandline-prompt" liberator:highlight="Prompt" flex="0" crop="none" value="" collapsed="false"/>
diff -r a9f2a2b7c47e common/skin/liberator.css
--- a/common/skin/liberator.css Fri Mar 25 23:04:39 2011 +0900
+++ b/common/skin/liberator.css Sat Mar 26 23:14:58 2011 +0900
@@ -94,16 +94,47 @@
#liberator-statusline {
font-family: monospace;
margin: 0px;
+ -moz-appearance: none;
/* padding: 2px;*/
}
/* all elements in the statusline and commandline need some padding to look good */
+#liberator-statusline {
+ border: none !important;
+ min-height: 17px !important;
+}
+#liberator-statusline :-moz-any(toolbarbutton, toolbaritem) {
+ border: none !important;
+ padding: 0 2px !important;
+ max-height: 17px;
+}
#liberator-statusline > *,
#liberator-commandline > * {
padding: 2px;
font-family: monospace;
}
+#liberator-bottombar.commandhide #liberator-commandline {
+ opacity: 0;
+}
+
+#liberator-statusline,
+#liberator-message-toolbar {
+ -moz-box-align: center;
+}
+#liberator-bottombar.commandhide:hover #liberator-commandline,
+#liberator-statusline[customizing="true"] ~ #liberator-commandline {
+ visibility: collapse;
+}
+#liberator-statusline[customizing="true"] #liberator-message-toolbar,
+#liberator-statusline[customizing="true"] #liberator-status-toolbar {
+ border: 1px dotted gray;
+ min-width: 1em;
+}
+
+#liberator-commandline.hide:hover {
+}
+
#liberator-commandline {
/*padding: 2px;*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment