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 window, jQuery, Galleria */ 13 14Galleria.addTheme({ 15 name: 'classic', 16 author: 'Apartment Cambridge', 17 css: 'galleria.classic.css', 18 defaults: { 19 transition: 'slide', // 'pulse' 20 thumbCrop: true,//'height', 21 imagecrop: 'width', 22 lightbox: false, 23 24 _showFullscreen: true, 25 _showPopout: true, 26 _showProgress: true, 27 28 _locale : { 29 click_to_close : "Click to close", 30 show_info : "Show info", 31 show_thumbnails: "Show thumbnails", 32 hide_thumbnails: "Hide thumbnails", 33 play: "Play slideshow", 34 pause: "Pause slideshow", 35 enter_fullscreen: "Enter fullscreen", 36 exit_fullscreen: "Exit fullscreen", 37 popout_image: "Popout image", 38 showing_image: "Showing image %s of %s" 39 } 40 }, 41 init: function(options) { 42 43 Galleria.requires(1.4, 'This version of Classic theme requires Galleria 1.4 or later'); 44 45 // add some elements 46 //this.addElement('info-link','info-close'); 47 //this.append({'info' : ['info-link','info-close']}); 48 //this.addElement("desc", "fs", "more"); 49 //this.append({container : ["desc", "fs", "info-description", "more"]}); 50 this.addElement("bar","fs", "play", "pause", "progress"); 51 this.append({container : ["bar", "play", "pause", "fs", "info-description", "progress"]}); 52 53 // cache some stuff 54 //var info = this.$('info-link,info-close,info-text'); 55 var touch = Galleria.TOUCH; 56 var desc, 57 gallery=this, 58 galleryFull=!1; 59 60 // show loader & counter with opacity 61 this.$('loader,counter').show().css('opacity', 0.4); 62 63 // some stuff for non-touch browsers 64 if (! touch ) { 65 this.addIdleState( this.get('image-nav-left'), { left:-50 }); 66 this.addIdleState( this.get('image-nav-right'), { right:-50 }); 67 this.addIdleState( this.get('counter'), { opacity:0 }); 68 } 69/* 70 // A 71 desc = this.$("desc").hide().hover(function () { 72 e(this).addClass("hover") 73 }, 74 function () { 75 e(this).removeClass("hover") 76 }).on("click:fast", function () { 77 e(this).hide() 78 }); 79*/ 80 // bind some stuff 81 this.bind('thumbnail', function(e) { 82 83 if (! touch ) { 84 // fade thumbnails 85 $(e.thumbTarget).css('opacity', 0.6).parent().hover(function() { 86 $(this).not('.active').children().stop().fadeTo(100, 1); 87 }, function() { 88 $(this).not('.active').children().stop().fadeTo(400, 0.6); 89 }); 90 91 if ( e.index === this.getIndex() ) { 92 $(e.thumbTarget).css('opacity',1); 93 } 94 } else { 95 $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6).bind('click:fast', function() { 96 $(this).css( 'opacity', 1 ).parent().siblings().children().css('opacity', 0.6); 97 }); 98 } 99 }); 100 101 var activate = function(e) { 102 $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6); 103 }; 104 105 this.bind('loadstart', function(e) { 106 if (!e.cached) { 107 this.$('loader').show().fadeTo(200, 0.4); 108 } 109 window.setTimeout(function() { 110 activate(e); 111 }, touch ? 300 : 0); 112 this.$('info').toggle( this.hasInfo() ); 113 }); 114 115 this.bind('loadfinish', function(e) { 116 this.$('loader').fadeOut(200); 117 }); 118 this.$("fs").on("click:fast", function () { 119 gallery.toggleFullscreen(); 120 galleryFull = !galleryFull; 121 if(galleryFull) gallery.$("fs").addClass('fs'); 122 else gallery.$("fs").removeClass('fs'); 123 }); 124 this.$("play").on("click:fast", function (e) { 125 gallery.play(2000); 126 gallery.$("play").hide(); 127 gallery.$("pause").show(); 128 }); 129 this.$("pause").on("click:fast", function (e) { 130 gallery.pause(); 131 gallery.$("pause").hide(); 132 gallery.$("play").show(); 133 gallery.$("progress").width(0); 134 }); 135 this.bind("progress", function (e) { 136 gallery.$("progress").width(e.percent / 100 * (this.getStageWidth()+20)); 137 }); 138 139 } 140}); 141 142}(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.