WP jQuery Lightbox - Version 1.4.8.3

Version Description

(2021-01-26)

Download this release

Release Info

Developer ulfben
Plugin Icon wp plugin WP jQuery Lightbox
Version 1.4.8.3
Comparing to
See all releases

Code changes from version 1.4.8.2 to 1.4.8.3

Files changed (2) hide show
  1. readme.txt +8 -2
  2. wp-jquery-lightbox.php +16 -6
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ulfben
3
  Donate link: https://www.amazon.com/gp/registry/wishlist/2QB6SQ5XX2U0N/105-3209188-5640446?reveal=unpurchased&filter=all&sort=priority&layout=standard&x=11&y=10
4
  Tags: lightbox, jquery, nodal, image, display, ulfben
5
  Requires at least: 5.0
6
- Tested up to: 5.6
7
- Stable tag: 1.4.8.2
8
  Requires PHP: 5.2
9
  License: GPLv2 or later
10
 
@@ -28,6 +28,9 @@ You can browse images with your keyboard: Arrows, P(revious)/N(ext) and X/C/ESC
28
 
29
  *[//Ulf Benjaminsson](http://www.ulfbenjaminsson.com)*
30
 
 
 
 
31
  = 1.4.8.2 (2021-01-26) =
32
  * Migrated lightbox to modern jQuery (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
33
  * Improved support of Gutenberg editor's image captions (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
@@ -161,6 +164,9 @@ Lastly:
161
  Still have problems? Post a link and describe what issue you're having, and tell us what of these steps you've already tried.
162
 
163
  == Changelog ==
 
 
 
164
  = 1.4.8.2 (2021-01-26) =
165
  * Migrated lightbox to modern jQuery (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
166
  * Improved support of Gutenberg editor's image captions (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
3
  Donate link: https://www.amazon.com/gp/registry/wishlist/2QB6SQ5XX2U0N/105-3209188-5640446?reveal=unpurchased&filter=all&sort=priority&layout=standard&x=11&y=10
4
  Tags: lightbox, jquery, nodal, image, display, ulfben
5
  Requires at least: 5.0
6
+ Tested up to: 6.0.1
7
+ Stable tag: 1.4.8.3
8
  Requires PHP: 5.2
9
  License: GPLv2 or later
10
 
28
 
29
  *[//Ulf Benjaminsson](http://www.ulfbenjaminsson.com)*
30
 
31
+ = 1.4.8.3 (2021-01-26) =
32
+ * Added setting to control whether jQuery is loaded in the header or footer.
33
+
34
  = 1.4.8.2 (2021-01-26) =
35
  * Migrated lightbox to modern jQuery (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
36
  * Improved support of Gutenberg editor's image captions (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
164
  Still have problems? Post a link and describe what issue you're having, and tell us what of these steps you've already tried.
165
 
166
  == Changelog ==
167
+ = 1.4.8.3 (2021-01-26) =
168
+ * Added setting to control whether jQuery is loaded in the header or footer.
169
+
170
  = 1.4.8.2 (2021-01-26) =
171
  * Migrated lightbox to modern jQuery (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
172
  * Improved support of Gutenberg editor's image captions (Thanks: [Joseph Rézeau aka papijo](https://www.rezeau.org/)!)
wp-jquery-lightbox.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wp-jquery-lightbox
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/
5
  Description: A drop in replacement for LightBox-2 and similar plugins. Uses jQuery to save you from the JS-library mess in your header. :)
6
- Version: 1.4.8.2
7
  Text Domain: wp-jquery-lightbox
8
  Author: Ulf Benjaminsson
9
  Author URI: http://www.ulfbenjaminsson.com
@@ -68,6 +68,7 @@ function jqlb_register_settings(){
68
  register_setting( 'jqlb-settings-group', 'jqlb_resize_speed', 'jqlb_pos_intval');
69
  register_setting( 'jqlb-settings-group', 'jqlb_slideshow_speed', 'jqlb_pos_intval');
70
  register_setting( 'jqlb-settings-group', 'jqlb_use_theme_styles', 'jqlb_bool_intval');
 
71
  add_option('jqlb_showTitle', 1);
72
  add_option('jqlb_showCaption', 1);
73
  add_option('jqlb_showNumbers', 1);
@@ -80,6 +81,7 @@ function jqlb_register_settings(){
80
  add_option('jqlb_resize_speed', 400);
81
  add_option('jqlb_slideshow_speed', 4000);
82
  add_option('jqlb_use_theme_styles', 0);
 
83
  }
84
  function jqlb_register_menu_item() {
85
  add_options_page('jQuery Lightbox Options', 'jQuery Lightbox', 'manage_options', 'jquery-lightbox-options', 'jqlb_options_panel');
@@ -114,14 +116,15 @@ function jqlb_css(){
114
  }
115
  }
116
  $uri = ( $haveThemeCss ) ? get_stylesheet_directory_uri().'/'.$fileName : plugin_dir_url(__FILE__).'styles/'.$fileName;
117
- wp_enqueue_style('jquery.lightbox.min.css', $uri, false, '1.4.8');
118
  }
119
 
120
  function jqlb_js() {
121
  if(is_admin() || is_feed()){return;}
122
- wp_enqueue_script('jquery', '', array(), false, true);
123
- wp_enqueue_script('wp-jquery-lightbox-swipe', plugins_url(JQLB_TOUCH_SCRIPT, __FILE__), Array('jquery'), '1.4.8', true);
124
- wp_enqueue_script('wp-jquery-lightbox', plugins_url(JQLB_SCRIPT, __FILE__), Array('jquery'), '1.4.8', true);
 
125
  wp_localize_script('wp-jquery-lightbox', 'JQLBSettings', array(
126
  'showTitle' => get_option('jqlb_showTitle'),
127
  'showCaption' => get_option('jqlb_showCaption'),
@@ -311,7 +314,14 @@ function jqlb_options_panel(){
311
  <input type="checkbox" id="jqlb_use_theme_styles" name="jqlb_use_theme_styles" value="1" <?php echo $check; ?> />
312
  <label for="jqlb_use_theme_styles" title="You must put lightbox.min.css or lightbox.min.[locale].css in your theme's style-folder. This is good to keep your CSS edits when updating the plugin."><?php _e('Use custom stylesheet', 'wp-jquery-lightbox'); ?></label>
313
  </td>
314
- </tr>
 
 
 
 
 
 
 
315
  <tr valign="baseline" colspan="2">
316
  <td colspan="2">
317
  <input type="text" id="jqlb_resize_speed" name="jqlb_resize_speed" value="<?php echo intval(get_option('jqlb_resize_speed')) ?>" size="3" />
3
  Plugin Name: wp-jquery-lightbox
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/
5
  Description: A drop in replacement for LightBox-2 and similar plugins. Uses jQuery to save you from the JS-library mess in your header. :)
6
+ Version: 1.4.8.3
7
  Text Domain: wp-jquery-lightbox
8
  Author: Ulf Benjaminsson
9
  Author URI: http://www.ulfbenjaminsson.com
68
  register_setting( 'jqlb-settings-group', 'jqlb_resize_speed', 'jqlb_pos_intval');
69
  register_setting( 'jqlb-settings-group', 'jqlb_slideshow_speed', 'jqlb_pos_intval');
70
  register_setting( 'jqlb-settings-group', 'jqlb_use_theme_styles', 'jqlb_bool_intval');
71
+ register_setting( 'jqlb-settings-group', 'jqlb_enqueue_in_footer', 'jqlb_bool_intval');
72
  add_option('jqlb_showTitle', 1);
73
  add_option('jqlb_showCaption', 1);
74
  add_option('jqlb_showNumbers', 1);
81
  add_option('jqlb_resize_speed', 400);
82
  add_option('jqlb_slideshow_speed', 4000);
83
  add_option('jqlb_use_theme_styles', 0);
84
+ add_option('jqlb_enqueue_in_footer', 1);
85
  }
86
  function jqlb_register_menu_item() {
87
  add_options_page('jQuery Lightbox Options', 'jQuery Lightbox', 'manage_options', 'jquery-lightbox-options', 'jqlb_options_panel');
116
  }
117
  }
118
  $uri = ( $haveThemeCss ) ? get_stylesheet_directory_uri().'/'.$fileName : plugin_dir_url(__FILE__).'styles/'.$fileName;
119
+ wp_enqueue_style('jquery.lightbox.min.css', $uri, false, '1.4.8.2');
120
  }
121
 
122
  function jqlb_js() {
123
  if(is_admin() || is_feed()){return;}
124
+ $enqueInFooter = get_option('jqlb_enqueue_in_footer') ? true : false;
125
+ wp_enqueue_script('jquery', '', array(), false, $enqueInFooter);
126
+ wp_enqueue_script('wp-jquery-lightbox-swipe', plugins_url(JQLB_TOUCH_SCRIPT, __FILE__), Array('jquery'), '1.4.8.2', $enqueInFooter);
127
+ wp_enqueue_script('wp-jquery-lightbox', plugins_url(JQLB_SCRIPT, __FILE__), Array('jquery'), '1.4.8.2', $enqueInFooter);
128
  wp_localize_script('wp-jquery-lightbox', 'JQLBSettings', array(
129
  'showTitle' => get_option('jqlb_showTitle'),
130
  'showCaption' => get_option('jqlb_showCaption'),
314
  <input type="checkbox" id="jqlb_use_theme_styles" name="jqlb_use_theme_styles" value="1" <?php echo $check; ?> />
315
  <label for="jqlb_use_theme_styles" title="You must put lightbox.min.css or lightbox.min.[locale].css in your theme's style-folder. This is good to keep your CSS edits when updating the plugin."><?php _e('Use custom stylesheet', 'wp-jquery-lightbox'); ?></label>
316
  </td>
317
+ </tr>
318
+ <tr valign="baseline" colspan="2">
319
+ <td>
320
+ <?php $check = get_option('jqlb_enqueue_in_footer') ? ' checked="yes" ' : ''; ?>
321
+ <input type="checkbox" id="jqlb_enqueue_in_footer" name="jqlb_enqueue_in_footer" value="1" <?php echo $check; ?> />
322
+ <label for="jqlb_enqueue_in_footer" title="<?php _e('Uncheck this box to load jQuery and lightbox in the header of your page.', 'wp-jquery-lightbox'); ?>"><?php _e('Load JavaScripts in page footer', 'wp-jquery-lightbox'); ?></label>
323
+ </td>
324
+ </tr>
325
  <tr valign="baseline" colspan="2">
326
  <td colspan="2">
327
  <input type="text" id="jqlb_resize_speed" name="jqlb_resize_speed" value="<?php echo intval(get_option('jqlb_resize_speed')) ?>" size="3" />