Changeset 2869326
- Timestamp:
- 02/22/2023 11:21:29 AM (3 years ago)
- Location:
- print-o-matic/trunk
- Files:
-
- 5 edited
-
README.md (modified) (1 diff)
-
js/print_elements.js (modified) (1 diff)
-
js/printomat.js (modified) (6 diffs)
-
print-o-matic.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
print-o-matic/trunk/README.md
r2846064 r2869326 6 6 * Requires at least: 4.9 7 7 * Tested up to: 6.1.1 8 * Stable tag: 2.1. 98 * Stable tag: 2.1.10 9 9 * License: GPLv2 or later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html -
print-o-matic/trunk/js/print_elements.js
r2742530 r2869326 60 60 }; 61 61 62 var _print = function (elements, pause_time,has_top_html, has_bot_html) {62 var _print = function (elements, has_top_html, has_bot_html) { 63 63 for (var i = 0; i < elements.length; i++) { 64 64 _walkTree(elements[i], _attachPrintClasses); 65 65 } 66 setTimeout(function () { 67 window.print(); 68 }, 500); 66 67 window.addEventListener('afterprint', e => after_print_clean_up(elements, has_top_html, has_bot_html) ); 68 window.print(); 69 }; 69 70 70 setTimeout(function () { 71 for (i = 0; i < elements.length; i++) { 72 _walkTree(elements[i], _cleanup); 73 } 74 pom_cleanup(has_top_html, has_bot_html); 75 }, pause_time); 76 77 }; 71 function after_print_clean_up(elements, has_top_html, has_bot_html){ 72 //console.log('clean up on isle 5'); 73 for (var i = 0; i < elements.length; i++) { 74 _walkTree(elements[i], _cleanup); 75 } 76 pom_cleanup(has_top_html, has_bot_html); 77 } 78 78 79 79 return { -
print-o-matic/trunk/js/printomat.js
r2742530 r2869326 1 1 /*! 2 * Print-O-Matic JavaScript v2.0.1 12 * Print-O-Matic JavaScript v2.0.13 3 3 * https://pluginoven.com/plugins/print-o-matic/ 4 4 */ … … 10 10 var this_print_data; 11 11 12 // TODO: must be a better way of assigning this dynamic print_data variable 12 13 if(eval('typeof print_data_' + id) !== "undefined"){ 13 14 this_print_data = eval('print_data_' + id ); … … 44 45 var trigger = jQuery(this); 45 46 var target = trigger.data('print_target'); 46 47 47 48 if(!target){ 48 49 classes = trigger.attr("class").split(/\s+/); … … 77 78 }); 78 79 } 79 80 80 }); 81 81 … … 86 86 87 87 var pause_time = print_data.pom_pause_time; 88 if(!pause_time){89 pause_time = 2000;90 }91 88 if(this_print_data && 'pom_pause_time' in this_print_data){ 92 89 pause_time = this_print_data.pom_pause_time; … … 94 91 95 92 if(targets){ 93 if(pause_time){ 94 console.log('pause_time hase been removed for now'); 95 } 96 96 PrintElements.print(targets, pause_time, has_top_html, has_bot_html); 97 97 } -
print-o-matic/trunk/print-o-matic.php
r2846064 r2869326 5 5 Plugin URI: https://pluginoven.com/plugins/print-o-matic/ 6 6 Description: Shortcode that adds a printer icon, allowing the user to print the post or a specified HTML element in the post. 7 Version: 2.1. 97 Version: 2.1.10 8 8 Author: twinpictures 9 9 Author URI: https://twinpictures.de … … 18 18 class WP_Print_O_Matic { 19 19 20 var $version = '2.1. 9';20 var $version = '2.1.10'; 21 21 var $domain = 'printomat'; 22 22 var $options_name = 'WP_Print_O_Matic_options'; … … 68 68 wp_register_script('printomatic-js', plugins_url('js/printomat.js', __FILE__), array('jquery'), '2.0.11', true); 69 69 wp_register_script('pe-js', plugins_url('js/print_elements.js', __FILE__), array('printomatic-js'), '1.1', true); 70 70 71 71 //prep options for injection 72 72 $print_data = [ … … 76 76 'pom_pause_time' => $this->options['pause_time'], 77 77 ]; 78 wp_add_inline_script( 'printomatic-js', ' constprint_data = ' . json_encode( $print_data ), 'before' );78 wp_add_inline_script( 'printomatic-js', 'var print_data = ' . json_encode( $print_data ), 'before' ); 79 79 80 80 //css … … 199 199 $print_data['pom_pause_time'] = $pause_before_print; 200 200 } 201 wp_add_inline_script( 'printomatic-js', ' constprint_data_'.$id.' = ' . json_encode( $print_data ) );201 wp_add_inline_script( 'printomatic-js', 'var print_data_'.$id.' = ' . json_encode( $print_data ) ); 202 202 203 203 //return nothing if usign an external button -
print-o-matic/trunk/readme.txt
r2846064 r2869326 5 5 Requires at least: 4.9 6 6 Tested up to: 6.1.1 7 Stable tag: 2.1. 97 Stable tag: 2.1.10 8 8 Requires PHP: 7.2 9 9 License: GPLv2 or later … … 50 50 51 51 == Changelog == 52 53 = 2.1.10 = 54 * removed pause before print 55 * fixed issue of not printing correctly in safari 52 56 53 57 = 2.1.9 =
Note: See TracChangeset
for help on using the changeset viewer.