1/*! 2 * Print-O-Matic JavaScript v2.0.13 3 * https://pluginoven.com/plugins/print-o-matic/ 4*/ 5 6jQuery(document).ready(function() { 7 jQuery(document).on( 'click', '.printomatic, .printomatictext', function(e) { 8 e.preventDefault(); 9 var id = jQuery(this).attr('id'); 10 var this_print_data; 11 12 // TODO: must be a better way of assigning this dynamic print_data variable 13 if(eval('typeof print_data_' + id) !== "undefined"){ 14 this_print_data = eval('print_data_' + id ); 15 } 16 17 if(this_print_data && 'pom_do_not_print' in this_print_data && jQuery(this_print_data.pom_do_not_print).length){ 18 jQuery(this_print_data.pom_do_not_print).addClass('pe-no-print'); 19 } 20 else if (jQuery(print_data.pom_do_not_print).length){ 21 jQuery(print_data.pom_do_not_print).addClass('pe-no-print'); 22 } 23 24 //add any html top or bottom 25 var has_top_html = false; 26 if(this_print_data && 'pom_html_top' in this_print_data){ 27 jQuery( 'body' ).prepend( '<div id="pom_top_html" class="pe-preserve-ancestor">' + this_print_data.pom_html_top + '</div>' ); 28 has_top_html = true; 29 } 30 else if (print_data.pom_html_top){ 31 jQuery( 'body' ).prepend( '<div id="pom_top_html" class="pe-preserve-ancestor">' + print_data.pom_html_top + '</div>' ); 32 has_top_html = true; 33 } 34 35 var has_bot_html = false; 36 if(this_print_data && 'pom_html_bottom' in this_print_data){ 37 jQuery( 'body' ).append( '<div id="pom_bot_html" class="pe-preserve-ancestor">' + this_print_data.pom_html_bottom + '</div>' ); 38 has_bot_html = true; 39 } 40 else if (print_data.pom_html_bottom){ 41 jQuery( 'body' ).append( '<div id="pom_bot_html" class="pe-preserve-ancestor">' + print_data.pom_html_bottom + '</div>' ); 42 has_bot_html = true; 43 } 44 45 var trigger = jQuery(this); 46 var target = trigger.data('print_target'); 47 48 if(!target){ 49 classes = trigger.attr("class").split(/\s+/); 50 for(i=0; i<classes.length; i++){ 51 if(classes[i].substring(0, 12) == "printtarget-"){ 52 target = classes[i].substring(12, classes[i].length); 53 } 54 } 55 } 56 57 if(!target || !jQuery(target).length ){ 58 return; 59 } 60 61 var target_arr = target.split(", "); 62 var targets = []; 63 var targ; 64 jQuery.each( target_arr, function( key, value ) { 65 if (value == '%prev%') { 66 targ = trigger.prev(); 67 } 68 else if (value == '%next%') { 69 targ = trigger.next(); 70 } 71 else{ 72 targ = jQuery(value); 73 } 74 //only add target if found on page 75 if(targ.length){ 76 jQuery.each( targ, function( ) { 77 targets.push(this); 78 }); 79 } 80 }); 81 82 // remove loading attribute 83 jQuery('img').each( function () { 84 jQuery(this).removeAttr('loading'); 85 }); 86 87 var pause_time = print_data.pom_pause_time; 88 if(this_print_data && 'pom_pause_time' in this_print_data){ 89 pause_time = this_print_data.pom_pause_time; 90 } 91 92 if(targets){ 93 if(pause_time){ 94 console.log('pause_time hase been removed for now'); 95 } 96 PrintElements.print(targets, pause_time, has_top_html, has_bot_html); 97 } 98 99 }); 100}); 101 102function pom_cleanup(has_top_html, has_bot_html){ 103 if ( has_top_html ){ 104 jQuery( '#pom_top_html' ).remove(); 105 } 106 if ( has_bot_html ){ 107 jQuery( '#pom_bot_html' ).remove(); 108 } 109}
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.