Responsive Lightbox & Gallery - Version 1.3.6

Version Description

  • New: Added rl_lightbox_args filter hook for embeddding different scripts based on any custom conditions (page, post, category, user id, etc.)
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Responsive Lightbox & Gallery
Version 1.3.6
Comparing to
See all releases

Code changes from version 1.3.5 to 1.3.6

Files changed (3) hide show
  1. js/front.js +1 -0
  2. readme.txt +7 -3
  3. responsive-lightbox.php +32 -8
js/front.js CHANGED
@@ -15,6 +15,7 @@ jQuery(document).ready(function($) {
15
  opacity: rlArgs.opacity,
16
  show_title: (rlArgs.showTitle === '1' ? true : false),
17
  allow_resize: (rlArgs.allowResize === '1' ? true : false),
 
18
  default_width: parseInt(rlArgs.width),
19
  default_height: parseInt(rlArgs.height),
20
  counter_separator_label: rlArgs.separator,
15
  opacity: rlArgs.opacity,
16
  show_title: (rlArgs.showTitle === '1' ? true : false),
17
  allow_resize: (rlArgs.allowResize === '1' ? true : false),
18
+ allow_expand: (rlArgs.allowExpand === '1' ? true : false),
19
  default_width: parseInt(rlArgs.width),
20
  default_height: parseInt(rlArgs.height),
21
  counter_separator_label: rlArgs.separator,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.dfactory.eu/
4
  Tags: gallery, images, lightbox, links, photos, template, theme, photo, image, picture, slideshow, modal, overlay, YouTube, Vimeo, video, videos
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
- Stable tag: 1.3.5
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -26,6 +26,7 @@ For more information, check out plugin page at [dFactory](http://www.dfactory.eu
26
  * Enter a selector for lightbox
27
  * Highly customizable settings for each of the lightbox scripts
28
  * Multisite support
 
29
  * .pot file for translations included
30
 
31
  = Translations: =
@@ -58,6 +59,9 @@ No questions yet.
58
 
59
  == Changelog ==
60
 
 
 
 
61
  = 1.3.5 =
62
  * New: Dutch translation, thanks to [Sebas Blom](http://www.basbva.nl/)
63
 
@@ -131,5 +135,5 @@ Initial release
131
 
132
  == Upgrade Notice ==
133
 
134
- = 1.3.5 =
135
- * New: Dutch translation, thanks to [Sebas Blom](http://www.basbva.nl/)
4
  Tags: gallery, images, lightbox, links, photos, template, theme, photo, image, picture, slideshow, modal, overlay, YouTube, Vimeo, video, videos
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
+ Stable tag: 1.3.6
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
26
  * Enter a selector for lightbox
27
  * Highly customizable settings for each of the lightbox scripts
28
  * Multisite support
29
+ * Filter hook for embeddding different scripts based on any custom conditions (page, post, category, user id, etc.)
30
  * .pot file for translations included
31
 
32
  = Translations: =
59
 
60
  == Changelog ==
61
 
62
+ = 1.3.6 =
63
+ * New: Added rl_lightbox_args filter hook for embeddding different scripts based on any custom conditions (page, post, category, user id, etc.)
64
+
65
  = 1.3.5 =
66
  * New: Dutch translation, thanks to [Sebas Blom](http://www.basbva.nl/)
67
 
135
 
136
  == Upgrade Notice ==
137
 
138
+ = 1.3.6 =
139
+ * New: Added rl_lightbox_args filter hook for embeddding different scripts based on any custom conditions (page, post, category, user id, etc.)
responsive-lightbox.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Responsive Lightbox
4
  Description: Responsive Lightbox allows users to view larger versions of images and galleries in a lightbox (overlay) effect optimized for mobile devices.
5
- Version: 1.3.5
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
@@ -45,6 +45,7 @@ class Responsive_Lightbox
45
  'opacity' => 75,
46
  'show_title' => TRUE,
47
  'allow_resize' => TRUE,
 
48
  'width' => 1080,
49
  'height' => 720,
50
  'separator' => '/',
@@ -99,7 +100,7 @@ class Responsive_Lightbox
99
  'error_message' => 'The requested content cannot be loaded. Please try again later.'
100
  )
101
  ),
102
- 'version' => '1.3.5'
103
  );
104
  private $scripts = array();
105
  private $options = array();
@@ -475,6 +476,7 @@ class Responsive_Lightbox
475
  add_settings_field('rl_pp_opacity', __('Opacity', 'responsive-lightbox'), array(&$this, 'rl_pp_opacity'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
476
  add_settings_field('rl_pp_title', __('Show title', 'responsive-lightbox'), array(&$this, 'rl_pp_title'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
477
  add_settings_field('rl_pp_allow_resize', __('Allow resize big images', 'responsive-lightbox'), array(&$this, 'rl_pp_allow_resize'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
 
478
  add_settings_field('rl_pp_width', __('Video width', 'responsive-lightbox'), array(&$this, 'rl_pp_width'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
479
  add_settings_field('rl_pp_height', __('Video height', 'responsive-lightbox'), array(&$this, 'rl_pp_height'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
480
  add_settings_field('rl_pp_theme', __('Theme', 'responsive-lightbox'), array(&$this, 'rl_pp_theme'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
@@ -840,6 +842,24 @@ class Responsive_Lightbox
840
  }
841
 
842
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
843
  public function rl_pp_width()
844
  {
845
  echo '
@@ -1527,6 +1547,9 @@ class Responsive_Lightbox
1527
  //resize
1528
  $input['prettyphoto']['allow_resize'] = (isset($input['prettyphoto']['allow_resize']) && in_array($input['prettyphoto']['allow_resize'], array_keys($this->choices)) ? ($input['prettyphoto']['allow_resize'] === 'yes' ? TRUE : FALSE) : $this->defaults['configuration']['prettyphoto']['allow_resize']);
1529
 
 
 
 
1530
  //dimensions
1531
  $input['prettyphoto']['width'] = (int)($input['prettyphoto']['width'] > 0 ? $input['prettyphoto']['width'] : $this->defaults['configuration']['prettyphoto']['width']);
1532
  $input['prettyphoto']['height'] = (int)($input['prettyphoto']['height'] > 0 ? $input['prettyphoto']['height'] : $this->defaults['configuration']['prettyphoto']['height']);
@@ -1824,14 +1847,14 @@ class Responsive_Lightbox
1824
 
1825
  public function front_scripts_styles()
1826
  {
1827
- $args = array(
1828
  'script' => $this->options['settings']['script'],
1829
  'selector' => $this->options['settings']['selector'],
1830
  'custom_events' => ($this->options['settings']['enable_custom_events'] === TRUE ? ' '.$this->options['settings']['custom_events'] : ''),
1831
  'activeGalleries' => $this->getBooleanValue($this->options['settings']['galleries'])
1832
- );
1833
 
1834
- if($this->options['settings']['script'] === 'prettyphoto')
1835
  {
1836
  wp_register_script(
1837
  'responsive-lightbox-prettyphoto',
@@ -1858,6 +1881,7 @@ class Responsive_Lightbox
1858
  'opacity' => sprintf('%.2f', ($this->options['configuration']['prettyphoto']['opacity'] / 100)),
1859
  'showTitle' => $this->getBooleanValue($this->options['configuration']['prettyphoto']['show_title']),
1860
  'allowResize' => $this->getBooleanValue($this->options['configuration']['prettyphoto']['allow_resize']),
 
1861
  'width' => $this->options['configuration']['prettyphoto']['width'],
1862
  'height' => $this->options['configuration']['prettyphoto']['height'],
1863
  'separator' => $this->options['configuration']['prettyphoto']['separator'],
@@ -1874,7 +1898,7 @@ class Responsive_Lightbox
1874
  )
1875
  );
1876
  }
1877
- elseif($this->options['settings']['script'] === 'swipebox')
1878
  {
1879
  wp_register_script(
1880
  'responsive-lightbox-swipebox',
@@ -1909,7 +1933,7 @@ class Responsive_Lightbox
1909
  );
1910
  }
1911
  }
1912
- elseif($this->options['settings']['script'] === 'fancybox')
1913
  {
1914
  wp_register_script(
1915
  'responsive-lightbox-fancybox',
@@ -1957,7 +1981,7 @@ class Responsive_Lightbox
1957
  )
1958
  );
1959
  }
1960
- elseif($this->options['settings']['script'] === 'nivo')
1961
  {
1962
  wp_register_script(
1963
  'responsive-lightbox-nivo',
2
  /*
3
  Plugin Name: Responsive Lightbox
4
  Description: Responsive Lightbox allows users to view larger versions of images and galleries in a lightbox (overlay) effect optimized for mobile devices.
5
+ Version: 1.3.6
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
45
  'opacity' => 75,
46
  'show_title' => TRUE,
47
  'allow_resize' => TRUE,
48
+ 'allow_expand' => true,
49
  'width' => 1080,
50
  'height' => 720,
51
  'separator' => '/',
100
  'error_message' => 'The requested content cannot be loaded. Please try again later.'
101
  )
102
  ),
103
+ 'version' => '1.3.6'
104
  );
105
  private $scripts = array();
106
  private $options = array();
476
  add_settings_field('rl_pp_opacity', __('Opacity', 'responsive-lightbox'), array(&$this, 'rl_pp_opacity'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
477
  add_settings_field('rl_pp_title', __('Show title', 'responsive-lightbox'), array(&$this, 'rl_pp_title'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
478
  add_settings_field('rl_pp_allow_resize', __('Allow resize big images', 'responsive-lightbox'), array(&$this, 'rl_pp_allow_resize'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
479
+ add_settings_field('rl_pp_allow_expand', __('Allow expand', 'responsive-lightbox'), array(&$this, 'rl_pp_allow_expand'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
480
  add_settings_field('rl_pp_width', __('Video width', 'responsive-lightbox'), array(&$this, 'rl_pp_width'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
481
  add_settings_field('rl_pp_height', __('Video height', 'responsive-lightbox'), array(&$this, 'rl_pp_height'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
482
  add_settings_field('rl_pp_theme', __('Theme', 'responsive-lightbox'), array(&$this, 'rl_pp_theme'), 'responsive_lightbox_configuration', 'responsive_lightbox_configuration');
842
  }
843
 
844
 
845
+ public function rl_pp_allow_expand()
846
+ {
847
+ echo '
848
+ <div id="rl_pp_allow_expand" class="wplikebtns">';
849
+
850
+ foreach($this->choices as $val => $trans)
851
+ {
852
+ echo '
853
+ <input id="rl-pp-allow-expand-'.$val.'" type="radio" name="responsive_lightbox_configuration[prettyphoto][allow_expand]" value="'.esc_attr($val).'" '.checked(($val === 'yes' ? TRUE : FALSE), $this->options['configuration']['prettyphoto']['allow_expand'], FALSE).' />
854
+ <label for="rl-pp-allow-expand-'.$val.'">'.$trans.'</label>';
855
+ }
856
+
857
+ echo '
858
+ <p class="description">'.__('Expands something.', 'responsive-lightbox').'</p>
859
+ </div>';
860
+ }
861
+
862
+
863
  public function rl_pp_width()
864
  {
865
  echo '
1547
  //resize
1548
  $input['prettyphoto']['allow_resize'] = (isset($input['prettyphoto']['allow_resize']) && in_array($input['prettyphoto']['allow_resize'], array_keys($this->choices)) ? ($input['prettyphoto']['allow_resize'] === 'yes' ? TRUE : FALSE) : $this->defaults['configuration']['prettyphoto']['allow_resize']);
1549
 
1550
+ //expand
1551
+ $input['prettyphoto']['allow_expand'] = (isset($input['prettyphoto']['allow_expand']) && in_array($input['prettyphoto']['allow_expand'], array_keys($this->choices)) ? ($input['prettyphoto']['allow_expand'] === 'yes' ? TRUE : FALSE) : $this->defaults['configuration']['prettyphoto']['allow_expand']);
1552
+
1553
  //dimensions
1554
  $input['prettyphoto']['width'] = (int)($input['prettyphoto']['width'] > 0 ? $input['prettyphoto']['width'] : $this->defaults['configuration']['prettyphoto']['width']);
1555
  $input['prettyphoto']['height'] = (int)($input['prettyphoto']['height'] > 0 ? $input['prettyphoto']['height'] : $this->defaults['configuration']['prettyphoto']['height']);
1847
 
1848
  public function front_scripts_styles()
1849
  {
1850
+ $args = apply_filters('rl_lightbox_args', array(
1851
  'script' => $this->options['settings']['script'],
1852
  'selector' => $this->options['settings']['selector'],
1853
  'custom_events' => ($this->options['settings']['enable_custom_events'] === TRUE ? ' '.$this->options['settings']['custom_events'] : ''),
1854
  'activeGalleries' => $this->getBooleanValue($this->options['settings']['galleries'])
1855
+ ));
1856
 
1857
+ if($args['script'] === 'prettyphoto')
1858
  {
1859
  wp_register_script(
1860
  'responsive-lightbox-prettyphoto',
1881
  'opacity' => sprintf('%.2f', ($this->options['configuration']['prettyphoto']['opacity'] / 100)),
1882
  'showTitle' => $this->getBooleanValue($this->options['configuration']['prettyphoto']['show_title']),
1883
  'allowResize' => $this->getBooleanValue($this->options['configuration']['prettyphoto']['allow_resize']),
1884
+ 'allowExpand' => $this->getBooleanValue($this->options['configuration']['prettyphoto']['allow_expand']),
1885
  'width' => $this->options['configuration']['prettyphoto']['width'],
1886
  'height' => $this->options['configuration']['prettyphoto']['height'],
1887
  'separator' => $this->options['configuration']['prettyphoto']['separator'],
1898
  )
1899
  );
1900
  }
1901
+ elseif($args['script'] === 'swipebox')
1902
  {
1903
  wp_register_script(
1904
  'responsive-lightbox-swipebox',
1933
  );
1934
  }
1935
  }
1936
+ elseif($args['script'] === 'fancybox')
1937
  {
1938
  wp_register_script(
1939
  'responsive-lightbox-fancybox',
1981
  )
1982
  );
1983
  }
1984
+ elseif($args['script'] === 'nivo')
1985
  {
1986
  wp_register_script(
1987
  'responsive-lightbox-nivo',