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 14Galleria.requires(1.26, 'This version of theme requires Galleria 1.2.6 or later'); 15 16(function($) { 17 18Galleria.addTheme({ 19 name: 'galleria-fs', 20 author: 'Petri Damstén', 21 defaults: { 22 transition: 'slide', 23 thumbCrop: 'height', 24 25 // set this to false if you want to show the caption all the time: 26 _toggleInfo: false 27 }, 28 init: function(options) { 29 // add some elements 30 this.addElement('info-link','info-close'); 31 this.append({ 32 'info' : ['info-link','info-close'] 33 }); 34 35 this.addElement('close', 'map', 'map-close'); 36 this.appendChild('container', 'close'); 37 this.appendChild('container', 'map'); 38 this.appendChild('map', 'map-close'); 39 40 // cache some stuff 41 var info = this.$('info-link,info-close,info-text'), 42 close = this.$('close'), 43 map = this.$('map'), 44 map_close = this.$('map-close'), 45 touch = Galleria.TOUCH, 46 click = touch ? 'touchstart' : 'click'; 47 48 // show loader & counter with opacity 49 this.$('loader, counter').show().css('opacity', 0.7); 50 51 // some stuff for non-touch browsers 52 if (! touch ) { 53 this.addIdleState( this.get('image-nav-left'), { opacity:0 }); 54 this.addIdleState( this.get('image-nav-right'), { opacity:0 }); 55 this.addIdleState( this.get('counter'), { opacity:0 }); 56 this.addIdleState( this.get('info-link'), { opacity:0 }); 57 this.addIdleState( this.get('info-text'), { opacity:0 }); 58 this.addIdleState( this.get('thumbnails'), { opacity:0.25 }); 59 } else { 60 this.$('image-nav-left, image-nav-right').hide(); 61 } 62 this.addIdleState( this.get('close'), { opacity:0 }); 63 var gallery = this; 64 $.each(this._layers, function() { 65 gallery.addIdleState(this, {opacity:0}); 66 }); 67 68 // toggle info 69 if ( options._toggleInfo === true ) { 70 info.bind( click, function() { 71 info.toggle(); 72 }); 73 } else { 74 info.show(); 75 this.$('info-link, info-close').hide(); 76 } 77 78 map.attr('id', 'galleria-map'); // openlayers needs id 79 close.bind(click, function() { 80 if ($('#galleria-map').is(":visible")) { 81 $('#galleria-map').toggle(); 82 } 83 $('#galleria').toggle(); 84 fsg_on_close(); 85 }); 86 map_close.bind(click, function() { 87 $('#galleria-map').toggle(); 88 }); 89 90 // bind some stuff 91 this.bind('thumbnail', function(e) { 92 if (! touch ) { 93 // fade thumbnails 94 $(e.thumbTarget).css('opacity', 0.6).parent().hover(function() { 95 $(this).not('.active').children().stop().fadeTo(100, 1); 96 }, function() { 97 $(this).not('.active').children().stop().fadeTo(400, 0.6); 98 }); 99 100 if ( e.index === this.getIndex() ) { 101 $(e.thumbTarget).css('opacity',1); 102 } 103 } else { 104 $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6); 105 } 106 }); 107 108 this.bind('loadstart', function(e) { 109 if (!e.cached) { 110 this.$('loader').show().fadeTo(200, 0.4); 111 } 112 113 this.$('info').toggle( this.hasInfo() ); 114 115 $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6); 116 }); 117 118 this.bind('loadfinish', function(e) { 119 this.$('loader').fadeOut(200); 120 }); 121 } 122}); 123 124}(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.