Simple Image Sizes - Version 3.2.1

Version Description

Download this release

Release Info

Developer Rahe
Plugin Icon wp plugin Simple Image Sizes
Version 3.2.1
Comparing to
See all releases

Code changes from version v2.3.1 to 3.2.1

Files changed (59) hide show
  1. README +0 -0
  2. assets/css/sis-style.css +78 -0
  3. assets/css/sis-style.min.css +1 -0
  4. assets/js/dist/app.js +840 -0
  5. assets/js/dist/app.js.map +12 -0
  6. assets/js/dist/app.min.js +7 -0
  7. assets/js/dist/app.min.js.map +12 -0
  8. assets/js/src/attachments.js +118 -0
  9. assets/js/src/featured.js +76 -0
  10. assets/js/src/sis.js +641 -0
  11. classes/Main.php +58 -0
  12. classes/admin/Main.php +335 -0
  13. classes/admin/Media.php +570 -0
  14. classes/admin/Post.php +271 -0
  15. css/Aristo/images/bg_fallback.png +0 -0
  16. css/Aristo/images/icon_sprite.png +0 -0
  17. css/Aristo/images/progress_bar.gif +0 -0
  18. css/Aristo/images/slider_handles.png +0 -0
  19. css/Aristo/images/ui-icons_222222_256x240.png +0 -0
  20. css/Aristo/images/ui-icons_454545_256x240.png +0 -0
  21. css/Aristo/jquery-ui-1.8.7.custom.css +0 -740
  22. css/sis-style.css +0 -70
  23. inc/class.admin.php +0 -914
  24. inc/class.client.php +0 -36
  25. js/jquery-ui-1.8.16.custom.min.js +0 -77
  26. js/sis-attachments.js +0 -100
  27. js/sis-attachments.min.js +0 -3
  28. js/sis.js +0 -700
  29. js/sis.min.js +0 -25
  30. languages/simple-image-sizes-de_DE.mo +0 -0
  31. languages/simple-image-sizes-de_DE.po +367 -0
  32. languages/simple-image-sizes-fr_FR.mo +0 -0
  33. languages/simple-image-sizes-fr_FR.po +324 -0
  34. languages/simple-image-sizes-he_IL.mo +0 -0
  35. languages/simple-image-sizes-he_IL.po +471 -0
  36. languages/simple-image-sizes.pot +274 -0
  37. languages/sis-de_DE.mo +0 -0
  38. languages/sis-de_DE.po +0 -373
  39. languages/sis-fr_FR.mo +0 -0
  40. languages/sis-fr_FR.po +0 -263
  41. languages/sis.pot +0 -254
  42. readme.md +224 -0
  43. readme.txt +77 -5
  44. screenshot-1.png +0 -0
  45. screenshot-2.png +0 -0
  46. screenshot-3.png +0 -0
  47. screenshot-4.png +0 -0
  48. simple_image_sizes.php +24 -22
  49. templates/admin-js.html +53 -0
  50. templates/options-media.php +153 -0
  51. vendor/autoload.php +7 -0
  52. vendor/composer/ClassLoader.php +445 -0
  53. vendor/composer/LICENSE +21 -0
  54. vendor/composer/autoload_classmap.php +13 -0
  55. vendor/composer/autoload_namespaces.php +9 -0
  56. vendor/composer/autoload_psr4.php +10 -0
  57. vendor/composer/autoload_real.php +52 -0
  58. vendor/composer/autoload_static.php +39 -0
  59. vendor/composer/installed.json +1 -0
README DELETED
File without changes
assets/css/sis-style.css ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .media-item.sis {
2
+ display: none;
3
+ }
4
+
5
+ .media-item.sis .progress {
6
+ width: 100%;
7
+ }
8
+
9
+ input.h, input.w {
10
+ border-color: #DFDFDF;
11
+ background-color: white;
12
+ border-width: 1px;
13
+ border-style: solid;
14
+ -moz-border-radius: 3px;
15
+ -khtml-border-radius: 3px;
16
+ -webkit-border-radius: 3px;
17
+ border-radius: 3px;
18
+ }
19
+
20
+ table.sis tr {
21
+ -webkit-transition: all .5s ease-in-out;
22
+ -moz-transition: all .5s ease-in-out;
23
+ -o-transition: all .5s ease-in-out;
24
+ transition: all .5s ease-in-out;
25
+ }
26
+
27
+ table.sis tr:nth-child(even) {
28
+ background-color: #FCFCFC;
29
+ }
30
+
31
+ table.sis tr:nth-child(odd) {
32
+ background-color: transparent;
33
+ }
34
+
35
+ tr.addPending {
36
+ background-color: #6CA1D7;
37
+ }
38
+
39
+ tr.successAdding {
40
+ background-color: #89D76A;
41
+ }
42
+
43
+ tr.errorAdding {
44
+ background-color: #C45858;
45
+ }
46
+
47
+ tr.notChangedAdding {
48
+ background-color: #F2A13A;
49
+ }
50
+
51
+ .sis .regenerate_message,
52
+ .sis .time,
53
+ .sis .thumb {
54
+ display: none;
55
+ }
56
+
57
+ #ajax_thumbnail_rebuild {
58
+ margin-top: 40px;
59
+ }
60
+
61
+ #sis_progress-percent {
62
+ width: 100%;
63
+ text-align: center;
64
+ font-weight: bold;
65
+ }
66
+
67
+ .sis .time .ui-state-highlight {
68
+ margin-top: 20px;
69
+ padding: 0 .7em;
70
+ }
71
+
72
+ #post-body .sis-regenerate-one {
73
+ float: left;
74
+ }
75
+
76
+ #sis_get_php {
77
+ user-select: all;
78
+ }
assets/css/sis-style.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .media-item.sis,.sis .regenerate_message,.sis .thumb,.sis .time{display:none}.media-item.sis .progress{width:100%}input.h,input.w{border-color:#DFDFDF;background-color:#fff;border-width:1px;border-style:solid;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}table.sis tr{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}table.sis tr:nth-child(even){background-color:#FCFCFC}table.sis tr:nth-child(odd){background-color:transparent}tr.addPending{background-color:#6CA1D7}tr.successAdding{background-color:#89D76A}tr.errorAdding{background-color:#C45858}tr.notChangedAdding{background-color:#F2A13A}#ajax_thumbnail_rebuild{margin-top:40px}#sis_progress-percent{width:100%;text-align:center;font-weight:700}.sis .time .ui-state-highlight{margin-top:20px;padding:0 .7em}#post-body .sis-regenerate-one{float:left}#sis_get_php{user-select:all}
assets/js/dist/app.js ADDED
@@ -0,0 +1,840 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Functions for the regenerating of images
2
+ var rahe;
3
+ if (!rahe) {
4
+ rahe = {};
5
+ } else if (typeof rahe !== "object") {
6
+ throw new Error('rahe already exists and not an object');
7
+ }
8
+
9
+ if (!rahe.sis) {
10
+ rahe.sis = {};
11
+ } else if (typeof rahe.sis !== "object") {
12
+ throw new Error('rahe.sis already exists and not an object');
13
+ }
14
+
15
+ rahe.sis.regenerate = {
16
+ post_types: [],
17
+ thumbnails: [],
18
+ total: 0,
19
+ cur: 0,
20
+ timeScript: [],
21
+ dateScript: '',
22
+ percent: '',
23
+ percentText: null,
24
+ progress: null,
25
+ messageZone: null,
26
+ sisZone: null,
27
+ time: null,
28
+ timeZone: null,
29
+ buttonRegenerate: null,
30
+ errorZone: null,
31
+ errorMessages: null,
32
+ thumb: null,
33
+ thumbImg: null,
34
+ init: function () {
35
+ this.sisZone = jQuery('.sis');
36
+ this.percentText = jQuery('#sis_progress-percent');
37
+ this.progress = jQuery('.progress');
38
+ this.messageZone = this.sisZone.find(".regenerate_message");
39
+ this.time = this.sisZone.find(".time");
40
+ this.timeZone = this.time.find("p span.time_message");
41
+ this.buttonRegenerate = jQuery("#ajax_thumbnail_rebuild");
42
+ this.errorZone = jQuery('#error_messages');
43
+ this.errorMessages = this.errorZone.find('ul.messages');
44
+ this.thumb = this.sisZone.find('.thumb');
45
+ this.thumbImg = this.sisZone.find('.thumb-img');
46
+ },
47
+ getThumbnails: function () {
48
+ var self = this,
49
+ inputs = jQuery('input.thumbnails:checked');
50
+
51
+ // Get the checked thumbnails inputs
52
+ if (inputs.length != jQuery('input.thumbnails[type="checkbox"]').length) {
53
+ inputs.each(
54
+ function (i) {
55
+ self.thumbnails.push(this.value);
56
+ }
57
+ );
58
+ }
59
+ },
60
+ getPostTypes: function () {
61
+ var self = this,
62
+ inputs = jQuery('input.post_types:checked');
63
+
64
+ // Get the checked post Types inputs
65
+ if (inputs.length != jQuery('input.post_types[type="checkbox"]').length) {
66
+ inputs.each(
67
+ function () {
68
+ self.post_types.push(this.value);
69
+ }
70
+ );
71
+ }
72
+ },
73
+ setMessage: function (msg) {
74
+ // Display the message
75
+ this.messageZone.html("<p>" + msg + "</p>").addClass('updated').addClass('fade').show();
76
+ },
77
+ setTimeMessage: function (msg) {
78
+ this.timeZone.html(msg);
79
+ },
80
+ checkStartRegenerating: function () {
81
+ if (jQuery('.notSaved').size() > 0) {
82
+ var confirmation = confirm(sis.notSaved);
83
+
84
+ // Delete if ok else not delete
85
+ if (confirmation == true) {
86
+ this.startRegenerating();
87
+ } else {
88
+ return false;
89
+ }
90
+ } else {
91
+ this.startRegenerating();
92
+ }
93
+ },
94
+ startRegenerating: function () {
95
+ var self = this,
96
+ wp_nonce = jQuery('input.getList').val();
97
+
98
+ // Get the humbnails and post types
99
+ self.getThumbnails();
100
+ self.getPostTypes();
101
+
102
+ this.dateScript = new Date();
103
+ // Start ajax
104
+ jQuery.ajax(
105
+ {
106
+ url: ajaxurl,
107
+ type: "POST",
108
+ dataType: 'json',
109
+ data: {
110
+ action: 'sis_get_list',
111
+ post_types: self.post_types,
112
+ nonce: wp_nonce
113
+ },
114
+ beforeSend: function () {
115
+
116
+ // Disable the button
117
+ self.buttonRegenerate.attr("disabled", true);
118
+ // Display the message
119
+ self.setMessage(sis.reading);
120
+
121
+ },
122
+ success: function (r) {
123
+
124
+ if (typeof r !== 'object') {
125
+ self.reInit();
126
+ self.setMessage(sis.phpError);
127
+ return false;
128
+ }
129
+
130
+ self.time.show();
131
+
132
+ // Eval the response
133
+ self.total = r.total;
134
+
135
+ // Set the current to 0
136
+ self.curr = 0;
137
+
138
+ // Display the progress Bar
139
+ self.progress.show().parent().show();
140
+
141
+ // Start Regenerating
142
+ self.regenItem();
143
+ }
144
+ }
145
+ );
146
+ },
147
+ regenItem: function () {
148
+ var self = this,
149
+ wp_nonce = jQuery('input.regen').val();
150
+
151
+ // If the list is empty display the message of emptyness and reinitialize the form
152
+ if (this.total == 0 || _.isUndefined(this.total)) {
153
+ this.reInit();
154
+ this.setMessage(sis.noMedia);
155
+ return false;
156
+ }
157
+
158
+ // If we have finished the regeneration display message and init again
159
+ if (this.curr >= this.total) {
160
+ var now = new Date();
161
+ this.reInit();
162
+ this.setMessage(sis.done + this.curr + ' ' + sis.messageRegenerated + sis.startedAt + ' ' + this.dateScript.getHours() + ":" + this.dateScript.getMinutes() + ":" + this.dateScript.getSeconds() + sis.finishedAt + ' ' + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds());
163
+ return;
164
+ }
165
+
166
+ // Set the message of current image regenerating
167
+ this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
168
+ this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
169
+
170
+ jQuery.ajax(
171
+ {
172
+ url: ajaxurl,
173
+ type: "POST",
174
+ dataType: 'json',
175
+ data: {
176
+ action: 'sis_rebuild_images',
177
+ offset: this.curr,
178
+ thumbnails: this.thumbnails,
179
+ nonce: wp_nonce
180
+ },
181
+ beforeSend: function () {
182
+ // Calculate the percentage of regeneration
183
+ self.percent = ( self.curr / self.total ) * 100;
184
+
185
+ // Change the progression
186
+ self.progress.find('.bar').width(self.percent + '%')
187
+ .find('.percent').html(self.percent + '%');
188
+
189
+ // Change the text of progression
190
+ self.percentText.removeClass('hidden').html(Math.round(self.percent) + "%");
191
+ },
192
+ success: function (r) {
193
+ // Check if error or a message in response
194
+ if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
195
+ var message = '';
196
+ if (typeof r !== 'object') {
197
+ message = sis.phpError;
198
+ } else {
199
+ message = r.error
200
+ }
201
+
202
+ self.errorZone.addClass('error message');
203
+ self.errorMessages.prepend('<li>' + message + '</li>');
204
+ } else {
205
+
206
+ // Append a message if needed
207
+ if (r.message) {
208
+ self.time.find('ul.messages').prepend('<li>' + r.message + '</li>');
209
+ }
210
+
211
+ // Display the image
212
+ self.thumb.show();
213
+
214
+ // Change his attribute
215
+ self.thumbImg.attr("src", r.src);
216
+
217
+ // Actual time
218
+ var dateEnd = new Date(),
219
+ curDate = new Date(),
220
+ num = 0,
221
+ sum = 0,
222
+ i = 0,
223
+ ave = 0,
224
+ time = '';
225
+
226
+ // Add the regenerating time to the array
227
+ self.timeScript.push(parseFloat(r.time.replace(',', '.'), 10));
228
+
229
+ // Get the number of elements in array
230
+ num = self.timeScript.length;
231
+
232
+ // Make the sum of the times
233
+ for (i; i < num; i++) {
234
+ sum += self.timeScript[i];
235
+ }
236
+
237
+ // Make the average value of the regenerating time
238
+ ave = sum / num;
239
+
240
+ // Round the value in miliseconds and add 25% or error
241
+ t = Math.round(( ( ave * self.total ) * 1000 ));
242
+
243
+ // Set the predicted time
244
+ dateEnd.setTime(self.dateScript.getTime() + t);
245
+
246
+ // Get the difference between the two dates
247
+ time = self.s2t(Math.abs(( dateEnd.getTime() - curDate.getTime() )) / 1000);
248
+
249
+ // Set the message in the notice box
250
+ self.setTimeMessage(dateEnd.getHours() + ":" + dateEnd.getMinutes() + ":" + dateEnd.getSeconds() + sis.or + time + sis.beforeEnd);
251
+ }
252
+
253
+ // Inscrease the counter and regene the next item
254
+ self.curr++;
255
+ self.regenItem();
256
+ }
257
+ }
258
+ );
259
+
260
+ },
261
+ s2t: function (secs) {
262
+ var secs = secs % 86400,
263
+ t = new Date(1970, 0, 1),
264
+ s = 0;
265
+
266
+ t.setSeconds(secs);
267
+ s = t.toTimeString().substr(0, 8);
268
+ if (secs > 86399) {
269
+ s = Math.floor(( t - Date.parse("1/1/70") ) / 3600000) + s.substr(2);
270
+ }
271
+ return s;
272
+ },
273
+ reInit: function () {
274
+ // Re initilize the form
275
+ this.buttonRegenerate.removeAttr("disabled");
276
+ this.thumb.hide();
277
+ this.progress.hide();
278
+ this.percentText.addClass('hidden');
279
+ }
280
+ };
281
+
282
+ rahe.sis.sizes = {
283
+ i: 0,
284
+ add: function (e, el) {
285
+ e.preventDefault();
286
+
287
+ // Create the template
288
+ var elTr = rahe.sis.template('new_size');
289
+ elTr = elTr(
290
+ {
291
+ size_id: this.i,
292
+ validate: sis.validate
293
+ }
294
+ );
295
+
296
+ // Add the form for editing
297
+ jQuery(el).closest('tr').before(elTr);
298
+
299
+ // Inscrease the identifier
300
+ this.i++;
301
+ },
302
+ register: function (e, el) {
303
+ // Stop propagation
304
+ e.preventDefault();
305
+
306
+ // Get name and id
307
+ var name = jQuery(el).closest('tr').children('th').find('input').val(),
308
+ id = jQuery(el).closest('tr').children('th').find('input').attr('id'),
309
+
310
+ // Get the number of elements with this name
311
+ checkPresent = jQuery(el).closest('tbody').find('input[value="' + name + '"]').length;
312
+
313
+ // Check if not basic size or already present, display message
314
+ if (name == 'thumbnail' || name == "medium" || name == "large") {
315
+ alert(sis.notOriginal);
316
+ return false;
317
+ } else if (checkPresent != 0) {
318
+ alert(sis.alreadyPresent);
319
+ return false;
320
+ }
321
+
322
+ var row = rahe.sis.template('new_size_row');
323
+
324
+ row = row(
325
+ {
326
+ size: sis.size,
327
+ size_name: name,
328
+ maximumWidth: sis.maximumWidth,
329
+ maximumHeight: sis.maximumHeight,
330
+ customName: sis.customName,
331
+ crop: sis.crop,
332
+ crop_positions: sis.crop_positions,
333
+ show: sis.show,
334
+ deleteImage: sis.deleteImage,
335
+ validateButton: sis.validateButton
336
+ }
337
+ );
338
+
339
+ // Add the row to the current list
340
+ jQuery('#' + id).closest('tr').html(row);
341
+ },
342
+ deleteSize: function (e, el) {
343
+ e.preventDefault();
344
+ // Check if user want to delete or not
345
+ var confirmation = confirm(sis.confirmDelete);
346
+
347
+ // Delete if ok else not delete
348
+ if (confirmation == true) {
349
+ // Remove from the list and the array
350
+ jQuery(el).closest('tr').remove();
351
+ this.ajaxUnregister(el);
352
+ }
353
+ },
354
+ getPhp: function (e, el) {
355
+ e.preventDefault();
356
+ // Get parent element
357
+ var parent = jQuery(el).closest('tr');
358
+
359
+ jQuery.ajax(
360
+ {
361
+ url: ajaxurl,
362
+ type: "POST",
363
+ data: {action: "sis_get_sizes"},
364
+ beforeSend: function () {
365
+ // Remove classes of status
366
+ parent.removeClass('addPending');
367
+ parent.addClass('addPending');
368
+ },
369
+ success: function (result) {
370
+ // Add the classes for the status
371
+ jQuery('#get_php').nextAll('code').html('<br />' + result).show().css({'display': 'block'});
372
+ parent.removeClass('addPending');
373
+ }
374
+ }
375
+ );
376
+ },
377
+ ajaxRegister: function (e, el) {
378
+ e.preventDefault();
379
+
380
+ // Get the vars
381
+ var self = this,
382
+ parentTable = jQuery(el).closest('table'),
383
+ timer,
384
+ wp_nonce = jQuery('.addSize').val(),
385
+ parent = jQuery(el).closest('tr'),
386
+ n = parent.find('input[name="image_name"]').val(),
387
+ c = parent.find('select.crop').val(),
388
+ s = parent.find('input.show').val(),
389
+ cn = parent.find('input.n').val(),
390
+ h = 0,
391
+ w = 0;
392
+ s = ( s == false || s == undefined ) ? false : true;
393
+ w = parseInt(parent.find('input.w').val());
394
+ h = parseInt(parent.find('input.h').val());
395
+
396
+ if (!parentTable.hasClass('ajaxing')) {
397
+ jQuery.ajax(
398
+ {
399
+ url: ajaxurl,
400
+ type: "POST",
401
+ dataType: 'json',
402
+ data: {
403
+ action: "sis_add_size",
404
+ width: w,
405
+ height: h,
406
+ crop: c,
407
+ name: n,
408
+ show: s,
409
+ customName: cn,
410
+ nonce: wp_nonce
411
+ },
412
+ beforeSend: function () {
413
+ // Remove status and set pending
414
+ parent.removeClass();
415
+ parent.addClass('addPending');
416
+ parentTable.addClass('ajaxing');
417
+ },
418
+ success: function (result) {
419
+ // Set basic class and remove pending
420
+ var classTr = '';
421
+ parent.removeClass();
422
+ parentTable.removeClass('ajaxing');
423
+
424
+ // Check the result for the different messages
425
+ if (result == 0) {
426
+ classTr = 'errorAdding';
427
+ } else if (result == 2) {
428
+ classTr = 'notChangedAdding';
429
+
430
+ // add/update to the array with the status class
431
+ self.addToArray(n, w, h, c, classTr);
432
+ } else {
433
+ classTr = 'successAdding';
434
+
435
+ // add/update to the array with the status class
436
+ self.addToArray(n, w, h, c, classTr);
437
+ }
438
+
439
+ // Add the new sizes values for checking of changed or not
440
+ parent.find('input.h').attr({base_h: h});
441
+ parent.find('input.w').attr({base_w: w});
442
+ parent.find('select.c').attr({base_c: c});
443
+ parent.find('input.s').attr({base_s: s});
444
+
445
+ // Add the generated class
446
+ parent.addClass(classTr);
447
+ parent.find('td').removeClass("notSaved");
448
+
449
+ // Change the button text
450
+ parent.find('.add_size').removeClass('validate_size').hide().children('.ui-button-text').text(sis.update);
451
+
452
+ clearTimeout(timer);
453
+ // Remove classes after 3 seconds
454
+ timer = setTimeout(
455
+ function () {
456
+ parent.removeClass('errorAdding notChangedAdding successAdding');
457
+ }, 2 * 1000
458
+ );
459
+ }
460
+ }
461
+ );
462
+ }
463
+ },
464
+ ajaxUnregister: function (el) {
465
+ // Get name and self object
466
+ var self = this,
467
+ n = jQuery(el).closest('tr').find('input[name="image_name"]').val(),
468
+ wp_nonce = jQuery(el).closest('tr').find('input.deleteSize').val();
469
+
470
+ // Make the ajax call
471
+ jQuery.ajax(
472
+ {
473
+ url: ajaxurl,
474
+ type: "POST",
475
+ data: {action: "sis_remove_size", name: n, nonce: wp_nonce},
476
+ success: function (result) {
477
+ self.removeFromArray(el);
478
+ }
479
+ }
480
+ );
481
+ },
482
+ addToArray: function (n, w, h, c, s) {
483
+ // Get the row for editing or updating
484
+ var testRow = jQuery('#sis-' + n),
485
+ newRow = '',
486
+ timer;
487
+
488
+ // Get the right newRow, updating or adding ?
489
+ if (testRow.length != 0) {
490
+ newRow = testRow.closest('tr');
491
+ } else {
492
+ newRow = jQuery('#sis-regen .wrapper > table#sis_sizes > tbody > tr:first').clone().attr('id', 'sis-' + n);
493
+ }
494
+
495
+ c = !_.isUndefined(sis.crop_positions[c]) ? sis.crop_positions[c] : sis.fl;
496
+
497
+ // Set the datas with the given datas
498
+ newRow.find('th > label').attr('for', n)
499
+ .end()
500
+ .find('input.thumbnails').val(n).attr('id', n)
501
+ .end()
502
+ .find('th:nth-child(2) > label').text(n)
503
+ .end()
504
+ .find('th:nth-child(3) > label').text(w + 'px')
505
+ .end()
506
+ .find('th:nth-child(4) > label').text(h + 'px')
507
+ .end()
508
+ .find('th:nth-child(5) > label').text(c);
509
+
510
+ // If new then add the row
511
+ if (testRow.length == 0) {
512
+ newRow.appendTo('#sis-regen .wrapper > table#sis_sizes > tbody');
513
+ }
514
+
515
+ // Remove the previous status classes and add the status class
516
+ newRow.removeClass('errorAdding notChangedAdding successAdding').addClass(s);
517
+
518
+ clearTimeout(timer);
519
+ // Remove the statuses classes
520
+ timer = setTimeout(
521
+ function () {
522
+ newRow.removeClass('errorAdding notChangedAdding successAdding');
523
+ }, 3 * 1000
524
+ );
525
+ },
526
+ removeFromArray: function (el) {
527
+ // get the name
528
+ var n = jQuery(el).closest('tr').find('input[name=image_name]').val();
529
+
530
+ // Remove the given name from the array
531
+ jQuery('#sis-' + n).remove();
532
+ },
533
+ displayChange: function (el) {
534
+ var el = jQuery(el),
535
+ parent = el.closest('tr');
536
+
537
+ // Check not new size
538
+ if (parent.hasClass('new_size')) {
539
+ return false;
540
+ }
541
+
542
+ var h_el = parent.find('input.h'),
543
+ w_el = parent.find('input.w'),
544
+ c_el = parent.find('select.c'),
545
+ s_el = parent.find('input.s'),
546
+ n_el = parent.find('input.n'),
547
+
548
+ h = h_el.val(),
549
+ w = w_el.val(),
550
+ c = c_el.val(),
551
+ s = s_el.val(),
552
+ n = n_el.val(),
553
+
554
+ base_h = h_el.attr('base_h'),
555
+ base_w = w_el.attr('base_w'),
556
+ base_c = c_el.attr('base_c'),
557
+ base_s = s_el.attr('base_s'),
558
+ base_n = n_el.attr('base_n');
559
+
560
+ base_c = base_c == '0' ? false : true;
561
+ base_s = base_s == '0' ? false : true;
562
+
563
+ if (h != base_h || w != base_w || c != base_c || s != base_s || n != base_n) {
564
+ el.closest('td').addClass('notSaved').find('.add_size').css('display', 'inline-block');
565
+ } else {
566
+ el.closest('td').removeClass('notSaved').find('.add_size').css('display', 'none');
567
+ }
568
+ }
569
+ };
570
+
571
+ rahe.sis.template = _.memoize(
572
+ function (id) {
573
+ var compiled,
574
+ options = {
575
+ evaluate: /<#([\s\S]+?)#>/g,
576
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
577
+ escape: /\{\{([^\}]+?)\}\}(?!\})/g,
578
+ variable: 'data'
579
+ };
580
+
581
+ return function (data) {
582
+ compiled = compiled || _.template(jQuery('#sis-' + id).html(), null, options);
583
+ return compiled(data);
584
+ };
585
+ }
586
+ );
587
+
588
+ jQuery(
589
+ function () {
590
+ rahe.sis.regenerate.init();
591
+ var bodyContent = jQuery('#wpbody-content');
592
+ // Regeneration listener
593
+ jQuery('#ajax_thumbnail_rebuild').click(
594
+ function () {
595
+ rahe.sis.regenerate.checkStartRegenerating();
596
+ }
597
+ );
598
+
599
+ // Add size button listener
600
+ bodyContent.on(
601
+ 'click', '#add_size', function (e) {
602
+ rahe.sis.sizes.add(e, this);
603
+ }
604
+ )
605
+
606
+ // Registering a new size listener
607
+ .on(
608
+ 'click', '.add_size_name', function (e) {
609
+ rahe.sis.sizes.register(e, this);
610
+ }
611
+ )
612
+
613
+ // Delete and Adding buttons
614
+ .on(
615
+ 'click', '.delete_size', function (e) {
616
+ rahe.sis.sizes.deleteSize(e, this);
617
+ }
618
+ )
619
+ .on(
620
+ 'click', '.add_size', function (e) {
621
+ rahe.sis.sizes.ajaxRegister(e, this);
622
+ }
623
+ )
624
+
625
+ .on(
626
+ 'click keyup change', '.h,.w,.c,.s,.n', function (e) {
627
+ rahe.sis.sizes.displayChange(this);
628
+ }
629
+ )
630
+
631
+ // Seup the getphp
632
+ .on(
633
+ 'click', '#get_php', function (e) {
634
+ rahe.sis.sizes.getPhp(e, this)
635
+ }
636
+ );
637
+ jQuery('#get_php').nextAll('code').hide();
638
+
639
+ jQuery(".add_size").hide();
640
+ }
641
+ );
642
+
643
+ // Functions for the regenerating of images
644
+ var sis;
645
+ if (!sis) {
646
+ sis = {};
647
+ } else if (typeof sis !== "object") {
648
+ throw new Error('sis already exists and not an object');
649
+ }
650
+
651
+ jQuery(
652
+ function () {
653
+ 'use strict';
654
+ var bdy = jQuery(document.body), SISAttachRegenerate = null, sis_obj = null;
655
+ // Add action dinamycally
656
+ jQuery('select[name="action"], select[name="action2"]').append(
657
+ jQuery('<option/>').attr('value', 'sis-regenerate').text(sis.regenerate)
658
+ );
659
+
660
+ // Regenerate one element
661
+ bdy.on(
662
+ 'click', '.sis-regenerate-one', function (e) {
663
+ e.preventDefault();
664
+ sis_obj = new SISAttachRegenerate(this);
665
+ }
666
+ );
667
+
668
+ // On bulk actions
669
+ jQuery('#doaction, #doaction2').on(
670
+ 'click', function (e) {
671
+ if (jQuery(this).parent().find('select').val() === 'sis-regenerate') {
672
+ // Get checked checkbocxes
673
+ var els = jQuery('#the-list .check-column input[type="checkbox"]:checked').closest('tr').find('.sis-regenerate-one');
674
+
675
+ // Check there is any elements selected
676
+ if (els.length > 0) {
677
+
678
+ // Stop default action
679
+ e.preventDefault();
680
+
681
+ // Make all the selected elements
682
+ els.each(
683
+ function (i, el) {
684
+ sis_obj = new SISAttachRegenerate(this);
685
+ }
686
+ );
687
+ }
688
+ }
689
+ }
690
+ );
691
+
692
+ // Function for regenerating the elements
693
+ SISAttachRegenerate = function (el) {
694
+ var regenerate = {
695
+ list: {},
696
+ parent: null,
697
+ el: null,
698
+ id: null,
699
+ messageZone: '',
700
+ init: function (el) {
701
+ this.el = el;
702
+ this.parent = el.closest('tr');
703
+ this.id = this.el.data('id');
704
+ this.list = {'id': this.id, 'title': ''};
705
+ this.messageZone = this.parent.find('.title em');
706
+
707
+ if (this.parent.find('.title em').length === 0) {
708
+ this.parent.find('.title strong').after('<em/>');
709
+ }
710
+
711
+ this.messageZone = this.parent.find('.title em');
712
+
713
+ if (!this.parent.hasClass('ajaxing')) {
714
+ this.regenItem();
715
+ }
716
+ },
717
+ setMessage: function (msg) {
718
+ // Display the message
719
+ this.messageZone.html(' - ' + msg).addClass('updated').addClass('fade').show();
720
+ },
721
+ regenItem: function () {
722
+ var self = this;
723
+
724
+ jQuery.ajax(
725
+ {
726
+ url: ajaxurl,
727
+ type: "POST",
728
+ dataType: 'json',
729
+ cache: false,
730
+ data: {
731
+ action: 'sis_rebuild_image',
732
+ id: this.list.id,
733
+ nonce: sis.regen_one
734
+ },
735
+ beforeSend: function () {
736
+ self.parent.addClass('ajaxing').find('.sis-regenerate-one').hide().end().find('.spinner').addClass('is-active').show();
737
+ self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '0.3');
738
+ },
739
+ success: function (r) {
740
+ var message = '';
741
+ // Check if error or a message in response
742
+ if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
743
+ message = typeof r !== 'object' ? message = sis.phpError : r.error;
744
+ } else {
745
+ message = sis.soloRegenerated.replace('%s', r.time);
746
+ }
747
+ self.setMessage(message);
748
+ self.parent.removeClass('ajaxing').find('.sis-regenerate-one').show().end().find('.spinner').removeClass('is-active').hide();
749
+ self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '1');
750
+ }
751
+ }
752
+ );
753
+ }
754
+ };
755
+
756
+ // Launch regeneration
757
+ regenerate.init(jQuery(el));
758
+ };
759
+ }
760
+ );
761
+
762
+ // Functions for the regenerating of images
763
+ var rahe;
764
+ if (!rahe) {
765
+ rahe = {};
766
+ } else if (typeof rahe !== "object") {
767
+ throw new Error('rahe already exists and not an object');
768
+ }
769
+
770
+ if (!rahe.sis) {
771
+ rahe.sis = {};
772
+ } else if (typeof rahe.sis !== "object") {
773
+ throw new Error('rahe.sis already exists and not an object');
774
+ }
775
+
776
+ rahe.sis.featured = {
777
+ messageZone: '',
778
+ parent: '',
779
+ element: '',
780
+ init: function () {
781
+ this.element = jQuery('#sis_featured_regenerate');
782
+ this.parent = this.element.closest('.inside');
783
+ this.nonce = this.element.attr('data-nonce');
784
+ this.id = jQuery('#post_ID').val();
785
+
786
+ this.parent.on(
787
+ 'click', '#sis_featured_regenerate', function (e) {
788
+ e.preventDefault();
789
+ rahe.sis.featured.regenItem();
790
+ }
791
+ );
792
+ },
793
+ setMessage: function (msg) {
794
+ // Display the message
795
+ this.parent.find('.sis_message').html("<p>" + msg + "</p>").show();
796
+ },
797
+ regenItem: function () {
798
+ var self = this;
799
+
800
+ jQuery.ajax(
801
+ {
802
+ url: ajaxurl,
803
+ type: "POST",
804
+ dataType: 'json',
805
+ cache: false,
806
+ data: {
807
+ action: 'sis_rebuild_featured',
808
+ id: this.id,
809
+ nonce: this.nonce
810
+ },
811
+ beforeSend: function () {
812
+ self.parent.find('.spinner').addClass('is-active');
813
+ self.parent.find('#sis_featured_regenerate').attr('disabled', 'disabled');
814
+ },
815
+ success: function (r) {
816
+ var message = '';
817
+ // Check if error or a message in response
818
+ if (!r.time || r.error || typeof r !== 'object') {
819
+ message = typeof r !== 'object' ? message = sis.phpError : r.error;
820
+ } else {
821
+ message = sis.soloRegenerated.replace('%s', r.time);
822
+ }
823
+ console.log(message);
824
+ self.setMessage(message);
825
+
826
+ self.parent.find('.spinner').removeClass('is-active');
827
+ self.parent.find('#sis_featured_regenerate').removeAttr('disabled');
828
+ }
829
+ }
830
+ );
831
+ }
832
+ };
833
+
834
+ jQuery(
835
+ function () {
836
+ rahe.sis.featured.init();
837
+ }
838
+ );
839
+
840
+ //# sourceMappingURL=app.js.map
assets/js/dist/app.js.map ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 3,
3
+ "file": "app.js",
4
+ "sources": [
5
+ "assets/js/src/sis.js",
6
+ "assets/js/src/attachments.js",
7
+ "assets/js/src/featured.js"
8
+ ],
9
+ "names": [],
10
+ "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
11
+ "sourceRoot": "../../"
12
+ }
assets/js/dist/app.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ var rahe;if(rahe){if("object"!=typeof rahe)throw new Error("rahe already exists and not an object")}else rahe={};if(rahe.sis){if("object"!=typeof rahe.sis)throw new Error("rahe.sis already exists and not an object")}else rahe.sis={};rahe.sis.regenerate={post_types:[],thumbnails:[],total:0,cur:0,timeScript:[],dateScript:"",percent:"",percentText:null,progress:null,messageZone:null,sisZone:null,time:null,timeZone:null,buttonRegenerate:null,errorZone:null,errorMessages:null,thumb:null,thumbImg:null,init:function(){this.sisZone=jQuery(".sis"),this.percentText=jQuery("#sis_progress-percent"),this.progress=jQuery(".progress"),this.messageZone=this.sisZone.find(".regenerate_message"),this.time=this.sisZone.find(".time"),this.timeZone=this.time.find("p span.time_message"),this.buttonRegenerate=jQuery("#ajax_thumbnail_rebuild"),this.errorZone=jQuery("#error_messages"),this.errorMessages=this.errorZone.find("ul.messages"),this.thumb=this.sisZone.find(".thumb"),this.thumbImg=this.sisZone.find(".thumb-img")},getThumbnails:function(){var e=this,t=jQuery("input.thumbnails:checked");t.length!=jQuery('input.thumbnails[type="checkbox"]').length&&t.each(function(t){e.thumbnails.push(this.value)})},getPostTypes:function(){var e=this,t=jQuery("input.post_types:checked");t.length!=jQuery('input.post_types[type="checkbox"]').length&&t.each(function(){e.post_types.push(this.value)})},setMessage:function(e){this.messageZone.html("<p>"+e+"</p>").addClass("updated").addClass("fade").show()},setTimeMessage:function(e){this.timeZone.html(e)},checkStartRegenerating:function(){if(jQuery(".notSaved").size()>0){var e=confirm(sis.notSaved);if(1!=e)return!1;this.startRegenerating()}else this.startRegenerating()},startRegenerating:function(){var e=this,t=jQuery("input.getList").val();e.getThumbnails(),e.getPostTypes(),this.dateScript=new Date,jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"sis_get_list",post_types:e.post_types,nonce:t},beforeSend:function(){e.buttonRegenerate.attr("disabled",!0),e.setMessage(sis.reading)},success:function(t){return"object"!=typeof t?(e.reInit(),e.setMessage(sis.phpError),!1):(e.time.show(),e.total=t.total,e.curr=0,e.progress.show().parent().show(),void e.regenItem())}})},regenItem:function(){var e=this,s=jQuery("input.regen").val();if(0==this.total||_.isUndefined(this.total))return this.reInit(),this.setMessage(sis.noMedia),!1;if(this.curr>=this.total){var i=new Date;return this.reInit(),void this.setMessage(sis.done+this.curr+" "+sis.messageRegenerated+sis.startedAt+" "+this.dateScript.getHours()+":"+this.dateScript.getMinutes()+":"+this.dateScript.getSeconds()+sis.finishedAt+" "+i.getHours()+":"+i.getMinutes()+":"+i.getSeconds())}this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.total),this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.total),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"sis_rebuild_images",offset:this.curr,thumbnails:this.thumbnails,nonce:s},beforeSend:function(){e.percent=e.curr/e.total*100,e.progress.find(".bar").width(e.percent+"%").find(".percent").html(e.percent+"%"),e.percentText.removeClass("hidden").html(Math.round(e.percent)+"%")},success:function(s){if(s.src&&s.time&&!s.error&&"object"==typeof s){s.message&&e.time.find("ul.messages").prepend("<li>"+s.message+"</li>"),e.thumb.show(),e.thumbImg.attr("src",s.src);var i=new Date,n=new Date,a=0,r=0,o=0,d=0,l="";for(e.timeScript.push(parseFloat(s.time.replace(",","."),10)),a=e.timeScript.length,o;a>o;o++)r+=e.timeScript[o];d=r/a,t=Math.round(d*e.total*1e3),i.setTime(e.dateScript.getTime()+t),l=e.s2t(Math.abs(i.getTime()-n.getTime())/1e3),e.setTimeMessage(i.getHours()+":"+i.getMinutes()+":"+i.getSeconds()+sis.or+l+sis.beforeEnd)}else{var u="";u="object"!=typeof s?sis.phpError:s.error,e.errorZone.addClass("error message"),e.errorMessages.prepend("<li>"+u+"</li>")}e.curr++,e.regenItem()}})},s2t:function(e){var e=e%86400,t=new Date(1970,0,1),s=0;return t.setSeconds(e),s=t.toTimeString().substr(0,8),e>86399&&(s=Math.floor((t-Date.parse("1/1/70"))/36e5)+s.substr(2)),s},reInit:function(){this.buttonRegenerate.removeAttr("disabled"),this.thumb.hide(),this.progress.hide(),this.percentText.addClass("hidden")}},rahe.sis.sizes={i:0,add:function(e,t){e.preventDefault();var s=rahe.sis.template("new_size");s=s({size_id:this.i,validate:sis.validate}),jQuery(t).closest("tr").before(s),this.i++},register:function(e,t){e.preventDefault();var s=jQuery(t).closest("tr").children("th").find("input").val(),i=jQuery(t).closest("tr").children("th").find("input").attr("id"),n=jQuery(t).closest("tbody").find('input[value="'+s+'"]').length;if("thumbnail"==s||"medium"==s||"large"==s)return alert(sis.notOriginal),!1;if(0!=n)return alert(sis.alreadyPresent),!1;var a=rahe.sis.template("new_size_row");a=a({size:sis.size,size_name:s,maximumWidth:sis.maximumWidth,maximumHeight:sis.maximumHeight,customName:sis.customName,crop:sis.crop,crop_positions:sis.crop_positions,show:sis.show,deleteImage:sis.deleteImage,validateButton:sis.validateButton}),jQuery("#"+i).closest("tr").html(a)},deleteSize:function(e,t){e.preventDefault();var s=confirm(sis.confirmDelete);1==s&&(jQuery(t).closest("tr").remove(),this.ajaxUnregister(t))},getPhp:function(e,t){e.preventDefault();var s=jQuery(t).closest("tr");jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"sis_get_sizes"},beforeSend:function(){s.removeClass("addPending"),s.addClass("addPending")},success:function(e){jQuery("#get_php").nextAll("code").html("<br />"+e).show().css({display:"block"}),s.removeClass("addPending")}})},ajaxRegister:function(e,t){e.preventDefault();var s,i=this,n=jQuery(t).closest("table"),a=jQuery(".addSize").val(),r=jQuery(t).closest("tr"),o=r.find('input[name="image_name"]').val(),d=r.find("select.crop").val(),l=r.find("input.show").val(),u=r.find("input.n").val(),h=0,c=0;l=0==l||void 0==l?!1:!0,c=parseInt(r.find("input.w").val()),h=parseInt(r.find("input.h").val()),n.hasClass("ajaxing")||jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"sis_add_size",width:c,height:h,crop:d,name:o,show:l,customName:u,nonce:a},beforeSend:function(){r.removeClass(),r.addClass("addPending"),n.addClass("ajaxing")},success:function(e){var t="";r.removeClass(),n.removeClass("ajaxing"),0==e?t="errorAdding":2==e?(t="notChangedAdding",i.addToArray(o,c,h,d,t)):(t="successAdding",i.addToArray(o,c,h,d,t)),r.find("input.h").attr({base_h:h}),r.find("input.w").attr({base_w:c}),r.find("select.c").attr({base_c:d}),r.find("input.s").attr({base_s:l}),r.addClass(t),r.find("td").removeClass("notSaved"),r.find(".add_size").removeClass("validate_size").hide().children(".ui-button-text").text(sis.update),clearTimeout(s),s=setTimeout(function(){r.removeClass("errorAdding notChangedAdding successAdding")},2e3)}})},ajaxUnregister:function(e){var t=this,s=jQuery(e).closest("tr").find('input[name="image_name"]').val(),i=jQuery(e).closest("tr").find("input.deleteSize").val();jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"sis_remove_size",name:s,nonce:i},success:function(s){t.removeFromArray(e)}})},addToArray:function(e,t,s,i,n){var a,r=jQuery("#sis-"+e),o="";o=0!=r.length?r.closest("tr"):jQuery("#sis-regen .wrapper > table#sis_sizes > tbody > tr:first").clone().attr("id","sis-"+e),i=_.isUndefined(sis.crop_positions[i])?sis.fl:sis.crop_positions[i],o.find("th > label").attr("for",e).end().find("input.thumbnails").val(e).attr("id",e).end().find("th:nth-child(2) > label").text(e).end().find("th:nth-child(3) > label").text(t+"px").end().find("th:nth-child(4) > label").text(s+"px").end().find("th:nth-child(5) > label").text(i),0==r.length&&o.appendTo("#sis-regen .wrapper > table#sis_sizes > tbody"),o.removeClass("errorAdding notChangedAdding successAdding").addClass(n),clearTimeout(a),a=setTimeout(function(){o.removeClass("errorAdding notChangedAdding successAdding")},3e3)},removeFromArray:function(e){var t=jQuery(e).closest("tr").find("input[name=image_name]").val();jQuery("#sis-"+t).remove()},displayChange:function(e){var e=jQuery(e),t=e.closest("tr");if(t.hasClass("new_size"))return!1;var s=t.find("input.h"),i=t.find("input.w"),n=t.find("select.c"),a=t.find("input.s"),r=t.find("input.n"),o=s.val(),d=i.val(),l=n.val(),u=a.val(),h=r.val(),c=s.attr("base_h"),p=i.attr("base_w"),g=n.attr("base_c"),m=a.attr("base_s"),f=r.attr("base_n");g="0"==g?!1:!0,m="0"==m?!1:!0,o!=c||d!=p||l!=g||u!=m||h!=f?e.closest("td").addClass("notSaved").find(".add_size").css("display","inline-block"):e.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}},rahe.sis.template=_.memoize(function(e){var t,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(i){return(t=t||_.template(jQuery("#sis-"+e).html(),null,s))(i)}}),jQuery(function(){rahe.sis.regenerate.init();var e=jQuery("#wpbody-content");jQuery("#ajax_thumbnail_rebuild").click(function(){rahe.sis.regenerate.checkStartRegenerating()}),e.on("click","#add_size",function(e){rahe.sis.sizes.add(e,this)}).on("click",".add_size_name",function(e){rahe.sis.sizes.register(e,this)}).on("click",".delete_size",function(e){rahe.sis.sizes.deleteSize(e,this)}).on("click",".add_size",function(e){rahe.sis.sizes.ajaxRegister(e,this)}).on("click keyup change",".h,.w,.c,.s,.n",function(e){rahe.sis.sizes.displayChange(this)}).on("click","#get_php",function(e){rahe.sis.sizes.getPhp(e,this)}),jQuery("#get_php").nextAll("code").hide(),jQuery(".add_size").hide()});
2
+
3
+ var sis;if(sis){if("object"!=typeof sis)throw new Error("sis already exists and not an object")}else sis={};jQuery(function(){"use strict";var e=jQuery(document.body),t=null,s=null;jQuery('select[name="action"], select[name="action2"]').append(jQuery("<option/>").attr("value","sis-regenerate").text(sis.regenerate)),e.on("click",".sis-regenerate-one",function(e){e.preventDefault(),s=new t(this)}),jQuery("#doaction, #doaction2").on("click",function(e){if("sis-regenerate"===jQuery(this).parent().find("select").val()){var n=jQuery('#the-list .check-column input[type="checkbox"]:checked').closest("tr").find(".sis-regenerate-one");n.length>0&&(e.preventDefault(),n.each(function(e,n){s=new t(this)}))}}),t=function(e){var t={list:{},parent:null,el:null,id:null,messageZone:"",init:function(e){this.el=e,this.parent=e.closest("tr"),this.id=this.el.data("id"),this.list={id:this.id,title:""},this.messageZone=this.parent.find(".title em"),0===this.parent.find(".title em").length&&this.parent.find(".title strong").after("<em/>"),this.messageZone=this.parent.find(".title em"),this.parent.hasClass("ajaxing")||this.regenItem()},setMessage:function(e){this.messageZone.html(" - "+e).addClass("updated").addClass("fade").show()},regenItem:function(){var e=this;jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"sis_rebuild_image",id:this.list.id,nonce:sis.regen_one},beforeSend:function(){e.parent.addClass("ajaxing").find(".sis-regenerate-one").hide().end().find(".spinner").addClass("is-active").show(),e.parent.find("a.sis-regenerate-one").closest("tr").fadeTo("fast","0.3")},success:function(t){var s="";s=t.src&&t.time&&!t.error&&"object"==typeof t?sis.soloRegenerated.replace("%s",t.time):"object"!=typeof t?s=sis.phpError:t.error,e.setMessage(s),e.parent.removeClass("ajaxing").find(".sis-regenerate-one").show().end().find(".spinner").removeClass("is-active").hide(),e.parent.find("a.sis-regenerate-one").closest("tr").fadeTo("fast","1")}})}};t.init(jQuery(e))}});
4
+
5
+ var rahe;if(rahe){if("object"!=typeof rahe)throw new Error("rahe already exists and not an object")}else rahe={};if(rahe.sis){if("object"!=typeof rahe.sis)throw new Error("rahe.sis already exists and not an object")}else rahe.sis={};rahe.sis.featured={messageZone:"",parent:"",element:"",init:function(){this.element=jQuery("#sis_featured_regenerate"),this.parent=this.element.closest(".inside"),this.nonce=this.element.attr("data-nonce"),this.id=jQuery("#post_ID").val(),this.parent.on("click","#sis_featured_regenerate",function(e){e.preventDefault(),rahe.sis.featured.regenItem()})},setMessage:function(e){this.parent.find(".sis_message").html("<p>"+e+"</p>").show()},regenItem:function(){var e=this;jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"sis_rebuild_featured",id:this.id,nonce:this.nonce},beforeSend:function(){e.parent.find(".spinner").addClass("is-active"),e.parent.find("#sis_featured_regenerate").attr("disabled","disabled")},success:function(t){var s="";s=!t.time||t.error||"object"!=typeof t?"object"!=typeof t?s=sis.phpError:t.error:sis.soloRegenerated.replace("%s",t.time),e.setMessage(s),e.parent.find(".spinner").removeClass("is-active"),e.parent.find("#sis_featured_regenerate").removeAttr("disabled")}})}},jQuery(function(){rahe.sis.featured.init()});
6
+
7
+ //# sourceMappingURL=app.min.js.map
assets/js/dist/app.min.js.map ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 3,
3
+ "file": "app.min.js",
4
+ "sources": [
5
+ "assets/js/src/sis.js",
6
+ "assets/js/src/attachments.js",
7
+ "assets/js/src/featured.js"
8
+ ],
9
+ "names": [],
10
+ "mappings": "AAAA;;ACAA;;ACAA",
11
+ "sourceRoot": "../../"
12
+ }
assets/js/src/attachments.js ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Functions for the regenerating of images
2
+ var sis;
3
+ if (!sis) {
4
+ sis = {};
5
+ } else if (typeof sis !== "object") {
6
+ throw new Error('sis already exists and not an object');
7
+ }
8
+
9
+ jQuery(
10
+ function () {
11
+ 'use strict';
12
+ var bdy = jQuery(document.body), SISAttachRegenerate = null, sis_obj = null;
13
+ // Add action dinamycally
14
+ jQuery('select[name="action"], select[name="action2"]').append(
15
+ jQuery('<option/>').attr('value', 'sis-regenerate').text(sis.regenerate)
16
+ );
17
+
18
+ // Regenerate one element
19
+ bdy.on(
20
+ 'click', '.sis-regenerate-one', function (e) {
21
+ e.preventDefault();
22
+ sis_obj = new SISAttachRegenerate(this);
23
+ }
24
+ );
25
+
26
+ // On bulk actions
27
+ jQuery('#doaction, #doaction2').on(
28
+ 'click', function (e) {
29
+ if (jQuery(this).parent().find('select').val() === 'sis-regenerate') {
30
+ // Get checked checkbocxes
31
+ var els = jQuery('#the-list .check-column input[type="checkbox"]:checked').closest('tr').find('.sis-regenerate-one');
32
+
33
+ // Check there is any elements selected
34
+ if (els.length > 0) {
35
+
36
+ // Stop default action
37
+ e.preventDefault();
38
+
39
+ // Make all the selected elements
40
+ els.each(
41
+ function (i, el) {
42
+ sis_obj = new SISAttachRegenerate(this);
43
+ }
44
+ );
45
+ }
46
+ }
47
+ }
48
+ );
49
+
50
+ // Function for regenerating the elements
51
+ SISAttachRegenerate = function (el) {
52
+ var regenerate = {
53
+ list: {},
54
+ parent: null,
55
+ el: null,
56
+ id: null,
57
+ messageZone: '',
58
+ init: function (el) {
59
+ this.el = el;
60
+ this.parent = el.closest('tr');
61
+ this.id = this.el.data('id');
62
+ this.list = {'id': this.id, 'title': ''};
63
+ this.messageZone = this.parent.find('.title em');
64
+
65
+ if (this.parent.find('.title em').length === 0) {
66
+ this.parent.find('.title strong').after('<em/>');
67
+ }
68
+
69
+ this.messageZone = this.parent.find('.title em');
70
+
71
+ if (!this.parent.hasClass('ajaxing')) {
72
+ this.regenItem();
73
+ }
74
+ },
75
+ setMessage: function (msg) {
76
+ // Display the message
77
+ this.messageZone.html(' - ' + msg).addClass('updated').addClass('fade').show();
78
+ },
79
+ regenItem: function () {
80
+ var self = this;
81
+
82
+ jQuery.ajax(
83
+ {
84
+ url: ajaxurl,
85
+ type: "POST",
86
+ dataType: 'json',
87
+ cache: false,
88
+ data: {
89
+ action: 'sis_rebuild_image',
90
+ id: this.list.id,
91
+ nonce: sis.regen_one
92
+ },
93
+ beforeSend: function () {
94
+ self.parent.addClass('ajaxing').find('.sis-regenerate-one').hide().end().find('.spinner').addClass('is-active').show();
95
+ self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '0.3');
96
+ },
97
+ success: function (r) {
98
+ var message = '';
99
+ // Check if error or a message in response
100
+ if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
101
+ message = typeof r !== 'object' ? message = sis.phpError : r.error;
102
+ } else {
103
+ message = sis.soloRegenerated.replace('%s', r.time);
104
+ }
105
+ self.setMessage(message);
106
+ self.parent.removeClass('ajaxing').find('.sis-regenerate-one').show().end().find('.spinner').removeClass('is-active').hide();
107
+ self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '1');
108
+ }
109
+ }
110
+ );
111
+ }
112
+ };
113
+
114
+ // Launch regeneration
115
+ regenerate.init(jQuery(el));
116
+ };
117
+ }
118
+ );
assets/js/src/featured.js ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Functions for the regenerating of images
2
+ var rahe;
3
+ if (!rahe) {
4
+ rahe = {};
5
+ } else if (typeof rahe !== "object") {
6
+ throw new Error('rahe already exists and not an object');
7
+ }
8
+
9
+ if (!rahe.sis) {
10
+ rahe.sis = {};
11
+ } else if (typeof rahe.sis !== "object") {
12
+ throw new Error('rahe.sis already exists and not an object');
13
+ }
14
+
15
+ rahe.sis.featured = {
16
+ messageZone: '',
17
+ parent: '',
18
+ element: '',
19
+ init: function () {
20
+ this.element = jQuery('#sis_featured_regenerate');
21
+ this.parent = this.element.closest('.inside');
22
+ this.nonce = this.element.attr('data-nonce');
23
+ this.id = jQuery('#post_ID').val();
24
+
25
+ this.parent.on(
26
+ 'click', '#sis_featured_regenerate', function (e) {
27
+ e.preventDefault();
28
+ rahe.sis.featured.regenItem();
29
+ }
30
+ );
31
+ },
32
+ setMessage: function (msg) {
33
+ // Display the message
34
+ this.parent.find('.sis_message').html("<p>" + msg + "</p>").show();
35
+ },
36
+ regenItem: function () {
37
+ var self = this;
38
+
39
+ jQuery.ajax(
40
+ {
41
+ url: ajaxurl,
42
+ type: "POST",
43
+ dataType: 'json',
44
+ cache: false,
45
+ data: {
46
+ action: 'sis_rebuild_featured',
47
+ id: this.id,
48
+ nonce: this.nonce
49
+ },
50
+ beforeSend: function () {
51
+ self.parent.find('.spinner').addClass('is-active');
52
+ self.parent.find('#sis_featured_regenerate').attr('disabled', 'disabled');
53
+ },
54
+ success: function (r) {
55
+ var message = '';
56
+ // Check if error or a message in response
57
+ if (!r.time || r.error || typeof r !== 'object') {
58
+ message = typeof r !== 'object' ? message = sis.phpError : r.error;
59
+ } else {
60
+ message = sis.soloRegenerated.replace('%s', r.time);
61
+ }
62
+ self.setMessage(message);
63
+
64
+ self.parent.find('.spinner').removeClass('is-active');
65
+ self.parent.find('#sis_featured_regenerate').removeAttr('disabled');
66
+ }
67
+ }
68
+ );
69
+ }
70
+ };
71
+
72
+ jQuery(
73
+ function () {
74
+ rahe.sis.featured.init();
75
+ }
76
+ );
assets/js/src/sis.js ADDED
@@ -0,0 +1,641 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Functions for the regenerating of images
2
+ var rahe;
3
+ if (!rahe) {
4
+ rahe = {};
5
+ } else if (typeof rahe !== "object") {
6
+ throw new Error('rahe already exists and not an object');
7
+ }
8
+
9
+ if (!rahe.sis) {
10
+ rahe.sis = {};
11
+ } else if (typeof rahe.sis !== "object") {
12
+ throw new Error('rahe.sis already exists and not an object');
13
+ }
14
+
15
+ rahe.sis.regenerate = {
16
+ post_types: [],
17
+ thumbnails: [],
18
+ total: 0,
19
+ cur: 0,
20
+ timeScript: [],
21
+ dateScript: '',
22
+ percent: '',
23
+ percentText: null,
24
+ progress: null,
25
+ messageZone: null,
26
+ sisZone: null,
27
+ time: null,
28
+ timeZone: null,
29
+ buttonRegenerate: null,
30
+ errorZone: null,
31
+ errorMessages: null,
32
+ thumb: null,
33
+ thumbImg: null,
34
+ init: function () {
35
+ this.sisZone = jQuery('.sis');
36
+ this.percentText = jQuery('#sis_progress-percent');
37
+ this.progress = jQuery('.progress');
38
+ this.messageZone = this.sisZone.find(".regenerate_message");
39
+ this.time = this.sisZone.find(".time");
40
+ this.timeZone = this.time.find("p span.time_message");
41
+ this.buttonRegenerate = jQuery("#ajax_thumbnail_rebuild");
42
+ this.errorZone = jQuery('#error_messages');
43
+ this.errorMessages = this.errorZone.find('ul.messages');
44
+ this.thumb = this.sisZone.find('.thumb');
45
+ this.thumbImg = this.sisZone.find('.thumb-img');
46
+ },
47
+ getThumbnails: function () {
48
+ var self = this,
49
+ inputs = jQuery('input.thumbnails:checked');
50
+
51
+ // Get the checked thumbnails inputs
52
+ if (inputs.length != jQuery('input.thumbnails[type="checkbox"]').length) {
53
+ inputs.each(
54
+ function (i) {
55
+ self.thumbnails.push(this.value);
56
+ }
57
+ );
58
+ }
59
+ },
60
+ getPostTypes: function () {
61
+ var self = this,
62
+ inputs = jQuery('input.post_types:checked');
63
+
64
+ // Get the checked post Types inputs
65
+ if (inputs.length != jQuery('input.post_types[type="checkbox"]').length) {
66
+ inputs.each(
67
+ function () {
68
+ self.post_types.push(this.value);
69
+ }
70
+ );
71
+ }
72
+ },
73
+ setMessage: function (msg) {
74
+ // Display the message
75
+ this.messageZone.html("<p>" + msg + "</p>").addClass('updated').addClass('fade').show();
76
+ },
77
+ setTimeMessage: function (msg) {
78
+ this.timeZone.html(msg);
79
+ },
80
+ checkStartRegenerating: function () {
81
+ if (jQuery('.notSaved').size() > 0) {
82
+ var confirmation = confirm(sis.notSaved);
83
+
84
+ // Delete if ok else not delete
85
+ if (confirmation == true) {
86
+ this.startRegenerating();
87
+ } else {
88
+ return false;
89
+ }
90
+ } else {
91
+ this.startRegenerating();
92
+ }
93
+ },
94
+ startRegenerating: function () {
95
+ var self = this,
96
+ wp_nonce = jQuery('input.getList').val();
97
+
98
+ // Get the humbnails and post types
99
+ self.getThumbnails();
100
+ self.getPostTypes();
101
+
102
+ this.dateScript = new Date();
103
+ // Start ajax
104
+ jQuery.ajax(
105
+ {
106
+ url: ajaxurl,
107
+ type: "POST",
108
+ dataType: 'json',
109
+ data: {
110
+ action: 'sis_get_list',
111
+ post_types: self.post_types,
112
+ nonce: wp_nonce
113
+ },
114
+ beforeSend: function () {
115
+
116
+ // Disable the button
117
+ self.buttonRegenerate.attr("disabled", true);
118
+ // Display the message
119
+ self.setMessage(sis.reading);
120
+
121
+ },
122
+ success: function (r) {
123
+
124
+ if (typeof r !== 'object') {
125
+ self.reInit();
126
+ self.setMessage(sis.phpError);
127
+ return false;
128
+ }
129
+
130
+ self.time.show();
131
+
132
+ // Eval the response
133
+ self.total = r.total;
134
+
135
+ // Set the current to 0
136
+ self.curr = 0;
137
+
138
+ // Display the progress Bar
139
+ self.progress.show().parent().show();
140
+
141
+ // Start Regenerating
142
+ self.regenItem();
143
+ }
144
+ }
145
+ );
146
+ },
147
+ regenItem: function () {
148
+ var self = this,
149
+ wp_nonce = jQuery('input.regen').val();
150
+
151
+ // If the list is empty display the message of emptyness and reinitialize the form
152
+ if (this.total == 0 || _.isUndefined(this.total)) {
153
+ this.reInit();
154
+ this.setMessage(sis.noMedia);
155
+ return false;
156
+ }
157
+
158
+ // If we have finished the regeneration display message and init again
159
+ if (this.curr >= this.total) {
160
+ var now = new Date();
161
+ this.reInit();
162
+ this.setMessage(sis.done + this.curr + ' ' + sis.messageRegenerated + sis.startedAt + ' ' + this.dateScript.getHours() + ":" + this.dateScript.getMinutes() + ":" + this.dateScript.getSeconds() + sis.finishedAt + ' ' + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds());
163
+ return;
164
+ }
165
+
166
+ // Set the message of current image regenerating
167
+ this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
168
+ this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
169
+
170
+ jQuery.ajax(
171
+ {
172
+ url: ajaxurl,
173
+ type: "POST",
174
+ dataType: 'json',
175
+ data: {
176
+ action: 'sis_rebuild_images',
177
+ offset: this.curr,
178
+ thumbnails: this.thumbnails,
179
+ nonce: wp_nonce
180
+ },
181
+ beforeSend: function () {
182
+ // Calculate the percentage of regeneration
183
+ self.percent = ( self.curr / self.total ) * 100;
184
+
185
+ // Change the progression
186
+ self.progress.find('.bar').width(self.percent + '%')
187
+ .find('.percent').html(self.percent + '%');
188
+
189
+ // Change the text of progression
190
+ self.percentText.removeClass('hidden').html(Math.round(self.percent) + "%");
191
+ },
192
+ success: function (r) {
193
+ // Check if error or a message in response
194
+ if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
195
+ var message = '';
196
+ if (typeof r !== 'object') {
197
+ message = sis.phpError;
198
+ } else {
199
+ message = r.error
200
+ }
201
+
202
+ self.errorZone.addClass('error message');
203
+ self.errorMessages.prepend('<li>' + message + '</li>');
204
+ } else {
205
+
206
+ // Append a message if needed
207
+ if (r.message) {
208
+ self.time.find('ul.messages').prepend('<li>' + r.message + '</li>');
209
+ }
210
+
211
+ // Display the image
212
+ self.thumb.show();
213
+
214
+ // Change his attribute
215
+ self.thumbImg.attr("src", r.src);
216
+
217
+ // Actual time
218
+ var dateEnd = new Date(),
219
+ curDate = new Date(),
220
+ num = 0,
221
+ sum = 0,
222
+ i = 0,
223
+ ave = 0,
224
+ time = '';
225
+
226
+ // Add the regenerating time to the array
227
+ self.timeScript.push(parseFloat(r.time.replace(',', '.'), 10));
228
+
229
+ // Get the number of elements in array
230
+ num = self.timeScript.length;
231
+
232
+ // Make the sum of the times
233
+ for (i; i < num; i++) {
234
+ sum += self.timeScript[i];
235
+ }
236
+
237
+ // Make the average value of the regenerating time
238
+ ave = sum / num;
239
+
240
+ // Round the value in miliseconds and add 25% or error
241
+ t = Math.round(( ( ave * self.total ) * 1000 ));
242
+
243
+ // Set the predicted time
244
+ dateEnd.setTime(self.dateScript.getTime() + t);
245
+
246
+ // Get the difference between the two dates
247
+ time = self.s2t(Math.abs(( dateEnd.getTime() - curDate.getTime() )) / 1000);
248
+
249
+ // Set the message in the notice box
250
+ self.setTimeMessage(dateEnd.getHours() + ":" + dateEnd.getMinutes() + ":" + dateEnd.getSeconds() + sis.or + time + sis.beforeEnd);
251
+ }
252
+
253
+ // Inscrease the counter and regene the next item
254
+ self.curr++;
255
+ self.regenItem();
256
+ }
257
+ }
258
+ );
259
+
260
+ },
261
+ s2t: function (secs) {
262
+ var secs = secs % 86400,
263
+ t = new Date(1970, 0, 1),
264
+ s = 0;
265
+
266
+ t.setSeconds(secs);
267
+ s = t.toTimeString().substr(0, 8);
268
+ if (secs > 86399) {
269
+ s = Math.floor(( t - Date.parse("1/1/70") ) / 3600000) + s.substr(2);
270
+ }
271
+ return s;
272
+ },
273
+ reInit: function () {
274
+ // Re initilize the form
275
+ this.buttonRegenerate.removeAttr("disabled");
276
+ this.thumb.hide();
277
+ this.progress.hide();
278
+ this.percentText.addClass('hidden');
279
+ }
280
+ };
281
+
282
+ rahe.sis.sizes = {
283
+ i: 0,
284
+ add: function (e, el) {
285
+ e.preventDefault();
286
+
287
+ // Create the template
288
+ var elTr = rahe.sis.template('new_size');
289
+ elTr = elTr(
290
+ {
291
+ size_id: this.i,
292
+ validate: sis.validate
293
+ }
294
+ );
295
+
296
+ // Add the form for editing
297
+ jQuery(el).closest('tr').before(elTr);
298
+
299
+ // Inscrease the identifier
300
+ this.i++;
301
+ },
302
+ register: function (e, el) {
303
+ // Stop propagation
304
+ e.preventDefault();
305
+
306
+ // Get name and id
307
+ var name = jQuery(el).closest('tr').children('th').find('input').val(),
308
+ id = jQuery(el).closest('tr').children('th').find('input').attr('id'),
309
+
310
+ // Get the number of elements with this name
311
+ checkPresent = jQuery(el).closest('tbody').find('input[value="' + name + '"]').length;
312
+
313
+ // Check if not basic size or already present, display message
314
+ if (name == 'thumbnail' || name == "medium" || name == "large") {
315
+ alert(sis.notOriginal);
316
+ return false;
317
+ } else if (checkPresent != 0) {
318
+ alert(sis.alreadyPresent);
319
+ return false;
320
+ }
321
+
322
+ var row = rahe.sis.template('new_size_row');
323
+
324
+ row = row(
325
+ {
326
+ size: sis.size,
327
+ size_name: name,
328
+ maximumWidth: sis.maximumWidth,
329
+ maximumHeight: sis.maximumHeight,
330
+ customName: sis.customName,
331
+ crop: sis.crop,
332
+ crop_positions: sis.crop_positions,
333
+ show: sis.show,
334
+ deleteImage: sis.deleteImage,
335
+ validateButton: sis.validateButton
336
+ }
337
+ );
338
+
339
+ // Add the row to the current list
340
+ jQuery('#' + id).closest('tr').html(row);
341
+ },
342
+ deleteSize: function (e, el) {
343
+ e.preventDefault();
344
+ // Check if user want to delete or not
345
+ var confirmation = confirm(sis.confirmDelete);
346
+
347
+ // Delete if ok else not delete
348
+ if (confirmation == true) {
349
+ // Remove from the list and the array
350
+ jQuery(el).closest('tr').remove();
351
+ this.ajaxUnregister(el);
352
+ }
353
+ },
354
+ getPhp: function (e, el) {
355
+ e.preventDefault();
356
+ // Get parent element
357
+ var parent = jQuery(el).closest('tr');
358
+
359
+ jQuery.ajax(
360
+ {
361
+ url: ajaxurl,
362
+ type: "POST",
363
+ data: {action: "sis_get_sizes"},
364
+ beforeSend: function () {
365
+ // Remove classes of status
366
+ parent.removeClass('addPending');
367
+ parent.addClass('addPending');
368
+ },
369
+ success: function (result) {
370
+ // Add the classes for the status
371
+ jQuery('#get_php').nextAll('code').html('<br />' + result).show().css({'display': 'block'});
372
+ parent.removeClass('addPending');
373
+ }
374
+ }
375
+ );
376
+ },
377
+ ajaxRegister: function (e, el) {
378
+ e.preventDefault();
379
+
380
+ // Get the vars
381
+ var self = this,
382
+ parentTable = jQuery(el).closest('table'),
383
+ timer,
384
+ wp_nonce = jQuery('.addSize').val(),
385
+ parent = jQuery(el).closest('tr'),
386
+ n = parent.find('input[name="image_name"]').val(),
387
+ c = parent.find('select.crop').val(),
388
+ s = parent.find('input.show').val(),
389
+ cn = parent.find('input.n').val(),
390
+ h = 0,
391
+ w = 0;
392
+ s = ( s == false || s == undefined ) ? false : true;
393
+ w = parseInt(parent.find('input.w').val());
394
+ h = parseInt(parent.find('input.h').val());
395
+
396
+ if (!parentTable.hasClass('ajaxing')) {
397
+ jQuery.ajax(
398
+ {
399
+ url: ajaxurl,
400
+ type: "POST",
401
+ dataType: 'json',
402
+ data: {
403
+ action: "sis_add_size",
404
+ width: w,
405
+ height: h,
406
+ crop: c,
407
+ name: n,
408
+ show: s,
409
+ customName: cn,
410
+ nonce: wp_nonce
411
+ },
412
+ beforeSend: function () {
413
+ // Remove status and set pending
414
+ parent.removeClass();
415
+ parent.addClass('addPending');
416
+ parentTable.addClass('ajaxing');
417
+ },
418
+ success: function (result) {
419
+ // Set basic class and remove pending
420
+ var classTr = '';
421
+ parent.removeClass();
422
+ parentTable.removeClass('ajaxing');
423
+
424
+ // Check the result for the different messages
425
+ if (result == 0) {
426
+ classTr = 'errorAdding';
427
+ } else if (result == 2) {
428
+ classTr = 'notChangedAdding';
429
+
430
+ // add/update to the array with the status class
431
+ self.addToArray(n, w, h, c, classTr);
432
+ } else {
433
+ classTr = 'successAdding';
434
+
435
+ // add/update to the array with the status class
436
+ self.addToArray(n, w, h, c, classTr);
437
+ }
438
+
439
+ // Add the new sizes values for checking of changed or not
440
+ parent.find('input.h').attr({base_h: h});
441
+ parent.find('input.w').attr({base_w: w});
442
+ parent.find('select.c').attr({base_c: c});
443
+ parent.find('input.s').attr({base_s: s});
444
+
445
+ // Add the generated class
446
+ parent.addClass(classTr);
447
+ parent.find('td').removeClass("notSaved");
448
+
449
+ // Change the button text
450
+ parent.find('.add_size').removeClass('validate_size').hide().children('.ui-button-text').text(sis.update);
451
+
452
+ clearTimeout(timer);
453
+ // Remove classes after 3 seconds
454
+ timer = setTimeout(
455
+ function () {
456
+ parent.removeClass('errorAdding notChangedAdding successAdding');
457
+ }, 2 * 1000
458
+ );
459
+ }
460
+ }
461
+ );
462
+ }
463
+ },
464
+ ajaxUnregister: function (el) {
465
+ // Get name and self object
466
+ var self = this,
467
+ n = jQuery(el).closest('tr').find('input[name="image_name"]').val(),
468
+ wp_nonce = jQuery(el).closest('tr').find('input.deleteSize').val();
469
+
470
+ // Make the ajax call
471
+ jQuery.ajax(
472
+ {
473
+ url: ajaxurl,
474
+ type: "POST",
475
+ data: {action: "sis_remove_size", name: n, nonce: wp_nonce},
476
+ success: function (result) {
477
+ self.removeFromArray(el);
478
+ }
479
+ }
480
+ );
481
+ },
482
+ addToArray: function (n, w, h, c, s) {
483
+ // Get the row for editing or updating
484
+ var testRow = jQuery('#sis-' + n),
485
+ newRow = '',
486
+ timer;
487
+
488
+ // Get the right newRow, updating or adding ?
489
+ if (testRow.length != 0) {
490
+ newRow = testRow.closest('tr');
491
+ } else {
492
+ newRow = jQuery('#sis-regen .wrapper > table#sis_sizes > tbody > tr:first').clone().attr('id', 'sis-' + n);
493
+ }
494
+
495
+ c = !_.isUndefined(sis.crop_positions[c]) ? sis.crop_positions[c] : sis.fl;
496
+
497
+ // Set the datas with the given datas
498
+ newRow.find('th > label').attr('for', n)
499
+ .end()
500
+ .find('input.thumbnails').val(n).attr('id', n)
501
+ .end()
502
+ .find('th:nth-child(2) > label').text(n)
503
+ .end()
504
+ .find('th:nth-child(3) > label').text(w + 'px')
505
+ .end()
506
+ .find('th:nth-child(4) > label').text(h + 'px')
507
+ .end()
508
+ .find('th:nth-child(5) > label').text(c);
509
+
510
+ // If new then add the row
511
+ if (testRow.length == 0) {
512
+ newRow.appendTo('#sis-regen .wrapper > table#sis_sizes > tbody');
513
+ }
514
+
515
+ // Remove the previous status classes and add the status class
516
+ newRow.removeClass('errorAdding notChangedAdding successAdding').addClass(s);
517
+
518
+ clearTimeout(timer);
519
+ // Remove the statuses classes
520
+ timer = setTimeout(
521
+ function () {
522
+ newRow.removeClass('errorAdding notChangedAdding successAdding');
523
+ }, 3 * 1000
524
+ );
525
+ },
526
+ removeFromArray: function (el) {
527
+ // get the name
528
+ var n = jQuery(el).closest('tr').find('input[name=image_name]').val();
529
+
530
+ // Remove the given name from the array
531
+ jQuery('#sis-' + n).remove();
532
+ },
533
+ displayChange: function (el) {
534
+ var el = jQuery(el),
535
+ parent = el.closest('tr');
536
+
537
+ // Check not new size
538
+ if (parent.hasClass('new_size')) {
539
+ return false;
540
+ }
541
+
542
+ var h_el = parent.find('input.h'),
543
+ w_el = parent.find('input.w'),
544
+ c_el = parent.find('select.c'),
545
+ s_el = parent.find('input.s'),
546
+ n_el = parent.find('input.n'),
547
+
548
+ h = h_el.val(),
549
+ w = w_el.val(),
550
+ c = c_el.val(),
551
+ s = s_el.val(),
552
+ n = n_el.val(),
553
+
554
+ base_h = h_el.attr('base_h'),
555
+ base_w = w_el.attr('base_w'),
556
+ base_c = c_el.attr('base_c'),
557
+ base_s = s_el.attr('base_s'),
558
+ base_n = n_el.attr('base_n');
559
+
560
+ base_c = base_c == '0' ? false : true;
561
+ base_s = base_s == '0' ? false : true;
562
+
563
+ if (h != base_h || w != base_w || c != base_c || s != base_s || n != base_n) {
564
+ el.closest('td').addClass('notSaved').find('.add_size').css('display', 'inline-block');
565
+ } else {
566
+ el.closest('td').removeClass('notSaved').find('.add_size').css('display', 'none');
567
+ }
568
+ }
569
+ };
570
+
571
+ rahe.sis.template = _.memoize(
572
+ function (id) {
573
+ var compiled,
574
+ options = {
575
+ evaluate: /<#([\s\S]+?)#>/g,
576
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
577
+ escape: /\{\{([^\}]+?)\}\}(?!\})/g,
578
+ variable: 'data'
579
+ };
580
+
581
+ return function (data) {
582
+ compiled = compiled || _.template(jQuery('#sis-' + id).html(), null, options);
583
+ return compiled(data);
584
+ };
585
+ }
586
+ );
587
+
588
+ jQuery(
589
+ function () {
590
+ rahe.sis.regenerate.init();
591
+ var bodyContent = jQuery('#wpbody-content');
592
+ // Regeneration listener
593
+ jQuery('#ajax_thumbnail_rebuild').click(
594
+ function () {
595
+ rahe.sis.regenerate.checkStartRegenerating();
596
+ }
597
+ );
598
+
599
+ // Add size button listener
600
+ bodyContent.on(
601
+ 'click', '#add_size', function (e) {
602
+ rahe.sis.sizes.add(e, this);
603
+ }
604
+ )
605
+
606
+ // Registering a new size listener
607
+ .on(
608
+ 'click', '.add_size_name', function (e) {
609
+ rahe.sis.sizes.register(e, this);
610
+ }
611
+ )
612
+
613
+ // Delete and Adding buttons
614
+ .on(
615
+ 'click', '.delete_size', function (e) {
616
+ rahe.sis.sizes.deleteSize(e, this);
617
+ }
618
+ )
619
+ .on(
620
+ 'click', '.add_size', function (e) {
621
+ rahe.sis.sizes.ajaxRegister(e, this);
622
+ }
623
+ )
624
+
625
+ .on(
626
+ 'click keyup change', '.h,.w,.c,.s,.n', function (e) {
627
+ rahe.sis.sizes.displayChange(this);
628
+ }
629
+ )
630
+
631
+ // Seup the getphp
632
+ .on(
633
+ 'click', '#get_php', function (e) {
634
+ rahe.sis.sizes.getPhp(e, this)
635
+ }
636
+ );
637
+ jQuery('#get_php').nextAll('code').hide();
638
+
639
+ jQuery(".add_size").hide();
640
+ }
641
+ );
classes/Main.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Rahe\Simple_Image_Sizes;
3
+
4
+ class Main {
5
+
6
+ public function __construct() {
7
+ // Make new image sizes.
8
+ add_action( 'init', [ __CLASS__, 'after_setup_theme' ], 1 );
9
+
10
+ // Add translation.
11
+ add_action( 'init', [ __CLASS__, 'init_translation' ], 2 );
12
+ }
13
+
14
+ /**
15
+ * Override the images by the plugin images
16
+ *
17
+ * @access public
18
+ * @return void
19
+ * @author Nicolas Juen
20
+ */
21
+ public static function after_setup_theme() {
22
+ // Get initial options.
23
+ $sizes = get_option( SIS_OPTION, [] );
24
+
25
+ // Return false if empty.
26
+ if ( empty( $sizes ) || ! is_array( $sizes ) ) {
27
+ return;
28
+ }
29
+
30
+ // Set the new sizes.
31
+ foreach ( $sizes as $name => $size ) {
32
+ if ( empty( $size ) || ! isset( $size['w'] ) || ! isset( $size['h'] ) ) {
33
+ continue;
34
+ }
35
+
36
+ $crop = ( isset( $size['c'] ) && ! empty( $size['c'] ) ) ? $size['c'] : false;
37
+
38
+ if ( is_bool( $crop ) || is_numeric( $crop ) ) {
39
+ $crop = ( 0 === absint( $crop ) ) ? false : true;
40
+ } elseif ( is_string( $crop ) ) {
41
+ $crop = explode( '_', $crop );
42
+ }
43
+
44
+ // Add the images sizes.
45
+ add_image_size( $name, $size['w'], $size['h'], $crop );
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Load the plugin text domain
51
+ *
52
+ * @return void
53
+ * @author Nicolas Juen
54
+ */
55
+ public static function init_translation() {
56
+ load_plugin_textdomain( 'simple-image-sizes', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
57
+ }
58
+ }
classes/admin/Main.php ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Rahe\Simple_Image_Sizes\Admin;
3
+
4
+ class Main {
5
+
6
+ public function __construct() {
7
+ add_action( 'admin_init', [ __CLASS__, 'register_assets' ] );
8
+ }
9
+
10
+ /**
11
+ * Register all the assets for the admin
12
+ */
13
+ public static function register_assets() {
14
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min';
15
+ // Add javascript.
16
+ wp_register_script(
17
+ 'sis_js', SIS_URL . 'assets/js/dist/app' . $suffix . '.js', [
18
+ 'jquery',
19
+ 'jquery-ui-button',
20
+ 'jquery-ui-progressbar',
21
+ 'underscore',
22
+ ], SIS_VERSION
23
+ );
24
+
25
+ // Add javascript translations.
26
+ wp_localize_script( 'sis_js', 'sis', self::localize_vars() );
27
+
28
+ // Add CSS.
29
+ wp_enqueue_style( 'sis_css', SIS_URL . 'assets/css/sis-style' . $suffix . '.css', [], SIS_VERSION );
30
+ }
31
+
32
+
33
+ /**
34
+ * Localize the var for javascript
35
+ *
36
+ * @access public
37
+ * @return array
38
+ * @author Nicolas Juen
39
+ */
40
+ public static function localize_vars() {
41
+ return array(
42
+ 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
43
+ 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
44
+ 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
45
+ 'crop' => __( 'Crop', 'simple-image-sizes' ),
46
+ 'tr' => __( 'yes', 'simple-image-sizes' ),
47
+ 'fl' => __( 'no', 'simple-image-sizes' ),
48
+ 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
49
+ 'of' => __( ' of ', 'simple-image-sizes' ),
50
+ 'or' => __( ' or ', 'simple-image-sizes' ),
51
+ 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
52
+ 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
53
+ 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
54
+ 'regenerating' => __( 'Regenerating ', 'simple-image-sizes' ),
55
+ 'regenerate' => __( 'Regenerate ', 'simple-image-sizes' ),
56
+ 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
57
+ 'done' => __( 'Done.', 'simple-image-sizes' ),
58
+ 'size' => __( 'Size', 'simple-image-sizes' ),
59
+ 'notOriginal' => __( 'Don\'t use the basic WordPress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
60
+ 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
61
+ 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
62
+ 'update' => __( 'Update', 'simple-image-sizes' ),
63
+ 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
64
+ 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
65
+ 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
66
+ 'startedAt' => __( ' started at', 'simple-image-sizes' ),
67
+ 'customName' => __( 'Public name', 'simple-image-sizes' ),
68
+ 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
69
+ 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
70
+ 'notSaved' => __( 'All the sizes you have modified are not saved, continue anyway ?', 'simple-image-sizes' ),
71
+
72
+ /*
73
+ * translators: %s is the number of seconds for the image generation.
74
+ */
75
+ 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
76
+ 'crop_positions' => self::get_available_crop(),
77
+ 'regen_one' => wp_create_nonce( 'regen' ),
78
+ );
79
+ }
80
+
81
+ /**
82
+ * Rebuild the given attribute with the given thumbnails
83
+ *
84
+ * @param int $att_id : The attachment_id.
85
+ * @param array $thumbnails : the thumbnails to re-generate.
86
+ *
87
+ * @return array
88
+ * @author Nicolas Juen
89
+ */
90
+ public static function thumbnail_rebuild( $att_id, $thumbnails = null ) {
91
+ // Time a the beginning.
92
+ timer_start();
93
+
94
+ // Check Id.
95
+ if ( (int) $att_id <= 0 ) {
96
+ return [
97
+ 'time' => timer_stop( false, 4 ),
98
+ 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' ),
99
+ ];
100
+ }
101
+
102
+ // Get the path.
103
+ $fullsizepath = get_attached_file( $att_id );
104
+
105
+ // Regen the attachment.
106
+ if ( false !== $fullsizepath && file_exists( $fullsizepath ) ) {
107
+ if ( false === wp_update_attachment_metadata( $att_id, self::wp_generate_attachment_metadata_custom( $att_id, $fullsizepath, $thumbnails ) ) ) {
108
+ return [
109
+ 'src' => wp_get_attachment_thumb_url( $att_id ),
110
+ 'time' => timer_stop( false, 4 ),
111
+ 'message' => sprintf(
112
+
113
+ /*
114
+ * Translators: First element is link to the attachment admin edit, second the title of the attachment
115
+ */
116
+ __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes' ),
117
+ get_edit_post_link( $att_id ),
118
+ get_the_title( $att_id )
119
+ ),
120
+ ];
121
+ }
122
+ } else {
123
+ return [
124
+ 'src' => wp_get_attachment_thumb_url( $att_id ),
125
+ 'time' => timer_stop( false, 4 ),
126
+ 'error' => sprintf(
127
+
128
+ /*
129
+ * Translators: First element is link to the attachment admin edit, second the title of the attachment
130
+ */
131
+ __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes' ),
132
+ get_edit_post_link( $att_id ),
133
+ get_the_title( $att_id )
134
+ ),
135
+ ];
136
+
137
+ }
138
+
139
+ // Display the attachment url for feedback.
140
+ return [
141
+ 'time' => timer_stop( false, 4 ),
142
+ 'src' => wp_get_attachment_thumb_url( $att_id ),
143
+ 'title' => get_the_title( $att_id ),
144
+ ];
145
+ }
146
+
147
+ /**
148
+ * Include the javascript template
149
+ *
150
+ * @return bool
151
+ */
152
+ public static function add_template() {
153
+ global $pagenow;
154
+ if ( 'options-media.php' !== $pagenow ) {
155
+ return false;
156
+ }
157
+
158
+ if ( is_file( SIS_DIR . '/templates/admin-js.html' ) ) {
159
+ include SIS_DIR . '/templates/admin-js.html';
160
+ }
161
+
162
+ return true;
163
+ }
164
+
165
+ /**
166
+ * Get all the available cropping
167
+ *
168
+ * @return array
169
+ *
170
+ * @author Nicolas Juen
171
+ */
172
+ public static function get_available_crop() {
173
+ global $wp_version;
174
+
175
+ // Return the only possible.
176
+ if ( version_compare( $wp_version, '3.9', '<' ) ) {
177
+ return [];
178
+ }
179
+
180
+ $x = [
181
+ 'left' => __( 'Left', 'simple-image-sizes' ),
182
+ 'center' => __( 'Center', 'simple-image-sizes' ),
183
+ 'right' => __( 'Right', 'simple-image-sizes' ),
184
+ ];
185
+
186
+ $y = [
187
+ 'top' => __( 'top', 'simple-image-sizes' ),
188
+ 'center' => __( 'center', 'simple-image-sizes' ),
189
+ 'bottom' => __( 'bottom', 'simple-image-sizes' ),
190
+ ];
191
+
192
+ /**
193
+ * Base crops
194
+ */
195
+ $crops = [
196
+ 0 => __( 'No', 'simple-image-sizes' ),
197
+ 1 => __( 'Yes', 'simple-image-sizes' ),
198
+ ];
199
+
200
+ foreach ( $x as $x_pos => $x_pos_label ) {
201
+ foreach ( $y as $y_pos => $y_pos_label ) {
202
+ $crops[ $x_pos . '_' . $y_pos ] = $x_pos_label . ' ' . $y_pos_label;
203
+ }
204
+ }
205
+
206
+ return $crops;
207
+ }
208
+
209
+ /**
210
+ * Check if the crop is available
211
+ *
212
+ * @param string $crop_position : the crop position slug.
213
+ *
214
+ * @return bool
215
+ * @author Nicolas Juen
216
+ */
217
+ public static function is_crop_position( $crop_position ) {
218
+ $crops = self::get_available_crop();
219
+
220
+ return is_bool( $crop_position ) ? $crop_position : isset( $crops[ $crop_position ] );
221
+ }
222
+
223
+ /**
224
+ * Return the crop position label from the slug
225
+ *
226
+ * @param string $crop_position : the crop position slug.
227
+ *
228
+ * @return string
229
+ * @author Nicolas Juen
230
+ */
231
+ public static function get_crop_position_label( $crop_position ) {
232
+ if ( ! self::is_crop_position( $crop_position ) ) {
233
+ return '';
234
+ }
235
+ $crops = self::get_available_crop();
236
+
237
+ return $crops[ $crop_position ];
238
+ }
239
+
240
+ /**
241
+ * Generate post thumbnail attachment meta data.
242
+ *
243
+ * @since 2.1.0
244
+ *
245
+ * @param int $attachment_id : Attachment Id to process.
246
+ * @param string $file : Filepath of the Attached image.
247
+ *
248
+ * @param null|array $thumbnails : thumbnails to regenerate, if null all
249
+ *
250
+ * @return mixed Metadata for attachment.
251
+ */
252
+ public static function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = null ) {
253
+ $attachment = get_post( $attachment_id );
254
+
255
+ $meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
256
+
257
+ $metadata = [];
258
+ if ( preg_match( '!^image/!', get_post_mime_type( $attachment ) ) && file_is_displayable_image( $file ) ) {
259
+ $imagesize = getimagesize( $file );
260
+ $metadata['width'] = $imagesize[0];
261
+ $metadata['height'] = $imagesize[1];
262
+ list( $uwidth, $uheight ) = wp_constrain_dimensions( $metadata['width'], $metadata['height'], 128, 96 );
263
+ $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
264
+
265
+ // Make the file path relative to the upload dir.
266
+ $metadata['file'] = _wp_relative_upload_path( $file );
267
+
268
+ // make thumbnails and other intermediate sizes.
269
+ global $_wp_additional_image_sizes;
270
+
271
+ foreach ( get_intermediate_image_sizes() as $s ) {
272
+ $sizes[ $s ] = [
273
+ 'width' => '',
274
+ 'height' => '',
275
+ 'crop' => false,
276
+ ];
277
+ if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
278
+ $sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
279
+ } // For theme-added sizes
280
+ else {
281
+ $sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
282
+ } // For default sizes set in options
283
+ if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
284
+ $sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
285
+ } // For theme-added sizes
286
+ else {
287
+ $sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
288
+ } // For default sizes set in options
289
+ if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
290
+ $sizes[ $s ]['crop'] = intval( $_wp_additional_image_sizes[ $s ]['crop'] );
291
+ } // For theme-added sizes
292
+ else {
293
+ $sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
294
+ } // For default sizes set in options
295
+ }
296
+
297
+ $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
298
+
299
+ // Only if not all sizes.
300
+ if ( isset( $thumbnails ) && is_array( $thumbnails ) && isset( $meta_datas['sizes'] ) && ! empty( $meta_datas['sizes'] ) ) {
301
+ // Fill the array with the other sizes not have to be done.
302
+ foreach ( $meta_datas['sizes'] as $name => $fsize ) {
303
+ $metadata['sizes'][ $name ] = $fsize;
304
+ }
305
+ }
306
+
307
+ foreach ( $sizes as $size => $size_data ) {
308
+ if ( isset( $thumbnails ) ) {
309
+ if ( ! in_array( $size, $thumbnails ) ) {
310
+ continue;
311
+ }
312
+ }
313
+
314
+ $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
315
+
316
+ if ( isset( $meta_datas['size'][ $size ] ) ) {
317
+ // Remove the size from the orignal sizes for after work.
318
+ unset( $meta_datas['size'][ $size ] );
319
+ }
320
+
321
+ if ( $resized ) {
322
+ $metadata['sizes'][ $size ] = $resized;
323
+ }
324
+ }
325
+
326
+ // fetch additional metadata from exif/iptc.
327
+ $image_meta = wp_read_image_metadata( $file );
328
+ if ( $image_meta ) {
329
+ $metadata['image_meta'] = $image_meta;
330
+ }
331
+ }
332
+
333
+ return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
334
+ }
335
+ }
classes/admin/Media.php ADDED
@@ -0,0 +1,570 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Rahe\Simple_Image_Sizes\Admin;
3
+
4
+ class Media {
5
+
6
+ /**
7
+ * Original WordPress sizes.
8
+ *
9
+ * @var array
10
+ */
11
+ public static $original = [
12
+ 'thumbnail',
13
+ 'medium',
14
+ 'large',
15
+ ];
16
+
17
+ public function __construct() {
18
+ // Init.
19
+ add_action( 'admin_menu', [ __CLASS__, 'init' ] );
20
+ add_action( 'admin_enqueue_scripts', [ __CLASS__, 'enqueue_assets' ], 11 );
21
+
22
+ // Add ajax action.
23
+ add_action( 'wp_ajax_sis_get_list', [ __CLASS__, 'a_get_list' ] );
24
+ add_action( 'wp_ajax_sis_rebuild_images', [ __CLASS__, 'a_thumbnails_rebuild' ] );
25
+ add_action( 'wp_ajax_sis_get_sizes', [ __CLASS__, 'a_get_sizes' ] );
26
+ add_action( 'wp_ajax_sis_add_size', [ __CLASS__, 'a_add_size' ] );
27
+ add_action( 'wp_ajax_sis_remove_size', [ __CLASS__, 'a_remove_size' ] );
28
+
29
+ // Add link in plugins list.
30
+ add_filter( 'plugin_action_links', [ __CLASS__, 'add_settings_link' ], 10, 2 );
31
+ }
32
+
33
+ /**
34
+ * Register javascripts and css.
35
+ *
36
+ * @access public
37
+ *
38
+ * @param string $hook_suffix
39
+ *
40
+ * @author Nicolas Juen
41
+ */
42
+ public static function enqueue_assets( $hook_suffix = '' ) {
43
+ if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
44
+ return;
45
+ }
46
+
47
+ $suffixes = [ 'options-media.php', 'settings_page_media' ];
48
+ if ( ! in_array( $hook_suffix, $suffixes, true ) ) {
49
+ return;
50
+ }
51
+
52
+ // Add javascript.
53
+ wp_enqueue_script( 'sis_js' );
54
+
55
+ // Add CSS.
56
+ wp_enqueue_style( 'sis_css' );
57
+
58
+ // Add underscore template.
59
+ add_action( 'admin_footer', [ 'Rahe\Simple_Image_Sizes\Admin\Main', 'add_template' ] );
60
+ }
61
+
62
+
63
+ /**
64
+ * Add a link to the setting option page
65
+ *
66
+ * @access public
67
+ *
68
+ * @param array $links : the admin links.
69
+ * @param string $file : the file concerned in the row.
70
+ *
71
+ * @return array
72
+ * @author Nicolas Juen
73
+ */
74
+ public static function add_settings_link( $links = array(), $file = '' ) {
75
+
76
+ if ( 'simple-image-sizes/simple_image_sizes.php' !== $file ) {
77
+ return $links;
78
+ }
79
+
80
+ $settings_link = sprintf( '<a href="%s"> %s </a>', admin_url( 'options-media.php' ), __( 'Settings', 'simple-image-sizes' ) );
81
+ array_unshift( $links, $settings_link );
82
+
83
+ return $links;
84
+ }
85
+
86
+ /**
87
+ * Init for the option page
88
+ *
89
+ * @access public
90
+ * @return void
91
+ * @author Nicolas Juen
92
+ */
93
+ public static function init() {
94
+ // Check if admin.
95
+ if ( ! is_admin() ) {
96
+ return;
97
+ }
98
+
99
+ // Get the image sizes.
100
+ global $_wp_additional_image_sizes;
101
+
102
+ // Get the sizes and add the settings.
103
+ foreach ( get_intermediate_image_sizes() as $s ) {
104
+ // Don't make the original sizes or numeric sizes that appear.
105
+ if ( in_array( $s, self::$original ) || is_integer( $s ) ) {
106
+ continue;
107
+ }
108
+
109
+ // Set width.
110
+ $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
111
+
112
+ // Set height.
113
+ $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
114
+
115
+ // Set crop.
116
+ $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? intval( $_wp_additional_image_sizes[ $s ]['crop'] ) : get_option( "{$s}_crop" );
117
+
118
+ // Add the setting field for this size.
119
+ add_settings_field(
120
+ 'image_size_' . $s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), [
121
+ __CLASS__,
122
+ 'image_sizes',
123
+ ], 'media', 'default', [
124
+ 'name' => $s,
125
+ 'width' => $width,
126
+ 'height' => $height,
127
+ 'c' => $crop,
128
+ ]
129
+ );
130
+ }
131
+
132
+ // Register the setting for media option page.
133
+ register_setting( 'media', SIS_OPTION );
134
+
135
+ // Add the button.
136
+ add_settings_field(
137
+ 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), [
138
+ __CLASS__,
139
+ 'addSizeButton',
140
+ ], 'media'
141
+ );
142
+
143
+ // Add php button.
144
+ add_settings_field(
145
+ 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), [
146
+ __CLASS__,
147
+ 'getPhpButton',
148
+ ], 'media'
149
+ );
150
+
151
+ // Add section for the thumbnail regeneration.
152
+ add_settings_section(
153
+ 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), [
154
+ __CLASS__,
155
+ 'thumbnailRegenerate',
156
+ ], 'media'
157
+ );
158
+ }
159
+
160
+ /**
161
+ * Display the row of the image size
162
+ *
163
+ * @access public
164
+ *
165
+ * @param mixed $args
166
+ *
167
+ * @return void
168
+ * @author Nicolas Juen
169
+ */
170
+ public static function image_sizes( $args ) {
171
+
172
+ if ( is_integer( $args['name'] ) ) {
173
+ return;
174
+ }
175
+
176
+ // Get the options.
177
+ $sizes = (array) get_option( SIS_OPTION, [] );
178
+
179
+ // Get the vars.
180
+ $height = isset( $sizes[ $args['name'] ]['h'] ) ? $sizes[ $args['name'] ]['h'] : $args['height'];
181
+ $width = isset( $sizes[ $args['name'] ]['w'] ) ? $sizes[ $args['name'] ]['w'] : $args['width'];
182
+ $crop = isset( $sizes[ $args['name'] ]['c'] ) && ! empty( $sizes[ $args['name'] ]['c'] ) ? $sizes[ $args['name'] ]['c'] : $args['c'];
183
+ $show = isset( $sizes[ $args['name'] ]['s'] ) && ! empty( $sizes[ $args['name'] ]['s'] ) ? '1' : '0';
184
+ $custom = isset( $sizes[ $args['name'] ]['custom'] ) && ! empty( $sizes[ $args['name'] ]['custom'] ) ? '1' : '0';
185
+ $name = isset( $sizes[ $args['name'] ]['n'] ) && ! empty( $sizes[ $args['name'] ]['n'] ) ? esc_html( $sizes[ $args['name'] ]['n'] ) : esc_html( $args['name'] );
186
+ ?>
187
+ <input type="hidden" value="<?php echo esc_attr( $args['name'] ); ?>" name="image_name"/>
188
+ <?php if ( $custom ) : ?>
189
+ <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" type="hidden"
190
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" value="1"/>
191
+ <?php else : ?>
192
+ <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" type="hidden"
193
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" value="1"/>
194
+ <?php endif; ?>
195
+ <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>">
196
+ <?php _e( 'Maximum width', 'simple-image-sizes' ); ?>
197
+ <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>" class='w small-text'
198
+ type="number" step='1' min='0'
199
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>"
200
+ base_w='<?php echo esc_attr( $width ); ?>' value="<?php echo esc_attr( $width ); ?>"/>
201
+ </label>
202
+ <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>">
203
+ <?php _e( 'Maximum height', 'simple-image-sizes' ); ?>
204
+ <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>" class='h small-text'
205
+ type="number" step='1' min='0'
206
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>"
207
+ base_h='<?php echo esc_attr( $height ); ?>' value="<?php echo esc_attr( $height ); ?>"/>
208
+ </label>
209
+ <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>">
210
+ <?php _e( 'Public name', 'simple-image-sizes' ); ?>
211
+ <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>" class='n'
212
+ type="text" id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>"
213
+ base_n='<?php echo $name; ?>' value="<?php echo $name; ?>"/>
214
+ </label>
215
+ <span class="size_options">
216
+ <label class="c"
217
+ for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes' ); ?></label>
218
+ <select id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>" class="c crop"
219
+ base_c='<?php echo esc_attr( $crop ); ?>'
220
+ name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>">
221
+
222
+ <?php foreach ( Main::get_available_crop() as $crop_position => $label ) : ?>
223
+ <option <?php selected( $crop_position, $crop ); ?>
224
+ value="<?php echo esc_attr( $crop_position ); ?>"><?php echo esc_html( $label ); ?></option>
225
+ <?php endforeach; ?>
226
+ </select>
227
+
228
+ <input type='checkbox'
229
+ id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" <?php checked( $show, 1 ); ?>
230
+ class="s show" base_s='<?php echo esc_attr( $show ); ?>'
231
+ name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" value="1"/>
232
+ <label class="s"
233
+ for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>"><?php _e( 'Show in post insertion ?', 'simple-image-sizes' ); ?></label>
234
+ </span>
235
+ <span class="delete_size button-secondary"><?php _e( 'Delete', 'simple-image-sizes' ); ?></span>
236
+ <span class="add_size validate_size button-primary"><?php _e( 'Update', 'simple-image-sizes' ); ?></span>
237
+
238
+ <input type="hidden" class="deleteSize button-primary"
239
+ value='<?php echo wp_create_nonce( 'delete_' . $args['name'] ); ?>'/>
240
+ <?php
241
+ }
242
+
243
+ /**
244
+ * Add the button to add a size
245
+ *
246
+ * @access public
247
+ * @return void
248
+ * @author Nicolas Juen
249
+ */
250
+ public static function addSizeButton() {
251
+ ?>
252
+ <input type="button" class="button-secondary action" id="add_size"
253
+ value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes' ); ?>"/>
254
+ <?php
255
+ }
256
+
257
+ /**
258
+ * Add the button to get the php for th sizes
259
+ *
260
+ * @access public
261
+ * @return void
262
+ * @author Nicolas Juen
263
+ */
264
+ public static function getPhpButton() {
265
+ ?>
266
+ <input type="button" class="button-secondary action" id="get_php"
267
+ value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes' ); ?>"/>
268
+ <p> <?php _e( 'Copy and paste the code below into your WordPress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes' ); ?> </p>
269
+ <code id="sis_get_php"></code>
270
+ <?php
271
+ }
272
+
273
+ /**
274
+ * Display the Table of sizes and post types for regenerating
275
+ *
276
+ * @access public
277
+ * @return void
278
+ * @author Nicolas Juen
279
+ */
280
+ public static function thumbnailRegenerate() {
281
+ if ( is_file( SIS_DIR . '/templates/options-media.php' ) ) {
282
+ include SIS_DIR . '/templates/options-media.php';
283
+ } else {
284
+ esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
285
+ }
286
+ }
287
+
288
+ /**
289
+ * Add a size by Ajax
290
+ *
291
+ * @access public
292
+ * @return void
293
+ * @author Nicolas Juen
294
+ */
295
+ public static function a_add_size() {
296
+
297
+ // Get the nonce
298
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
299
+
300
+ // Get old options
301
+ $sizes = (array) get_option( SIS_OPTION, [] );
302
+ $croppings = Main::get_available_crop();
303
+ $croppings[ true ] = '';
304
+ $croppings[ false ] = '';
305
+
306
+ // Check entries
307
+ $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
308
+ $height = ! isset( $_POST['height'] ) ? 0 : absint( $_POST['height'] );
309
+ $width = ! isset( $_POST['width'] ) ? 0 : absint( $_POST['width'] );
310
+ $crop = isset( $_POST['crop'] ) && isset( $croppings[ $_POST['crop'] ] ) ? $_POST['crop'] : false;
311
+ $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
312
+ $cn = isset( $_POST['customName'] ) && ! empty( $_POST['customName'] ) ? sanitize_text_field( $_POST['customName'] ) : $name;
313
+
314
+ // Check the nonce
315
+ if ( ! wp_verify_nonce( $nonce, 'add_size' ) ) {
316
+ die( 0 );
317
+ }
318
+
319
+ // If no name given do not save
320
+ if ( empty( $name ) ) {
321
+ die( 0 );
322
+ }
323
+
324
+ // Make values
325
+ $values = [
326
+ 'custom' => 1,
327
+ 'w' => $width,
328
+ 'h' => $height,
329
+ 'c' => $crop,
330
+ 's' => $show,
331
+ 'n' => $cn,
332
+ ];
333
+
334
+ // If the size have not changed return 2
335
+ if ( isset( $sizes[ $name ] ) && $sizes[ $name ] === $values ) {
336
+ die( 2 );
337
+ }
338
+
339
+ // Put the new values
340
+ $sizes[ $name ] = $values;
341
+
342
+ // display update result
343
+ echo (int) update_option( 'custom_image_sizes', $sizes );
344
+ die();
345
+ }
346
+
347
+ /**
348
+ * Remove a size by Ajax
349
+ *
350
+ * @access public
351
+ * @return void
352
+ * @author Nicolas Juen
353
+ */
354
+ public static function a_remove_size() {
355
+
356
+ // Get old options
357
+ $sizes = (array) get_option( SIS_OPTION, [] );
358
+
359
+ // Get the nonce and name
360
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
361
+ $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
362
+
363
+ // Check the nonce
364
+ if ( ! wp_verify_nonce( $nonce, 'delete_' . $name ) ) {
365
+ die( 0 );
366
+ }
367
+
368
+ // Remove the size
369
+ unset( $sizes[ sanitize_title( $name ) ] );
370
+ unset( $sizes[0] );
371
+
372
+ // Display the results
373
+ echo (int) update_option( SIS_OPTION, $sizes );
374
+ die();
375
+ }
376
+
377
+ /**
378
+ * Display the add_image_size for the registered sizes
379
+ *
380
+ * @access public
381
+ * @return void
382
+ */
383
+ public static function a_get_sizes() {
384
+ global $_wp_additional_image_sizes, $wp_version;
385
+
386
+ foreach ( get_intermediate_image_sizes() as $s ) {
387
+ // Don't make the original sizes
388
+ if ( in_array( $s, self::$original ) ) {
389
+ continue;
390
+ }
391
+
392
+ // Set width
393
+ $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
394
+
395
+ // Set height
396
+ $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
397
+
398
+ //Set crop
399
+ $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
400
+
401
+ if ( is_bool( $crop ) || is_numeric( $crop ) || version_compare( $wp_version, '3.9', '<' ) ) {
402
+ $crop = ( absint( $crop ) == 0 ) ? 'false' : 'true';
403
+ } else {
404
+ if ( ! Main::is_crop_position( implode( '_', $crop ) ) ) {
405
+ $crop = 'false';
406
+ } else {
407
+ $crop = '[ "' . $crop[0] . '", "' . $crop[1] . '")';
408
+ }
409
+ }
410
+ ?>
411
+ add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop; ?> );
412
+ <br/>
413
+ <?php
414
+ }
415
+
416
+ die();
417
+ }
418
+
419
+ /**
420
+ *
421
+ * Get the media list to regenerate
422
+ *
423
+ * @param : void
424
+ *
425
+ * @return void
426
+ */
427
+ public static function a_get_list() {
428
+ /**
429
+ * @var \wpdb $wpdb
430
+ */
431
+ global $wpdb;
432
+
433
+ // Basic vars
434
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
435
+
436
+ // Check the nonce
437
+ if ( ! wp_verify_nonce( $nonce, 'getList' ) ) {
438
+ wp_send_json( [] );
439
+ }
440
+
441
+ if ( isset( $_POST['post_types'] ) && ! empty( $_POST['post_types'] ) ) {
442
+
443
+ foreach ( $_POST['post_types'] as $key => $type ) {
444
+ if ( ! post_type_exists( $type ) ) {
445
+ unset( $_POST['post_types'][ $key ] );
446
+ }
447
+ }
448
+
449
+ if ( empty( $_POST['post_types'][ $key ] ) ) {
450
+ wp_send_json( [] );
451
+ }
452
+
453
+ // Get image medias.
454
+ $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
455
+
456
+ // Get all parent from post type.
457
+ $attachments = $wpdb->get_var(
458
+ "SELECT COUNT( ID )
459
+ FROM $wpdb->posts
460
+ WHERE 1 = 1
461
+ AND post_type = 'attachment'
462
+ $whichmimetype
463
+ AND post_parent IN (
464
+ SELECT DISTINCT ID
465
+ FROM $wpdb->posts
466
+ WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
467
+ )"
468
+ );
469
+ // Return the Id's and Title of medias
470
+ wp_send_json( [ 'total' => $attachments ] );
471
+
472
+ } else {
473
+ $attachments = get_children(
474
+ [
475
+ 'post_type' => 'attachment',
476
+ 'post_mime_type' => 'image',
477
+ 'numberposts' => - 1,
478
+ 'post_status' => null,
479
+ 'post_parent' => null, // any parent
480
+ 'output' => 'ids',
481
+ ]
482
+ );
483
+ // Return the Id's and Title of medias
484
+ wp_send_json( [ 'total' => count( $attachments ) ] );
485
+ }
486
+
487
+ }
488
+
489
+ /**
490
+ * Regenerate the thumbnails ajax action
491
+ *
492
+ * @param void
493
+ *
494
+ * @author Nicolas Juen
495
+ */
496
+ public static function a_thumbnails_rebuild() {
497
+ /**
498
+ * @var $wpdb \wpdb
499
+ */
500
+ global $wpdb;
501
+
502
+ // Get the nonce
503
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
504
+ $offset = isset( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 0;
505
+ $post_types = isset( $_POST['post_types'] ) ? $_POST['post_types'] : 'any';
506
+ $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
507
+
508
+ // Check the nonce
509
+ if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
510
+ wp_send_json( [ 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ] );
511
+ }
512
+
513
+ if ( 'any' !== $post_types ) {
514
+
515
+ foreach ( $_POST['post_types'] as $key => $type ) {
516
+ if ( ! post_type_exists( $type ) ) {
517
+ unset( $_POST['post_types'][ $key ] );
518
+ }
519
+ }
520
+
521
+ if ( empty( $_POST['post_types'] ) ) {
522
+ wp_send_json( [] );
523
+ }
524
+
525
+ // Get image medias
526
+ $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
527
+
528
+ // Get all parent from post type
529
+ $attachment = $wpdb->get_var(
530
+ $wpdb->prepare(
531
+ "SELECT ID
532
+ FROM $wpdb->posts
533
+ WHERE 1 = 1
534
+ AND post_type = 'attachment'
535
+ $whichmimetype
536
+ AND post_parent IN (
537
+ SELECT DISTINCT ID
538
+ FROM $wpdb->posts
539
+ WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
540
+ )
541
+ LIMIT %d,1
542
+ ", $offset
543
+ )
544
+ );
545
+
546
+ } else {
547
+ $attachment = get_posts(
548
+ [
549
+ 'post_type' => 'attachment',
550
+ 'post_mime_type' => 'image',
551
+ 'numberposts' => 1,
552
+ 'post_status' => 'any',
553
+ 'output' => 'object',
554
+ 'offset' => $offset,
555
+ ]
556
+ );
557
+
558
+ $attachment = ! empty( $attachment ) ? $attachment[0]->ID : 0;
559
+ }
560
+
561
+ if ( empty( $attachment ) ) {
562
+ wp_send_json(
563
+ [
564
+ 'message' => __( 'Regeneration ended', 'simple-image-sizes' ),
565
+ ]
566
+ );
567
+ }
568
+ wp_send_json( Main::thumbnail_rebuild( $attachment, $thumbnails ) );
569
+ }
570
+ }
classes/admin/Post.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Rahe\Simple_Image_Sizes\Admin;
3
+
4
+ class Post {
5
+ public function __construct() {
6
+
7
+ add_filter( 'image_size_names_choose', [ __CLASS__, 'add_thumbnail_name' ] );
8
+
9
+ add_action( 'admin_enqueue_scripts', [ __CLASS__, 'enqueue_assets' ], 11 );
10
+
11
+ // Rebuilt the image.
12
+ add_action( 'wp_ajax_sis_rebuild_image', [ __CLASS__, 'a_thumbnail_rebuild' ] );
13
+
14
+ // Rebuild featured.
15
+ add_action( 'wp_ajax_sis_rebuild_featured', [ __CLASS__, 'a_featured_rebuild' ] );
16
+
17
+ // Add action in media row quick actions.
18
+ add_filter( 'media_row_actions', [ __CLASS__, 'add_actions_list' ], 10, 2 );
19
+
20
+ // Add filter for the Media single.
21
+ add_filter( 'attachment_fields_to_edit', [ __CLASS__, 'add_field_regenerate' ], 9, 2 );
22
+
23
+ // Media regenerate on admin featured.
24
+ add_filter( 'admin_post_thumbnail_html', [ __CLASS__, 'admin_post_thumbnail_html' ], 10, 2 );
25
+ }
26
+
27
+ /**
28
+ * Generate HTML on the featured image size.
29
+ *
30
+ * @param string $content : the content of the post_thumbnail view.
31
+ * @param int $ID : the ID of the content concerned.
32
+ *
33
+ * @return string
34
+ */
35
+ public static function admin_post_thumbnail_html( $content, $ID ) {
36
+ /**
37
+ * Allow to not display the regenerate image link
38
+ */
39
+ if ( false === apply_filters( 'SIS/Admin/Post/Display_Thumbnail_Regenerate', true ) ) {
40
+ return $content;
41
+ }
42
+
43
+ /**
44
+ * Do not display if post_Type does not support it
45
+ */
46
+ if ( false === post_type_supports( get_post_type(), 'thumbnail' ) ) {
47
+ return $content;
48
+ }
49
+
50
+ $content .= '<span class="spinner"></span>';
51
+ $content .= sprintf(
52
+ "<a id='sis_featured_regenerate' data-nonce='%s' href='#' >%s</a>",
53
+ wp_create_nonce( 'sis-regenerate-featured-' . $ID ),
54
+ esc_html__( 'Regenerate image sizes', 'simple-image-sizes' )
55
+ );
56
+ $content .= '<div class="sis_message"></div>';
57
+
58
+ return $content;
59
+ }
60
+
61
+ /**
62
+ * Rebuild the image size of a content featured image
63
+ */
64
+ public static function a_featured_rebuild() {
65
+ // Get the nonce.
66
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
67
+
68
+ // Get the thumbnails.
69
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : null;
70
+
71
+ // Check the nonce.
72
+ if ( ! wp_verify_nonce( $nonce, 'sis-regenerate-featured-' . $id ) || ! \current_user_can( 'manage_options' ) ) {
73
+ wp_send_json( [ 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ] );
74
+ }
75
+
76
+ $attachment_id = get_post_thumbnail_id( $id );
77
+
78
+ if ( ! has_post_thumbnail( $id ) || is_null( $attachment_id ) ) {
79
+ wp_send_json( [ 'error' => __( 'There is no media attached to this content.', 'simple-image-sizes' ) ] );
80
+ }
81
+
82
+ // Get the id.
83
+ wp_send_json( Main::thumbnail_rebuild( $attachment_id ) );
84
+ }
85
+
86
+ /**
87
+ * Register javascripts and css.
88
+ *
89
+ * @access public
90
+ *
91
+ * @param string $hook_suffix : the hook for the current page.
92
+ *
93
+ * @author Nicolas Juen
94
+ */
95
+ public static function enqueue_assets( $hook_suffix = '' ) {
96
+ if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
97
+ return;
98
+ }
99
+
100
+ /**
101
+ * Enqueue the assets for the featured image only on the edit pages and the post types that supports it
102
+ */
103
+ if ( in_array( $hook_suffix, [ 'post-new.php', 'post.php' ] ) ) {
104
+ if ( post_type_supports( get_post_type( get_post() ), 'thumbnail' ) ) {
105
+ // Add javascript.
106
+ wp_enqueue_script( 'sis_js' );
107
+ }
108
+ }
109
+
110
+ if ( 'upload.php' === $hook_suffix || ( 'post.php' === $hook_suffix && isset( $_GET['post'] ) && isset( $_GET['action'] ) && 'edit' == $_GET['action'] ) ) {
111
+ // Add javascript.
112
+ wp_enqueue_script( 'sis_js' );
113
+
114
+ // Add underscore template.
115
+ add_action( 'admin_footer', [ 'Rahe\Simple_Image_Sizes\Admin\Main', 'add_template' ] );
116
+ }
117
+ }
118
+
119
+ /**
120
+ * Rebuild the image
121
+ *
122
+ * @access public
123
+ * @return void
124
+ * @author Nicolas Juen
125
+ */
126
+ public static function a_thumbnail_rebuild() {
127
+ // Get the nonce.
128
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
129
+
130
+ // Get the thumbnails.
131
+ $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
132
+
133
+ // Check the nonce.
134
+ if ( ! wp_verify_nonce( $nonce, 'regen' ) || ! \current_user_can( 'manage_options' ) ) {
135
+ wp_send_json( [ 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ] );
136
+ }
137
+
138
+ // Get the id.
139
+ $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
140
+ wp_send_json( Main::thumbnail_rebuild( $id, $thumbnails ) );
141
+ }
142
+
143
+ /**
144
+ * Add the thumbnail name in the post insertion, based on new WP filter
145
+ *
146
+ * @access public
147
+ *
148
+ * @param array $sizes : the sizes.
149
+ *
150
+ * @return array
151
+ * @since 2.3
152
+ * @author Nicolas Juen
153
+ * @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
154
+ */
155
+ public static function add_thumbnail_name( array $sizes ) {
156
+ // Get options.
157
+ $sizes_custom = get_option( SIS_OPTION, [] );
158
+
159
+ // init size array.
160
+ $add_sizes = [];
161
+
162
+ // check there is custom sizes.
163
+ if ( is_array( $sizes_custom ) && ! empty( $sizes_custom ) ) {
164
+ foreach ( $sizes_custom as $key => $value ) {
165
+ // If we show this size in the admin.
166
+ if ( ! isset( $value['s'] ) || 1 !== (int) $value['s'] ) {
167
+ continue;
168
+ }
169
+ $add_sizes[ $key ] = self::get_thumbnail_name( $key );
170
+ }
171
+ }
172
+
173
+ // Merge the two array.
174
+ $new_sizes = array_merge( $sizes, $add_sizes );
175
+
176
+ // Add new size.
177
+ return $new_sizes;
178
+ }
179
+
180
+ /**
181
+ * Get a thumbnail name from its slug
182
+ *
183
+ * @access private
184
+ *
185
+ * @param string $thumbnail_slug : the slug of the thumbnail.
186
+ *
187
+ * @return string
188
+ * @since 2.3
189
+ * @author Nicolas Juen
190
+ */
191
+ private static function get_thumbnail_name( $thumbnail_slug = '' ) {
192
+
193
+ // get the options.
194
+ $sizes_custom = get_option( SIS_OPTION );
195
+
196
+ if ( ! isset( $sizes_custom[ $thumbnail_slug ] ) ) {
197
+ // return slug if not found.
198
+ return $thumbnail_slug;
199
+ }
200
+
201
+ // If the name exists return it, slug by default.
202
+ if ( isset( $sizes_custom[ $thumbnail_slug ]['n'] ) && ! empty( $sizes_custom[ $thumbnail_slug ]['n'] ) ) {
203
+ return $sizes_custom[ $thumbnail_slug ]['n'];
204
+ }
205
+
206
+ return $thumbnail_slug;
207
+ }
208
+
209
+
210
+ /**
211
+ * Add action in media row
212
+ *
213
+ * @since 2.2
214
+ * @access public
215
+ *
216
+ * @param array $actions : array of actions and content to display.
217
+ * @param \WP_Post $object : the WordPress object for the actions.
218
+ *
219
+ * @return array $actions
220
+ * @author Nicolas Juen
221
+ */
222
+ public static function add_actions_list( $actions, $object ) {
223
+ if ( ! wp_attachment_is_image( $object->ID ) ) {
224
+ return $actions;
225
+ }
226
+ // Add action for regeneration.
227
+ $actions['sis-regenerate'] = sprintf( "<a href='#' data-id='%s' class='sis-regenerate-one'>%s</a>", esc_attr( $object->ID ), esc_html__( 'Regenerate thumbnails', 'simple-image-sizes' ) );
228
+
229
+ // Return actions.
230
+ return $actions;
231
+ }
232
+
233
+
234
+ /**
235
+ * Get a thumbnail name from its slug
236
+ *
237
+ * @access public
238
+ *
239
+ * @param array $fields : the fields of the media.
240
+ * @param \WP_Post $post : the post object.
241
+ *
242
+ * @return array
243
+ * @since 2.3.1
244
+ * @author Nicolas Juen
245
+ */
246
+ public static function add_field_regenerate( $fields, $post ) {
247
+ // Check this is an image.
248
+ if ( false === strpos( $post->post_mime_type, 'image' ) ) {
249
+ return $fields;
250
+ }
251
+
252
+ $fields['sis-regenerate'] = [
253
+ 'label' => __( 'Regenerate Thumbnails', 'simple-image-sizes' ),
254
+ 'input' => 'html',
255
+ 'html' => sprintf(
256
+ '
257
+ <input type="button" data-id="%s" class="button title sis-regenerate-one" value="%s" />
258
+ <span class="spinner"></span>
259
+ <span class="title"><em></em></span>
260
+ <input type="hidden" class="regen" value="%s" />',
261
+ esc_attr( $post->ID ),
262
+ esc_attr__( 'Regenerate Thumbnails', 'simple-image-sizes' ),
263
+ wp_create_nonce( 'regen' )
264
+ ),
265
+ 'show_in_edit' => true,
266
+ 'show_in_modal' => false,
267
+ ];
268
+
269
+ return $fields;
270
+ }
271
+ }
css/Aristo/images/bg_fallback.png DELETED
Binary file
css/Aristo/images/icon_sprite.png DELETED
Binary file
css/Aristo/images/progress_bar.gif DELETED
Binary file
css/Aristo/images/slider_handles.png DELETED
Binary file
css/Aristo/images/ui-icons_222222_256x240.png DELETED
Binary file
css/Aristo/images/ui-icons_454545_256x240.png DELETED
Binary file
css/Aristo/jquery-ui-1.8.7.custom.css DELETED
@@ -1,740 +0,0 @@
1
- /*
2
- * jQuery UI CSS Framework 1.8.7
3
- *
4
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI/Theming/API
9
- */
10
-
11
- /* Layout helpers
12
- ----------------------------------*/
13
- .ui-helper-hidden { display: none; }
14
- .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
- .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
- .ui-helper-clearfix { display: inline-block; }
18
- /* required comment for clearfix to work in Opera \*/
19
- * html .ui-helper-clearfix { height:1%; }
20
- .ui-helper-clearfix { display:block; }
21
- /* end clearfix */
22
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
-
24
-
25
- /* Interaction Cues
26
- ----------------------------------*/
27
- .ui-state-disabled { cursor: default !important; }
28
-
29
-
30
- /* Icons
31
- ----------------------------------*/
32
-
33
- /* states and images */
34
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
-
36
-
37
- /* Misc visuals
38
- ----------------------------------*/
39
-
40
- /* Overlays */
41
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
-
43
-
44
- /*
45
- * jQuery UI CSS Framework 1.8.7
46
- *
47
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
48
- * Dual licensed under the MIT or GPL Version 2 licenses.
49
- * http://jquery.org/license
50
- *
51
- * http://docs.jquery.com/UI/Theming/API
52
- *
53
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller
54
- */
55
-
56
-
57
- /* Component containers
58
- ----------------------------------*/
59
- .ui-widget { font-family: Helvetica,Arial,sans-serif; font-size: 1.1em; }
60
- .ui-widget .ui-widget { font-size: 1em; }
61
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Helvetica,Arial,sans-serif; font-size: 1em; }
62
- .ui-widget-content { border: 1px solid #B6B6B6; background: #ffffff; color: #4F4F4F; }
63
- .ui-widget-content a { color: #4F4F4F; }
64
- .ui-widget-header { border: 1px solid #B6B6B6; color: #4F4F4F; font-weight: bold; }
65
- .ui-widget-header {
66
- background: url(images/bg_fallback.png) 0 0 repeat-x;
67
- background: -webkit-gradient(
68
- linear,
69
- left bottom,
70
- left top,
71
- color-stop(1, rgb(237,237,237)),
72
- color-stop(0, rgb(196,196,196))
73
- );
74
- background: -moz-linear-gradient(
75
- center top,
76
- rgb(237,237,237),
77
- rgb(196,196,196)
78
- );
79
- }
80
- .ui-widget-header a { color: #4F4F4F; }
81
-
82
- /* Interaction states
83
- ----------------------------------*/
84
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B6B6B6; font-weight: normal; color: #4F4F4F; }
85
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
86
- background: url(images/bg_fallback.png) 0 0 repeat-x;
87
- background: -webkit-gradient(
88
- linear,
89
- left bottom,
90
- left top,
91
- color-stop(1, rgb(237,237,237)),
92
- color-stop(0, rgb(196,196,196))
93
- );
94
- background: -moz-linear-gradient(
95
- center top,
96
- rgb(237,237,237),
97
- rgb(196,196,196)
98
- );
99
- -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
100
- -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
101
- }
102
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #4F4F4F; text-decoration: none; }
103
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #9D9D9D; font-weight: normal; color: #313131; }
104
- .ui-state-hover a, .ui-state-hover a:hover { color: #313131; text-decoration: none; }
105
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
106
- outline: none;
107
- color: #1c4257; border: 1px solid #7096ab;
108
- background: url(images/bg_fallback.png) 0 -50px repeat-x;
109
- background: -webkit-gradient(
110
- linear,
111
- left bottom,
112
- left top,
113
- color-stop(1, rgb(185,224,245)),
114
- color-stop(0, rgb(146,189,214))
115
- );
116
- background: -moz-linear-gradient(
117
- center top,
118
- rgb(185,224,245),
119
- rgb(146,189,214)
120
- );
121
- -webkit-box-shadow: none;
122
- -moz-box-shadow: none;
123
- }
124
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #313131; text-decoration: none; }
125
- .ui-widget :active { outline: none; }
126
-
127
- /* Interaction Cues
128
- ----------------------------------*/
129
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #d2dbf4; background: #f4f8fd; color: #0d2054; -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; border-radius: 0 !important; }
130
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
131
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #e2d0d0; background: #fcf0f0; color: #280b0b; -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; border-radius: 0 !important; }
132
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
133
- .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
134
- .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
135
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
136
- .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
137
-
138
- /* Icons
139
- ----------------------------------*/
140
-
141
- /* states and images */
142
- .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
143
- .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
144
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
145
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_454545_256x240.png); }
146
- .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
147
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
148
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
149
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background: url(images/icon_sprite.png) -16px 0 no-repeat !important; }
150
- .ui-state-highlight .ui-icon, .ui-state-error .ui-icon { margin-top: -1px; }
151
-
152
- /* positioning */
153
- .ui-icon-carat-1-n { background-position: 0 0; }
154
- .ui-icon-carat-1-ne { background-position: -16px 0; }
155
- .ui-icon-carat-1-e { background-position: -32px 0; }
156
- .ui-icon-carat-1-se { background-position: -48px 0; }
157
- .ui-icon-carat-1-s { background-position: -64px 0; }
158
- .ui-icon-carat-1-sw { background-position: -80px 0; }
159
- .ui-icon-carat-1-w { background-position: -96px 0; }
160
- .ui-icon-carat-1-nw { background-position: -112px 0; }
161
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
162
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
163
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
164
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
165
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
166
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
167
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
168
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
169
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
170
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
171
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
172
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
173
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
174
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
175
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
176
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
177
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
178
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
179
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
180
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
181
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
182
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
183
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
184
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
185
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
186
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
187
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
188
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
189
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
190
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
191
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
192
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
193
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
194
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
195
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
196
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
197
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
198
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
199
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
200
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
201
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
202
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
203
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
204
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
205
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
206
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
207
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
208
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
209
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
210
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
211
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
212
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
213
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
214
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
215
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
216
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
217
- .ui-icon-arrow-4 { background-position: 0 -80px; }
218
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
219
- .ui-icon-extlink { background-position: -32px -80px; }
220
- .ui-icon-newwin { background-position: -48px -80px; }
221
- .ui-icon-refresh { background-position: -64px -80px; }
222
- .ui-icon-shuffle { background-position: -80px -80px; }
223
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
224
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
225
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
226
- .ui-icon-folder-open { background-position: -16px -96px; }
227
- .ui-icon-document { background-position: -32px -96px; }
228
- .ui-icon-document-b { background-position: -48px -96px; }
229
- .ui-icon-note { background-position: -64px -96px; }
230
- .ui-icon-mail-closed { background-position: -80px -96px; }
231
- .ui-icon-mail-open { background-position: -96px -96px; }
232
- .ui-icon-suitcase { background-position: -112px -96px; }
233
- .ui-icon-comment { background-position: -128px -96px; }
234
- .ui-icon-person { background-position: -144px -96px; }
235
- .ui-icon-print { background-position: -160px -96px; }
236
- .ui-icon-trash { background-position: -176px -96px; }
237
- .ui-icon-locked { background-position: -192px -96px; }
238
- .ui-icon-unlocked { background-position: -208px -96px; }
239
- .ui-icon-bookmark { background-position: -224px -96px; }
240
- .ui-icon-tag { background-position: -240px -96px; }
241
- .ui-icon-home { background-position: 0 -112px; }
242
- .ui-icon-flag { background-position: -16px -112px; }
243
- .ui-icon-calendar { background-position: -32px -112px; }
244
- .ui-icon-cart { background-position: -48px -112px; }
245
- .ui-icon-pencil { background-position: -64px -112px; }
246
- .ui-icon-clock { background-position: -80px -112px; }
247
- .ui-icon-disk { background-position: -96px -112px; }
248
- .ui-icon-calculator { background-position: -112px -112px; }
249
- .ui-icon-zoomin { background-position: -128px -112px; }
250
- .ui-icon-zoomout { background-position: -144px -112px; }
251
- .ui-icon-search { background-position: -160px -112px; }
252
- .ui-icon-wrench { background-position: -176px -112px; }
253
- .ui-icon-gear { background-position: -192px -112px; }
254
- .ui-icon-heart { background-position: -208px -112px; }
255
- .ui-icon-star { background-position: -224px -112px; }
256
- .ui-icon-link { background-position: -240px -112px; }
257
- .ui-icon-cancel { background-position: 0 -128px; }
258
- .ui-icon-plus { background-position: -16px -128px; }
259
- .ui-icon-plusthick { background-position: -32px -128px; }
260
- .ui-icon-minus { background-position: -48px -128px; }
261
- .ui-icon-minusthick { background-position: -64px -128px; }
262
- .ui-icon-close { background-position: -80px -128px; }
263
- .ui-icon-closethick { background-position: -96px -128px; }
264
- .ui-icon-key { background-position: -112px -128px; }
265
- .ui-icon-lightbulb { background-position: -128px -128px; }
266
- .ui-icon-scissors { background-position: -144px -128px; }
267
- .ui-icon-clipboard { background-position: -160px -128px; }
268
- .ui-icon-copy { background-position: -176px -128px; }
269
- .ui-icon-contact { background-position: -192px -128px; }
270
- .ui-icon-image { background-position: -208px -128px; }
271
- .ui-icon-video { background-position: -224px -128px; }
272
- .ui-icon-script { background-position: -240px -128px; }
273
- .ui-icon-alert { background-position: 0 -144px; }
274
- .ui-icon-info { background: url(images/icon_sprite.png) 0 0 no-repeat !important; }
275
- .ui-icon-notice { background-position: -32px -144px; }
276
- .ui-icon-help { background-position: -48px -144px; }
277
- .ui-icon-check { background-position: -64px -144px; }
278
- .ui-icon-bullet { background-position: -80px -144px; }
279
- .ui-icon-radio-off { background-position: -96px -144px; }
280
- .ui-icon-radio-on { background-position: -112px -144px; }
281
- .ui-icon-pin-w { background-position: -128px -144px; }
282
- .ui-icon-pin-s { background-position: -144px -144px; }
283
- .ui-icon-play { background-position: 0 -160px; }
284
- .ui-icon-pause { background-position: -16px -160px; }
285
- .ui-icon-seek-next { background-position: -32px -160px; }
286
- .ui-icon-seek-prev { background-position: -48px -160px; }
287
- .ui-icon-seek-end { background-position: -64px -160px; }
288
- .ui-icon-seek-start { background-position: -80px -160px; }
289
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
290
- .ui-icon-seek-first { background-position: -80px -160px; }
291
- .ui-icon-stop { background-position: -96px -160px; }
292
- .ui-icon-eject { background-position: -112px -160px; }
293
- .ui-icon-volume-off { background-position: -128px -160px; }
294
- .ui-icon-volume-on { background-position: -144px -160px; }
295
- .ui-icon-power { background-position: 0 -176px; }
296
- .ui-icon-signal-diag { background-position: -16px -176px; }
297
- .ui-icon-signal { background-position: -32px -176px; }
298
- .ui-icon-battery-0 { background-position: -48px -176px; }
299
- .ui-icon-battery-1 { background-position: -64px -176px; }
300
- .ui-icon-battery-2 { background-position: -80px -176px; }
301
- .ui-icon-battery-3 { background-position: -96px -176px; }
302
- .ui-icon-circle-plus { background-position: 0 -192px; }
303
- .ui-icon-circle-minus { background-position: -16px -192px; }
304
- .ui-icon-circle-close { background-position: -32px -192px; }
305
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
306
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
307
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
308
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
309
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
310
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
311
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
312
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
313
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
314
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
315
- .ui-icon-circle-check { background-position: -208px -192px; }
316
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
317
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
318
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
319
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
320
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
321
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
322
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
323
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
324
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
325
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
326
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
327
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
328
-
329
-
330
- /* Misc visuals
331
- ----------------------------------*/
332
-
333
- /* Corner radius */
334
- .ui-corner-tl { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
335
- .ui-corner-tr { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
336
- .ui-corner-bl { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
337
- .ui-corner-br { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
338
- .ui-corner-top { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
339
- .ui-corner-bottom { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
340
- .ui-corner-right { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
341
- .ui-corner-left { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
342
- .ui-corner-all { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
343
-
344
- /* Overlays */
345
- .ui-widget-overlay { background: #262b33; opacity: .70;filter:Alpha(Opacity=70); }
346
- .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #000000; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
347
- * jQuery UI Resizable 1.8.7
348
- *
349
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
350
- * Dual licensed under the MIT or GPL Version 2 licenses.
351
- * http://jquery.org/license
352
- *
353
- * http://docs.jquery.com/UI/Resizable#theming
354
- */
355
- .ui-resizable { position: relative;}
356
- .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
357
- .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
358
- .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
359
- .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
360
- .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
361
- .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
362
- .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
363
- .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
364
- .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
365
- .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
366
- * jQuery UI Selectable 1.8.7
367
- *
368
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
369
- * Dual licensed under the MIT or GPL Version 2 licenses.
370
- * http://jquery.org/license
371
- *
372
- * http://docs.jquery.com/UI/Selectable#theming
373
- */
374
- .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
375
- /*
376
- * jQuery UI Accordion 1.8.7
377
- *
378
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
379
- * Dual licensed under the MIT or GPL Version 2 licenses.
380
- * http://jquery.org/license
381
- *
382
- * http://docs.jquery.com/UI/Accordion#theming
383
- */
384
- /* IE/Win - Fix animation bug - #4615 */
385
- .ui-accordion { width: 100%; }
386
- .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
387
- .ui-accordion .ui-accordion-header, .ui-accordion .ui-accordion-content { -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
388
- .ui-accordion .ui-accordion-li-fix { display: inline; }
389
- .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
390
- .ui-accordion .ui-accordion-header a { display: block; font-size: 12px; font-weight: bold; padding: .5em .5em .5em .7em; }
391
- .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
392
- .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
393
- .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
394
- .ui-accordion .ui-accordion-content-active { display: block; }/*
395
- * jQuery UI Autocomplete 1.8.7
396
- *
397
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
398
- * Dual licensed under the MIT or GPL Version 2 licenses.
399
- * http://jquery.org/license
400
- *
401
- * http://docs.jquery.com/UI/Autocomplete#theming
402
- */
403
- .ui-autocomplete {
404
- position: absolute; cursor: default; z-index: 3 !important;
405
- -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
406
- -moz-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
407
- -webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
408
- }
409
-
410
- /* workarounds */
411
- * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
412
-
413
- /*
414
- * jQuery UI Menu 1.8.7
415
- *
416
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
417
- * Dual licensed under the MIT or GPL Version 2 licenses.
418
- * http://jquery.org/license
419
- *
420
- * http://docs.jquery.com/UI/Menu#theming
421
- */
422
- .ui-menu {
423
- list-style:none;
424
- padding: 2px;
425
- margin: 0;
426
- display:block;
427
- float: left;
428
- }
429
- .ui-menu .ui-menu {
430
- margin-top: -3px;
431
- }
432
- .ui-menu .ui-menu-item {
433
- margin:0;
434
- padding: 0;
435
- zoom: 1;
436
- float: left;
437
- clear: left;
438
- width: 100%;
439
- }
440
- .ui-menu .ui-menu-item a {
441
- text-decoration:none;
442
- display:block;
443
- padding:.2em .4em;
444
- line-height:1.5;
445
- zoom:1;
446
- }
447
- .ui-menu .ui-menu-item a.ui-state-hover,
448
- .ui-menu .ui-menu-item a.ui-state-active {
449
- font-weight: normal;
450
- margin: -1px;
451
- background: #5f83b9;
452
- color: #FFFFFF;
453
- text-shadow: 0px 1px 1px #234386;
454
- border-color: #466086;
455
- -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
456
- }
457
- /*
458
- * jQuery UI Button 1.8.7
459
- *
460
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
461
- * Dual licensed under the MIT or GPL Version 2 licenses.
462
- * http://jquery.org/license
463
- *
464
- * http://docs.jquery.com/UI/Button#theming
465
- */
466
- .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; -webkit-user-select: none; -moz-user-select: none; user-select: none; } /* the overflow property removes extra width in IE */
467
- .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
468
- button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
469
- .ui-button-icons-only { width: 3.4em; }
470
- button.ui-button-icons-only { width: 3.7em; }
471
-
472
- /* button animation properties */
473
- .ui-button {
474
- -webkit-transition: all 0.25s ease-in-out;
475
- -moz-transition: all 0.25s ease-in-out;
476
- -o-transition: all 0.25s ease-in-out;
477
- }
478
-
479
- /*states*/
480
- .ui-button.ui-state-hover {
481
- -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
482
- -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
483
- }
484
- .ui-button.ui-state-focus {
485
- outline: none;
486
- color: #1c4257; border-color: #7096ab;
487
- background-image: -webkit-gradient(
488
- linear,
489
- left bottom,
490
- left top,
491
- color-stop(1, rgb(185,224,245)),
492
- color-stop(0, rgb(146,189,214))
493
- );
494
- background-image: -moz-linear-gradient(
495
- center top,
496
- rgb(185,224,245),
497
- rgb(146,189,214)
498
- );
499
- -webkit-box-shadow: none;
500
- -moz-box-shadow: none;
501
- }
502
-
503
- /*button text element */
504
- .ui-button .ui-button-text { display: block; line-height: 1.4; font-weight: bold; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
505
- .ui-button-text-only .ui-button-text { padding: .4em 1em .3em }
506
- .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
507
- .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
508
- .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
509
- .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
510
- /* no icon support for input elements, provide padding by default */
511
- input.ui-button { padding: .4em 1em; }
512
-
513
- /*button icon element(s) */
514
- .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
515
- .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
516
- .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
517
- .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
518
- .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
519
-
520
- /*button sets*/
521
- .ui-buttonset { margin-right: 7px; }
522
- .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
523
- .ui-buttonset .ui-button.ui-state-active { color: #1c4257; border-color: #7096ab; }
524
- .ui-buttonset .ui-button.ui-state-active {
525
- background-image: -webkit-gradient(
526
- linear,
527
- left bottom,
528
- left top,
529
- color-stop(1, rgb(185,224,245)),
530
- color-stop(0, rgb(146,189,214))
531
- );
532
- background-image: -moz-linear-gradient(
533
- center top,
534
- rgb(185,224,245),
535
- rgb(146,189,214)
536
- );
537
- -webkit-box-shadow: none;
538
- -moz-box-shadow: none;
539
- }
540
-
541
- /* workarounds */
542
- button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
543
- /*
544
- * jQuery UI Dialog 1.8.7
545
- *
546
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
547
- * Dual licensed under the MIT or GPL Version 2 licenses.
548
- * http://jquery.org/license
549
- *
550
- * http://docs.jquery.com/UI/Dialog#theming
551
- */
552
- .ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; }
553
- .ui-dialog {
554
- -webkit-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
555
- -moz-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
556
- }
557
- .ui-dialog .ui-dialog-titlebar { padding: 0.7em 1em 0.6em 1em; position: relative; border: none; border-bottom: 1px solid #979797; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
558
- .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; font-size: 14px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
559
- .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .8em; top: 55%; width: 16px; margin: -10px 0 0 0; padding: 0; height: 16px; }
560
- .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; background: url(images/icon_sprite.png) 0 -16px no-repeat; }
561
- .ui-dialog .ui-dialog-titlebar-close:hover span { background-position: -16px -16px; }
562
- .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; border: 0; }
563
- .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
564
- .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
565
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
566
- .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
567
- .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
568
- .ui-draggable .ui-dialog-titlebar { cursor: move; }
569
- /*
570
- * jQuery UI Slider 1.8.7
571
- *
572
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
573
- * Dual licensed under the MIT or GPL Version 2 licenses.
574
- * http://jquery.org/license
575
- *
576
- * http://docs.jquery.com/UI/Slider#theming
577
- */
578
- .ui-slider { position: relative; text-align: left; background: #d7d7d7; }
579
- .ui-slider { -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset; }
580
- .ui-slider .ui-slider-handle { background: url(images/slider_handles.png) 0px -23px no-repeat; position: absolute; z-index: 2; width: 23px; height: 23px; cursor: default; border: none; outline: none; -moz-box-shadow: none; -webkit-box-shadow: none; }
581
- .ui-slider .ui-state-hover, .ui-slider .ui-state-active { background-position: 0 0; }
582
- .ui-slider .ui-slider-range { background: #a3cae0; position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
583
- .ui-slider .ui-slider-range { -moz-box-shadow: 0 1px 2px rgba(17,35,45,0.6) inset; -webkit-box-shadow: 0 1px 2px rgba(17,35,45,0.6) inset; }
584
-
585
-
586
- .ui-slider-horizontal { height: 5px; }
587
- .ui-slider-horizontal .ui-slider-handle { top: -8px; margin-left: -13px; }
588
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
589
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
590
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
591
-
592
- .ui-slider-vertical { width: 5px; height: 100px; }
593
- .ui-slider-vertical .ui-slider-handle { left: -8px; margin-left: 0; margin-bottom: -13px; }
594
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
595
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
596
- .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
597
- * jQuery UI Tabs 1.8.7
598
- *
599
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
600
- * Dual licensed under the MIT or GPL Version 2 licenses.
601
- * http://jquery.org/license
602
- *
603
- * http://docs.jquery.com/UI/Tabs#theming
604
- */
605
- .ui-tabs { position: relative; zoom: 1; border: 0; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
606
- .ui-tabs .ui-tabs-nav { margin: 0; padding: 0; background: transparent; border-width: 0 0 1px 0; }
607
- .ui-tabs .ui-tabs-nav {
608
- -moz-border-radius: 0;
609
- -webkit-border-radius: 0;
610
- border-radius: 0;
611
- }
612
- .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
613
- .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; font-size: 12px; font-weight: bold; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
614
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; background: #fff; border-color: #B6B6B6; }
615
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; outline: none; }
616
- .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
617
- .ui-tabs .ui-tabs-panel { display: block; border-width: 0 1px 1px 1px; padding: 1em 1.4em; background: none; }
618
- .ui-tabs .ui-tabs-panel {
619
- -moz-border-radius: 0;
620
- -webkit-border-radius: 0;
621
- border-radius: 0;
622
- }
623
- .ui-tabs .ui-tabs-hide { display: none !important; }
624
- /*
625
- * jQuery UI Datepicker 1.8.7
626
- *
627
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
628
- * Dual licensed under the MIT or GPL Version 2 licenses.
629
- * http://jquery.org/license
630
- *
631
- * http://docs.jquery.com/UI/Datepicker#theming
632
- */
633
- .ui-datepicker { width: 17em; padding: 0; display: none; border-color: #DDDDDD; }
634
- .ui-datepicker {
635
- -moz-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
636
- -webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
637
- box-shadow: 0 4px 8px rgba(0,0,0,0.5);
638
- }
639
- .ui-datepicker .ui-datepicker-header { position:relative; padding:.35em 0; border: none; border-bottom: 1px solid #B6B6B6; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
640
- .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 6px; width: 1.8em; height: 1.8em; }
641
- .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { border: 1px none; }
642
- .ui-datepicker .ui-datepicker-prev { left:2px; }
643
- .ui-datepicker .ui-datepicker-next { right:2px; }
644
- .ui-datepicker .ui-datepicker-prev span { background-position: 0px -32px !important; }
645
- .ui-datepicker .ui-datepicker-next span { background-position: -16px -32px !important; }
646
- .ui-datepicker .ui-datepicker-prev-hover span { background-position: 0px -48px !important; }
647
- .ui-datepicker .ui-datepicker-next-hover span { background-position: -16px -48px !important; }
648
- .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; background: url(images/icon_sprite.png) no-repeat; }
649
- .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
650
- .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
651
- .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
652
- .ui-datepicker select.ui-datepicker-month,
653
- .ui-datepicker select.ui-datepicker-year { width: 49%;}
654
- .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
655
- .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
656
- .ui-datepicker td { border: 0; padding: 1px; }
657
- .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
658
- .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
659
- .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
660
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
661
- .ui-datepicker .ui-state-default { background: transparent; border-color: #FFF; }
662
- .ui-datepicker .ui-state-active { background: #5F83B9; border-color: #5F83B9; color: #FFF; font-weight: bold; text-shadow: 0 1px 1px #234386; }
663
-
664
- /* with multiple calendars */
665
- .ui-datepicker.ui-datepicker-multi { width:auto; }
666
- .ui-datepicker-multi .ui-datepicker-group { float:left; }
667
- .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
668
- .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
669
- .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
670
- .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
671
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
672
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
673
- .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
674
- .ui-datepicker-row-break { clear:both; width:100%; }
675
-
676
- /* RTL support */
677
- .ui-datepicker-rtl { direction: rtl; }
678
- .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
679
- .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
680
- .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
681
- .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
682
- .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
683
- .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
684
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
685
- .ui-datepicker-rtl .ui-datepicker-group { float:right; }
686
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
687
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
688
-
689
- /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
690
- .ui-datepicker-cover {
691
- display: none; /*sorry for IE5*/
692
- display/**/: block; /*sorry for IE5*/
693
- position: absolute; /*must have*/
694
- z-index: -1; /*must have*/
695
- filter: mask(); /*must have*/
696
- top: -4px; /*must have*/
697
- left: -4px; /*must have*/
698
- width: 200px; /*must have*/
699
- height: 200px; /*must have*/
700
- }/*
701
- * jQuery UI Progressbar 1.8.7
702
- *
703
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
704
- * Dual licensed under the MIT or GPL Version 2 licenses.
705
- * http://jquery.org/license
706
- *
707
- * http://docs.jquery.com/UI/Progressbar#theming
708
- */
709
- .ui-progressbar { height: 12px; text-align: left; background: #FFF url(images/progress_bar.gif) 0 -14px repeat-x; }
710
- .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; background: url(images/progress_bar.gif) 0 0 repeat-x; }
711
-
712
- /* Extra Input Field Styling */
713
- /*
714
- textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
715
- padding: 3px;
716
- -webkit-border-radius: 2px;
717
- -moz-border-radius: 2px;
718
- border-radius: 2px;
719
- border: 1px solid #cecece;
720
- outline: none;
721
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
722
- -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
723
- box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
724
- -webkit-transition: all 0.25s ease-in-out;
725
- -moz-transition: all 0.25 ease-in-out;
726
- -o-transition: all 0.25s ease-in-out;
727
- }
728
- textarea:hover, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover {
729
- border: 1px solid #bdbdbd;
730
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
731
- -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
732
- box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
733
- }
734
- textarea:focus, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus {
735
- border: 1px solid #95bdd4;
736
- -webkit-box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
737
- -moz-box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
738
- box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
739
- }
740
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/sis-style.css DELETED
@@ -1,70 +0,0 @@
1
- .progress {
2
- position:relative;
3
- height:13px;
4
- margin-bottom: 43px;
5
- margin-top: 60px;
6
- color:#FFFFFF;
7
- display:none;
8
- }
9
-
10
- .progress .progress-percent {
11
- position: absolute;
12
- left: 0%;
13
- top: -63px;
14
- width: 82px;
15
- height: 49px;
16
- margin-top: -9px;
17
- font-weight: bold;
18
- line-height: 39px;
19
- text-align: center;
20
- }
21
- input.h,input.w{
22
- border-color: #DFDFDF;
23
- background-color: white;
24
- border-width: 1px;
25
- border-style: solid;
26
- -moz-border-radius: 3px;
27
- -khtml-border-radius: 3px;
28
- -webkit-border-radius: 3px;
29
- border-radius: 3px;
30
- }
31
- tr{
32
- -webkit-transition: all .5s ease-in-out;
33
- -moz-transition: all .5s ease-in-out;
34
- -o-transition: all .5s ease-in-out;
35
- transition: all .5s ease-in-out;
36
- }
37
- table.sis tr:nth-child(even) {
38
- background-color:#FCFCFC ;
39
- }
40
- table.sis tr:nth-child(odd) {
41
- background-color:transparent ;
42
- }
43
- tr.addPending {
44
- background-color:#6CA1D7;
45
- }
46
- tr.successAdding {
47
- background-color:#89D76A;
48
- }
49
- tr.errorAdding {
50
- background-color:#C45858;
51
- }
52
- tr.notChangedAdding {
53
- background-color:#F2A13A;
54
- }
55
-
56
- #regenerate_message,#time,#thumb {
57
- display:none;
58
- }
59
-
60
- #ajax_thumbnail_rebuild {
61
- margin-top:40px;
62
- }
63
- @media screen and (max-width: 820px) {
64
- .sis-label {
65
- display:block;
66
- }
67
- .size_options label{
68
- margin-top: -5px;
69
- }
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class.admin.php DELETED
@@ -1,914 +0,0 @@
1
- <?php
2
- Class SISAdmin {
3
-
4
- // Original sizes
5
- public $original = array( 'thumbnail', 'medium', 'large' );
6
-
7
- public function __construct(){
8
- // Init
9
- add_action ( 'admin_menu', array( &$this, 'init' ) );
10
- add_action ( 'admin_enqueue_scripts', array( &$this, 'registerScripts' ), 11 );
11
-
12
- // Add ajax action
13
- add_action( 'wp_ajax_'.'sis_ajax_thumbnail_rebuild', array( &$this, 'ajaxThumbnailRebuildAjax' ) );
14
- add_action( 'wp_ajax_'.'get_sizes', array( &$this, 'ajaxGetSizes' ) );
15
- add_action( 'wp_ajax_'.'add_size', array( &$this, 'ajaxAddSize' ) );
16
- add_action( 'wp_ajax_'.'remove_size', array( &$this, 'ajaxRemoveSize' ) );
17
-
18
- // Add image sizes in the form, check if 3.3 is installed or not
19
- if( !function_exists( 'is_main_query' ) ) {
20
- add_filter( 'attachment_fields_to_edit', array( &$this, 'sizesInForm' ), 11, 2 ); // Add our sizes to media forms
21
- } else {
22
- add_filter( 'image_size_names_choose', array( &$this, 'AddThumbnailName' ) );
23
- }
24
-
25
- // Add link in plugins list
26
- add_filter( 'plugin_action_links', array( &$this,'addSettingsLink' ), 10, 2 );
27
-
28
- // Add action in media row quick actions
29
- add_filter( 'media_row_actions', array(&$this, 'addActionsList' ), 10, 2 );
30
-
31
- // Add filter for the Media single
32
- add_filter( 'attachment_fields_to_edit', array( &$this, 'addFieldRegenerate' ), 9, 2 );
33
-
34
- }
35
-
36
- /**
37
- * Register javascripts and css.
38
- *
39
- * @access public
40
- * @return void
41
- * @author Nicolas Juen
42
- */
43
- public function registerScripts($hook_suffix = '' ) {
44
- if( !isset( $hook_suffix ) || empty( $hook_suffix ) )
45
- return false;
46
-
47
- if( $hook_suffix == 'options-media.php' ) {
48
- // Add javascript
49
- wp_enqueue_script( 'sis-jquery-ui-sis', SIS_URL.'js/jquery-ui-1.8.16.custom.min.js', array('jquery'), '1.8.16' );
50
- wp_enqueue_script( 'sis_js', SIS_URL.'js/sis.min.js', array('jquery','sis-jquery-ui-sis'), SIS_VERSION );
51
-
52
- // Add javascript translation
53
- wp_localize_script( 'sis_js', 'sis', $this->localizeVars() );
54
-
55
- // Add CSS
56
- wp_enqueue_style( 'jquery-ui-sis', SIS_URL.'css/Aristo/jquery-ui-1.8.7.custom.css', array(), '1.8.7' );
57
- wp_enqueue_style( 'sis_css', SIS_URL.'css/sis-style.css', array(), SIS_VERSION );
58
- } elseif( $hook_suffix == 'upload.php' || ( $hook_suffix == 'media.php' && isset( $_GET['attachment_id'] ) && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) ) {
59
- // Add javascript
60
- wp_enqueue_script( 'sis_js', SIS_URL.'js/sis-attachments.min.js', array( 'jquery' ), SIS_VERSION );
61
-
62
- // Add javascript translation
63
- wp_localize_script( 'sis_js', 'sis', $this->localizeVars() );
64
- }
65
- }
66
-
67
- /**
68
- * Localize the var for javascript
69
- *
70
- * @access public
71
- * @return void
72
- * @author Nicolas Juen
73
- */
74
- public function localizeVars() {
75
- return array(
76
- 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
77
- 'reading' => __( 'Reading attachments...', 'sis' ),
78
- 'maximumWidth' => __( 'Maximum width', 'sis' ),
79
- 'maximumHeight' => __( 'Maximum height', 'sis' ),
80
- 'crop' => __( 'Crop ?', 'sis' ),
81
- 'tr' => __( 'yes', 'sis' ),
82
- 'fl' => __( 'no', 'sis' ),
83
- 'show' => __( 'Show in post insertion ?', 'sis' ),
84
- 'of' => __( ' of ', 'sis' ),
85
- 'or' => __( ' or ', 'sis' ),
86
- 'beforeEnd' => __( ' before the end.', 'sis' ),
87
- 'deleteImage' => __( 'Delete', 'sis' ),
88
- 'noMedia' => __( 'No media in your site to regenerate !', 'sis' ),
89
- 'regenerating' => __( 'Regenerating ', 'sis'),
90
- 'regenerate' => __( 'Regenerate ', 'sis'),
91
- 'validate' => __( 'Validate image size name', 'sis' ),
92
- 'done' => __( 'Done.', 'sis' ),
93
- 'size' => __( 'Size', 'sis' ),
94
- 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'sis' ),
95
- 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'sis' ),
96
- 'confirmDelete' => __( 'Do you really want to delete these size ?', 'sis' ),
97
- 'update' => __( 'Update', 'sis' ),
98
- 'ajaxErrorHandler' => __( 'Error requesting page', 'sis' ),
99
- 'messageRegenerated' => __( 'images have been regenerated !', 'sis' ),
100
- 'validateButton' => __( 'Validate', 'sis' ),
101
- 'startedAt' => __( ' started at', 'sis' ),
102
- 'customName' => __( 'Public name', 'sis' ),
103
- 'finishedAt' => __( ' finished at :', 'sis' ),
104
- 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'sis' ),
105
- 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'sis' ),
106
- 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'sis' ),
107
- );
108
- }
109
-
110
- /**
111
- * Add action in media row
112
- *
113
- * @since 2.2
114
- * @access public
115
- * @return $actions : array of actions and content to display
116
- * @author Nicolas Juen
117
- */
118
- function addActionsList( $actions, $object ) {
119
-
120
- // Add action for regeneration
121
- $actions['sis-regenerate'] = "<a href='#' class='sis-regenerate-one'>".__( 'Regenerate thumbnails', 'sis' )."</a>".'<input type="hidden" class="regen" value="'.wp_create_nonce( 'regen' ).'" />';
122
-
123
- // Return actions
124
- return $actions;
125
- }
126
-
127
- /**
128
- * Add a link to the setting option page
129
- *
130
- * @access public
131
- * @param array $links
132
- * @param string $file
133
- * @return void
134
- * @author Nicolas Juen
135
- */
136
- public function addSettingsLink( $links, $file ) {
137
-
138
- if( $file != 'simple-image-sizes/simple_image_sizes.php' )
139
- return $links;
140
-
141
- $settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'sis' ).' </a>';
142
- array_unshift($links, $settings_link);
143
-
144
- return $links;
145
- }
146
-
147
- /**
148
- * Init for the option page
149
- *
150
- * @access public
151
- * @return void
152
- * @author Nicolas Juen
153
- */
154
- function init() {
155
- // Check if admin
156
- if( !is_admin() )
157
- return false;
158
-
159
- // Get the image sizes
160
- global $_wp_additional_image_sizes;
161
- $options = get_option( SIS_OPTION );
162
-
163
- // Get the sizes and add the settings
164
- foreach ( get_intermediate_image_sizes() as $s ) {
165
- // Don't make the original sizes or numeric sizes that appear
166
- if( in_array( $s, $this->original ) || is_integer( $s ) )
167
- continue;
168
-
169
- // Set width
170
- if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) // For theme-added sizes
171
- $width = intval( $_wp_additional_image_sizes[$s]['width'] );
172
- else // For default sizes set in options
173
- $width = get_option( "{$s}_size_w" );
174
-
175
- // Set height
176
- if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) // For theme-added sizes
177
- $height = intval( $_wp_additional_image_sizes[$s]['height'] );
178
- else // For default sizes set in options
179
- $height = get_option( "{$s}_size_h" );
180
-
181
- //Set crop
182
- if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) { // For theme-added sizes
183
- $crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
184
- } else {
185
- // For default sizes set in options
186
- $crop = get_option( "{$s}_crop" );
187
- }
188
-
189
- // Add the setting field for this size
190
- add_settings_field( 'image_size_'.$s, sprintf( __( '%s size', 'sis' ), $s ), array( &$this, 'imageSizes' ), 'media' , 'default', array( 'name' => $s , 'width' => $width , 'height' => $height, 'c' => $crop ) );
191
- }
192
-
193
- // Register the setting for media option page
194
- register_setting( 'media', SIS_OPTION );
195
-
196
- // Add the button
197
- add_settings_field( 'add_size_button', __( 'Add a new size', 'sis' ), array( &$this, 'addSizeButton' ), 'media' );
198
-
199
- // Add legend
200
- add_settings_field( 'add_legend', __( 'Legend of the sizes', 'sis' ), array( &$this, 'addLegend' ), 'media' );
201
-
202
- // Add php button
203
- add_settings_field( 'get_php_button', __( 'Get php for theme', 'sis' ), array( &$this, 'getPhpButton' ), 'media' );
204
-
205
- // Add section for the thumbnail regeneration
206
- add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'sis' ), array( &$this, 'thumbnailRegenerate' ), 'media' );
207
- }
208
-
209
- /**
210
- * Display the row of the image size
211
- *
212
- * @access public
213
- * @param mixed $args
214
- * @return void
215
- * @author Nicolas Juen
216
- */
217
- public function imageSizes( $args ) {
218
-
219
- if( is_integer( $args['name'] ) )
220
- return false;
221
-
222
- // Get the options
223
- $sizes = (array)get_option( SIS_OPTION );
224
-
225
- // Get the vars
226
- $height = isset( $sizes[$args['name']]['h'] )? $sizes[$args['name']]['h'] : $args['height'] ;
227
- $width = isset( $sizes[$args['name']]['w'] )? $sizes[$args['name']]['w'] : $args['width'] ;
228
- $crop = isset( $sizes[$args['name']]['c'] ) && !empty( $sizes[$args['name']]['c'] )? $sizes[$args['name']]['c'] : $args['c'] ;
229
- $show = isset( $sizes[$args['name']]['s'] ) && !empty( $sizes[$args['name']]['s'] )? '1' : '0' ;
230
- $custom = isset( $sizes[$args['name']]['custom'] ) && !empty( $sizes[$args['name']]['custom'] )? '1' : '0' ;
231
- $name = isset( $sizes[$args['name']]['n'] ) && !empty( $sizes[$args['name']]['n'] )? esc_html( $sizes[$args['name']]['n'] ) : esc_html( $args['name'] ) ;
232
-
233
- ?>
234
- <input type="hidden" value="<?php echo esc_attr( $args['name'] ); ?>" name="image_name" />
235
- <?php if( $custom ): ?>
236
- <input name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" type="hidden" id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" value="1" />
237
- <?php else: ?>
238
- <input name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" type="hidden" id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" value="1" />
239
- <?php endif; ?>
240
- <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][w]' ); ?>">
241
- <?php _e( 'Maximum width', 'sis'); ?>
242
- <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" class='w small-text' type="number" step='1' min='0' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" base_w='<?php echo esc_attr( $width ); ?>' value="<?php echo esc_attr( $width ); ?>" />
243
- </label>
244
- <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>">
245
- <?php _e( 'Maximum height', 'sis'); ?>
246
- <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" class='h small-text' type="number" step='1' min='0' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" base_h='<?php echo esc_attr( $height ); ?>' value="<?php echo esc_attr( $height ); ?>" />
247
- </label>
248
- <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][n]' ); ?>">
249
- <?php _e( 'Public name', 'sis'); ?>
250
- <input name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][n]' ); ?>" class='n' type="text" id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][n]' ); ?>" base_n='<?php echo $name; ?>' value="<?php echo $name ?>" />
251
- </label>
252
- <span class="size_options">
253
- <input type='checkbox' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" <?php checked( $crop, 1 ) ?> class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" value="1" />
254
- <label class="c" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Crop ?', 'sis'); ?></label>
255
-
256
- <input type='checkbox' id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][s]'); ?>" <?php checked( $show, 1 ) ?> class="s show" base_s='<?php echo esc_attr( $show ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][s]'); ?>" value="1" />
257
- <label class="s" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][s]'); ?>"><?php _e( 'Show in post insertion ?', 'sis'); ?></label>
258
- </span>
259
- <span class="delete_size"><?php _e( 'Delete', 'sis'); ?></span>
260
- <span class="add_size validate_size"><?php _e( 'Update', 'sis'); ?></span>
261
-
262
- <input type="hidden" class="deleteSize" value='<?php echo wp_create_nonce( 'delete_'.$args['name'] ); ?>' />
263
- <?php }
264
-
265
- /**
266
- * Add the button to add a size
267
- *
268
- * @access public
269
- * @return void
270
- * @author Nicolas Juen
271
- */
272
- public function addSizeButton() { ?>
273
- <input type="button" class="button-secondary action" id="add_size" value="<?php esc_attr_e( 'Add a new size of thumbnail', 'sis'); ?>" />
274
- <?php
275
- }
276
-
277
- /**
278
- * Add the button to get the php for th sizes
279
- *
280
- * @access public
281
- * @return void
282
- * @author Nicolas Juen
283
- */
284
- public function getPhpButton() { ?>
285
- <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'sis'); ?>" />
286
- <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'sis'); ?> </p>
287
- <code></code>
288
- <?php
289
- }
290
-
291
- /**
292
- * Add the legend fo the colors
293
- *
294
- * @access public
295
- * @return void
296
- * @author Nicolas Juen
297
- */
298
- public function addLegend() { ?>
299
- <?php _e('The images created on your theme are <span style="color:#F2A13A">orange</span> and your custom size are <span style="color:#89D76A"> green </span>.', 'sis'); ?>
300
- <?php
301
- }
302
-
303
- /**
304
- * Display the Table of sizes and post types for regenerating
305
- *
306
- * @access public
307
- * @return void
308
- * @author Nicolas Juen
309
- */
310
- public function thumbnailRegenerate() {
311
- // Get the sizes
312
- global $_wp_additional_image_sizes,$_wp_post_type_features;
313
- ?>
314
- <input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>' />
315
- <input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>' />
316
- <input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>' />
317
- <div id="sis-regen">
318
- <div class="wrapper" style="">
319
- <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'sis'); ?> </h4>
320
- <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
321
- <thead>
322
- <tr>
323
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
324
- <th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
325
- <th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
326
- <th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
327
- <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
328
- </tr>
329
- </thead>
330
- <tbody>
331
- <?php
332
- // Display the sizes in the array
333
- foreach ( get_intermediate_image_sizes() as $s ):
334
- // Don't make or numeric sizes that appear
335
- if( is_integer( $s ) )
336
- continue;
337
-
338
- if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) // For theme-added sizes
339
- $width = intval( $_wp_additional_image_sizes[$s]['width'] );
340
- else // For default sizes set in options
341
- $width = get_option( "{$s}_size_w" );
342
-
343
- if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) // For theme-added sizes
344
- $height = intval( $_wp_additional_image_sizes[$s]['height'] );
345
- else // For default sizes set in options
346
- $height = get_option( "{$s}_size_h" );
347
-
348
- if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) // For theme-added sizes
349
- $crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
350
- else // For default sizes set in options
351
- $crop = get_option( "{$s}_crop" );
352
- ?>
353
- <tr>
354
- <th class="check-column">
355
- <input type="checkbox" class="thumbnails" id="<?php echo esc_attr( $s ) ?>" name="thumbnails[]" checked="checked" value="<?php echo esc_attr( $s ); ?>" />
356
- </th>
357
- <th>
358
- <label for="<?php esc_attr_e( $s ); ?>">
359
- <?php echo esc_html( $s ); ?>
360
- </label>
361
- </th>
362
- <th>
363
- <label for="<?php esc_attr_e( $s ); ?>">
364
- <?php echo esc_html( $width); ?> px
365
- </label>
366
- </th>
367
- <th>
368
- <label for="<?php esc_attr_e( $s ); ?>">
369
- <?php echo esc_html( $height ); ?> px
370
- </label>
371
- </th>
372
- <th>
373
- <label for="<?php esc_attr_e( $s ); ?>">
374
- <?php echo ( $crop == 1 )? __( 'yes', 'sis' ):__( 'no', 'sis' ); ?>
375
- </label>
376
- </th>
377
- </tr>
378
- <?php endforeach;?>
379
- </tbody>
380
- <tfoot>
381
- <tr>
382
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
383
- <th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
384
- <th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
385
- <th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
386
- <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
387
- </tr>
388
- </tfoot>
389
- </table>
390
-
391
- <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'sis'); ?></h4>
392
- <table cellspacing="0" class="widefat page fixed sis">
393
- <thead>
394
- <tr>
395
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
396
- <th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
397
- </tr>
398
- </thead>
399
- <tbody>
400
- <?php
401
- // Diplay the post types table
402
- foreach ( get_post_types( array( 'public' => true, '_builtin' => false ), 'objects', 'or' ) as $ptype ):
403
- // Avoid the post_types without post thumbnails feature
404
- if( !array_key_exists( 'thumbnail' , $_wp_post_type_features[$ptype->name] ) || $_wp_post_type_features[$ptype->name] == false )
405
- continue;
406
- ?>
407
- <tr>
408
- <th class="check-column">
409
- <label for="<?php esc_attr_e( $ptype->name ); ?>">
410
- <input type="checkbox" class="post_types" name="post_types[]" checked="checked" id="<?php echo esc_attr( $ptype->name ); ?>" value="<?php echo esc_attr( $ptype->name ); ?>" />
411
- </label>
412
- </th>
413
- <th>
414
- <label for="<?php esc_attr_e( $ptype->name ); ?>">
415
- <em><?php echo esc_html( $ptype->labels->name ); ?></em>
416
- </label>
417
- </th>
418
- </tr>
419
- <?php endforeach;?>
420
- </tbody>
421
- <tfoot>
422
- <tr>
423
- <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
424
- <th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
425
- </tr>
426
- </tfoot>
427
- </table>
428
- </div>
429
- </div>
430
- <div >
431
- <div id="regenerate_message"></div>
432
- <div class="progress">
433
- <div class=" progress-percent ui-widget">
434
- <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
435
- <p>
436
- <span class="ui-icon ui-icon-info" style="float: left; margin-right: .7em;"></span>
437
- <span class="text">0%</span>
438
- </p>
439
- </div>
440
- </div>
441
- </div>
442
- <div class="ui-widget" id="time">
443
- <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
444
- <p>
445
- <span class="ui-icon ui-icon-info" style="float: left; margin-right: .7em;"></span>
446
- <span><strong><?php _e( 'End time calculated :', 'sis' ); ?></strong> <span class='time_message'>Calculating...</span> </span>
447
- </p>
448
- <ul class="messages"></ul>
449
- </div>
450
- </div>
451
- <div id="error_messages">
452
- <p>
453
- <ol class="messages">
454
- </ol>
455
- </p>
456
- </div>
457
- <div id="thumb"><h4><?php _e( 'Last image:', 'sis'); ?></h4><img id="thumb-img" /></div>
458
- <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'sis' ) ?>" />
459
- </div>
460
- <?php
461
- }
462
-
463
- /**
464
- * Add a size by Ajax
465
- *
466
- * @access public
467
- * @return void
468
- * @author Nicolas Juen
469
- */
470
- public function ajaxAddSize() {
471
-
472
- // Get the nonce
473
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
474
-
475
- // Get old options
476
- $sizes = (array)get_option( SIS_OPTION );
477
-
478
- // Check entries
479
- $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ): '' ;
480
- $height = !isset( $_POST['height'] )? 0 : absint( $_POST['height'] );
481
- $width = !isset( $_POST['width'] )? 0 : absint( $_POST['width'] );
482
- $crop = isset( $_POST['crop'] ) && $_POST['crop'] == 'false' ? false : true;
483
- $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
484
- $cn = isset( $_POST['customName'] ) && !empty( $_POST['customName'] ) ? sanitize_text_field( $_POST['customName'] ): $name ;
485
-
486
- // Check the nonce
487
- if( !wp_verify_nonce( $nonce , 'add_size' ) ) {
488
- echo 0;
489
- die();
490
- }
491
-
492
- // If no name given do not save
493
- if( empty( $name ) ) {
494
- echo 0;
495
- die();
496
- }
497
-
498
- // Make values
499
- $values = array( 'custom' => 1, 'w' => $width , 'h' => $height, 'c' => $crop, 's' => $show, 'n' => $cn );
500
-
501
- // If the size have not changed return 2
502
- if( isset( $sizes[$name] ) && $sizes[$name] === $values ) {
503
- echo 2;
504
- die();
505
- }
506
-
507
- // Put the new values
508
- $sizes[$name] = $values;
509
-
510
- // display update result
511
- echo (int)update_option( 'custom_image_sizes', $sizes );
512
- die();
513
- }
514
-
515
- /**
516
- * Remove a size by Ajax
517
- *
518
- * @access public
519
- * @return void
520
- * @author Nicolas Juen
521
- */
522
- public function ajaxRemoveSize() {
523
-
524
- // Get old options
525
- $sizes = (array)get_option( SIS_OPTION );
526
-
527
- // Get the nonce and name
528
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
529
- $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ): '' ;
530
-
531
- // Check the nonce
532
- if( !wp_verify_nonce( $nonce , 'delete_'.$name ) ) {
533
- echo 0;
534
- die();
535
- }
536
-
537
- // Remove the size
538
- unset( $sizes[sanitize_title( $name )] );
539
- unset( $sizes[0] );
540
-
541
- // Display the results
542
- echo (int)update_option( SIS_OPTION, $sizes );
543
- die();
544
- }
545
-
546
- /**
547
- * Display the add_image_size for the registered sizes
548
- *
549
- * @access public
550
- * @return void
551
- */
552
- public function ajaxGetSizes() {
553
- global $_wp_additional_image_sizes;
554
-
555
- foreach ( get_intermediate_image_sizes() as $s ):
556
-
557
- // Don't make the original sizes
558
- if( in_array( $s, $this->original ) )
559
- continue;
560
-
561
- if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) // For theme-added sizes
562
- $width = intval( $_wp_additional_image_sizes[$s]['width'] );
563
- else // For default sizes set in options
564
- $width = get_option( "{$s}_size_w" );
565
-
566
- if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) // For theme-added sizes
567
- $height = intval( $_wp_additional_image_sizes[$s]['height'] );
568
- else // For default sizes set in options
569
- $height = get_option( "{$s}_size_h" );
570
-
571
- if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) // For theme-added sizes
572
- $crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
573
- else // For default sizes set in options
574
- $crop = get_option( "{$s}_crop" );
575
-
576
- $crop = ( $crop == 0 )? 'false' : 'true' ;
577
- ?>
578
- add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop ?> );<br />
579
- <?php endforeach;
580
-
581
- die();
582
- }
583
-
584
- /**
585
- * Rebuild the image
586
- *
587
- * @access public
588
- * @return void
589
- * @author Nicolas Juen
590
- */
591
- public function ajaxThumbnailRebuildAjax() {
592
- global $wpdb;
593
-
594
- // Get the nonce
595
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
596
-
597
- // Time a the begining
598
- $start_time = microtime(true);
599
-
600
- // Get the action
601
- $action = $_POST["do"];
602
-
603
- // Get the thumbnails
604
- $thumbnails = isset( $_POST['thumbnails'] )? $_POST['thumbnails'] : NULL;
605
-
606
- if ( $action == "getlist" ) {
607
- // Check the nonce
608
- if( !wp_verify_nonce( $nonce , 'getList' ) ) {
609
- echo json_encode( array( ) );
610
- die();
611
- }
612
-
613
- if ( isset( $_POST['post_types'] ) && !empty( $_POST['post_types'] ) ) {
614
-
615
- // Get image medias
616
- $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
617
-
618
- // Get all parent from post type
619
- $attachments = $wpdb->get_results( "SELECT *
620
- FROM $wpdb->posts
621
- WHERE 1 = 1
622
- AND post_type = 'attachment'
623
- $whichmimetype
624
- AND post_parent IN (
625
- SELECT DISTINCT ID
626
- FROM $wpdb->posts
627
- WHERE post_type IN ('".implode( "', '", $_POST['post_types'] )."')
628
- )" );
629
-
630
- } else {
631
- $attachments =& get_children( array(
632
- 'post_type' => 'attachment',
633
- 'post_mime_type' => 'image',
634
- 'numberposts' => -1,
635
- 'post_status' => null,
636
- 'post_parent' => null, // any parent
637
- 'output' => 'object',
638
- ) );
639
- }
640
-
641
- // Get the attachments
642
- foreach ( $attachments as $attachment ) {
643
- $res[] = array('id' => $attachment->ID, 'title' => $attachment->post_title);
644
- }
645
- // Return the Id's and Title of medias
646
- die( json_encode( $res ) );
647
- } else if ( $action == "regen" ) {
648
-
649
- // Check the nonce
650
- if( !wp_verify_nonce( $nonce , 'regen' ) ) {
651
- echo json_encode( array( 'error' => _e( 'Trying to cheat ?', 'sis' ) ) );
652
- die();
653
- }
654
-
655
- // Get the id
656
- $id = $_POST["id"];
657
-
658
- // Check Id
659
- if( (int)$id == 0 ) {
660
- die( json_encode( array( 'time' => round( microtime( true ) - $start_time, 4 ), 'error' => __( 'No id given in POST datas.', 'sis' ) ) ) );
661
- }
662
-
663
- // Get the path
664
- $fullsizepath = get_attached_file( $id );
665
-
666
- // Regen the attachment
667
- if ( FALSE !== $fullsizepath && @file_exists( $fullsizepath ) ) {
668
- set_time_limit( 30 );
669
- if( wp_update_attachment_metadata( $id, $this->wp_generate_attachment_metadata_custom( $id, $fullsizepath, $thumbnails ) ) == false )
670
- die( json_encode( array( 'src' => wp_get_attachment_thumb_url( $id ), 'time' => round( microtime( true ) - $start_time, 4 ) ,'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'sis'), get_edit_post_link( $id ), get_the_title( $id ) ) ) ) );
671
- } else {
672
- die( json_encode( array( 'src' => wp_get_attachment_thumb_url( $id ), 'time' => round( microtime( true ) - $start_time, 4 ), 'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'sis'), get_edit_post_link( $id ), get_the_title( $id ) ) ) ) );
673
- }
674
- // Display the attachment url for feedback
675
- die( json_encode( array( 'time' => round( microtime( true ) - $start_time, 4 ) , 'src' => wp_get_attachment_thumb_url( $id ), 'title' => get_the_title( $id ) ) ) );
676
- }
677
- }
678
-
679
- /**
680
- * Generate post thumbnail attachment meta data.
681
- *
682
- * @since 2.1.0
683
- *
684
- * @param int $attachment_id Attachment Id to process.
685
- * @param string $file Filepath of the Attached image.
686
- * @return mixed Metadata for attachment.
687
- */
688
- public function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = NULL ) {
689
- $attachment = get_post( $attachment_id );
690
-
691
- $meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
692
-
693
- $metadata = array();
694
- if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
695
- $imagesize = getimagesize( $file );
696
- $metadata['width'] = $imagesize[0];
697
- $metadata['height'] = $imagesize[1];
698
- list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96);
699
- $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
700
-
701
- // Make the file path relative to the upload dir
702
- $metadata['file'] = _wp_relative_upload_path($file);
703
-
704
- // make thumbnails and other intermediate sizes
705
- global $_wp_additional_image_sizes;
706
-
707
- foreach ( get_intermediate_image_sizes() as $s ) {
708
- $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE );
709
- if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
710
- $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes
711
- else
712
- $sizes[$s]['width'] = get_option( "{$s}_size_w" ); // For default sizes set in options
713
- if ( isset( $_wp_additional_image_sizes[$s]['height'] ) )
714
- $sizes[$s]['height'] = intval( $_wp_additional_image_sizes[$s]['height'] ); // For theme-added sizes
715
- else
716
- $sizes[$s]['height'] = get_option( "{$s}_size_h" ); // For default sizes set in options
717
- if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) )
718
- $sizes[$s]['crop'] = intval( $_wp_additional_image_sizes[$s]['crop'] ); // For theme-added sizes
719
- else
720
- $sizes[$s]['crop'] = get_option( "{$s}_crop" ); // For default sizes set in options
721
- }
722
-
723
- $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
724
-
725
- foreach ( $sizes as $size => $size_data ) {
726
- if( isset( $thumbnails ) )
727
- if( !in_array( $size, $thumbnails ) ) {
728
- continue;
729
- }
730
-
731
- $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
732
-
733
- if( isset( $meta_datas['size'][$size] ) ) {
734
- // Remove the size from the orignal sizes for after work
735
- unset( $meta_datas['size'][$size] );
736
- }
737
-
738
- if ( $resized )
739
- $metadata['sizes'][$size] = $resized;
740
- }
741
-
742
- // Only if not all sizes
743
- if( is_array( $thumbnails ) ) {
744
- // Fill the array with the other sizes not have to be done
745
- foreach( $meta_datas['sizes'] as $name => $fsize ) {
746
- $metadata['sizes'][$name] = $fsize;
747
- }
748
- }
749
-
750
- // fetch additional metadata from exif/iptc
751
- $image_meta = wp_read_image_metadata( $file );
752
- if ( $image_meta )
753
- $metadata['image_meta'] = $image_meta;
754
- }
755
-
756
- return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
757
- }
758
-
759
- /**
760
- * Add the custom sizes to the image sizes in article edition
761
- *
762
- * @access public
763
- * @param array $form_fields
764
- * @param object $post
765
- * @return void
766
- * @author Nicolas Juen
767
- * @author Additional Image Sizes (zui)
768
- */
769
- public function sizesInForm( $form_fields, $post ) {
770
- // Protect from being view in Media editor where there are no sizes
771
- if ( isset( $form_fields['image-size'] ) ) {
772
- $out = NULL;
773
- $size_names = array();
774
- $sizes_custom = get_option( SIS_OPTION );
775
-
776
- if ( is_array( $sizes_custom ) ) {
777
- foreach( $sizes_custom as $key => $value ) {
778
- if( isset( $value['s'] ) && $value['s'] == 1 ) {
779
- $size_names[$key] = $this->_getThumbnailName( $key );;
780
- }
781
- }
782
- }
783
- foreach ( $size_names as $size => $label ) {
784
- $downsize = image_downsize( $post->ID, $size );
785
-
786
- // is this size selectable?
787
- $enabled = ( $downsize[3] || 'full' == $size );
788
- $css_id = "image-size-{$size}-{$post->ID}";
789
-
790
- // We must do a clumsy search of the existing html to determine is something has been checked yet
791
- if ( FALSE === strpos( 'checked="checked"', $form_fields['image-size']['html'] ) ) {
792
-
793
- if ( empty($check) )
794
- $check = get_user_setting( 'imgsize' ); // See if they checked a custom size last time
795
-
796
- $checked = '';
797
-
798
- // if this size is the default but that's not available, don't select it
799
- if ( $size == $check || str_replace( " ", "", $size ) == $check ) {
800
- if ( $enabled )
801
- $checked = " checked='checked'";
802
- else
803
- $check = '';
804
- } elseif ( !$check && $enabled && 'thumbnail' != $size ) {
805
- // if $check is not enabled, default to the first available size that's bigger than a thumbnail
806
- $check = $size;
807
- $checked = " checked='checked'";
808
- }
809
- }
810
- $html = "<div class='image-size-item' style='min-height: 50px; margin-top: 18px;'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
811
-
812
- $html .= "<label for='{$css_id}'>$label</label>";
813
- // only show the dimensions if that choice is available
814
- if ( $enabled )
815
- $html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d&nbsp;&times;&nbsp;%d)", $downsize[1], $downsize[2] ). "</label>";
816
-
817
- $html .= '</div>';
818
-
819
- $out .= $html;
820
- }
821
- $form_fields['image-size']['html'] .= $out;
822
- } // End protect from Media editor
823
-
824
- return $form_fields;
825
- }
826
-
827
- /**
828
- * Add the thumbnail name in the post insertion, based on new WP filter
829
- *
830
- * @access public
831
- * @param array $sizes
832
- * @return array
833
- * @since 2.3
834
- * @author Nicolas Juen
835
- * @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
836
- */
837
- function AddThumbnailName($sizes) {
838
- // Get options
839
- $sizes_custom = get_option( SIS_OPTION );
840
- // init size array
841
- $addsizes = array();
842
-
843
- // check there is custom sizes
844
- if ( is_array( $sizes_custom ) && !empty( $sizes_custom ) ) {
845
- foreach( $sizes_custom as $key => $value ) {
846
- // If we show this size in the admin
847
- if( isset( $value['s'] ) && $value['s'] == 1 )
848
- $addsizes[$key] = $this->_getThumbnailName( $key );
849
- }
850
- }
851
-
852
- // Merge the two array
853
- $newsizes = array_merge($sizes, $addsizes);
854
-
855
- // Add new size
856
- return $newsizes;
857
- }
858
-
859
- /**
860
- * Get a thumbnail name from its slug
861
- *
862
- * @access private
863
- * @param string $thumbnailSlug : the slug of the thumbnail
864
- * @return array
865
- * @since 2.3
866
- * @author Nicolas Juen
867
- */
868
- private function _getThumbnailName( $thumbnailSlug = '' ) {
869
-
870
- // get the options
871
- $sizes_custom = get_option( SIS_OPTION );
872
-
873
- // If the size exists
874
- if( isset( $sizes_custom[$thumbnailSlug] ) ) {
875
- // If the name exists return it, slug by default
876
- if( isset( $sizes_custom[$thumbnailSlug]['n'] ) && !empty( $sizes_custom[$thumbnailSlug]['n'] ) ) {
877
- return $sizes_custom[$thumbnailSlug]['n'];
878
- } else {
879
- return $thumbnailSlug;
880
- }
881
- }
882
-
883
- // return slug if not found
884
- return $thumbnailSlug;
885
- }
886
-
887
- /**
888
- * Get a thumbnail name from its slug
889
- *
890
- * @access public
891
- * @param array $fields : the fields of the media
892
- * @param object $post : the post object
893
- * @return array
894
- * @since 2.3.1
895
- * @author Nicolas Juen
896
- */
897
- function addFieldRegenerate( $fields, $post ) {
898
- // Check this is an image
899
- if( strpos( $post->post_mime_type, 'image' ) === false )
900
- return $fields;
901
-
902
- $fields['sis-regenerate'] = array(
903
- 'label' => __( 'Regenerate Thumbnails', 'sis' ),
904
- 'input' => 'html',
905
- 'html' => '
906
- <input type="button" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'sis' ).'" />
907
- <span class="title"><em></em></span>
908
- <input type="hidden" class="regen" value="'.wp_create_nonce( 'regen' ).'" />
909
- '
910
- );
911
- return $fields;
912
- }
913
- }
914
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class.client.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- Class SISClient {
3
-
4
- // Set the original
5
- var $original = array( 'thumbnail', 'medium', 'large' );
6
-
7
- function __construct() {
8
- add_action ( 'init', array( &$this, 'init' ) );
9
- }
10
-
11
- /**
12
- * Override the images by the plugin images
13
- *
14
- * @access public
15
- * @return void
16
- * @author Nicolas Juen
17
- */
18
- function init() {
19
- // Get inital options
20
- $sizes = get_option( 'custom_image_sizes' );
21
-
22
- // Return flase if empty
23
- if( empty( $sizes ) || !is_array( $sizes ) )
24
- return false;
25
-
26
- // Set the new sizes
27
- foreach( $sizes as $name => $size ){
28
- // Get cropping
29
- $crop = ( isset( $size['c'] ) && !empty( $size['c'] ) )? $size['c'] : 0 ;
30
-
31
- // Add the images sizes
32
- add_image_size( $name, $size['w'], $size['h'], $crop );
33
- }
34
- }
35
- }
36
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery-ui-1.8.16.custom.min.js DELETED
@@ -1,77 +0,0 @@
1
- /*!
2
- * jQuery UI 1.8.16
3
- *
4
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI
9
- */
10
- (function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",
11
- keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=
12
- this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
13
- "overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":
14
- "mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,
15
- outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,
16
- "tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&
17
- a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&
18
- c.ui.isOverAxis(b,e,i)}})}})(jQuery);
19
- ;/*!
20
- * jQuery UI Widget 1.8.16
21
- *
22
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
23
- * Dual licensed under the MIT or GPL Version 2 licenses.
24
- * http://jquery.org/license
25
- *
26
- * http://docs.jquery.com/UI/Widget
27
- */
28
- (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=
29
- function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):
30
- d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=
31
- b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
32
- "-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
33
- c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
34
- ;/*
35
- * jQuery UI Button 1.8.16
36
- *
37
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
38
- * Dual licensed under the MIT or GPL Version 2 licenses.
39
- * http://jquery.org/license
40
- *
41
- * http://docs.jquery.com/UI/Button
42
- *
43
- * Depends:
44
- * jquery.ui.core.js
45
- * jquery.ui.widget.js
46
- */
47
- (function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
48
- "boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
49
- this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g=
50
- false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed","true");
51
- var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
52
- d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
53
- "radio"){var a=this.element.parents().filter(":last"),c="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
54
- widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
55
- b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
56
- "true"):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
57
- c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only":
58
- "ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")===
59
- "ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
60
- b.Widget.prototype.destroy.call(this)}})})(jQuery);
61
- ;/*
62
- * jQuery UI Progressbar 1.8.16
63
- *
64
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
65
- * Dual licensed under the MIT or GPL Version 2 licenses.
66
- * http://jquery.org/license
67
- *
68
- * http://docs.jquery.com/UI/Progressbar
69
- *
70
- * Depends:
71
- * jquery.ui.core.js
72
- * jquery.ui.widget.js
73
- */
74
- (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
75
- this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
76
- this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery);
77
- ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/sis-attachments.js DELETED
@@ -1,100 +0,0 @@
1
- jQuery( function() {
2
- // Add action dinamycally
3
- jQuery( 'select[name="action"]' ).append(
4
- jQuery( '<option/>' ).attr( 'value', 'sis-regenerate' ).text( sis.regenerate )
5
- );
6
-
7
- // Regenerate one element
8
- jQuery( '.sis-regenerate-one' ).click( function( e ) {
9
- e.preventDefault();
10
- new SISAttachRegenerate( this );
11
- });
12
-
13
- // On bulk actions
14
- jQuery( '#doaction' ).click( function( e ) {
15
- if( jQuery( this ).parent().find( 'select' ).val() == 'sis-regenerate' ) {
16
- // Get checked checkbocxes
17
- var els = jQuery( '.wp-list-table.media #the-list tr input[type="checkbox"]:checked' );
18
-
19
- // Check there is any elements selected
20
- if( els.length > 0 ) {
21
-
22
- // Stop default action
23
- e.preventDefault();
24
-
25
- // Make all the selected elements
26
- els.each( function( i,el ) {
27
- new SISAttachRegenerate( jQuery( this ) );
28
- } )
29
- }
30
- }
31
- } );
32
-
33
- // Function for regenerating the elements
34
- var SISAttachRegenerate = function( el ) {
35
- var regenerate = {
36
- list : '',
37
- percent : '' ,
38
- el : '',
39
- id : '',
40
- messageZone : '',
41
- init: function( el ) {
42
- this.el = jQuery( el );
43
- id = this.el.attr( 'id' );
44
-
45
- // IF no id found
46
- if( !id ) {
47
- id = this.el.closest( '.media-item' ).attr( 'id' );
48
- this.id = id.replace( 'media-item-', '' );
49
- } else {
50
- this.id = id.replace( 'post-', '' );
51
- }
52
-
53
- this.list = { 'id' : this.id, 'title' : 'titre' };
54
-
55
- if( this.el.find('.title em').size() == 0 )
56
- this.el.find('.title strong').after('<em/>');
57
-
58
- this.messageZone = this.el.find('.title em');
59
-
60
- if( !this.el.hasClass( 'ajaxing' ) )
61
- this.regenItem();
62
- },
63
- setMessage : function( msg ) {
64
- // Display the message
65
- this.messageZone.html( ' - '+ msg ).addClass( 'updated' ).addClass( 'fade' ).show();
66
- },
67
- regenItem : function( ) {
68
- var _self = this;
69
- var wp_nonce = jQuery('input.regen').val();
70
-
71
- jQuery.ajax( {
72
- url: sis.ajaxUrl,
73
- type: "POST",
74
- dataType: 'json',
75
- data: "action=sis_ajax_thumbnail_rebuild&do=regen&id=" + this.list.id+'&nonce='+wp_nonce,
76
- beforeSend : function() {
77
- _self.el.fadeTo( 'fast' ,'0.2' ).addClass('ajaxing');
78
- },
79
- success: function( r ) {
80
- var message ='';
81
- // Check if error or a message in response
82
- if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
83
- if( typeof r !== 'object' )
84
- message = sis.phpError;
85
- else
86
- message = r.error
87
- } else {
88
- message = sis.soloRegenerated.replace( '%s', r.time );
89
- }
90
- _self.setMessage( message );
91
- _self.el.fadeTo( 'fast' ,'1' ).removeClass('ajaxing');
92
- }
93
- });
94
- }
95
- }
96
-
97
- // Launch regeneration
98
- regenerate.init( jQuery( el ).closest( 'tr' ) );
99
- }
100
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/sis-attachments.min.js DELETED
@@ -1,3 +0,0 @@
1
- jQuery(function(){jQuery('select[name="action"]').append(jQuery("<option/>").attr("value","sis-regenerate").text(sis.regenerate));jQuery(".sis-regenerate-one").click(function(a){a.preventDefault();new c(this)});jQuery("#doaction").click(function(a){if("sis-regenerate"==jQuery(this).parent().find("select").val()){var b=jQuery('.wp-list-table.media #the-list tr input[type="checkbox"]:checked');0<b.length&&(a.preventDefault(),b.each(function(){new c(jQuery(this))}))}});var c=function(a){({list:"",percent:"",
2
- el:"",id:"",messageZone:"",init:function(b){this.el=jQuery(b);(id=this.el.attr("id"))?this.id=id.replace("post-",""):(id=this.el.closest(".media-item").attr("id"),this.id=id.replace("media-item-",""));this.list={id:this.id,title:"titre"};0==this.el.find(".title em").size()&&this.el.find(".title strong").after("<em/>");this.messageZone=this.el.find(".title em");this.el.hasClass("ajaxing")||this.regenItem()},setMessage:function(b){this.messageZone.html(" - "+b).addClass("updated").addClass("fade").show()},
3
- regenItem:function(){var b=this,a=jQuery("input.regen").val();jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:"action=sis_ajax_thumbnail_rebuild&do=regen&id="+this.list.id+"&nonce="+a,beforeSend:function(){b.el.fadeTo("fast","0.2").addClass("ajaxing")},success:function(a){var c="",c=!a.src||!a.time||a.error||"object"!==typeof a?"object"!==typeof a?sis.phpError:a.error:sis.soloRegenerated.replace("%s",a.time);b.setMessage(c);b.el.fadeTo("fast","1").removeClass("ajaxing")}})}}).init(jQuery(a).closest("tr"))}});
 
 
 
js/sis.js DELETED
@@ -1,700 +0,0 @@
1
- sis_small = true;
2
- // Functions for the regenerating of images
3
- var regenerate = {
4
- post_types : '',
5
- thumbnails : '',
6
- list : '',
7
- cur : 0,
8
- timeScript: new Array,
9
- dateScript: '',
10
- percent : '' ,
11
- getThumbnails : function() {
12
- var _self = this;
13
- var inputs = jQuery( 'input.thumbnails:checked' );
14
-
15
- // Get the checked thumbnails inputs
16
- if (inputs.length != jQuery( 'input.thumbnails[type="checkbox"]' ).length) {
17
- inputs.each( function( i ) {
18
- _self.thumbnails += '&thumbnails[]=' + jQuery( this ).val();
19
- });
20
- }
21
- },
22
- getPostTypes : function() {
23
- var _self = this;
24
- var inputs = jQuery( 'input.post_types:checked' );
25
-
26
- // Get the checked post Types inputs
27
- if ( inputs.length != jQuery( 'input.post_types[type="checkbox"]' ).length ) {
28
- inputs.each( function() {
29
- _self.post_types += '&post_types[]=' + jQuery( this ).val();
30
- } );
31
- }
32
- },
33
- setMessage : function( msg ) {
34
- // Display the message
35
- jQuery("#regenerate_message").html( "<p>" + msg + "</p>" ).addClass( 'updated' ).addClass( 'fade' ).show();
36
- this.refreshProgressBar();
37
- },
38
- setTimeMessage : function ( msg ) {
39
- jQuery("#time p span.time_message").html( msg );
40
- },
41
- refreshProgressBar: function(){
42
- // Refresh the progress Bar
43
- jQuery(".progress").progressbar();
44
- },
45
- checkStartRegenerating : function(){
46
- if( jQuery( '.notSaved' ).size() > 0 ) {
47
- var confirmation = confirm( sis.notSaved );
48
-
49
- // Delete if ok else not delete
50
- if( confirmation == true ) {
51
- this.startRegenerating();
52
- } else {
53
- return false;
54
- }
55
- } else {
56
- this.startRegenerating();
57
- }
58
- },
59
- startRegenerating : function( ) {
60
- var _self = this;
61
- var wp_nonce = jQuery('input.getList').val();
62
-
63
- this.dateScript = new Date();
64
-
65
- // Start ajax
66
- jQuery.ajax( {
67
- url: sis.ajaxUrl,
68
- type: "POST",
69
- dataType: 'json',
70
- data: "action=sis_ajax_thumbnail_rebuild&do=getlist" + _self.post_types+'&nonce='+wp_nonce,
71
- beforeSend: function() {
72
-
73
- // Disable the button
74
- jQuery( "#ajax_thumbnail_rebuild" ).attr( "disabled", true );
75
- // Display the message
76
- _self.setMessage( sis.reading );
77
-
78
- // Get the humbnails and post types
79
- _self.getThumbnails();
80
- _self.getPostTypes();
81
- },
82
- success: function( r ) {
83
-
84
- if( typeof r !== 'object' ) {
85
- _self.reInit();
86
- _self.setMessage( sis.phpError );
87
- return false;
88
- }
89
-
90
- jQuery("#time").show();
91
-
92
- // Eval the response
93
- _self.list = r ;
94
-
95
- // Set the current to 0
96
- _self.curr = 0;
97
-
98
- // Display the progress Bar
99
- jQuery( '.progress' ).show();
100
-
101
- // Start Regenerating
102
- _self.regenItem();
103
- }
104
- });
105
- },
106
- regenItem : function( ) {
107
- var _self = this;
108
- var wp_nonce = jQuery('input.regen').val();
109
-
110
- // If the list is empty display the message of emptyness and reinitialize the form
111
- if ( !this.list ) {
112
- this.reInit();
113
- this.setMessage( sis.noMedia );
114
- return false;
115
- }
116
-
117
- // If we have finished the regeneration display message and init again
118
- if ( this.curr >= this.list.length ) {
119
- var now = new Date();
120
- this.reInit();
121
- this.setMessage( sis.done+this.curr+' '+sis.messageRegenerated+sis.startedAt+' '+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+sis.finishedAt+' '+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds() );
122
- return;
123
- }
124
-
125
- // Set the message of current image regenerating
126
- this.setMessage( sis.regenerating + ( this.curr + 1 ) + sis.of + this.list.length + " (" + this.list[this.curr].title + ")...");
127
-
128
- jQuery.ajax( {
129
- url: sis.ajaxUrl,
130
- type: "POST",
131
- dataType: 'json',
132
- data: "action=sis_ajax_thumbnail_rebuild&do=regen&id=" + this.list[this.curr].id + this.thumbnails + '&nonce='+wp_nonce,
133
- beforeSend : function() {
134
- // Calculate the percentage of regeneration
135
- _self.percent = ( _self.curr / _self.list.length ) * 100;
136
-
137
- // Change the progression
138
- jQuery( ".progress" ).progressbar( "value", _self.percent );
139
-
140
- // Change the text of progression
141
- jQuery( ".progress-percent span.text" ).html( Math.round( _self.percent ) + "%").closest( '.progress-percent' ).animate( { left: Math.round( _self.percent )-2.5 + "%" }, 500 );
142
- },
143
- success: function( r ) {
144
- // Check if error or a message in response
145
- if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
146
- var message ='';
147
- if( typeof r !== 'object' )
148
- message = sis.phpError;
149
- else
150
- message = r.error
151
-
152
- jQuery( '#error_messages' ).addClass( 'error message' );
153
- jQuery( '#error_messages ul.messages' ).prepend( '<li>'+message+'</li>' );
154
- } else {
155
-
156
- // Append a message if needed
157
- if( r.message )
158
- jQuery( '#time ul.messages' ).prepend( '<li>'+r.message+'</li>' );
159
-
160
- // Actual time
161
- var dateEnd = new Date();
162
- var curDate = new Date();
163
-
164
- // Display the image
165
- jQuery( "#thumb" ).show();
166
-
167
- // Change his attribute
168
- jQuery( "#thumb-img" ).attr("src", r.src);
169
-
170
- // Add the regenerating time to the array
171
- _self.timeScript.push(r.time);
172
-
173
- // Get the number of elements in array
174
- var num = _self.timeScript.length;
175
- var sum = 0;
176
-
177
- // Make the sum of the times
178
- for( var i=0; i<num ;i++ ) {
179
- sum += _self.timeScript[i];
180
- }
181
-
182
- // Make the average value of the regenerating time
183
- var ave = sum/num;
184
-
185
- // Round the value in miliseconds and add 25% or error
186
- var t = Math.round( ( ( ave *_self.list.length ) * 1000 ) );
187
-
188
- // Set the predicted time
189
- dateEnd.setTime( _self.dateScript.getTime() + t );
190
-
191
- // Get the difference between the two dates
192
- var time = _self.s2t( ( dateEnd.getTime() - curDate.getTime() ) / 1000 );
193
-
194
- // Set the message in the notice box
195
- _self.setTimeMessage( dateEnd.getHours()+":"+dateEnd.getMinutes()+":"+dateEnd.getSeconds()+sis.or+time+sis.beforeEnd );
196
- }
197
-
198
- // Inscrease the counter and regene the next item
199
- _self.curr++;
200
- _self.regenItem();
201
- }
202
- });
203
-
204
- },
205
- s2t : function (secs) {
206
- secs = secs % 86400;
207
- var t = new Date(1970,0,1);
208
- t.setSeconds(secs);
209
- var s = t.toTimeString().substr(0,8);
210
- if(secs > 86399)
211
- s = Math.floor((t - Date.parse("1/1/70")) / 3600000) + s.substr(2);
212
- return s;
213
- }
214
- ,
215
- reInit: function() {
216
- // Re initilize the form
217
- jQuery( "#ajax_thumbnail_rebuild" ).removeAttr( "disabled" );
218
- jQuery( ".progress, #thumb" ).hide();
219
- }
220
- }
221
-
222
- var sizes = {
223
- i: 0,
224
- add: function(e,el) {
225
- e.preventDefault();
226
-
227
- // Create the template
228
- var elTr = jQuery( '<tr />' ).attr( 'valign', 'top' ).addClass( 'new_size_' + this.i+' new_size' );
229
- jQuery( '<th />' ).attr( 'scope', 'row' ).append(
230
- jQuery( '<input />' )
231
- .attr( {
232
- type: 'text',
233
- id: 'new_size_'+this.i
234
- }
235
- )
236
- .val( 'thumbnail-name' )
237
- ).appendTo( elTr );
238
-
239
- jQuery( '<td />' ).append( jQuery( '<input />' )
240
- .attr( {
241
- type: 'button',
242
- id: 'validate_'+this.i
243
- }
244
- )
245
- .val( sis.validate )
246
- .addClass('button-secondary action add_size_name')
247
- ).appendTo( elTr );
248
-
249
- // Add the form for editing
250
- jQuery(el).closest( 'tr' ).before( elTr );
251
-
252
- // Inscrease the identifier
253
- this.i++;
254
- },
255
- register: function( e, el ) {
256
- // Stop propagation
257
- e.preventDefault();
258
-
259
- // Get name and id
260
- var name = jQuery(el).closest('tr').children( 'th' ).find( 'input' ).val();
261
- var id = jQuery(el).closest('tr').children('th').find( 'input' ).attr( 'id' );
262
-
263
- // Get the number of elements with this name
264
- var checkPresent = jQuery( el ).closest('tbody').find( 'input[value="'+name+'"]' ).length;
265
-
266
- // Check if not basic size or already present, display message
267
- if( name == 'thumbnail' || name == "medium" || name == "large" ) {
268
- alert( sis.notOriginal );
269
- return false;
270
- } else if( checkPresent !=0 ) {
271
- alert( sis.alreadyPresent );
272
- return false;
273
- }
274
-
275
- // Create td and th elements fo the row
276
- var thEl = jQuery( '<th />' ).attr( 'scope', 'row' ).text( sis.size + ' ' + name );
277
- var tdEl = jQuery( '<td />' );
278
-
279
- jQuery( '<input />' ).attr( { type: 'hidden', name: 'image_name' } ).val( name ).appendTo( tdEl ) ;
280
- jQuery( '<input />' ).attr( { type :'hidden', name : 'custom_image_sizes[' + name + '][custom]' } ).val( "1" ).appendTo( tdEl );
281
-
282
- jQuery( '<label />' ).attr( 'for', 'custom_image_sizes[' + name + '][w]' ).addClass( 'sis-label' ).text(sis.maximumWidth).append(
283
- jQuery( '<input />' ).attr( { type: 'number',
284
- name: 'custom_image_sizes[' + name + '][w]',
285
- step: 1,
286
- min: 0,
287
- id: 'custom_image_sizes[' + name + '][w]',
288
- base_w:0
289
- }
290
- ).val( "0" ).addClass( "w small-text" )
291
- ).appendTo( tdEl );
292
-
293
- jQuery( '<label />' ).attr( 'for', 'custom_image_sizes[' + name + '][h]' ).addClass( 'sis-label' ).text(sis.maximumHeight).append(
294
- jQuery( '<input />' ).attr( { type: 'number',
295
- name: 'custom_image_sizes[' + name + '][h]',
296
- step: 1,
297
- min: 0,
298
- id: 'custom_image_sizes[' + name + '][h]',
299
- base_h:0
300
- }
301
- ).val( "0" ).addClass( "h small-text" )
302
- ).appendTo( tdEl );
303
-
304
-
305
- jQuery( '<label />' ).attr( 'for', 'custom_image_sizes[' + name + '][n]' ).addClass( 'sis-label' ).text(sis.customName).append(
306
- jQuery( '<input />' ).attr( { type: 'text',
307
- name: 'custom_image_sizes[' + name + '][n]',
308
- id: 'custom_image_sizes[' + name + '][n]',
309
- base_n:name
310
- }
311
- ).val( name ).addClass( "n small-text" )
312
- ).appendTo( tdEl );
313
-
314
- els = jQuery( '<span />' )
315
- .addClass( 'size_options' )
316
- .append(
317
- jQuery( '<input />' )
318
- .attr( {
319
- type: 'checkbox',
320
- name: 'custom_image_sizes[' + name + '][c]',
321
- id: 'custom_image_sizes[' + name + '][c]',
322
- base_c:0
323
- } )
324
- .val( "1" )
325
- .addClass( 'c crop' )
326
- )
327
- .append(
328
- jQuery( '<label />' )
329
- .attr( {
330
- 'for': 'custom_image_sizes[' + name + '][c]',
331
- id: 'custom_image_sizes[' + name + '][c]',
332
- 'class': 'c',
333
- title:sis.crop
334
- } )
335
- .text( sis.crop )
336
- )
337
- .append(
338
- jQuery( '<input />' )
339
- .attr( {
340
- type: 'checkbox',
341
- name: 'custom_image_sizes[' + name + '][s]',
342
- id: 'custom_image_sizes[' + name + '][s]',
343
- base_s:0
344
- } )
345
- .val( "1" )
346
- .addClass( 's show' )
347
- )
348
- .append(
349
- jQuery( '<label />' )
350
- .attr( {
351
- 'for': 'custom_image_sizes[' + name + '][s]',
352
- id: 'custom_image_sizes[' + name + '][s]',
353
- 'class': 's',
354
- title:sis.show
355
- } )
356
- .text( sis.show )
357
- );
358
-
359
- els.appendTo(tdEl);
360
-
361
- jQuery( '<div />' ).text( sis.deleteImage ).addClass('delete_size').appendTo( tdEl );
362
- jQuery( '<div />' ).text( sis.validateButton ).addClass('add_size validate_size').appendTo( tdEl );
363
-
364
- // Add the row to the current list
365
- jQuery('#' + id).closest( 'tr' ).html( thEl.after( tdEl ) );
366
-
367
- if( sis_small == true ){
368
- // Refresh the buttons
369
- this.setButtonsSmall();
370
- } else {
371
- // Refresh the buttons
372
- this.setButtons();
373
- }
374
- },
375
- deleteSize: function( e, el ) {
376
- e.preventDefault();
377
- // Check if user want to delete or not
378
- var confirmation = confirm( sis.confirmDelete );
379
-
380
- // Delete if ok else not delete
381
- if( confirmation == true ) {
382
- // Remove from the list and the array
383
- jQuery( el ).closest( 'tr' ).remove();
384
- this.ajaxUnregister( el );
385
- }
386
- },
387
- getPhp : function( e, el ) {
388
- e.preventDefault();
389
- // Get parent element
390
- var parent = jQuery( el ).closest( 'tr' );
391
-
392
- jQuery.ajax( {
393
- url: sis.ajaxUrl,
394
- type: "POST",
395
- data: { action : "get_sizes" },
396
- beforeSend: function() {
397
- // Remove classes of status
398
- parent.removeClass( 'addPending' );
399
- parent.addClass( 'addPending' );
400
- },
401
- success: function( result ) {
402
- // Add the classes for the status
403
- jQuery( '#get_php' ).nextAll( 'code' ).html( '<br />' + result).show().css( { 'display' : 'block' } );
404
- parent.removeClass( 'addPending' );
405
- }
406
- } );
407
- },
408
- ajaxRegister: function( e, el ) {
409
- e.preventDefault();
410
-
411
- // Get the vars
412
- var _self = this;
413
- var parentTable = jQuery( el ).closest( 'table' );
414
- var timer;
415
- var wp_nonce = jQuery( '.addSize' ).val();
416
- var parent = jQuery( el ).closest( 'tr' );
417
- var n = parent.find( 'input[name="image_name"]' ).val();
418
- var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
419
- var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
420
- var cn = parent.find( 'input.n' ).val();
421
-
422
- if( c == false || c == undefined ) {
423
- c = false;
424
- } else {
425
- c = true;
426
- }
427
-
428
- if( s == false || s == undefined ) {
429
- s = false;
430
- } else {
431
- s = true;
432
- }
433
-
434
- var w = parseInt( parent.find( 'input.w' ).val() );
435
- var h = parseInt( parent.find( 'input.h' ).val() );
436
-
437
- if( !parentTable.hasClass( 'ajaxing' ) ) {
438
- jQuery.ajax({
439
- url: sis.ajaxUrl,
440
- type: "POST",
441
- dataType :'json',
442
- data: { action : "add_size", width: w, height: h, crop: c, name: n, show: s, customName : cn , nonce : wp_nonce },
443
- beforeSend: function() {
444
- // Remove status and set pending
445
- parent.removeClass();
446
- parent.addClass( 'addPending' );
447
- parentTable.addClass( 'ajaxing' );
448
- },
449
- success: function(result) {
450
- // Set basic class and remove pending
451
- var classTr = '';
452
- parent.removeClass();
453
- parentTable.removeClass( 'ajaxing' )
454
-
455
- // Check the result for the different messages
456
- if( result == 0 ) {
457
- classTr = 'errorAdding';
458
- } else if( result == 2 ) {
459
- classTr = 'notChangedAdding';
460
-
461
- // add/update to the array with the status class
462
- _self.addToArray( n, w, h, c, classTr );
463
- } else {
464
- classTr = 'successAdding';
465
-
466
- // add/update to the array with the status class
467
- _self.addToArray( n, w, h, c, classTr );
468
- }
469
-
470
- // Add the new sizes values for checking of changed or not
471
- parent.find( 'input.h' ).attr( { base_h : h } );
472
- parent.find( 'input.w' ).attr( { base_w : w } );
473
- parent.find( 'input.c' ).attr( { base_c : c } );
474
- parent.find( 'input.s' ).attr( { base_s : s } );
475
-
476
- // Add the generated class
477
- parent.addClass( classTr );
478
- parent.find( 'td' ).removeClass( "notSaved" );
479
-
480
- // Change the button text
481
- parent.find( '.add_size' ).removeClass('validate_size').hide().children('.ui-button-text' ).text( sis.update ) ;
482
-
483
- clearTimeout( timer );
484
- // Remove classes after 3 seconds
485
- timer = setTimeout(function() {
486
- parent.removeClass( 'errorAdding notChangedAdding successAdding' );
487
- }, 3 * 1000 );
488
- }
489
- });
490
- }
491
- },
492
- ajaxUnregister: function( el ) {
493
- // Get name and _self object
494
- var _self = this;
495
- var n = jQuery( el ).closest('tr').find( 'input[name="image_name"]' ).val();
496
- var wp_nonce = jQuery( el ).closest('tr').find( 'input.deleteSize' ).val();
497
-
498
- // Make the ajax call
499
- jQuery.ajax({
500
- url: sis.ajaxUrl,
501
- type: "POST",
502
- data: { action : "remove_size", name: n, nonce : wp_nonce },
503
- success: function(result) {
504
- _self.removeFromArray( el );
505
- }
506
- });
507
- },
508
- addToArray: function( n, w, h, c, s ) {
509
- // Get the row for editing or updating
510
- var testRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+n+'"]' );
511
- var newRow = '';
512
- var timer;
513
-
514
- // Get the right newRow, updating or adding ?
515
- if( testRow.length != 0 )
516
- newRow = testRow.closest( 'tr' );
517
- else
518
- newRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody > tr:first' ).clone();
519
-
520
- if( c == true )
521
- c = sis.tr;
522
- else
523
- c = sis.fl;
524
-
525
- // Set the datas with the given datas
526
- newRow.find( 'th > label' ).attr( 'for', n )
527
- .end()
528
- .find( 'input.thumbnails' ).val( n ).attr( 'id', n ).end()
529
- .find( 'th:nth-child(2) > label' ).text( n )
530
- .end()
531
- .find( 'th:nth-child(3) > label' ).text( w+'px' )
532
- .end()
533
- .find( 'th:nth-child(4) > label' ).text( h+'px' )
534
- .end()
535
- .find( 'th:nth-child(5) > label' ).text( c );
536
-
537
- // If new then add the row
538
- if( testRow.length == 0 )
539
- newRow.appendTo( '#sis-regen .wrapper > table#sis_sizes > tbody' );
540
-
541
- // Remove the previous status classes and add the status class
542
- newRow.removeClass( 'errorAdding notChangedAdding successAdding' ).addClass( s );
543
-
544
- clearTimeout( timer );
545
- // Remove the statuses classes
546
- timer = setTimeout(function() {
547
- newRow.removeClass( 'errorAdding notChangedAdding successAdding' );
548
- }, 3 * 1000 );
549
- },
550
- removeFromArray: function( el ) {
551
- // get the name
552
- var n = jQuery( el ).closest( 'tr' ).find( 'input[name=image_name]' ).val();
553
-
554
- // Remove the given name from the array
555
- jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+n+'"]' ).closest( 'tr' ).remove();
556
- },
557
- setButtons: function() {
558
- // UI for delete,crop and add buttons
559
- jQuery(".delete_size").button( {
560
- icons: {
561
- primary: 'ui-icon-circle-close'
562
- },
563
- text: true
564
- } );
565
- jQuery(".add_size").button( {
566
- icons: {
567
- primary: 'ui-icon-check'
568
- },
569
- text: true
570
- } );
571
- jQuery(".crop").button({
572
- icons: {
573
- primary: 'ui-icon-arrow-4-diag'
574
- },
575
- text: true
576
- });
577
- jQuery(".show").button({
578
- icons: {
579
- primary: 'ui-icon-lightbulb'
580
- },
581
- text: true
582
- });
583
- jQuery( '.size_options' ).buttonset();
584
- },
585
- setButtonsSmall: function() {
586
- // UI for delete,crop and add buttons
587
- jQuery(".delete_size").button( {icons: {
588
- primary: 'ui-icon-circle-close'
589
- },text: false} );
590
- jQuery(".add_size").button( { icons: {
591
- primary: 'ui-icon-check'
592
- },text: false} );
593
- jQuery(".crop").button({icons: {
594
- primary: 'ui-icon-arrow-4-diag'
595
- },text: false});
596
- jQuery(".show").button( {icons: {
597
- primary: 'ui-icon-lightbulb'
598
- },text: false});
599
- },
600
- displayChange : function( el ) {
601
- el = jQuery( el );
602
- var parent = el.closest( 'tr' );
603
-
604
- // Check not new size
605
- if( parent.hasClass( 'new_size' ) )
606
- return false;
607
-
608
- var h_el = parent.find( 'input.h' );
609
- var w_el = parent.find( 'input.w' );
610
- var c_el = parent.find( 'input.c' );
611
- var s_el = parent.find( 'input.s' );
612
- var n_el = parent.find( 'input.n' );
613
-
614
- var h = h_el.val();
615
- var w = w_el.val();
616
- var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
617
- var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
618
- var n = n_el.val();
619
-
620
- var base_h = h_el.attr( 'base_h' );
621
- var base_w = w_el.attr( 'base_w' );
622
- var base_c = c_el.attr( 'base_c' );
623
- var base_s = s_el.attr( 'base_s' );
624
- var base_n = n_el.attr( 'base_n' );
625
-
626
- if( base_c == '0' )
627
- base_c = false;
628
- else
629
- base_c = true;
630
-
631
- if( base_s == '0' )
632
- base_s = false;
633
- else
634
- base_s = true;
635
-
636
-
637
-
638
- if( h != base_h || w != base_w || c != base_c || s != base_s || n != base_n ) {
639
- el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
640
- } else {
641
- el.closest( 'td' ).removeClass( 'notSaved' ).find('.add_size').css( 'display', 'none' );
642
- }
643
- }
644
- }
645
- jQuery(function() {
646
-
647
- // Regeneration listener
648
- jQuery( '#ajax_thumbnail_rebuild' ).click( function() { regenerate.checkStartRegenerating(); } );
649
-
650
- // Add size button listener
651
- jQuery('#add_size').click(function( e ){ sizes.add( e, this ); });
652
-
653
- // Registering a new size listener
654
- jQuery('.add_size_name').live( 'click',function( e ) { sizes.register( e, this ); } );
655
-
656
- // Delete and Adding buttons
657
- jQuery('.delete_size').live( 'click', function( e ) { sizes.deleteSize( e, this ); } );
658
- jQuery('.add_size').live( 'click', function( e ) { sizes.ajaxRegister( e, this ); } );
659
-
660
- jQuery( '.h,.w,.c,.s,.n' ).live( 'click skeyup change', function( e ) { sizes.displayChange( this ); } );
661
-
662
- // Seup the getphp
663
- jQuery('#get_php').click( function( e ){ sizes.getPhp( e, this ) } );
664
- jQuery('#get_php').nextAll('code').hide();
665
-
666
- // Colors for the theme / custom sizes
667
- jQuery('span.custom_size').closest('tr').children('th').css( {
668
- 'color': '#89D76A'
669
- } );
670
- jQuery('span.theme_size').closest('tr').children('th').css( {
671
- 'color': '#F2A13A'
672
- } );
673
-
674
-
675
- jQuery(".add_size").hide();
676
-
677
- // Error ajax handler
678
- jQuery( '<div class="ui-widget" id="msg"><div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span><strong>Alert:</strong> <ul class="msg" ></ul></p></div></div>').prependTo( "div#wpwrap" ).slideUp( 0 );
679
-
680
- // Display the errors of ajax queries
681
- jQuery("#msg").ajaxError( function(event, request, settings ) {
682
- jQuery( this ).find( '.msg' ).append( "<li>"+sis.ajaxErrorHandler+" " + settings.url + ", status "+request.status+" : "+request.statusText+"</li>" ).end().stop( false, false ).slideDown( 200 ).delay( 5000 ).slideUp( 200 );
683
- });
684
-
685
- // Check resizing of the window
686
- jQuery(window).bind('resize', sisCheckWindowSize );
687
-
688
- function sisCheckWindowSize() {
689
- if( window.innerWidth <= 820 && sis_small == false ) {
690
- sizes.setButtonsSmall();
691
- sis_small = true;
692
- } else if( window.innerWidth > 820 && sis_small == true ){
693
- sizes.setButtons();
694
- sis_small = false;
695
- }
696
- }
697
-
698
- // Set the buttons
699
- sizes.setButtons();
700
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/sis.min.js DELETED
@@ -1,25 +0,0 @@
1
- sis_small=!0;
2
- var regenerate={post_types:"",thumbnails:"",list:"",cur:0,timeScript:[],dateScript:"",percent:"",getThumbnails:function(){var a=this,c=jQuery("input.thumbnails:checked");c.length!=jQuery('input.thumbnails[type="checkbox"]').length&&c.each(function(){a.thumbnails+="&thumbnails[]="+jQuery(this).val()})},getPostTypes:function(){var a=this,c=jQuery("input.post_types:checked");c.length!=jQuery('input.post_types[type="checkbox"]').length&&c.each(function(){a.post_types+="&post_types[]="+jQuery(this).val()})},setMessage:function(a){jQuery("#regenerate_message").html("<p>"+
3
- a+"</p>").addClass("updated").addClass("fade").show();this.refreshProgressBar()},setTimeMessage:function(a){jQuery("#time p span.time_message").html(a)},refreshProgressBar:function(){jQuery(".progress").progressbar()},checkStartRegenerating:function(){if(0<jQuery(".notSaved").size())if(!0==confirm(sis.notSaved))this.startRegenerating();else return!1;else this.startRegenerating()},startRegenerating:function(){var a=this,c=jQuery("input.getList").val();this.dateScript=new Date;jQuery.ajax({url:sis.ajaxUrl,
4
- type:"POST",dataType:"json",data:"action=sis_ajax_thumbnail_rebuild&do=getlist"+a.post_types+"&nonce="+c,beforeSend:function(){jQuery("#ajax_thumbnail_rebuild").attr("disabled",!0);a.setMessage(sis.reading);a.getThumbnails();a.getPostTypes()},success:function(b){if("object"!==typeof b)return a.reInit(),a.setMessage(sis.phpError),!1;jQuery("#time").show();a.list=b;a.curr=0;jQuery(".progress").show();a.regenItem()}})},regenItem:function(){var a=this,c=jQuery("input.regen").val();if(!this.list)return this.reInit(),
5
- this.setMessage(sis.noMedia),!1;this.curr>=this.list.length?(c=new Date,this.reInit(),this.setMessage(sis.done+this.curr+" "+sis.messageRegenerated+sis.startedAt+" "+c.getHours()+":"+c.getMinutes()+":"+c.getSeconds()+sis.finishedAt+" "+c.getHours()+":"+c.getMinutes()+":"+c.getSeconds())):(this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.list.length+" ("+this.list[this.curr].title+")..."),jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:"action=sis_ajax_thumbnail_rebuild&do=regen&id="+
6
- this.list[this.curr].id+this.thumbnails+"&nonce="+c,beforeSend:function(){a.percent=100*(a.curr/a.list.length);jQuery(".progress").progressbar("value",a.percent);jQuery(".progress-percent span.text").html(Math.round(a.percent)+"%").closest(".progress-percent").animate({left:Math.round(a.percent)-2.5+"%"},500)},success:function(b){if(!b.src||!b.time||b.error||"object"!==typeof b){var c="",c="object"!==typeof b?sis.phpError:b.error;jQuery("#error_messages").addClass("error message");jQuery("#error_messages ul.messages").prepend("<li>"+
7
- c+"</li>")}else{b.message&&jQuery("#time ul.messages").prepend("<li>"+b.message+"</li>");var c=new Date,g=new Date;jQuery("#thumb").show();jQuery("#thumb-img").attr("src",b.src);a.timeScript.push(b.time);for(var b=a.timeScript.length,e=0,d=0;d<b;d++)e+=a.timeScript[d];b=Math.round(1E3*e/b*a.list.length);c.setTime(a.dateScript.getTime()+b);g=a.s2t((c.getTime()-g.getTime())/1E3);a.setTimeMessage(c.getHours()+":"+c.getMinutes()+":"+c.getSeconds()+sis.or+g+sis.beforeEnd)}a.curr++;a.regenItem()}}))},s2t:function(a){var a=
8
- a%86400,c=new Date(1970,0,1);c.setSeconds(a);var b=c.toTimeString().substr(0,8);86399<a&&(b=Math.floor((c-Date.parse("1/1/70"))/36E5)+b.substr(2));return b},reInit:function(){jQuery("#ajax_thumbnail_rebuild").removeAttr("disabled");jQuery(".progress, #thumb").hide()}},sizes={i:0,add:function(a,c){a.preventDefault();var b=jQuery("<tr />").attr("valign","top").addClass("new_size_"+this.i+" new_size");jQuery("<th />").attr("scope","row").append(jQuery("<input />").attr({type:"text",id:"new_size_"+this.i}).val("thumbnail-name")).appendTo(b);
9
- jQuery("<td />").append(jQuery("<input />").attr({type:"button",id:"validate_"+this.i}).val(sis.validate).addClass("button-secondary action add_size_name")).appendTo(b);jQuery(c).closest("tr").before(b);this.i++},register:function(a,c){a.preventDefault();var b=jQuery(c).closest("tr").children("th").find("input").val(),f=jQuery(c).closest("tr").children("th").find("input").attr("id"),g=jQuery(c).closest("tbody").find('input[value="'+b+'"]').length;if("thumbnail"==b||"medium"==b||"large"==b)return alert(sis.notOriginal),
10
- !1;if(0!=g)return alert(sis.alreadyPresent),!1;var g=jQuery("<th />").attr("scope","row").text(sis.size+" "+b),e=jQuery("<td />");jQuery("<input />").attr({type:"hidden",name:"image_name"}).val(b).appendTo(e);jQuery("<input />").attr({type:"hidden",name:"custom_image_sizes["+b+"][custom]"}).val("1").appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+b+"][w]").addClass("sis-label").text(sis.maximumWidth).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+b+"][w]",
11
- step:1,min:0,id:"custom_image_sizes["+b+"][w]",base_w:0}).val("0").addClass("w small-text")).appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+b+"][h]").addClass("sis-label").text(sis.maximumHeight).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+b+"][h]",step:1,min:0,id:"custom_image_sizes["+b+"][h]",base_h:0}).val("0").addClass("h small-text")).appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+b+"][n]").addClass("sis-label").text(sis.customName).append(jQuery("<input />").attr({type:"text",
12
- name:"custom_image_sizes["+b+"][n]",id:"custom_image_sizes["+b+"][n]",base_n:b}).val(b).addClass("n small-text")).appendTo(e);els=jQuery("<span />").addClass("size_options").append(jQuery("<input />").attr({type:"checkbox",name:"custom_image_sizes["+b+"][c]",id:"custom_image_sizes["+b+"][c]",base_c:0}).val("1").addClass("c crop")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+b+"][c]",id:"custom_image_sizes["+b+"][c]","class":"c",title:sis.crop}).text(sis.crop)).append(jQuery("<input />").attr({type:"checkbox",
13
- name:"custom_image_sizes["+b+"][s]",id:"custom_image_sizes["+b+"][s]",base_s:0}).val("1").addClass("s show")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+b+"][s]",id:"custom_image_sizes["+b+"][s]","class":"s",title:sis.show}).text(sis.show));els.appendTo(e);jQuery("<div />").text(sis.deleteImage).addClass("delete_size").appendTo(e);jQuery("<div />").text(sis.validateButton).addClass("add_size validate_size").appendTo(e);jQuery("#"+f).closest("tr").html(g.after(e));!0==sis_small?this.setButtonsSmall():
14
- this.setButtons()},deleteSize:function(a,c){a.preventDefault();!0==confirm(sis.confirmDelete)&&(jQuery(c).closest("tr").remove(),this.ajaxUnregister(c))},getPhp:function(a,c){a.preventDefault();var b=jQuery(c).closest("tr");jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"get_sizes"},beforeSend:function(){b.removeClass("addPending");b.addClass("addPending")},success:function(a){jQuery("#get_php").nextAll("code").html("<br />"+a).show().css({display:"block"});b.removeClass("addPending")}})},
15
- ajaxRegister:function(a,c){a.preventDefault();var b=this,f=jQuery(c).closest("table"),g,e=jQuery(".addSize").val(),d=jQuery(c).closest("tr"),i=d.find('input[name="image_name"]').val(),h=d.find("label.c").hasClass("ui-state-active"),j=d.find("label.s").hasClass("ui-state-active"),k=d.find("input.n").val(),h=!1==h||void 0==h?!1:!0,j=!1==j||void 0==j?!1:!0,l=parseInt(d.find("input.w").val()),m=parseInt(d.find("input.h").val());f.hasClass("ajaxing")||jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",
16
- data:{action:"add_size",width:l,height:m,crop:h,name:i,show:j,customName:k,nonce:e},beforeSend:function(){d.removeClass();d.addClass("addPending");f.addClass("ajaxing")},success:function(a){var c="";d.removeClass();f.removeClass("ajaxing");0==a?c="errorAdding":(c=2==a?"notChangedAdding":"successAdding",b.addToArray(i,l,m,h,c));d.find("input.h").attr({base_h:m});d.find("input.w").attr({base_w:l});d.find("input.c").attr({base_c:h});d.find("input.s").attr({base_s:j});d.addClass(c);d.find("td").removeClass("notSaved");
17
- d.find(".add_size").removeClass("validate_size").hide().children(".ui-button-text").text(sis.update);clearTimeout(g);g=setTimeout(function(){d.removeClass("errorAdding notChangedAdding successAdding")},3E3)}})},ajaxUnregister:function(a){var c=this,b=jQuery(a).closest("tr").find('input[name="image_name"]').val(),f=jQuery(a).closest("tr").find("input.deleteSize").val();jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"remove_size",name:b,nonce:f},success:function(){c.removeFromArray(a)}})},addToArray:function(a,
18
- c,b,f,g){var e=jQuery('#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+a+'"]'),d="",i,d=0!=e.length?e.closest("tr"):jQuery("#sis-regen .wrapper > table#sis_sizes > tbody > tr:first").clone(),f=!0==f?sis.tr:sis.fl;d.find("th > label").attr("for",a).end().find("input.thumbnails").val(a).attr("id",a).end().find("th:nth-child(2) > label").text(a).end().find("th:nth-child(3) > label").text(c+"px").end().find("th:nth-child(4) > label").text(b+"px").end().find("th:nth-child(5) > label").text(f);
19
- 0==e.length&&d.appendTo("#sis-regen .wrapper > table#sis_sizes > tbody");d.removeClass("errorAdding notChangedAdding successAdding").addClass(g);clearTimeout(i);i=setTimeout(function(){d.removeClass("errorAdding notChangedAdding successAdding")},3E3)},removeFromArray:function(a){a=jQuery(a).closest("tr").find("input[name=image_name]").val();jQuery('#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+a+'"]').closest("tr").remove()},setButtons:function(){jQuery(".delete_size").button({icons:{primary:"ui-icon-circle-close"},
20
- text:!0});jQuery(".add_size").button({icons:{primary:"ui-icon-check"},text:!0});jQuery(".crop").button({icons:{primary:"ui-icon-arrow-4-diag"},text:!0});jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!0});jQuery(".size_options").buttonset()},setButtonsSmall:function(){jQuery(".delete_size").button({icons:{primary:"ui-icon-circle-close"},text:!1});jQuery(".add_size").button({icons:{primary:"ui-icon-check"},text:!1});jQuery(".crop").button({icons:{primary:"ui-icon-arrow-4-diag"},text:!1});
21
- jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!1})},displayChange:function(a){var a=jQuery(a),c=a.closest("tr");if(c.hasClass("new_size"))return!1;var b=c.find("input.h"),f=c.find("input.w"),g=c.find("input.c"),e=c.find("input.s"),d=c.find("input.n"),i=b.val(),h=f.val(),j=c.find("label.c").hasClass("ui-state-active"),c=c.find("label.s").hasClass("ui-state-active"),k=d.val(),b=b.attr("base_h"),f=f.attr("base_w"),g=g.attr("base_c"),e=e.attr("base_s"),d=d.attr("base_n");i!=b||h!=f||
22
- j!=("0"==g?!1:!0)||c!=("0"==e?!1:!0)||k!=d?a.closest("td").addClass("notSaved").find(".add_size").css("display","inline-block"):a.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}};
23
- jQuery(function(){jQuery("#ajax_thumbnail_rebuild").click(function(){regenerate.checkStartRegenerating()});jQuery("#add_size").click(function(a){sizes.add(a,this)});jQuery(".add_size_name").live("click",function(a){sizes.register(a,this)});jQuery(".delete_size").live("click",function(a){sizes.deleteSize(a,this)});jQuery(".add_size").live("click",function(a){sizes.ajaxRegister(a,this)});jQuery(".h,.w,.c,.s,.n").live("click skeyup change",function(){sizes.displayChange(this)});jQuery("#get_php").click(function(a){sizes.getPhp(a,
24
- this)});jQuery("#get_php").nextAll("code").hide();jQuery("span.custom_size").closest("tr").children("th").css({color:"#89D76A"});jQuery("span.theme_size").closest("tr").children("th").css({color:"#F2A13A"});jQuery(".add_size").hide();jQuery('<div class="ui-widget" id="msg"><div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span><strong>Alert:</strong> <ul class="msg" ></ul></p></div></div>').prependTo("div#wpwrap").slideUp(0);
25
- jQuery("#msg").ajaxError(function(a,c,b){jQuery(this).find(".msg").append("<li>"+sis.ajaxErrorHandler+" "+b.url+", status "+c.status+" : "+c.statusText+"</li>").end().stop(!1,!1).slideDown(200).delay(5E3).slideUp(200)});jQuery(window).bind("resize",function(){820>=window.innerWidth&&!1==sis_small?(sizes.setButtonsSmall(),sis_small=!0):820<window.innerWidth&&!0==sis_small&&(sizes.setButtons(),sis_small=!1)});sizes.setButtons()});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/simple-image-sizes-de_DE.mo ADDED
Binary file
languages/simple-image-sizes-de_DE.po ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-04-20 15:24+0100\n"
6
+ "PO-Revision-Date: 2014-04-20 15:32+0100\n"
7
+ "Last-Translator: Nicolas Juen <nicolas.juen@gmail.com>\n"
8
+ "Language-Team: LANGUAGE <LL@li.org>\n"
9
+ "Language: de_DE\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "X-Generator: Poedit 1.6.3\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ # @ sis
23
+ #: ../classes/admin/main.php:39
24
+ msgid "Reading attachments..."
25
+ msgstr "Lese Anhänge…"
26
+
27
+ # @ sis
28
+ #: ../classes/admin/main.php:40 ../classes/admin/media.php:154
29
+ msgid "Maximum width"
30
+ msgstr "Maximale Breite"
31
+
32
+ # @ sis
33
+ #: ../classes/admin/main.php:41 ../classes/admin/media.php:158
34
+ msgid "Maximum height"
35
+ msgstr "Maximale Höhe"
36
+
37
+ # @ sis
38
+ #: ../classes/admin/main.php:42
39
+ msgid "Crop"
40
+ msgstr ""
41
+
42
+ # @ sis
43
+ #: ../classes/admin/main.php:43
44
+ msgid "yes"
45
+ msgstr "ja"
46
+
47
+ # @ sis
48
+ #: ../classes/admin/main.php:44
49
+ msgid "no"
50
+ msgstr "nein"
51
+
52
+ # @ sis
53
+ #: ../classes/admin/main.php:45 ../classes/admin/media.php:176
54
+ msgid "Show in post insertion ?"
55
+ msgstr "Beim Einfügen in den Beitrag anzeigen?"
56
+
57
+ # @ sis
58
+ #: ../classes/admin/main.php:46
59
+ msgid " of "
60
+ msgstr "von"
61
+
62
+ # @ sis
63
+ #: ../classes/admin/main.php:47
64
+ msgid " or "
65
+ msgstr "oder"
66
+
67
+ # @ sis
68
+ #: ../classes/admin/main.php:48
69
+ msgid " before the end."
70
+ msgstr "vor dem Ende."
71
+
72
+ # @ sis
73
+ #: ../classes/admin/main.php:49 ../classes/admin/media.php:178
74
+ msgid "Delete"
75
+ msgstr "Löschen"
76
+
77
+ # @ sis
78
+ #: ../classes/admin/main.php:50
79
+ msgid "No media in your site to regenerate !"
80
+ msgstr "Keine Medien neu zu generieren!"
81
+
82
+ # @ sis
83
+ #: ../classes/admin/main.php:51
84
+ msgid "Regenerating "
85
+ msgstr "Neu generieren"
86
+
87
+ # @ sis
88
+ #: ../classes/admin/main.php:52
89
+ msgid "Regenerate "
90
+ msgstr ""
91
+
92
+ # @ sis
93
+ #: ../classes/admin/main.php:53
94
+ msgid "Validate image size name"
95
+ msgstr "Bildgrößenbezeichnung überprüfen"
96
+
97
+ # @ sis
98
+ #: ../classes/admin/main.php:54
99
+ msgid "Done."
100
+ msgstr "Fertig."
101
+
102
+ # @ sis
103
+ #: ../classes/admin/main.php:55
104
+ msgid "Size"
105
+ msgstr "Bildgröße"
106
+
107
+ # @ sis
108
+ #: ../classes/admin/main.php:56
109
+ msgid ""
110
+ "Don't use the basic Wordpress thumbnail size name, use the form above to "
111
+ "edit them"
112
+ msgstr ""
113
+ "Nutze nicht die vorgegebene Thumbnail-Bezeichnung in WordPress! Nutze das "
114
+ "Formular, um diese zu bearbeiten."
115
+
116
+ # @ sis
117
+ #: ../classes/admin/main.php:57
118
+ msgid "This size is already registered, edit it instead of recreating it."
119
+ msgstr ""
120
+ "Die Bildgröße existiert bereits. Du kannst sie bearbeiten, anstatt sie "
121
+ "doppelt anzulegen."
122
+
123
+ # @ sis
124
+ #: ../classes/admin/main.php:58
125
+ msgid "Do you really want to delete these size ?"
126
+ msgstr "Willst du diese Bildgröße/n wirklich löschen?"
127
+
128
+ # @ sis
129
+ #: ../classes/admin/main.php:59 ../classes/admin/media.php:179
130
+ msgid "Update"
131
+ msgstr "Aktualisieren"
132
+
133
+ # @ sis
134
+ #: ../classes/admin/main.php:60
135
+ msgid "Error requesting page"
136
+ msgstr "Fehler beim Abruf der Seite"
137
+
138
+ # @ sis
139
+ #: ../classes/admin/main.php:61
140
+ msgid "images have been regenerated !"
141
+ msgstr "Bilder wurden neu generiert!"
142
+
143
+ # @ sis
144
+ #: ../classes/admin/main.php:62
145
+ msgid "Validate"
146
+ msgstr "Überprüfen"
147
+
148
+ # @ sis
149
+ #: ../classes/admin/main.php:63
150
+ msgid " started at"
151
+ msgstr "begonnen: "
152
+
153
+ # @ sis
154
+ #: ../classes/admin/main.php:64 ../classes/admin/media.php:162
155
+ msgid "Public name"
156
+ msgstr ""
157
+
158
+ # @ sis
159
+ #: ../classes/admin/main.php:65
160
+ msgid " finished at :"
161
+ msgstr "beendet: "
162
+
163
+ # @ sis
164
+ #: ../classes/admin/main.php:66
165
+ msgid ""
166
+ "Error during the php treatment, be sure to not have php errors in your page"
167
+ msgstr ""
168
+ "Fehler während des PHP-Durchlaufs! Stelle sicher, dass sich keine PHP-Fehler "
169
+ "in deiner Seite befinden."
170
+
171
+ # @ sis
172
+ #: ../classes/admin/main.php:67
173
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
174
+ msgstr ""
175
+ "Deine veränderten Bildgrößen wurden noch nicht gespeichert. Trotzdem "
176
+ "fortfahren?"
177
+
178
+ # @ sis
179
+ #: ../classes/admin/main.php:68
180
+ #, php-format
181
+ msgid "This image has been regenerated in %s seconds"
182
+ msgstr "Dieses Bild wurde neu generiert in %s Sekunden."
183
+
184
+ # @ sis
185
+ #: ../classes/admin/main.php:91
186
+ msgid "No id given in POST datas."
187
+ msgstr "Keine ID in den POST-Daten gegeben."
188
+
189
+ # @ sis
190
+ #: ../classes/admin/main.php:104
191
+ #, php-format
192
+ msgid ""
193
+ "This file already exists in this size and have not been regenerated :<br/><a "
194
+ "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
195
+ msgstr ""
196
+
197
+ # @ sis
198
+ #: ../classes/admin/main.php:111
199
+ #, php-format
200
+ msgid ""
201
+ "This file does not exists and have not been regenerated :<br/><a target="
202
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
203
+ msgstr ""
204
+ "Diese Datei existiert nicht und wurde nicht neu generiert:<br/><a target="
205
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
206
+
207
+ #: ../classes/admin/main.php:158
208
+ msgid "Left"
209
+ msgstr ""
210
+
211
+ #: ../classes/admin/main.php:159
212
+ msgid "Center"
213
+ msgstr ""
214
+
215
+ # @ sis
216
+ #: ../classes/admin/main.php:160
217
+ msgid "Right"
218
+ msgstr ""
219
+
220
+ #: ../classes/admin/main.php:164
221
+ msgid "top"
222
+ msgstr ""
223
+
224
+ #: ../classes/admin/main.php:165
225
+ msgid "center"
226
+ msgstr ""
227
+
228
+ #: ../classes/admin/main.php:166
229
+ msgid "bottom"
230
+ msgstr ""
231
+
232
+ # @ sis
233
+ #: ../classes/admin/media.php:66
234
+ msgid "Settings"
235
+ msgstr "Einstellungen"
236
+
237
+ # @ sis
238
+ #: ../classes/admin/media.php:106
239
+ #, php-format
240
+ msgid "%s size"
241
+ msgstr "Bildgröße „%s“"
242
+
243
+ # @ sis
244
+ #: ../classes/admin/media.php:113
245
+ msgid "Add a new size"
246
+ msgstr "Neue Bildgröße hinzufügen"
247
+
248
+ # @ sis
249
+ #: ../classes/admin/media.php:116
250
+ msgid "Get php for theme"
251
+ msgstr "PHP für dein Theme generieren"
252
+
253
+ # @ sis
254
+ #: ../classes/admin/media.php:119
255
+ msgid "Thumbnail regeneration"
256
+ msgstr "Artikelbilder neu generieren"
257
+
258
+ #: ../classes/admin/media.php:155 ../classes/admin/media.php:157
259
+ #: ../classes/admin/media.php:159
260
+ msgid "custom_image_sizes["
261
+ msgstr ""
262
+
263
+ #: ../classes/admin/media.php:166
264
+ msgid "Cropping"
265
+ msgstr ""
266
+
267
+ #: ../classes/admin/media.php:168 ../templates/options-media.php:39
268
+ msgid "No"
269
+ msgstr ""
270
+
271
+ # @ sis
272
+ #: ../classes/admin/media.php:169 ../templates/options-media.php:39
273
+ msgid "Yes"
274
+ msgstr "Ja"
275
+
276
+ # @ sis
277
+ #: ../classes/admin/media.php:192
278
+ msgid "Add a new size of thumbnail"
279
+ msgstr "Neue Bildgröße für Thumbnail hinzufügen"
280
+
281
+ # @ sis
282
+ #: ../classes/admin/media.php:204
283
+ msgid "Get the PHP for the theme"
284
+ msgstr "Hol‘ dir den PHP-Code für dein Theme!"
285
+
286
+ # @ sis
287
+ #: ../classes/admin/media.php:205
288
+ msgid ""
289
+ "Copy and paste the code below into your Wordpress theme function file if you "
290
+ "wanted to save them and deactivate the plugin."
291
+ msgstr ""
292
+ "Falls du deine Bildgrößen behalten und das Plugin deaktivieren möchtest, "
293
+ "kopiere diesen PHP-Code in die Datei functions.php deines Theme."
294
+
295
+ #: ../classes/admin/media.php:221
296
+ msgid "Admin option-media template missing"
297
+ msgstr ""
298
+
299
+ #: ../classes/admin/media.php:425 ../classes/admin/post.php:65
300
+ msgid "Trying to cheat ?"
301
+ msgstr ""
302
+
303
+ # @ sis
304
+ #: ../classes/admin/media.php:472
305
+ msgid "Regeneration ended"
306
+ msgstr ""
307
+
308
+ # @ sis
309
+ #: ../classes/admin/post.php:216
310
+ msgid "Regenerate thumbnails"
311
+ msgstr "Artikelbilder neu generieren"
312
+
313
+ # @ sis
314
+ #: ../classes/admin/post.php:240 ../classes/admin/post.php:243
315
+ #: ../templates/options-media.php:138
316
+ msgid "Regenerate Thumbnails"
317
+ msgstr "Artikelbilder neu generieren"
318
+
319
+ # @ sis
320
+ #: ../templates/options-media.php:10
321
+ msgid "Select which thumbnails you want to rebuild:"
322
+ msgstr "Wähle die Artikelbilder aus, die neu generiert werden sollen:"
323
+
324
+ # @ sis
325
+ #: ../templates/options-media.php:15 ../templates/options-media.php:67
326
+ msgid "Size name"
327
+ msgstr "Bildgrößenbezeichnung"
328
+
329
+ # @ sis
330
+ #: ../templates/options-media.php:16 ../templates/options-media.php:68
331
+ msgid "Width"
332
+ msgstr "Breite"
333
+
334
+ # @ sis
335
+ #: ../templates/options-media.php:17 ../templates/options-media.php:69
336
+ msgid "Height"
337
+ msgstr "Höhe"
338
+
339
+ # @ sis
340
+ #: ../templates/options-media.php:18 ../templates/options-media.php:70
341
+ msgid "Crop ?"
342
+ msgstr "Beschneiden?"
343
+
344
+ # @ sis
345
+ #: ../templates/options-media.php:75
346
+ msgid "Select which post type source thumbnails you want to rebuild:"
347
+ msgstr ""
348
+ "Wähle die Inhaltstypen aus, deren Artikelbilder du neu generieren willst:"
349
+
350
+ # @ sis
351
+ #: ../templates/options-media.php:80 ../templates/options-media.php:107
352
+ msgid "Post type"
353
+ msgstr "Inhaltstyp"
354
+
355
+ # @ sis
356
+ #: ../templates/options-media.php:126
357
+ msgid "End time calculated :"
358
+ msgstr "Berechnetes Ende:"
359
+
360
+ #: ../templates/options-media.php:126
361
+ msgid "Calculating..."
362
+ msgstr ""
363
+
364
+ # @ sis
365
+ #: ../templates/options-media.php:137
366
+ msgid "Last image:"
367
+ msgstr "Letztes Bild:"
languages/simple-image-sizes-fr_FR.mo ADDED
Binary file
languages/simple-image-sizes-fr_FR.po ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Simple image sizes\n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2014-04-20 15:24+0100\n"
8
+ "PO-Revision-Date: 2015-08-20 14:35+0100\n"
9
+ "Last-Translator: Nicolas Juen <njuen@beapi.fr>\n"
10
+ "Language-Team: Beapi <njuen@beapi.fr>\n"
11
+ "Language: fr_FR\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Generator: Poedit 1.7.5\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: templates/options-media.php:10
22
+ msgid "Select which thumbnails you want to rebuild:"
23
+ msgstr "Sélectionnez les tailles de vignettes à régénérer"
24
+
25
+ #: templates/options-media.php:17 templates/options-media.php:73
26
+ msgid "Size name"
27
+ msgstr "Nom de la taille"
28
+
29
+ #: templates/options-media.php:18 templates/options-media.php:74
30
+ msgid "Width"
31
+ msgstr "Largeur"
32
+
33
+ #: templates/options-media.php:19 templates/options-media.php:75
34
+ msgid "Height"
35
+ msgstr "Hauteur"
36
+
37
+ #: templates/options-media.php:20 templates/options-media.php:76
38
+ msgid "Crop ?"
39
+ msgstr "Rogner ?"
40
+
41
+ #: templates/options-media.php:42 classes/admin/main.php:183
42
+ msgid "Yes"
43
+ msgstr "Oui"
44
+
45
+ #: templates/options-media.php:42 classes/admin/main.php:182
46
+ msgid "No"
47
+ msgstr "Non"
48
+
49
+ #: templates/options-media.php:81
50
+ msgid "Select which post type source thumbnails you want to rebuild:"
51
+ msgstr ""
52
+ "Sélectionnez quelles vignettes de quel type de contenu vous souhaitez "
53
+ "régénérer : "
54
+
55
+ #: templates/options-media.php:88 templates/options-media.php:119
56
+ msgid "Post type"
57
+ msgstr "Type de contenu"
58
+
59
+ #: templates/options-media.php:138
60
+ msgid "End time calculated :"
61
+ msgstr "Fin du traitement calculé :"
62
+
63
+ #: templates/options-media.php:139
64
+ msgid "Calculating..."
65
+ msgstr "Calcul en cours..."
66
+
67
+ #: templates/options-media.php:150
68
+ msgid "Last image:"
69
+ msgstr "Dernière image :"
70
+
71
+ #: templates/options-media.php:152 classes/admin/post.php:250
72
+ #: classes/admin/post.php:258
73
+ msgid "Regenerate Thumbnails"
74
+ msgstr "Régénérer les vignettes"
75
+
76
+ #: classes/admin/post.php:64 classes/admin/media.php:474
77
+ msgid "Trying to cheat ?"
78
+ msgstr "Cheater ?"
79
+
80
+ #: classes/admin/post.php:224
81
+ msgid "Regenerate thumbnails"
82
+ msgstr "Régénérer les vignettes"
83
+
84
+ #: classes/admin/main.php:44
85
+ msgid "Reading attachments..."
86
+ msgstr "Chargement des médias..."
87
+
88
+ #: classes/admin/main.php:45 classes/admin/media.php:171
89
+ msgid "Maximum width"
90
+ msgstr "Largeur maximum"
91
+
92
+ #: classes/admin/main.php:46 classes/admin/media.php:178
93
+ msgid "Maximum height"
94
+ msgstr "Hauteur maximum"
95
+
96
+ #: classes/admin/main.php:47
97
+ msgid "Crop"
98
+ msgstr "Rogner"
99
+
100
+ #: classes/admin/main.php:48
101
+ msgid "yes"
102
+ msgstr "oui"
103
+
104
+ #: classes/admin/main.php:49
105
+ msgid "no"
106
+ msgstr "non"
107
+
108
+ #: classes/admin/main.php:50 classes/admin/media.php:208
109
+ msgid "Show in post insertion ?"
110
+ msgstr "Afficher dans l'insertion ?"
111
+
112
+ #: classes/admin/main.php:51
113
+ msgid " of "
114
+ msgstr " de "
115
+
116
+ #: classes/admin/main.php:52
117
+ msgid " or "
118
+ msgstr " ou "
119
+
120
+ #: classes/admin/main.php:53
121
+ msgid " before the end."
122
+ msgstr " avant la fin."
123
+
124
+ #: classes/admin/main.php:54 classes/admin/media.php:210
125
+ msgid "Delete"
126
+ msgstr "Supprimer"
127
+
128
+ #: classes/admin/main.php:55
129
+ msgid "No media in your site to regenerate !"
130
+ msgstr "Pas de médias à regénérer !"
131
+
132
+ #: classes/admin/main.php:56
133
+ msgid "Regenerating "
134
+ msgstr "Regénération "
135
+
136
+ #: classes/admin/main.php:57
137
+ msgid "Regenerate "
138
+ msgstr "Regénérer "
139
+
140
+ #: classes/admin/main.php:58
141
+ msgid "Validate image size name"
142
+ msgstr "Valider le nom de la taille d'image"
143
+
144
+ #: classes/admin/main.php:59
145
+ msgid "Done."
146
+ msgstr "Fini."
147
+
148
+ #: classes/admin/main.php:60
149
+ msgid "Size"
150
+ msgstr "Taille "
151
+
152
+ #: classes/admin/main.php:61
153
+ msgid ""
154
+ "Don't use the basic WordPress thumbnail size name, use the form above to "
155
+ "edit them"
156
+ msgstr ""
157
+ "N'utilisez pas les tailles par défaut de WordPress comme nom de taille, "
158
+ "éditez leurs valeurs avec le formulaire ci-dessus."
159
+
160
+ #: classes/admin/main.php:62
161
+ msgid "This size is already registered, edit it instead of recreating it."
162
+ msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
163
+
164
+ #: classes/admin/main.php:63
165
+ msgid "Do you really want to delete these size ?"
166
+ msgstr "Voulez-vous réellement supprimer cette taille ?"
167
+
168
+ #: classes/admin/main.php:64 classes/admin/media.php:211
169
+ msgid "Update"
170
+ msgstr "Mettre à jour"
171
+
172
+ #: classes/admin/main.php:65
173
+ msgid "Error requesting page"
174
+ msgstr "Erreur lors de la requête vers la page"
175
+
176
+ #: classes/admin/main.php:66
177
+ msgid "images have been regenerated !"
178
+ msgstr "images ont été regénérées !"
179
+
180
+ #: classes/admin/main.php:67
181
+ msgid "Validate"
182
+ msgstr "Valider"
183
+
184
+ #: classes/admin/main.php:68
185
+ msgid " started at"
186
+ msgstr " commencé à "
187
+
188
+ #: classes/admin/main.php:69 classes/admin/media.php:185
189
+ msgid "Public name"
190
+ msgstr "Nom public"
191
+
192
+ #: classes/admin/main.php:70
193
+ msgid " finished at :"
194
+ msgstr " terminé à :"
195
+
196
+ #: classes/admin/main.php:71
197
+ msgid ""
198
+ "Error during the php treatment, be sure to not have php errors in your page"
199
+ msgstr ""
200
+ "Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans "
201
+ "votre page"
202
+
203
+ #: classes/admin/main.php:72
204
+ msgid "All the sizes you have modified are not saved, continue anyway ?"
205
+ msgstr ""
206
+ "Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer "
207
+ "tout de même ?"
208
+
209
+ #: classes/admin/main.php:73
210
+ msgid "This image has been regenerated in %s seconds"
211
+ msgstr "Cette image a été regénérée en %s secondes"
212
+
213
+ #: classes/admin/main.php:96
214
+ msgid "No id given in POST datas."
215
+ msgstr "Pas d'id donné dans les données du POST."
216
+
217
+ #: classes/admin/main.php:109
218
+ msgid ""
219
+ "This file already exists in this size and have not been regenerated :<br/><a "
220
+ "target=\"_blank\" href=\"%1$s\" >%2$s</a>"
221
+ msgstr ""
222
+ "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
223
+ "regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
224
+
225
+ #: classes/admin/main.php:116
226
+ msgid ""
227
+ "This file does not exists and have not been regenerated :<br/><a target="
228
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
229
+ msgstr ""
230
+ "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
231
+ "regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
232
+
233
+ #: classes/admin/main.php:167
234
+ msgid "Left"
235
+ msgstr "Gauche"
236
+
237
+ #: classes/admin/main.php:168
238
+ msgid "Center"
239
+ msgstr "Centre"
240
+
241
+ #: classes/admin/main.php:169
242
+ msgid "Right"
243
+ msgstr "Droite"
244
+
245
+ #: classes/admin/main.php:173
246
+ msgid "top"
247
+ msgstr "haut"
248
+
249
+ #: classes/admin/main.php:174
250
+ msgid "center"
251
+ msgstr "centre"
252
+
253
+ #: classes/admin/main.php:175
254
+ msgid "bottom"
255
+ msgstr "bas"
256
+
257
+ #: classes/admin/media.php:67
258
+ msgid "Settings"
259
+ msgstr "Paramètres"
260
+
261
+ #: classes/admin/media.php:107
262
+ msgid "%s size"
263
+ msgstr "Taille %s"
264
+
265
+ #: classes/admin/media.php:117
266
+ msgid "Add a new size"
267
+ msgstr "Ajouter une nouvelle taille"
268
+
269
+ #: classes/admin/media.php:123
270
+ msgid "Get php for theme"
271
+ msgstr "Récupérer le PHP pour le thème"
272
+
273
+ #: classes/admin/media.php:129
274
+ msgid "Thumbnail regeneration"
275
+ msgstr "Régénération des vignettes"
276
+
277
+ #: classes/admin/media.php:192
278
+ msgid "Cropping"
279
+ msgstr "Rognage"
280
+
281
+ #: classes/admin/media.php:226
282
+ msgid "Add a new size of thumbnail"
283
+ msgstr "Ajouter une nouvelle taille de vignette"
284
+
285
+ #: classes/admin/media.php:239
286
+ msgid "Get the PHP for the theme"
287
+ msgstr "Récupérer le PHP pour le thème"
288
+
289
+ #: classes/admin/media.php:240
290
+ msgid ""
291
+ "Copy and paste the code below into your Wordpress theme function file if you "
292
+ "wanted to save them and deactivate the plugin."
293
+ msgstr ""
294
+ "Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre "
295
+ "thème WordPress si vous voulez les conserver et désactiver ce plugin."
296
+
297
+ #: classes/admin/media.php:256
298
+ msgid "Admin option-media template missing"
299
+ msgstr "Template d'affichage admin manquant"
300
+
301
+ #: classes/admin/media.php:521
302
+ msgid "Regeneration ended"
303
+ msgstr "Regénération terminée"
304
+
305
+ #~ msgid "Legend of the sizes"
306
+ #~ msgstr "Légende des tailles"
307
+
308
+ #~ msgid ""
309
+ #~ "The images created on your theme are <span style=\"color:#F2A13A"
310
+ #~ "\">orange</span> and your custom size are <span style=\"color:#89D76A\"> "
311
+ #~ "green </span>."
312
+ #~ msgstr ""
313
+ #~ "Les tailles d'images crées par votre thème sont en <span style=\"color:"
314
+ #~ "#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style="
315
+ #~ "\"color:#89D76A\"> vert </span>."
316
+
317
+ #~ msgid "Size "
318
+ #~ msgstr "Taille "
319
+
320
+ #~ msgid "Theme size"
321
+ #~ msgstr "Taille de thème"
322
+
323
+ #~ msgid "Resize ?"
324
+ #~ msgstr "Regénérer ?"
languages/simple-image-sizes-he_IL.mo ADDED
Binary file
languages/simple-image-sizes-he_IL.po ADDED
@@ -0,0 +1,471 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was generated by WPML
2
+ # WPML is a WordPress plugin that can turn any WordPress or WordPressMU site into a full featured multilingual content management system.
3
+ # http://wpml.org
4
+ msgid ""
5
+ msgstr ""
6
+ "Content-Type: text/plain; charset=UTF-8\n"
7
+ "Content-Transfer-Encoding: 8bit\n"
8
+ "Project-Id-Version: simple-image-sizes\n"
9
+ "POT-Creation-Date: \n"
10
+ "PO-Revision-Date: \n"
11
+ "Last-Translator: Ahrale <contact@atar4u.com>\n"
12
+ "Language-Team: Ahrale, Atar4U.com <contact@atar4u.com>\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Language: he_IL\n"
15
+ "X-Generator: Poedit 1.7.3\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+
18
+ # 'center' => __( 'center', 'simple-image-sizes' ),
19
+ # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
20
+ # );
21
+ # wpml-name: 71f262d796bed1ab30e8a2d5a8ddee6f
22
+ msgid "bottom"
23
+ msgstr "למטה"
24
+
25
+ # 'center' => __( 'center', 'simple-image-sizes' ),
26
+ # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
27
+ # );
28
+ # wpml-name: adb115059e28d960fa8badfac5516667
29
+ msgid "center"
30
+ msgstr "מרכז"
31
+
32
+ # $y = array(
33
+ # 'top' => __( 'top', 'simple-image-sizes' ),
34
+ # 'center' => __( 'center', 'simple-image-sizes' ),
35
+ # wpml-name: b28354b543375bfa94dabaeda722927f
36
+ msgid "top"
37
+ msgstr "למעלה"
38
+
39
+ # 'center' => __( 'Center', 'simple-image-sizes' ),
40
+ # 'right' => __( 'Right', 'simple-image-sizes' ),
41
+ # );
42
+ # wpml-name: 92b09c7c48c520c3c55e497875da437c
43
+ msgid "Right"
44
+ msgstr "ימין"
45
+
46
+ # 'top' => __( 'top', 'simple-image-sizes' ),
47
+ # 'center' => __( 'center', 'simple-image-sizes' ),
48
+ # 'bottom' => __( 'bottom', 'simple-image-sizes' ),
49
+ # wpml-name: 4f1f6016fc9f3f2353c0cc7c67b292bd
50
+ msgid "Center"
51
+ msgstr "אמצע"
52
+
53
+ # $x = array(
54
+ # 'left' => __( 'Left', 'simple-image-sizes' ),
55
+ # 'center' => __( 'Center', 'simple-image-sizes' ),
56
+ # wpml-name: 945d5e233cf7d6240f6b783b36a374ff
57
+ msgid "Left"
58
+ msgstr "שמאל"
59
+
60
+ # 'time' => timer_stop( false, 4 ),
61
+ # 'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
62
+ # );
63
+ # wpml-name: a97ca0c87f209ef404682709c928fb77
64
+ msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
65
+ msgstr "קובץ זה אינו קיים ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
66
+
67
+ # 'time' => timer_stop( false, 4 ),
68
+ # 'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
69
+ # );
70
+ # wpml-name: 5aa7d495ab0ac8335d6c1019be44de71
71
+ msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
72
+ msgstr "קובץ זה כבר קיים בגודל זה ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
73
+
74
+ # 'time' => timer_stop( false, 4 ),
75
+ # 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' )
76
+ # );
77
+ # wpml-name: 31644e7c5c9ebc483f0e6e3497caf08e
78
+ msgid "No id given in POST datas."
79
+ msgstr "אין מזהה בנתוני הפוסט."
80
+
81
+ # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
82
+ # 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
83
+ # 'crop_positions' => self::get_available_crop(),
84
+ # wpml-name: 368cc8aa10b0843efcd7d24789f8f6b7
85
+ msgid "This image has been regenerated in %s seconds"
86
+ msgstr "תמונה זו נוצרה מחדש ב %s שניות"
87
+
88
+ # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
89
+ # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
90
+ # 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
91
+ # wpml-name: 63b1eca818d85423d99421224064c83f
92
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
93
+ msgstr "כל המידות ששינית לא נשמרו, להמשיך בכל זאת ?"
94
+
95
+ # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
96
+ # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
97
+ # 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
98
+ # wpml-name: 2e2e3b980040e2e5ff60122457a2d94e
99
+ msgid "Error during the php treatment, be sure to not have php errors in your page"
100
+ msgstr "שגיאה במהלך טיפול ה php, וודא שאין שגיאות php בעמוד שלך"
101
+
102
+ # 'customName' => __( 'Public name', 'simple-image-sizes' ),
103
+ # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
104
+ # 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
105
+ # wpml-name: 250efec0f456647c37b218d66fbf1cd1
106
+ msgid " finished at :"
107
+ msgstr " הסתיים ב :"
108
+
109
+ # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
110
+ # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
111
+ # 'customName' => __( 'Public name', 'simple-image-sizes' ),
112
+ # wpml-name: a8a392d1e0802a5f793863ae847d8d1a
113
+ msgid " started at"
114
+ msgstr "התחיל ב"
115
+
116
+ # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
117
+ # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
118
+ # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
119
+ # wpml-name: ad3d06d03d94223fa652babc913de686
120
+ msgid "Validate"
121
+ msgstr "אמת"
122
+
123
+ # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
124
+ # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
125
+ # 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
126
+ # wpml-name: 2be848adf7d74af67397cd8d7afe649f
127
+ msgid "images have been regenerated !"
128
+ msgstr "תמונות נוצרו מחדש !"
129
+
130
+ # 'update' => __( 'Update', 'simple-image-sizes' ),
131
+ # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
132
+ # 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
133
+ # wpml-name: fe0bfb1709b1de3ce5b316f877845254
134
+ msgid "Error requesting page"
135
+ msgstr "שגיאה בבקשת העמוד"
136
+
137
+ # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
138
+ # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
139
+ # 'update' => __( 'Update', 'simple-image-sizes' ),
140
+ # wpml-name: aa795e0c2898239890d9a04b3225b71d
141
+ msgid "Do you really want to delete these size ?"
142
+ msgstr "האם אתה באמת רוצה למחוק את הגודל הזה ?"
143
+
144
+ # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
145
+ # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
146
+ # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
147
+ # wpml-name: 580c280158be3a37af3f1a396fa8fa48
148
+ msgid "This size is already registered, edit it instead of recreating it."
149
+ msgstr "גודל זה כבר רשום, ערוך אותו במקום ליצור אותו מחדש."
150
+
151
+ # 'size' => __( 'Size', 'simple-image-sizes' ),
152
+ # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
153
+ # 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
154
+ # wpml-name: 09ec5b94f6e7373427b84771c2ec9fda
155
+ msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
156
+ msgstr "אל תשתמש בשם התמונה הממוזערת של הוורדפרס הבסיסי, השתמש בטופס לעיל כדי לערוך אותם"
157
+
158
+ # 'done' => __( 'Done.', 'simple-image-sizes' ),
159
+ # 'size' => __( 'Size', 'simple-image-sizes' ),
160
+ # 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
161
+ # wpml-name: 6f6cb72d544962fa333e2e34ce64f719
162
+ msgid "Size"
163
+ msgstr "גודל"
164
+
165
+ # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
166
+ # 'done' => __( 'Done.', 'simple-image-sizes' ),
167
+ # 'size' => __( 'Size', 'simple-image-sizes' ),
168
+ # wpml-name: f5940523060652e3a7d9c269ce48de50
169
+ msgid "Done."
170
+ msgstr "בוצע."
171
+
172
+ # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
173
+ # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
174
+ # 'done' => __( 'Done.', 'simple-image-sizes' ),
175
+ # wpml-name: 7a50a2d7840041d6668f889ea35fa548
176
+ msgid "Validate image size name"
177
+ msgstr "אמת את שם הגודל"
178
+
179
+ # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
180
+ # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
181
+ # 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
182
+ # wpml-name: 69314e19325b39027d107d0c79a9897d
183
+ msgid "Regenerate "
184
+ msgstr "צור מחדש "
185
+
186
+ # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
187
+ # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
188
+ # 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
189
+ # wpml-name: 2d2ed670c4cb53daf32909b501fa4620
190
+ msgid "Regenerating "
191
+ msgstr "יוצר מחדש"
192
+
193
+ # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
194
+ # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
195
+ # 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
196
+ # wpml-name: 37b1d0785260f44322eb6aa55ef3b1ad
197
+ msgid "No media in your site to regenerate !"
198
+ msgstr "אין מדיה באתר שלך ליצור מחדש !"
199
+
200
+ # 'or' => __( ' or ', 'simple-image-sizes' ),
201
+ # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
202
+ # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
203
+ # wpml-name: b08355a64e809c27c91ee20706e66d1b
204
+ msgid " before the end."
205
+ msgstr "לפני הסוף."
206
+
207
+ # 'of' => __( ' of ', 'simple-image-sizes' ),
208
+ # 'or' => __( ' or ', 'simple-image-sizes' ),
209
+ # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
210
+ # wpml-name: 8e0c4e984dbb4b30a86c232b15df8490
211
+ msgid " or "
212
+ msgstr "או "
213
+
214
+ # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
215
+ # 'of' => __( ' of ', 'simple-image-sizes' ),
216
+ # 'or' => __( ' or ', 'simple-image-sizes' ),
217
+ # wpml-name: 7e7e076a81fa5dc64f44b8ff14199cbf
218
+ msgid " of "
219
+ msgstr " של "
220
+
221
+ # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
222
+ # <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
223
+ # <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
224
+ # wpml-name: 7fa3b767c460b54a2be4d49030b349c7
225
+ msgid "no"
226
+ msgstr "לא"
227
+
228
+ # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
229
+ # <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
230
+ # <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
231
+ # wpml-name: a6105c0a611b41b08f1209506350279e
232
+ msgid "yes"
233
+ msgstr "כן"
234
+
235
+ # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
236
+ # 'crop' => __( 'Crop', 'simple-image-sizes' ),
237
+ # 'tr' => __( 'yes', 'simple-image-sizes' ),
238
+ # wpml-name: d388632d05e8826abe4b95de0b110529
239
+ msgid "Crop"
240
+ msgstr "חתוך"
241
+
242
+ # 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
243
+ # 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
244
+ # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
245
+ # wpml-name: 6a98035cbc4c133b74c77491ce876940
246
+ msgid "Reading attachments..."
247
+ msgstr "קורא קבצים מצורפים..."
248
+
249
+ # 'html' => '
250
+ # <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
251
+ # <span class="spinner"></span>
252
+ # wpml-name: 258606ef5a3ed5cd7e39da08435adec0
253
+ msgid "Regenerate thumbnails"
254
+ msgstr "יוצר מחדש תמונות ממוזערות"
255
+
256
+ # } else {
257
+ # esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
258
+ # }
259
+ # wpml-name: f528f9b0d97ba7592b85a85f0c9f9c13
260
+ msgid "Admin option-media template missing"
261
+ msgstr "חסרה תבנית ניהול אפשרות-מדיה"
262
+
263
+ # public static function getPhpButton() { ?>
264
+ # <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
265
+ # <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
266
+ # wpml-name: bb3db310d06bffcbddaf06323583e91d
267
+ msgid "Get the PHP for the theme"
268
+ msgstr "קבל את ה PHP עבור ערכת הנושא"
269
+
270
+ # public static function addSizeButton() { ?>
271
+ # <input type="button" class="button-secondary action" id="add_size" value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes'); ?>" />
272
+ # <?php
273
+ # wpml-name: 786741aec3b7c066357245ef98dc9fde
274
+ msgid "Add a new size of thumbnail"
275
+ msgstr "הוסף גודל חדש של תמונה ממוזערת"
276
+
277
+ # if( !wp_verify_nonce( $nonce , 'regen' ) ) {
278
+ # SIS_Admin_Main::displayJson( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
279
+ # }
280
+ # wpml-name: b57077974e73b05d05c5ab21a7bb35fe
281
+ msgid "Trying to cheat ?"
282
+ msgstr "מנסה לרמות ?"
283
+
284
+ # <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
285
+ # <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
286
+ # <code></code>
287
+ # wpml-name: 265103d3ca486243e0f00a62d6dfd2b7
288
+ msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
289
+ msgstr "העתק והדבק את הקוד שלהלן אל קובץ function.php בערכת הנושא של הוורדפרס שלך אם אתה רוצה לשמור אותם ולכבות את התוסף."
290
+
291
+ # 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
292
+ # 'update' => __( 'Update', 'simple-image-sizes' ),
293
+ # 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
294
+ # wpml-name: 06933067aafd48425d67bcb01bba5cb6
295
+ msgid "Update"
296
+ msgstr "עדכן"
297
+
298
+ # 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
299
+ # 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
300
+ # 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
301
+ # wpml-name: f2a6c498fb90ee345d997f888fce3b18
302
+ msgid "Delete"
303
+ msgstr "מחיקה"
304
+
305
+ # 'fl' => __( 'no', 'simple-image-sizes' ),
306
+ # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
307
+ # 'of' => __( ' of ', 'simple-image-sizes' ),
308
+ # wpml-name: b223790b250471a6cae35deb5a4b0aa4
309
+ msgid "Show in post insertion ?"
310
+ msgstr "להציג בהוספה לפוסט ?"
311
+
312
+ # <span class="size_options">
313
+ # <label class="c" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes'); ?></label>
314
+ # <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
315
+ # wpml-name: 57bb299f73bf5946a8d4790cc4bbd8fb
316
+ msgid "Cropping"
317
+ msgstr "חיתוך"
318
+
319
+ # 'startedAt' => __( ' started at', 'simple-image-sizes' ),
320
+ # 'customName' => __( 'Public name', 'simple-image-sizes' ),
321
+ # 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
322
+ # wpml-name: d274013ea65428454962a59b7b373a41
323
+ msgid "Public name"
324
+ msgstr "שם ציבורי"
325
+
326
+ # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
327
+ # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
328
+ # 'crop' => __( 'Crop', 'simple-image-sizes' ),
329
+ # wpml-name: d3c7d075cfb70ed08d062facb1a056e8
330
+ msgid "Maximum height"
331
+ msgstr "גובה מירבי"
332
+
333
+ # 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
334
+ # 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
335
+ # 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
336
+ # wpml-name: 614a998c745fcc3009bf6c6daf18562e
337
+ msgid "Maximum width"
338
+ msgstr "רוחב מירבי"
339
+
340
+ # return array(
341
+ # 'message' => __( 'Regeneration ended', 'simple-image-sizes')
342
+ # );
343
+ # wpml-name: cd4e39700ffd7ae49e430859c97834c2
344
+ msgid "Regeneration ended"
345
+ msgstr "היצירה מחדש הסתיימה"
346
+
347
+ # // Add section for the thumbnail regeneration
348
+ # add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), array( __CLASS__, 'thumbnailRegenerate' ), 'media' );
349
+ # }
350
+ # wpml-name: 99e4f0028f10ce4b38eb35c5488c1bba
351
+ msgid "Thumbnail regeneration"
352
+ msgstr "יצירה מחדש של תמונה ממוזערת"
353
+
354
+ # // Add php button
355
+ # add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), array( __CLASS__, 'getPhpButton' ), 'media' );
356
+ #
357
+ # wpml-name: fea30a43d377bbead8aace51d915477a
358
+ msgid "Get php for theme"
359
+ msgstr "קבל php עבור ערכת הנושא"
360
+
361
+ # // Add the button
362
+ # add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), array( __CLASS__, 'addSizeButton' ), 'media' );
363
+ #
364
+ # wpml-name: a2da7c2e28e5e69b7daaa13377ee29e4
365
+ msgid "Add a new size"
366
+ msgstr "הוספת גודל חדש"
367
+
368
+ # // Add the setting field for this size
369
+ # add_settings_field( 'image_size_'.$s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), array( __CLASS__, 'image_sizes' ), 'media' , 'default', array( 'name' => $s , 'width' => $width , 'height' => $height, 'c' => $crop ) );
370
+ # }
371
+ # wpml-name: be74017300bae51721e39b611652ee22
372
+ msgid "%s size"
373
+ msgstr "גודל %s"
374
+
375
+ #
376
+ # $settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'simple-image-sizes' ).' </a>';
377
+ # array_unshift( $links, $settings_link );
378
+ # wpml-name: f4f70727dc34561dfde1a3c529b6205c
379
+ msgid "Settings"
380
+ msgstr "הגדרות"
381
+
382
+ # 'html' => '
383
+ # <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
384
+ # <span class="spinner"></span>
385
+ # wpml-name: 6f8330b0bc479531022cb9002cffde14
386
+ msgid "Regenerate Thumbnails"
387
+ msgstr "צור מחדש תמונות ממוזערות"
388
+
389
+ # </div>
390
+ # <div class="thumb"><h4><?php _e( 'Last image:', 'simple-image-sizes'); ?></h4><img class="thumb-img" /></div>
391
+ # <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'simple-image-sizes' ) ?>" />
392
+ # wpml-name: c9d4436607c99b571f4d84ff0e1a8fb5
393
+ msgid "Last image:"
394
+ msgstr "תמונה אחרונה:"
395
+
396
+ # <span class="ui-icon ui-icon-info"></span>
397
+ # <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
398
+ # </p>
399
+ # wpml-name: 0582cd2fd62743a89db5f715fd51e532
400
+ msgid "Calculating..."
401
+ msgstr "מחשב..."
402
+
403
+ # <span class="ui-icon ui-icon-info"></span>
404
+ # <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
405
+ # </p>
406
+ # wpml-name: fe5a9d159a95ad346f9443464115edfc
407
+ msgid "End time calculated :"
408
+ msgstr "חישוב זמן סיום :"
409
+
410
+ # <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
411
+ # <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes'); ?></th>
412
+ # </tr>
413
+ # wpml-name: 363c969ebde35c09236f5355c6dff165
414
+ msgid "Post type"
415
+ msgstr "סוג מאמר"
416
+
417
+ #
418
+ # <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'simple-image-sizes'); ?></h4>
419
+ # <table cellspacing="0" class="widefat page fixed sis">
420
+ # wpml-name: 4f02f535b1a39a2fc34c244b5fe5c828
421
+ msgid "Select which post type source thumbnails you want to rebuild:"
422
+ msgstr "בחר אילו תמונות ממוזערות של אילו סוגי פוסט אתה רוצה לבנות מחדש:"
423
+
424
+ # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
425
+ # <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
426
+ # </tr>
427
+ # wpml-name: 8ae8aaf1c06d7eeee38c66ba6f6c4f00
428
+ msgid "Crop ?"
429
+ msgstr "לחתוך ?"
430
+
431
+ # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
432
+ # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
433
+ # <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
434
+ # wpml-name: eec6c4bdbd339edf8cbea68becb85244
435
+ msgid "Height"
436
+ msgstr "גובה"
437
+
438
+ # <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
439
+ # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
440
+ # <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
441
+ # wpml-name: 32954654ac8fe66a1d09be19001de2d4
442
+ msgid "Width"
443
+ msgstr "רוחב"
444
+
445
+ # <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
446
+ # <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
447
+ # <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
448
+ # wpml-name: 3e6a625faef0050601371de85af0630d
449
+ msgid "Size name"
450
+ msgstr "שם המידה"
451
+
452
+ # <div class="wrapper" style="">
453
+ # <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes'); ?> </h4>
454
+ # <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
455
+ # wpml-name: d3108e30b8046e29dd3baa9b3c455d35
456
+ msgid "Select which thumbnails you want to rebuild:"
457
+ msgstr "בחר אילו תמונות ממוזערות אתה רוצה לבנות מחדש:"
458
+
459
+ # 'tr' => __( 'yes', 'simple-image-sizes' ),
460
+ # 'fl' => __( 'no', 'simple-image-sizes' ),
461
+ # 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
462
+ # wpml-name: bafd7322c6e97d25b6299b5d6fe8920b
463
+ msgid "No"
464
+ msgstr "לא"
465
+
466
+ # 'crop' => __( 'Crop', 'simple-image-sizes' ),
467
+ # 'tr' => __( 'yes', 'simple-image-sizes' ),
468
+ # 'fl' => __( 'no', 'simple-image-sizes' ),
469
+ # wpml-name: 93cba07454f06a4a960172bbd6e2a435
470
+ msgid "Yes"
471
+ msgstr "כן"
languages/simple-image-sizes.pot ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: \n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: 2014-04-20 15:24+0100\n"
8
+ "PO-Revision-Date: 2014-04-20 15:24+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: LANGUAGE <LL@li.org>\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+
15
+ #: templates/options-media.php:10
16
+ msgid "Select which thumbnails you want to rebuild:"
17
+ msgstr ""
18
+
19
+ #: templates/options-media.php:17 templates/options-media.php:73
20
+ msgid "Size name"
21
+ msgstr ""
22
+
23
+ #: templates/options-media.php:18 templates/options-media.php:74
24
+ msgid "Width"
25
+ msgstr ""
26
+
27
+ #: templates/options-media.php:19 templates/options-media.php:75
28
+ msgid "Height"
29
+ msgstr ""
30
+
31
+ #: templates/options-media.php:20 templates/options-media.php:76
32
+ msgid "Crop ?"
33
+ msgstr ""
34
+
35
+ #: templates/options-media.php:42 classes/admin/main.php:183
36
+ msgid "Yes"
37
+ msgstr ""
38
+
39
+ #: templates/options-media.php:42 classes/admin/main.php:182
40
+ msgid "No"
41
+ msgstr ""
42
+
43
+ #: templates/options-media.php:81
44
+ msgid "Select which post type source thumbnails you want to rebuild:"
45
+ msgstr ""
46
+
47
+ #: templates/options-media.php:88 templates/options-media.php:119
48
+ msgid "Post type"
49
+ msgstr ""
50
+
51
+ #: templates/options-media.php:138
52
+ msgid "End time calculated :"
53
+ msgstr ""
54
+
55
+ #: templates/options-media.php:139
56
+ msgid "Calculating..."
57
+ msgstr ""
58
+
59
+ #: templates/options-media.php:150
60
+ msgid "Last image:"
61
+ msgstr ""
62
+
63
+ #: templates/options-media.php:152 classes/admin/post.php:250
64
+ #: classes/admin/post.php:258
65
+ msgid "Regenerate Thumbnails"
66
+ msgstr ""
67
+
68
+ #: classes/admin/post.php:64 classes/admin/media.php:474
69
+ msgid "Trying to cheat ?"
70
+ msgstr ""
71
+
72
+ #: classes/admin/post.php:224
73
+ msgid "Regenerate thumbnails"
74
+ msgstr ""
75
+
76
+ #: classes/admin/main.php:44
77
+ msgid "Reading attachments..."
78
+ msgstr ""
79
+
80
+ #: classes/admin/main.php:45 classes/admin/media.php:171
81
+ msgid "Maximum width"
82
+ msgstr ""
83
+
84
+ #: classes/admin/main.php:46 classes/admin/media.php:178
85
+ msgid "Maximum height"
86
+ msgstr ""
87
+
88
+ #: classes/admin/main.php:47
89
+ msgid "Crop"
90
+ msgstr ""
91
+
92
+ #: classes/admin/main.php:48
93
+ msgid "yes"
94
+ msgstr ""
95
+
96
+ #: classes/admin/main.php:49
97
+ msgid "no"
98
+ msgstr ""
99
+
100
+ #: classes/admin/main.php:50 classes/admin/media.php:208
101
+ msgid "Show in post insertion ?"
102
+ msgstr ""
103
+
104
+ #: classes/admin/main.php:51
105
+ msgid " of "
106
+ msgstr ""
107
+
108
+ #: classes/admin/main.php:52
109
+ msgid " or "
110
+ msgstr ""
111
+
112
+ #: classes/admin/main.php:53
113
+ msgid " before the end."
114
+ msgstr ""
115
+
116
+ #: classes/admin/main.php:54 classes/admin/media.php:210
117
+ msgid "Delete"
118
+ msgstr ""
119
+
120
+ #: classes/admin/main.php:55
121
+ msgid "No media in your site to regenerate !"
122
+ msgstr ""
123
+
124
+ #: classes/admin/main.php:56
125
+ msgid "Regenerating "
126
+ msgstr ""
127
+
128
+ #: classes/admin/main.php:57
129
+ msgid "Regenerate "
130
+ msgstr ""
131
+
132
+ #: classes/admin/main.php:58
133
+ msgid "Validate image size name"
134
+ msgstr ""
135
+
136
+ #: classes/admin/main.php:59
137
+ msgid "Done."
138
+ msgstr ""
139
+
140
+ #: classes/admin/main.php:60
141
+ msgid "Size"
142
+ msgstr ""
143
+
144
+ #: classes/admin/main.php:61
145
+ msgid "Don't use the basic WordPress thumbnail size name, use the form above to edit them"
146
+ msgstr ""
147
+
148
+ #: classes/admin/main.php:62
149
+ msgid "This size is already registered, edit it instead of recreating it."
150
+ msgstr ""
151
+
152
+ #: classes/admin/main.php:63
153
+ msgid "Do you really want to delete these size ?"
154
+ msgstr ""
155
+
156
+ #: classes/admin/main.php:64 classes/admin/media.php:211
157
+ msgid "Update"
158
+ msgstr ""
159
+
160
+ #: classes/admin/main.php:65
161
+ msgid "Error requesting page"
162
+ msgstr ""
163
+
164
+ #: classes/admin/main.php:66
165
+ msgid "images have been regenerated !"
166
+ msgstr ""
167
+
168
+ #: classes/admin/main.php:67
169
+ msgid "Validate"
170
+ msgstr ""
171
+
172
+ #: classes/admin/main.php:68
173
+ msgid " started at"
174
+ msgstr ""
175
+
176
+ #: classes/admin/main.php:69 classes/admin/media.php:185
177
+ msgid "Public name"
178
+ msgstr ""
179
+
180
+ #: classes/admin/main.php:70
181
+ msgid " finished at :"
182
+ msgstr ""
183
+
184
+ #: classes/admin/main.php:71
185
+ msgid "Error during the php treatment, be sure to not have php errors in your page"
186
+ msgstr ""
187
+
188
+ #: classes/admin/main.php:72
189
+ msgid "All the sizes you have modified are not saved, continue anyway ?"
190
+ msgstr ""
191
+
192
+ #: classes/admin/main.php:73
193
+ msgid "This image has been regenerated in %s seconds"
194
+ msgstr ""
195
+
196
+ #: classes/admin/main.php:96
197
+ msgid "No id given in POST datas."
198
+ msgstr ""
199
+
200
+ #: classes/admin/main.php:109
201
+ msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
202
+ msgstr ""
203
+
204
+ #: classes/admin/main.php:116
205
+ msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
206
+ msgstr ""
207
+
208
+ #: classes/admin/main.php:167
209
+ msgid "Left"
210
+ msgstr ""
211
+
212
+ #: classes/admin/main.php:168
213
+ msgid "Center"
214
+ msgstr ""
215
+
216
+ #: classes/admin/main.php:169
217
+ msgid "Right"
218
+ msgstr ""
219
+
220
+ #: classes/admin/main.php:173
221
+ msgid "top"
222
+ msgstr ""
223
+
224
+ #: classes/admin/main.php:174
225
+ msgid "center"
226
+ msgstr ""
227
+
228
+ #: classes/admin/main.php:175
229
+ msgid "bottom"
230
+ msgstr ""
231
+
232
+ #: classes/admin/media.php:67
233
+ msgid "Settings"
234
+ msgstr ""
235
+
236
+ #: classes/admin/media.php:107
237
+ msgid "%s size"
238
+ msgstr ""
239
+
240
+ #: classes/admin/media.php:117
241
+ msgid "Add a new size"
242
+ msgstr ""
243
+
244
+ #: classes/admin/media.php:123
245
+ msgid "Get php for theme"
246
+ msgstr ""
247
+
248
+ #: classes/admin/media.php:129
249
+ msgid "Thumbnail regeneration"
250
+ msgstr ""
251
+
252
+ #: classes/admin/media.php:192
253
+ msgid "Cropping"
254
+ msgstr ""
255
+
256
+ #: classes/admin/media.php:226
257
+ msgid "Add a new size of thumbnail"
258
+ msgstr ""
259
+
260
+ #: classes/admin/media.php:239
261
+ msgid "Get the PHP for the theme"
262
+ msgstr ""
263
+
264
+ #: classes/admin/media.php:240
265
+ msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
266
+ msgstr ""
267
+
268
+ #: classes/admin/media.php:256
269
+ msgid "Admin option-media template missing"
270
+ msgstr ""
271
+
272
+ #: classes/admin/media.php:521
273
+ msgid "Regeneration ended"
274
+ msgstr ""
languages/sis-de_DE.mo DELETED
Binary file
languages/sis-de_DE.po DELETED
@@ -1,373 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: \n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-10-02 00:11+0100\n"
6
- "PO-Revision-Date: 2011-10-02 00:11+0100\n"
7
- "Last-Translator: \n"
8
- "Language-Team: LANGUAGE <LL@li.org>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Poedit-Language: \n"
14
- "X-Poedit-Country: \n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
- "X-Poedit-Basepath: .\n"
18
- "X-Poedit-Bookmarks: \n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Textdomain-Support: yes"
21
-
22
- #: inc/class.admin.php:89
23
- #@ sis
24
- msgid "Reading attachments..."
25
- msgstr "Lese Anhänge…"
26
-
27
- #: inc/class.admin.php:90
28
- #: inc/class.admin.php:249
29
- #@ sis
30
- msgid "Maximum width"
31
- msgstr "Maximale Breite"
32
-
33
- #: inc/class.admin.php:91
34
- #: inc/class.admin.php:254
35
- #@ sis
36
- msgid "Maximum height"
37
- msgstr "Maximale Höhe"
38
-
39
- #: inc/class.admin.php:92
40
- #: inc/class.admin.php:259
41
- #: inc/class.admin.php:327
42
- #: inc/class.admin.php:386
43
- #@ sis
44
- msgid "Crop ?"
45
- msgstr "Beschneiden?"
46
-
47
- #: inc/class.admin.php:93
48
- #: inc/class.admin.php:374
49
- #@ sis
50
- msgid "yes"
51
- msgstr "ja"
52
-
53
- #: inc/class.admin.php:94
54
- #: inc/class.admin.php:374
55
- #@ sis
56
- msgid "no"
57
- msgstr "nein"
58
-
59
- #: inc/class.admin.php:95
60
- #: inc/class.admin.php:262
61
- #@ sis
62
- msgid "Show in post insertion ?"
63
- msgstr "Beim Einfügen in den Beitrag anzeigen?"
64
-
65
- #: inc/class.admin.php:96
66
- #@ sis
67
- msgid " of "
68
- msgstr "von"
69
-
70
- #: inc/class.admin.php:97
71
- #@ sis
72
- msgid " or "
73
- msgstr "oder"
74
-
75
- #: inc/class.admin.php:98
76
- #@ sis
77
- msgid " before the end."
78
- msgstr "vor dem Ende."
79
-
80
- #: inc/class.admin.php:99
81
- #: inc/class.admin.php:264
82
- #@ sis
83
- msgid "Delete"
84
- msgstr "Löschen"
85
-
86
- #: inc/class.admin.php:100
87
- #@ sis
88
- msgid "No media in your site to regenerate !"
89
- msgstr "Keine Medien neu zu generieren!"
90
-
91
- #: inc/class.admin.php:101
92
- #@ sis
93
- msgid "Regenerating "
94
- msgstr "Neu generieren"
95
-
96
- #: inc/class.admin.php:102
97
- #@ sis
98
- msgid "Validate image size name"
99
- msgstr "Bildgrößenbezeichnung überprüfen"
100
-
101
- #: inc/class.admin.php:103
102
- #@ sis
103
- msgid "Done."
104
- msgstr "Fertig."
105
-
106
- #: inc/class.admin.php:104
107
- #@ sis
108
- msgid "Size"
109
- msgstr "Bildgröße"
110
-
111
- #: inc/class.admin.php:105
112
- #@ sis
113
- msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
114
- msgstr "Nutze nicht die vorgegebene Thumbnail-Bezeichnung in WordPress! Nutze das Formular, um diese zu bearbeiten."
115
-
116
- #: inc/class.admin.php:106
117
- #@ sis
118
- msgid "This size is already registered, edit it instead of recreating it."
119
- msgstr "Die Bildgröße existiert bereits. Du kannst sie bearbeiten, anstatt sie doppelt anzulegen."
120
-
121
- #: inc/class.admin.php:107
122
- #@ sis
123
- msgid "Do you really want to delete these size ?"
124
- msgstr "Willst du diese Bildgröße/n wirklich löschen?"
125
-
126
- #: inc/class.admin.php:108
127
- #: inc/class.admin.php:265
128
- #@ sis
129
- msgid "Update"
130
- msgstr "Aktualisieren"
131
-
132
- #: inc/class.admin.php:109
133
- #@ sis
134
- msgid "Error requesting page"
135
- msgstr "Fehler beim Abruf der Seite"
136
-
137
- #: inc/class.admin.php:110
138
- #@ sis
139
- msgid "images have been regenerated !"
140
- msgstr "Bilder wurden neu generiert!"
141
-
142
- #: inc/class.admin.php:111
143
- #@ sis
144
- msgid "Validate"
145
- msgstr "Überprüfen"
146
-
147
- #: inc/class.admin.php:112
148
- #@ sis
149
- msgid " started at"
150
- msgstr "begonnen: "
151
-
152
- #: inc/class.admin.php:113
153
- #@ sis
154
- msgid " finished at :"
155
- msgstr "beendet: "
156
-
157
- #: inc/class.admin.php:114
158
- #@ sis
159
- msgid "Error during the php treatment, be sure to not have php errors in your page"
160
- msgstr "Fehler während des PHP-Durchlaufs! Stelle sicher, dass sich keine PHP-Fehler in deiner Seite befinden."
161
-
162
- #: inc/class.admin.php:115
163
- #@ sis
164
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
165
- msgstr "Deine veränderten Bildgrößen wurden noch nicht gespeichert. Trotzdem fortfahren?"
166
-
167
- #: inc/class.admin.php:116
168
- #, php-format
169
- #@ sis
170
- msgid "This image has been regenerated in %s seconds"
171
- msgstr "Dieses Bild wurde neu generiert in %s Sekunden."
172
-
173
- #: inc/class.admin.php:131
174
- #@ sis
175
- msgid "Regenerate thumbnails"
176
- msgstr "Artikelbilder neu generieren"
177
-
178
- #: inc/class.admin.php:151
179
- #@ sis
180
- msgid "Settings"
181
- msgstr "Einstellungen"
182
-
183
- #: inc/class.admin.php:200
184
- #, php-format
185
- #@ sis
186
- msgid "%s size"
187
- msgstr "Bildgröße „%s“"
188
-
189
- #: inc/class.admin.php:207
190
- #@ sis
191
- msgid "Add a new size"
192
- msgstr "Neue Bildgröße hinzufügen"
193
-
194
- #: inc/class.admin.php:210
195
- #@ sis
196
- msgid "Legend of the sizes"
197
- msgstr "Legende für deine Bildgrößen"
198
-
199
- #: inc/class.admin.php:213
200
- #@ sis
201
- msgid "Get php for theme"
202
- msgstr "PHP für dein Theme generieren"
203
-
204
- #: inc/class.admin.php:216
205
- #@ sis
206
- msgid "Thumbnail regeneration"
207
- msgstr "Artikelbilder neu generieren"
208
-
209
- #: inc/class.admin.php:276
210
- #@ sis
211
- msgid "Add a new size of thumbnail"
212
- msgstr "Neue Bildgröße für Thumbnail hinzufügen"
213
-
214
- #: inc/class.admin.php:288
215
- #@ sis
216
- msgid "Get the PHP for the theme"
217
- msgstr "Hol‘ dir den PHP-Code für dein Theme!"
218
-
219
- #: inc/class.admin.php:289
220
- #@ sis
221
- msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
222
- msgstr "Falls du deine Bildgrößen behalten und das Plugin deaktivieren möchtest, kopiere diesen PHP-Code in die Datei functions.php deines Theme."
223
-
224
- #: inc/class.admin.php:302
225
- #@ sis
226
- msgid "The images created on your theme are <span style=\"color:#F2A13A\">orange</span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
227
- msgstr "Die von deinem Theme generierten Bildgrößen sind <span style=\"color:#F2A13A\">orange</span>, deine selbst erstellten Bildgrößen sind <span style=\"color:#89D76A\"> grün </span>."
228
-
229
- #: inc/class.admin.php:319
230
- #@ sis
231
- msgid "Select which thumbnails you want to rebuild:"
232
- msgstr "Wähle die Artikelbilder aus, die neu generiert werden sollen:"
233
-
234
- #: inc/class.admin.php:323
235
- #: inc/class.admin.php:382
236
- #: inc/class.admin.php:395
237
- #: inc/class.admin.php:420
238
- #@ sis
239
- msgid "Resize ?"
240
- msgstr "Bearbeiten?"
241
-
242
- #: inc/class.admin.php:324
243
- #: inc/class.admin.php:383
244
- #@ sis
245
- msgid "Size name"
246
- msgstr "Bildgrößenbezeichnung"
247
-
248
- #: inc/class.admin.php:325
249
- #: inc/class.admin.php:384
250
- #@ sis
251
- msgid "Width"
252
- msgstr "Breite"
253
-
254
- #: inc/class.admin.php:326
255
- #: inc/class.admin.php:385
256
- #@ sis
257
- msgid "Height"
258
- msgstr "Höhe"
259
-
260
- #: inc/class.admin.php:391
261
- #@ sis
262
- msgid "Select which post type source thumbnails you want to rebuild:"
263
- msgstr "Wähle die Inhaltstypen aus, deren Artikelbilder du neu generieren willst:"
264
-
265
- #: inc/class.admin.php:396
266
- #: inc/class.admin.php:421
267
- #@ sis
268
- msgid "Post type"
269
- msgstr "Inhaltstyp"
270
-
271
- #: inc/class.admin.php:443
272
- #@ sis
273
- msgid "End time calculated :"
274
- msgstr "Berechnetes Ende:"
275
-
276
- #: inc/class.admin.php:454
277
- #@ sis
278
- msgid "Last image:"
279
- msgstr "Letztes Bild:"
280
-
281
- #: inc/class.admin.php:455
282
- #@ sis
283
- msgid "Regenerate Thumbnails"
284
- msgstr "Artikelbilder neu generieren"
285
-
286
- #: inc/class.admin.php:620
287
- #@ sis
288
- msgid "No id given in POST datas."
289
- msgstr "Keine ID in den POST-Daten gegeben."
290
-
291
- #: inc/class.admin.php:630
292
- #: inc/class.admin.php:632
293
- #, php-format
294
- #@ sis
295
- msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
296
- msgstr "Diese Datei existiert nicht und wurde nicht neu generiert:<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
297
-
298
- #: inc/class.admin.php:73
299
- #, php-format
300
- #@ sis
301
- msgid "<h3>Welcome to Simple Image Sizes !</h3><p>In this plugin, you can add new image sizes<br/> and regenerate the images that doesn't exist yet.<br/> Click on <a href=\"%s\">Medias</a> for configurate the images</p>"
302
- msgstr "<h3>Willkommen bei Simple Image Sizes!</h3><p>Mit diesem Plugin kannst du neue Bildgrößen hinzufügen<br/> und für bereits existierende Bilder neu generieren.<br/> Gehe zur <a href=\"%s\">Mediathek</a>, um deine Bilder neu zu konfigurieren.</p>"
303
-
304
- #: inc/class.admin.php:244
305
- #@ default
306
- msgid "custom_image_sizes[name][custom]"
307
- msgstr ""
308
-
309
- #: inc/class.admin.php:246
310
- #@ default
311
- msgid "custom_image_sizes[name][theme]"
312
- msgstr ""
313
-
314
- #: inc/class.admin.php:248
315
- #: inc/class.admin.php:250
316
- #@ default
317
- msgid "custom_image_sizes[name][w]"
318
- msgstr ""
319
-
320
- #: inc/class.admin.php:253
321
- #: inc/class.admin.php:255
322
- #@ default
323
- msgid "custom_image_sizes[name][h]"
324
- msgstr ""
325
-
326
- #: inc/class.admin.php:258
327
- #: inc/class.admin.php:259
328
- #@ default
329
- msgid "custom_image_sizes[name][c]"
330
- msgstr ""
331
-
332
- #: inc/class.admin.php:261
333
- #: inc/class.admin.php:262
334
- #@ default
335
- msgid "custom_image_sizes[name][s]"
336
- msgstr ""
337
-
338
- #. translators: plugin header field 'Name'
339
- #: simple_image_sizes.php:0
340
- #@ sis
341
- msgid "Simple Image Size"
342
- msgstr "Simple Image Size"
343
-
344
- #. translators: plugin header field 'PluginURI'
345
- #: simple_image_sizes.php:0
346
- #@ sis
347
- msgid "http://redmine.beapi.fr/projects/show/simple-image-sizes"
348
- msgstr "http://redmine.beapi.fr/projects/show/simple-image-sizes"
349
-
350
- #. translators: plugin header field 'Description'
351
- #: simple_image_sizes.php:0
352
- #@ sis
353
- msgid "Add options in media setting page for images sizes"
354
- msgstr "Optionen für Bildgrößen in den Mediathek-Einstellungen hinzufügen"
355
-
356
- #. translators: plugin header field 'Author'
357
- #: simple_image_sizes.php:0
358
- #@ sis
359
- msgid "Rahe"
360
- msgstr "Rahe"
361
-
362
- #. translators: plugin header field 'AuthorURI'
363
- #: simple_image_sizes.php:0
364
- #@ sis
365
- msgid "http://nicolas-juen.fr"
366
- msgstr "http://nicolas-juen.fr"
367
-
368
- #. translators: plugin header field 'Version'
369
- #: simple_image_sizes.php:0
370
- #@ sis
371
- msgid "2.2.3"
372
- msgstr ""
373
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/sis-fr_FR.mo DELETED
Binary file
languages/sis-fr_FR.po DELETED
@@ -1,263 +0,0 @@
1
- # Copyright (C) 2010
2
- # This file is distributed under the same license as the package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Simple image sizes\n"
6
- "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: 2012-03-31 01:51+0100\n"
8
- "PO-Revision-Date: 2012-03-31 01:52+0100\n"
9
- "Last-Translator: \n"
10
- "Language-Team: Beapi <njuen@beapi.fr>\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Poedit-Language: French\n"
15
- "X-Poedit-Country: FRANCE\n"
16
- "X-Poedit-SourceCharset: utf-8\n"
17
- "X-Poedit-KeywordsList: __;_e;__\n"
18
- "X-Poedit-Basepath: ../\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
-
21
- #: inc/class.admin.php:77
22
- msgid "Reading attachments..."
23
- msgstr "Chargement des médias..."
24
-
25
- #: inc/class.admin.php:78
26
- #: inc/class.admin.php:241
27
- msgid "Maximum width"
28
- msgstr "Largeur maximum"
29
-
30
- #: inc/class.admin.php:79
31
- #: inc/class.admin.php:245
32
- msgid "Maximum height"
33
- msgstr "Hauteur maximum"
34
-
35
- #: inc/class.admin.php:80
36
- #: inc/class.admin.php:254
37
- #: inc/class.admin.php:327
38
- #: inc/class.admin.php:386
39
- msgid "Crop ?"
40
- msgstr "Rogner ?"
41
-
42
- #: inc/class.admin.php:81
43
- #: inc/class.admin.php:374
44
- msgid "yes"
45
- msgstr "oui"
46
-
47
- #: inc/class.admin.php:82
48
- #: inc/class.admin.php:374
49
- msgid "no"
50
- msgstr "non"
51
-
52
- #: inc/class.admin.php:83
53
- #: inc/class.admin.php:257
54
- msgid "Show in post insertion ?"
55
- msgstr "Afficher dans l'insertion ?"
56
-
57
- #: inc/class.admin.php:84
58
- msgid " of "
59
- msgstr " de "
60
-
61
- #: inc/class.admin.php:85
62
- msgid " or "
63
- msgstr " ou "
64
-
65
- #: inc/class.admin.php:86
66
- msgid " before the end."
67
- msgstr " avant la fin."
68
-
69
- #: inc/class.admin.php:87
70
- #: inc/class.admin.php:259
71
- msgid "Delete"
72
- msgstr "Supprimer"
73
-
74
- #: inc/class.admin.php:88
75
- msgid "No media in your site to regenerate !"
76
- msgstr "Pas de médias à regénérer !"
77
-
78
- #: inc/class.admin.php:89
79
- msgid "Regenerating "
80
- msgstr "Regénération "
81
-
82
- #: inc/class.admin.php:90
83
- msgid "Regenerate "
84
- msgstr "Regénérer "
85
-
86
- #: inc/class.admin.php:91
87
- msgid "Validate image size name"
88
- msgstr "Valider le nom de la taille d'image"
89
-
90
- #: inc/class.admin.php:92
91
- msgid "Done."
92
- msgstr "Fini."
93
-
94
- #: inc/class.admin.php:93
95
- msgid "Size"
96
- msgstr "Taille "
97
-
98
- #: inc/class.admin.php:94
99
- msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
100
- msgstr "N'utilisez pas les tailles par défaut de WordPress comme nom de taille, éditez leurs valeurs avec le formulaire ci-dessus."
101
-
102
- #: inc/class.admin.php:95
103
- msgid "This size is already registered, edit it instead of recreating it."
104
- msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
105
-
106
- #: inc/class.admin.php:96
107
- msgid "Do you really want to delete these size ?"
108
- msgstr "Voulez-vous réellement supprimer cette taille ?"
109
-
110
- #: inc/class.admin.php:97
111
- #: inc/class.admin.php:260
112
- msgid "Update"
113
- msgstr "Mettre à jour"
114
-
115
- #: inc/class.admin.php:98
116
- msgid "Error requesting page"
117
- msgstr "Erreur lors de la requête vers la page"
118
-
119
- #: inc/class.admin.php:99
120
- msgid "images have been regenerated !"
121
- msgstr "images ont été regénérées !"
122
-
123
- #: inc/class.admin.php:100
124
- msgid "Validate"
125
- msgstr "Valider"
126
-
127
- #: inc/class.admin.php:101
128
- msgid " started at"
129
- msgstr " commencé à "
130
-
131
- #: inc/class.admin.php:102
132
- #: inc/class.admin.php:249
133
- msgid "Public name"
134
- msgstr "Nom public"
135
-
136
- #: inc/class.admin.php:103
137
- msgid " finished at :"
138
- msgstr " terminé à :"
139
-
140
- #: inc/class.admin.php:104
141
- msgid "Error during the php treatment, be sure to not have php errors in your page"
142
- msgstr "Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans votre page"
143
-
144
- #: inc/class.admin.php:105
145
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
146
- msgstr "Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer tout de même ?"
147
-
148
- #: inc/class.admin.php:106
149
- #, php-format
150
- msgid "This image has been regenerated in %s seconds"
151
- msgstr "Cette image a été regénérée en %s secondes"
152
-
153
- #: inc/class.admin.php:121
154
- msgid "Regenerate thumbnails"
155
- msgstr "Régénérer les vignettes"
156
-
157
- #: inc/class.admin.php:141
158
- msgid "Settings"
159
- msgstr "Paramètres"
160
-
161
- #: inc/class.admin.php:190
162
- #, php-format
163
- msgid "%s size"
164
- msgstr "Taille %s"
165
-
166
- #: inc/class.admin.php:197
167
- msgid "Add a new size"
168
- msgstr "Ajouter une nouvelle taille"
169
-
170
- #: inc/class.admin.php:200
171
- msgid "Legend of the sizes"
172
- msgstr "Légende des tailles"
173
-
174
- #: inc/class.admin.php:203
175
- msgid "Get php for theme"
176
- msgstr "Récupérer le PHP pour le thème"
177
-
178
- #: inc/class.admin.php:206
179
- msgid "Thumbnail regeneration"
180
- msgstr "Régénération des vignettes"
181
-
182
- #: inc/class.admin.php:286
183
- msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
184
- msgstr "Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre thème WordPress si vous voulez les conserver et désactiver ce plugin."
185
-
186
- #: inc/class.admin.php:299
187
- msgid "The images created on your theme are <span style=\"color:#F2A13A\">orange</span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
188
- msgstr "Les tailles d'images crées par votre thème sont en <span style=\"color:#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style=\"color:#89D76A\"> vert </span>."
189
-
190
- #: inc/class.admin.php:319
191
- msgid "Select which thumbnails you want to rebuild:"
192
- msgstr "Sélectionnez les tailles de vignettes à régénérer"
193
-
194
- #: inc/class.admin.php:324
195
- #: inc/class.admin.php:383
196
- msgid "Size name"
197
- msgstr "Nom de la taille"
198
-
199
- #: inc/class.admin.php:325
200
- #: inc/class.admin.php:384
201
- msgid "Width"
202
- msgstr "Largeur"
203
-
204
- #: inc/class.admin.php:326
205
- #: inc/class.admin.php:385
206
- msgid "Height"
207
- msgstr "Hauteur"
208
-
209
- #: inc/class.admin.php:391
210
- msgid "Select which post type source thumbnails you want to rebuild:"
211
- msgstr "Sélectionnez quelles vignettes de quel type de contenu vous souhaitez régénérer : "
212
-
213
- #: inc/class.admin.php:396
214
- #: inc/class.admin.php:424
215
- msgid "Post type"
216
- msgstr "Type de contenu"
217
-
218
- #: inc/class.admin.php:446
219
- msgid "End time calculated :"
220
- msgstr "Fin du traitement calculé :"
221
-
222
- #: inc/class.admin.php:457
223
- msgid "Last image:"
224
- msgstr "Dernière image :"
225
-
226
- #: inc/class.admin.php:458
227
- #: inc/class.admin.php:903
228
- #: inc/class.admin.php:906
229
- msgid "Regenerate Thumbnails"
230
- msgstr "Régénérer les vignettes"
231
-
232
- #: inc/class.admin.php:651
233
- msgid "Trying to cheat ?"
234
- msgstr "Cheater ?"
235
-
236
- #: inc/class.admin.php:660
237
- msgid "No id given in POST datas."
238
- msgstr "Pas d'id donné dans les données du POST."
239
-
240
- #: inc/class.admin.php:670
241
- #, php-format
242
- msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
243
- msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
244
-
245
- #: inc/class.admin.php:672
246
- #, php-format
247
- msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
248
- msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
249
-
250
- #~ msgid "Size "
251
- #~ msgstr "Taille "
252
-
253
- #~ msgid "Theme size"
254
- #~ msgstr "Taille de thème"
255
-
256
- #~ msgid "Add a new size of thumbnail"
257
- #~ msgstr "Ajouter une nouvelle taille de vignette"
258
-
259
- #~ msgid "Get the PHP for the theme"
260
- #~ msgstr "Récupérer le PHP pour le thème"
261
-
262
- #~ msgid "Resize ?"
263
- #~ msgstr "Regénérer ?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/sis.pot DELETED
@@ -1,254 +0,0 @@
1
- # Copyright (C) 2010
2
- # This file is distributed under the same license as the package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: \n"
6
- "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: 2012-01-20 14:56+0100\n"
8
- "PO-Revision-Date: 2012-01-20 14:56+0100\n"
9
- "Last-Translator: Nicolas <njuen@beapi.fr>\n"
10
- "Language-Team: LANGUAGE <LL@li.org>\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Poedit-Basepath: .\n"
15
- "X-Poedit-KeywordsList: esc_attr_e;esc_html_e;esc_attr__;esc_html__;_e;__\n"
16
- "X-Poedit-SearchPath-0: ..\n"
17
-
18
- #: ../inc/class.admin.php:74
19
- msgid "Reading attachments..."
20
- msgstr ""
21
-
22
- #: ../inc/class.admin.php:75
23
- #: ../inc/class.admin.php:237
24
- msgid "Maximum width"
25
- msgstr ""
26
-
27
- #: ../inc/class.admin.php:76
28
- #: ../inc/class.admin.php:241
29
- msgid "Maximum height"
30
- msgstr ""
31
-
32
- #: ../inc/class.admin.php:77
33
- #: ../inc/class.admin.php:250
34
- #: ../inc/class.admin.php:323
35
- #: ../inc/class.admin.php:382
36
- msgid "Crop ?"
37
- msgstr ""
38
-
39
- #: ../inc/class.admin.php:78
40
- #: ../inc/class.admin.php:370
41
- msgid "yes"
42
- msgstr ""
43
-
44
- #: ../inc/class.admin.php:79
45
- #: ../inc/class.admin.php:370
46
- msgid "no"
47
- msgstr ""
48
-
49
- #: ../inc/class.admin.php:80
50
- #: ../inc/class.admin.php:253
51
- msgid "Show in post insertion ?"
52
- msgstr ""
53
-
54
- #: ../inc/class.admin.php:81
55
- msgid " of "
56
- msgstr ""
57
-
58
- #: ../inc/class.admin.php:82
59
- msgid " or "
60
- msgstr ""
61
-
62
- #: ../inc/class.admin.php:83
63
- msgid " before the end."
64
- msgstr ""
65
-
66
- #: ../inc/class.admin.php:84
67
- #: ../inc/class.admin.php:255
68
- msgid "Delete"
69
- msgstr ""
70
-
71
- #: ../inc/class.admin.php:85
72
- msgid "No media in your site to regenerate !"
73
- msgstr ""
74
-
75
- #: ../inc/class.admin.php:86
76
- msgid "Regenerating "
77
- msgstr ""
78
-
79
- #: ../inc/class.admin.php:87
80
- msgid "Validate image size name"
81
- msgstr ""
82
-
83
- #: ../inc/class.admin.php:88
84
- msgid "Done."
85
- msgstr ""
86
-
87
- #: ../inc/class.admin.php:89
88
- msgid "Size"
89
- msgstr ""
90
-
91
- #: ../inc/class.admin.php:90
92
- msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
93
- msgstr ""
94
-
95
- #: ../inc/class.admin.php:91
96
- msgid "This size is already registered, edit it instead of recreating it."
97
- msgstr ""
98
-
99
- #: ../inc/class.admin.php:92
100
- msgid "Do you really want to delete these size ?"
101
- msgstr ""
102
-
103
- #: ../inc/class.admin.php:93
104
- #: ../inc/class.admin.php:256
105
- msgid "Update"
106
- msgstr ""
107
-
108
- #: ../inc/class.admin.php:94
109
- msgid "Error requesting page"
110
- msgstr ""
111
-
112
- #: ../inc/class.admin.php:95
113
- msgid "images have been regenerated !"
114
- msgstr ""
115
-
116
- #: ../inc/class.admin.php:96
117
- msgid "Validate"
118
- msgstr ""
119
-
120
- #: ../inc/class.admin.php:97
121
- msgid " started at"
122
- msgstr ""
123
-
124
- #: ../inc/class.admin.php:98
125
- #: ../inc/class.admin.php:245
126
- msgid "Public name"
127
- msgstr ""
128
-
129
- #: ../inc/class.admin.php:99
130
- msgid " finished at :"
131
- msgstr ""
132
-
133
- #: ../inc/class.admin.php:100
134
- msgid "Error during the php treatment, be sure to not have php errors in your page"
135
- msgstr ""
136
-
137
- #: ../inc/class.admin.php:101
138
- msgid "All the sizes you have modifed are not saved, continue anyway ?"
139
- msgstr ""
140
-
141
- #: ../inc/class.admin.php:102
142
- #, php-format
143
- msgid "This image has been regenerated in %s seconds"
144
- msgstr ""
145
-
146
- #: ../inc/class.admin.php:117
147
- msgid "Regenerate thumbnails"
148
- msgstr ""
149
-
150
- #: ../inc/class.admin.php:137
151
- msgid "Settings"
152
- msgstr ""
153
-
154
- #: ../inc/class.admin.php:186
155
- #, php-format
156
- msgid "%s size"
157
- msgstr ""
158
-
159
- #: ../inc/class.admin.php:193
160
- msgid "Add a new size"
161
- msgstr ""
162
-
163
- #: ../inc/class.admin.php:196
164
- msgid "Legend of the sizes"
165
- msgstr ""
166
-
167
- #: ../inc/class.admin.php:199
168
- msgid "Get php for theme"
169
- msgstr ""
170
-
171
- #: ../inc/class.admin.php:202
172
- msgid "Thumbnail regeneration"
173
- msgstr ""
174
-
175
- #: ../inc/class.admin.php:238
176
- #: ../inc/class.admin.php:240
177
- #: ../inc/class.admin.php:242
178
- msgid "custom_image_sizes["
179
- msgstr ""
180
-
181
- #: ../inc/class.admin.php:269
182
- msgid "Add a new size of thumbnail"
183
- msgstr ""
184
-
185
- #: ../inc/class.admin.php:281
186
- msgid "Get the PHP for the theme"
187
- msgstr ""
188
-
189
- #: ../inc/class.admin.php:282
190
- msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
191
- msgstr ""
192
-
193
- #: ../inc/class.admin.php:295
194
- msgid "The images created on your theme are <span style=\"color:#F2A13A\">orange</span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
195
- msgstr ""
196
-
197
- #: ../inc/class.admin.php:315
198
- msgid "Select which thumbnails you want to rebuild:"
199
- msgstr ""
200
-
201
- #: ../inc/class.admin.php:320
202
- #: ../inc/class.admin.php:379
203
- msgid "Size name"
204
- msgstr ""
205
-
206
- #: ../inc/class.admin.php:321
207
- #: ../inc/class.admin.php:380
208
- msgid "Width"
209
- msgstr ""
210
-
211
- #: ../inc/class.admin.php:322
212
- #: ../inc/class.admin.php:381
213
- msgid "Height"
214
- msgstr ""
215
-
216
- #: ../inc/class.admin.php:387
217
- msgid "Select which post type source thumbnails you want to rebuild:"
218
- msgstr ""
219
-
220
- #: ../inc/class.admin.php:392
221
- #: ../inc/class.admin.php:420
222
- msgid "Post type"
223
- msgstr ""
224
-
225
- #: ../inc/class.admin.php:442
226
- msgid "End time calculated :"
227
- msgstr ""
228
-
229
- #: ../inc/class.admin.php:453
230
- msgid "Last image:"
231
- msgstr ""
232
-
233
- #: ../inc/class.admin.php:454
234
- msgid "Regenerate Thumbnails"
235
- msgstr ""
236
-
237
- #: ../inc/class.admin.php:647
238
- msgid "Trying to cheat ?"
239
- msgstr ""
240
-
241
- #: ../inc/class.admin.php:656
242
- msgid "No id given in POST datas."
243
- msgstr ""
244
-
245
- #: ../inc/class.admin.php:666
246
- #, php-format
247
- msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
248
- msgstr ""
249
-
250
- #: ../inc/class.admin.php:668
251
- #, php-format
252
- msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
253
- msgstr ""
254
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.md ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Simple Image Sizes #
2
+ **Contributors:** Rahe
3
+
4
+ **Donate link:** http://www.beapi.fr/donate/
5
+
6
+ **Tags:** images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate, cropping
7
+
8
+ **Requires at least:** 3.5
9
+
10
+ **Tested up to:** 4.9.1
11
+
12
+ **Stable tag:** 3.2.1
13
+
14
+
15
+ ## Description ##
16
+
17
+ This plugin allow create custom image sizes for your site. Override your theme sizes directly on the media option page.
18
+ You can regenerate all the sizes you have just created and choose which one you wanted to regenerate.
19
+ You can now get all the code to copy and paste to your function theme file.
20
+ Now you can use the generated sizes directly into your posts and insert images at the right size !
21
+ Now you choose if you want display the size in the post insert image.
22
+ Now you can regenerate the images one by one in the 'Medias' general pane.
23
+ Now you can regenerate the images by bulk action in the 'Medias' general pane.
24
+ Now you can regenerate the image sizes on single attachment edit page.
25
+
26
+ I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
27
+ I have improved the php and javascript, you can know if the image have been regenerated or not or if there is an error and which one.
28
+
29
+ Contribute on https://github.com/Rahe/Simple-image-sizes
30
+
31
+ ## Installation ##
32
+ **PHP5.6 minimum Required.**
33
+
34
+ 1. Download, unzip and upload to your WordPress plugins directory
35
+ 2. Activate the plugin within you WordPress Administration Backend
36
+ 3. Go to Settings > Medias
37
+ 4. Configure your new image sizes and regenerate the thumbnails !
38
+
39
+
40
+ ## Frequently Asked Questions ##
41
+
42
+ ### Where can I add image sizes ? ####
43
+ Go to Settings -> Media then you can add a image size. You have to add a unique custom name without any spaces or special chars.
44
+ The best is to use something like my-custom-size.
45
+ Then you have several fields for configuring the image size, the widht, the height, cropping.
46
+ And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
47
+
48
+
49
+ ## Screenshots ##
50
+
51
+ ###1. Settings page
52
+ ###
53
+ ![Settings page
54
+ ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-1.png)
55
+
56
+ ###2. Get PHP for the theme
57
+ ###
58
+ ![Get PHP for the theme
59
+ ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-2.png)
60
+
61
+ ###3. Choose the sizes to regenerate and regenerate them
62
+ ###
63
+ ![Choose the sizes to regenerate
64
+ ](http://s.wordpress.org/extend/plugins/simple-image-sizes/screenshot-3.png)
65
+
66
+ ## Changelog ##
67
+ * 3.2.1
68
+ * Remove the .git file
69
+ * Add phpcs file
70
+ * 3.2.0
71
+ * Compatibility to 4.9.X
72
+ * Reformat code and improve maintenability
73
+ * 3.1.1
74
+ * Make translatable the link on admin featured image metabox
75
+ * Add filter to allow to remove the button : filter SIS/Admin/Post/Display_Thumbnail_Regenerate
76
+ * 3.1.0
77
+ * Regenerate images from the featured image
78
+ * Use wp_send_json since the minimum WordPress version is 3.5
79
+ * 3.0.10
80
+ * Remove text-domain on the header for language pack
81
+ * 3.0.9
82
+ * Reuse the after_setup_theme for image size registering
83
+ * Code formatting and cleaning
84
+ * Check compatibility wth 4.3
85
+ * 3.0.8
86
+ * Fix potential bug on error ajax
87
+ * Stop using init hook and use after_setup_theme for image size registering
88
+ * Update underscore cdn version for WP install without it
89
+ * Remove useless timer_start
90
+ * 3.0.6
91
+ * Fix bug for the image adding
92
+ * 3.0.5
93
+ * Fix bug on condition
94
+ * 3.0.4
95
+ * Fix global add_image_size
96
+ * 3.0.3
97
+ * Add Hebrew translations thanks to Atar4U
98
+ * 3.0.2
99
+ * Fix version check for the image crop positions
100
+ * Add Hebrew translations thanks to Atar4U
101
+ * 3.0.1
102
+ * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
103
+ * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
104
+ * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
105
+ * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
106
+ * 3.0
107
+ * Revamping all the code, change classes and structure
108
+ * Use grunt for compiling files
109
+ * Handle the 3.9 new cropping position
110
+ * Remove aristo css
111
+ * Use UI from WordPress
112
+ * 2.4.3
113
+ * Remove some php notices
114
+ * Remove notice when wrong image size
115
+ * 2.4.2
116
+ * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
117
+ * 2.4.1
118
+ * Remove function not working on admin file
119
+ * 2.4
120
+ * Made for 3.5 and up
121
+ * Refactoring PHP/Javascript code
122
+ * Javascript improvements
123
+ * Remove useless UI
124
+ * UI improvements
125
+ * Global PHP performance improvements
126
+ * 2.3.1
127
+ * Add Ajax bulk actions on medias list
128
+ * Add ajax thumbnail rebuild on single media
129
+ * 2.3
130
+ * Add the custom size name in the attachment insertion
131
+ * Exclude post_type wich do not support the post-thumbnail feature
132
+ * 2.2.5
133
+ * Debug the regeneration buggy !
134
+ * Complete the french translation
135
+ * Security update for single regeneration, include the nonce this time :)
136
+ * 2.2.4
137
+ * Add security nonces for every actions
138
+ * Put the messages at the begining of the log
139
+ * Add a select all checkbox Thank to cocola
140
+ * Add the german translation thanks to glueckpress
141
+ * Remove notice tnahks to christianwach
142
+ * Remove useless and buggy for my scripting pointers
143
+ * 2.2.3
144
+ * Do not force network usage
145
+ * 2.2.2
146
+ * Debug js for the buttons
147
+ * Remove console.log calls
148
+ * 2.2.1
149
+ * Use buttonset for the checkboxes
150
+ * Add Pointer for WordPress 3.3
151
+ * Fix translation in French
152
+ * Some medias queries for small windows ( change size of buttons and alignment )
153
+ * 2.2
154
+ * Add new version of css aristo
155
+ * Add some icons
156
+ * Display button for saving changes only when changes detected
157
+ * Display message when a size is modified but not saved and wanted to regenerate
158
+ * Debug functionnality when regenerating only some sizes, metas not crushed
159
+ * Add solo regenerating
160
+ * Remove displaying for theme/not theme sizes
161
+ * Use WordPress class for small inputs
162
+ * 2.1
163
+ * Add javascript timer
164
+ * Improve javascript and more IE friendly
165
+ * You can now choose if you want to display the image sizes in image insertion or not
166
+ * Handle errors and messages
167
+ * Remove some css useless rules
168
+ * Fix bad translation for french
169
+ * Remove accents in image sizes
170
+ * Do not update size properties if there is an ajax query for an another size name
171
+ * 2.0.3
172
+ * Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
173
+ * 2.0.2
174
+ * Remove debug on php for javascript
175
+ * Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
176
+ * 2.0.1
177
+ * Resolve javascript issue when clicking on delete button
178
+ * Resolve issue of never unchecking crop button
179
+ * 2.0
180
+ * Code refactoring
181
+ * Update translations
182
+ * Ajaxification of the process
183
+ * Deleting by Ajax
184
+ * Updating by Ajax
185
+ * Adding by Ajax
186
+ * Change UI
187
+ * Change theme
188
+ * Handle ajax errors
189
+ * Handle not modified sizes, cropped
190
+ * Handle same names
191
+ * Sanitize the names
192
+ * Customize jQuery ui
193
+ * Customize jQuery ui theme
194
+ * HTML5 Elements
195
+ * CSS3 Animations
196
+ * 1.0.6
197
+ * Minify javascript names
198
+ * Change progressbar style
199
+ * Add animations on progressbar
200
+ * 1.0.5
201
+ * Only add css and js script in the media page to avoid any javascript error in other pages
202
+ * Rectify css
203
+ * Add function to get the code for the function.php file of the theme
204
+ * Don't redefine the Wordpress basic size names
205
+ * 1.0.4
206
+ * Fix the add_image_size issue ( height and width reversed )
207
+ * 1.0.3
208
+ * Fix the plugin language
209
+ * Add some translations
210
+ * Externalise some css
211
+ * Add sizes in the image adding to an article
212
+ * Add setting link in the plugins list
213
+ * Use admin_url instead of home_url
214
+ * Add legend for colors
215
+ * Some code refactoring
216
+ * 1.0.2
217
+ * Fix the plugin license
218
+ * 1.0.1
219
+ * Add POT file
220
+ * Add french translation
221
+ * 1.0
222
+ * First release
223
+ * Thumbnail regenerate
224
+ * Image size generation
readme.txt CHANGED
@@ -2,9 +2,12 @@
2
  Contributors: Rahe
3
  Donate link: http://www.beapi.fr/donate/
4
  Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
5
- Requires at least: 3.0
6
- Tested up to: 3.3.1
7
- Stable tag: 2.3.1
 
 
 
8
 
9
  == Description ==
10
 
@@ -30,14 +33,83 @@ Contribute on https://github.com/Rahe/Simple-image-sizes
30
  3. Go to Settings > Medias
31
  4. Configure your new image sizes and regenerate the thumbnails !
32
 
 
 
 
 
 
 
 
 
 
33
  == Screenshots ==
34
 
35
  1. Settings page
36
  2. Get PHP for the theme
37
- 3. Choose the sizes to regenerate
38
- 4. Regenerating image sizes
39
 
40
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  * 2.3.1
42
  * Add Ajax bulk actions on medias list
43
  * Add ajax thumbnail rebuild on single media
2
  Contributors: Rahe
3
  Donate link: http://www.beapi.fr/donate/
4
  Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
5
+ Requires at least: 3.5
6
+ Tested up to: 4.9.1
7
+ Stable tag: 3.2.1
8
+ Requires PHP: 5.6.33
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
  == Description ==
13
 
33
  3. Go to Settings > Medias
34
  4. Configure your new image sizes and regenerate the thumbnails !
35
 
36
+ == Frequently Asked Questions ==
37
+
38
+ = Where can I add image sizes ? =
39
+ Go to Settings -> Media then you can add a image size. You have to add a unique custom name without any spaces or special chars.
40
+ The best is to use something like my-custom-size.
41
+ Then you have several fields for configuring the image size, the widht, the height, cropping.
42
+ And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
43
+
44
+
45
  == Screenshots ==
46
 
47
  1. Settings page
48
  2. Get PHP for the theme
49
+ 3. Choose the sizes to regenerate and regenerate them
 
50
 
51
  == Changelog ==
52
+ * 3.2.1
53
+ * Remove the .git file
54
+ * Add phpcs file
55
+ * 3.2.0
56
+ * Compatibility to 4.9.X
57
+ * Reformat and clean some code and improve maintenability
58
+ * 3.1.1
59
+ * Make translatable the link on admin featured image metabox
60
+ * Add filter to allow to remove the button : filter SIS/Admin/Post/Display_Thumbnail_Regenerate
61
+ * 3.1.0
62
+ * Regenerate images from the featured image
63
+ * Use wp_send_json since the minimum WordPress version is 3.5
64
+ * 3.0.10
65
+ * Remove text-domain on the header for language pack
66
+ * 3.0.9
67
+ * Reuse the after_setup_theme for image size registering
68
+ * Code formatting and cleaning
69
+ * Check compatibility wth 4.3
70
+ * 3.0.8
71
+ * Fix potential bug on error ajax
72
+ * Stop using init hook and use after_setup_theme for image size registering
73
+ * Update underscore cdn version for WP install without it
74
+ * Remove useless timer_start
75
+ * 3.0.7
76
+ * Fix bug on single image regeneration upload page
77
+ * Fix bug https://github.com/Rahe/Simple-image-sizes/issues/30
78
+ * 3.0.6
79
+ * Fix bug for the image adding
80
+ * 3.0.5
81
+ * Fix bug on condition
82
+ * 3.0.4
83
+ * Fix global add_image_size
84
+ * 3.0.3
85
+ * Add Hebrew translations thanks to Atar4U
86
+ * 3.0.2
87
+ * Fix version check for the image crop positions
88
+ * 3.0.1
89
+ * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
90
+ * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
91
+ * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
92
+ * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
93
+ * 3.0
94
+ * Revamping all the code, change classes and structure
95
+ * Use grunt for compiling files
96
+ * Handle the 3.9 new cropping position
97
+ * Remove aristo css
98
+ * Use UI from WordPress
99
+ * 2.4.3
100
+ * Remove some php notices
101
+ * Remove notice when wrong image size
102
+ * 2.4.2
103
+ * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
104
+ * 2.4.1
105
+ * Remove function not working on admin file
106
+ * 2.4
107
+ * Made for 3.5 and up
108
+ * Refactoring PHP/Javascript code
109
+ * Javascript improvements
110
+ * Remove useless UI
111
+ * UI improvements
112
+ * Global PHP performance improvements
113
  * 2.3.1
114
  * Add Ajax bulk actions on medias list
115
  * Add ajax thumbnail rebuild on single media
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png DELETED
Binary file
simple_image_sizes.php CHANGED
@@ -1,14 +1,15 @@
1
  <?php
2
  /*
3
- Plugin Name: Simple Image Size
4
- Plugin URI: http://redmine.beapi.fr/projects/show/simple-image-sizes
5
  Description: Add options in media setting page for images sizes
6
- Version: 2.3.1
7
  Author: Rahe
8
  Author URI: http://nicolas-juen.fr
9
- Text Domain: sis
10
- Domain Path: /languages/
11
- Network: false
 
12
 
13
  Copyright 2011 Nicolas JUEN (njuen@beapi.fr) - Be-API
14
 
@@ -27,22 +28,23 @@ along with this program; if not, write to the Free Software
27
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
  */
29
 
30
- define( 'SIS_URL', plugins_url('/', __FILE__) );
31
- define( 'SIS_DIR', dirname(__FILE__) );
32
- define( 'SIS_VERSION', '2.3.1' );
33
  define( 'SIS_OPTION', 'custom_image_sizes' );
34
 
35
- require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.admin.php' );
36
- require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.client.php' );
37
-
38
- add_action ( 'plugins_loaded', 'initSIS' );
39
- function initSIS() {
40
- global $SIS;
41
- if( is_admin() )
42
- $SIS['admin'] = new SISAdmin();
43
-
44
- $SIS['client'] = new SISClient();
45
-
46
- load_plugin_textdomain ( 'sis', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
 
 
47
  }
48
- ?>
1
  <?php
2
  /*
3
+ Plugin Name: Simple Image Sizes
4
+ Plugin URI: https://github.com/Rahe/simple-image-sizes
5
  Description: Add options in media setting page for images sizes
6
+ Version: 3.2.1
7
  Author: Rahe
8
  Author URI: http://nicolas-juen.fr
9
+ Text Domain: simple-image-sizes
10
+ Domain Path: /languages
11
+ License: GPLv2 or later
12
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
14
  Copyright 2011 Nicolas JUEN (njuen@beapi.fr) - Be-API
15
 
28
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
  */
30
 
31
+ define( 'SIS_URL', plugin_dir_url( __FILE__ ) );
32
+ define( 'SIS_DIR', plugin_dir_path( __FILE__ ) );
33
+ define( 'SIS_VERSION', '3.2.1' );
34
  define( 'SIS_OPTION', 'custom_image_sizes' );
35
 
36
+ if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
37
+ require __DIR__ . '/vendor/autoload.php';
38
+ }
39
+
40
+ add_action( 'plugins_loaded', 'init_sis' );
41
+ function init_sis() {
42
+ new Rahe\Simple_Image_Sizes\Main();
43
+
44
+ if ( is_admin() ) {
45
+ new \Rahe\Simple_Image_Sizes\Admin\Main();
46
+ new \Rahe\Simple_Image_Sizes\Admin\Post();
47
+ new \Rahe\Simple_Image_Sizes\Admin\Media();
48
+ }
49
+
50
  }
 
templates/admin-js.html ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/html" id="sis-new_size">
2
+ <tr valign="top" class="new_size_{{ data.size_id }} new_size">
3
+ <th scope="row">
4
+ <input type="text" id="new_size_{{ data.size_id }}" value="thumbnail-name">
5
+ </th>
6
+ <td>
7
+ <input type="button" id="validate_{{ data.size_id }}" value="{{ data.validate }}"
8
+ class="button-secondary action add_size_name">
9
+ </td>
10
+ </tr>
11
+ </script>
12
+ <script type="text/html" id="sis-new_size_row">
13
+ <th scope="row">{{ data.size }}{{ data.size_name }}</th>
14
+ <td>
15
+ <input type="hidden" name="image_name" value="{{ data.size_name }}">
16
+ <input type="hidden" name="custom_image_sizes[{{ data.size_name }}][custom]" value="1">
17
+ <label for="custom_image_sizes[{{ data.size_name }}][w]" class="sis-label">
18
+ {{ data.maximumWidth }}
19
+ <input type="number" name="custom_image_sizes[{{ data.size_name }}][w]" value="1" step="1" min="0"
20
+ id="custom_image_sizes[{{ data.size_name }}][w]" base_w="0" class="w small-text">
21
+ </label>
22
+ <label for="custom_image_sizes[{{ data.size_name }}][h]" class="sis-label">
23
+ {{ data.maximumHeight }}
24
+ <input type="number" name="custom_image_sizes[{{ data.size_name }}][h]" value="1" step="1" min="0"
25
+ id="custom_image_sizes[{{ data.size_name }}][h]" base_h="0" class="h small-text">
26
+ </label>
27
+ <label for="custom_image_sizes[{{ data.size_name }}][n]" class="sis-label">
28
+ {{ data.customName }}
29
+ <input type="text" name="custom_image_sizes[{{ data.size_name }}][n]"
30
+ id="custom_image_sizes[{{ data.size_name }}][n]" base_n="{{ data.size_name }}" class="n">
31
+ </label>
32
+ <span class="size_options">
33
+ <label for="custom_image_sizes[{{ data.size_name }}][c]" id="custom_image_sizes[{{ data.size_name }}][c]"
34
+ class="c" title="{{ data.crop }}">
35
+ {{ data.crop }}
36
+ </label>
37
+ <select type="checkbox" name="custom_image_sizes[{{ data.size_name }}][c]"
38
+ id="custom_image_sizes[{{ data.size_name }}][c]" base_c="0" class="c crop">
39
+ <# _.each( sis.crop_positions, function( label, name ) { #>
40
+ <option value="{{ name }}"> {{ label }} </option>
41
+ <# }); #>
42
+ </select>
43
+ <input type="checkbox" name="custom_image_sizes[{{ data.size_name }}][s]"
44
+ id="custom_image_sizes[{{ data.size_name }}][s]" base_s="0" value="1" class="s show">
45
+ <label for="custom_image_sizes[{{ data.size_name }}][s]" id="custom_image_sizes[{{ data.size_name }}][s]"
46
+ class="s" title="{{ data.show }}">
47
+ {{ data.show }}
48
+ </label>
49
+ </span>
50
+ <div class="delete_size button-secondary">{{ data.deleteImage }}</div>
51
+ <div class="add_size button-primary">{{ data.validateButton }}</div>
52
+ </td>
53
+ </script>
templates/options-media.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Get the sizes.
3
+ global $_wp_additional_image_sizes, $_wp_post_type_features;
4
+ ?>
5
+ <input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>'/>
6
+ <input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>'/>
7
+ <input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>'/>
8
+ <div id="sis-regen">
9
+ <div class="wrapper" style="">
10
+ <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes' ); ?> </h4>
11
+ <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
12
+ <thead>
13
+ <tr>
14
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
15
+ type="checkbox">
16
+ </th>
17
+ <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes' ); ?></th>
18
+ <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes' ); ?></th>
19
+ <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes' ); ?></th>
20
+ <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes' ); ?></th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ <?php
25
+ // Display the sizes in the array.
26
+ foreach ( get_intermediate_image_sizes() as $s ) :
27
+ // Don't make or numeric sizes that appear.
28
+ if ( is_integer( $s ) ) {
29
+ continue;
30
+ }
31
+
32
+ // Set width.
33
+ $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
34
+
35
+ // Set height
36
+ $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
37
+
38
+ //Set crop
39
+ $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
40
+
41
+ if ( is_numeric( $crop ) || is_bool( $crop ) || is_string( $crop ) ) {
42
+ $crop = absint( $crop ) > 0 ? __( 'Yes', 'simple-image-sizes' ) : __( 'No', 'simple-image-sizes' );
43
+ } else {
44
+ $crop = \Rahe\Simple_Image_Sizes\Admin\Main::get_crop_position_label( implode( '_', $crop ) );
45
+ }
46
+
47
+ ?>
48
+ <tr id="sis-<?php echo esc_attr( $s ); ?>">
49
+ <th class="check-column">
50
+ <input type="checkbox" class="thumbnails" id="<?php echo esc_attr( $s ); ?>" name="thumbnails[]"
51
+ checked="checked" value="<?php echo esc_attr( $s ); ?>"/>
52
+ </th>
53
+ <th>
54
+ <label for="<?php echo esc_attr( $s ); ?>"><?php echo esc_html( $s ); ?></label>
55
+ </th>
56
+ <th>
57
+ <label for="<?php echo esc_attr( $s ); ?>"><?php echo esc_html( $width ); ?> px</label>
58
+ </th>
59
+ <th>
60
+ <label for="<?php echo esc_attr( $s ); ?>"><?php echo esc_html( $height ); ?> px</label>
61
+ </th>
62
+ <th>
63
+ <label for="<?php echo esc_attr( $s ); ?>"><?php echo $crop; ?> </label>
64
+ </th>
65
+ </tr>
66
+ <?php endforeach; ?>
67
+ </tbody>
68
+ <tfoot>
69
+ <tr>
70
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
71
+ type="checkbox">
72
+ </th>
73
+ <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes' ); ?></th>
74
+ <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes' ); ?></th>
75
+ <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes' ); ?></th>
76
+ <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes' ); ?></th>
77
+ </tr>
78
+ </tfoot>
79
+ </table>
80
+
81
+ <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'simple-image-sizes' ); ?></h4>
82
+ <table cellspacing="0" class="widefat page fixed sis">
83
+ <thead>
84
+ <tr>
85
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
86
+ type="checkbox">
87
+ </th>
88
+ <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes' ); ?></th>
89
+ </tr>
90
+ </thead>
91
+ <tbody>
92
+ <?php
93
+ // Diplay the post types table
94
+ foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $ptype ) :
95
+ // Avoid the post_types without post thumbnails feature
96
+ if ( ! isset( $_wp_post_type_features[ $ptype->name ] ) || ! array_key_exists( 'thumbnail', $_wp_post_type_features[ $ptype->name ] ) || false == $_wp_post_type_features[ $ptype->name ] ) {
97
+ continue;
98
+ }
99
+ ?>
100
+ <tr>
101
+ <th class="check-column">
102
+ <label for="<?php echo esc_attr( $ptype->name ); ?>">
103
+ <input type="checkbox" class="post_types" name="post_types[]" checked="checked"
104
+ id="<?php echo esc_attr( $ptype->name ); ?>"
105
+ value="<?php echo esc_attr( $ptype->name ); ?>"/>
106
+ </label>
107
+ </th>
108
+ <th>
109
+ <label
110
+ for="<?php echo esc_attr( $ptype->name ); ?>"><em><?php echo esc_html( $ptype->labels->name ); ?></em></label>
111
+ </th>
112
+ </tr>
113
+ <?php endforeach; ?>
114
+ </tbody>
115
+ <tfoot>
116
+ <tr>
117
+ <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked"
118
+ type="checkbox"></th>
119
+ <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes' ); ?></th>
120
+ </tr>
121
+ </tfoot>
122
+ </table>
123
+ </div>
124
+ </div>
125
+ <div class="sis">
126
+ <div class="regenerate_message"></div>
127
+ <div class="media-item sis">
128
+ <div class="progress">
129
+ <div id="sis_progress-percent" class="percent">100%</div>
130
+ <div class="bar"></div>
131
+ </div>
132
+ </div>
133
+
134
+ <div class="ui-widget time">
135
+ <div class="ui-state-highlight ui-corner-all">
136
+ <p>
137
+ <span class="ui-icon ui-icon-info"></span>
138
+ <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span
139
+ class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ); ?></span> </span>
140
+ </p>
141
+ <ul class="messages"></ul>
142
+ </div>
143
+ </div>
144
+ <div id="error_messages">
145
+ <p>
146
+ <ol class="messages">
147
+ </ol>
148
+ </p>
149
+ </div>
150
+ <div class="thumb"><h4><?php _e( 'Last image:', 'simple-image-sizes' ); ?></h4><img class="thumb-img"/></div>
151
+ <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild"
152
+ value="<?php _e( 'Regenerate Thumbnails', 'simple-image-sizes' ); ?>"/>
153
+ </div>
vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInite8db5e2fa0e66b36b184ae83c72d3132::getLoader();
vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+ private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
+
60
+ public function getPrefixes()
61
+ {
62
+ if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
64
+ }
65
+
66
+ return array();
67
+ }
68
+
69
+ public function getPrefixesPsr4()
70
+ {
71
+ return $this->prefixDirsPsr4;
72
+ }
73
+
74
+ public function getFallbackDirs()
75
+ {
76
+ return $this->fallbackDirsPsr0;
77
+ }
78
+
79
+ public function getFallbackDirsPsr4()
80
+ {
81
+ return $this->fallbackDirsPsr4;
82
+ }
83
+
84
+ public function getClassMap()
85
+ {
86
+ return $this->classMap;
87
+ }
88
+
89
+ /**
90
+ * @param array $classMap Class to filename map
91
+ */
92
+ public function addClassMap(array $classMap)
93
+ {
94
+ if ($this->classMap) {
95
+ $this->classMap = array_merge($this->classMap, $classMap);
96
+ } else {
97
+ $this->classMap = $classMap;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Registers a set of PSR-0 directories for a given prefix, either
103
+ * appending or prepending to the ones previously set for this prefix.
104
+ *
105
+ * @param string $prefix The prefix
106
+ * @param array|string $paths The PSR-0 root directories
107
+ * @param bool $prepend Whether to prepend the directories
108
+ */
109
+ public function add($prefix, $paths, $prepend = false)
110
+ {
111
+ if (!$prefix) {
112
+ if ($prepend) {
113
+ $this->fallbackDirsPsr0 = array_merge(
114
+ (array) $paths,
115
+ $this->fallbackDirsPsr0
116
+ );
117
+ } else {
118
+ $this->fallbackDirsPsr0 = array_merge(
119
+ $this->fallbackDirsPsr0,
120
+ (array) $paths
121
+ );
122
+ }
123
+
124
+ return;
125
+ }
126
+
127
+ $first = $prefix[0];
128
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
+
131
+ return;
132
+ }
133
+ if ($prepend) {
134
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
135
+ (array) $paths,
136
+ $this->prefixesPsr0[$first][$prefix]
137
+ );
138
+ } else {
139
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
140
+ $this->prefixesPsr0[$first][$prefix],
141
+ (array) $paths
142
+ );
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Registers a set of PSR-4 directories for a given namespace, either
148
+ * appending or prepending to the ones previously set for this namespace.
149
+ *
150
+ * @param string $prefix The prefix/namespace, with trailing '\\'
151
+ * @param array|string $paths The PSR-4 base directories
152
+ * @param bool $prepend Whether to prepend the directories
153
+ *
154
+ * @throws \InvalidArgumentException
155
+ */
156
+ public function addPsr4($prefix, $paths, $prepend = false)
157
+ {
158
+ if (!$prefix) {
159
+ // Register directories for the root namespace.
160
+ if ($prepend) {
161
+ $this->fallbackDirsPsr4 = array_merge(
162
+ (array) $paths,
163
+ $this->fallbackDirsPsr4
164
+ );
165
+ } else {
166
+ $this->fallbackDirsPsr4 = array_merge(
167
+ $this->fallbackDirsPsr4,
168
+ (array) $paths
169
+ );
170
+ }
171
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
+ // Register directories for a new namespace.
173
+ $length = strlen($prefix);
174
+ if ('\\' !== $prefix[$length - 1]) {
175
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
+ }
177
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
+ } elseif ($prepend) {
180
+ // Prepend directories for an already registered namespace.
181
+ $this->prefixDirsPsr4[$prefix] = array_merge(
182
+ (array) $paths,
183
+ $this->prefixDirsPsr4[$prefix]
184
+ );
185
+ } else {
186
+ // Append directories for an already registered namespace.
187
+ $this->prefixDirsPsr4[$prefix] = array_merge(
188
+ $this->prefixDirsPsr4[$prefix],
189
+ (array) $paths
190
+ );
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Registers a set of PSR-0 directories for a given prefix,
196
+ * replacing any others previously set for this prefix.
197
+ *
198
+ * @param string $prefix The prefix
199
+ * @param array|string $paths The PSR-0 base directories
200
+ */
201
+ public function set($prefix, $paths)
202
+ {
203
+ if (!$prefix) {
204
+ $this->fallbackDirsPsr0 = (array) $paths;
205
+ } else {
206
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Registers a set of PSR-4 directories for a given namespace,
212
+ * replacing any others previously set for this namespace.
213
+ *
214
+ * @param string $prefix The prefix/namespace, with trailing '\\'
215
+ * @param array|string $paths The PSR-4 base directories
216
+ *
217
+ * @throws \InvalidArgumentException
218
+ */
219
+ public function setPsr4($prefix, $paths)
220
+ {
221
+ if (!$prefix) {
222
+ $this->fallbackDirsPsr4 = (array) $paths;
223
+ } else {
224
+ $length = strlen($prefix);
225
+ if ('\\' !== $prefix[$length - 1]) {
226
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
+ }
228
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Turns on searching the include path for class files.
235
+ *
236
+ * @param bool $useIncludePath
237
+ */
238
+ public function setUseIncludePath($useIncludePath)
239
+ {
240
+ $this->useIncludePath = $useIncludePath;
241
+ }
242
+
243
+ /**
244
+ * Can be used to check if the autoloader uses the include path to check
245
+ * for classes.
246
+ *
247
+ * @return bool
248
+ */
249
+ public function getUseIncludePath()
250
+ {
251
+ return $this->useIncludePath;
252
+ }
253
+
254
+ /**
255
+ * Turns off searching the prefix and fallback directories for classes
256
+ * that have not been registered with the class map.
257
+ *
258
+ * @param bool $classMapAuthoritative
259
+ */
260
+ public function setClassMapAuthoritative($classMapAuthoritative)
261
+ {
262
+ $this->classMapAuthoritative = $classMapAuthoritative;
263
+ }
264
+
265
+ /**
266
+ * Should class lookup fail if not found in the current class map?
267
+ *
268
+ * @return bool
269
+ */
270
+ public function isClassMapAuthoritative()
271
+ {
272
+ return $this->classMapAuthoritative;
273
+ }
274
+
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
+ /**
296
+ * Registers this instance as an autoloader.
297
+ *
298
+ * @param bool $prepend Whether to prepend the autoloader or not
299
+ */
300
+ public function register($prepend = false)
301
+ {
302
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
+ }
304
+
305
+ /**
306
+ * Unregisters this instance as an autoloader.
307
+ */
308
+ public function unregister()
309
+ {
310
+ spl_autoload_unregister(array($this, 'loadClass'));
311
+ }
312
+
313
+ /**
314
+ * Loads the given class or interface.
315
+ *
316
+ * @param string $class The name of the class
317
+ * @return bool|null True if loaded, null otherwise
318
+ */
319
+ public function loadClass($class)
320
+ {
321
+ if ($file = $this->findFile($class)) {
322
+ includeFile($file);
323
+
324
+ return true;
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Finds the path to the file where the class is defined.
330
+ *
331
+ * @param string $class The name of the class
332
+ *
333
+ * @return string|false The path if found, false otherwise
334
+ */
335
+ public function findFile($class)
336
+ {
337
+ // class map lookup
338
+ if (isset($this->classMap[$class])) {
339
+ return $this->classMap[$class];
340
+ }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
+ return false;
343
+ }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
+
351
+ $file = $this->findFileWithExtension($class, '.php');
352
+
353
+ // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
+ $file = $this->findFileWithExtension($class, '.hh');
356
+ }
357
+
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
+ // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
+ }
366
+
367
+ return $file;
368
+ }
369
+
370
+ private function findFileWithExtension($class, $ext)
371
+ {
372
+ // PSR-4 lookup
373
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
+
375
+ $first = $class[0];
376
+ if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath . '\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
+ if (file_exists($file = $dir . $pathEnd)) {
385
+ return $file;
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+
392
+ // PSR-4 fallback dirs
393
+ foreach ($this->fallbackDirsPsr4 as $dir) {
394
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
+ return $file;
396
+ }
397
+ }
398
+
399
+ // PSR-0 lookup
400
+ if (false !== $pos = strrpos($class, '\\')) {
401
+ // namespaced class name
402
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
+ } else {
405
+ // PEAR-like class name
406
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
+ }
408
+
409
+ if (isset($this->prefixesPsr0[$first])) {
410
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
+ if (0 === strpos($class, $prefix)) {
412
+ foreach ($dirs as $dir) {
413
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
+ return $file;
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ // PSR-0 fallback dirs
422
+ foreach ($this->fallbackDirsPsr0 as $dir) {
423
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
+ return $file;
425
+ }
426
+ }
427
+
428
+ // PSR-0 include paths.
429
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
+ return $file;
431
+ }
432
+
433
+ return false;
434
+ }
435
+ }
436
+
437
+ /**
438
+ * Scope isolated include.
439
+ *
440
+ * Prevents access to $this/self from included files.
441
+ */
442
+ function includeFile($file)
443
+ {
444
+ include $file;
445
+ }
vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'Rahe\\Simple_Image_Sizes\\Admin\\Main' => $baseDir . '/classes/admin/Main.php',
10
+ 'Rahe\\Simple_Image_Sizes\\Admin\\Media' => $baseDir . '/classes/admin/Media.php',
11
+ 'Rahe\\Simple_Image_Sizes\\Admin\\Post' => $baseDir . '/classes/admin/Post.php',
12
+ 'Rahe\\Simple_Image_Sizes\\Main' => $baseDir . '/classes/Main.php',
13
+ );
vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'Rahe\\Simple_Image_Sizes\\' => array($baseDir . '/classes'),
10
+ );
vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInite8db5e2fa0e66b36b184ae83c72d3132
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ public static function getLoader()
17
+ {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInite8db5e2fa0e66b36b184ae83c72d3132', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInite8db5e2fa0e66b36b184ae83c72d3132', 'loadClassLoader'));
25
+
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
+ if ($useStaticLoader) {
28
+ require_once __DIR__ . '/autoload_static.php';
29
+
30
+ call_user_func(\Composer\Autoload\ComposerStaticInite8db5e2fa0e66b36b184ae83c72d3132::getInitializer($loader));
31
+ } else {
32
+ $map = require __DIR__ . '/autoload_namespaces.php';
33
+ foreach ($map as $namespace => $path) {
34
+ $loader->set($namespace, $path);
35
+ }
36
+
37
+ $map = require __DIR__ . '/autoload_psr4.php';
38
+ foreach ($map as $namespace => $path) {
39
+ $loader->setPsr4($namespace, $path);
40
+ }
41
+
42
+ $classMap = require __DIR__ . '/autoload_classmap.php';
43
+ if ($classMap) {
44
+ $loader->addClassMap($classMap);
45
+ }
46
+ }
47
+
48
+ $loader->register(true);
49
+
50
+ return $loader;
51
+ }
52
+ }
vendor/composer/autoload_static.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_static.php @generated by Composer
4
+
5
+ namespace Composer\Autoload;
6
+
7
+ class ComposerStaticInite8db5e2fa0e66b36b184ae83c72d3132
8
+ {
9
+ public static $prefixLengthsPsr4 = array (
10
+ 'R' =>
11
+ array (
12
+ 'Rahe\\Simple_Image_Sizes\\' => 24,
13
+ ),
14
+ );
15
+
16
+ public static $prefixDirsPsr4 = array (
17
+ 'Rahe\\Simple_Image_Sizes\\' =>
18
+ array (
19
+ 0 => __DIR__ . '/../..' . '/classes',
20
+ ),
21
+ );
22
+
23
+ public static $classMap = array (
24
+ 'Rahe\\Simple_Image_Sizes\\Admin\\Main' => __DIR__ . '/../..' . '/classes/admin/Main.php',
25
+ 'Rahe\\Simple_Image_Sizes\\Admin\\Media' => __DIR__ . '/../..' . '/classes/admin/Media.php',
26
+ 'Rahe\\Simple_Image_Sizes\\Admin\\Post' => __DIR__ . '/../..' . '/classes/admin/Post.php',
27
+ 'Rahe\\Simple_Image_Sizes\\Main' => __DIR__ . '/../..' . '/classes/Main.php',
28
+ );
29
+
30
+ public static function getInitializer(ClassLoader $loader)
31
+ {
32
+ return \Closure::bind(function () use ($loader) {
33
+ $loader->prefixLengthsPsr4 = ComposerStaticInite8db5e2fa0e66b36b184ae83c72d3132::$prefixLengthsPsr4;
34
+ $loader->prefixDirsPsr4 = ComposerStaticInite8db5e2fa0e66b36b184ae83c72d3132::$prefixDirsPsr4;
35
+ $loader->classMap = ComposerStaticInite8db5e2fa0e66b36b184ae83c72d3132::$classMap;
36
+
37
+ }, null, ClassLoader::class);
38
+ }
39
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1 @@
 
1
+ []