// Copyright (c) 2006-2008 by Martin Stubenschrott // Copyright (c) 2007-2011 by Doug Kearns // Copyright (c) 2008-2011 by Kris Maglione // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. "use strict"; var MOW = Module("mow", { init: function init() { this._resize = Timer(20, 400, function _resize() { if (this.visible) this.resize(false); if (this.visible && isinstance(modes.main, modes.OUTPUT_MULTILINE)) this.updateMorePrompt(); }, this); this._timer = Timer(20, 400, function _timer() { if (modes.have(modes.OUTPUT_MULTILINE)) { this.resize(true); if (options["more"] && this.isScrollable(1)) { // start the last executed command's output at the top of the screen let elements = this.document.getElementsByClassName("ex-command-output"); elements[elements.length - 1].scrollIntoView(true); } else this.body.scrollTop = this.body.scrollHeight; dactyl.focus(this.window); this.updateMorePrompt(); } }, this); events.listen(window, this, "windowEvents"); modules.mow = this; let fontSize = util.computedStyle(document.documentElement).fontSize; styles.system.add("font-size", "dactyl://content/buffer.xhtml", "body { font-size: " + fontSize + "; } \ html|html > xul|scrollbar { visibility: collapse !important; }", true); XML.ignoreWhitespace = true; util.overlayWindow(window, { objects: { eventTarget: this }, append: