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