Action dropdown

1 view
Skip to first unread message

jayCampbell

unread,
Apr 6, 2008, 1:19:39 PM4/6/08
to Ecmanomic
This quickie code:

var actionform = "<select name=\"functionName\" value=\"propose\">\n";
for (action in GameData.Action) {
var t = action.split("_");
if (t[t.length-1] != "comment") {
actionform += " <option=\"" + action + "\">" + action + "</
select>\n";
};
};
actionform += "</select>\n"

Produces this dropdown:

<select name="functionName" value="propose">
<option="adduser">adduser</select>
<option="propose">propose</select>
<option="vote">vote</select>
<option="activate">activate</select>
<option="rss">rss</select>
<option="debug">debug</select>
<option="codeWriter">codeWriter</select>
</select>

But I'm unclear on what parts of the page are replaced when returning
a new __bodyHtml. And introducing ecmascript into the HTML form to
make it dynamic may not be as useful as building the form itself in
ecmascript.

Adam Bliss

unread,
Apr 6, 2008, 2:42:59 PM4/6/08
to ecma...@googlegroups.com
Yeah, yesterday I realized that the whole __bodyHtml business is a
terrible hack, and we should just write the whole page from the game
object. I'll refactor and propose today.

--abliss

jayCampbell

unread,
Apr 7, 2008, 8:58:38 PM4/7/08
to Ecmanomic
I voted up your replacement but right now going to /test.html gives me
a 'Show Pirate Game' submit button that irrevocably hides the form.

jayCampbell

unread,
Apr 7, 2008, 11:42:16 PM4/7/08
to Ecmanomic
I currently get this at the top:

Errors: in onLoadFunctions[8]: ReferenceError: UnTip is not defined

abl...@gmail.com

unread,
Apr 7, 2008, 11:45:55 PM4/7/08
to Ecmanomic
On Apr 7, 8:42 pm, jayCampbell <jaycampb...@gmail.com> wrote:
> I currently get this at the top:
>
> Errors: in onLoadFunctions[8]: ReferenceError: UnTip is not defined

Yeah, my fault; I just proposed a fix.

The rest of the page still loads, though, right? That error should
only impact the tool tips.

--abliss

jayCampbell

unread,
Apr 7, 2008, 11:56:26 PM4/7/08
to Ecmanomic
I just voted that up. Everything but tooltips did seem dandy.
Reply all
Reply to author
Forward
0 new messages