example_jscallfunction.js

This is an example of a JavaScript in ShapeUp that is intended to be run by a GPI plugin using the SUJavaScript::CallFunction() method with 'doSomething' as argument. Note that since a call to init() is made at file level, the init() function will be called the first time SUJavaScript::CallFunction() is called. To avoid this behaviour, remove the call to init at file level at line 16.

00001 var myState1 = 0;
00002 var myLayer = null;
00003 
00004 function doSomething()
00005 {
00006     myState++;
00007 }
00008 
00009 function init()
00010 {
00011     myLayer = workspace.addNewLayer('Point');
00012     workspace.refresh();
00013 }
00014 
00015 // call to init() on file level, see SUJavaScript
00016 init();

Generated on Thu Apr 15 10:55:32 2010 for ShapeUp API by  doxygen 1.5.2