|
From: <vo...@us...> - 2010-10-29 17:53:51
|
Revision: 5671
http://xoops.svn.sourceforge.net/xoops/?rev=5671&view=rev
Author: voltan1
Date: 2010-10-29 17:53:43 +0000 (Fri, 29 Oct 2010)
Log Message:
-----------
Move all js and css files to script folder
Modified Paths:
--------------
XoopsModules/extgallery/trunk/modules/extgallery/templates/blocks/extgallery_block_ajax.html
XoopsModules/extgallery/trunk/modules/extgallery/templates/extgallery_public-album.html
XoopsModules/extgallery/trunk/modules/extgallery/templates/extgallery_public-slideshow.html
Added Paths:
-----------
XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/
XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/close.png
XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/index.html
XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/transparent.png
XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/white.png
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.css
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.js
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.js
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/index.html
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview/
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview/easing.js
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview/galleryview.css
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview/galleryview.js
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview/index.html
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview/timers.js
XoopsModules/extgallery/trunk/modules/extgallery/include/overlay/
XoopsModules/extgallery/trunk/modules/extgallery/include/overlay/index.html
XoopsModules/extgallery/trunk/modules/extgallery/include/overlay/overlay.css
XoopsModules/extgallery/trunk/modules/extgallery/include/overlay/overlay.jquery.tools.min.js
XoopsModules/extgallery/trunk/modules/extgallery/include/tooltip/
XoopsModules/extgallery/trunk/modules/extgallery/include/tooltip/image.tooltip.css
XoopsModules/extgallery/trunk/modules/extgallery/include/tooltip/image.tooltip.js
XoopsModules/extgallery/trunk/modules/extgallery/include/tooltip/index.html
Removed Paths:
-------------
XoopsModules/extgallery/trunk/modules/extgallery/images/Thumbs.db
XoopsModules/extgallery/trunk/modules/extgallery/images/close.png
XoopsModules/extgallery/trunk/modules/extgallery/images/transparent.png
XoopsModules/extgallery/trunk/modules/extgallery/images/white.png
XoopsModules/extgallery/trunk/modules/extgallery/include/easing.js
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria.classic.css
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria.classic.js
XoopsModules/extgallery/trunk/modules/extgallery/include/galleria.js
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview.css
XoopsModules/extgallery/trunk/modules/extgallery/include/galleryview.js
XoopsModules/extgallery/trunk/modules/extgallery/include/image.tooltip.css
XoopsModules/extgallery/trunk/modules/extgallery/include/image.tooltip.js
XoopsModules/extgallery/trunk/modules/extgallery/include/overlay.css
XoopsModules/extgallery/trunk/modules/extgallery/include/overlay.jquery.tools.min.js
XoopsModules/extgallery/trunk/modules/extgallery/include/timers.js
Deleted: XoopsModules/extgallery/trunk/modules/extgallery/images/Thumbs.db
===================================================================
(Binary files differ)
Deleted: XoopsModules/extgallery/trunk/modules/extgallery/images/close.png
===================================================================
(Binary files differ)
Added: XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/close.png
===================================================================
(Binary files differ)
Property changes on: XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/close.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/index.html
===================================================================
--- XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/index.html (rev 0)
+++ XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/index.html 2010-10-29 17:53:43 UTC (rev 5671)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/transparent.png
===================================================================
(Binary files differ)
Property changes on: XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/transparent.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/white.png
===================================================================
(Binary files differ)
Property changes on: XoopsModules/extgallery/trunk/modules/extgallery/images/overlay/white.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: XoopsModules/extgallery/trunk/modules/extgallery/images/transparent.png
===================================================================
(Binary files differ)
Deleted: XoopsModules/extgallery/trunk/modules/extgallery/images/white.png
===================================================================
(Binary files differ)
Deleted: XoopsModules/extgallery/trunk/modules/extgallery/include/easing.js
===================================================================
--- XoopsModules/extgallery/trunk/modules/extgallery/include/easing.js 2010-10-29 16:17:24 UTC (rev 5670)
+++ XoopsModules/extgallery/trunk/modules/extgallery/include/easing.js 2010-10-29 17:53:43 UTC (rev 5671)
@@ -1,205 +0,0 @@
-/*
- * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
- *
- * Uses the built in easing capabilities added In jQuery 1.1
- * to offer multiple easing options
- *
- * TERMS OF USE - jQuery Easing
- *
- * Open source under the BSD License.
- *
- * Copyright © 2008 George McGinley Smith
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
-*/
-
-// t: current time, b: begInnIng value, c: change In value, d: duration
-jQuery.easing['jswing'] = jQuery.easing['swing'];
-
-jQuery.extend( jQuery.easing,
-{
- def: 'easeOutQuad',
- swing: function (x, t, b, c, d) {
- //alert(jQuery.easing.default);
- return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
- },
- easeInQuad: function (x, t, b, c, d) {
- return c*(t/=d)*t + b;
- },
- easeOutQuad: function (x, t, b, c, d) {
- return -c *(t/=d)*(t-2) + b;
- },
- easeInOutQuad: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t + b;
- return -c/2 * ((--t)*(t-2) - 1) + b;
- },
- easeInCubic: function (x, t, b, c, d) {
- return c*(t/=d)*t*t + b;
- },
- easeOutCubic: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t + 1) + b;
- },
- easeInOutCubic: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
- return c/2*((t-=2)*t*t + 2) + b;
- },
- easeInQuart: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t + b;
- },
- easeOutQuart: function (x, t, b, c, d) {
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
- },
- easeInOutQuart: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
- },
- easeInQuint: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t*t + b;
- },
- easeOutQuint: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
- },
- easeInOutQuint: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
- return c/2*((t-=2)*t*t*t*t + 2) + b;
- },
- easeInSine: function (x, t, b, c, d) {
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
- },
- easeOutSine: function (x, t, b, c, d) {
- return c * Math.sin(t/d * (Math.PI/2)) + b;
- },
- easeInOutSine: function (x, t, b, c, d) {
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
- },
- easeInExpo: function (x, t, b, c, d) {
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
- },
- easeOutExpo: function (x, t, b, c, d) {
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
- },
- easeInOutExpo: function (x, t, b, c, d) {
- if (t==0) return b;
- if (t==d) return b+c;
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
- },
- easeInCirc: function (x, t, b, c, d) {
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
- },
- easeOutCirc: function (x, t, b, c, d) {
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
- },
- easeInOutCirc: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
- },
- easeInElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- },
- easeOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
- },
- easeInOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
- },
- easeInBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*(t/=d)*t*((s+1)*t - s) + b;
- },
- easeOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
- },
- easeInOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
- },
- easeInBounce: function (x, t, b, c, d) {
- return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
- },
- easeOutBounce: function (x, t, b, c, d) {
- if ((t/=d) < (1/2.75)) {
- return c*(7.5625*t*t) + b;
- } else if (t < (2/2.75)) {
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
- } else if (t < (2.5/2.75)) {
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
- } else {
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
- }
- },
- easeInOutBounce: function (x, t, b, c, d) {
- if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
- return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
- }
-});
-
-/*
- *
- * TERMS OF USE - EASING EQUATIONS
- *
- * Open source under the BSD License.
- *
- * Copyright © 2001 Robert Penner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
\ No newline at end of file
Added: XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.css
===================================================================
--- XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.css (rev 0)
+++ XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.css 2010-10-29 17:53:43 UTC (rev 5671)
@@ -0,0 +1,202 @@
+/*
+ * Galleria Classic Theme
+ * Copyright (c) 2010, Aino
+ * Licensed under the MIT license.
+ */
+
+.galleria-container {
+ position: relative;
+ overflow: hidden;
+ background-color: #000;
+}
+.galleria-container img {
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -o-user-select: none;
+}
+.galleria-stage {
+ position: absolute;
+ top: 10px;
+ bottom: 60px;
+ left: 10px;
+ right: 10px;
+ overflow:hidden;
+}
+.galleria-thumbnails-container {
+ height: 50px;
+ bottom: 0;
+ position: absolute;
+ left: 10px;
+ right: 10px;
+ z-index: 2;
+}
+.galleria-carousel .galleria-thumbnails-list {
+ margin-left: 30px;
+ margin-right: 30px;
+}
+.galleria-thumbnails .galleria-image {
+ height: 40px;
+ width: 60px;
+ background: #000;
+ margin: 0 5px 0 0;
+ border: 1px solid #000;;
+ float: left;
+ cursor: pointer;
+}
+.galleria-counter {
+ position: absolute;
+ bottom: 10px;
+ left: 10px;
+ text-align: right;
+ color: #fff;
+ font: normal 11px/1 arial,sans-serif;
+ z-index: 2;
+}
+.galleria-loader {
+ background: #000;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ z-index: 2;
+ display: none;
+ background: url(modules/extgallery/images/galleria/classic-loader.gif) no-repeat 2px 2px;
+}
+.galleria-info {
+ width: 50%;
+ top: 15px;
+ left: 15px;
+ z-index: 2;
+ position: absolute;
+}
+.galleria-info-text {
+ background-color: #000;
+ padding: 12px;
+ display: none;
+ /* IE7 */ zoom:1;
+}
+.galleria-info-title {
+ font: bold 12px/1.1 arial,sans-serif;
+ margin: 0;
+ color: #fff;
+}
+.galleria-info-description {
+ font: italic 12px/1.4 georgia,serif;
+ margin: 0;
+ color: #bbb;
+}
+.galleria-info-title+.galleria-info-description {
+ margin-top: 7px;
+}
+.galleria-info-close {
+ width: 9px;
+ height: 9px;
+ position: absolute;
+ top: 5px;
+ right: 5px;
+ background-position: -753px -11px;
+ opacity: .5;
+ filter: alpha(opacity=50);
+ cursor: pointer;
+ display: none;
+}
+.galleria-info-close:hover{
+ opacity:1;
+ filter: alpha(opacity=100);
+}
+.galleria-info-link {
+ background-position: -669px -5px;
+ opacity: .7;
+ filter: alpha(opacity=70);
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ cursor: pointer;
+ background-color: #000;
+}
+.galleria-info-link:hover {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+.galleria-image-nav {
+ position: absolute;
+ top: 50%;
+ margin-top: -62px;
+ width: 100%;
+ height: 62px;
+ left: 0;
+}
+.galleria-image-nav-left,
+.galleria-image-nav-right {
+ opacity: .3;
+ filter: alpha(opacity=30);
+ cursor: pointer;
+ width: 62px;
+ height: 124px;
+ position: absolute;
+ left: 10px;
+ z-index: 2;
+ background-position: 0 46px;
+}
+.galleria-image-nav-right {
+ left: auto;
+ right: 10px;
+ background-position: -254px 46px;
+ z-index: 2;
+}
+.galleria-image-nav-left:hover,
+.galleria-image-nav-right:hover {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+.galleria-thumb-nav-left,
+.galleria-thumb-nav-right {
+ cursor: pointer;
+ display: none;
+ background-position: -495px 5px;
+ position: absolute;
+ left: 0;
+ top: 0;
+ height: 40px;
+ width: 23px;
+ z-index: 3;
+ opacity: .8;
+ filter: alpha(opacity=80);
+}
+.galleria-thumb-nav-right {
+ background-position: -578px 5px;
+ border-right: none;
+ right: 0;
+ left: auto;
+}
+.galleria-thumbnails-container .disabled {
+ opacity: .2;
+ filter: alpha(opacity=20);
+ cursor: default;
+}
+.galleria-thumb-nav-left:hover,
+.galleria-thumb-nav-right:hover {
+ opacity: 1;
+ filter: alpha(opacity=100);
+ background-color: #111;
+}
+.galleria-thumbnails-container .disabled:hover {
+ opacity: 0.2;
+ filter: alpha(opacity=20);
+ background-color: transparent;
+}
+
+.galleria-carousel .galleria-thumb-nav-left,
+.galleria-carousel .galleria-thumb-nav-right {
+ display: block;
+}
+.galleria-thumb-nav-left,
+.galleria-thumb-nav-right,
+.galleria-info-link,
+.galleria-info-close,
+.galleria-image-nav-left,
+.galleria-image-nav-right {
+ background-image: url(modules/extgallery/images/galleria/classic-map.png);
+ background-repeat: no-repeat;
+}
Added: XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.js
===================================================================
--- XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.js (rev 0)
+++ XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.classic.js 2010-10-29 17:53:43 UTC (rev 5671)
@@ -0,0 +1,82 @@
+/*
+ * Galleria Classic Theme v. 1.5 2010-10-28
+ * http://galleria.aino.se
+ *
+ * Copyright (c) 2010, Aino
+ * Licensed under the MIT license.
+ */
+
+(function($) {
+
+Galleria.addTheme({
+ name: 'classic',
+ author: 'Galleria',
+ version: '1.5',
+ css: 'galleria.classic.css',
+ defaults: {
+ transition: 'slide',
+ thumb_crop: 'height',
+
+ // set this to false if you want to show the caption all the time:
+ _toggle_info: true
+ },
+ init: function(options) {
+
+ // add some elements
+ this.addElement('info-link','info-close');
+ this.append({
+ 'info' : ['info-link','info-close']
+ });
+
+ // cache some stuff
+ var toggle = this.$('image-nav-left,image-nav-right,counter'),
+ info = this.$('info-link,info-close,info-text'),
+ click = Galleria.TOUCH ? 'touchstart' : 'click';
+
+ // show loader & counter with opacity
+ this.$('loader,counter').show().css('opacity',.4)
+
+ // some stuff for non-touch browsers
+ if (! Galleria.TOUCH ) {
+
+ // fade thumbnails
+ this.$('thumbnails').children().hover(function() {
+ $(this).not('.active').children().stop().fadeTo(100, 1);
+ }, function() {
+ $(this).not('.active').children().stop().fadeTo(400, .6);
+ });
+
+ this.addIdleState( this.get('image-nav-left'), { left:-50 });
+ this.addIdleState( this.get('image-nav-right'), { right:-50 });
+ this.addIdleState( this.get('counter'), { opacity:0 });
+ }
+
+ // toggle info
+ if ( options._toggle_info ) {
+ info.bind( click, function() {
+ info.toggle();
+ });
+ }
+
+ // bind some stuff
+ this.bind(Galleria.THUMBNAIL, function(e) {
+ $(e.thumbTarget).parent(':not(.active)').children().css('opacity',.6)
+ });
+
+ this.bind(Galleria.LOADSTART, function(e) {
+ if (!e.cached) {
+ this.$('loader').show().fadeTo(200, .4);
+ }
+
+ this.$('info').toggle( this.hasInfo() );
+
+ $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity',.6);
+ });
+
+ this.bind(Galleria.LOADFINISH, function(e) {
+ this.$('loader').fadeOut(200);
+ });
+ }
+});
+
+})(jQuery);
Added: XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.js
===================================================================
--- XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.js (rev 0)
+++ XoopsModules/extgallery/trunk/modules/extgallery/include/galleria/galleria.js 2010-10-29 17:53:43 UTC (rev 5671)
@@ -0,0 +1,3734 @@
+/*
+ * Galleria v 1.2 prerelease 1.1 2010-10-29
+ * http://galleria.aino.se
+ *
+ * Copyright (c) 2010, Aino
+ * Licensed under the MIT license.
+ */
+
+(function($) {
+
+// some references
+var undef,
+ window = this,
+ doc = document,
+ $doc = $( doc );
+
+// internal constants
+var DEBUG = false,
+ NAV = navigator.userAgent.toLowerCase(),
+ HASH = window.location.hash.replace(/#\//, ''),
+ CLICK = function() {
+ // use this to make touch devices snappier
+ return Galleria.TOUCH ? 'touchstart' : 'click';
+ },
+ IE = (function() {
+ var v = 3,
+ div = doc.createElement( 'div' );
+ while (
+ div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->',
+ div.getElementsByTagName('i')[0]
+ );
+ return v > 4 ? v : undef;
+ }() ),
+ DOM = function() {
+ return {
+ html: doc.documentElement,
+ body: doc.body,
+ head: doc.getElementsByTagName('head')[0],
+ title: doc.title
+ };
+ },
+
+ // the internal timeouts object
+ // provides helper methods for controlling timeouts
+ _timeouts = {
+
+ trunk: {},
+
+ add: function( id, fn, delay, loop ) {
+ loop = loop || false;
+ this.clear( id );
+ if ( loop ) {
+ var old = fn;
+ fn = function() {
+ old();
+ _timeouts.add( id, fn, delay );
+ };
+ }
+ this.trunk[ id ] = window.setTimeout( fn, delay );
+ },
+
+ clear: function( id ) {
+
+ var del = function( i ) {
+ window.clearTimeout( this.trunk[ i ] );
+ delete this.trunk[ i ];
+ };
+
+ if ( !!id && id in this.trunk ) {
+ del.call( _timeouts, id );
+
+ } else if ( typeof id == 'undefined' ) {
+ for ( var i in this.trunk ) {
+ del.call( _timeouts, i );
+ }
+ }
+ }
+ },
+
+ // the internal gallery holder
+ _galleries = [],
+
+ // the transitions holder
+ _transitions = {
+
+ fade: function(params, complete) {
+ $(params.next).css('opacity', 0).show().animate({
+ opacity: 1
+ }, params.speed, complete);
+
+ if (params.prev) {
+ $(params.prev).css('opacity', 1).show().animate({
+ opacity: 0
+ }, params.speed);
+ }
+ },
+
+ flash: function(params, complete) {
+ $(params.next).css('opacity', 0);
+ if (params.prev) {
+ $(params.prev).animate({
+ opacity: 0
+ }, (params.speed / 2), function() {
+ $(params.next).animate({
+ opacity: 1
+ }, params.speed, complete);
+ });
+ } else {
+ $(params.next).animate({
+ opacity: 1
+ }, params.speed, complete);
+ }
+ },
+
+ pulse: function(params, complete) {
+ if (params.prev) {
+ $(params.prev).hide();
+ }
+ $(params.next).css('opacity', 0).animate({
+ opacity:1
+ }, params.speed, complete);
+ },
+
+ slide: function(params, complete) {
+ var image = $(params.next).parent(),
+ images = this.$('images'), // ??
+ width = this._stageWidth,
+ easing = this.getOptions( 'easing' );
+
+ image.css({
+ left: width * ( params.rewind ? -1 : 1 )
+ });
+ images.animate({
+ left: width * ( params.rewind ? 1 : -1 )
+ }, {
+ duration: params.speed,
+ queue: false,
+ easing: easing,
+ complete: function() {
+ images.css('left', 0);
+ image.css('left', 0);
+ complete();
+ }
+ });
+ },
+
+ fadeslide: function(params, complete) {
+
+ var x = 0,
+ easing = this.getOptions('easing');
+
+ if (params.prev) {
+ x = Utils.parseValue( $(params.prev).css('left') );
+ $(params.prev).css({
+ opacity: 1,
+ left: x
+ }).animate({
+ opacity: 0,
+ left: x + ( 50 * ( params.rewind ? 1 : -1 ) )
+ },{
+ duration: params.speed,
+ queue: false,
+ easing: easing
+ });
+ }
+
+ x = Utils.parseValue( $(params.next).css('left') );
+
+ $(params.next).css({
+ left: x + ( 50 * ( params.rewind ? -1 : 1 ) ),
+ opacity: 0
+ }).animate({
+ opacity: 1,
+ left: x
+ }, {
+ duration: params.speed,
+ complete: complete,
+ queue: false,
+ easing: easing
+ });
+ }
+ },
+
+ // the Utils singleton
+ Utils = (function() {
+
+ return {
+
+ array : function( obj ) {
+ return Array.prototype.slice.call(obj);
+ },
+
+ create : function( className, nodeName ) {
+ nodeName = nodeName || 'div';
+ var elem = doc.createElement( nodeName );
+ elem.className = className;
+ return elem;
+ },
+
+ forceStyles : function( elem, styles ) {
+ elem = $(elem);
+ if ( elem.attr( 'style' ) ) {
+ elem.data( 'styles', elem.attr( 'style' ) ).removeAttr( 'style' );
+ }
+ elem.css( styles );
+ },
+
+ revertStyles : function() {
+ $.each( Utils.array( arguments ), function( i, elem ) {
+
+ elem = $( elem ).removeAttr( 'style' );
+
+ if ( elem.data( 'styles' ) ) {
+ elem.attr( 'style', elem.data('styles') ).data( 'styles', null );
+ }
+ });
+ },
+
+ moveOut : function( elem ) {
+ Utils.forceStyles( elem, {
+ position: 'absolute',
+ left: -10000
+ });
+ },
+
+ moveIn : function() {
+ Utils.revertStyles.apply( Utils, Utils.array( arguments ) );
+ },
+
+ hide : function( elem, speed, callback ) {
+ elem = $(elem);
+
+ // save the value if not exist
+ if (! elem.data('opacity') ) {
+ elem.data('opacity', elem.css('opacity') );
+ }
+
+ // always hide
+ var style = { opacity: 0 };
+
+ if (speed) {
+ elem.stop().animate( style, speed, callback );
+ } else {
+ elem.css( style );
+ };
+ },
+
+ show : function( elem, speed, callback ) {
+ elem = $(elem);
+
+ // bring back saved opacity
+ var saved = parseFloat( elem.data('opacity') ) || 1,
+ style = { opacity: saved };
+
+ // reset save if opacity == 1
+ if (saved == 1) {
+ elem.data('opacity', null);
+ }
+
+ // animate or toggle
+ if (speed) {
+ elem.stop().animate( style, speed, callback );
+ } else {
+ elem.css( style );
+ };
+ },
+
+ addTimer : function() {
+ _timeouts.add.apply( _timeouts, Utils.array( arguments ) );
+ return this;
+ },
+
+ clearTimer : function() {
+ _timeouts.clear.apply( _timeouts, Utils.array( arguments ) );
+ return this;
+ },
+
+ wait : function(options) {
+ options = $.extend({
+ until : function() { return false; },
+ success : function() {},
+ error : function() { Galleria.raise('Could not complete wait function.'); },
+ timeout: 3000
+ }, options);
+
+ var start = Utils.timestamp(),
+ elapsed,
+ now;
+
+ window.setTimeout(function() {
+ now = Utils.timestamp();
+ elapsed = now - start;
+ if ( options.until( elapsed ) ) {
+ options.success();
+ return false;
+ }
+
+ if (now >= start + options.timeout) {
+ options.error();
+ return false;
+ }
+ window.setTimeout(arguments.callee, 2);
+ }, 2);
+ },
+
+ toggleQuality : function( img, force ) {
+
+ if ( !( IE == 7 || IE == 8 ) || !!img === false ) {
+ return;
+ }
+
+ if ( typeof force === 'undefined' ) {
+ force = img.style.msInterpolationMode == 'nearest-neighbor';
+ }
+
+ img.style.msInterpolationMode = force ? 'bicubic' : 'nearest-neighbor';
+ },
+
+ insertStyleTag : function( styles ) {
+ var style = doc.createElement( 'style' );
+ DOM().head.appendChild( style );
+
+ if ( style.styleSheet ) { // IE
+ style.styleSheet.cssText = styles;
+ } else {
+ var cssText = doc.createTextNode( styles );
+ style.appendChild( cssText );
+ }
+ },
+
+ // a loadscript method that works for local scripts
+ loadScript: function( url, callback ) {
+ var done = false,
+ script = $('<scr'+'ipt>').attr({
+ src: url,
+ async: true
+ }).get(0);
+
+ // Attach handlers for all browsers
+ script. = function() {
+ if ( !done && (!this.readyState ||
+ this.readyState == 'loaded' || this.readyState == 'complete') ) {
+ done = true;
+
+ if (typeof callback == 'function') {
+ callback.call( this, this );
+ }
+
+ // Handle memory leak in IE
+ script. = null;
+ }
+ };
+
+ var s = doc.getElementsByTagName( 'script' )[0];
+ s.parentNode.insertBefore( script, s );
+ },
+
+ // parse anything into a number
+ parseValue: function( val ) {
+ if (typeof val == 'number') {
+ return val;
+ } else if (typeof val == 'string') {
+ var arr = val.match(/\-?\d/g);
+ return arr && arr.constructor == Array ? arr.join('') * 1 : 0;
+ } else {
+ return 0;
+ }
+ },
+
+ // timestamp abstraction
+ timestamp: function() {
+ return new Date().getTime();
+ },
+
+ // this is pretty crap, but works for now
+ // it will add a callback, but it can't guarantee that the styles can be fetched
+ // using getComputedStyle further checking needed, possibly a dummy element
+ loadCSS : function( href, id, callback ) {
+
+ var link,
+ ready = false,
+ length;
+
+ // look for manual css
+ $('link[rel=stylesheet]').each(function() {
+ if ( new RegExp( href ).test( this.href ) ) {
+ link = this;
+ return false;
+ }
+ });
+
+ if ( typeof id == 'function' ) {
+ callback = id;
+ id = undef;
+ }
+
+ callback = callback || function() {}; // dirty
+
+ // if already present, return
+ if ( link ) {
+ callback.call( link, link );
+ return link;
+ }
+
+ // save the length of stylesheets to check against
+ length = doc.styleSheets.length;
+
+ // add timestamp if DEBUG is true
+ if ( DEBUG ) {
+ href += '?' + Utils.timestamp();
+ }
+
+ // check for existing id
+ if( $('#'+id).length ) {
+ $('#'+id).attr('href', href);
+ length--;
+ ready = true;
+ } else {
+ link = $( '<link>' ).attr({
+ rel: 'stylesheet',
+ href: href,
+ id: id
+ }).get(0);
+
+ window.setTimeout(function() {
+ var styles = $('link[rel="stylesheet"], style');
+ if ( styles.length ) {
+ styles.get(0).parentNode.insertBefore( link, styles[0] );
+ } else {
+ DOM().head.appendChild( link );
+ }
+
+ if ( IE ) {
+ link.attachEvent( 'onreadystatechange', function(e) {
+ if( link.readyState == 'complete' ) {
+ ready = true;
+ }
+ });
+ } else {
+ // what to do here? returning for now.
+ ready = true;
+ }
+ }, 10);
+ }
+
+ if (typeof callback == 'function') {
+
+ Utils.wait({
+ until: function() {
+ return ready && doc.styleSheets.length > length;
+ },
+ success: function() {
+ Utils.addTimer( 'css', function() {
+ callback.call( link, link );
+ }, 100);
+ },
+ error: function() {
+ Galleria.raise( 'Theme CSS could not load' );
+ },
+ timeout: 1000
+ });
+ }
+ return link;
+ }
+ };
+ })();
+
+/**
+ The main Galleria class
+
+ @class
+
+ @example var gallery = new Galleria();
+
+ @author http://aino.se
+
+ @requires jQuery
+
+ @returns {Galleria}
+*/
+
+Galleria = function() {
+
+ var self = this;
+
+ // the theme used
+ this._theme = undef;
+
+ // internal options
+ this._options = {};
+
+ // flag for controlling play/pause
+ this._playing = false;
+
+ // internal interval for slideshow
+ this._playtime = 5000;
+
+ // internal variable for the currently active image
+ this._active = null;
+
+ // the internal queue, arrayified
+ this._queue = { length: 0 };
+
+ // the internal data array
+ this._data = [];
+
+ // the internal dom collection
+ this._dom = {};
+
+ // the internal thumbnails array
+ this._thumbnails = [];
+
+ // internal init flag
+ this._initialized = false;
+
+ // global stagewidth/height
+ this._stageWidth = 0;
+ this._stageHeight = 0;
+
+ // target holder
+ this._target = undef;
+
+ // instance id
+ this._id = Utils.timestamp();
+
+ // add some elements
+ var divs = 'container stage images image-nav image-nav-left image-nav-right ' +
+ 'info info-text info-title info-description info-author ' +
+ 'thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right ' +
+ 'loader counter tooltip',
+ spans = 'current total';
+
+ $.each( divs.split(' '), function( i, elemId ) {
+ self._dom[ elemId ] = Utils.create( 'galleria-' + elemId );
+ });
+
+ $.each( spans.split(' '), function( i, elemId ) {
+ self._dom[ elemId ] = Utils.create( 'galleria-' + elemId, 'span' );
+ });
+
+ // the internal keyboard object
+ // keeps reference of the keybinds and provides helper methods for binding keys
+ var keyboard = this._keyboard = {
+
+ keys : {
+ 'UP': 38,
+ 'DOWN': 40,
+ 'LEFT': 37,
+ 'RIGHT': 39,
+ 'RETURN': 13,
+ 'ESCAPE': 27,
+ 'BACKSPACE': 8
+ },
+
+ map : {},
+
+ bound: false,
+
+ press: function(e) {
+ var key = e.keyCode || e.which;
+ if ( key in keyboard.map && typeof keyboard.map[key] == 'function' ) {
+ keyboard.map[key].call(self, e);
+ }
+ },
+
+ attach: function(map) {
+ for( var key in map ) {
+ var up = key.toUpperCase();
+ if ( up in keyboard.keys ) {
+ keyboard.map[ keyboard.keys[up] ] = map[key];
+ }
+ }
+ if ( !keyboard.bound ) {
+ keyboard.bound = true;
+ $doc.bind('keydown', keyboard.press);
+ }
+ },
+
+ detach: function() {
+ keyboard.bound = false;
+ $doc.unbind('keydown', keyboard.press);
+ }
+ };
+
+ // internal controls for keeping track of active / inactive images
+ var controls = this._controls = {
+
+ 0: undef,
+
+ 1: undef,
+
+ active : 0,
+
+ swap : function() {
+ controls.active = controls.active ? 0 : 1;
+ },
+
+ getActive : function() {
+ return controls[ controls.active ];
+ },
+
+ getNext : function() {
+ return controls[ 1 - controls.active ];
+ }
+ };
+
+ // internal carousel object
+ var carousel = this._carousel = {
+
+ // shortcuts
+ next: self.$('thumb-nav-right'),
+ prev: self.$('thumb-nav-left'),
+
+ // cache the width
+ width: 0,
+
+ // track the current position
+ current: 0,
+
+ // cache max value
+ max: 0,
+
+ // save all hooks for each width in an array
+ hooks: [],
+
+ // update the carousel
+ // you can run this method anytime, f.ex on window.resize
+ update: function() {
+ var w = 0,
+ h = 0,
+ hooks = [0];
+
+ $.each( self._thumbnails, function( i, thumb ) {
+ if ( thumb.ready ) {
+ w += thumb.outerWidth || $( thumb.container ).outerWidth( true );
+ hooks[ i+1 ] = w;
+ h = Math.max( h, thumb.outerHeight || $( thumb.container).outerHeight() );
+ }
+ });
+ self.$( 'thumbnails-container' ).toggleClass( 'galleria-carousel', w > self._stageWidth );
+
+ self.$( 'thumbnails' ).css({
+ width: w,
+ height: h
+ });
+
+ carousel.max = w;
+ carousel.hooks = hooks;
+ carousel.width = self.$( 'thumbnails-list' ).width();
+ carousel.setClasses();
+
+ // todo: fix so the carousel moves to the left
+ },
+
+ bindControls: function() {
+
+ carousel.next.bind( CLICK(), function(e) {
+ e.preventDefault();
+
+ if ( self._options.carousel_steps == 'auto' ) {
+
+ for ( var i = carousel.current; i < carousel.hooks.length; i++ ) {
+ if ( carousel.hooks[i] - carousel.hooks[ carousel.current ] > carousel.width ) {
+ carousel.set(i - 2);
+ break;
+ }
+ }
+
+ } else {
+ carousel.set( carousel.current + self._options.carousel_steps);
+ }
+ });
+
+ carousel.prev.bind( CLICK(), function(e) {
+ e.preventDefault();
+
+ if ( self._options.carousel_steps == 'auto' ) {
+
+ for ( var i = carousel.current; i >= 0; i-- ) {
+ if ( carousel.hooks[ carousel.current ] - carousel.hooks[i] > carousel.width ) {
+ carousel.set( i + 2 );
+ break;
+ } else if ( i == 0 ) {
+ carousel.set( 0 );
+ break;
+ }
+ }
+ } else {
+ carousel.set( carousel.current - self._options.carousel_steps );
+ }
+ });
+ },
+
+ // calculate and set positions
+ set: function( i ) {
+ i = Math.max( i, 0 );
+ while ( carousel.hooks[i - 1] + carousel.width > carousel.max && i >= 0 ) {
+ i--;
+ }
+ carousel.current = i;
+ carousel.animate();
+ },
+
+ // get the last position
+ getLast: function(i) {
+ return ( i || carousel.current ) - 1;
+ },
+
+ // follow the active image
+ follow: function(i) {
+
+ //don't follow if position fits
+ if ( i == 0 || i == carousel.hooks.length - 2 ) {
+ carousel.set( i );
+ return;
+ }
+
+ // calculate last position
+ var last = carousel.current;
+ while( carousel.hooks[last] - carousel.hooks[ carousel.current ] <
+ carousel.width && last <= carousel.hooks.length ) {
+ last ++;
+ }
+
+ // set position
+ if ( i - 1 < carousel.current ) {
+ carousel.set( i - 1 );
+ } else if ( i + 2 > last) {
+ carousel.set( i - last + carousel.current + 2 );
+ }
+ },
+
+ // helper for setting disabled classes
+ setClasses: function() {
+ carousel.prev.toggleClass( 'disabled', !carousel.current );
+ carousel.next.toggleClass( 'disabled', carousel.hooks[ carousel.current ] + carousel.width > carousel.max );
+ },
+
+ // the animation method
+ animate: function(to) {
+ carousel.setClasses();
+ var num = carousel.hooks[ carousel.current ] * -1;
+
+ if ( isNaN( num ) ) {
+ return;
+ }
+
+ self.$( 'thumbnails' ).animate({
+ left: num
+ },{
+ duration: self._options.carousel_speed,
+ easing: self._options.easing,
+ queue: false
+ });
+ }
+ };
+
+ // tooltip control
+ // added in 1.2
+ var tooltip = this._tooltip = {
+
+ initialized : false,
+
+ active: null,
+
+ open: false,
+
+ init: function() {
+
+ tooltip.initialized = true;
+
+ var css = '.galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3' +
+ 'opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}';
+
+ Utils.insertStyleTag(css);
+
+ self.$( 'tooltip' ).css('opacity', .8);
+ Utils.hide( self.get('tooltip') );
+
+ },
+
+ // move handler
+ move: function( e ) {
+ var mouseX = self.getMousePosition(e).x,
+ mouseY = self.getMousePosition(e).y,
+ $elem = self.$( 'tooltip' ),
+ x = mouseX,
+ y = mouseY,
+ height = $elem.outerHeight( true ) + 1,
+ width = $elem.outerWidth( true ),
+ limitY = height + 15;
+
+ var maxX = self._stageWidth - width,
+ maxY = self._stageHeight - height;
+
+ if ( !isNaN(x) && !isNaN(y) ) {
+
+ x += 15;
+ y -= 35;
+
+ x = Math.max( 0, Math.min( maxX, x ) );
+ y = Math.max( 0, Math.min( maxY, y ) );
+
+ if( mouseY < limitY ) {
+ y = limitY;
+ }
+
+ $elem.css({ left: x, top: y });
+ }
+ },
+
+ // bind elements to the tooltip
+ // you can bind multiple elementIDs using { elemID : function } or { elemID : string }
+ // you can also bind single DOM elements using bind(elem, string)
+ bind: function( elem, value ) {
+
+ if (! tooltip.initialized ) {
+ tooltip.init();
+ }
+
+ var hover = function( elem, value) {
+
+ tooltip.define( elem, value );
+
+ $( elem ).hover(function() {
+
+ tooltip.active = elem;
+ Utils.clearTimer('switch_tooltip');
+ self.$('container').unbind( 'mousemove', tooltip.move ).bind( 'mousemove', tooltip.move ).trigger( 'mousemove' );
+ tooltip.show( elem );
+
+ Galleria.utils.addTimer( 'tooltip', function() {
+
+ Utils.show( self.get( 'tooltip' ), 400 );
+ tooltip.open = true;
+
+ }, tooltip.open ? 0 : 1000);
+
+ }, function() {
+
+ tooltip.active = null;
+
+ self.$( 'container' ).unbind( 'mousemove', tooltip.move );
+ Utils.clearTimer( 'tooltip' );
+
+ Utils.hide( self.get( 'tooltip' ), 200, function() {
+ Utils.addTimer('switch_tooltip', function() {
+ tooltip.open = false;
+ }, 1000);
+ });
+ });
+ };
+
+ if (typeof value == 'string') {
+ hover( ( elem in self._dom ? self.get(elem) : elem ), value );
+ } else {
+ // asume elemID here
+ $.each( elem, function( elemID, val ) {
+ hover( self.get(elemID), val );
+ });
+ }
+ },
+
+ show: function( elem ) {
+ var text = $(elem).data('tt');
+ if ( ! text ) {
+ return;
+ }
+ text = typeof text == 'function' ? text() : text;
+ self.$( 'tooltip' ).html( text.replace(/\s/, ' ') );
+ },
+
+ // redefine the tooltip here
+ define: function( elem, value ) {
+
+ // we store functions, not strings
+ if (typeof value !== 'function') {
+ var s = value;
+ value = function() {
+ return s;
+ };
+ }
+
+ if ( elem in self._dom ) {
+ elem = self.get( elem );
+ }
+
+ $(elem).data('tt', value);
+
+ tooltip.show( elem );
+
+ },
+
+ refresh: function() {
+ $.each( arguments, function(i, elem) {
+ if ( tooltip.active == elem ) {
+ tooltip.show( elem );
+ }
+ });
+ }
+ };
+
+ // internal fullscreen control
+ // added in 1.195
+ // still kind of experimental
+ var fullscreen = this._fullscreen = {
+ scrolled: 0,
+ enter: function(callback) {
+
+ // hide the image until rescale is complete
+ Utils.hide( self.getActiveImage() );
+
+ self.$( 'container' ).addClass( 'fullscreen' );
+
+ fullscreen.scrolled = $(window).scrollTop();
+
+ // begin styleforce
+ Utils.forceStyles(self.get('container'), {
+ position: 'fixed',
+ top: 0,
+ left: 0,
+ width: '100%',
+ height: '100%',
+ zIndex: 10000
+ });
+
+ var htmlbody = {
+ height: '100%',
+ overflow: 'hidden',
+ margin:0,
+ padding:0
+ };
+
+ Utils.forceStyles( DOM().html, htmlbody );
+ Utils.forceStyles( DOM().body, htmlbody );
+
+ // attach some keys
+ self.attachKeyboard({
+ escape: self.exitFullscreen,
+ right: self.next,
+ left: self.prev
+ });
+
+ // init the first rescale and attach callbacks
+ self.rescale(function() {
+
+ Utils.addTimer('fullscreen_enter', function() {
+ // show the image after 50 ms
+ Utils.show( self.getActiveImage() );
+
+ if (typeof callback == 'function') {
+ callback.call( self );
+ }
+
+ }, 50);
+
+ self.trigger( Galleria.FULLSCREEN_ENTER );
+ });
+
+ // bind the scaling to the resize event
+ $(window).resize( function() {
+ fullscreen.scale();
+ } );
+ },
+
+ scale : function() {
+ self.rescale();
+ },
+
+ exit: function(callback) {
+
+ Utils.hide( self.getActiveImage() );
+
+ self.$('container').removeClass( 'fullscreen' );
+
+ // revert all styles
+ Utils.revertStyles( self.get('container'), DOM().html, DOM().body );
+
+ // scroll back
+ window.scrollTo(0, fullscreen.scrolled);
+
+ // detach all keyboard events (is this good?)
+ self.detachKeyboard();
+
+ self.rescale(function() {
+ Utils.addTimer('fullscreen_exit', function() {
+
+ // show the image after 50 ms
+ Utils.show( self.getActiveImage() );
+
+ if ( typeof callback == 'function' ) {
+ callback.call( self );
+ }
+
+ }, 50);
+
+ self.trigger( Galleria.FULLSCREEN_EXIT );
+ });
+
+ $(window).unbind('resize', fullscreen.scale);
+ }
+ };
+
+ // the internal idle object for controlling idle states
+ // TODO occational event conflicts
+ var idle = this._idle = {
+
+ trunk: [],
+
+ bound: false,
+
+ add: function(elem, to) {
+ if (!elem) {
+ return;
+ }
+ if (!idle.bound) {
+ idle.addEvent();
+ }
+ elem = $(elem);
+
+ var from = {};
+
+ for (var style in to) {
+ from[style] = elem.css(style);
+ }
+ elem.data('idle', {
+ from: from,
+ to: to,
+ complete: true,
+ busy: false
+ });
+ idle.addTimer();
+ idle.trunk.push(elem);
+ },
+
+ remove: function(elem) {
+
+ elem = jQuery(elem);
+
+ $.each(idle.trunk, function(i, el) {
+ if ( el.length && !el.not(elem).length ) {
+ self._idle.show(elem);
+ self._idle.trunk.splice(i, 1);
+ }
+ });
+
+ if (!idle.trunk.length) {
+ idle.removeEvent();
+ Utils.clearTimer('idle');
+ }
+ },
+
+ addEvent : function() {
+ idle.bound = true;
+ self.$('container').bind('mousemove click', idle.showAll );
+ },
+
+ removeEvent : function() {
+ idle.bound = false;
+ self.$('container').unbind('mousemove click', idle.showAll );
+ },
+
+ addTimer : function() {
+ Utils.addTimer('idle', function() {
+ self._idle.hide();
+ }, self._options.idle_time );
+ },
+
+ hide : function() {
+ self.trigger( Galleria.IDLE_ENTER );
+
+ $.each( idle.trunk, function(i, elem) {
+
+ var data = elem.data('idle');
+
+ if (! data) {
+ return;
+ }
+
+ data.complete = false;
+
+ elem.stop().animate(data.to, {
+ duration: 600,
+ queue: false,
+ easing: 'swing'
+ });
+ });
+ },
+
+ showAll : function() {
+ Utils.clearTimer('idle');
+
+ $.each(self._idle.trunk, function( i, elem ) {
+ self._idle.show( elem );
+ });
+ },
+
+ show: function(elem) {
+
+ var data = elem.data('idle');
+
+ if (!data.busy && !data.complete) {
+
+ data.busy = true;
+
+ self.trigger( Galleria.IDLE_EXIT );
+
+ elem.animate(data.from, {
+ duration: 300,
+ queue: false,
+ easing: 'swing',
+ complete: function() {
+ $(this).data('idle').busy = false;
+ $(this).data('idle').complete = true;
+ }
+ });
+ }
+ idle.addTimer();
+ }
+ };
+
+ // internal lightbox object
+ // creates a predesigned lightbox for simple popups of images in galleria
+ var lightbox = this._lightbox = {
+
+ width : 0,
+
+ height : 0,
+
+ initialized : false,
+
+ active : null,
+
+ image : null,
+
+ elems : {},
+
+ init : function() {
+
+ // trigger the event
+ self.trigger( Galleria.LIGHTBOX_OPEN );
+
+ if ( lightbox.initialized ) {
+ return;
+ }
+ lightbox.initialized = true;
+
+ // create some elements to work with
+ var elems = 'overlay box content shadow title info close prevholder prev nextholder next counter image',
+ el = {},
+ op = self._options,
+ css = '',
+ cssMap = {
+ overlay: 'position:fixed;display:none;opacity:'+op.overlay_opacity+';top:0;left:0;width:100%;height:100%;background:'+op.overlay_background+';z-index:99990',
+ box: 'position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991',
+ shadow: 'position:absolute;background:#000;width:100%;height:100%;',
+ content: 'position:absolute;background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden',
+ info: 'position:absolute;bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px',
+ close: 'position:absolute;top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999',
+ image: 'position:absolute;top:10px;left:10px;right:10px;bottom:30px;overflow:hidden',
+ prevholder: 'position:absolute;width:50%;height:100%;cursor:pointer',
+ nextholder: 'position:absolute;width:50%;height:100%;right:0;cursor:pointer',
+ prev: 'position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;line-height:40px;text-align:center;color:#000',
+ next: 'position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;line-height:40px;text-align:center;color:#000',
+ title: 'float:left',
+ counter: 'float:right;margin-left:8px'
+ },
+ hover = function(elem) {
+ return elem.hover(
+ function() { $(this).css( 'color', '#bbb' ); },
+ function() { $(this).css( 'color', '#444' ); }
+ );
+ };
+
+ // create and insert CSS
+ $.each(cssMap, function( key, value ) {
+ css += '.galleria-lightbox-'+key+'{'+value+'}';
+ });
+
+ Utils.insertStyleTag( css );
+
+ // create the elements
+ $.each(elems.split(' '), function( i, elemId ) {
+ self.addElement( 'lightbox-' + elemId );
+ el[ elemId ] = lightbox.elems[ elemId ] = self.get( 'lightbox-' + elemId );
+ });
+
+ // initiate the image
+ lightbox.image = new Galleria.Picture();
+
+ // append the elements
+ self.append({
+ 'lightbox-box': ['lightbox-shadow','lig...
[truncated message content] |