Download

Concepts

Example

Documentation

Plugins

How to

Contribute

Links

Scriptaculous Plugin

If you know prototype, you also know scriptaculous. You can downlad it here.

Configuring scriptaculous

The bad thing with scriptaculous is that it use the document.write() method. As you know, if you rode the loading on the fly section, this method breaks the dynamic load. So you will have to change some code so you can use Scriptaculous with the framework. Don't worry, it is really easy. Download it and put it to your WZPlugin folder.

Then open the scripaculous.js file and the only thing you have to change is :

Find the line :
function(include) { Scriptaculous.require(path+include+'.js') });

And change it to :
function(include) { if (include != '') Scriptaculous.require(path+include+'.js') });

That's it !

Using it

To use it, the only thing you have to do is to declare it to the PluginManager :

PluginManager.getInstance().declarePlugin('Scriptaculous', 'scriptaculous-js-1.8.1/scriptaculous.js?load=', 'Scriptaculous');

Notice the ?load= at the end of the URL. Don't forget it !

If you wish to use the Effect or DragAndDrop class :

PluginManager.getInstance().declarePlugin('Effect', 'scriptaculous-js-1.8.1/effect.js', 'Effect');
PluginManager.getInstance().declarePlugin('DragAndDrop', 'scriptaculous-js-1.8.1/dragdrop.js', 'Droppables');

You have to use it in the controller model because it is the only class in your module that know the view.

var ModuleController = Class.create(ControllerHelper, {
	...						   
	hide: function(id) {
		Controller.getInstance().applyMethodToElement(id, 'fade', { duration: 3.0, from: 0, to: 1 });
		Controller.getInstance().applyMethodToElement(id, 'blindUp');
	},
	...
});