# HG changeset patch # User Atul Varma # Date 1210986927 25200 # Node ID f380e3b3785d88a7f6c3409427fcb9e7d8bd1eb6 # Parent 7bba1e9f167d7ee8b3300c79fefa1ba59e6853c6 Finally got quotations in Curses and Troll looking decent, although it's potentially a somewhat fragile solution. diff -r 7bba1e9f167d -r f380e3b3785d gnusto.css --- a/gnusto.css Fri May 16 16:30:27 2008 -0700 +++ b/gnusto.css Fri May 16 18:15:27 2008 -0700 @@ -6,6 +6,19 @@ margin-bottom: 8px; } +.buffered-window { + width: 640px; + text-align: center; + margin: 0 auto; + font-family: monaco; + font-size: 10px; + top: 0px; + left: 0px; + position: fixed; + z-index: 0; + line-height: 12px; +} + #top-window { width: 640px; text-align: center; @@ -17,6 +30,7 @@ top: 0px; left: 0px; position: fixed; + z-index: 1; } #content { diff -r 7bba1e9f167d -r f380e3b3785d gnusto.html --- a/gnusto.html Fri May 16 16:30:27 2008 -0700 +++ b/gnusto.html Fri May 16 18:15:27 2008 -0700 @@ -9,6 +9,7 @@
+
diff -r 7bba1e9f167d -r f380e3b3785d web-zui.js --- a/web-zui.js Fri May 16 16:30:27 2008 -0700 +++ b/web-zui.js Fri May 16 18:15:27 2008 -0700 @@ -92,6 +92,7 @@ var callback = self._currentCallback; self._currentCallback = null; + self._removeBufferedWindows(); callback(keyCode); } } @@ -124,6 +125,7 @@ ('' + finalInputString + '
') ); + self._removeBufferedWindows(); callback(finalInputString); } } @@ -139,6 +141,14 @@ _windowResize: function() { var contentLeft = $("#content").get(0).offsetLeft + "px"; $("#top-window").get(0).style.left = contentLeft; + $(".buffered-window").css({left: contentLeft}); + }, + + _removeBufferedWindows: function() { + var windows = $(".buffered-window"); + windows.fadeOut("slow", function() { windows.remove(); }); + // A more conservative alternative to the above is: + // $("#buffered-windows").empty(); }, _eraseBottomWindow: function() { @@ -248,6 +258,24 @@ $("#top-window").get(0), self); } else { + // Z-Machine games are peculiar in regards to the way they + // sometimes overlay quotations on top of the current text; + // we basically want to preserve any text that is already in + // the top window "below" the layer of the top window, so + // that anything it doesn't write over remains visible, at + // least (and this is an arbitrary decision on our part) + // until the user has entered some input. + + var newDiv = document.createElement("div"); + var html = $("#top-window").get(0).innerHTML; + newDiv.className = "buffered-window"; + newDiv.innerHTML = html; + $("#buffered-windows").append(newDiv); + + // Pretend the window was just resized, which will position + // the new buffered window properly on the x-axis. + self._windowResize(); + self._console.resize(numlines); } }