Search code examples
seaside

Seaside on Pharo - Why the weird jQuery integration syntax compared to Scriptaculous?


Example 1:

html scriptaculous sortable onUpdate: (html scriptaculous... etc).

html jQuery **new** sortable onStop: (html jQuery... etc).

Example 2:

html scriptaculous effect id: helpId; toggleAppear.

(html jQuery id: helpId) slideToggle: 1 seconds.

The way jQuery and Scriptaculous were integrated seems similar. Can anyone explain what design change took place between the two and its effect on syntax (especially in the second example)?


Solution

  • JQuery has a very uniform calling pattern, and so does the integration into Seaside:

    1. Query: Find the desired DOM elements.
    2. Action: Perform actions on the matching elements.

    Having the possibility to perform actions on multiple elements at once is very powerful and one of the benefits of JQuery. For more details and examples, have a look at these slides.

    On the other hand, script.aculo.us is a collection of UI tools that are less generic and less uniformly organized. Most script.aculo.us calls require a single DOM ID to identify the element to work on. This is may be simpler initially, but is also less powerful.