From af2f2275168124e103af685035fafdc0755d45be Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Thu, 28 Aug 2008 09:45:58 +0000 Subject: [PATCH] showwindow in a separate file include Id-s --- include/controls.js | 2 ++ include/gallery.css | 2 ++ include/gallery.js | 2 ++ include/show.js | 2 ++ include/showwin.js | 87 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+) create mode 100644 include/showwin.js diff --git a/include/controls.js b/include/controls.js index 8823d6c..f27ac2a 100644 --- a/include/controls.js +++ b/include/controls.js @@ -1,4 +1,6 @@ /* + $Id$ + This is a part of mkgallery.pl suite http://www.average.org/mkgallery/ diff --git a/include/gallery.css b/include/gallery.css index edfa12d..dfecd8d 100644 --- a/include/gallery.css +++ b/include/gallery.css @@ -1,4 +1,6 @@ /* + $Id$ + This is a part of mkgallery.pl suite http://www.average.org/mkgallery/ */ diff --git a/include/gallery.js b/include/gallery.js index 3dcc3c2..25a2a5a 100644 --- a/include/gallery.js +++ b/include/gallery.js @@ -1,4 +1,6 @@ /* + $Id$ + This is a part of mkgallery.pl suite http://www.average.org/mkgallery/ diff --git a/include/show.js b/include/show.js index cdd6af0..066485c 100644 --- a/include/show.js +++ b/include/show.js @@ -1,4 +1,6 @@ /* + $Id$ + This is a part of mkgallery.pl suite http://www.average.org/mkgallery/ diff --git a/include/showwin.js b/include/showwin.js new file mode 100644 index 0000000..daec73a --- /dev/null +++ b/include/showwin.js @@ -0,0 +1,87 @@ +/* + $Id$ + + This is a part of mkgallery.pl suite + http://www.average.org/mkgallery/ + + Uses mootools (1.2) http://www.mootools.net/ + Uses slideshow http://www.phatfusion.net/slideshow/ +*/ + +/* + Hidable "fullscreen" Window for Slideshow +*/ + +var showWindow = new Class({ + + getOptions: function(){ + return { + embed: [], + zIndex: 2, + container: document.body, + onClick: $empty, + } + }, + + initialize: function(name,options){ + this.setOptions(this.getOptions(), options); + + this.options.container = $(this.options.container); + + this.container = new Element('div').addClass(name). + setProperties({ + id: name, + name: name, + }).setStyles({ + position: 'absolute', + left: '0px', + top: '0px', + width: '100%', + zIndex: this.options.zIndex, + overflow: 'hidden', + display: 'none' + }).addEvent('click', function(){ + this.options.onClick() + }.bind(this)).injectInside(this.options.container); + + this.embedded = []; + this.options.embed.each(function(el){ + var sub = new Element('div'); + sub.addClass(el).setProperties({ + id: el, + name: el, + }).injectInside(this.container); + this.embedded.push(sub); + },this); + + this.position(); + + window.addEvent('resize', this.position.bind(this)); + window.addEvent('scroll', this.position.bind(this)); + }, + + position: function(){ + if(this.options.container == document.body){ + this.h = window.getHeight(); + this.s = window.getScrollTop(); + }else{ + var myCoords = this.options.container.getCoordinates(); + this.h = myCoords.height; + this.s = myCoords.top; + } + this.container.setStyles({ + top: this.s+'px', + height: this.h+'px' + }) + }, + + show: function(){ + this.container.setStyle('display', 'block'); + }, + + hide: function(){ + this.container.setStyle('display', 'none'); + } +}) +showWindow.implement(new Options); + -- 2.39.2