Other‎ > ‎

How to use Wavefunctions

posted Sep 10, 2009, 8:39 AM by Tim Nash   [ updated Nov 27, 2009, 12:40 PM ]
To use Prepared Wavefunctions, click the 'Share' button and then click the tab titled 'Wavefunctions'

You will see a radio listing of wavefunctions. Click the one you want and press the 'Use this wavefunction' button.

Important! Now reload your entire webpage to get access to the new functionality.



WaveFunctions allow the user to decide which javascript functions they want to include when their page loads.

The purpose is to increase the number of javascript functions available to each individual waveform without forcing all users to download that code.

Users can enter <script src="" ></script> set of tags with the src= pointing to a trusted javascript file. The next time they load their main page, the associated javascript function will be loaded.
 
Users can also enter their own javascript in the textarea box under the "Share" window area.

First time users are set up with just the link to gtheme:

<link rel="stylesheet" type="text/css" href="/ext2f/gtheme/gtheme.css" />


If you want a complete set of wavefunctions that includes a WSJ news gadget and turtles gadget, use the following:



Wavefunction with WSJ and pet turtles

<link rel="stylesheet" type="text/css" href="/ext2f/gtheme/gtheme.css" />
<script type="text/javascript" src="/ext2f/ux/relationalForms.js"></script>
<script type="text/javascript" src="/ext2f/ux/offline.js"></script>
<script type="text/javascript" src="/ext2f/TinyMCE/lib/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/ext2f/ux/tinymce_wf.js"></script>
<script type="text/javascript" src="/ext2f/ux/updater_wf.js"></script>
<script type="text/javascript" src="/ext2f/ux/collintel_wf.js"></script>
<script type="text/javascript" src="/ext2f/ux/secret_wf.js"></script>
<script type="text/javascript" src="ext2f/ux/picker.js"></script>
<script type="text/javascript" src="/ext2f/ux/wavefunctions.js"></script>
<div id="wsj"><script src="http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/100674619146546250953/wsj.xml&amp;up_entries=5&amp;up_refresh=15&amp;synd=open&amp;w=320&amp;h=300&amp;title=The+Wall+Street+Journal&amp;border=%23ffffff%7C0px%2C1px+solid+%23004488%7C0px%2C1px+solid+%23005599%7C0px%2C1px+solid+%230077BB%7C0px%2C1px+solid+%230088CC&amp;output=js"></script></div>
<div id='turtle'>
<script src="http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/112581010116074801021/turtle.xml&amp;up_turtleName=Turtle&amp;up_waterColor=d0dce5&amp;up_percentWater=.75&amp;up_groundColor=EEEEEE&amp;up_foodColor=CCCC33&amp;up_numTurtles=2&amp;up_turtle1HeadColor=828250&amp;up_turtle1ShellColor=828250&amp;up_turtle1LegColor=66663f&amp;up_turtle2HeadColor=828250&amp;up_turtle2ShellColor=828250&amp;up_turtle2LegColor=66663f&amp;up_turtle3HeadColor=828250&amp;up_turtle3ShellColor=828250&amp;up_turtle3LegColor=66663f&amp;up_turtle4HeadColor=828250&amp;up_turtle4ShellColor=828250&amp;up_turtle4LegColor=66663f&amp;up_turtle5HeadColor=828250&amp;up_turtle5ShellColor=828250&amp;up_turtle5LegColor=66663f&amp;synd=open&amp;w=320&amp;h=200&amp;title=Veronica+and+Jughead&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>
</div>

<script>



Ext.get('googletalk').dom.innerHTML = Ext.get('turtle').dom.innerHTML + '<br />' + Ext.get('wsj').dom.innerHTML;

</script>
<script>
var userAdded = function(contactEntry) {
var emailAddresses = contactEntry.getEmailAddresses();

for (var j = 0; j < emailAddresses.length; j++) {
var emailAddress = emailAddresses[j].getAddress();

var currvals = Ext.getCmp('newmembers').getValue()
currvals = currvals.replace(";;", ";");
currvals = currvals.replace("; ;", ";");
Ext.getCmp('newmembers').setValue( currvals + ';' + emailAddress );
}
}
</script>
<script>
var userRemoved = function(contactEntry) {
var emailAddresses = contactEntry.getEmailAddresses();

for (var j = 0; j < emailAddresses.length; j++) {
var emailAddress = emailAddresses[j].getAddress();

var currvals = Ext.getCmp('newmembers').getValue();
var newval = currvals.replace(emailAddress , "");
newval = newval.replace(";;", ";");
newval = newval.replace("; ;", ";");
Ext.getCmp('newmembers').setValue( newval );
}
}

if(gcal.init != 'faux'){
google.load("gdata", "3.x");
Picker.setServiceName('waveforms_contact_sampler');
Picker.setUserAddCallback(userAdded);
Picker.setUserRemoveCallback(userRemoved);
Picker.render('picker_container');
}

</script>





Comments