Document Gallery - Version 4.1.12

Version Description

  • Bug Fix: Resolves issues where the visual editor gallery preview was missing for a small subset of shortcode types.
Download this release

Release Info

Developer dan.rossiter
Plugin Icon 128x128 Document Gallery
Version 4.1.12
Comparing to
See all releases

Code changes from version 4.1.11 to 4.1.12

CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
  # Changelog
2
 
 
 
 
3
  ## 4.1.11
4
  * **Bug Fix:** Resolves bug that resulted in various issues, including Jetpack and some core WordPress functionality
5
  not working correctly.
1
  # Changelog
2
 
3
+ ## 4.1.12
4
+ * **Bug Fix:** Resolves issues where the visual editor gallery preview was missing for a small subset of shortcode types.
5
+
6
  ## 4.1.11
7
  * **Bug Fix:** Resolves bug that resulted in various issues, including Jetpack and some core WordPress functionality
8
  not working correctly.
README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: attachments, library, thumbnail, documents, gallery, word, pdf
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EE5LWRLG933EN&lc=US&item_name=Document%20Gallery%20Plugin&item_number=document%2dgallery&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
5
  Requires at least: 4.1
6
  Tested up to: 4.4
7
- Stable tag: 4.1.11
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -422,6 +422,9 @@ To see a list of features planned for the future as well as to propose your own
422
  ideas for future Document Gallery development, take a look at our
423
  [issue tracker](https://github.com/thenadz/document-gallery/issues).
424
 
 
 
 
425
  = 4.1.11 =
426
  * **Bug Fix:** Resolves bug that resulted in various issues, including Jetpack and some core WordPress functionality
427
  not working correctly.
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EE5LWRLG933EN&lc=US&item_name=Document%20Gallery%20Plugin&item_number=document%2dgallery&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
5
  Requires at least: 4.1
6
  Tested up to: 4.4
7
+ Stable tag: 4.1.12
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
422
  ideas for future Document Gallery development, take a look at our
423
  [issue tracker](https://github.com/thenadz/document-gallery/issues).
424
 
425
+ = 4.1.12 =
426
+ * **Bug Fix:** Resolves issues where the visual editor gallery preview was missing for a small subset of shortcode types.
427
+
428
  = 4.1.11 =
429
  * **Bug Fix:** Resolves bug that resulted in various issues, including Jetpack and some core WordPress functionality
430
  not working correctly.
assets/js/gallery.js CHANGED
@@ -85,6 +85,9 @@
85
  function retrieveGallery(atts, target) {
86
  // TODO: Cache already-retrieved gallery pages. Need to be careful not to keep too many at a time
87
  // (could consume a lot of memory) & handle caching pages for multiple galleries on a single pages.
 
 
 
88
  $.post(ajaxurl, { action: 'dg_generate_gallery', atts: atts }, function(html) {
89
  var jobj = $($.parseHTML(html));
90
  target.replaceWith(jobj);
85
  function retrieveGallery(atts, target) {
86
  // TODO: Cache already-retrieved gallery pages. Need to be careful not to keep too many at a time
87
  // (could consume a lot of memory) & handle caching pages for multiple galleries on a single pages.
88
+ if ( typeof atts['id'] === 'undefined' ) {
89
+ atts['id'] = wp.media.dgDefaults.id;
90
+ }
91
  $.post(ajaxurl, { action: 'dg_generate_gallery', atts: atts }, function(html) {
92
  var jobj = $($.parseHTML(html));
93
  target.replaceWith(jobj);
assets/js/gallery.min.js CHANGED
@@ -1,3 +1,4 @@
1
  (function(b){function g(a){(a||b(".document-gallery[data-icon-width]")).each(function(){var a=b(this).data("icon-width")+"%";b(this).find(".document-icon").width(a)})}function m(){"undefined"!==typeof tinymce&&tinymce.PluginManager.add("dg",function(a,d){a.on("LoadContent dgUpdate undo",function(a){b(a.target.contentDocument).find(".wpview-type-dg > [data-shortcode]").each(function(){h(b.parseJSON(decodeURIComponent(b(this).data("shortcode"))),b(this))})})})}function n(){b("body").delegate(".dg-paginate-wrapper .paginate a",
2
- "click",function(a){var d=b(this).closest(".dg-paginate-wrapper"),e=d.data("shortcode");e.skip=0;var c=b(this).attr("href").split("#")[1].split("=");2<=c.length&&(e.skip=e.limit*(c.pop()-1));h(e,d);a.preventDefault()})}function k(){c=[];f=0;b(".document-gallery img[data-id]").each(function(){var a=b(this).data("id");-1===b.inArray(a,c)&&c.push(a)});l()}function h(a,d){b.post(ajaxurl,{action:"dg_generate_gallery",atts:a},function(a){a=b(b.parseHTML(a));d.replaceWith(a);g(a);k()})}function l(){for(var a=
3
- [];f<c.length&&4!==a.length;f++)a.push(c[f]);0!=a.length&&b.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"dg_generate_icons",ids:a},success:p,error:function(a){console.error(a.responseText)}})}function p(a){for(var d in a)if(a.hasOwnProperty(d)){var c=b('.document-gallery img[data-id="'+d+'"]');c.removeAttr("data-id");(function(c,d){d.fadeOut("fast",function(){b(this).attr("src",a[c]);b(this).fadeIn("fast")})})(d,c)}l()}var c,f;b(document).ready(function(){g();k();m();n()})})(jQuery);
 
1
  (function(b){function g(a){(a||b(".document-gallery[data-icon-width]")).each(function(){var a=b(this).data("icon-width")+"%";b(this).find(".document-icon").width(a)})}function m(){"undefined"!==typeof tinymce&&tinymce.PluginManager.add("dg",function(a,d){a.on("LoadContent dgUpdate undo",function(a){b(a.target.contentDocument).find(".wpview-type-dg > [data-shortcode]").each(function(){h(b.parseJSON(decodeURIComponent(b(this).data("shortcode"))),b(this))})})})}function n(){b("body").delegate(".dg-paginate-wrapper .paginate a",
2
+ "click",function(a){var d=b(this).closest(".dg-paginate-wrapper"),e=d.data("shortcode");e.skip=0;var c=b(this).attr("href").split("#")[1].split("=");2<=c.length&&(e.skip=e.limit*(c.pop()-1));h(e,d);a.preventDefault()})}function k(){c=[];f=0;b(".document-gallery img[data-id]").each(function(){var a=b(this).data("id");-1===b.inArray(a,c)&&c.push(a)});l()}function h(a,d){"undefined"===typeof a.id&&(a.id=wp.media.dgDefaults.id);b.post(ajaxurl,{action:"dg_generate_gallery",atts:a},function(a){a=b(b.parseHTML(a));
3
+ d.replaceWith(a);g(a);k()})}function l(){for(var a=[];f<c.length&&4!==a.length;f++)a.push(c[f]);0!=a.length&&b.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"dg_generate_icons",ids:a},success:p,error:function(a){console.error(a.responseText)}})}function p(a){for(var d in a)if(a.hasOwnProperty(d)){var c=b('.document-gallery img[data-id="'+d+'"]');c.removeAttr("data-id");(function(c,d){d.fadeOut("fast",function(){b(this).attr("src",a[c]);b(this).fadeIn("fast")})})(d,c)}l()}var c,f;b(document).ready(function(){g();
4
+ k();m();n()})})(jQuery);
document-gallery.php CHANGED
@@ -5,14 +5,14 @@ defined( 'WPINC' ) OR exit;
5
  Plugin Name: Document Gallery
6
  Plugin URI: http://wordpress.org/extend/plugins/document-gallery/
7
  Description: Display non-images (and images) in gallery format on a page or post with the [dg] shortcode.
8
- Version: 4.1.11
9
  Author: Dan Rossiter
10
  Author URI: http://danrossiter.org/
11
  License: GPLv3
12
  Text Domain: document-gallery
13
  */
14
 
15
- define( 'DG_VERSION', '4.1.11' );
16
 
17
  if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
18
  add_action( 'admin_notices', 'dg_php_lt_three' );
5
  Plugin Name: Document Gallery
6
  Plugin URI: http://wordpress.org/extend/plugins/document-gallery/
7
  Description: Display non-images (and images) in gallery format on a page or post with the [dg] shortcode.
8
+ Version: 4.1.12
9
  Author: Dan Rossiter
10
  Author URI: http://danrossiter.org/
11
  License: GPLv3
12
  Text Domain: document-gallery
13
  */
14
 
15
+ define( 'DG_VERSION', '4.1.12' );
16
 
17
  if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
18
  add_action( 'admin_notices', 'dg_php_lt_three' );
inc/thumbers/thumber-co/class-thumber-client.php CHANGED
@@ -125,7 +125,6 @@ class DG_ThumberClient extends ThumberClient {
125
  */
126
  public function getSubscription($update_options = true) {
127
  global $dg_options;
128
- $ret = $dg_options['thumber-co']['subscription'];
129
  if ( empty( $dg_options['thumber-co']['subscription'] ) ) {
130
  static $whitelist = array( 'direct_upload', 'file_size_limit', 'thumb_size_limit' );
131
  $ret = array_intersect_key( (array)parent::getSubscription(), array_flip( $whitelist ) );
@@ -135,7 +134,7 @@ class DG_ThumberClient extends ThumberClient {
135
  }
136
  }
137
 
138
- return $ret;
139
  }
140
 
141
  /**
125
  */
126
  public function getSubscription($update_options = true) {
127
  global $dg_options;
 
128
  if ( empty( $dg_options['thumber-co']['subscription'] ) ) {
129
  static $whitelist = array( 'direct_upload', 'file_size_limit', 'thumb_size_limit' );
130
  $ret = array_intersect_key( (array)parent::getSubscription(), array_flip( $whitelist ) );
134
  }
135
  }
136
 
137
+ return $dg_options['thumber-co']['subscription'];
138
  }
139
 
140
  /**