|
From: Ian S. <ian...@ac...> - 2007-08-19 20:04:23
|
The latest build in the repository contains some basic support for
context menus on things. You can control the context menu's content
and resulting action (if something is selected) with javascript on
the thing. Here is a simple example that gives the user four options
(with altavista greyed out) and records the users selection into the
space settings...
This has been asked for before, so I'd like it if people would
comment on whether or not this met their needs...
ian
function onContextClick(person, shapeName){
space.log(person + " context clicked " + thingID + " on its " +
shapeName);
i1 = new ContextMenuInfo("Google",true,"google");
i2 = new ContextMenuInfo("Yahoo",true,"yahoo");
i3 = new ContextMenuInfo("Altavista",false,"NOTUSED");
i4 = new ContextMenuInfo("Transmutable",true,"transmutable");
return new Array(i1,i2,i3,i4);
}
function onContextMenuItemChosen(username,id)
{
var key = "favoriteSite";
var preferred = space.getSetting(key);
space.putSetting(key,id);
//causes browser to jump to that page!
return "http://www."+id+".com/";
}
-----------------------------------------------------
Ian Smith
ian...@ac...
-----------------------------------------------------
In politics, absurdity is not a handicap.
-Napoleon Bonaparte
|