1jQuery(function($) { 2 var ngg_imagebrowser_init = function() { 3 var imagebrowser_links = $('a.use_imagebrowser_effect'); 4 imagebrowser_links.on('click', function(e) { 5 e.preventDefault(); 6 var success = true; 7 var $this = $(this); 8 var image_id = $this.attr('data-image-id'); 9 var image_slug = $this.attr('data-image-slug'); 10 var image_url = $this.attr('data-imagebrowser-url'); 11 12 var url = window.location.toString(); 13 url = url.split('/' + photocrati_ajax.ngg_param_slug + '/').shift(); 14 if (url.substr(-1) === '/') 15 url = url.substr(0, url.length - 1); 16 17 image_id = image_slug ? image_slug : image_id; 18 try { 19 if (!image_id) 20 image_id = parseInt($this.parents('.ngg-gallery-thumbnail-box').attr('id').match(/\d+/).join('')); 21 } catch (ex) { 22 success = false; 23 } 24 25 if (success) { 26 27 url = image_url.replace('%STUB%', image_id); 28 29 /* TODO: Remove this entire chunk. It should be unecessary. 30 // Custom permalinks are disabled. So we have to redirect to /index.php/nggallery/image/n?qs=1 31 if (photocrati_ajax.wp_root_url.indexOf('index.php') >= 0) { 32 url = photocrati_ajax.wp_root_url + "/" + photocrati_ajax.ngg_param_slug + "/image/" + image_id; 33 if (window.location.toString().indexOf('?') >= 0) 34 url += '?'+window.location.toString().split('?').pop(); 35 } else { 36 // Just append the slug 37 url += "/" + photocrati_ajax.ngg_param_slug + "/image/" + image_id; 38 } */ 39 40 window.location = url; 41 } 42 }); 43 44 // Unregister any onclick handlers added after the above has executed to avoid conflicts 45 if (imagebrowser_links.length > 0) { 46 setTimeout(function() { 47 imagebrowser_links.each(function() { 48 this.onclick = null; 49 }); 50 }, 200); 51 } 52 }; 53 54 $(this).on('refreshed', ngg_imagebrowser_init); 55 ngg_imagebrowser_init(); 56});
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.