Responsive Lightbox & Gallery - Version 1.6.1

Version Description

  • Fix: prettyPhoto and Nivo gallery navigation broken
  • Tweak: Added another way to close the extensions notification
Download this release

Release Info

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

Code changes from version 1.6.0 to 1.6.1

assets/prettyphoto/js/jquery.prettyPhoto.js CHANGED
@@ -86,11 +86,11 @@
86
  </div>',
87
  image_markup: '<img id="fullResImage" src="{path}" />',
88
  flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
89
- quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
90
  iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
91
  inline_markup: '<div class="pp_inline">{content}</div>',
92
  custom_markup: '',
93
- social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' /* html or false to disable */
94
  }, pp_settings);
95
 
96
  // Global variables accessible only by prettyPhoto
@@ -146,7 +146,7 @@
146
 
147
  // Find out if the picture is part of a set
148
  theRel = $(this).attr(settings.hook);
149
- galleryRegExp = /\[(?:.*)\]/;
150
  isSet = (galleryRegExp.exec(theRel)) ? true : false;
151
 
152
  // Put the SRCs, TITLEs, ALTs into an array.
@@ -279,7 +279,7 @@
279
  movie_id = movie_id.substr(0,movie_id.indexOf('&')); // Strip anything after the &
280
  }
281
 
282
- movie = 'http://www.youtube.com/embed/'+movie_id;
283
  (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]) : movie+="?rel=1";
284
 
285
  if(settings.autoplay) movie += "&autoplay=1";
@@ -294,7 +294,7 @@
294
  var regExp = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;
295
  var match = movie_id.match(regExp);
296
 
297
- movie = 'http://player.vimeo.com/video/'+ match[3] +'?title=0&amp;byline=0&amp;portrait=0';
298
  if(settings.autoplay) movie += "&autoplay=1;";
299
 
300
  vimeo_width = pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width'];
86
  </div>',
87
  image_markup: '<img id="fullResImage" src="{path}" />',
88
  flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
89
+ quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="//www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="//www.apple.com/quicktime/download/"></embed></object>',
90
  iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
91
  inline_markup: '<div class="pp_inline">{content}</div>',
92
  custom_markup: '',
93
+ social_tools: '<div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' /* html or false to disable */
94
  }, pp_settings);
95
 
96
  // Global variables accessible only by prettyPhoto
146
 
147
  // Find out if the picture is part of a set
148
  theRel = $(this).attr(settings.hook);
149
+ galleryRegExp = /\-(?:.*)/;
150
  isSet = (galleryRegExp.exec(theRel)) ? true : false;
151
 
152
  // Put the SRCs, TITLEs, ALTs into an array.
279
  movie_id = movie_id.substr(0,movie_id.indexOf('&')); // Strip anything after the &
280
  }
281
 
282
+ movie = '//www.youtube.com/embed/'+movie_id;
283
  (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]) : movie+="?rel=1";
284
 
285
  if(settings.autoplay) movie += "&autoplay=1";
294
  var regExp = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;
295
  var match = movie_id.match(regExp);
296
 
297
+ movie = '//player.vimeo.com/video/'+ match[3] +'?title=0&amp;byline=0&amp;portrait=0';
298
  if(settings.autoplay) movie += "&autoplay=1;";
299
 
300
  vimeo_width = pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width'];
assets/tosrus/js/jquery.tosrus.min.all.js CHANGED
@@ -82,7 +82,7 @@
82
  * Copyright (c) Fred Heusschen
83
  * www.frebsite.nl
84
  */
85
- !function(i){function t(t){function l(){f.length&&(f.attr("src",""),f.attr("src",h))}c||(a=i[s]._c,e=i[s]._d,o=i[s]._e,r=i[s]._f,n=i[s]._g,e.add("ratio maxWidth maxHeight"),c=!0);var f=t.children(),m=t.data(i[s]._d.anchor)||i(),h=f.attr("src"),u=m.data(e.ratio)||this.opts[d].ratio,g=m.data(e.maxWidth)||this.opts[d].maxWidth,p=m.data(e.maxHeight)||this.opts[d].maxHeight;t.removeClass(a.loading).trigger(o.loaded).on(o.loading,function(){r.resizeRatio(f,t,g,p,u)}),this.nodes.$wrpr.on(o.sliding,function(){l()}).on(o.closing,function(){l()}),n.$wndw.on(o.resize,function(){r.resizeRatio(f,t,g,p,u)})}var a,e,o,r,n,s="tosrus",d="vimeo",c=!1;i[s].media[d]={filterAnchors:function(i){return i.attr("href").toLowerCase().indexOf("vimeo.com/")>-1},initAnchors:function(a,e){var o=this._uniqueID();e=e.split("vimeo.com/")[1].split("?")[0]+"?api=1&player_id="+o,i('<iframe id="'+o+'" src="http://player.vimeo.com/video/'+e+'" frameborder="0" allowfullscreen />').appendTo(a),t.call(this,a)},filterSlides:function(i){return i.is("iframe")&&i.attr("src")?i.attr("src").toLowerCase().indexOf("vimeo.com/video/")>-1:!1},initSlides:function(i){t.call(this,i)}},i[s].defaults.media[d]={},i[s].defaults[d]={ratio:16/9,maxWidth:!1,maxHeight:!1}}(jQuery);
86
  /*
87
  * jQuery Touch Optimized Sliders "R"Us
88
  * Youtube media
@@ -90,4 +90,4 @@
90
  * Copyright (c) Fred Heusschen
91
  * www.frebsite.nl
92
  */
93
- !function(t){function e(e){function u(t){l.length&&l[0].contentWindow.postMessage('{ "event": "command", "func": "'+t+'Video" }',"*")}c||(i=t[s]._c,o=t[s]._d,a=t[s]._e,n=t[s]._f,r=t[s]._g,o.add("ratio maxWidth maxHeight"),c=!0);var l=e.children(),m=e.data(t[s]._d.anchor)||t(),f=m.data(o.ratio)||this.opts[d].ratio,h=m.data(o.maxWidth)||this.opts[d].maxWidth,p=m.data(o.maxHeight)||this.opts[d].maxHeight;e.removeClass(i.loading).trigger(a.loaded).on(a.loading,function(){n.resizeRatio(l,e,h,p,f)}),this.nodes.$wrpr.on(a.sliding,function(){u("pause")}).on(a.closing,function(){u("stop")}),r.$wndw.on(a.resize,function(){n.resizeRatio(l,e,h,p,f)})}var i,o,a,n,r,s="tosrus",d="youtube",c=!1;t[s].media[d]={filterAnchors:function(t){return t.attr("href").toLowerCase().indexOf("youtube.com/watch?v=")>-1},initAnchors:function(i,o){var a=o;o=o.split("?v=")[1].split("&")[0],this.opts[d].imageLink?(o="http://img.youtube.com/vi/"+o+"/0.jpg",t('<a href="'+a+'" class="'+t[s]._c("play")+'" target="_blank" />').appendTo(i),t('<img border="0" />').on(t[s]._e.load,function(e){e.stopPropagation(),i.removeClass(t[s]._c.loading).trigger(t[s]._e.loaded)}).appendTo(i).attr("src",o)):(t('<iframe src="http://www.youtube.com/embed/'+o+'?enablejsapi=1" frameborder="0" allowfullscreen />').appendTo(i),e.call(this,i))},filterSlides:function(t){return t.is("iframe")&&t.attr("src")?t.attr("src").toLowerCase().indexOf("youtube.com/embed/")>-1:!1},initSlides:function(t){e.call(this,t)}},t[s].defaults.media[d]={},t[s].defaults[d]={ratio:16/9,maxWidth:!1,maxHeight:!1,imageLink:t[s].support.touch}}(jQuery);
82
  * Copyright (c) Fred Heusschen
83
  * www.frebsite.nl
84
  */
85
+ !function(i){function t(t){function l(){f.length&&(f.attr("src",""),f.attr("src",h))}c||(a=i[s]._c,e=i[s]._d,o=i[s]._e,r=i[s]._f,n=i[s]._g,e.add("ratio maxWidth maxHeight"),c=!0);var f=t.children(),m=t.data(i[s]._d.anchor)||i(),h=f.attr("src"),u=m.data(e.ratio)||this.opts[d].ratio,g=m.data(e.maxWidth)||this.opts[d].maxWidth,p=m.data(e.maxHeight)||this.opts[d].maxHeight;t.removeClass(a.loading).trigger(o.loaded).on(o.loading,function(){r.resizeRatio(f,t,g,p,u)}),this.nodes.$wrpr.on(o.sliding,function(){l()}).on(o.closing,function(){l()}),n.$wndw.on(o.resize,function(){r.resizeRatio(f,t,g,p,u)})}var a,e,o,r,n,s="tosrus",d="vimeo",c=!1;i[s].media[d]={filterAnchors:function(i){return i.attr("href").toLowerCase().indexOf("vimeo.com/")>-1},initAnchors:function(a,e){var o=this._uniqueID();e=e.split("vimeo.com/")[1].split("?")[0]+"?api=1&player_id="+o,i('<iframe id="'+o+'" src="//player.vimeo.com/video/'+e+'" frameborder="0" allowfullscreen />').appendTo(a),t.call(this,a)},filterSlides:function(i){return i.is("iframe")&&i.attr("src")?i.attr("src").toLowerCase().indexOf("vimeo.com/video/")>-1:!1},initSlides:function(i){t.call(this,i)}},i[s].defaults.media[d]={},i[s].defaults[d]={ratio:16/9,maxWidth:!1,maxHeight:!1}}(jQuery);
86
  /*
87
  * jQuery Touch Optimized Sliders "R"Us
88
  * Youtube media
90
  * Copyright (c) Fred Heusschen
91
  * www.frebsite.nl
92
  */
93
+ !function(t){function e(e){function u(t){l.length&&l[0].contentWindow.postMessage('{ "event": "command", "func": "'+t+'Video" }',"*")}c||(i=t[s]._c,o=t[s]._d,a=t[s]._e,n=t[s]._f,r=t[s]._g,o.add("ratio maxWidth maxHeight"),c=!0);var l=e.children(),m=e.data(t[s]._d.anchor)||t(),f=m.data(o.ratio)||this.opts[d].ratio,h=m.data(o.maxWidth)||this.opts[d].maxWidth,p=m.data(o.maxHeight)||this.opts[d].maxHeight;e.removeClass(i.loading).trigger(a.loaded).on(a.loading,function(){n.resizeRatio(l,e,h,p,f)}),this.nodes.$wrpr.on(a.sliding,function(){u("pause")}).on(a.closing,function(){u("stop")}),r.$wndw.on(a.resize,function(){n.resizeRatio(l,e,h,p,f)})}var i,o,a,n,r,s="tosrus",d="youtube",c=!1;t[s].media[d]={filterAnchors:function(t){return t.attr("href").toLowerCase().indexOf("youtube.com/watch?v=")>-1},initAnchors:function(i,o){var a=o;o=o.split("?v=")[1].split("&")[0],this.opts[d].imageLink?(o="//img.youtube.com/vi/"+o+"/0.jpg",t('<a href="'+a+'" class="'+t[s]._c("play")+'" target="_blank" />').appendTo(i),t('<img border="0" />').on(t[s]._e.load,function(e){e.stopPropagation(),i.removeClass(t[s]._c.loading).trigger(t[s]._e.loaded)}).appendTo(i).attr("src",o)):(t('<iframe src="//www.youtube.com/embed/'+o+'?enablejsapi=1" frameborder="0" allowfullscreen />').appendTo(i),e.call(this,i))},filterSlides:function(t){return t.is("iframe")&&t.attr("src")?t.attr("src").toLowerCase().indexOf("youtube.com/embed/")>-1:!1},initSlides:function(t){e.call(this,t)}},t[s].defaults.media[d]={},t[s].defaults[d]={ratio:16/9,maxWidth:!1,maxHeight:!1,imageLink:t[s].support.touch}}(jQuery);
includes/class-settings.php CHANGED
@@ -157,7 +157,7 @@ class Responsive_Lightbox_Settings {
157
  'section' => 'responsive_lightbox_settings',
158
  'type' => 'radio',
159
  'label' => '',
160
- 'description' => sprintf(__( 'Select your preffered ligthbox effect script or get our <a href="%s">premium extensions</a>.', 'responsive-lightbox' ), esc_url( add_query_arg( array( 'rl_action' => 'hide_notice' ), admin_url( 'options-general.php?page=responsive-lightbox&tab=addons' ) ) ) ),
161
  'options' => $scripts,
162
  // 'options_cb' => '',
163
  // 'id' => '',
157
  'section' => 'responsive_lightbox_settings',
158
  'type' => 'radio',
159
  'label' => '',
160
+ 'description' => sprintf(__( 'Select your preffered ligthbox effect script or get our <a href="%s">premium extensions</a>.', 'responsive-lightbox' ), wp_nonce_url( add_query_arg( array( 'action' => 'rl-hide-notice' ), admin_url( 'options-general.php?page=responsive-lightbox&tab=addons' ) ), 'rl_action', 'rl_nonce' ) ),
161
  'options' => $scripts,
162
  // 'options_cb' => '',
163
  // 'id' => '',
js/front.js CHANGED
@@ -121,7 +121,7 @@
121
  // for some browsers, `attr` is undefined; for others,
122
  // `attr` is false. Check for both.
123
  if ( typeof attr !== typeof undefined && attr !== false ) {
124
- var match = attr.match( new RegExp( rlArgs.selector + '\\[(gallery\\-(?:[\\da-z]{1,4}))\\]', 'ig' ) );
125
 
126
  if ( match !== null ) {
127
  $( this ).attr( 'data-lightbox-gallery', match[0] );
@@ -205,7 +205,7 @@
205
  infinite : ( rlArgs.infinite === '1' ? true : false ),
206
  autoplay : {
207
  play : ( rlArgs.autoplay === '1' ? true : false ),
208
- pauseOnHover : ( rlArgs.pause_on_hover === '1' ? true : false ),
209
  timeout : rlArgs.timeout
210
  },
211
  effect : rlArgs.effect,
121
  // for some browsers, `attr` is undefined; for others,
122
  // `attr` is false. Check for both.
123
  if ( typeof attr !== typeof undefined && attr !== false ) {
124
+ var match = attr.match( new RegExp( rlArgs.selector + '\\-(gallery\\-(?:[\\da-z]{1,4}))', 'ig' ) );
125
 
126
  if ( match !== null ) {
127
  $( this ).attr( 'data-lightbox-gallery', match[0] );
205
  infinite : ( rlArgs.infinite === '1' ? true : false ),
206
  autoplay : {
207
  play : ( rlArgs.autoplay === '1' ? true : false ),
208
+ pauseOnHover : ( rlArgs.pauseOnHover === '1' ? true : false ),
209
  timeout : rlArgs.timeout
210
  },
211
  effect : rlArgs.effect,
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: 4.0
6
  Tested up to: 4.3
7
- Stable tag: 1.6.0
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -74,6 +74,10 @@ No questions yet.
74
 
75
  == Changelog ==
76
 
 
 
 
 
77
  = 1.6.0 =
78
  * New: Introducing [Justified Gallery](https://www.dfactory.eu/products/justified-gallery/) and [Lightcase Lightbox](https://www.dfactory.eu/products/lightcase-lightbox/) premium extensions.
79
  * New: Option to set single images title from image title, caption, alt or description
@@ -250,6 +254,6 @@ Initial release
250
 
251
  == Upgrade Notice ==
252
 
253
- = 1.6.0 =
254
- * New: Introducing [Justified Gallery](https://www.dfactory.eu/products/justified-gallery/) and [Lightcase Lightbox](https://www.dfactory.eu/products/lightcase-lightbox/) premium extensions.
255
- * New: Option to single images title from image title, caption, alt or description
4
  Tags: gallery, images, lightbox, links, photos, template, theme, photo, image, picture, slideshow, modal, overlay, YouTube, Vimeo, video, videos
5
  Requires at least: 4.0
6
  Tested up to: 4.3
7
+ Stable tag: 1.6.1
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.6.1 =
78
+ * Fix: prettyPhoto and Nivo gallery navigation broken
79
+ * Tweak: Added another way to close the extensions notification
80
+
81
  = 1.6.0 =
82
  * New: Introducing [Justified Gallery](https://www.dfactory.eu/products/justified-gallery/) and [Lightcase Lightbox](https://www.dfactory.eu/products/lightcase-lightbox/) premium extensions.
83
  * New: Option to set single images title from image title, caption, alt or description
254
 
255
  == Upgrade Notice ==
256
 
257
+ = 1.6.1 =
258
+ * Fix: prettyPhoto and Nivo gallery navigation broken
259
+ * Tweak: Added another way to close the extensions notification
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.6.0
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
@@ -36,7 +36,7 @@ include_once( RESPONSIVE_LIGHTBOX_PATH . 'includes/class-settings.php' );
36
  * Responsive Lightbox class.
37
  *
38
  * @class Responsive_Lightbox
39
- * @version 1.6.0
40
  */
41
  class Responsive_Lightbox {
42
 
@@ -146,7 +146,7 @@ class Responsive_Lightbox {
146
  'pagination_type' => 'thumbnails'
147
  )
148
  ),
149
- 'version' => '1.6.0'
150
  );
151
  public $options = array();
152
  private $notices = array();
@@ -201,6 +201,7 @@ class Responsive_Lightbox {
201
  add_action( 'wp_enqueue_scripts', array( &$this, 'front_scripts_styles' ) );
202
  add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts_styles' ) );
203
  add_action( 'admin_init', array( &$this, 'update_notices' ) );
 
204
 
205
  // filters
206
  add_filter( 'plugin_action_links', array( &$this, 'plugin_settings_link' ), 10, 2 );
@@ -302,16 +303,20 @@ class Responsive_Lightbox {
302
  // check version, if update ver is lower than plugin ver, set update notice to true
303
  $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_version' => $current_update, 'update_notice' => true ) );
304
  update_option( 'responsive_lightbox_settings', $this->options['settings'] );
305
- } elseif ( isset( $_GET['rl_action'] ) && $_GET['rl_action'] == 'hide_notice' ) {
306
- // hide notice, if query arg is set, before it gets displayed
307
- $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_notice' => false ) );
308
- update_option( 'responsive_lightbox_settings', $this->options['settings'] );
 
 
 
 
309
  }
310
 
311
  // display current version notice
312
  if ( $this->options['settings']['update_notice'] === true ) {
313
 
314
- $this->add_notice( sprintf(__( 'Thank you for updating Responsive Lightbox to version %s. <a href="%s">Click here</a> to check out our latest extensions!', 'responsive-lightbox'), $this->defaults['version'], esc_url( add_query_arg( array( 'rl_action' => 'hide_notice' ), admin_url( 'options-general.php' ) . '?page=responsive-lightbox&tab=addons' ) ) ), 'updated notice' );
315
  }
316
  }
317
 
@@ -344,7 +349,34 @@ class Responsive_Lightbox {
344
  </div>';
345
  }
346
  }
347
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  /**
349
  * Add links to Support Forum
350
  */
@@ -625,6 +657,11 @@ class Responsive_Lightbox {
625
 
626
  default :
627
 
 
 
 
 
 
628
  break;
629
  }
630
 
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.6.1
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/responsive-lightbox/
36
  * Responsive Lightbox class.
37
  *
38
  * @class Responsive_Lightbox
39
+ * @version 1.6.1
40
  */
41
  class Responsive_Lightbox {
42
 
146
  'pagination_type' => 'thumbnails'
147
  )
148
  ),
149
+ 'version' => '1.6.1'
150
  );
151
  public $options = array();
152
  private $notices = array();
201
  add_action( 'wp_enqueue_scripts', array( &$this, 'front_scripts_styles' ) );
202
  add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts_styles' ) );
203
  add_action( 'admin_init', array( &$this, 'update_notices' ) );
204
+ add_action( 'admin_print_scripts', array( &$this, 'admin_inline_js' ), 999 );
205
 
206
  // filters
207
  add_filter( 'plugin_action_links', array( &$this, 'plugin_settings_link' ), 10, 2 );
303
  // check version, if update ver is lower than plugin ver, set update notice to true
304
  $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_version' => $current_update, 'update_notice' => true ) );
305
  update_option( 'responsive_lightbox_settings', $this->options['settings'] );
306
+ } elseif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'rl-hide-notice' ) {
307
+ if ( wp_verify_nonce( $_REQUEST['rl_nonce'], 'rl_action' ) ) {
308
+ // hide notice, if query arg is set, before it gets displayed
309
+ $this->options['settings'] = array_merge( $this->options['settings'], array( 'update_notice' => false ) );
310
+ update_option( 'responsive_lightbox_settings', $this->options['settings'] );
311
+ } else {
312
+ print_r( $_REQUEST );
313
+ }
314
  }
315
 
316
  // display current version notice
317
  if ( $this->options['settings']['update_notice'] === true ) {
318
 
319
+ $this->add_notice( sprintf(__( 'Thank you for installing Responsive Lightbox version %s. <a href="%s">Click here</a> to check out our latest extensions!', 'responsive-lightbox'), $this->defaults['version'], wp_nonce_url( add_query_arg( array( 'action' => 'rl-hide-notice' ), admin_url( 'options-general.php' ) . '?page=responsive-lightbox&tab=addons' ), 'rl_action', 'rl_nonce' ) ), 'updated notice is-dismissible rl-notice' );
320
  }
321
  }
322
 
349
  </div>';
350
  }
351
  }
352
+
353
+ /**
354
+ * Print admin scripts.
355
+ */
356
+ public function admin_inline_js() {
357
+ if ( ! current_user_can( 'install_plugins' ) )
358
+ return;
359
+ ?>
360
+ <script type="text/javascript">
361
+ ( function ( $ ) {
362
+ $( document ).ready( function () {
363
+ // save dismiss state
364
+ $( '.rl-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( e ) {
365
+ e.preventDefault();
366
+
367
+ $.post( ajaxurl, {
368
+ action: 'rl-hide-notice',
369
+ url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
370
+ rl_nonce: '<?php echo wp_create_nonce( 'rl_action' ); ?>'
371
+ } );
372
+
373
+ } );
374
+ } );
375
+ } )( jQuery );
376
+ </script>
377
+ <?php
378
+ }
379
+
380
  /**
381
  * Add links to Support Forum
382
  */
657
 
658
  default :
659
 
660
+ do_action( 'rl_lightbox_enqueue_scripts' );
661
+
662
+ $scripts = apply_filters( 'rl_lightbox_scripts', $scripts );
663
+ $styles = apply_filters( 'rl_lightbox_styles', $styles );
664
+
665
  break;
666
  }
667