1(function($) { 2 $(document).ready(function() { 3 4 if ($('.js-pdf-light-viewer-print-options').length) { 5 $('.js-pdf-light-viewer-print-options').each(function() { 6 var self = $(this), 7 instance = self.parents('.js-pdf-light-viewer'); 8 self.qtip({ 9 style: { classes: 'qtip-light pdf-light-viewer-tips ' + PdfLightViewer.settings.theme_class }, 10 content: { 11 text: $('.js-pdf-light-viewer-print-options-contaner') 12 }, 13 show: 'click', 14 hide: { 15 event: 'click' 16 }, 17 position: { 18 my: 'top center', 19 container: instance 20 } 21 }).on('click', function(e) { 22 e.preventDefault(); 23 }); 24 }); 25 } 26 27 if ($('.js-pdf-light-viewer-print').length) { 28 $('.js-pdf-light-viewer-print').printPage({ 29 attr: 'href' 30 }); 31 } 32 33 $(document).on('pdf-light-viewer.turned', function(event, data) { 34 35 if ($('.js-pdf-light-viewer-magazine', data.instance).turn('display') == 'single') { 36 var pages = [data.page]; 37 } 38 else { 39 var pages = [data.page,data.neighborhood_page]; 40 } 41 42 $('.js-pdf-light-viewer-print-page', data.instance).attr('href', 43 $('.js-pdf-light-viewer-print-page', data.instance).attr('data-base-href') + '&pages='+pages.join(',') 44 ); 45 }); 46 47 if ($('.js-pdf-light-viewer-search-form-input').length) { 48 49 $('.js-pdf-light-viewer-search-form-input').each(function() { 50 51 var input = $(this); 52 53 var searchAdapter = new Bloodhound({ 54 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'), 55 queryTokenizer: Bloodhound.tokenizers.whitespace, 56 remote: { 57 url: PdfLightViewerPro.url.ajaxurl + '?action=pdf-light-viewer-pro_pages_search&post_id='+(input.data('post-id'))+'&q=%QUERY', 58 wildcard: '%QUERY' 59 } 60 }); 61 searchAdapter.initialize(); 62 63 input.typeahead({ 64 highlight: true, 65 minLength: 2 66 }, { 67 displayKey: 'text', 68 source: searchAdapter.ttAdapter(), 69 limit: 8, 70 templates: { 71 suggestion: function(suggestion) { 72 return '<div>'+PdfLightViewerPro.__.page+' '+suggestion.page+': '+suggestion.text+'</div>'; 73 } 74 } 75 }) 76 .on('typeahead:selected', function(e, suggestion) { 77 if (suggestion.page) { 78 $('.js-pdf-light-viewer-magazine').turn('page', suggestion.page); 79 } 80 }); 81 }); 82 } 83 84 if ($('.js-tip', '.js-pdf-light-viewer-archive').length) { 85 $('.js-tip', '.js-pdf-light-viewer-archive').qtip({ 86 style: { classes: 'qtip-light pdf-light-viewer-tips ' + PdfLightViewer.settings.theme_class }, 87 position: { 88 my: 'bottom center' 89 } 90 }); 91 } 92 93 if ($('.js-pdf-light-viewer-popup-trigger').length) { 94 95 // thickbox dynamic modal size changes 96 $(window).on('resize', function() { 97 // set the displayWidth/Height to be 90% of the window 98 var displayWidth = $(window).width() * 0.9; 99 var displayHeight = $(window).height() * 0.9; 100 // Animate the thickbox window to the new size (with 50px padding 101 $("#TB_window").animate({ 102 marginLeft: 0 - (displayWidth + 50) / 2, 103 marginTop: 0 - (displayHeight + 50) / 2, 104 height: displayHeight + 50, 105 width: displayWidth + 30 106 }, { 107 duration: 200 108 }); 109 $("#TB_ajaxContent").animate({ 110 height: displayHeight, 111 width: displayWidth 112 }, { 113 duration: 200 114 }); 115 }); 116 117 $('.js-pdf-light-viewer-popup-trigger').each(function(i, el) { 118 $(el).on('click', function() { 119 setTimeout(function() { 120 PDFLightViewerApp.triggerRecalculateAllSizes(); 121 122 if ($(el).data('fullscreen')) { 123 $('.js-pdf-light-viewer-fullscreen:visible').trigger('click'); 124 } 125 }, 100); 126 }); 127 }); 128 } 129 130 }); 131})(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.