1/** 2 * @preserve Galleria Fullscreen Theme 2012-01-25 3 * http://galleria.aino.se 4 * 5 * Copyright (c) 2011, Aino 6 * Copyright (c) 2012, Petri Damstén 7 * Licensed under the MIT license. 8 * 9 * Modified to work with Wordpress galleria-fs by Petri Damstén 10 */ 11 12/* global jQuery, Galleria */ 13 14(function($) { 15 16Galleria.addTheme({ 17 version: '1.5.4', 18 name: 'galleria-fs', 19 author: 'Petri Damstén', 20 defaults: { 21 transition: 'slide', 22 thumbCrop: 'height', 23 imageCrop: true, 24 easing: 'galleriaOut', 25 trueFullscreen: false, 26 // set this to false if you want to keep the thumbnails: 27 _hideDock: Galleria.TOUCH ? false : true, 28 // set this to true if you want to shrink the carousel when clicking a thumbnail: 29 _closeOnClick: false, 30 // set this to false if you want to show the caption all the time: 31 _toggleInfo: false 32 }, 33 init: function(options) { 34 Galleria.requires(1.5, 'This version of theme requires Galleria 1.5 or later'); 35 36 // add some elements 37 this.addElement('info-link','info-close'); 38 this.append({ 39 'info' : ['info-link','info-close'] 40 }); 41 42 this.addElement('close', 'map', 'map-close'); 43 this.appendChild('container', 'close'); 44 this.appendChild('container', 'map'); 45 this.appendChild('map', 'map-close'); 46 47 var timer = 0; 48 // cache some stuff 49 var info = this.$('info-link,info-close,info-text'), 50 close = this.$('close'), 51 map = this.$('map'), 52 map_close = this.$('map-close'), 53 touch = Galleria.TOUCH; 54 55 // show loader & counter with opacity 56 this.$('loader, counter').show().css('opacity', 0.4); 57 58 // some stuff for non-touch browsers 59 if (! touch ) { 60 this.addIdleState( this.get('image-nav-left'), { left:-50 }); 61 this.addIdleState( this.get('image-nav-right'), { right:-50 }); 62 this.addIdleState( this.get('close'), { right:-50 }); 63 this.addIdleState( this.get('counter'), { opacity:0 }); 64 this.addIdleState( this.get('info-link'), { opacity:0 }); 65 this.addIdleState( this.get('info-text'), { opacity:0 }); 66 this.addIdleState( this.get('thumbnails'), { opacity:0.25 }); 67 } 68 var gallery = this; 69 $.each(this._layers, function() { 70 gallery.addIdleState(this, {opacity:0}); 71 }); 72 73 // toggle info 74 if ( options._toggleInfo === true ) { 75 info.bind( 'click:fast', function() { 76 info.toggle(); 77 }); 78 } else { 79 info.show(); 80 this.$('info-link, info-close').hide(); 81 } 82 83 map.attr('id', 'galleria-map'); // openlayers needs id 84 close.bind('click:fast', function() { 85 if ($('#galleria-map').is(":visible")) { 86 $('#galleria-map').toggle(); 87 } 88 $('#galleria').toggle(); 89 fsg_on_close(); 90 }); 91 map_close.bind('click:fast', function() { 92 $('#galleria-map').toggle(); 93 }); 94 95 // bind some stuff 96 if ( touch ) { 97 this.bind('image', function(e) { 98 clearTimeout(timer); 99 timer = setTimeout(function(e) { 100 $('.galleria-infolayer').fadeOut(750); 101 }, 750); 102 }); 103 $('#galleria').bind('click', function() { 104 clearTimeout(timer); 105 $('.galleria-infolayer').fadeIn(300); 106 }); 107 } 108 this.bind('thumbnail', function(e) { 109 110 if (! touch ) { 111 // fade thumbnails 112 $(e.thumbTarget).css('opacity', 0.6).parent().hover(function() { 113 $(this).not('.active').children().stop().fadeTo(100, 1); 114 }, function() { 115 $(this).not('.active').children().stop().fadeTo(400, 0.6); 116 }); 117 118 if ( e.index === this.getIndex() ) { 119 $(e.thumbTarget).css('opacity',1); 120 } 121 } else { 122 $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6).bind('click:fast', function() { 123 $(this).css( 'opacity', 1 ).parent().siblings().children().css('opacity', 0.6); 124 }); 125 } 126 }); 127 128 var activate = function(e) { 129 $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6); 130 }; 131 132 this.bind('loadstart', function(e) { 133 if (!e.cached) { 134 this.$('loader').show().fadeTo(200, 0.4); 135 } 136 window.setTimeout(function() { 137 activate(e); 138 }, touch ? 300 : 0); 139 this.$('info').toggle( this.hasInfo() ); 140 }); 141 142 this.bind('loadfinish', function(e) { 143 this.$('loader').fadeOut(200); 144 }); 145 } 146}); 147 148}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.