(part of) a browser Glk

6 views
Skip to first unread message

Andrew Plotkin

unread,
Jun 8, 2008, 11:12:54 PM6/8/08
to
I see we're getting multiple Z-machine implementations running in web
browsers. Far be it from me to let Glk/Glulx fall too far behind. :)

I *am* behind, but I want to show off what I've got. Which is... the
HTML/CSS/Javascript half of a web-based Glulx interpreter.

<http://eblong.com/zarf/glk/remdemo/test.html>

This is not actually hooked up to a Glulx interpreter. It's the front
end. I've got a fake game in there -- also written in Javascript --
which accepts a few one-word commands to exercise the display
capabilities. Check it out.

The *back* end (once I write it) will be a Glk library that runs under
a web server (via CGI script). Replace the fake game code with an AJAX
call, and presto -- any Glk interpreter running as a web app.

But this front end doesn't have to be used that way. It could just as
easily be hooked up to a real game interpreter written in Javascript.
Then you'd have a client-side web app, like Parchment. (I will
eventually document the AJAX-or-Javascript API that this thing uses.
It's morally equivalent to the Glk API, but rearranged to allow for
the batch-mode interaction pattern. Details to come.)

This is a work in progress. Implemented so far: grid and buffer
windows, line input, multiple windows, different styles. Character
input is the only critical feature I have left. (Graphics, sound, and
timed input count as non-critical features.) There's also a big
handful of UI annoyances to clear up.

Tested only in Safari 3 and (Mac) Firefox 2. I expect massive failure
on IE. This is my first big HTML/Javascript app -- at my age! -- so
I've done a lot of flailing, particular with keyboard and mouse event
handlers.

(Tested on iPhone. Result: massive failure. :)

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
You don't become a tyranny by committing torture. If you plan for torture,
argue in favor of torture, set up legal justifications for torturing
someday, then the moral rot has *already* set in.

namekuseijin

unread,
Jun 8, 2008, 11:56:55 PM6/8/08
to
> LOOK
You see some truly exciting time ahead for interactive-fiction, since
uncautioned people can start playing them right from their browser,
without having to deal with installing interpreters and feeding them
the games.

> CHEER
Yes, indeed!

Aaron A. Reed

unread,
Jun 9, 2008, 12:03:43 AM6/9/08
to

Oh, very cool. :) Great that Glulx gets to play with all the Web 2.0
goodies as well!

Especially since I expect any future projects of mine will be Glulx,
too. (I'm trying to coin a phrase starting with "Once you go Glulx..."
but I'm having a hard time finding anything that rhymes with Glulx.)

All these new web terps are niftastic. Keep it up, oh clever
people! :)

--Aaron

var...@gmail.com

unread,
Jun 9, 2008, 2:28:37 AM6/9/08
to
Very cool!! I don't know much about Glulx, but if there's any way I
can help out with anything, just ask.

In regards to getting stuff to work on MSIE, I actually recommend that
you try doing that once you hit a good stopping point (which you seem
to be at right now). Parchment was my first "real" JS web-app too so
I didn't have any idea how different MSIE was from the rest of the
world. After getting it to work on MSIE I learned lots of things that
would've been useful to have known a little earlier, like the fact
that strings can't be indexed like arrays in MS JScript, even though
they can be in JavaScript. Now that I have some idea of the quirks
that MSIE has, it's not a big scary question-mark in my mind and it's
a lot easier for me to write code that works in it and all the other
browsers the first time through.

That said, your demo actually gets relatively far in MSIE before
bailing--it shows the loading screen and puts up some fields before
crashing at the beginning of calling the onblur() event handler.

Looking forward to seeing this evolve!

- Atul

Jimmy Maher

unread,
Jun 9, 2008, 9:06:40 AM6/9/08
to
Aaron A. Reed wrote:

> Especially since I expect any future projects of mine will be Glulx,
> too. (I'm trying to coin a phrase starting with "Once you go Glulx..."
> but I'm having a hard time finding anything that rhymes with Glulx.)

"Once you go to Glulx,
Everything else just sux."

Kind of a slant rhyme, but what the hell...

--
Jimmy Maher
Editor, SPAG Magazine -- http://www.sparkynet.com/spag
Thank you for helping to keep text adventures alive!

Andrew Plotkin

unread,
Jun 9, 2008, 10:36:53 AM6/9/08
to
Here, var...@gmail.com <var...@gmail.com> wrote:
>
> In regards to getting stuff to work on MSIE, I actually recommend that
> you try doing that once you hit a good stopping point (which you seem
> to be at right now).

Not quite, but in a few days.

The only copy of IE I have is what came with an XP SP1 installation
from 2003... IE6, I guess that must be. I never use it, because, well,
duh. But I suppose that's no excuse now. :)

> That said, your demo actually gets relatively far in MSIE before
> bailing--it shows the loading screen and puts up some fields before
> crashing at the beginning of calling the onblur() event handler.

Interesting. Must be the way the event properties are different
(wrong). Thanks.

I'm using one of those "smooth over the differences" libraries --
Prototype, in my case. It's quite possible that I'm not using it very
well.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

When Bush says "Stay the course," what he means is "I don't know what to
do next." He's been saying this for years now.

Rikard Peterson

unread,
Jun 9, 2008, 12:20:08 PM6/9/08
to
In article <jNmdnZFGLJWNttDV...@posted.grandecom>,
Jimmy Maher <mah...@SPAMgrandecom.net> wrote:

> Aaron A. Reed wrote:
>
> > (I'm trying to coin a phrase starting with "Once you go Glulx..."
> > but I'm having a hard time finding anything that rhymes with Glulx.)
>
> "Once you go to Glulx,
> Everything else just sux."
>
> Kind of a slant rhyme, but what the hell...

Sulks?

namekuseijin

unread,
Jun 9, 2008, 12:23:43 PM6/9/08
to
On 9 jun, 13:20, Rikard Peterson <trumgott...@bigfoot.com> wrote:
> In article <jNmdnZFGLJWNttDVnZ2dnUVZ_trin...@posted.grandecom>,

>  Jimmy Maher <mahe...@SPAMgrandecom.net> wrote:
>
> > Aaron A. Reed wrote:
>
> > > (I'm trying to coin a phrase starting with "Once you go Glulx..."
> > > but I'm having a hard time finding anything that rhymes with Glulx.)
>
> > "Once you go to Glulx,
> > Everything else just sux."
>
> > Kind of a slant rhyme, but what the hell...
>
> Sulks?

for some reason, I feel compelled to always spell Glulx as glulux. :)

JDC

unread,
Jun 9, 2008, 2:09:58 PM6/9/08
to
On Jun 9, 12:20 pm, Rikard Peterson <trumgott...@bigfoot.com> wrote:
> In article <jNmdnZFGLJWNttDVnZ2dnUVZ_trin...@posted.grandecom>,
> Jimmy Maher <mahe...@SPAMgrandecom.net> wrote:
> > Aaron A. Reed wrote:
>
> > > (I'm trying to coin a phrase starting with "Once you go Glulx..."
> > > but I'm having a hard time finding anything that rhymes with Glulx.)
>
> > "Once you go to Glulx,
> > Everything else just sux."
>
> > Kind of a slant rhyme, but what the hell...
>
> Sulks?

How about 'orange'?

This looks very cool. As noted above, there really does seem to be a
groundswell of browser-based IF work going on, and this could really
open things up for more casual players.

One thing I would like to see (in all browser-based interpreters, not
just this) is the ability to resize the game window inside of the
broswer window, i.e., have the game running in a resizable frame or
something so that you could shrink the width to a comfortable size
without having to shrink the whole browser window (which I prefer not
to do, especially when I have a bunch of tabs open).

-JDC

Andrew Plotkin

unread,
Jun 9, 2008, 4:12:18 PM6/9/08
to
Here, JDC <jd...@psu.edu> wrote:
>
> This looks very cool. As noted above, there really does seem to be a
> groundswell of browser-based IF work going on, and this could really
> open things up for more casual players.
>
> One thing I would like to see (in all browser-based interpreters, not
> just this) is the ability to resize the game window inside of the
> broswer window, i.e., have the game running in a resizable frame or
> something so that you could shrink the width to a comfortable size
> without having to shrink the whole browser window (which I prefer not
> to do, especially when I have a bunch of tabs open).

I set mine up to lay out all the game content in a <div>, whose size
is controlled by the usual CSS rules. My demo just says "width: 100%;
height: 100%" for simplicity's sake; but if you added "max-width: ..."
then the width would be limited. Or you could use a fancier bit of
Javascript -- external to the game UI -- which gave you a resize bar.

Hm. I really need to figure out how to detect these size changes, so I
can alert the game code. I guess I can just keep polling the DOM every
second...

(I'm surprised none of the tabbed browsers offer a "resize-tab-inside-
window" control.)

Aris Katsaris

unread,
Jun 9, 2008, 9:07:10 PM6/9/08
to
On Jun 9, 6:12 am, Andrew Plotkin <erkyr...@eblong.com> wrote:
> This is a work in progress. Implemented so far: grid and buffer
> windows, line input, multiple windows, different styles. Character
> input is the only critical feature I have left. (Graphics, sound, and
> timed input count as non-critical features.)

Extreme coolness! -- however I'm hoping graphics will be eventually
implemented too. My current work in progress uses some graphics
as a critical part of one of the scenes of the game, not merely as
decoration and mood-setters.

-Aris Katsaris

Victor Gijsbers

unread,
Jun 10, 2008, 10:36:12 AM6/10/08
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Plotkin wrote:

> Tested only in Safari 3 and (Mac) Firefox 2. I expect massive failure
> on IE. This is my first big HTML/Javascript app -- at my age! -- so
> I've done a lot of flailing, particular with keyboard and mouse event
> handlers.
>
> (Tested on iPhone. Result: massive failure. :)

I can confirm that it works on Linux (Ubuntu 8.04) using the following
browsers:

* Firefox
* Seamonkey
* Epiphany

It doesn't work on the text-mode browser Lynx, but I didn't really
expect it to.

I haven't tried the other major Linux browser, Konqueror and Opera.

Regards,
Victor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFITpFcoiOrMwvIZLwRAoQ8AJsEJOkK0eAbPhD94lPAOXJJnfeBugCfTtv3
kDKfVYwaAP7C/TeE93JGpZA=
=o3WB
-----END PGP SIGNATURE-----

George Oliver

unread,
Jun 10, 2008, 10:43:42 AM6/10/08
to
On Jun 9, 1:12 pm, Andrew Plotkin <erkyr...@eblong.com> wrote:

>
> (I'm surprised none of the tabbed browsers offer a "resize-tab-inside-
> window" control.)
>
> --Z

I've read that Opera does allow that but I've never used Opera -- can
anyone confirm?

Andrew Plotkin

unread,
Jun 10, 2008, 10:52:36 AM6/10/08
to
Here, Victor Gijsbers <vic...@lilith.gotdns.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Andrew Plotkin wrote:
>
> > Tested only in Safari 3 and (Mac) Firefox 2. I expect massive failure
> > on IE. This is my first big HTML/Javascript app -- at my age! -- so
> > I've done a lot of flailing, particular with keyboard and mouse event
> > handlers.
> >
> > (Tested on iPhone. Result: massive failure. :)
>
> I can confirm that it works on Linux (Ubuntu 8.04) using the following
> browsers:
>
> * Firefox
> * Seamonkey
> * Epiphany

Thanks.

> It doesn't work on the text-mode browser Lynx, but I didn't really
> expect it to.

No, Lynx doesn't have Javascript. Although the next update will have a
message (visible under Lynx) which says "This requires a browser with
Javascript!"

> I haven't tried the other major Linux browser, Konqueror and Opera.

Konqueror, hey, I have that on this machine... a really old Konqueror
3.2.2. Hm. Nope, doesn't work. The windows and fields are laid out
correctly, but there's no text. That's weird.

I wonder if Konqueror is allergic to the "node.textContent = string"
method of DOM manipulation. That would be weird.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Victor Gijsbers

unread,
Jun 10, 2008, 11:14:45 AM6/10/08
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Plotkin wrote:

> Konqueror, hey, I have that on this machine... a really old Konqueror
> 3.2.2. Hm. Nope, doesn't work. The windows and fields are laid out
> correctly, but there's no text. That's weird.
>
> I wonder if Konqueror is allergic to the "node.textContent = string"
> method of DOM manipulation. That would be weird.

Installing Konqueror (either the KDE3 version or the new KDE4 version)
would involve me installing all the core components of the K Desktop
Environment, which I never use. I'd rather not do that, especially since
chances are that someone using KDE will read this and give you feedback.

But I'll do it anyway if nobody else replies to this post with some
Konqueror feedback.

Regards,
Victor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFITpploiOrMwvIZLwRAt7/AJ9rka1dfiNKRZ1fRPxTG55GU+dy2wCdEiy8
nhH1+oGsxvZbhTZLCFUFWPg=
=xHyl
-----END PGP SIGNATURE-----

John McCallum

unread,
Jun 10, 2008, 12:53:05 PM6/10/08
to
Hi,

Victor Gijsbers wrote:
> But I'll do it anyway if nobody else replies to this post with some
> Konqueror feedback.

Well it seems to work with Konqueror 3.5.9, albeit that it doesn't scroll
down to the bottom.

Firefox on my machine does scroll all the way to the bottom if the input
that generated the scroll was the same. If using 'both' the other window
doesn't scroll. Also of note is that if I select a window and start typing,
the first keypress is normally lost on the other window.

Opera (v9.27) works, but interestingly Opera displays less of the unicode
characters than Konqueror or Firefox (it doesn't display the Hirigana
characters) on the same machine... must use it's own font set. It also
doesn't scroll to the bottom as per Konqueror.

HTH.

Cheers,
John McCallum

Andrew Plotkin

unread,
Jun 10, 2008, 1:07:49 PM6/10/08
to
Here, John McCallum <john.m...@skipthisemerson.com> wrote:
> Hi,
>
> Victor Gijsbers wrote:
> > But I'll do it anyway if nobody else replies to this post with some
> > Konqueror feedback.
>
> Well it seems to work with Konqueror 3.5.9, albeit that it doesn't scroll
> down to the bottom.
>
> Firefox on my machine does scroll all the way to the bottom if the input
> that generated the scroll was the same. If using 'both' the other window
> doesn't scroll. Also of note is that if I select a window and start typing,
> the first keypress is normally lost on the other window.

Yes, I see all those problems myself. The scrolling is broken on all
browsers, and I am confident about fixing it.

The lost character is a great annoyance to me. If anybody knows more
about Javascript keypress events than me...?

The problem is that I'm intercepting keypress events on the window.
When I get one, I call input.focus(), and then let the event continue.
This does the right thing in Safari, but not Firefox.

Various experiments with capturing (non-bubbling) event handlers and
launching new events have all failed. I could append the character
directly to the input field's value, but that wouldn't really be
correct behavior: the input field's cursor isn't necessarily at the
end of its content.

Better than what happens now, I guess.

James Cunningham

unread,
Jun 10, 2008, 1:41:56 PM6/10/08
to

On Windows, Opera has a MDI that allows such a thing, yes, but it's
more like having child windows inside the primary browser window than
simple resizing. (Works neither on Macs nor, I think, Linux, though I
may be wrong about the latter.)

Best,
James

Emily Boegheim

unread,
Jun 10, 2008, 7:59:12 PM6/10/08
to

This is true, but it's not particularly obvious to the user, since by
default Opera maximises all tabs and hides the Window menu. To resize
a tab, you have to right-click on the tab and click "Restore", which
unmaximises the tab and lets you adjust it as you please.

Oh, and the test page works in Opera 9.5 (last build before the
release candidate), but after playing around with it for a while the
input box in the left-hand window would get misplaced. It would be
shifted up the window, usually but not always to the place of the last
prompt. I was playing around with the split/unsplit commands at the
time, so it might have had something to do with them.

Emily

Andrew Plotkin

unread,
Jun 10, 2008, 8:13:28 PM6/10/08
to
Here, Emily Boegheim <emily.b...@gmail.com> wrote:
>
> Oh, and the test page works in Opera 9.5 (last build before the
> release candidate), but after playing around with it for a while the
> input box in the left-hand window would get misplaced. It would be
> shifted up the window, usually but not always to the place of the last
> prompt. I was playing around with the split/unsplit commands at the
> time, so it might have had something to do with them.

Permanently, or did it move to the right place after the next input?

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

9/11 did change everything. Since 9/12, the biggest threat to American
society has been the American president. I'd call that a change.

Emily Boegheim

unread,
Jun 10, 2008, 9:09:29 PM6/10/08
to
On Jun 11, 8:13 am, Andrew Plotkin <erkyr...@eblong.com> wrote:

> Here, Emily Boegheim <emily.boegh...@gmail.com> wrote:
>
>
>
> > Oh, and the test page works in Opera 9.5 (last build before the
> > release candidate), but after playing around with it for a while the
> > input box in the left-hand window would get misplaced. It would be
> > shifted up the window, usually but not always to the place of the last
> > prompt. I was playing around with the split/unsplit commands at the
> > time, so it might have had something to do with them.
>
> Permanently, or did it move to the right place after the next input?

Permanently, until I cleared the window. As I remember, it happened
more than once, so it was getting further up the window each time it
happened.

Emily

Andrew Plotkin

unread,
Jun 11, 2008, 12:32:52 AM6/11/08
to
Here, Andrew Plotkin <erky...@eblong.com> wrote:
> Here, var...@gmail.com <var...@gmail.com> wrote:
> >
> > In regards to getting stuff to work on MSIE, I actually recommend that
> > you try doing that once you hit a good stopping point (which you seem
> > to be at right now).
>
> Not quite, but in a few days.
>
> The only copy of IE I have is what came with an XP SP1 installation
> from 2003... IE6, I guess that must be. I never use it, because, well,
> duh. But I suppose that's no excuse now. :)
>
> > That said, your demo actually gets relatively far in MSIE before
> > bailing--it shows the loading screen and puts up some fields before
> > crashing at the beginning of calling the onblur() event handler.
>
> Interesting. Must be the way the event properties are different
> (wrong). Thanks.

That is a fairly trivial problem, compared to the fact that all of
the windows are drawn with a height of one line. And none of the text
is visible.

(The layout issue isn't a result of the event-property thing -- it
still happens even if I remove all the problematic event handlers.)

I don't suppose anybody knows how to beat IE into submission to
absolutely positioned elements? An extremely simplified version of my
scheme is up at:
<http://eblong.com/zarf/glk/remdemo/layouttest.html>

This is a CSS-only (no script) layout -- a tan pane, with red markers
in two corners, and a white banner above that. You can resize the
window freely. Lovely in Safari/Firefox, completely gone in IE. If I
could get a version of that for IE6, I could start rebuilding my app
to suit.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

If the Bush administration hasn't thrown you in military prison
without trial, it's for one reason: they don't feel like it. Not
because of the Fifth Amendment.

Peter Mattsson

unread,
Jun 11, 2008, 5:52:24 AM6/11/08
to
On Jun 11, 5:32 am, Andrew Plotkin <erkyr...@eblong.com> wrote:
> I don't suppose anybody knows how to beat IE into submission to
> absolutely positioned elements? An extremely simplified version of my
> scheme is up at:
> <http://eblong.com/zarf/glk/remdemo/layouttest.html>

If you just want the scheme to work in IE7, changing the DOCTYPE to
XHTML/HTML4 Strict will do the trick, as this puts IE into what's
optimistically called "standards mode". The relevant lines are

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">

for HTML 4.01 and

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

for XHTML.

Getting the scheme to work in IE6 is a little trickier, as it doesn't
support specifying both top and bottom to stretch an absolutely-
positioned div. (In this case, I don't blame it: I don't think the
standard specifies what should happen if you do this, and ignoring one
of the properties -- as IE6 seems to do -- is a legitimate option.)
The key here is to specify the height of gameport using an expression,

height:expression(document.body.clientHeight-50);

and set height:100% on the body tag to get clientHeight to return the
right value. It's non-standard markup, but all the other browsers seem
to ignore it.

I've put an updated version of the code up at

http://www.bespokerealities.com/layouttest.html

HTH,

Peter

Andrew Plotkin

unread,
Jun 11, 2008, 11:29:33 AM6/11/08
to

Thank you! I will try to incorporate this wisdom. You are a hero of
the revolution.

I have a suspicion why the text isn't appearing, too, although I need
to dig into Prototype to be sure.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

If the Bush administration hasn't shipped you to Syria for interrogation,
it's for one reason: they don't feel like it. Not because you're patriotic.

Andrew Plotkin

unread,
Jun 12, 2008, 1:27:54 AM6/12/08
to
Here, Andrew Plotkin <erky...@eblong.com> wrote:
>
> <http://eblong.com/zarf/glk/remdemo/test.html>

Moderate improvements. You can now test character input (type "char"
and then hit a key).

Paging and auto-scrolling (to the bottom) are still not implemented.

It still doesn't work right in IE6, but it should *look* right. The
windows and initial text should be laid out correctly. The only thing
that doesn't work is typing commands in... a small fix which
unfortunately I am too tired to fit into this margin.

(Seriously, margin problems have occupied me for the past two hours.
Blah. What happened to models where (left+width==right)? Was that such
a bad idea?)

I have hopes of it working right in IE7 but someone will have to
confirm that. I'm also pretty sure that Konqueror 3 is cool, not that
anyone has asked.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Bush's biggest lie is his claim that it's okay to disagree with him. As soon as
you *actually* disagree with him, he sadly explains that you're undermining
America, that you're giving comfort to the enemy. That you need to be silent.

Dave Holland

unread,
Jun 12, 2008, 5:01:28 AM6/12/08
to
Andrew Plotkin <erky...@eblong.com> wrote:
>Moderate improvements. You can now test character input (type "char"
>and then hit a key).

Looks better: in Firefox 2.0.0.13 (Debian) the first-character-eating
bug is gone. Well done! But when I split the window and click to move
focus to the other side, the flashing cursor disappears and doesn't
reappear until after a character is typed. Just a minor niggle, but the
lack of cursor is a tad disconcerting.

Cheers,
Dave

Andrew Plotkin

unread,
Jun 12, 2008, 10:56:38 AM6/12/08
to
Here, Dave Holland <da...@biff.org.uk> wrote:
> Andrew Plotkin <erky...@eblong.com> wrote:
> >Moderate improvements. You can now test character input (type "char"
> >and then hit a key).
>
> Looks better: in Firefox 2.0.0.13 (Debian) the first-character-eating
> bug is gone.

Yep.

> But when I split the window and click to move
> focus to the other side, the flashing cursor disappears and doesn't
> reappear until after a character is typed. Just a minor niggle, but the
> lack of cursor is a tad disconcerting.

I originally set it up so that it *did* move the cursor into the
field. However, that destroys your ability to select text in the
window. I found that very uncomfortable, so I rewrote it.

I tried highlighting the current input field in a couple of ways, but
they all seemed distracting in the normal (one-input-field) case. I
guess I could have it behave differently when two input fields are
available.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Gerald Aungst

unread,
Jun 12, 2008, 5:05:45 PM6/12/08
to
Andrew Plotkin wrote:
> Here, Andrew Plotkin <erky...@eblong.com> wrote:
>> <http://eblong.com/zarf/glk/remdemo/test.html>
>
> I have hopes of it working right in IE7 but someone will have to
> confirm that.
>

Unfortunately, no it doesn't work in IE7 (at least not on Vista). It
displays the blue header with "Not A Real Game" and the link for "How do
I play?" then it screeches to a halt. I get this error, if it helps you
nail down the problem:

Line: 1922
Char: 9
Error: Invalid argument
Code: 0

Anyone with IE8 want to give it a try and see if they finally got
something right...???

--
Gerald

Malcolm Beattie

unread,
Jun 12, 2008, 6:06:35 PM6/12/08
to
On 2008-06-12, Andrew Plotkin <erky...@eblong.com> wrote:
> Here, Andrew Plotkin <erky...@eblong.com> wrote:
>>
>> <http://eblong.com/zarf/glk/remdemo/test.html>
[...]

> I'm also pretty sure that Konqueror 3 is cool, not that
> anyone has asked.

With Konqueror 3.5.7 (Fedora 6), functionality seems all there but,
unlike with Firefox, the active text prompt ">" is followed by a
bordered box in which the cursor and typed text appears. The box
has a black border, a white background (hence visibly lighter than
the #ddffff of the rest of the window) and is 20 characters in size.

--Malcolm

--
Malcolm Beattie <mbea...@clueful.co.uk>

Andrew Plotkin

unread,
Jun 12, 2008, 11:39:50 PM6/12/08
to
Here, Gerald Aungst <gau...@gmail.com> wrote:
> Andrew Plotkin wrote:
> > Here, Andrew Plotkin <erky...@eblong.com> wrote:
> >> <http://eblong.com/zarf/glk/remdemo/test.html>
> >
> > I have hopes of it working right in IE7 but someone will have to
> > confirm that.
>
> Unfortunately, no it doesn't work in IE7 (at least not on Vista). It
> displays the blue header with "Not A Real Game" and the link for "How do
> I play?" then it screeches to a halt. I get this error, if it helps you
> nail down the problem:
>
> Line: 1922
> Char: 9
> Error: Invalid argument
> Code: 0

My HTML file doesn't have 1922 lines. I suppose it's referring to the
Prototype library. Line 1922 is in Element.setStyle(), which I do
call, but I don't see a bug in their issue tracker that relates.

Here, Malcolm Beattie <mbea...@clueful.co.uk> wrote:
>
> With Konqueror 3.5.7 (Fedora 6), functionality seems all there but,
> unlike with Firefox, the active text prompt ">" is followed by a
> bordered box in which the cursor and typed text appears. The box
> has a black border, a white background (hence visibly lighter than
> the #ddffff of the rest of the window) and is 20 characters in size.

I think I have to put that down to stylesheet quirks. I set the Input
CSS class to no-border, no-background, but if the browser really wants
to highlight the input field then it will.

My touchstone here is <http://goosh.org/>, another web app with a
command prompt. I've tried to steal all the tricks it uses to make the
input field invisible. If that works better on Konqueror than mine
does, let me know and I'll try to figure out which trick I missed. :)

Emily Boegheim

unread,
Jun 13, 2008, 6:23:39 AM6/13/08
to

I went back and tried this again to work out exactly when it happens.
After the scrollback in a window becomes long enough to require a
scrollbar, every command entered will leave the input line behind it.

Emily

Andrew Plotkin

unread,
Jun 13, 2008, 10:46:33 AM6/13/08
to
Here, Emily Boegheim <emily.b...@gmail.com> wrote:

Thanks. That helps.

If you move the scrollbar, does the misplaced input line move, or is
it fixed relative to the window overall?

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

If the Bush administration hasn't thrown you in military prison

without trial, it's for one reason: they don't feel like it. Not
because of the Fifth Amendment.

Emily Boegheim

unread,
Jun 13, 2008, 8:38:38 PM6/13/08
to
On Jun 13, 10:46 pm, Andrew Plotkin <erkyr...@eblong.com> wrote:
> Here, Emily Boegheim <emily.boegh...@gmail.com> wrote:
>
>
>
>
>
> > On Jun 11, 9:09 am, Emily Boegheim <emily.boegh...@gmail.com> wrote:
> > > On Jun 11, 8:13 am, Andrew Plotkin <erkyr...@eblong.com> wrote:
>
> > > > Here, Emily Boegheim <emily.boegh...@gmail.com> wrote:
>
> > > > > Oh, and the test page works in Opera 9.5 (last build before the
> > > > > release candidate), but after playing around with it for a while the
> > > > > input box in the left-hand window would get misplaced. It would be
> > > > > shifted up the window, usually but not always to the place of the last
> > > > > prompt. I was playing around with the split/unsplit commands at the
> > > > > time, so it might have had something to do with them.
>
> > > > Permanently, or did it move to the right place after the next input?
>
> > > Permanently, until I cleared the window. As I remember, it happened
> > > more than once, so it was getting further up the window each time it
> > > happened.
>
> > I went back and tried this again to work out exactly when it happens.
> > After the scrollback in a window becomes long enough to require a
> > scrollbar, every command entered will leave the input line behind it.
>
> Thanks. That helps.
>
> If you move the scrollbar, does the misplaced input line move, or is
> it fixed relative to the window overall?

It moves with the rest of the text.

Emily

Andrew Plotkin

unread,
Jun 15, 2008, 11:11:02 PM6/15/08
to

Yet more improvements. It behaves sanely under Firefox, Safari, and
IE6. I still don't have access to IE7 to test, so it probably hasn't
gotten any better there.

The code is more or less ready to wrap up as a Javascript library.
Namespace and all. I still need to write docs.

The big bug that remains is that the input field is misplaced in
certain circumstances. (After typing "split" in IE6; after the page
scrolls in Opera.) I will think about ways to deal with that.

(It happens because I'm positioning the input field absolutely, using
the measured coordinates of the last output line. This measurement
goes screwy if I've just changed the DOM. I can probably position the
field using some other scheme -- it's just a pain in the butt.)

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

namekuseijin

unread,
Jun 16, 2008, 3:33:10 PM6/16/08
to
On Jun 16, 12:11 am, Andrew Plotkin <erkyr...@eblong.com> wrote:
> > <http://eblong.com/zarf/glk/remdemo/test.html>
>
> Yet more improvements. It behaves sanely under Firefox, Safari, and
> IE6. I still don't have access to IE7 to test, so it probably hasn't
> gotten any better there.

I have IE7 at work, but sadly your site is blocked, as well as inform-
fiction.org and tads.org and also wurb. Clever guys.
Luckly, parchment.toolness.com is still relatively obscure. :)

Damien Neil

unread,
Jun 17, 2008, 5:48:23 AM6/17/08
to
Andrew Plotkin <erky...@eblong.com> wrote:
> I *am* behind, but I want to show off what I've got. Which is... the
> HTML/CSS/Javascript half of a web-based Glulx interpreter.

I've been fiddling around with Parchment's input handling. After some
thought, I concluded that the input model that you're using (an input
element with decorations turned off) is a better approach than the one
that Parchment currently takes (no input element, just raw key events).

I then became curious how difficult it would be to plug your browser Glk
implementation into Parchment's Z-code interpreter.

The answer: Surprisingly easy.

<http://www.misago.org/palimpsest/>

This is...well, "a work in progress" would be too kind. Consider it a
proof of concept. Parts of it work. Much of it doesn't. I don't know
how much more work I'll be putting into it, since I'd rather not
distract from Atul's excellent ongoing work on Parchment.

- Damien

Andrew Plotkin

unread,
Jun 17, 2008, 9:42:09 AM6/17/08
to
Here, Damien Neil <ne...@misago.org> wrote:
> Andrew Plotkin <erky...@eblong.com> wrote:
> > I *am* behind, but I want to show off what I've got. Which is... the
> > HTML/CSS/Javascript half of a web-based Glulx interpreter.
>
> I've been fiddling around with Parchment's input handling. After some
> thought, I concluded that the input model that you're using (an input
> element with decorations turned off) is a better approach than the one
> that Parchment currently takes (no input element, just raw key events).
>
> I then became curious how difficult it would be to plug your browser Glk
> implementation into Parchment's Z-code interpreter.
>
> The answer: Surprisingly easy.

Yay!

I was hoping this would be possible, but I expected to have to do it
myself. And if not, I expected to have to write a lot of documentation
first. :)

(I'm *writing* the documentation. Honest. I am impressed with your
fortitude at deciphering the game_... part of my demo -- that's not
commented at all, and one of my notes to myself in game_select() is
"De-ugify this math!")

Obviously my library is a work in progress *too*; I expect to update
it a couple more times before the worst bugs are fixed. Plus the math.

> <http://www.misago.org/palimpsest/>
>
> This is...well, "a work in progress" would be too kind. Consider it a
> proof of concept. Parts of it work. Much of it doesn't. I don't know
> how much more work I'll be putting into it, since I'd rather not
> distract from Atul's excellent ongoing work on Parchment.

Parchment is awesome -- have I not said that in public yet? -- and I
don't mean to compete with it. I am taking it as established that more
than one interpreter implementation is a good thing for applications,
so it's a good thing on the web.

Secretly, I mean to look at Atul's work on saving games, because I
haven't thought about that part at all yet.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

JDC

unread,
Jun 18, 2008, 2:10:58 AM6/18/08
to
On Jun 17, 5:48 am, Damien Neil <ne...@misago.org> wrote:
> I've been fiddling around with Parchment's input handling.  After some
> thought, I concluded that the input model that you're using (an input
> element with decorations turned off) is a better approach than the one
> that Parchment currently takes (no input element, just raw key events).
>
> I then became curious how difficult it would be to plug your browser Glk
> implementation into Parchment's Z-code interpreter.
>
> The answer: Surprisingly easy.
>
>   <http://www.misago.org/palimpsest/>

In case you're interested, this doesn't seem to work in Firefox 3.0
(Mac or Linux); the error console shows "window.console undefined" (in
function processBase64Zcode(content). Strangely, it didn't work for
me in Safari (Mac) the first time I tried it, but it is working for me
now (not sure what that means exactly). Looks very good...

(Aside to Zarf: There's a margin issue with your test in Firefox 3.0
(Mac): The moves counter runs off the side, sometimes. Seems to depend
on the window size; as I resize the window it sometimes stays in the
window and sometimes runs off the side). Yes, today is Firefox 3.0
day...

-JDC

Andrew Plotkin

unread,
Jun 18, 2008, 12:13:52 PM6/18/08
to
Here, JDC <jd...@psu.edu> wrote:
> On Jun 17, 5:48 am, Damien Neil <ne...@misago.org> wrote:
> > I've been fiddling around with Parchment's input handling.  After some
> > thought, I concluded that the input model that you're using (an input
> > element with decorations turned off) is a better approach than the one
> > that Parchment currently takes (no input element, just raw key events).
> >
> > I then became curious how difficult it would be to plug your browser Glk
> > implementation into Parchment's Z-code interpreter.
> >
> > The answer: Surprisingly easy.
> >
> > <http://www.misago.org/palimpsest/>
>
> In case you're interested, this doesn't seem to work in Firefox 3.0
> (Mac or Linux); the error console shows "window.console undefined" (in
> function processBase64Zcode(content). Strangely, it didn't work for
> me in Safari (Mac) the first time I tried it, but it is working for me
> now (not sure what that means exactly). Looks very good...

The interpreter (or, probably, the plug-them-together layer on top of
it) is calling console.log(), which is one of those annoying habits
that works in Safari, and in Firefox *if* you have Firebug installed.
So it always works for web developers. :) Until yesterday, since I
hear Firebug isn't updated for FF3 yet.

I have updated my test.html again, and it now exports a function
GlkOte.log(), which writes to the error log if it can and does nothing
if it can't. There's also GlkOte.error(), which pops up the library's
fatal-error display pane.

(Another small change, if Damien wants to pick up the new code: you'll
have to change the line "border:4" in your Game object to
"spacing:4".)

I *thought* I had fixed the Opera problem, but it turns out I found a
new and different way to break it. Seriously, Opera, why do you hate
absolutely-positioned divs inside scrolling panes? Why the hate?

> (Aside to Zarf: There's a margin issue with your test in Firefox 3.0
> (Mac): The moves counter runs off the side, sometimes. Seems to depend
> on the window size; as I resize the window it sometimes stays in the
> window and sometimes runs off the side).

I noticed that, but it was only running off by a tiny bit -- a couple
of characters' worth, when the window is wide. The error is
proportional to the window width (plus or minus half a char-width). Is
that what you are seeing?

JDC

unread,
Jun 18, 2008, 2:13:25 PM6/18/08
to
On Jun 18, 12:13 pm, Andrew Plotkin <erkyr...@eblong.com> wrote:

> Here, JDC <jd...@psu.edu> wrote:
> > (Aside to Zarf: There's a margin issue with your test in Firefox 3.0
> > (Mac): The moves counter runs off the side, sometimes. Seems to depend
> > on the window size; as I resize the window it sometimes stays in the
> > window and sometimes runs off the side).
>
> I noticed that, but it was only running off by a tiny bit -- a couple
> of characters' worth, when the window is wide. The error is
> proportional to the window width (plus or minus half a char-width). Is
> that what you are seeing?

This sounds like what I was seeing (I don't have a Mac with me right
now so I can't check). It seems to behave properly now in Firefox 3.0
on linux.

-JDC

Andrew Plotkin

unread,
Jun 18, 2008, 2:33:11 PM6/18/08
to

I see what's happening... I was rounding the character width to an
integer, but FF3 on Mac is happy to render a fixed-width font at 7.25
pixels per character position.

Will fix this tonight.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Andrew Plotkin

unread,
Jun 19, 2008, 1:29:45 AM6/19/08
to
Here, Andrew Plotkin <erky...@eblong.com> wrote:
>
> I *thought* I had fixed the Opera problem, but it turns out I found a
> new and different way to break it.

Fixed now. It *should* be happy now on Firefox 2 and 3, Safari 3, iCab 4,
Opera (I only tested the very latest version), and IE6. I hope to sit
down in front of a machine with IE7 next week and see what the heck is
going on.

Writing documentation has led to me rename some functions and data
structures and things. If you plan to start programming with this
thing, I recommend you wait a few days for stuff to stabilize. There
will be an actual release at some point, really...

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Just because you vote for the Republicans, doesn't mean they let you be one.

Heiko Nock

unread,
Jun 22, 2008, 6:21:43 AM6/22/08
to
Andrew Plotkin wrote:

> The interpreter (or, probably, the plug-them-together layer on top of
> it) is calling console.log(), which is one of those annoying habits
> that works in Safari, and in Firefox *if* you have Firebug installed.
> So it always works for web developers. :) Until yesterday, since I
> hear Firebug isn't updated for FF3 yet.

There's a 1.2 beta version at http://getfirebug.com/releases/index.html
that works with Firefox 3.

--

Andrew Plotkin

unread,
Jun 23, 2008, 11:47:38 PM6/23/08
to
Here, Andrew Plotkin <erky...@eblong.com> wrote:
> Here, Andrew Plotkin <erky...@eblong.com> wrote:
> >
> > <http://eblong.com/zarf/glk/remdemo/test.html>

> >
> > I *thought* I had fixed the Opera problem, but it turns out I found a
> > new and different way to break it.
>
> Fixed now. It *should* be happy now on Firefox 2 and 3, Safari 3, iCab 4,
> Opera (I only tested the very latest version), and IE6. I hope to sit
> down in front of a machine with IE7 next week and see what the heck is
> going on.

I think IE7 is now nailed down. That's it as far as version-1 features
and functionality, I believe. (But the API is still not quite stable.)

By the way, the early suggestions of

height: expression(this.parentNode.clientHeight-this.offsetTop);

...turned out to be unworkable. (This is not a complaint, just a
warning to anybody following up on this thread in the future.) That
CSS property makes IE6 work, but generates warnings in other browsers,
and (ironically) IE7 irremediably chokes on it. And I couldn't find a
way to *conditionally* apply it under IE6. I had to take it out.
Instead, I make IE6 work by dropping in a "resize" handler which does
that computation and applies it to the height style.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Mike Tarbert

unread,
Jun 24, 2008, 4:24:42 AM6/24/08
to
Andrew Plotkin wrote:
> Here, Andrew Plotkin <erky...@eblong.com> wrote:
>> Here, Andrew Plotkin <erky...@eblong.com> wrote:
>>> <http://eblong.com/zarf/glk/remdemo/test.html>
>>>
>>> I *thought* I had fixed the Opera problem, but it turns out I found a
>>> new and different way to break it.
>> Fixed now. It *should* be happy now on Firefox 2 and 3, Safari 3, iCab 4,
>> Opera (I only tested the very latest version), and IE6. I hope to sit
>> down in front of a machine with IE7 next week and see what the heck is
>> going on.
>
> I think IE7 is now nailed down. That's it as far as version-1 features
> and functionality, I believe. (But the API is still not quite stable.)
>

I can confirm all the commands work as expected in IE7 under WinXP,
including previous command access via the up / down arrow keys. I also
like very much the way the window focus automatically follows the
current mouse pointer position w/out clicking when using the scroll
wheel. (Frankly, I wish more programs worked this way.) Nice job, Zarf!

(Consider me "explodey".)

Skinny Mike

Peter Mattsson

unread,
Jun 24, 2008, 10:00:26 AM6/24/08
to
On Jun 24, 4:47 am, Andrew Plotkin <erkyr...@eblong.com> wrote:
> By the way, the early suggestions of
>
>   height: expression(this.parentNode.clientHeight-this.offsetTop);
>
> ...turned out to be unworkable. (This is not a complaint, just a
> warning to anybody following up on this thread in the future.) That
> CSS property makes IE6 work, but generates warnings in other browsers,
> and (ironically) IE7 irremediably chokes on it. And I couldn't find a
> way to *conditionally* apply it under IE6. I had to take it out.
> Instead, I make IE6 work by dropping in a "resize" handler which does
> that computation and applies it to the height style.

If you run into any other situations where you want to apply CSS to a
specific IE version, you might find "conditional comments" useful.
This is another non-standard IE extension, using special HTML comments
that IE interprets as commands. For example, putting

<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="iefixes.css"/>
<![endif]-->

in the <head> of an HTML document causes IE versions 6 and below to
load the stylesheet iefixes.css. Later versions of IE won't load the
stylesheet, and all other browsers will interpret the whole thing as a
comment and ignore it. (I use this to get IE to load an extra
stylesheet after the normal one, containing fixes for IE-specific CSS
bugs, but you can use these comments anywhere in an HTML file.) If you
want further information, Microsoft's page on the subject is at

http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx

Peter

Andrew Plotkin

unread,
Jun 24, 2008, 10:43:36 AM6/24/08
to
Here, Peter Mattsson <peter.m...@lineone.net> wrote:
> On Jun 24, 4:47 am, Andrew Plotkin <erkyr...@eblong.com> wrote:
> > By the way, the early suggestions of
> >
> >   height: expression(this.parentNode.clientHeight-this.offsetTop);
> >
> > ...turned out to be unworkable. (This is not a complaint, just a
> > warning to anybody following up on this thread in the future.) That
> > CSS property makes IE6 work, but generates warnings in other browsers,
> > and (ironically) IE7 irremediably chokes on it. And I couldn't find a
> > way to *conditionally* apply it under IE6. I had to take it out.
> > Instead, I make IE6 work by dropping in a "resize" handler which does
> > that computation and applies it to the height style.
>
> If you run into any other situations where you want to apply CSS to a
> specific IE version, you might find "conditional comments" useful.
> This is another non-standard IE extension, using special HTML comments
> that IE interprets as commands. For example, putting
>
> <!--[if lte IE 6]>
> <link rel="stylesheet" type="text/css" href="iefixes.css"/>
> <![endif]-->
>
> in the <head> of an HTML document causes IE versions 6 and below to
> load the stylesheet iefixes.css. Later versions of IE won't load the
> stylesheet, and all other browsers will interpret the whole thing as a
> comment and ignore it.

Thanks.

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Making a saint out of Reagan is sad. Making an idol out of Nixon ("If the
President does it then it's legal") is contemptible.

Andrew Plotkin

unread,
Jun 24, 2008, 10:44:44 AM6/24/08
to
Here, Mike Tarbert <miket...@embarqmail.com> wrote:
>
> I can confirm all the commands work as expected in IE7 under WinXP,
> including previous command access via the up / down arrow keys. I also
> like very much the way the window focus automatically follows the
> current mouse pointer position w/out clicking when using the scroll
> wheel.

Interestingly, I have no idea how I did that. I don't even know what
the scroll wheel *does* in that case. :)

--Z

--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*

Mike Tarbert

unread,
Jun 24, 2008, 11:24:35 AM6/24/08
to
Andrew Plotkin wrote:
> Here, Mike Tarbert <miket...@embarqmail.com> wrote:
>> I also
>> like very much the way the window focus automatically follows the
>> current mouse pointer position w/out clicking when using the scroll
>> wheel.
>
> Interestingly, I have no idea how I did that. I don't even know what
> the scroll wheel *does* in that case. :)
>
> --Z
>
I just meant the way one can scroll back in one window using the wheel,
and then mouse the cursor over to the other window and scroll that one
back without first clicking. This is standard behavior in some apps w/
split windows (like Thunderbird) but not others. ;)

Skinny Mike

Reply all
Reply to author
Forward
0 new messages