Trying to replace the prefix with a mechanism for using a callback for the id; wave.Participant() shouldn't work - Participant() is the constructor for the Participant objects returned from getViewer() etc.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@127 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -42,6 +42,7 @@ function SvgCanvas(c)
|
||||
|
||||
// private functions
|
||||
var getId = function() {
|
||||
if (events["getid"]) return call("getid",obj_num);
|
||||
return idprefix+obj_num;
|
||||
}
|
||||
|
||||
|
||||
@@ -257,18 +257,18 @@ SVG-edit Google Wave Gadget @ <a href="http://svg-edit.googlecode.com/" target="
|
||||
wave.getState().submitDelta(delta);
|
||||
}
|
||||
|
||||
function setupId() {
|
||||
svgCanvas.setIdPrefix("svg_"+wave.Participant().getId()+"_");
|
||||
function getId(objnum) {
|
||||
return "svg_"+wave.getViewer().getId()+"_"+objnum;
|
||||
}
|
||||
|
||||
function main() {
|
||||
svgCanvas = svg_edit_setup();
|
||||
if (wave && wave.isInWaveContainer()) {
|
||||
wave.setStateCallback(stateUpdated);
|
||||
wave.setParticipantCallback(setupId);
|
||||
}
|
||||
svgCanvas.bind("changed", sendDelta);
|
||||
svgCanvas.bind("cleared", stateUpdated);
|
||||
svgCanvas.bind("getid", getId);
|
||||
}
|
||||
|
||||
gadgets.util.registerOnLoadHandler(main);
|
||||
|
||||
Reference in New Issue
Block a user