1/** 2 * Galleria Classic Theme 2012-08-08 3 * http://galleria.io 4 * 5 * Licensed under the MIT license 6 * https://raw.github.com/aino/galleria/master/LICENSE 7 * 8 */ 9 10(function($) { 11 12/*global jQuery, Galleria */ 13 14Galleria.addTheme({ 15 name: 'classic', 16 author: 'Galleria', 17 css: 'galleria.classic.css', 18 defaults: { 19 transition: 'slide', 20 thumbCrop: 'height', 21 22 // set this to false if you want to show the caption all the time: 23 _toggleInfo: true 24 }, 25 init: function(options) { 26 var self = this; 27 Galleria.requires(1.28, 'This version of Classic theme requires Galleria 1.2.8 or later'); 28 29 // add some elements 30 this.addElement('info-link','info-close'); 31 this.append({ 32 'info' : ['info-link','info-close'] 33 }); 34 35 // cache some stuff 36 var info = this.$('info-link,info-close,info-text'), 37 touch = Galleria.TOUCH, 38 click = touch ? 'touchstart' : 'click'; 39 40 // show loader & counter with opacity 41 this.$('loader,counter').show().css('opacity', 0.4); 42 43 // some stuff for non-touch browsers 44 if (! touch ) { 45 this.addIdleState( this.get('image-nav-left'), { left:-50 }); 46 this.addIdleState( this.get('image-nav-right'), { right:-50 }); 47 this.addIdleState( this.get('counter'), { opacity:0 }); 48 } 49 50 // toggle info 51 if ( options._toggleInfo === true ) { 52 info.bind( click, function() { 53 info.toggle(); 54 }); 55 } else { 56 info.show(); 57 this.$('info-link, info-close').hide(); 58 } 59 60 // bind some stuff 61 this.bind('thumbnail', function(e) { 62 63 if (! touch ) { 64 // fade thumbnails 65 $(e.thumbTarget).css('opacity', 0.6).parent().hover(function() { 66 $(this).not('.active').children().stop().fadeTo(100, 1); 67 }, function() { 68 $(this).not('.active').children().stop().fadeTo(400, 0.6); 69 }); 70 71 if ( e.index === this.getIndex() ) { 72 $(e.thumbTarget).css('opacity',1); 73 } 74 } else { 75 $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6); 76 } 77 }); 78 79 this.bind('loadstart', function(e) { 80 if (!e.cached) { 81 this.$('loader').show().fadeTo(200, 0.4); 82 } 83 84 this.$('info').toggle( this.hasInfo() ); 85 86 $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6); 87 }); 88 89 this.bind('loadfinish', function(e) { 90 this.$('loader').fadeOut(200); 91 }); 92 93 this.bind('image', function(e) { 94 if (!options.lightbox) { 95 $(e.imageTarget).unbind('click').click(function() { 96 self.toggleFullscreen(); 97 }); 98 } 99 }); 100 } 101}); 102 103}(cmsSystemJQuery));
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.