vendor: 2,328 bytes, lines 1-82
1/*! lg-hash - v1.0.1 - 2016-09-30 2 * http://sachinchoolur.github.io/lightGallery 3 * Copyright (c) 2016 Sachin N; Licensed GPLv3 */ 4 5(function (root, factory) { 6 if (typeof define === 'function' && define.amd) { 7 // AMD. Register as an anonymous module unless amdModuleId is set 8 define(['jquery'], function (a0) { 9 return (factory(a0)); 10 }); 11 } else if (typeof exports === 'object') { 12 // Node. Does not work with strict CommonJS, but 13 // only CommonJS-like environments that support module.exports, 14 // like Node. 15 module.exports = factory(require('jquery')); 16 } else { 17 factory(jQuery); 18 } 19}(this, function ($) { 20 21 (function() { 22 23 'use strict'; 24 25 var defaults = { 26 hash: true 27 }; 28 29 var Hash = function(element) { 30 31 this.core = $(element).data('lightGallery'); 32 33 this.core.s = $.extend({}, defaults, this.core.s); 34 35 if (this.core.s.hash) { 36 this.oldHash = window.location.hash; 37 this.init(); 38 } 39 40 return this; 41 }; 42 43 Hash.prototype.init = function() { 44 var _this = this; 45 var _hash; 46 47 // Change hash value on after each slide transition 48 _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) { 49 //window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index; 50 }); 51 52 // Listen hash change and change the slide according to slide value 53 54 }; 55 56 Hash.prototype.destroy = function() { 57 58 if (!this.core.s.hash) { 59 return; 60 } 61 62 // Reset to old hash value 63 //if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) { 64 // window.location.hash = this.oldHash; 65 // } else { 66 // if (history.pushState) { 67 //history.pushState('', document.title, window.location.pathname + window.location.search); 68 // } else { 69 //window.location.hash = ''; 70 //} 71 // } 72 73 this.core.$el.off('.lg.hash'); 74 75 }; 76 77 $.fn.lightGallery.modules.hash = Hash; 78 79 })(); 80 81 82}));
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.