Skip to content

Commit

Permalink
release 2.1.4
Browse files Browse the repository at this point in the history
moved pause before print to print-elements script to prevent issue with having to click print twice
  • Loading branch information
baden03 committed May 23, 2022
1 parent 001840c commit cb56fe0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Print-O-Matic
* 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: 5.9.2
* Stable tag: 2.1.5a
* Tested up to: 5.9.3
* Stable tag: 2.1.5
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down
13 changes: 8 additions & 5 deletions js/print_elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ var PrintElements = (function () {
}
};

var _print = function (elements) {
var _print = function (elements, pause_time) {
for (var i = 0; i < elements.length; i++) {
_walkTree(elements[i], _attachPrintClasses);
}
window.print();
for (i = 0; i < elements.length; i++) {
_walkTree(elements[i], _cleanup);
}
setTimeout(function () {
window.print();
for (i = 0; i < elements.length; i++) {
_walkTree(elements[i], _cleanup);
}
}, pause_time);

};

return {
Expand Down
9 changes: 5 additions & 4 deletions js/printomat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Print-O-Matic JavaScript v2.0.7
* Print-O-Matic JavaScript v2.0.8
* https://pluginoven.com/plugins/print-o-matic/
*/

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

setTimeout(function () {
//setTimeout(function () {
if(targets){
PrintElements.print(targets);
PrintElements.print(targets, pause_time);
}

if ( has_top_html ){
Expand All @@ -99,7 +99,8 @@ jQuery(document).ready(function() {
if ( has_bot_html ){
jQuery( '#pom_bot_html' ).remove();
}
}, pause_time);
//}, pause_time);


});
});
8 changes: 4 additions & 4 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.5a
Version: 2.1.4
Author: twinpictures
Author URI: https://twinpictures.de
License: GPL2
Expand All @@ -17,7 +17,7 @@
*/
class WP_Print_O_Matic {

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

//prep options for injection
$print_data = [
Expand Down
6 changes: 4 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: twinpictures, baden03
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: 5.9.2
Stable tag: 2.1.5a
Tested up to: 5.9.3
Stable tag: 2.1.4
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -52,6 +52,7 @@ We like to rock the party.

= 2.1.5 =
* reverted back to wp_localize_script to pass print data to js script
* moved pause before print to the print-elements script

= 2.1.4 =
* try and force lazy load images to load before print
Expand Down Expand Up @@ -240,3 +241,4 @@ We like to rock the party.

== Upgrade Notice ==
* reverted back to wp_localize_script to pass print data to js script
* moved pause before print to the print-elements script

0 comments on commit cb56fe0

Please sign in to comment.