]> www.average.org Git - mkgallery.git/blob - include/show.js
cdd6af07129873c243fa4c6fa5d963c8e14f864c
[mkgallery.git] / include / show.js
1 /*
2         This is a part of mkgallery.pl suite
3         http://www.average.org/mkgallery/
4
5         Uses mootools (1.2) http://www.mootools.net/
6         Inspired by slideshow http://www.phatfusion.net/slideshow/
7 */
8
9 /*
10         Slideshow
11
12   - On show image: find this and next urls; put in place
13     those that are already here; free unneeded; initiate download of
14     the rest; if needed image is ready then initiate "transitioning", else
15     initiate "loading".
16   - On load complete: if this is the target image, initiate "transitioning".
17   - On "loading": show "loading" image
18   - On "transitioning": hide "loading" image; initiate FX animation to the
19     needed image.
20   - On animation complete: blank previous image; if "playing" then schedule
21     autoswitch to next image in the future.
22   - On autoswitch to next image: if "playing" then switch to next image.
23   - On switch to next image: if next exists, show next image, else show
24     "last image" message.
25   - On switch to prev image: if prev exists, show prev image, else show
26     "first image" message.
27   - On "play": make "playing"; switch to next image.
28   - On "stop": if "playing" cancel autoswitch; break "playing".
29   - On "start show": set up things; set "playing" state; show needed image.
30   - On "stop show": cancel any schedules, hide things.
31 */
32
33 var Show = new Class({
34
35         getOptions: function(){
36                 return {
37                         onClick: $empty,
38                 }
39         },
40
41         initialize: function(vimgs, container, controls, options){
42                 this.setOptions(this.getOptions(), options);
43                 this.vimgs = vimgs;
44                 this.container = $(container);
45                 this.controls = controls;
46                 this.controls.registershow(this);
47
48                 window.addEvent('resize', this.resizer.bind(this))
49                 window.addEvent('scroll', this.scroller.bind(this))
50         },
51
52         resizer: function(){
53                 alert('show.resizer called');
54         },
55
56         scroller: function(){
57                 alert('show.scroller called');
58         },
59
60 });
61 Show.implement(new Options);
62