Skip to content

Commit

Permalink
2.1.6 - pause before print now adjust time to wait while browser rend…
Browse files Browse the repository at this point in the history
…er the print layout
  • Loading branch information
baden03 committed May 29, 2022
1 parent ca7a7d4 commit 62e1017
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Print-O-Matic
* Tags: print, print element, print shortcode, send to print, print button, print me, jQuery, print page, javascript, twinpictures, plugin oven
* Requires at least: 4.9
* Tested up to: 6.0
* Stable tag: 2.1.5
* Stable tag: 2.1.6
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down
6 changes: 5 additions & 1 deletion js/printomat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Print-O-Matic JavaScript v2.0.9
* Print-O-Matic JavaScript v2.0.10
* https://pluginoven.com/plugins/print-o-matic/
*/

Expand Down Expand Up @@ -88,6 +88,10 @@ jQuery(document).ready(function() {
pause_time = this_print_data.pom_pause_time;
}

//pause_time is now pause to allow the browser to render the print preview before resetting back to display
//force at least 2 seconds
pause_time = pause_time + 2000;

if(targets){
PrintElements.print(targets, pause_time);
}
Expand Down
6 changes: 3 additions & 3 deletions print-o-matic.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Text Domain: print-o-matic
Plugin URI: https://pluginoven.com/plugins/print-o-matic/
Description: Shortcode that adds a printer icon, allowing the user to print the post or a specified HTML element in the post.
Version: 2.1.5
Version: 2.1.6
Author: twinpictures
Author URI: https://twinpictures.de
License: GPL2
Expand All @@ -17,7 +17,7 @@
*/
class WP_Print_O_Matic {

var $version = '2.1.5';
var $version = '2.1.6';
var $domain = 'printomat';
var $options_name = 'WP_Print_O_Matic_options';
var $options = array(
Expand Down Expand Up @@ -65,7 +65,7 @@ function load_textdomain() {
*/
function printMaticInit() {
//script
wp_register_script('printomatic-js', plugins_url('js/printomat.js', __FILE__), array('jquery'), '2.0.8', true);
wp_register_script('printomatic-js', plugins_url('js/printomat.js', __FILE__), array('jquery'), '2.0.10', true);
wp_register_script('pe-js', plugins_url('js/print_elements.js', __FILE__), array('printomatic-js'), '1.1', true);

//prep options for injection
Expand Down
10 changes: 6 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://pluginoven.com/panares-fund/
Tags: print, print element, print shortcode, send to print, print button, print me, jQuery, print page, javascript, twinpictures, plugin oven
Requires at least: 4.9
Tested up to: 6.0
Stable tag: 2.1.5
Stable tag: 2.1.6
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -50,6 +50,9 @@ We like to rock the party.

== Changelog ==

= 2.1.6 =
* pause before print is now pause time to allow the browser to render the print-preview before resetting back to display layout

= 2.1.5 =
* reverted back to wp_localize_script to pass print data to js script
* moved pause before print to the post print cleanup
Expand Down Expand Up @@ -241,6 +244,5 @@ We like to rock the party.
* The plug-in was forked and completely rewritten from Print Button Shortcode by MyWebsiteAdvisor.

== Upgrade Notice ==
* reverted back to wp_localize_script to pass print data to js script
* moved pause before print to the post print cleanup
* fully tested with version 6.0
* pause before print is now pause time to allow the browser to render the print-preview before resetting back to display layout

0 comments on commit 62e1017

Please sign in to comment.