[Seaside] Procedure for adding a JQuery Plugin..

Tim Murray tmurray at ecsorl.com
Mon Aug 2 19:26:51 UTC 2010

Apologies if this has been covered elsewhere.


I would like to add a JQuery plugin for displaying charts to our site.


The plugin site is here http://www.jqplot.com/


I have modeled a new application library after the
JQUIDevelopmentLibrary which

Has two instance methods: jQueryUiJs and selectorsToInclude which
contains an array with the symbol for the other method.


Using this as a model, for each javascript library in the plugin...

  I replaced single quotes with a ''

  I created a method to contain it and return the javascript code.

  I added a selector o the selectorsToInclude array.


I then added that library containing all the javascript code for this
plugin to my application via the Dispatcher->config area.


Reading the Seaside Tutorial, there are 4 ways to use Javascript....


1. Add to a script tag

   don't use this as no way to guarantee script will run after page load


2. add to a list of load-scripts

   html document addLoadScript: aJavaScriptBrush


3. add to a DOM element


   html div script: aJavaScriptBrush; with: 'Hello World'


      Every html brush understands the message script: wich will endure 

      (1) the tag has a unique id 

      (2) passes the ID of the tag to the Javascript brush

      (3) add the Javascript brush to the list of load scripts.


4. Add as a DOM event handler


    html div onClick: aJavascriptBrush; with: 'hello World'




My question is what exactly is aJavascriptBrush?  Is it a smalltalk
wrapper around my new library objects? Or, can/should I access the new
library directly?


The plugin author has a demo/test page, and I want to display a simple
bar chart to start with:


The javascript is trivial, so with my new library, can I just assign
this to a div and display the chart?

If a smalltalk wrapper is required, is there a boilerplate procedure for
writing it?

If somebody can guide me through the procedure, I will be very happy to
port this plugin to Seaside.


Thx in advance.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100802/3451e33d/attachment.htm

More information about the seaside mailing list