Document Gallery - Version 4.1.7

Version Description

  • Bug Fix: There was a minor issue on some admin pages that has been resolved.
Download this release

Release Info

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

Code changes from version 4.1.6 to 4.1.7

CHANGELOG.md CHANGED
@@ -1,13 +1,20 @@
1
- == Changelog ==
2
 
3
- = 4.1.5 =
 
 
 
 
 
 
 
4
  * **Bug Fix:** For a subset of the users upgrading from `4.0` to `4.1.x`, the thumbnail images will have been corrupted
5
  during the upgrade process. This release addresses the problem.
6
 
7
- = 4.1.1 & 4.1.2 & 4.1.3 & 4.1.4 =
8
  * **Bug Fix:** Resolves various errors reported following `4.1` release.
9
 
10
- = 4.1 =
11
  * **Enhancement:** At long last, support for Microsoft Office files (Word, PowerPoint, Publisher, Visio), as well as a
12
  boat-load of [other formats](https://www.thumber.co/about#filetypes), has been re-added to Document Gallery by way of
13
  integration with the [Thumber.co](https://www.thumber.co) service. For a small fee you can generate images for all of your
@@ -22,7 +29,7 @@
22
  If this applies to you then you'll want to hold off on upgrading until you've had a chance to rework your usage of the
23
  filter to map to the new expected values.
24
 
25
- = 4.0 =
26
  * **Enhancement:** The WordPress visual editor now displays a full gallery preview.
27
  * **Enhancement:** You can now paginate your galleries. This is especially useful in large multi-hundred item galleries.
28
  To enable pagination in your galleries, simply use `limit=##`.
@@ -40,34 +47,34 @@
40
  * **Bug Fix:** `Limit` was not working in cases where the `ids` or `include` attribute were present. This has been fixed.
41
  * **Tested Up To:** Document Gallery has been tested in WP 4.4 beta.
42
 
43
- = 3.5.4 =
44
  * **Bug Fix:** There were issues in the structure of HTML generated for galleries. This resulted in issues
45
  with icon generation.
46
  * **Notice:** For any developers using PHP filters with Document Gallery, the structure of the content being
47
  filtered in `dg_gallery_template` has changed. Documentation has been updated accordingly.
48
 
49
- = 3.5.3 =
50
  * **Bug Fix:** The `images` attribute was not being parsed correctly. Thanks to
51
  [kalico](https://wordpress.org/support/profile/kalico) for pointing this out!
52
 
53
- = 3.5.2 =
54
  * **Bug Fix:** There was an issue with the Media Manager integration preventing using the Document Gallery creation
55
  within the "Add Media" dialog.
56
 
57
- = 3.5.1 =
58
  * **Bug Fix:** There was a minor bug in `3.5` with the new gallery loading logic. It was a compatibility issue with
59
  other plugins.
60
 
61
- = 3.5 =
62
  * **Enhancement:** No more waiting a **LONG** time for your new gallery to load. If you create a new gallery and view
63
  it, rendering will complete immediately and the thumbnails will be generated after your gallery initially loads.
64
  This should provide a significantly improved user experience!
65
  * **Enhancement:** All JS and CSS files are now served compressed, making your WordPress that much faster!
66
 
67
- = 3.4.2 =
68
  * **Bug Fix:** Resolves issues in handling manual thumbnail uploads that were introduced in `3.4`.
69
 
70
- = 3.4 =
71
  * **Enhancement:** To address recent issues resulting from corrupt plugin options, we're making option validation no longer
72
  optional. This was an advanced feature that most users were likely not aware of, but it allows us to provide more
73
  robust option management moving forward. Any options that have been previously corrupted will be reset during upgrading
@@ -78,11 +85,11 @@
78
  * **Bug Fix:** There were some CSS changes in WP 3.3 which broke some styling in the DG settings dialogs. These have
79
  been resolved.
80
 
81
- = 3.3.1 =
82
  * **Bug Fix:** A couple of the translation files (Finnish & Ukrainian) were named incorrectly, resulting in them
83
  never actually being loaded.
84
 
85
- = 3.3 =
86
  * **Enhancement:** Developers using the Document Gallery API now have access to new
87
  values when using the `dg_icon_template` filter.
88
  (Thanks to [pierowbmstr](https://wordpress.org/support/profile/pierowbmstr)!)
@@ -92,20 +99,20 @@
92
  * **Bug Fix:** Resolved Media Manager integration not being available when first creating
93
  a post.
94
 
95
- = 3.2 =
96
  * **Enhancement:** The long awaited option to open thumbnail links in a new window
97
  has been added. Simply use `[dg new_window=true]`.
98
 
99
- = 3.1 =
100
  * **Enhancement:** The Media Manager can now be used to generate a gallery without
101
  needing to manually write the shortcode.
102
  * **Enhancement:** Document Gallery logs can now be rolled over at regular intervals
103
  to avoid generating massive log files over extended periods of time.
104
 
105
- = 3.0.2 =
106
  * **Bug Fix:** The update process was broken in 3.0 -- this resolves that issue.
107
 
108
- = 3.0 =
109
  * **Notice:** Google Drive support has been removed as recent changes to how the service functions
110
  have made it no longer useful in thumbnail generation. A replacement for supporting MS Office
111
  filetypes (and other filetypes not supported in existing options) is in the works and we hope
@@ -126,28 +133,28 @@
126
  * **Deprecation:** The `localpost` option has been deprecated and will be removed at a future date.
127
  If you are currently using `localpost=false` then it should be replaced by `id=-1`.
128
 
129
- = 2.3.7 =
130
  * **Bug Fix:** There was an issue that resulted in an error being thrown in certain situations.
131
 
132
- = 2.3.6 =
133
  * **Bug Fix:** There was an issue that resulted in the the Document Gallery Settings view crashing on some systems.
134
 
135
- = 2.3.5 =
136
  * **Bug Fix:** There was an issue with how custom CSS was being processed that is resolved in this version.
137
 
138
- = 2.3.4 =
139
  * **Bug Fix:** A bug was introduced that broke the `ids` parameter. This is resolved now.
140
 
141
- = 2.3.3 =
142
  * **Bug Fix:** Update script was failing following new release. This resolves that issue.
143
 
144
- = 2.3.2 =
145
  * **Translation:** Russian and Ukrainian translations have been updated.
146
 
147
- = 2.3.1 =
148
  * **Bug Fix:** Resolved a couple of bugs introduced with new `2.3` functionality.
149
 
150
- = 2.3 =
151
  * **Enhancement:** Taxonomy support now includes handling for both relationships
152
  between different taxons and relationships between different terms within a single
153
  taxon. See installation tab for more details.
@@ -163,37 +170,37 @@
163
  * **Bug Fix:** When Ghostscript chokes on a PDF, it will no longer print the error message
164
  in the Document Gallery output (instead it will end up in Document Gallery Logging).
165
 
166
- = 2.2.7 =
167
  * **Bug Fix:** There was an issue with a few phrases not being translated in the
168
  admin dialogs. Dates in the logs were also not being properly translated.
169
 
170
- = 2.2.6 =
171
  * **Enhancement:** Improved how Ghostscript executable is detected.
172
 
173
- = 2.2.5 =
174
  * **Bug Fix:** Resolves a bug where document descriptions were not being displayed
175
  correctly.
176
  * **Translation:** Thanks, Marc Liotard and [Traffic Influence](http://www.trafic-influence.com/)
177
  for updating the French translation to include new phrases throughout the plugin!
178
 
179
- = 2.2.4 =
180
  * **Translation:**: Thanks to [mepmepmep](http://wordpress.org/support/profile/mepmepmep)
181
  who has just updated the Document Gallery Swedish translation!
182
 
183
- = 2.2.3 =
184
  * **Enhancement:** This will only be relevant to developers. `%descriptions%` tag
185
  is now available in the `dg_icon_template` filter.
186
 
187
- = 2.2.2 =
188
  * **Bug Fix:** Resolves minor issue in `2.2.1` that resulted in a warning being
189
  logged while interacting with the new thumbnail management table in the
190
  Document Gallery settings.
191
 
192
- = 2.2.1 =
193
  * **Bug Fix:** PHP installs older than 5.3 were crashing with version 2.2. This release
194
  patches the issue.
195
 
196
- = 2.2 =
197
  * **Note:** This release is the first release where development has been done by
198
  multiple people. I would like to give a massive thank you to
199
  [demur](http://wordpress.org/support/profile/demur) who has been an equal
@@ -218,7 +225,7 @@
218
  aspects of HTML generated by the plugin. Look at the Installation tab for documentation
219
  on these new filters.
220
 
221
- = 2.1.1 =
222
  * **Translation:** Thanks to [mepmepmep](http://wordpress.org/support/profile/mepmepmep)
223
  who has translated Document Gallery into Swedish!
224
  * **Translation:** Thanks to Marc Liotard who has translated Document Gallery into French!
@@ -229,11 +236,11 @@
229
  near future. Look for a complete makeover of the admin options including
230
  lots of new ways to configure DG to best meet your needs!
231
 
232
- = 2.1 =
233
  * **Enhancement:** Document Gallery now supports
234
  [multisite networks](http://codex.wordpress.org/Create_A_Network).
235
 
236
- = 2.0.10 =
237
  * **Enhancement:** Ghostscript detection should now work correctly on GoDaddy
238
  and some other hosts that don't properly setup their executables.
239
  * **Translation:** Thanks *again* to
@@ -242,22 +249,22 @@
242
  translate Document Gallery into another language, get started
243
  [here](http://wordpress.org/support/topic/seeking-translators)!
244
 
245
- = 2.0.9 =
246
  * **Bug Fix:** The `order` attribute was documented and implemented as being `ASC`
247
  or `DEC`, but the latter should actually have been `DESC`. Documentation and
248
  implementation for this option has been corrected. Thanks again to
249
  [demur](http://wordpress.org/support/profile/demur) for catching this!
250
 
251
- = 2.0.8 =
252
  * **Enhancement:** Ghostscript will now handle PS and EPS files if enabled.
253
  * **Bug Fix:** There were a couple of issues in how the `ids` attribute was being
254
  handled. Thanks, [demur](http://wordpress.org/support/profile/demur) for catching
255
  these!
256
 
257
- = 2.0.7 =
258
  * **Bug Fix:** `2.0.6` did not fully resolve the bug described below. This should.
259
 
260
- = 2.0.6 =
261
  * **Bug Fix:** If DG failed to automagically detect the location of the
262
  Ghostscript binary, manually setting the location did not enable using it.
263
  Thanks for tracking this bug down,
@@ -266,11 +273,11 @@
266
  for image types.
267
  * **Tested Up To:** Document Gallery has been tested in WP 3.9 (RC 1).
268
 
269
- = 2.0.5 =
270
  * **Bug Fix:** Rolling back part of CSS enhancments in 2.0.4 that were causing
271
  errors on some servers. May revisit at a later date.
272
 
273
- = 2.0.4 =
274
  * **Enhancement:** Custom CSS is now loaded faster, meaning faster page loads
275
  for your users. Tests are showing a speedup of around 30% over where it was
276
  in the last release.
@@ -279,7 +286,7 @@
279
  points decrease in size. Thanks for the suggestion,
280
  [wm](http://wordpress.org/support/profile/webbmasterpianise)!
281
 
282
- = 2.0.3 =
283
  * **Enhancement:** Now handles custom user CSS more securely.
284
  * **Enhancement:** Now handles calling Ghostscript executable more securely.
285
  * **Enhancement:** Now provides timing information for gallery generation
@@ -291,21 +298,21 @@
291
  which finished almost instantly using GS, but took multiple minutes when
292
  using IM on my test server (results may vary). See new FAQ tab to find out why.
293
 
294
- = 2.0.2 =
295
  * **Bug Fix:** Imagick was actually never working... My bad -- it is now! Thanks to
296
  [kaldimar](http://wordpress.org/support/profile/kaldimar) for reporting this.
297
  * **Enhancement:** Document Gallery en el Español por Andrew de
298
  [WebHostingHub](http://www.webhostinghub.com/). (To help translate to another
299
  language, [see here](http://wordpress.org/support/topic/seeking-translators).)
300
 
301
- = 2.0.1 =
302
  * **Bug Fix:** Resolves issue with `2.0` where DG options were not properly
303
  initialized when the plugin was updated. This caused the settings page to
304
  behave oddly and many other things throughout to not work as expected when
305
  you updated through the dashboard. Thanks to jawhite & rigbypa for
306
  [reporting this](http://wordpress.org/support/topic/errors-after-updating-to-20)!
307
 
308
- = 2.0 =
309
  * **Enhancement:** This release is a **BIG** deal! We are introducing true
310
  document thumbnails (rather than the boring static images that were the same
311
  for every document), meaning that you will be able to generate and display
@@ -335,10 +342,10 @@
335
  [report the issue](http://wordpress.org/support/plugin/document-gallery)
336
  so that I can resolve it. Thanks!
337
 
338
- = 1.4.3 =
339
  * **Bug Fix:** Resolves minor bug introduced in version 1.4.2. Thanks, tkokholm!
340
 
341
- = 1.4.2 =
342
  * **Note:** This release includes an increase in the minimum WP version to 3.5.
343
  If you have not yet upgraded to at least this version, you should consider doing
344
  so as future releases include a number of *fantastic* new features as well as
@@ -355,27 +362,24 @@
355
  coming weeks!
356
  PS: If you're really curious, there are some clues in the source code ;)
357
 
358
- = 1.4.1 =
359
  * **Bug Fix:** This resolves a bug introduced in `1.4`, which caused a warning
360
  to be thrown when no attributes were used (i.e.: `[dg]`). (Thanks to
361
  [wtfbingo](http://wordpress.org/support/topic/error-after-update-19) for
362
  pointing this out!)
363
 
364
- = 1.4 =
365
-
366
  * **New Feature:** This release features the addition of *category/taxonomy* support,
367
  [as suggested by Pyo](http://wordpress.org/support/topic/sorting-documents-by-categorytag-or-other-taxonomy).
368
  * **Under The Hood:** The plugin was completely rewritten for this release. Logic
369
  was cleaned up to make maintenance easier and facilitate some *big* changes
370
  planned for version 2.0 of Document Gallery.
371
 
372
- = 1.3.1 =
373
-
374
  * **Bug Fix:** This resolves a bug introduced in version `1.3`. (Thanks to JKChad
375
  for pointing this out!)
376
 
377
- = 1.3 =
378
-
379
  * **New Feature:** It is now possible to filter the HTML produced to represent
380
  each individual icon, making it possible to add extra attributes and other
381
  modifications on the fly as document icons are generated. This will probably
@@ -388,13 +392,11 @@
388
  generated so that the format of the icon returned now matches the rest of
389
  the icons.
390
 
391
- = 1.2.1 =
392
-
393
  * **Bug Fix:** Resolved issue with the `ids` attribute in `1.2` not working.
394
  Sorry about that!
395
 
396
- = 1.2 =
397
-
398
  * **New Feature:** Images can now be included alongside documents in a
399
  document gallery (using `images=true` attribute).
400
  (Thanks for the suggestion, Luca!)
@@ -404,38 +406,32 @@
404
  * **Enhancement:** The CSS stylesheet has been enhanced for more flexibility
405
  in sizing icons.
406
 
407
- = 1.1 =
408
-
409
  * **New Feature:** Included option to link to the attachment page as well as
410
  to the actual document.
411
  * **Enhancement:** Added documentation for customizing the appearance of the plugin.
412
  * **Enhancement:** Many improvements to the backend, including pretty HTML output
413
  and best practice implementation in calls to WordPress core functions.
414
 
415
- = 1.0.4 =
416
-
417
  * **Bug Fix:** Removed extra `div` at bottom when number of documents is
418
  evenly divisible by 4. (Thanks, joero4ri!)
419
 
420
- = 1.0.3 =
421
-
422
  * **Bug Fix:** Resolved issue with detecting plugin directory. (Thanks,
423
  Brigitte!)
424
  * **Enhancement:** Minor improvement to how linking to individual
425
  documents is handled.
426
 
427
- = 1.0.2 =
428
-
429
  * **Bug Fix:** Merge for changes in 1.0 did not go through correctly so users
430
  downloaded the old icon set which broke the plugin. Sorry about that, but
431
  all is resolved with this release!
432
 
433
- = 1.0.1 =
434
-
435
  * **Bug Fix:** Resolved issue with long document titles being cut off in some themes.
436
 
437
- = 1.0 =
438
-
439
  * **New Feature:** Plugin now has **36 icons** representing **72 filetypes**!
440
  * **Enhancement:** Optimized gallery generation (faster!)
441
  * **Enhancement:** Added fallback to WordPress default icons if you happen to
@@ -444,13 +440,11 @@
444
  work for backward compatibility).
445
  * **Enhancement:** Gave documentation some **much needed** revisions.
446
 
447
- = 0.8.5 =
448
-
449
  * **Enhancement:** Added support for
450
  [OpenDocuments](http://en.wikipedia.org/wiki/OpenDocument).
451
 
452
- = 0.8 =
453
-
454
  * **Release:** First public release of Document Gallery.
455
  * **Feature:** Displays PDF, Word, PowerPoint, Excel, and ZIP documents from a
456
  given page or post.
1
+ # Changelog
2
 
3
+ ## 4.1.7
4
+ * **Bug Fix:** There was a minor issue on some admin pages that has been resolved.
5
+
6
+ ## 4.1.6
7
+ * **Enhancement:** Added warning to plugins page when a PHP version < 5.3 is being used.
8
+ * **Bug Fix:** Resolves a "class not found" error.
9
+
10
+ ## 4.1.5
11
  * **Bug Fix:** For a subset of the users upgrading from `4.0` to `4.1.x`, the thumbnail images will have been corrupted
12
  during the upgrade process. This release addresses the problem.
13
 
14
+ ## 4.1.1 & 4.1.2 & 4.1.3 & 4.1.4
15
  * **Bug Fix:** Resolves various errors reported following `4.1` release.
16
 
17
+ ## 4.1
18
  * **Enhancement:** At long last, support for Microsoft Office files (Word, PowerPoint, Publisher, Visio), as well as a
19
  boat-load of [other formats](https://www.thumber.co/about#filetypes), has been re-added to Document Gallery by way of
20
  integration with the [Thumber.co](https://www.thumber.co) service. For a small fee you can generate images for all of your
29
  If this applies to you then you'll want to hold off on upgrading until you've had a chance to rework your usage of the
30
  filter to map to the new expected values.
31
 
32
+ ## 4.0
33
  * **Enhancement:** The WordPress visual editor now displays a full gallery preview.
34
  * **Enhancement:** You can now paginate your galleries. This is especially useful in large multi-hundred item galleries.
35
  To enable pagination in your galleries, simply use `limit=##`.
47
  * **Bug Fix:** `Limit` was not working in cases where the `ids` or `include` attribute were present. This has been fixed.
48
  * **Tested Up To:** Document Gallery has been tested in WP 4.4 beta.
49
 
50
+ ## 3.5.4
51
  * **Bug Fix:** There were issues in the structure of HTML generated for galleries. This resulted in issues
52
  with icon generation.
53
  * **Notice:** For any developers using PHP filters with Document Gallery, the structure of the content being
54
  filtered in `dg_gallery_template` has changed. Documentation has been updated accordingly.
55
 
56
+ ## 3.5.3
57
  * **Bug Fix:** The `images` attribute was not being parsed correctly. Thanks to
58
  [kalico](https://wordpress.org/support/profile/kalico) for pointing this out!
59
 
60
+ ## 3.5.2
61
  * **Bug Fix:** There was an issue with the Media Manager integration preventing using the Document Gallery creation
62
  within the "Add Media" dialog.
63
 
64
+ ## 3.5.1
65
  * **Bug Fix:** There was a minor bug in `3.5` with the new gallery loading logic. It was a compatibility issue with
66
  other plugins.
67
 
68
+ ## 3.5
69
  * **Enhancement:** No more waiting a **LONG** time for your new gallery to load. If you create a new gallery and view
70
  it, rendering will complete immediately and the thumbnails will be generated after your gallery initially loads.
71
  This should provide a significantly improved user experience!
72
  * **Enhancement:** All JS and CSS files are now served compressed, making your WordPress that much faster!
73
 
74
+ ## 3.4.2
75
  * **Bug Fix:** Resolves issues in handling manual thumbnail uploads that were introduced in `3.4`.
76
 
77
+ ## 3.4
78
  * **Enhancement:** To address recent issues resulting from corrupt plugin options, we're making option validation no longer
79
  optional. This was an advanced feature that most users were likely not aware of, but it allows us to provide more
80
  robust option management moving forward. Any options that have been previously corrupted will be reset during upgrading
85
  * **Bug Fix:** There were some CSS changes in WP 3.3 which broke some styling in the DG settings dialogs. These have
86
  been resolved.
87
 
88
+ ## 3.3.1
89
  * **Bug Fix:** A couple of the translation files (Finnish & Ukrainian) were named incorrectly, resulting in them
90
  never actually being loaded.
91
 
92
+ ## 3.3
93
  * **Enhancement:** Developers using the Document Gallery API now have access to new
94
  values when using the `dg_icon_template` filter.
95
  (Thanks to [pierowbmstr](https://wordpress.org/support/profile/pierowbmstr)!)
99
  * **Bug Fix:** Resolved Media Manager integration not being available when first creating
100
  a post.
101
 
102
+ ## 3.2
103
  * **Enhancement:** The long awaited option to open thumbnail links in a new window
104
  has been added. Simply use `[dg new_window=true]`.
105
 
106
+ ## 3.1
107
  * **Enhancement:** The Media Manager can now be used to generate a gallery without
108
  needing to manually write the shortcode.
109
  * **Enhancement:** Document Gallery logs can now be rolled over at regular intervals
110
  to avoid generating massive log files over extended periods of time.
111
 
112
+ ## 3.0.2
113
  * **Bug Fix:** The update process was broken in 3.0 -- this resolves that issue.
114
 
115
+ ## 3.0
116
  * **Notice:** Google Drive support has been removed as recent changes to how the service functions
117
  have made it no longer useful in thumbnail generation. A replacement for supporting MS Office
118
  filetypes (and other filetypes not supported in existing options) is in the works and we hope
133
  * **Deprecation:** The `localpost` option has been deprecated and will be removed at a future date.
134
  If you are currently using `localpost=false` then it should be replaced by `id=-1`.
135
 
136
+ ## 2.3.7
137
  * **Bug Fix:** There was an issue that resulted in an error being thrown in certain situations.
138
 
139
+ ## 2.3.6
140
  * **Bug Fix:** There was an issue that resulted in the the Document Gallery Settings view crashing on some systems.
141
 
142
+ ## 2.3.5
143
  * **Bug Fix:** There was an issue with how custom CSS was being processed that is resolved in this version.
144
 
145
+ ## 2.3.4
146
  * **Bug Fix:** A bug was introduced that broke the `ids` parameter. This is resolved now.
147
 
148
+ ## 2.3.3
149
  * **Bug Fix:** Update script was failing following new release. This resolves that issue.
150
 
151
+ ## 2.3.2
152
  * **Translation:** Russian and Ukrainian translations have been updated.
153
 
154
+ ## 2.3.1
155
  * **Bug Fix:** Resolved a couple of bugs introduced with new `2.3` functionality.
156
 
157
+ ## 2.3
158
  * **Enhancement:** Taxonomy support now includes handling for both relationships
159
  between different taxons and relationships between different terms within a single
160
  taxon. See installation tab for more details.
170
  * **Bug Fix:** When Ghostscript chokes on a PDF, it will no longer print the error message
171
  in the Document Gallery output (instead it will end up in Document Gallery Logging).
172
 
173
+ ## 2.2.7
174
  * **Bug Fix:** There was an issue with a few phrases not being translated in the
175
  admin dialogs. Dates in the logs were also not being properly translated.
176
 
177
+ ## 2.2.6
178
  * **Enhancement:** Improved how Ghostscript executable is detected.
179
 
180
+ ## 2.2.5
181
  * **Bug Fix:** Resolves a bug where document descriptions were not being displayed
182
  correctly.
183
  * **Translation:** Thanks, Marc Liotard and [Traffic Influence](http://www.trafic-influence.com/)
184
  for updating the French translation to include new phrases throughout the plugin!
185
 
186
+ ## 2.2.4
187
  * **Translation:**: Thanks to [mepmepmep](http://wordpress.org/support/profile/mepmepmep)
188
  who has just updated the Document Gallery Swedish translation!
189
 
190
+ ## 2.2.3
191
  * **Enhancement:** This will only be relevant to developers. `%descriptions%` tag
192
  is now available in the `dg_icon_template` filter.
193
 
194
+ ## 2.2.2
195
  * **Bug Fix:** Resolves minor issue in `2.2.1` that resulted in a warning being
196
  logged while interacting with the new thumbnail management table in the
197
  Document Gallery settings.
198
 
199
+ ## 2.2.1
200
  * **Bug Fix:** PHP installs older than 5.3 were crashing with version 2.2. This release
201
  patches the issue.
202
 
203
+ ## 2.2
204
  * **Note:** This release is the first release where development has been done by
205
  multiple people. I would like to give a massive thank you to
206
  [demur](http://wordpress.org/support/profile/demur) who has been an equal
225
  aspects of HTML generated by the plugin. Look at the Installation tab for documentation
226
  on these new filters.
227
 
228
+ ## 2.1.1
229
  * **Translation:** Thanks to [mepmepmep](http://wordpress.org/support/profile/mepmepmep)
230
  who has translated Document Gallery into Swedish!
231
  * **Translation:** Thanks to Marc Liotard who has translated Document Gallery into French!
236
  near future. Look for a complete makeover of the admin options including
237
  lots of new ways to configure DG to best meet your needs!
238
 
239
+ ## 2.1
240
  * **Enhancement:** Document Gallery now supports
241
  [multisite networks](http://codex.wordpress.org/Create_A_Network).
242
 
243
+ ## 2.0.10
244
  * **Enhancement:** Ghostscript detection should now work correctly on GoDaddy
245
  and some other hosts that don't properly setup their executables.
246
  * **Translation:** Thanks *again* to
249
  translate Document Gallery into another language, get started
250
  [here](http://wordpress.org/support/topic/seeking-translators)!
251
 
252
+ ## 2.0.9
253
  * **Bug Fix:** The `order` attribute was documented and implemented as being `ASC`
254
  or `DEC`, but the latter should actually have been `DESC`. Documentation and
255
  implementation for this option has been corrected. Thanks again to
256
  [demur](http://wordpress.org/support/profile/demur) for catching this!
257
 
258
+ ## 2.0.8
259
  * **Enhancement:** Ghostscript will now handle PS and EPS files if enabled.
260
  * **Bug Fix:** There were a couple of issues in how the `ids` attribute was being
261
  handled. Thanks, [demur](http://wordpress.org/support/profile/demur) for catching
262
  these!
263
 
264
+ ## 2.0.7
265
  * **Bug Fix:** `2.0.6` did not fully resolve the bug described below. This should.
266
 
267
+ ## 2.0.6
268
  * **Bug Fix:** If DG failed to automagically detect the location of the
269
  Ghostscript binary, manually setting the location did not enable using it.
270
  Thanks for tracking this bug down,
273
  for image types.
274
  * **Tested Up To:** Document Gallery has been tested in WP 3.9 (RC 1).
275
 
276
+ ## 2.0.5
277
  * **Bug Fix:** Rolling back part of CSS enhancments in 2.0.4 that were causing
278
  errors on some servers. May revisit at a later date.
279
 
280
+ ## 2.0.4
281
  * **Enhancement:** Custom CSS is now loaded faster, meaning faster page loads
282
  for your users. Tests are showing a speedup of around 30% over where it was
283
  in the last release.
286
  points decrease in size. Thanks for the suggestion,
287
  [wm](http://wordpress.org/support/profile/webbmasterpianise)!
288
 
289
+ ## 2.0.3
290
  * **Enhancement:** Now handles custom user CSS more securely.
291
  * **Enhancement:** Now handles calling Ghostscript executable more securely.
292
  * **Enhancement:** Now provides timing information for gallery generation
298
  which finished almost instantly using GS, but took multiple minutes when
299
  using IM on my test server (results may vary). See new FAQ tab to find out why.
300
 
301
+ ## 2.0.2
302
  * **Bug Fix:** Imagick was actually never working... My bad -- it is now! Thanks to
303
  [kaldimar](http://wordpress.org/support/profile/kaldimar) for reporting this.
304
  * **Enhancement:** Document Gallery en el Español por Andrew de
305
  [WebHostingHub](http://www.webhostinghub.com/). (To help translate to another
306
  language, [see here](http://wordpress.org/support/topic/seeking-translators).)
307
 
308
+ ## 2.0.1
309
  * **Bug Fix:** Resolves issue with `2.0` where DG options were not properly
310
  initialized when the plugin was updated. This caused the settings page to
311
  behave oddly and many other things throughout to not work as expected when
312
  you updated through the dashboard. Thanks to jawhite & rigbypa for
313
  [reporting this](http://wordpress.org/support/topic/errors-after-updating-to-20)!
314
 
315
+ ## 2.0
316
  * **Enhancement:** This release is a **BIG** deal! We are introducing true
317
  document thumbnails (rather than the boring static images that were the same
318
  for every document), meaning that you will be able to generate and display
342
  [report the issue](http://wordpress.org/support/plugin/document-gallery)
343
  so that I can resolve it. Thanks!
344
 
345
+ ## 1.4.3
346
  * **Bug Fix:** Resolves minor bug introduced in version 1.4.2. Thanks, tkokholm!
347
 
348
+ ## 1.4.2
349
  * **Note:** This release includes an increase in the minimum WP version to 3.5.
350
  If you have not yet upgraded to at least this version, you should consider doing
351
  so as future releases include a number of *fantastic* new features as well as
362
  coming weeks!
363
  PS: If you're really curious, there are some clues in the source code ;)
364
 
365
+ ## 1.4.1
366
  * **Bug Fix:** This resolves a bug introduced in `1.4`, which caused a warning
367
  to be thrown when no attributes were used (i.e.: `[dg]`). (Thanks to
368
  [wtfbingo](http://wordpress.org/support/topic/error-after-update-19) for
369
  pointing this out!)
370
 
371
+ ## 1.4
 
372
  * **New Feature:** This release features the addition of *category/taxonomy* support,
373
  [as suggested by Pyo](http://wordpress.org/support/topic/sorting-documents-by-categorytag-or-other-taxonomy).
374
  * **Under The Hood:** The plugin was completely rewritten for this release. Logic
375
  was cleaned up to make maintenance easier and facilitate some *big* changes
376
  planned for version 2.0 of Document Gallery.
377
 
378
+ ## 1.3.1
 
379
  * **Bug Fix:** This resolves a bug introduced in version `1.3`. (Thanks to JKChad
380
  for pointing this out!)
381
 
382
+ ## 1.3
 
383
  * **New Feature:** It is now possible to filter the HTML produced to represent
384
  each individual icon, making it possible to add extra attributes and other
385
  modifications on the fly as document icons are generated. This will probably
392
  generated so that the format of the icon returned now matches the rest of
393
  the icons.
394
 
395
+ ## 1.2.1
 
396
  * **Bug Fix:** Resolved issue with the `ids` attribute in `1.2` not working.
397
  Sorry about that!
398
 
399
+ ## 1.2
 
400
  * **New Feature:** Images can now be included alongside documents in a
401
  document gallery (using `images=true` attribute).
402
  (Thanks for the suggestion, Luca!)
406
  * **Enhancement:** The CSS stylesheet has been enhanced for more flexibility
407
  in sizing icons.
408
 
409
+ ## 1.1
 
410
  * **New Feature:** Included option to link to the attachment page as well as
411
  to the actual document.
412
  * **Enhancement:** Added documentation for customizing the appearance of the plugin.
413
  * **Enhancement:** Many improvements to the backend, including pretty HTML output
414
  and best practice implementation in calls to WordPress core functions.
415
 
416
+ ## 1.0.4
 
417
  * **Bug Fix:** Removed extra `div` at bottom when number of documents is
418
  evenly divisible by 4. (Thanks, joero4ri!)
419
 
420
+ ## 1.0.3
 
421
  * **Bug Fix:** Resolved issue with detecting plugin directory. (Thanks,
422
  Brigitte!)
423
  * **Enhancement:** Minor improvement to how linking to individual
424
  documents is handled.
425
 
426
+ ## 1.0.2
 
427
  * **Bug Fix:** Merge for changes in 1.0 did not go through correctly so users
428
  downloaded the old icon set which broke the plugin. Sorry about that, but
429
  all is resolved with this release!
430
 
431
+ ## 1.0.1
 
432
  * **Bug Fix:** Resolved issue with long document titles being cut off in some themes.
433
 
434
+ ## 1.0
 
435
  * **New Feature:** Plugin now has **36 icons** representing **72 filetypes**!
436
  * **Enhancement:** Optimized gallery generation (faster!)
437
  * **Enhancement:** Added fallback to WordPress default icons if you happen to
440
  work for backward compatibility).
441
  * **Enhancement:** Gave documentation some **much needed** revisions.
442
 
443
+ ## 0.8.5
 
444
  * **Enhancement:** Added support for
445
  [OpenDocuments](http://en.wikipedia.org/wiki/OpenDocument).
446
 
447
+ ## 0.8
 
448
  * **Release:** First public release of Document Gallery.
449
  * **Feature:** Displays PDF, Word, PowerPoint, Excel, and ZIP documents from a
450
  given page or post.
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.6
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.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.6 =
426
  * **Enhancement:** Added warning to plugins page when a PHP version < 5.3 is being used.
427
  * **Bug Fix:** Resolves a "class not found" error.
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.7
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.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.7 =
426
+ * **Bug Fix:** There was a minor issue on some admin pages that has been resolved.
427
+
428
  = 4.1.6 =
429
  * **Enhancement:** Added warning to plugins page when a PHP version < 5.3 is being used.
430
  * **Bug Fix:** Resolves a "class not found" error.
admin/class-admin.php CHANGED
@@ -329,6 +329,11 @@ class DG_Admin {
329
  * @param $post WP_Post The post.
330
  */
331
  public static function renderMetaBox( $post ) {
 
 
 
 
 
332
  wp_nonce_field( DG_OPTION_NAME . '_meta_box', DG_OPTION_NAME . '_meta_box_nonce' );
333
  $ID = $post->ID;
334
  $options = DG_Thumber::getOptions();
329
  * @param $post WP_Post The post.
330
  */
331
  public static function renderMetaBox( $post ) {
332
+ // Disabling scripts that have nothing to do with Edit Media pages
333
+ wp_dequeue_script( 'dg-media-manager' );
334
+ remove_filter( 'mce_external_plugins', array( __CLASS__, 'mce_external_plugins' ) );
335
+ remove_filter( 'mce_css', array( __CLASS__, 'dg_plugin_mce_css' ) );
336
+
337
  wp_nonce_field( DG_OPTION_NAME . '_meta_box', DG_OPTION_NAME . '_meta_box_nonce' );
338
  $ID = $post->ID;
339
  $options = DG_Thumber::getOptions();
assets/js/media_manager.js CHANGED
@@ -7,6 +7,9 @@
7
  *
8
  */
9
  ( function ($, _) {
 
 
 
10
  var l10n,
11
  media = wp.media;
12
 
@@ -487,70 +490,73 @@
487
  });
488
  }(jQuery, _));
489
 
490
- // Based on code from /wp-includes/js/mce-view.js WP 4.2
491
- /*
492
- * The WordPress core TinyMCE views.
493
- * View for the dg shortcode.
494
- */
495
- (function (window, views, media, $) {
496
- var dg;
 
 
497
 
498
- base = {
499
- state: [],
500
 
501
- edit: function (text, update) {
502
- // currently the shortcode *must* include ids attribute and may include any of the listed attributes to be editable
503
- if ( text.search( /\sids\s*=/gi ) == -1 || text.search( /\s(?!(?:ids|attachment_pg|columns|new_window|descriptions|fancy|orderby|order|paginate|limit)\s*=)[\w\-]+\s*=/gi ) > -1 ) {
504
- tinyMCE.activeEditor.windowManager.alert( DGl10n.unfitSCalert );
505
- } else {
506
- var type = this.type,
507
- frame = media[type].edit(text.replace(/\sorder\s*=/ig, ' dgorder=').replace(/\sorderby\s*=/ig, ' dgorderby='));
508
 
509
- this.pausePlayers && this.pausePlayers();
510
 
511
- _.each(this.state, function (state) {
512
- frame.state(state).on('update', function (selection) {
513
- update(media[type].shortcode(selection).string(), type === 'dg');
 
514
  });
515
- });
516
 
517
- frame.on('close', function () {
518
- frame.detach();
519
- });
520
 
521
- frame.open();
 
522
  }
523
- }
524
- };
525
 
526
- dg = _.extend({}, base, {
527
- state: ['dg-edit'],
528
- template: media.template('editor-dg'),
529
 
530
- initialize: function () {
531
- var attachments = media.dg.attachments(this.shortcode, media.view.settings.post.id),
532
- attrs = this.shortcode.attrs.named,
533
- sc = this.text,
534
- atts = {},
535
- self = this;
536
-
537
- for (prop in attrs) {
538
- if (sc.indexOf(' ' + prop + '=') > -1) {
539
- atts[prop] = attrs[prop];
 
540
  }
 
 
 
 
 
 
 
 
 
541
  }
542
- if (sc.indexOf(' dgorderby=') > -1) {
543
- atts['orderby'] = attrs['dgorderby'];
544
- }
545
- if (sc.indexOf(' dgorder=') > -1) {
546
- atts['order'] = attrs['dgorder'];
547
- }
548
- self.render('<div data-shortcode="' +
549
- encodeURIComponent(JSON.stringify(atts)) +
550
- '"><div class="loading-placeholder"><div class="dashicons dashicons-admin-media"></div><div class="wpview-loading"><ins></ins></div></div></div>');
551
- }
552
- });
553
 
554
- views.register('dg', _.extend({}, dg));
555
 
556
- })(window, window.wp.mce.views, window.wp.media, window.jQuery);
 
7
  *
8
  */
9
  ( function ($, _) {
10
+ // Check if environment is suitable for the code to be executed
11
+ if ( typeof wp.media.collection !== 'function' ) return;
12
+
13
  var l10n,
14
  media = wp.media;
15
 
490
  });
491
  }(jQuery, _));
492
 
493
+ // Check if environment is suitable for the code to be executed
494
+ if ( typeof window.wp.mce !== 'undefined' && typeof window.wp.mce.views !== 'undefined' ) {
495
+ // Based on code from /wp-includes/js/mce-view.js WP 4.2
496
+ /*
497
+ * The WordPress core TinyMCE views.
498
+ * View for the dg shortcode.
499
+ */
500
+ (function (window, views, media, $) {
501
+ var dg;
502
 
503
+ base = {
504
+ state: [],
505
 
506
+ edit: function (text, update) {
507
+ // currently the shortcode *must* include ids attribute and may include any of the listed attributes to be editable
508
+ if (text.search(/\sids\s*=/gi) == -1 || text.search(/\s(?!(?:ids|attachment_pg|columns|new_window|descriptions|fancy|orderby|order|paginate|limit)\s*=)[\w\-]+\s*=/gi) > -1) {
509
+ tinyMCE.activeEditor.windowManager.alert(DGl10n.unfitSCalert);
510
+ } else {
511
+ var type = this.type,
512
+ frame = media[type].edit(text.replace(/\sorder\s*=/ig, ' dgorder=').replace(/\sorderby\s*=/ig, ' dgorderby='));
513
 
514
+ this.pausePlayers && this.pausePlayers();
515
 
516
+ _.each(this.state, function (state) {
517
+ frame.state(state).on('update', function (selection) {
518
+ update(media[type].shortcode(selection).string(), type === 'dg');
519
+ });
520
  });
 
521
 
522
+ frame.on('close', function () {
523
+ frame.detach();
524
+ });
525
 
526
+ frame.open();
527
+ }
528
  }
529
+ };
 
530
 
531
+ dg = _.extend({}, base, {
532
+ state: ['dg-edit'],
533
+ template: media.template('editor-dg'),
534
 
535
+ initialize: function () {
536
+ var attachments = media.dg.attachments(this.shortcode, media.view.settings.post.id),
537
+ attrs = this.shortcode.attrs.named,
538
+ sc = this.text,
539
+ atts = {},
540
+ self = this;
541
+
542
+ for (prop in attrs) {
543
+ if (sc.indexOf(' ' + prop + '=') > -1) {
544
+ atts[prop] = attrs[prop];
545
+ }
546
  }
547
+ if (sc.indexOf(' dgorderby=') > -1) {
548
+ atts['orderby'] = attrs['dgorderby'];
549
+ }
550
+ if (sc.indexOf(' dgorder=') > -1) {
551
+ atts['order'] = attrs['dgorder'];
552
+ }
553
+ self.render('<div data-shortcode="' +
554
+ encodeURIComponent(JSON.stringify(atts)) +
555
+ '"><div class="loading-placeholder"><div class="dashicons dashicons-admin-media"></div><div class="wpview-loading"><ins></ins></div></div></div>');
556
  }
557
+ });
 
 
 
 
 
 
 
 
 
 
558
 
559
+ views.register('dg', _.extend({}, dg));
560
 
561
+ })(window, window.wp.mce.views, window.wp.media, window.jQuery);
562
+ }
assets/js/media_manager.min.js CHANGED
@@ -1,15 +1,15 @@
1
- (function(h,g){var d,a=wp.media;d=a.view.l10n="undefined"===typeof _wpMediaViewsL10n?{}:_wpMediaViewsL10n;jQuery.extend(d,DGl10n);a.controller.dgEdit=a.controller.Library.extend({defaults:{id:"dg-edit",title:d.editdgTitle,multiple:!1,searchable:!1,sortable:!0,display:!1,content:"browse",toolbar:"dg-edit",describe:!0,displaySettings:!0,dragInfo:!0,idealColumnWidth:170,editing:!1,priority:60,syncSelection:!1},initialize:function(){this.get("library")||this.set("library",new a.model.Selection);this.get("AttachmentView")||
2
- this.set("AttachmentView",a.view.Attachment.EditLibrary);a.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){this.get("library");this.get("library").observe(wp.Uploader.queue);this.frame.on("content:render:browse",this.dgSettings,this);a.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue);this.frame.off("content:render:browse",this.dgSettings,this);a.controller.Library.prototype.deactivate.apply(this,
3
- arguments)},dgSettings:function(b){if(this.get("displaySettings")){var c=this.get("library");c&&b&&(c.dg=c.dg||new Backbone.Model,b.sidebar.set({dg:new a.view.Settings.dg({controller:this,model:c.dg,priority:40})}),b.toolbar.set("reverse",{text:d.reverseOrder,priority:80,click:function(){c.reset(c.toArray().reverse())}}))}}});a.controller.dgAdd=a.controller.Library.extend({defaults:g.defaults({id:"dg-library",title:d.addTodgTitle,multiple:"add",filterable:"uploaded",menu:"dg",toolbar:"dg-add",priority:100,
4
- syncSelection:!1},a.controller.Library.prototype.defaults),initialize:function(){this.get("library")||this.set("library",a.query());a.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var b=this.get("library"),c=this.frame.state("dg-edit").get("library");this.editLibrary&&this.editLibrary!==c&&b.unobserve(this.editLibrary);b.validator=function(b){return!!this.mirroring.get(b.cid)&&!c.get(b.cid)&&a.model.Selection.prototype.validator.apply(this,arguments)};b.reset(b.mirroring.models,
5
- {silent:!0});b.observe(c);this.editLibrary=c;a.controller.Library.prototype.activate.apply(this,arguments)}});a.view.Settings.dg=a.view.Settings.extend({update:function(b){var c=this.model.get(b),a=this.$('[data-setting="'+b+'"]');a.length&&(a.is("select")?(c=a.find('[value="'+c+'"]'),c.length?(a.find("option").prop("selected",!1),c.prop("selected",!0)):this.model.set(b,a.find(":selected").val())):a.hasClass("button-group")?(b=a.find("button").removeClass("active"),b.filter('[value="'+c+'"]').addClass("active")):
6
- a.is('input[type="text"], input[type="number"], textarea')?a.is(":focus")||a.val(c):a.is('input[type="checkbox"]')&&a.prop("checked",!!c&&"false"!==c))},className:"collection-settings dg-settings",template:a.template("dg-settings")});var e=wp.media.view.MediaFrame.Post;wp.media.view.MediaFrame.Post=e.extend({initialize:function(){e.prototype.initialize.apply(this,arguments);this.states.add([new a.controller.Library({id:"dg",title:d.dgMenuTitle,priority:50,toolbar:"main-dg",filterable:"all",multiple:"add",
7
- editable:!1,library:a.query(this.options.library)}),new a.controller.dgEdit({library:this.options.selection,editing:this.options.editing,menu:"dg"}),new a.controller.dgAdd]);this.on("menu:create:dg",this.createMenu,this);this.on("toolbar:create:main-dg",this.createToolbar,this);this.on("menu:render:dg",this.dgMenu,this);this.on("toolbar:render:main-dg",this.maindgToolbar,this);this.on("toolbar:render:dg-edit",this.dgEditToolbar,this);this.on("toolbar:render:dg-add",this.dgAddToolbar,this)},dgMenu:function(b){var c=
8
- this.lastState(),f=c&&c.id,e=this;b.set({cancel:{text:d.canceldgTitle,priority:20,click:function(){f?e.setState(f):e.close();this.controller.modal.focusManager.focus()}},separateCancel:new a.View({className:"separator",priority:40})})},maindgToolbar:function(b){var c=this;this.selectionStatusToolbar(b);b.set("dg",{style:"primary",text:d.dgButton,priority:60,requires:{selection:!0},click:function(){var b=c.state().get("selection");c.state("dg-edit").set("library",new a.model.Selection(b.models,{props:b.props.toJSON(),
9
- multiple:!0}));this.controller.setState("dg-edit");this.controller.modal.focusManager.focus()}})},dgEditToolbar:function(){var b=this.state().get("editing");this.toolbar.set(new a.view.Toolbar({controller:this,items:{insert:{style:"primary",text:b?d.updatedg:d.insertdg,priority:80,requires:{library:!0},click:function(){var c=this.controller,b=c.state();c.close();wp.media.editor.insert(wp.media.dg.shortcode(b.get("library")).string().replace(/\sdgorder=/ig," order=").replace(/\sdgorderby=/ig," orderby="));
10
- c.setState(c.options.state);c.reset();"undefined"!=typeof tinyMCE&&tinyMCE.activeEditor.fire("dgUpdate")}}}}))},dgAddToolbar:function(){this.toolbar.set(new a.view.Toolbar({controller:this,items:{insert:{style:"primary",text:d.addTodg,priority:80,requires:{selection:!0},click:function(){var b=this.controller,c=b.state();b.state("dg-edit").get("library").add(c.get("selection").models);c.trigger("reset");b.setState("dg-edit")}}}}))}});wp.media._dgDefaults={id:wp.media.view.settings.post&&wp.media.view.settings.post.id,
11
- columns:dgDefaults.columns,fancy:dgDefaults.fancy,relation:dgDefaults.relation,limit:dgDefaults.limit,mime_types:dgDefaults.mime_types,post_status:dgDefaults.post_status,post_type:dgDefaults.post_type,attachment_pg:dgDefaults.attachment_pg,descriptions:dgDefaults.descriptions,new_window:dgDefaults.new_window,paginate:dgDefaults.paginate,dgorder:dgDefaults.order,dgorderby:dgDefaults.orderby};wp.media.dgDefaults=wp.media.view.settings.dgDefaults?g.extend({},wp.media._dgDefaults,wp.media.view.settings.dgDefaults):
12
- wp.media._dgDefaults;wp.media.dg=new wp.media.collection({tag:"dg",editTitle:wp.media.view.l10n.editdgTitle,defaults:wp.media.dgDefaults,setDefaults:function(b){var c=this,a=!g.isEqual(wp.media.dgDefaults,wp.media._dgDefaults);g.each(this.defaults,function(d,e){b[e]=c.coerce(b,e);d!==b[e]||a&&d!==wp.media._dgDefaults[e]||delete b[e]});return b}})})(jQuery,_);
13
- (function(h,g,d,a){base={state:[],edit:function(a,b){if(-1==a.search(/\sids\s*=/gi)||-1<a.search(/\s(?!(?:ids|attachment_pg|columns|new_window|descriptions|fancy|orderby|order|paginate|limit)\s*=)[\w\-]+\s*=/gi))tinyMCE.activeEditor.windowManager.alert(DGl10n.unfitSCalert);else{var c=this.type,f=d[c].edit(a.replace(/\sorder\s*=/ig," dgorder=").replace(/\sorderby\s*=/ig," dgorderby="));this.pausePlayers&&this.pausePlayers();_.each(this.state,function(a){f.state(a).on("update",function(a){b(d[c].shortcode(a).string(),
14
- "dg"===c)})});f.on("close",function(){f.detach()});f.open()}}};h=_.extend({},base,{state:["dg-edit"],template:d.template("editor-dg"),initialize:function(){d.dg.attachments(this.shortcode,d.view.settings.post.id);var a=this.shortcode.attrs.named,b=this.text,c={};for(prop in a)-1<b.indexOf(" "+prop+"=")&&(c[prop]=a[prop]);-1<b.indexOf(" dgorderby=")&&(c.orderby=a.dgorderby);-1<b.indexOf(" dgorder=")&&(c.order=a.dgorder);this.render('<div data-shortcode="'+encodeURIComponent(JSON.stringify(c))+'"><div class="loading-placeholder"><div class="dashicons dashicons-admin-media"></div><div class="wpview-loading"><ins></ins></div></div></div>')}});
15
- g.register("dg",_.extend({},h))})(window,window.wp.mce.views,window.wp.media,window.jQuery);
1
+ (function(h,g){if("function"===typeof wp.media.collection){var d,a=wp.media;d=a.view.l10n="undefined"===typeof _wpMediaViewsL10n?{}:_wpMediaViewsL10n;jQuery.extend(d,DGl10n);a.controller.dgEdit=a.controller.Library.extend({defaults:{id:"dg-edit",title:d.editdgTitle,multiple:!1,searchable:!1,sortable:!0,display:!1,content:"browse",toolbar:"dg-edit",describe:!0,displaySettings:!0,dragInfo:!0,idealColumnWidth:170,editing:!1,priority:60,syncSelection:!1},initialize:function(){this.get("library")||this.set("library",
2
+ new a.model.Selection);this.get("AttachmentView")||this.set("AttachmentView",a.view.Attachment.EditLibrary);a.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){this.get("library");this.get("library").observe(wp.Uploader.queue);this.frame.on("content:render:browse",this.dgSettings,this);a.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue);this.frame.off("content:render:browse",this.dgSettings,
3
+ this);a.controller.Library.prototype.deactivate.apply(this,arguments)},dgSettings:function(b){if(this.get("displaySettings")){var c=this.get("library");c&&b&&(c.dg=c.dg||new Backbone.Model,b.sidebar.set({dg:new a.view.Settings.dg({controller:this,model:c.dg,priority:40})}),b.toolbar.set("reverse",{text:d.reverseOrder,priority:80,click:function(){c.reset(c.toArray().reverse())}}))}}});a.controller.dgAdd=a.controller.Library.extend({defaults:g.defaults({id:"dg-library",title:d.addTodgTitle,multiple:"add",
4
+ filterable:"uploaded",menu:"dg",toolbar:"dg-add",priority:100,syncSelection:!1},a.controller.Library.prototype.defaults),initialize:function(){this.get("library")||this.set("library",a.query());a.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var b=this.get("library"),c=this.frame.state("dg-edit").get("library");this.editLibrary&&this.editLibrary!==c&&b.unobserve(this.editLibrary);b.validator=function(b){return!!this.mirroring.get(b.cid)&&!c.get(b.cid)&&a.model.Selection.prototype.validator.apply(this,
5
+ arguments)};b.reset(b.mirroring.models,{silent:!0});b.observe(c);this.editLibrary=c;a.controller.Library.prototype.activate.apply(this,arguments)}});a.view.Settings.dg=a.view.Settings.extend({update:function(b){var c=this.model.get(b),a=this.$('[data-setting="'+b+'"]');a.length&&(a.is("select")?(c=a.find('[value="'+c+'"]'),c.length?(a.find("option").prop("selected",!1),c.prop("selected",!0)):this.model.set(b,a.find(":selected").val())):a.hasClass("button-group")?(b=a.find("button").removeClass("active"),
6
+ b.filter('[value="'+c+'"]').addClass("active")):a.is('input[type="text"], input[type="number"], textarea')?a.is(":focus")||a.val(c):a.is('input[type="checkbox"]')&&a.prop("checked",!!c&&"false"!==c))},className:"collection-settings dg-settings",template:a.template("dg-settings")});var e=wp.media.view.MediaFrame.Post;wp.media.view.MediaFrame.Post=e.extend({initialize:function(){e.prototype.initialize.apply(this,arguments);this.states.add([new a.controller.Library({id:"dg",title:d.dgMenuTitle,priority:50,
7
+ toolbar:"main-dg",filterable:"all",multiple:"add",editable:!1,library:a.query(this.options.library)}),new a.controller.dgEdit({library:this.options.selection,editing:this.options.editing,menu:"dg"}),new a.controller.dgAdd]);this.on("menu:create:dg",this.createMenu,this);this.on("toolbar:create:main-dg",this.createToolbar,this);this.on("menu:render:dg",this.dgMenu,this);this.on("toolbar:render:main-dg",this.maindgToolbar,this);this.on("toolbar:render:dg-edit",this.dgEditToolbar,this);this.on("toolbar:render:dg-add",
8
+ this.dgAddToolbar,this)},dgMenu:function(b){var c=this.lastState(),f=c&&c.id,e=this;b.set({cancel:{text:d.canceldgTitle,priority:20,click:function(){f?e.setState(f):e.close();this.controller.modal.focusManager.focus()}},separateCancel:new a.View({className:"separator",priority:40})})},maindgToolbar:function(b){var c=this;this.selectionStatusToolbar(b);b.set("dg",{style:"primary",text:d.dgButton,priority:60,requires:{selection:!0},click:function(){var b=c.state().get("selection");c.state("dg-edit").set("library",
9
+ new a.model.Selection(b.models,{props:b.props.toJSON(),multiple:!0}));this.controller.setState("dg-edit");this.controller.modal.focusManager.focus()}})},dgEditToolbar:function(){var b=this.state().get("editing");this.toolbar.set(new a.view.Toolbar({controller:this,items:{insert:{style:"primary",text:b?d.updatedg:d.insertdg,priority:80,requires:{library:!0},click:function(){var c=this.controller,b=c.state();c.close();wp.media.editor.insert(wp.media.dg.shortcode(b.get("library")).string().replace(/\sdgorder=/ig,
10
+ " order=").replace(/\sdgorderby=/ig," orderby="));c.setState(c.options.state);c.reset();"undefined"!=typeof tinyMCE&&tinyMCE.activeEditor.fire("dgUpdate")}}}}))},dgAddToolbar:function(){this.toolbar.set(new a.view.Toolbar({controller:this,items:{insert:{style:"primary",text:d.addTodg,priority:80,requires:{selection:!0},click:function(){var b=this.controller,c=b.state();b.state("dg-edit").get("library").add(c.get("selection").models);c.trigger("reset");b.setState("dg-edit")}}}}))}});wp.media._dgDefaults=
11
+ {id:wp.media.view.settings.post&&wp.media.view.settings.post.id,columns:dgDefaults.columns,fancy:dgDefaults.fancy,relation:dgDefaults.relation,limit:dgDefaults.limit,mime_types:dgDefaults.mime_types,post_status:dgDefaults.post_status,post_type:dgDefaults.post_type,attachment_pg:dgDefaults.attachment_pg,descriptions:dgDefaults.descriptions,new_window:dgDefaults.new_window,paginate:dgDefaults.paginate,dgorder:dgDefaults.order,dgorderby:dgDefaults.orderby};wp.media.dgDefaults=wp.media.view.settings.dgDefaults?
12
+ g.extend({},wp.media._dgDefaults,wp.media.view.settings.dgDefaults):wp.media._dgDefaults;wp.media.dg=new wp.media.collection({tag:"dg",editTitle:wp.media.view.l10n.editdgTitle,defaults:wp.media.dgDefaults,setDefaults:function(b){var c=this,a=!g.isEqual(wp.media.dgDefaults,wp.media._dgDefaults);g.each(this.defaults,function(d,e){b[e]=c.coerce(b,e);d!==b[e]||a&&d!==wp.media._dgDefaults[e]||delete b[e]});return b}})}})(jQuery,_);
13
+ "undefined"!==typeof window.wp.mce&&"undefined"!==typeof window.wp.mce.views&&function(h,g,d,a){base={state:[],edit:function(a,b){if(-1==a.search(/\sids\s*=/gi)||-1<a.search(/\s(?!(?:ids|attachment_pg|columns|new_window|descriptions|fancy|orderby|order|paginate|limit)\s*=)[\w\-]+\s*=/gi))tinyMCE.activeEditor.windowManager.alert(DGl10n.unfitSCalert);else{var c=this.type,f=d[c].edit(a.replace(/\sorder\s*=/ig," dgorder=").replace(/\sorderby\s*=/ig," dgorderby="));this.pausePlayers&&this.pausePlayers();
14
+ _.each(this.state,function(a){f.state(a).on("update",function(a){b(d[c].shortcode(a).string(),"dg"===c)})});f.on("close",function(){f.detach()});f.open()}}};h=_.extend({},base,{state:["dg-edit"],template:d.template("editor-dg"),initialize:function(){d.dg.attachments(this.shortcode,d.view.settings.post.id);var a=this.shortcode.attrs.named,b=this.text,c={};for(prop in a)-1<b.indexOf(" "+prop+"=")&&(c[prop]=a[prop]);-1<b.indexOf(" dgorderby=")&&(c.orderby=a.dgorderby);-1<b.indexOf(" dgorder=")&&(c.order=
15
+ a.dgorder);this.render('<div data-shortcode="'+encodeURIComponent(JSON.stringify(c))+'"><div class="loading-placeholder"><div class="dashicons dashicons-admin-media"></div><div class="wpview-loading"><ins></ins></div></div></div>')}});g.register("dg",_.extend({},h))}(window,window.wp.mce.views,window.wp.media,window.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.6
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.6' );
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.7
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.7' );
16
 
17
  if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
18
  add_action( 'admin_notices', 'dg_php_lt_three' );