Mercurial > web-gnusto
changeset 46:b427293b62e4
The top window and bottom window are now placed at a proper distance apart from each other.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Fri, 16 May 2008 00:13:16 -0700 |
parents | b878753fd3b9 |
children | 1effb310d6ee |
files | console.js gnusto.css trivial-zui.js |
diffstat | 3 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/console.js Thu May 15 23:49:12 2008 -0700 +++ b/console.js Fri May 16 00:13:16 2008 -0700 @@ -1,8 +1,9 @@ -function Console(width, height, element) { +function Console(width, height, element, observer) { this._width = width; this._height = height; this._element = element; this._pos = [0, 0]; + this._observer = observer; this.clear(); } @@ -55,6 +56,7 @@ string += "<br/>"; } this._element.innerHTML = string; + this._observer.onConsoleRender(); }, close: function() {
--- a/gnusto.css Thu May 15 23:49:12 2008 -0700 +++ b/gnusto.css Fri May 16 00:13:16 2008 -0700 @@ -2,6 +2,8 @@ font-family: palatino, georgia, verdana, arial, sans-serif; text-align: center; overflow: hidden; + margin-top: 0px; + margin-bottom: 8px; } #top-window {
--- a/trivial-zui.js Thu May 15 23:49:12 2008 -0700 +++ b/trivial-zui.js Fri May 16 00:13:16 2008 -0700 @@ -13,6 +13,11 @@ var self = this; this.__proto__ = { + onConsoleRender: function() { + var height = $("#top-window").get(0).clientHeight; + $("#content").get(0).style.padding = "" + height + "px 0 0 0"; + }, + _windowKeypress: function(event) { if ($("#current-input").length == 0) { // We're not waiting for a line of input, but we may @@ -145,7 +150,8 @@ } else self._console = new Console(self._size[0], numlines, - $("#top-window").get(0)); + $("#top-window").get(0), + self); }, onPrint: function(output) {