1(function($) { 2 paginator = function () { 3 /** 4 * Private properties 5 */ 6 var linkNext = null; 7 var linkPrev = null; 8 9 /** 10 * Private methods 11 */ 12 var setLinks = function () { 13 linkPrev = $("ul.pagination li.pager-previous a").attr("href"); 14 linkNext = $("ul.pagination li.pager-next a").attr("href"); 15 }; 16 17 var navigate = function (event) { 18 var href = null; 19 if (event.ctrlKey && event.keyCode == 37) href = linkPrev; 20 if (event.ctrlKey && event.keyCode == 39) href = linkNext; 21 if (href) document.location = href; 22 }; 23 24 /** 25 * Public methods 26 */ 27 this.__init = function () { 28 // Get next/prev hrefs 29 setLinks(); 30 31 // Ctrl + arrow event handle 32 $(document).keydown( function(event) { 33 navigate(event); 34 }); 35 } 36 }; 37 38 $(document).ready(function(){ 39 var pageNavigation = new paginator(); 40 pageNavigation.__init(); 41 }); 42 43 /** 44 * Hide next and previous element 45 */ 46 $(document).ready(function(){ 47 $('ul.pagination').each(function () { 48 if ($(this).find('li:eq(1)').attr('class') == 'active') { 49 $(this).find('li:eq(0)').hide(); 50 } else if ($(this).find('li:eq(-2)').attr('class') == 'active') { 51 $(this).find('li:eq(-1)').hide(); 52 } 53 }); 54 55 }); 56})(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.