4 This is a part of mkgallery.pl suite
5 http://www.average.org/mkgallery/
7 Uses mootools (1.2) http://www.mootools.net/
8 Inspired by slideshow http://www.phatfusion.net/slideshow/
14 - First, initialize "controls" without hooks to the "show".
15 - Then, initialize "show" passing "controls" object as an argument to
17 - From the "show" constructuor, call "controls"'s "complete initialization"
18 method passing them "this", so that they will be able to access "show"'s
20 - Because this is slightly simpler than symmetric "co-routine" approach,
21 and arguably better suits the task at hand.
24 var Controls = new Class({
26 getOptions: function(){
32 initialize: function(container, options){
33 this.setOptions(this.getOptions(), options);
34 this.container = $(container);
35 var buttons = ['prev','stop','play','next','exit','comm'];
36 buttons.each(function(el){
37 var sub = new Element('div');
38 sub.addClass('controlButton').setProperties({
41 }).injectInside(this.container);
46 registershow: function(show){
47 alert('controls.registershow called');
49 var buttons = ['prev','stop','play','next','exit'];
50 buttons.each(function(el){
51 var sub = new Element('div');
52 sub.addEvent('click', function() {
60 Controls.implement(new Options);