]> www.average.org Git - mkgallery.git/commitdiff
showwindow in a separate file
authorEugene Crosser <crosser@average.org>
Thu, 28 Aug 2008 09:45:58 +0000 (09:45 +0000)
committerEugene Crosser <crosser@average.org>
Thu, 28 Aug 2008 09:45:58 +0000 (09:45 +0000)
include Id-s

include/controls.js
include/gallery.css
include/gallery.js
include/show.js
include/showwin.js [new file with mode: 0644]

index 8823d6c12c553149deed5a030493832c4ccff1d6..f27ac2a0e832248a380e836557735c1f221f86f9 100644 (file)
@@ -1,4 +1,6 @@
 /*
+       $Id$
+
         This is a part of mkgallery.pl suite
         http://www.average.org/mkgallery/
 
index edfa12d1e66970254ff07b061283ca9900f2a1da..dfecd8d65dff99c5f2b98f25e678fa574d3bbca7 100644 (file)
@@ -1,4 +1,6 @@
 /*
+       $Id$
+
        This is a part of mkgallery.pl suite
        http://www.average.org/mkgallery/
 */
index 3dcc3c2201a7088a931e74bf40c3d9e8fa9c319d..25a2a5a285d876297cd6b36c6d3edf3bd4d8da99 100644 (file)
@@ -1,4 +1,6 @@
 /*
+       $Id$
+
         This is a part of mkgallery.pl suite
         http://www.average.org/mkgallery/
 
index cdd6af07129873c243fa4c6fa5d963c8e14f864c..066485c88cb597534ac27ce26ce77e942384ff8e 100644 (file)
@@ -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 (file)
index 0000000..daec73a
--- /dev/null
@@ -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);
+