Hi, I just played around with this and here's a little javascript that grabs the current room name from the status line. You don't need to do anything to the parchment.min.js or anything special in inform, (or muck about with I6), just "release along with an interpreter", add this to play.html and you're good.
Here I just output it into a div, but my intent is to use this to indicate where I am on an a visual map. This is mostly comments, and perhaps not the best way to do this. I'm trying to do this step by step so anybody can follow, hopefully this can spark some ideas.
The "$" stuff is jQuery, which is already there with your Parchment installation.
Code:
/*
* dynamap.js 0.0.1
*
* This is a javascript that grabs the current room name from the Parchment play.html.
*
* 1. Add the script to play.html with this line in the <head>:
* <script src="dynamap.js"></script>
*
* 2. Add a div like this, for example right under the <div class="smalltitle">...</div> line:
* <div id="myOutput"></div>
*/
function dynamapUpdate() {
// grab the status line
var grab = $("div#top-window span").text();
// extract the room name from the status line:
// the regexp should be like this, without quotes, surrounded by slashes
// \s* -- any number of white spaces, followed by...
// (.*?) -- anything, in a matching group meaning this is what we look for, followed by...
// \s\s -- two spaces
var myRegexp = /\s*(.*?)\s\s/;
var match = myRegexp.exec(grab);
var room = match[1];
// output the room name
$("div#myOutput").html(room);
}
// start automatically:
window.onload=function(){
setInterval("dynamapUpdate()", 500); // interval in ms
}