Created
November 21, 2011 13:00
-
-
Save caisui/1382563 to your computer and use it in GitHub Desktop.
liberator-overlay-ext の 残骸
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mapping の 当て方 | |
:js mappings.addUserMap([modes.COMMAND_LINE], ["<C-g>"], "toggle completions list", function () plugins.toggleFloatBox.toggleBox()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
const self = this; | |
const className = "box-transparent"; | |
mappings.addUserMap([modes.COMMAND_LINE], ["<C-g>"], "toggle completions list", function () self.toggleBox()); | |
var style = document.createElementNS(XHTML, "style"); | |
style.appendChild(document.createTextNode(<![CDATA[ | |
.@@ { | |
max-height: 10px!important; | |
} | |
]]>.toString().replace("@@", className))); | |
document.documentElement.appendChild(style); | |
this.__defineGetter__("compBox", function () document.getElementById("liberator-completions").parentNode); | |
this.__defineGetter__("mOutBox", function () document.getElementById("liberator-multiline-output").parentNode); | |
this.toggleBox = function () { | |
let dom1 = compBox; | |
let dom2 = mOutBox; | |
if (dom1.classList.contains(className)) { | |
if (dom2.collapsed || dom2.classList.contains(className)) { | |
dom1.classList.remove(className); | |
dom2.classList.remove(className); | |
} else | |
dom2.classList.add(className); | |
} else | |
dom1.classList.add(className); | |
}; | |
function modeChange ([oldMode], [newMode]) { | |
if (oldMode === modes.COMMAND_LINE) { | |
compBox.classList.remove(className); | |
mOutBox.classList.remove(className); | |
} | |
} | |
liberator.registerObserver("modeChange", modeChange); | |
this.onUnload = function () { | |
let p = style.parentNode; | |
if (p) p.removeChild(style); | |
liberator.unregisterObserver("modeChange", modeChange); | |
}; | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
plugin-container が 透過できないので、消す方向で