Simple Image Sizes - Version V2.3

Version Description

Download this release

Release Info

Developer Rahe
Plugin Icon wp plugin Simple Image Sizes
Version V2.3
Comparing to
See all releases

Code changes from version 3.2.0 to V2.3

Files changed (53) hide show
  1. .gitignore +0 -164
  2. README +0 -0
  3. assets/css/sis-style.css +0 -62
  4. assets/css/sis-style.min.css +0 -1
  5. assets/js/dist/app.js +0 -785
  6. assets/js/dist/app.js.map +0 -12
  7. assets/js/dist/app.min.js +0 -7
  8. assets/js/dist/app.min.js.map +0 -12
  9. assets/js/src/attachments.js +0 -108
  10. assets/js/src/featured.js +0 -70
  11. assets/js/src/sis.js +0 -602
  12. classes/admin/main.php +0 -320
  13. classes/admin/media.php +0 -547
  14. classes/admin/post.php +0 -269
  15. classes/main.php +0 -57
  16. css/Aristo/images/bg_fallback.png +0 -0
  17. css/Aristo/images/icon_sprite.png +0 -0
  18. css/Aristo/images/progress_bar.gif +0 -0
  19. css/Aristo/images/slider_handles.png +0 -0
  20. css/Aristo/images/ui-icons_222222_256x240.png +0 -0
  21. css/Aristo/images/ui-icons_454545_256x240.png +0 -0
  22. css/Aristo/jquery-ui-1.8.7.custom.css +740 -0
  23. css/sis-style.css +70 -0
  24. gulpfile.js +0 -40
  25. inc/class.admin.php +803 -0
  26. inc/class.client.php +36 -0
  27. js/jquery-ui-1.8.16.custom.min.js +77 -0
  28. js/sis-attachments.js +60 -0
  29. js/sis-attachments.min.js +2 -0
  30. js/sis.js +685 -0
  31. js/sis.min.js +24 -0
  32. languages/simple-image-sizes-de_DE.mo +0 -0
  33. languages/simple-image-sizes-de_DE.po +0 -367
  34. languages/simple-image-sizes-fr_FR.mo +0 -0
  35. languages/simple-image-sizes-fr_FR.po +0 -324
  36. languages/simple-image-sizes-he_IL.mo +0 -0
  37. languages/simple-image-sizes-he_IL.po +0 -471
  38. languages/simple-image-sizes.pot +0 -274
  39. languages/sis-de_DE.mo +0 -0
  40. languages/sis-de_DE.po +373 -0
  41. languages/sis-fr_FR.mo +0 -0
  42. languages/sis-fr_FR.po +252 -0
  43. languages/sis.pot +211 -0
  44. package.json +0 -22
  45. readme.md +0 -221
  46. readme.txt +5 -84
  47. screenshot-1.png +0 -0
  48. screenshot-2.png +0 -0
  49. screenshot-3.png +0 -0
  50. screenshot-4.png +0 -0
  51. simple_image_sizes.php +22 -36
  52. templates/admin-js.html +0 -45
  53. templates/options-media.php +0 -153
.gitignore DELETED
@@ -1,164 +0,0 @@
1
- #################
2
- ## Eclipse
3
- #################
4
-
5
- *.pydevproject
6
- .project
7
- .metadata
8
- bin/
9
- tmp/
10
- *.tmp
11
- *.bak
12
- *.swp
13
- *~.nib
14
- local.properties
15
- .classpath
16
- .settings/
17
- .loadpath
18
-
19
- # External tool builders
20
- .externalToolBuilders/
21
-
22
- # Locally stored "Eclipse launch configurations"
23
- *.launch
24
-
25
- # CDT-specific
26
- .cproject
27
-
28
- # PDT-specific
29
- .buildpath
30
-
31
-
32
- #################
33
- ## Visual Studio
34
- #################
35
-
36
- ## Ignore Visual Studio temporary files, build results, and
37
- ## files generated by popular Visual Studio add-ons.
38
-
39
- # User-specific files
40
- *.suo
41
- *.user
42
- *.sln.docstates
43
-
44
- # Build results
45
- [Dd]ebug/
46
- [Rr]elease/
47
- *_i.c
48
- *_p.c
49
- *.ilk
50
- *.meta
51
- *.obj
52
- *.pch
53
- *.pdb
54
- *.pgc
55
- *.pgd
56
- *.rsp
57
- *.sbr
58
- *.tlb
59
- *.tli
60
- *.tlh
61
- *.tmp
62
- *.vspscc
63
- .builds
64
- *.dotCover
65
-
66
- ## TODO: If you have NuGet Package Restore enabled, uncomment this
67
- #packages/
68
-
69
- # Visual C++ cache files
70
- ipch/
71
- *.aps
72
- *.ncb
73
- *.opensdf
74
- *.sdf
75
-
76
- # Visual Studio profiler
77
- *.psess
78
- *.vsp
79
-
80
- # ReSharper is a .NET coding add-in
81
- _ReSharper*
82
-
83
- # Installshield output folder
84
- [Ee]xpress
85
-
86
- # DocProject is a documentation generator add-in
87
- DocProject/buildhelp/
88
- DocProject/Help/*.HxT
89
- DocProject/Help/*.HxC
90
- DocProject/Help/*.hhc
91
- DocProject/Help/*.hhk
92
- DocProject/Help/*.hhp
93
- DocProject/Help/Html2
94
- DocProject/Help/html
95
-
96
- # Click-Once directory
97
- publish
98
-
99
- # Others
100
- [Bb]in
101
- [Oo]bj
102
- sql
103
- TestResults
104
- *.Cache
105
- ClientBin
106
- stylecop.*
107
- ~$*
108
- *.dbmdl
109
- Generated_Code #added for RIA/Silverlight projects
110
-
111
- # Backup & report files from converting an old project file to a newer
112
- # Visual Studio version. Backup files are not needed, because we have git ;-)
113
- _UpgradeReport_Files/
114
- Backup*/
115
- UpgradeLog*.XML
116
-
117
-
118
-
119
- ############
120
- ## Windows
121
- ############
122
-
123
- # Windows image file caches
124
- Thumbs.db
125
-
126
- # Folder config file
127
- Desktop.ini
128
-
129
-
130
- #############
131
- ## Python
132
- #############
133
-
134
- *.py[co]
135
-
136
- # Packages
137
- *.egg
138
- *.egg-info
139
- build
140
- eggs
141
- parts
142
- bin
143
- var
144
- sdist
145
- develop-eggs
146
- .installed.cfg
147
-
148
- # Installer logs
149
- pip-log.txt
150
-
151
- # Unit test / coverage reports
152
- .coverage
153
- .tox
154
-
155
- #Mr Developer
156
- .mr.developer.cfg
157
-
158
- # Mac crap
159
- .DS_Store
160
-
161
- .settings
162
-
163
- #Grunt
164
- node_modules/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README ADDED
File without changes
assets/css/sis-style.css DELETED
@@ -1,62 +0,0 @@
1
- .media-item.sis {
2
- display: none;
3
- }
4
- .media-item.sis .progress {
5
- width: 100%;
6
- }
7
- input.h, input.w {
8
- border-color: #DFDFDF;
9
- background-color: white;
10
- border-width: 1px;
11
- border-style: solid;
12
- -moz-border-radius: 3px;
13
- -khtml-border-radius: 3px;
14
- -webkit-border-radius: 3px;
15
- border-radius: 3px;
16
- }
17
- table.sis tr {
18
- -webkit-transition: all .5s ease-in-out;
19
- -moz-transition: all .5s ease-in-out;
20
- -o-transition: all .5s ease-in-out;
21
- transition: all .5s ease-in-out;
22
- }
23
- table.sis tr:nth-child(even) {
24
- background-color: #FCFCFC;
25
- }
26
- table.sis tr:nth-child(odd) {
27
- background-color: transparent;
28
- }
29
- tr.addPending {
30
- background-color: #6CA1D7;
31
- }
32
- tr.successAdding {
33
- background-color: #89D76A;
34
- }
35
- tr.errorAdding {
36
- background-color: #C45858;
37
- }
38
- tr.notChangedAdding {
39
- background-color: #F2A13A;
40
- }
41
- .sis .regenerate_message,
42
- .sis .time,
43
- .sis .thumb {
44
- display: none;
45
- }
46
-
47
- #ajax_thumbnail_rebuild {
48
- margin-top: 40px;
49
- }
50
- #sis_progress-percent {
51
- width: 100%;
52
- text-align: center;
53
- font-weight: bold;
54
- }
55
-
56
- .sis .time .ui-state-highlight{
57
- margin-top: 20px;
58
- padding: 0 .7em;
59
- }
60
- #post-body .sis-regenerate-one{
61
- float:left;
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/sis-style.min.css DELETED
@@ -1 +0,0 @@
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}
 
assets/js/dist/app.js DELETED
@@ -1,785 +0,0 @@
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(function (i) {
54
- self.thumbnails.push(this.value);
55
- });
56
- }
57
- },
58
- getPostTypes: function () {
59
- var self = this,
60
- inputs = jQuery('input.post_types:checked');
61
-
62
- // Get the checked post Types inputs
63
- if (inputs.length != jQuery('input.post_types[type="checkbox"]').length) {
64
- inputs.each(function () {
65
- self.post_types.push(this.value);
66
- });
67
- }
68
- },
69
- setMessage: function (msg) {
70
- // Display the message
71
- this.messageZone.html("<p>" + msg + "</p>").addClass('updated').addClass('fade').show();
72
- },
73
- setTimeMessage: function (msg) {
74
- this.timeZone.html(msg);
75
- },
76
- checkStartRegenerating: function () {
77
- if (jQuery('.notSaved').size() > 0) {
78
- var confirmation = confirm(sis.notSaved);
79
-
80
- // Delete if ok else not delete
81
- if (confirmation == true) {
82
- this.startRegenerating();
83
- } else {
84
- return false;
85
- }
86
- } else {
87
- this.startRegenerating();
88
- }
89
- },
90
- startRegenerating: function () {
91
- var self = this,
92
- wp_nonce = jQuery('input.getList').val();
93
-
94
- // Get the humbnails and post types
95
- self.getThumbnails();
96
- self.getPostTypes();
97
-
98
- this.dateScript = new Date();
99
- // Start ajax
100
- jQuery.ajax({
101
- url: ajaxurl,
102
- type: "POST",
103
- dataType: 'json',
104
- data: {
105
- action: 'sis_get_list',
106
- post_types: self.post_types,
107
- nonce: wp_nonce
108
- },
109
- beforeSend: function () {
110
-
111
- // Disable the button
112
- self.buttonRegenerate.attr("disabled", true);
113
- // Display the message
114
- self.setMessage(sis.reading);
115
-
116
- },
117
- success: function (r) {
118
-
119
- if (typeof r !== 'object') {
120
- self.reInit();
121
- self.setMessage(sis.phpError);
122
- return false;
123
- }
124
-
125
- self.time.show();
126
-
127
- // Eval the response
128
- self.total = r.total;
129
-
130
- // Set the current to 0
131
- self.curr = 0;
132
-
133
- // Display the progress Bar
134
- self.progress.show().parent().show();
135
-
136
- // Start Regenerating
137
- self.regenItem();
138
- }
139
- });
140
- },
141
- regenItem: function () {
142
- var self = this,
143
- wp_nonce = jQuery('input.regen').val();
144
-
145
- // If the list is empty display the message of emptyness and reinitialize the form
146
- if (this.total == 0 || _.isUndefined(this.total)) {
147
- this.reInit();
148
- this.setMessage(sis.noMedia);
149
- return false;
150
- }
151
-
152
- // If we have finished the regeneration display message and init again
153
- if (this.curr >= this.total) {
154
- var now = new Date();
155
- this.reInit();
156
- 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());
157
- return;
158
- }
159
-
160
- // Set the message of current image regenerating
161
- this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
162
- this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
163
-
164
- jQuery.ajax({
165
- url: ajaxurl,
166
- type: "POST",
167
- dataType: 'json',
168
- data: {
169
- action: 'sis_rebuild_images',
170
- offset: this.curr,
171
- thumbnails: this.thumbnails,
172
- nonce: wp_nonce
173
- },
174
- beforeSend: function () {
175
- // Calculate the percentage of regeneration
176
- self.percent = ( self.curr / self.total ) * 100;
177
-
178
- // Change the progression
179
- self.progress.find('.bar').width(self.percent + '%')
180
- .find('.percent').html(self.percent + '%');
181
-
182
- // Change the text of progression
183
- self.percentText.removeClass('hidden').html(Math.round(self.percent) + "%");
184
- },
185
- success: function (r) {
186
- // Check if error or a message in response
187
- if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
188
- var message = '';
189
- if (typeof r !== 'object') {
190
- message = sis.phpError;
191
- } else {
192
- message = r.error
193
- }
194
-
195
- self.errorZone.addClass('error message');
196
- self.errorMessages.prepend('<li>' + message + '</li>');
197
- } else {
198
-
199
- // Append a message if needed
200
- if (r.message) {
201
- self.time.find('ul.messages').prepend('<li>' + r.message + '</li>');
202
- }
203
-
204
- // Display the image
205
- self.thumb.show();
206
-
207
- // Change his attribute
208
- self.thumbImg.attr("src", r.src);
209
-
210
- // Actual time
211
- var dateEnd = new Date(),
212
- curDate = new Date(),
213
- num = 0,
214
- sum = 0,
215
- i = 0,
216
- ave = 0,
217
- time = '';
218
-
219
- // Add the regenerating time to the array
220
- self.timeScript.push(parseFloat(r.time.replace(',', '.'), 10));
221
-
222
- // Get the number of elements in array
223
- num = self.timeScript.length;
224
-
225
- // Make the sum of the times
226
- for (i; i < num; i++) {
227
- sum += self.timeScript[i];
228
- }
229
-
230
- // Make the average value of the regenerating time
231
- ave = sum / num;
232
-
233
- // Round the value in miliseconds and add 25% or error
234
- t = Math.round(( ( ave * self.total ) * 1000 ));
235
-
236
- // Set the predicted time
237
- dateEnd.setTime(self.dateScript.getTime() + t);
238
-
239
- // Get the difference between the two dates
240
- time = self.s2t(Math.abs(( dateEnd.getTime() - curDate.getTime() )) / 1000);
241
-
242
- // Set the message in the notice box
243
- self.setTimeMessage(dateEnd.getHours() + ":" + dateEnd.getMinutes() + ":" + dateEnd.getSeconds() + sis.or + time + sis.beforeEnd);
244
- }
245
-
246
- // Inscrease the counter and regene the next item
247
- self.curr++;
248
- self.regenItem();
249
- }
250
- });
251
-
252
- },
253
- s2t: function (secs) {
254
- var secs = secs % 86400,
255
- t = new Date(1970, 0, 1),
256
- s = 0;
257
-
258
- t.setSeconds(secs);
259
- s = t.toTimeString().substr(0, 8);
260
- if (secs > 86399) {
261
- s = Math.floor(( t - Date.parse("1/1/70") ) / 3600000) + s.substr(2);
262
- }
263
- return s;
264
- },
265
- reInit: function () {
266
- // Re initilize the form
267
- this.buttonRegenerate.removeAttr("disabled");
268
- this.thumb.hide();
269
- this.progress.hide();
270
- this.percentText.addClass('hidden');
271
- }
272
- };
273
-
274
- rahe.sis.sizes = {
275
- i: 0,
276
- add: function (e, el) {
277
- e.preventDefault();
278
-
279
- // Create the template
280
- var elTr = rahe.sis.template('new_size');
281
- elTr = elTr({
282
- size_id: this.i,
283
- validate: sis.validate
284
- });
285
-
286
- // Add the form for editing
287
- jQuery(el).closest('tr').before(elTr);
288
-
289
- // Inscrease the identifier
290
- this.i++;
291
- },
292
- register: function (e, el) {
293
- // Stop propagation
294
- e.preventDefault();
295
-
296
- // Get name and id
297
- var name = jQuery(el).closest('tr').children('th').find('input').val(),
298
- id = jQuery(el).closest('tr').children('th').find('input').attr('id'),
299
-
300
- // Get the number of elements with this name
301
- checkPresent = jQuery(el).closest('tbody').find('input[value="' + name + '"]').length;
302
-
303
- // Check if not basic size or already present, display message
304
- if (name == 'thumbnail' || name == "medium" || name == "large") {
305
- alert(sis.notOriginal);
306
- return false;
307
- } else if (checkPresent != 0) {
308
- alert(sis.alreadyPresent);
309
- return false;
310
- }
311
-
312
- var row = rahe.sis.template('new_size_row');
313
-
314
- row = row({
315
- size: sis.size,
316
- size_name: name,
317
- maximumWidth: sis.maximumWidth,
318
- maximumHeight: sis.maximumHeight,
319
- customName: sis.customName,
320
- crop: sis.crop,
321
- crop_positions: sis.crop_positions,
322
- show: sis.show,
323
- deleteImage: sis.deleteImage,
324
- validateButton: sis.validateButton
325
- });
326
-
327
- // Add the row to the current list
328
- jQuery('#' + id).closest('tr').html(row);
329
- },
330
- deleteSize: function (e, el) {
331
- e.preventDefault();
332
- // Check if user want to delete or not
333
- var confirmation = confirm(sis.confirmDelete);
334
-
335
- // Delete if ok else not delete
336
- if (confirmation == true) {
337
- // Remove from the list and the array
338
- jQuery(el).closest('tr').remove();
339
- this.ajaxUnregister(el);
340
- }
341
- },
342
- getPhp: function (e, el) {
343
- e.preventDefault();
344
- // Get parent element
345
- var parent = jQuery(el).closest('tr');
346
-
347
- jQuery.ajax({
348
- url: ajaxurl,
349
- type: "POST",
350
- data: {action: "sis_get_sizes"},
351
- beforeSend: function () {
352
- // Remove classes of status
353
- parent.removeClass('addPending');
354
- parent.addClass('addPending');
355
- },
356
- success: function (result) {
357
- // Add the classes for the status
358
- jQuery('#get_php').nextAll('code').html('<br />' + result).show().css({'display': 'block'});
359
- parent.removeClass('addPending');
360
- }
361
- });
362
- },
363
- ajaxRegister: function (e, el) {
364
- e.preventDefault();
365
-
366
- // Get the vars
367
- var self = this,
368
- parentTable = jQuery(el).closest('table'),
369
- timer,
370
- wp_nonce = jQuery('.addSize').val(),
371
- parent = jQuery(el).closest('tr'),
372
- n = parent.find('input[name="image_name"]').val(),
373
- c = parent.find('select.crop').val(),
374
- s = parent.find('input.show').val(),
375
- cn = parent.find('input.n').val(),
376
- h = 0,
377
- w = 0;
378
- s = ( s == false || s == undefined ) ? false : true;
379
- w = parseInt(parent.find('input.w').val());
380
- h = parseInt(parent.find('input.h').val());
381
-
382
- if (!parentTable.hasClass('ajaxing')) {
383
- jQuery.ajax({
384
- url: ajaxurl,
385
- type: "POST",
386
- dataType: 'json',
387
- data: {
388
- action: "sis_add_size",
389
- width: w,
390
- height: h,
391
- crop: c,
392
- name: n,
393
- show: s,
394
- customName: cn,
395
- nonce: wp_nonce
396
- },
397
- beforeSend: function () {
398
- // Remove status and set pending
399
- parent.removeClass();
400
- parent.addClass('addPending');
401
- parentTable.addClass('ajaxing');
402
- },
403
- success: function (result) {
404
- // Set basic class and remove pending
405
- var classTr = '';
406
- parent.removeClass();
407
- parentTable.removeClass('ajaxing');
408
-
409
- // Check the result for the different messages
410
- if (result == 0) {
411
- classTr = 'errorAdding';
412
- } else if (result == 2) {
413
- classTr = 'notChangedAdding';
414
-
415
- // add/update to the array with the status class
416
- self.addToArray(n, w, h, c, classTr);
417
- } else {
418
- classTr = 'successAdding';
419
-
420
- // add/update to the array with the status class
421
- self.addToArray(n, w, h, c, classTr);
422
- }
423
-
424
- // Add the new sizes values for checking of changed or not
425
- parent.find('input.h').attr({base_h: h});
426
- parent.find('input.w').attr({base_w: w});
427
- parent.find('select.c').attr({base_c: c});
428
- parent.find('input.s').attr({base_s: s});
429
-
430
- // Add the generated class
431
- parent.addClass(classTr);
432
- parent.find('td').removeClass("notSaved");
433
-
434
- // Change the button text
435
- parent.find('.add_size').removeClass('validate_size').hide().children('.ui-button-text').text(sis.update);
436
-
437
- clearTimeout(timer);
438
- // Remove classes after 3 seconds
439
- timer = setTimeout(function () {
440
- parent.removeClass('errorAdding notChangedAdding successAdding');
441
- }, 2 * 1000);
442
- }
443
- });
444
- }
445
- },
446
- ajaxUnregister: function (el) {
447
- // Get name and self object
448
- var self = this,
449
- n = jQuery(el).closest('tr').find('input[name="image_name"]').val(),
450
- wp_nonce = jQuery(el).closest('tr').find('input.deleteSize').val();
451
-
452
- // Make the ajax call
453
- jQuery.ajax({
454
- url: ajaxurl,
455
- type: "POST",
456
- data: {action: "sis_remove_size", name: n, nonce: wp_nonce},
457
- success: function (result) {
458
- self.removeFromArray(el);
459
- }
460
- });
461
- },
462
- addToArray: function (n, w, h, c, s) {
463
- // Get the row for editing or updating
464
- var testRow = jQuery('#sis-' + n),
465
- newRow = '',
466
- timer;
467
-
468
- // Get the right newRow, updating or adding ?
469
- if (testRow.length != 0) {
470
- newRow = testRow.closest('tr');
471
- } else {
472
- newRow = jQuery('#sis-regen .wrapper > table#sis_sizes > tbody > tr:first').clone().attr('id', 'sis-' + n);
473
- }
474
-
475
- c = !_.isUndefined(sis.crop_positions[c]) ? sis.crop_positions[c] : sis.fl;
476
-
477
- // Set the datas with the given datas
478
- newRow.find('th > label').attr('for', n)
479
- .end()
480
- .find('input.thumbnails').val(n).attr('id', n)
481
- .end()
482
- .find('th:nth-child(2) > label').text(n)
483
- .end()
484
- .find('th:nth-child(3) > label').text(w + 'px')
485
- .end()
486
- .find('th:nth-child(4) > label').text(h + 'px')
487
- .end()
488
- .find('th:nth-child(5) > label').text(c);
489
-
490
- // If new then add the row
491
- if (testRow.length == 0) {
492
- newRow.appendTo('#sis-regen .wrapper > table#sis_sizes > tbody');
493
- }
494
-
495
- // Remove the previous status classes and add the status class
496
- newRow.removeClass('errorAdding notChangedAdding successAdding').addClass(s);
497
-
498
- clearTimeout(timer);
499
- // Remove the statuses classes
500
- timer = setTimeout(function () {
501
- newRow.removeClass('errorAdding notChangedAdding successAdding');
502
- }, 3 * 1000);
503
- },
504
- removeFromArray: function (el) {
505
- // get the name
506
- var n = jQuery(el).closest('tr').find('input[name=image_name]').val();
507
-
508
- // Remove the given name from the array
509
- jQuery('#sis-' + n).remove();
510
- },
511
- displayChange: function (el) {
512
- var el = jQuery(el),
513
- parent = el.closest('tr');
514
-
515
- // Check not new size
516
- if (parent.hasClass('new_size')) {
517
- return false;
518
- }
519
-
520
- var h_el = parent.find('input.h'),
521
- w_el = parent.find('input.w'),
522
- c_el = parent.find('select.c'),
523
- s_el = parent.find('input.s'),
524
- n_el = parent.find('input.n'),
525
-
526
- h = h_el.val(),
527
- w = w_el.val(),
528
- c = c_el.val(),
529
- s = s_el.val(),
530
- n = n_el.val(),
531
-
532
- base_h = h_el.attr('base_h'),
533
- base_w = w_el.attr('base_w'),
534
- base_c = c_el.attr('base_c'),
535
- base_s = s_el.attr('base_s'),
536
- base_n = n_el.attr('base_n');
537
-
538
-
539
- base_c = base_c == '0' ? false : true;
540
- base_s = base_s == '0' ? false : true;
541
-
542
- if (h != base_h || w != base_w || c != base_c || s != base_s || n != base_n) {
543
- el.closest('td').addClass('notSaved').find('.add_size').css('display', 'inline-block');
544
- } else {
545
- el.closest('td').removeClass('notSaved').find('.add_size').css('display', 'none');
546
- }
547
- }
548
- };
549
-
550
- rahe.sis.template = _.memoize(function (id) {
551
- var compiled,
552
- options = {
553
- evaluate: /<#([\s\S]+?)#>/g,
554
- interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
555
- escape: /\{\{([^\}]+?)\}\}(?!\})/g,
556
- variable: 'data'
557
- };
558
-
559
- return function (data) {
560
- compiled = compiled || _.template(jQuery('#sis-' + id).html(), null, options);
561
- return compiled(data);
562
- };
563
- });
564
-
565
- jQuery(function () {
566
- rahe.sis.regenerate.init();
567
- var bodyContent = jQuery('#wpbody-content');
568
- // Regeneration listener
569
- jQuery('#ajax_thumbnail_rebuild').click(function () {
570
- rahe.sis.regenerate.checkStartRegenerating();
571
- });
572
-
573
- // Add size button listener
574
- bodyContent.on('click', '#add_size', function (e) {
575
- rahe.sis.sizes.add(e, this);
576
- })
577
-
578
- // Registering a new size listener
579
- .on('click', '.add_size_name', function (e) {
580
- rahe.sis.sizes.register(e, this);
581
- })
582
-
583
- // Delete and Adding buttons
584
- .on('click', '.delete_size', function (e) {
585
- rahe.sis.sizes.deleteSize(e, this);
586
- })
587
- .on('click', '.add_size', function (e) {
588
- rahe.sis.sizes.ajaxRegister(e, this);
589
- })
590
-
591
- .on('click keyup change', '.h,.w,.c,.s,.n', function (e) {
592
- rahe.sis.sizes.displayChange(this);
593
- })
594
-
595
- // Seup the getphp
596
- .on('click', '#get_php', function (e) {
597
- rahe.sis.sizes.getPhp(e, this)
598
- });
599
- jQuery('#get_php').nextAll('code').hide();
600
-
601
- jQuery(".add_size").hide();
602
- });
603
-
604
- // Functions for the regenerating of images
605
- var sis;
606
- if (!sis) {
607
- sis = {};
608
- } else if (typeof sis !== "object") {
609
- throw new Error('sis already exists and not an object');
610
- }
611
-
612
- jQuery(function () {
613
- 'use strict';
614
- var bdy = jQuery(document.body), SISAttachRegenerate = null, sis_obj = null;
615
- // Add action dinamycally
616
- jQuery('select[name="action"], select[name="action2"]').append(
617
- jQuery('<option/>').attr('value', 'sis-regenerate').text(sis.regenerate)
618
- );
619
-
620
- // Regenerate one element
621
- bdy.on('click', '.sis-regenerate-one', function (e) {
622
- e.preventDefault();
623
- sis_obj = new SISAttachRegenerate(this);
624
- });
625
-
626
- // On bulk actions
627
- jQuery('#doaction, #doaction2').on('click', function (e) {
628
- if (jQuery(this).parent().find('select').val() === 'sis-regenerate') {
629
- // Get checked checkbocxes
630
- var els = jQuery('#the-list .check-column input[type="checkbox"]:checked').closest('tr').find('.sis-regenerate-one');
631
-
632
- // Check there is any elements selected
633
- if (els.length > 0) {
634
-
635
- // Stop default action
636
- e.preventDefault();
637
-
638
- // Make all the selected elements
639
- els.each(function (i, el) {
640
- sis_obj = new SISAttachRegenerate(this);
641
- });
642
- }
643
- }
644
- });
645
-
646
- // Function for regenerating the elements
647
- SISAttachRegenerate = function (el) {
648
- var regenerate = {
649
- list: {},
650
- parent: null,
651
- el: null,
652
- id: null,
653
- messageZone: '',
654
- init: function (el) {
655
- this.el = el;
656
- this.parent = el.closest('tr');
657
- this.id = this.el.data('id');
658
- this.list = {'id': this.id, 'title': ''};
659
- this.messageZone = this.parent.find('.title em');
660
-
661
- if (this.parent.find('.title em').length === 0) {
662
- this.parent.find('.title strong').after('<em/>');
663
- }
664
-
665
- this.messageZone = this.parent.find('.title em');
666
-
667
- if (!this.parent.hasClass('ajaxing')) {
668
- this.regenItem();
669
- }
670
- },
671
- setMessage: function (msg) {
672
- // Display the message
673
- this.messageZone.html(' - ' + msg).addClass('updated').addClass('fade').show();
674
- },
675
- regenItem: function () {
676
- var self = this;
677
-
678
- jQuery.ajax({
679
- url: ajaxurl,
680
- type: "POST",
681
- dataType: 'json',
682
- cache: false,
683
- data: {
684
- action: 'sis_rebuild_image',
685
- id: this.list.id,
686
- nonce: sis.regen_one
687
- },
688
- beforeSend: function () {
689
- self.parent.addClass('ajaxing').find('.sis-regenerate-one').hide().end().find('.spinner').addClass('is-active').show();
690
- self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '0.3');
691
- },
692
- success: function (r) {
693
- var message = '';
694
- // Check if error or a message in response
695
- if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
696
- message = typeof r !== 'object' ? message = sis.phpError : r.error;
697
- } else {
698
- message = sis.soloRegenerated.replace('%s', r.time);
699
- }
700
- self.setMessage(message);
701
- self.parent.removeClass('ajaxing').find('.sis-regenerate-one').show().end().find('.spinner').removeClass('is-active').hide();
702
- self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '1');
703
- }
704
- });
705
- }
706
- };
707
-
708
- // Launch regeneration
709
- regenerate.init(jQuery(el));
710
- };
711
- });
712
-
713
- // Functions for the regenerating of images
714
- var rahe;
715
- if( !rahe ) {
716
- rahe = {};
717
- } else if( typeof rahe !== "object" ) {
718
- throw new Error( 'rahe already exists and not an object' );
719
- }
720
-
721
- if( !rahe.sis ) {
722
- rahe.sis = {};
723
- } else if( typeof rahe.sis !== "object" ) {
724
- throw new Error( 'rahe.sis already exists and not an object' );
725
- }
726
-
727
- rahe.sis.featured = {
728
- messageZone : '',
729
- parent : '',
730
- element : '',
731
- init : function() {
732
- this.element = jQuery( '#sis_featured_regenerate' );
733
- this.parent = this.element.closest( '.inside' );
734
- this.nonce = this.element.attr( 'data-nonce' );
735
- this.id = jQuery( '#post_ID' ).val();
736
-
737
- this.parent.on( 'click', '#sis_featured_regenerate', function ( e ) {
738
- e.preventDefault();
739
- rahe.sis.featured.regenItem();
740
- } );
741
- },
742
- setMessage : function( msg ) {
743
- // Display the message
744
- this.parent.find( '.sis_message' ).html( "<p>" + msg + "</p>" ).show();
745
- },
746
- regenItem : function( ) {
747
- var self = this;
748
-
749
- jQuery.ajax( {
750
- url: ajaxurl,
751
- type: "POST",
752
- dataType: 'json',
753
- cache: false,
754
- data: {
755
- action : 'sis_rebuild_featured',
756
- id : this.id,
757
- nonce : this.nonce
758
- },
759
- beforeSend : function() {
760
- self.parent.find('.spinner').addClass( 'is-active');
761
- self.parent.find( '#sis_featured_regenerate' ).attr( 'disabled', 'disabled' );
762
- },
763
- success: function( r ) {
764
- var message ='';
765
- // Check if error or a message in response
766
- if( !r.time || r.error || typeof r !== 'object' ) {
767
- message = typeof r !== 'object' ? message = sis.phpError : r.error ;
768
- } else {
769
- message = sis.soloRegenerated.replace( '%s', r.time );
770
- }
771
- console.log(message);
772
- self.setMessage( message );
773
-
774
- self.parent.find('.spinner').removeClass( 'is-active');
775
- self.parent.find( '#sis_featured_regenerate' ).removeAttr( 'disabled' );
776
- }
777
- });
778
- }
779
- };
780
-
781
- jQuery(function () {
782
- rahe.sis.featured.init();
783
- } );
784
-
785
- //# sourceMappingURL=app.js.map
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/dist/app.js.map DELETED
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,7 +0,0 @@
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 DELETED
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,108 +0,0 @@
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(function () {
10
- 'use strict';
11
- var bdy = jQuery(document.body), SISAttachRegenerate = null, sis_obj = null;
12
- // Add action dinamycally
13
- jQuery('select[name="action"], select[name="action2"]').append(
14
- jQuery('<option/>').attr('value', 'sis-regenerate').text(sis.regenerate)
15
- );
16
-
17
- // Regenerate one element
18
- bdy.on('click', '.sis-regenerate-one', function (e) {
19
- e.preventDefault();
20
- sis_obj = new SISAttachRegenerate(this);
21
- });
22
-
23
- // On bulk actions
24
- jQuery('#doaction, #doaction2').on('click', function (e) {
25
- if (jQuery(this).parent().find('select').val() === 'sis-regenerate') {
26
- // Get checked checkbocxes
27
- var els = jQuery('#the-list .check-column input[type="checkbox"]:checked').closest('tr').find('.sis-regenerate-one');
28
-
29
- // Check there is any elements selected
30
- if (els.length > 0) {
31
-
32
- // Stop default action
33
- e.preventDefault();
34
-
35
- // Make all the selected elements
36
- els.each(function (i, el) {
37
- sis_obj = new SISAttachRegenerate(this);
38
- });
39
- }
40
- }
41
- });
42
-
43
- // Function for regenerating the elements
44
- SISAttachRegenerate = function (el) {
45
- var regenerate = {
46
- list: {},
47
- parent: null,
48
- el: null,
49
- id: null,
50
- messageZone: '',
51
- init: function (el) {
52
- this.el = el;
53
- this.parent = el.closest('tr');
54
- this.id = this.el.data('id');
55
- this.list = {'id': this.id, 'title': ''};
56
- this.messageZone = this.parent.find('.title em');
57
-
58
- if (this.parent.find('.title em').length === 0) {
59
- this.parent.find('.title strong').after('<em/>');
60
- }
61
-
62
- this.messageZone = this.parent.find('.title em');
63
-
64
- if (!this.parent.hasClass('ajaxing')) {
65
- this.regenItem();
66
- }
67
- },
68
- setMessage: function (msg) {
69
- // Display the message
70
- this.messageZone.html(' - ' + msg).addClass('updated').addClass('fade').show();
71
- },
72
- regenItem: function () {
73
- var self = this;
74
-
75
- jQuery.ajax({
76
- url: ajaxurl,
77
- type: "POST",
78
- dataType: 'json',
79
- cache: false,
80
- data: {
81
- action: 'sis_rebuild_image',
82
- id: this.list.id,
83
- nonce: sis.regen_one
84
- },
85
- beforeSend: function () {
86
- self.parent.addClass('ajaxing').find('.sis-regenerate-one').hide().end().find('.spinner').addClass('is-active').show();
87
- self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '0.3');
88
- },
89
- success: function (r) {
90
- var message = '';
91
- // Check if error or a message in response
92
- if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
93
- message = typeof r !== 'object' ? message = sis.phpError : r.error;
94
- } else {
95
- message = sis.soloRegenerated.replace('%s', r.time);
96
- }
97
- self.setMessage(message);
98
- self.parent.removeClass('ajaxing').find('.sis-regenerate-one').show().end().find('.spinner').removeClass('is-active').hide();
99
- self.parent.find('a.sis-regenerate-one').closest('tr').fadeTo('fast', '1');
100
- }
101
- });
102
- }
103
- };
104
-
105
- // Launch regeneration
106
- regenerate.init(jQuery(el));
107
- };
108
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/src/featured.js DELETED
@@ -1,70 +0,0 @@
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( 'click', '#sis_featured_regenerate', function ( e ) {
26
- e.preventDefault();
27
- rahe.sis.featured.regenItem();
28
- } );
29
- },
30
- setMessage : function( msg ) {
31
- // Display the message
32
- this.parent.find( '.sis_message' ).html( "<p>" + msg + "</p>" ).show();
33
- },
34
- regenItem : function( ) {
35
- var self = this;
36
-
37
- jQuery.ajax( {
38
- url: ajaxurl,
39
- type: "POST",
40
- dataType: 'json',
41
- cache: false,
42
- data: {
43
- action : 'sis_rebuild_featured',
44
- id : this.id,
45
- nonce : this.nonce
46
- },
47
- beforeSend : function() {
48
- self.parent.find('.spinner').addClass( 'is-active');
49
- self.parent.find( '#sis_featured_regenerate' ).attr( 'disabled', 'disabled' );
50
- },
51
- success: function( r ) {
52
- var message ='';
53
- // Check if error or a message in response
54
- if( !r.time || r.error || typeof r !== 'object' ) {
55
- message = typeof r !== 'object' ? message = sis.phpError : r.error ;
56
- } else {
57
- message = sis.soloRegenerated.replace( '%s', r.time );
58
- }
59
- self.setMessage( message );
60
-
61
- self.parent.find('.spinner').removeClass( 'is-active');
62
- self.parent.find( '#sis_featured_regenerate' ).removeAttr( 'disabled' );
63
- }
64
- });
65
- }
66
- };
67
-
68
- jQuery(function () {
69
- rahe.sis.featured.init();
70
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/src/sis.js DELETED
@@ -1,602 +0,0 @@
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(function (i) {
54
- self.thumbnails.push(this.value);
55
- });
56
- }
57
- },
58
- getPostTypes: function () {
59
- var self = this,
60
- inputs = jQuery('input.post_types:checked');
61
-
62
- // Get the checked post Types inputs
63
- if (inputs.length != jQuery('input.post_types[type="checkbox"]').length) {
64
- inputs.each(function () {
65
- self.post_types.push(this.value);
66
- });
67
- }
68
- },
69
- setMessage: function (msg) {
70
- // Display the message
71
- this.messageZone.html("<p>" + msg + "</p>").addClass('updated').addClass('fade').show();
72
- },
73
- setTimeMessage: function (msg) {
74
- this.timeZone.html(msg);
75
- },
76
- checkStartRegenerating: function () {
77
- if (jQuery('.notSaved').size() > 0) {
78
- var confirmation = confirm(sis.notSaved);
79
-
80
- // Delete if ok else not delete
81
- if (confirmation == true) {
82
- this.startRegenerating();
83
- } else {
84
- return false;
85
- }
86
- } else {
87
- this.startRegenerating();
88
- }
89
- },
90
- startRegenerating: function () {
91
- var self = this,
92
- wp_nonce = jQuery('input.getList').val();
93
-
94
- // Get the humbnails and post types
95
- self.getThumbnails();
96
- self.getPostTypes();
97
-
98
- this.dateScript = new Date();
99
- // Start ajax
100
- jQuery.ajax({
101
- url: ajaxurl,
102
- type: "POST",
103
- dataType: 'json',
104
- data: {
105
- action: 'sis_get_list',
106
- post_types: self.post_types,
107
- nonce: wp_nonce
108
- },
109
- beforeSend: function () {
110
-
111
- // Disable the button
112
- self.buttonRegenerate.attr("disabled", true);
113
- // Display the message
114
- self.setMessage(sis.reading);
115
-
116
- },
117
- success: function (r) {
118
-
119
- if (typeof r !== 'object') {
120
- self.reInit();
121
- self.setMessage(sis.phpError);
122
- return false;
123
- }
124
-
125
- self.time.show();
126
-
127
- // Eval the response
128
- self.total = r.total;
129
-
130
- // Set the current to 0
131
- self.curr = 0;
132
-
133
- // Display the progress Bar
134
- self.progress.show().parent().show();
135
-
136
- // Start Regenerating
137
- self.regenItem();
138
- }
139
- });
140
- },
141
- regenItem: function () {
142
- var self = this,
143
- wp_nonce = jQuery('input.regen').val();
144
-
145
- // If the list is empty display the message of emptyness and reinitialize the form
146
- if (this.total == 0 || _.isUndefined(this.total)) {
147
- this.reInit();
148
- this.setMessage(sis.noMedia);
149
- return false;
150
- }
151
-
152
- // If we have finished the regeneration display message and init again
153
- if (this.curr >= this.total) {
154
- var now = new Date();
155
- this.reInit();
156
- 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());
157
- return;
158
- }
159
-
160
- // Set the message of current image regenerating
161
- this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
162
- this.setMessage(sis.regenerating + ( this.curr + 1 ) + sis.of + this.total);
163
-
164
- jQuery.ajax({
165
- url: ajaxurl,
166
- type: "POST",
167
- dataType: 'json',
168
- data: {
169
- action: 'sis_rebuild_images',
170
- offset: this.curr,
171
- thumbnails: this.thumbnails,
172
- nonce: wp_nonce
173
- },
174
- beforeSend: function () {
175
- // Calculate the percentage of regeneration
176
- self.percent = ( self.curr / self.total ) * 100;
177
-
178
- // Change the progression
179
- self.progress.find('.bar').width(self.percent + '%')
180
- .find('.percent').html(self.percent + '%');
181
-
182
- // Change the text of progression
183
- self.percentText.removeClass('hidden').html(Math.round(self.percent) + "%");
184
- },
185
- success: function (r) {
186
- // Check if error or a message in response
187
- if (( !r.src || !r.time ) || r.error || typeof r !== 'object') {
188
- var message = '';
189
- if (typeof r !== 'object') {
190
- message = sis.phpError;
191
- } else {
192
- message = r.error
193
- }
194
-
195
- self.errorZone.addClass('error message');
196
- self.errorMessages.prepend('<li>' + message + '</li>');
197
- } else {
198
-
199
- // Append a message if needed
200
- if (r.message) {
201
- self.time.find('ul.messages').prepend('<li>' + r.message + '</li>');
202
- }
203
-
204
- // Display the image
205
- self.thumb.show();
206
-
207
- // Change his attribute
208
- self.thumbImg.attr("src", r.src);
209
-
210
- // Actual time
211
- var dateEnd = new Date(),
212
- curDate = new Date(),
213
- num = 0,
214
- sum = 0,
215
- i = 0,
216
- ave = 0,
217
- time = '';
218
-
219
- // Add the regenerating time to the array
220
- self.timeScript.push(parseFloat(r.time.replace(',', '.'), 10));
221
-
222
- // Get the number of elements in array
223
- num = self.timeScript.length;
224
-
225
- // Make the sum of the times
226
- for (i; i < num; i++) {
227
- sum += self.timeScript[i];
228
- }
229
-
230
- // Make the average value of the regenerating time
231
- ave = sum / num;
232
-
233
- // Round the value in miliseconds and add 25% or error
234
- t = Math.round(( ( ave * self.total ) * 1000 ));
235
-
236
- // Set the predicted time
237
- dateEnd.setTime(self.dateScript.getTime() + t);
238
-
239
- // Get the difference between the two dates
240
- time = self.s2t(Math.abs(( dateEnd.getTime() - curDate.getTime() )) / 1000);
241
-
242
- // Set the message in the notice box
243
- self.setTimeMessage(dateEnd.getHours() + ":" + dateEnd.getMinutes() + ":" + dateEnd.getSeconds() + sis.or + time + sis.beforeEnd);
244
- }
245
-
246
- // Inscrease the counter and regene the next item
247
- self.curr++;
248
- self.regenItem();
249
- }
250
- });
251
-
252
- },
253
- s2t: function (secs) {
254
- var secs = secs % 86400,
255
- t = new Date(1970, 0, 1),
256
- s = 0;
257
-
258
- t.setSeconds(secs);
259
- s = t.toTimeString().substr(0, 8);
260
- if (secs > 86399) {
261
- s = Math.floor(( t - Date.parse("1/1/70") ) / 3600000) + s.substr(2);
262
- }
263
- return s;
264
- },
265
- reInit: function () {
266
- // Re initilize the form
267
- this.buttonRegenerate.removeAttr("disabled");
268
- this.thumb.hide();
269
- this.progress.hide();
270
- this.percentText.addClass('hidden');
271
- }
272
- };
273
-
274
- rahe.sis.sizes = {
275
- i: 0,
276
- add: function (e, el) {
277
- e.preventDefault();
278
-
279
- // Create the template
280
- var elTr = rahe.sis.template('new_size');
281
- elTr = elTr({
282
- size_id: this.i,
283
- validate: sis.validate
284
- });
285
-
286
- // Add the form for editing
287
- jQuery(el).closest('tr').before(elTr);
288
-
289
- // Inscrease the identifier
290
- this.i++;
291
- },
292
- register: function (e, el) {
293
- // Stop propagation
294
- e.preventDefault();
295
-
296
- // Get name and id
297
- var name = jQuery(el).closest('tr').children('th').find('input').val(),
298
- id = jQuery(el).closest('tr').children('th').find('input').attr('id'),
299
-
300
- // Get the number of elements with this name
301
- checkPresent = jQuery(el).closest('tbody').find('input[value="' + name + '"]').length;
302
-
303
- // Check if not basic size or already present, display message
304
- if (name == 'thumbnail' || name == "medium" || name == "large") {
305
- alert(sis.notOriginal);
306
- return false;
307
- } else if (checkPresent != 0) {
308
- alert(sis.alreadyPresent);
309
- return false;
310
- }
311
-
312
- var row = rahe.sis.template('new_size_row');
313
-
314
- row = row({
315
- size: sis.size,
316
- size_name: name,
317
- maximumWidth: sis.maximumWidth,
318
- maximumHeight: sis.maximumHeight,
319
- customName: sis.customName,
320
- crop: sis.crop,
321
- crop_positions: sis.crop_positions,
322
- show: sis.show,
323
- deleteImage: sis.deleteImage,
324
- validateButton: sis.validateButton
325
- });
326
-
327
- // Add the row to the current list
328
- jQuery('#' + id).closest('tr').html(row);
329
- },
330
- deleteSize: function (e, el) {
331
- e.preventDefault();
332
- // Check if user want to delete or not
333
- var confirmation = confirm(sis.confirmDelete);
334
-
335
- // Delete if ok else not delete
336
- if (confirmation == true) {
337
- // Remove from the list and the array
338
- jQuery(el).closest('tr').remove();
339
- this.ajaxUnregister(el);
340
- }
341
- },
342
- getPhp: function (e, el) {
343
- e.preventDefault();
344
- // Get parent element
345
- var parent = jQuery(el).closest('tr');
346
-
347
- jQuery.ajax({
348
- url: ajaxurl,
349
- type: "POST",
350
- data: {action: "sis_get_sizes"},
351
- beforeSend: function () {
352
- // Remove classes of status
353
- parent.removeClass('addPending');
354
- parent.addClass('addPending');
355
- },
356
- success: function (result) {
357
- // Add the classes for the status
358
- jQuery('#get_php').nextAll('code').html('<br />' + result).show().css({'display': 'block'});
359
- parent.removeClass('addPending');
360
- }
361
- });
362
- },
363
- ajaxRegister: function (e, el) {
364
- e.preventDefault();
365
-
366
- // Get the vars
367
- var self = this,
368
- parentTable = jQuery(el).closest('table'),
369
- timer,
370
- wp_nonce = jQuery('.addSize').val(),
371
- parent = jQuery(el).closest('tr'),
372
- n = parent.find('input[name="image_name"]').val(),
373
- c = parent.find('select.crop').val(),
374
- s = parent.find('input.show').val(),
375
- cn = parent.find('input.n').val(),
376
- h = 0,
377
- w = 0;
378
- s = ( s == false || s == undefined ) ? false : true;
379
- w = parseInt(parent.find('input.w').val());
380
- h = parseInt(parent.find('input.h').val());
381
-
382
- if (!parentTable.hasClass('ajaxing')) {
383
- jQuery.ajax({
384
- url: ajaxurl,
385
- type: "POST",
386
- dataType: 'json',
387
- data: {
388
- action: "sis_add_size",
389
- width: w,
390
- height: h,
391
- crop: c,
392
- name: n,
393
- show: s,
394
- customName: cn,
395
- nonce: wp_nonce
396
- },
397
- beforeSend: function () {
398
- // Remove status and set pending
399
- parent.removeClass();
400
- parent.addClass('addPending');
401
- parentTable.addClass('ajaxing');
402
- },
403
- success: function (result) {
404
- // Set basic class and remove pending
405
- var classTr = '';
406
- parent.removeClass();
407
- parentTable.removeClass('ajaxing');
408
-
409
- // Check the result for the different messages
410
- if (result == 0) {
411
- classTr = 'errorAdding';
412
- } else if (result == 2) {
413
- classTr = 'notChangedAdding';
414
-
415
- // add/update to the array with the status class
416
- self.addToArray(n, w, h, c, classTr);
417
- } else {
418
- classTr = 'successAdding';
419
-
420
- // add/update to the array with the status class
421
- self.addToArray(n, w, h, c, classTr);
422
- }
423
-
424
- // Add the new sizes values for checking of changed or not
425
- parent.find('input.h').attr({base_h: h});
426
- parent.find('input.w').attr({base_w: w});
427
- parent.find('select.c').attr({base_c: c});
428
- parent.find('input.s').attr({base_s: s});
429
-
430
- // Add the generated class
431
- parent.addClass(classTr);
432
- parent.find('td').removeClass("notSaved");
433
-
434
- // Change the button text
435
- parent.find('.add_size').removeClass('validate_size').hide().children('.ui-button-text').text(sis.update);
436
-
437
- clearTimeout(timer);
438
- // Remove classes after 3 seconds
439
- timer = setTimeout(function () {
440
- parent.removeClass('errorAdding notChangedAdding successAdding');
441
- }, 2 * 1000);
442
- }
443
- });
444
- }
445
- },
446
- ajaxUnregister: function (el) {
447
- // Get name and self object
448
- var self = this,
449
- n = jQuery(el).closest('tr').find('input[name="image_name"]').val(),
450
- wp_nonce = jQuery(el).closest('tr').find('input.deleteSize').val();
451
-
452
- // Make the ajax call
453
- jQuery.ajax({
454
- url: ajaxurl,
455
- type: "POST",
456
- data: {action: "sis_remove_size", name: n, nonce: wp_nonce},
457
- success: function (result) {
458
- self.removeFromArray(el);
459
- }
460
- });
461
- },
462
- addToArray: function (n, w, h, c, s) {
463
- // Get the row for editing or updating
464
- var testRow = jQuery('#sis-' + n),
465
- newRow = '',
466
- timer;
467
-
468
- // Get the right newRow, updating or adding ?
469
- if (testRow.length != 0) {
470
- newRow = testRow.closest('tr');
471
- } else {
472
- newRow = jQuery('#sis-regen .wrapper > table#sis_sizes > tbody > tr:first').clone().attr('id', 'sis-' + n);
473
- }
474
-
475
- c = !_.isUndefined(sis.crop_positions[c]) ? sis.crop_positions[c] : sis.fl;
476
-
477
- // Set the datas with the given datas
478
- newRow.find('th > label').attr('for', n)
479
- .end()
480
- .find('input.thumbnails').val(n).attr('id', n)
481
- .end()
482
- .find('th:nth-child(2) > label').text(n)
483
- .end()
484
- .find('th:nth-child(3) > label').text(w + 'px')
485
- .end()
486
- .find('th:nth-child(4) > label').text(h + 'px')
487
- .end()
488
- .find('th:nth-child(5) > label').text(c);
489
-
490
- // If new then add the row
491
- if (testRow.length == 0) {
492
- newRow.appendTo('#sis-regen .wrapper > table#sis_sizes > tbody');
493
- }
494
-
495
- // Remove the previous status classes and add the status class
496
- newRow.removeClass('errorAdding notChangedAdding successAdding').addClass(s);
497
-
498
- clearTimeout(timer);
499
- // Remove the statuses classes
500
- timer = setTimeout(function () {
501
- newRow.removeClass('errorAdding notChangedAdding successAdding');
502
- }, 3 * 1000);
503
- },
504
- removeFromArray: function (el) {
505
- // get the name
506
- var n = jQuery(el).closest('tr').find('input[name=image_name]').val();
507
-
508
- // Remove the given name from the array
509
- jQuery('#sis-' + n).remove();
510
- },
511
- displayChange: function (el) {
512
- var el = jQuery(el),
513
- parent = el.closest('tr');
514
-
515
- // Check not new size
516
- if (parent.hasClass('new_size')) {
517
- return false;
518
- }
519
-
520
- var h_el = parent.find('input.h'),
521
- w_el = parent.find('input.w'),
522
- c_el = parent.find('select.c'),
523
- s_el = parent.find('input.s'),
524
- n_el = parent.find('input.n'),
525
-
526
- h = h_el.val(),
527
- w = w_el.val(),
528
- c = c_el.val(),
529
- s = s_el.val(),
530
- n = n_el.val(),
531
-
532
- base_h = h_el.attr('base_h'),
533
- base_w = w_el.attr('base_w'),
534
- base_c = c_el.attr('base_c'),
535
- base_s = s_el.attr('base_s'),
536
- base_n = n_el.attr('base_n');
537
-
538
-
539
- base_c = base_c == '0' ? false : true;
540
- base_s = base_s == '0' ? false : true;
541
-
542
- if (h != base_h || w != base_w || c != base_c || s != base_s || n != base_n) {
543
- el.closest('td').addClass('notSaved').find('.add_size').css('display', 'inline-block');
544
- } else {
545
- el.closest('td').removeClass('notSaved').find('.add_size').css('display', 'none');
546
- }
547
- }
548
- };
549
-
550
- rahe.sis.template = _.memoize(function (id) {
551
- var compiled,
552
- options = {
553
- evaluate: /<#([\s\S]+?)#>/g,
554
- interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
555
- escape: /\{\{([^\}]+?)\}\}(?!\})/g,
556
- variable: 'data'
557
- };
558
-
559
- return function (data) {
560
- compiled = compiled || _.template(jQuery('#sis-' + id).html(), null, options);
561
- return compiled(data);
562
- };
563
- });
564
-
565
- jQuery(function () {
566
- rahe.sis.regenerate.init();
567
- var bodyContent = jQuery('#wpbody-content');
568
- // Regeneration listener
569
- jQuery('#ajax_thumbnail_rebuild').click(function () {
570
- rahe.sis.regenerate.checkStartRegenerating();
571
- });
572
-
573
- // Add size button listener
574
- bodyContent.on('click', '#add_size', function (e) {
575
- rahe.sis.sizes.add(e, this);
576
- })
577
-
578
- // Registering a new size listener
579
- .on('click', '.add_size_name', function (e) {
580
- rahe.sis.sizes.register(e, this);
581
- })
582
-
583
- // Delete and Adding buttons
584
- .on('click', '.delete_size', function (e) {
585
- rahe.sis.sizes.deleteSize(e, this);
586
- })
587
- .on('click', '.add_size', function (e) {
588
- rahe.sis.sizes.ajaxRegister(e, this);
589
- })
590
-
591
- .on('click keyup change', '.h,.w,.c,.s,.n', function (e) {
592
- rahe.sis.sizes.displayChange(this);
593
- })
594
-
595
- // Seup the getphp
596
- .on('click', '#get_php', function (e) {
597
- rahe.sis.sizes.getPhp(e, this)
598
- });
599
- jQuery('#get_php').nextAll('code').hide();
600
-
601
- jQuery(".add_size").hide();
602
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/admin/main.php DELETED
@@ -1,320 +0,0 @@
1
- <?php
2
-
3
- Class SIS_Admin_Main {
4
-
5
- public function __construct() {
6
- add_action( 'admin_init', [ __CLASS__, 'register_assets' ] );
7
- }
8
-
9
- /**
10
- * Register all the assets for the admin
11
- */
12
- public static function register_assets() {
13
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min';
14
- // Add javascript.
15
- wp_register_script( 'sis_js', SIS_URL . 'assets/js/dist/app' . $suffix . '.js', [
16
- 'jquery',
17
- 'jquery-ui-button',
18
- 'jquery-ui-progressbar',
19
- 'underscore',
20
- ], SIS_VERSION );
21
-
22
- // Add javascript translations.
23
- wp_localize_script( 'sis_js', 'sis', self::localize_vars() );
24
-
25
- // Add CSS.
26
- wp_enqueue_style( 'sis_css', SIS_URL . 'assets/css/sis-style' . $suffix . '.css', [], SIS_VERSION );
27
- }
28
-
29
-
30
- /**
31
- * Localize the var for javascript
32
- *
33
- * @access public
34
- * @return array
35
- * @author Nicolas Juen
36
- */
37
- public static function localize_vars() {
38
- return array(
39
- 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
40
- 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
41
- 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
42
- 'crop' => __( 'Crop', 'simple-image-sizes' ),
43
- 'tr' => __( 'yes', 'simple-image-sizes' ),
44
- 'fl' => __( 'no', 'simple-image-sizes' ),
45
- 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
46
- 'of' => __( ' of ', 'simple-image-sizes' ),
47
- 'or' => __( ' or ', 'simple-image-sizes' ),
48
- 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
49
- 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
50
- 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
51
- 'regenerating' => __( 'Regenerating ', 'simple-image-sizes' ),
52
- 'regenerate' => __( 'Regenerate ', 'simple-image-sizes' ),
53
- 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
54
- 'done' => __( 'Done.', 'simple-image-sizes' ),
55
- 'size' => __( 'Size', 'simple-image-sizes' ),
56
- 'notOriginal' => __( 'Don\'t use the basic WordPress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
57
- 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
58
- 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
59
- 'update' => __( 'Update', 'simple-image-sizes' ),
60
- 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
61
- 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
62
- 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
63
- 'startedAt' => __( ' started at', 'simple-image-sizes' ),
64
- 'customName' => __( 'Public name', 'simple-image-sizes' ),
65
- 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
66
- 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
67
- 'notSaved' => __( 'All the sizes you have modified are not saved, continue anyway ?', 'simple-image-sizes' ),
68
- 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
69
- 'crop_positions' => self::get_available_crop(),
70
- 'regen_one' => wp_create_nonce( 'regen' ),
71
- );
72
- }
73
-
74
- /**
75
- * Rebuild the given attribute with the given thumbnails
76
- *
77
- * @param int $att_id : The attachment_id.
78
- * @param array $thumbnails : the thumbnails to re-generate.
79
- *
80
- * @return array
81
- * @author Nicolas Juen
82
- */
83
- public static function thumbnail_rebuild( $att_id, $thumbnails = null ) {
84
- // Time a the beginning.
85
- timer_start();
86
-
87
- // Check Id.
88
- if ( (int) $att_id <= 0 ) {
89
- return [
90
- 'time' => timer_stop( false, 4 ),
91
- 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' ),
92
- ];
93
- }
94
-
95
- // Get the path.
96
- $fullsizepath = get_attached_file( $att_id );
97
-
98
- // Regen the attachment.
99
- if ( false !== $fullsizepath && file_exists( $fullsizepath ) ) {
100
- if ( false == wp_update_attachment_metadata( $att_id, self::wp_generate_attachment_metadata_custom( $att_id, $fullsizepath, $thumbnails ) ) ) {
101
- return [
102
- 'src' => wp_get_attachment_thumb_url( $att_id ),
103
- 'time' => timer_stop( false, 4 ),
104
- 'message' => sprintf(
105
- __( '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' ),
106
- get_edit_post_link( $att_id ),
107
- get_the_title( $att_id )
108
- ),
109
- ];
110
- }
111
- } else {
112
- return [
113
- 'src' => wp_get_attachment_thumb_url( $att_id ),
114
- 'time' => timer_stop( false, 4 ),
115
- 'error' => sprintf(
116
- __( 'This file does not exists 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
- }
123
-
124
- // Display the attachment url for feedback.
125
- return [
126
- 'time' => timer_stop( false, 4 ),
127
- 'src' => wp_get_attachment_thumb_url( $att_id ),
128
- 'title' => get_the_title( $att_id ),
129
- ];
130
- }
131
-
132
- /**
133
- * Include the javascript template
134
- *
135
- * @return bool
136
- */
137
- public static function add_template() {
138
- global $pagenow;
139
- if ( 'options-media.php' !== $pagenow ) {
140
- return false;
141
- }
142
-
143
- if ( is_file( SIS_DIR . '/templates/admin-js.html' ) ) {
144
- include SIS_DIR . '/templates/admin-js.html';
145
- }
146
-
147
- return true;
148
- }
149
-
150
- /**
151
- * Get all the available cropping
152
- *
153
- * @return array
154
- *
155
- * @author Nicolas Juen
156
- */
157
- public static function get_available_crop() {
158
- global $wp_version;
159
-
160
- // Return the only possible.
161
- if ( version_compare( $wp_version, '3.9', '<' ) ) {
162
- return [];
163
- }
164
-
165
- $x = [
166
- 'left' => __( 'Left', 'simple-image-sizes' ),
167
- 'center' => __( 'Center', 'simple-image-sizes' ),
168
- 'right' => __( 'Right', 'simple-image-sizes' ),
169
- ];
170
-
171
- $y = [
172
- 'top' => __( 'top', 'simple-image-sizes' ),
173
- 'center' => __( 'center', 'simple-image-sizes' ),
174
- 'bottom' => __( 'bottom', 'simple-image-sizes' ),
175
- ];
176
-
177
- /**
178
- * Base crops
179
- */
180
- $crops = [
181
- 0 => __( 'No', 'simple-image-sizes' ),
182
- 1 => __( 'Yes', 'simple-image-sizes' ),
183
- ];
184
-
185
- foreach ( $x as $x_pos => $x_pos_label ) {
186
- foreach ( $y as $y_pos => $y_pos_label ) {
187
- $crops[ $x_pos . '_' . $y_pos ] = $x_pos_label . ' ' . $y_pos_label;
188
- }
189
- }
190
-
191
- return $crops;
192
- }
193
-
194
- /**
195
- * Check if the crop is available
196
- *
197
- * @param string $crop_position : the crop position slug.
198
- *
199
- * @return bool
200
- * @author Nicolas Juen
201
- */
202
- public static function is_crop_position( $crop_position ) {
203
- $crops = self::get_available_crop();
204
-
205
- return is_bool( $crop_position ) ? $crop_position : isset( $crops[ $crop_position ] );
206
- }
207
-
208
- /**
209
- * Return the crop position label from the slug
210
- *
211
- * @param string $crop_position : the crop position slug.
212
- *
213
- * @return string
214
- * @author Nicolas Juen
215
- */
216
- public static function get_crop_position_label( $crop_position ) {
217
- if ( ! self::is_crop_position( $crop_position ) ) {
218
- return '';
219
- }
220
- $crops = self::get_available_crop();
221
-
222
- return $crops[ $crop_position ];
223
- }
224
-
225
- /**
226
- * Generate post thumbnail attachment meta data.
227
- *
228
- * @since 2.1.0
229
- *
230
- * @param int $attachment_id : Attachment Id to process.
231
- * @param string $file : Filepath of the Attached image.
232
- *
233
- * @param null|array $thumbnails : thumbnails to regenerate, if null all
234
- *
235
- * @return mixed Metadata for attachment.
236
- */
237
- public static function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = null ) {
238
- $attachment = get_post( $attachment_id );
239
-
240
- $meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
241
-
242
- $metadata = [];
243
- if ( preg_match( '!^image/!', get_post_mime_type( $attachment ) ) && file_is_displayable_image( $file ) ) {
244
- $imagesize = getimagesize( $file );
245
- $metadata['width'] = $imagesize[0];
246
- $metadata['height'] = $imagesize[1];
247
- list( $uwidth, $uheight ) = wp_constrain_dimensions( $metadata['width'], $metadata['height'], 128, 96 );
248
- $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
249
-
250
- // Make the file path relative to the upload dir.
251
- $metadata['file'] = _wp_relative_upload_path( $file );
252
-
253
- // make thumbnails and other intermediate sizes.
254
- global $_wp_additional_image_sizes;
255
-
256
- foreach ( get_intermediate_image_sizes() as $s ) {
257
- $sizes[ $s ] = [
258
- 'width' => '',
259
- 'height' => '',
260
- 'crop' => false,
261
- ];
262
- if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
263
- $sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
264
- } // For theme-added sizes
265
- else {
266
- $sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
267
- } // For default sizes set in options
268
- if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
269
- $sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
270
- } // For theme-added sizes
271
- else {
272
- $sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
273
- } // For default sizes set in options
274
- if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
275
- $sizes[ $s ]['crop'] = intval( $_wp_additional_image_sizes[ $s ]['crop'] );
276
- } // For theme-added sizes
277
- else {
278
- $sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
279
- } // For default sizes set in options
280
- }
281
-
282
- $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
283
-
284
- // Only if not all sizes.
285
- if ( isset( $thumbnails ) && is_array( $thumbnails ) && isset( $meta_datas['sizes'] ) && ! empty( $meta_datas['sizes'] ) ) {
286
- // Fill the array with the other sizes not have to be done.
287
- foreach ( $meta_datas['sizes'] as $name => $fsize ) {
288
- $metadata['sizes'][ $name ] = $fsize;
289
- }
290
- }
291
-
292
- foreach ( $sizes as $size => $size_data ) {
293
- if ( isset( $thumbnails ) ) {
294
- if ( ! in_array( $size, $thumbnails ) ) {
295
- continue;
296
- }
297
- }
298
-
299
- $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
300
-
301
- if ( isset( $meta_datas['size'][ $size ] ) ) {
302
- // Remove the size from the orignal sizes for after work.
303
- unset( $meta_datas['size'][ $size ] );
304
- }
305
-
306
- if ( $resized ) {
307
- $metadata['sizes'][ $size ] = $resized;
308
- }
309
- }
310
-
311
- // fetch additional metadata from exif/iptc.
312
- $image_meta = wp_read_image_metadata( $file );
313
- if ( $image_meta ) {
314
- $metadata['image_meta'] = $image_meta;
315
- }
316
- }
317
-
318
- return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
319
- }
320
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/admin/media.php DELETED
@@ -1,547 +0,0 @@
1
- <?php
2
-
3
- Class SIS_Admin_Media {
4
-
5
- /**
6
- * Original WordPress sizes.
7
- *
8
- * @var array
9
- */
10
- public static $original = [
11
- 'thumbnail',
12
- 'medium',
13
- 'large',
14
- ];
15
-
16
- public function __construct() {
17
- // Init.
18
- add_action( 'admin_menu', [ __CLASS__, 'init' ] );
19
- add_action( 'admin_enqueue_scripts', [ __CLASS__, 'enqueue_assets' ], 11 );
20
-
21
- // Add ajax action.
22
- add_action( 'wp_ajax_sis_get_list', [ __CLASS__, 'a_get_list' ] );
23
- add_action( 'wp_ajax_sis_rebuild_images', [ __CLASS__, 'a_thumbnails_rebuild' ] );
24
- add_action( 'wp_ajax_sis_get_sizes', [ __CLASS__, 'a_get_sizes' ] );
25
- add_action( 'wp_ajax_sis_add_size', [ __CLASS__, 'a_add_size' ] );
26
- add_action( 'wp_ajax_sis_remove_size', [ __CLASS__, 'a_remove_size' ] );
27
-
28
- // Add link in plugins list.
29
- add_filter( 'plugin_action_links', [ __CLASS__, 'add_settings_link' ], 10, 2 );
30
- }
31
-
32
- /**
33
- * Register javascripts and css.
34
- *
35
- * @access public
36
- *
37
- * @param string $hook_suffix
38
- *
39
- * @author Nicolas Juen
40
- */
41
- public static function enqueue_assets( $hook_suffix = '' ) {
42
- if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
43
- return;
44
- }
45
-
46
- $suffixes = [ 'options-media.php', 'settings_page_media' ];
47
- if ( ! in_array( $hook_suffix, $suffixes, true ) ) {
48
- return;
49
- }
50
-
51
- // Add javascript.
52
- wp_enqueue_script( 'sis_js' );
53
-
54
- // Add CSS.
55
- wp_enqueue_style( 'sis_css' );
56
-
57
- // Add underscore template.
58
- add_action( 'admin_footer', [ 'SIS_Admin_Main', 'add_template' ] );
59
- }
60
-
61
-
62
- /**
63
- * Add a link to the setting option page
64
- *
65
- * @access public
66
- *
67
- * @param array $links : the admin links.
68
- * @param string $file : the file concerned in the row.
69
- *
70
- * @return array
71
- * @author Nicolas Juen
72
- */
73
- public static function add_settings_link( $links = array(), $file = '' ) {
74
-
75
- if ( 'simple-image-sizes/simple_image_sizes.php' !== $file ) {
76
- return $links;
77
- }
78
-
79
- $settings_link = sprintf( '<a href="%s"> %s </a>', admin_url( 'options-media.php' ), __( 'Settings', 'simple-image-sizes' ) );
80
- array_unshift( $links, $settings_link );
81
-
82
- return $links;
83
- }
84
-
85
- /**
86
- * Init for the option page
87
- *
88
- * @access public
89
- * @return void
90
- * @author Nicolas Juen
91
- */
92
- public static function init() {
93
- // Check if admin.
94
- if ( ! is_admin() ) {
95
- return;
96
- }
97
-
98
- // Get the image sizes.
99
- global $_wp_additional_image_sizes;
100
-
101
- // Get the sizes and add the settings.
102
- foreach ( get_intermediate_image_sizes() as $s ) {
103
- // Don't make the original sizes or numeric sizes that appear.
104
- if ( in_array( $s, self::$original ) || is_integer( $s ) ) {
105
- continue;
106
- }
107
-
108
- // Set width.
109
- $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
110
-
111
- // Set height.
112
- $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
113
-
114
- // Set crop.
115
- $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? intval( $_wp_additional_image_sizes[ $s ]['crop'] ) : get_option( "{$s}_crop" );
116
-
117
- // Add the setting field for this size.
118
- add_settings_field( 'image_size_' . $s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), [
119
- __CLASS__,
120
- 'image_sizes',
121
- ], 'media', 'default', [
122
- 'name' => $s,
123
- 'width' => $width,
124
- 'height' => $height,
125
- 'c' => $crop,
126
- ]
127
- );
128
- }
129
-
130
- // Register the setting for media option page.
131
- register_setting( 'media', SIS_OPTION );
132
-
133
- // Add the button.
134
- add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), [
135
- __CLASS__,
136
- 'addSizeButton',
137
- ], 'media' );
138
-
139
- // Add php button.
140
- add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), [
141
- __CLASS__,
142
- 'getPhpButton',
143
- ], 'media' );
144
-
145
- // Add section for the thumbnail regeneration.
146
- add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), [
147
- __CLASS__,
148
- 'thumbnailRegenerate',
149
- ], 'media' );
150
- }
151
-
152
- /**
153
- * Display the row of the image size
154
- *
155
- * @access public
156
- *
157
- * @param mixed $args
158
- *
159
- * @return void
160
- * @author Nicolas Juen
161
- */
162
- public static function image_sizes( $args ) {
163
-
164
- if ( is_integer( $args['name'] ) ) {
165
- return;
166
- }
167
-
168
- // Get the options.
169
- $sizes = (array) get_option( SIS_OPTION, [] );
170
-
171
- // Get the vars.
172
- $height = isset( $sizes[ $args['name'] ]['h'] ) ? $sizes[ $args['name'] ]['h'] : $args['height'];
173
- $width = isset( $sizes[ $args['name'] ]['w'] ) ? $sizes[ $args['name'] ]['w'] : $args['width'];
174
- $crop = isset( $sizes[ $args['name'] ]['c'] ) && ! empty( $sizes[ $args['name'] ]['c'] ) ? $sizes[ $args['name'] ]['c'] : $args['c'];
175
- $show = isset( $sizes[ $args['name'] ]['s'] ) && ! empty( $sizes[ $args['name'] ]['s'] ) ? '1' : '0';
176
- $custom = isset( $sizes[ $args['name'] ]['custom'] ) && ! empty( $sizes[ $args['name'] ]['custom'] ) ? '1' : '0';
177
- $name = isset( $sizes[ $args['name'] ]['n'] ) && ! empty( $sizes[ $args['name'] ]['n'] ) ? esc_html( $sizes[ $args['name'] ]['n'] ) : esc_html( $args['name'] );
178
- ?>
179
- <input type="hidden" value="<?php echo esc_attr( $args['name'] ); ?>" name="image_name"/>
180
- <?php if ( $custom ): ?>
181
- <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" type="hidden"
182
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" value="1"/>
183
- <?php else: ?>
184
- <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" type="hidden"
185
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" value="1"/>
186
- <?php endif; ?>
187
- <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>">
188
- <?php _e( 'Maximum width', 'simple-image-sizes' ); ?>
189
- <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>" class='w small-text'
190
- type="number" step='1' min='0'
191
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>"
192
- base_w='<?php echo esc_attr( $width ); ?>' value="<?php echo esc_attr( $width ); ?>"/>
193
- </label>
194
- <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>">
195
- <?php _e( 'Maximum height', 'simple-image-sizes' ); ?>
196
- <input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>" class='h small-text'
197
- type="number" step='1' min='0'
198
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>"
199
- base_h='<?php echo esc_attr( $height ); ?>' value="<?php echo esc_attr( $height ); ?>"/>
200
- </label>
201
- <label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>">
202
- <?php _e( 'Public name', 'simple-image-sizes' ); ?>
203
- <input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>" class='n'
204
- type="text" id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>"
205
- base_n='<?php echo $name; ?>' value="<?php echo $name; ?>"/>
206
- </label>
207
- <span class="size_options">
208
- <label class="c"
209
- for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes' ); ?></label>
210
- <select id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>" class="c crop"
211
- base_c='<?php echo esc_attr( $crop ); ?>'
212
- name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>">
213
-
214
- <?php foreach ( SIS_Admin_Main::get_available_crop() as $crop_position => $label ) : ?>
215
- <option <?php selected( $crop_position, $crop ); ?> value="<?php echo esc_attr( $crop_position ); ?>"><?php echo esc_html( $label ); ?></option>
216
- <?php endforeach; ?>
217
- </select>
218
-
219
- <input type='checkbox'
220
- id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" <?php checked( $show, 1 ); ?>
221
- class="s show" base_s='<?php echo esc_attr( $show ); ?>'
222
- name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" value="1"/>
223
- <label class="s"
224
- for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>"><?php _e( 'Show in post insertion ?', 'simple-image-sizes' ); ?></label>
225
- </span>
226
- <span class="delete_size button-secondary"><?php _e( 'Delete', 'simple-image-sizes' ); ?></span>
227
- <span class="add_size validate_size button-primary"><?php _e( 'Update', 'simple-image-sizes' ); ?></span>
228
-
229
- <input type="hidden" class="deleteSize button-primary"
230
- value='<?php echo wp_create_nonce( 'delete_' . $args['name'] ); ?>'/>
231
- <?php
232
- }
233
-
234
- /**
235
- * Add the button to add a size
236
- *
237
- * @access public
238
- * @return void
239
- * @author Nicolas Juen
240
- */
241
- public static function addSizeButton() { ?>
242
- <input type="button" class="button-secondary action" id="add_size"
243
- value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes' ); ?>"/>
244
- <?php
245
- }
246
-
247
- /**
248
- * Add the button to get the php for th sizes
249
- *
250
- * @access public
251
- * @return void
252
- * @author Nicolas Juen
253
- */
254
- public static function getPhpButton() { ?>
255
- <input type="button" class="button-secondary action" id="get_php"
256
- value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes' ); ?>"/>
257
- <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>
258
- <code></code>
259
- <?php
260
- }
261
-
262
- /**
263
- * Display the Table of sizes and post types for regenerating
264
- *
265
- * @access public
266
- * @return void
267
- * @author Nicolas Juen
268
- */
269
- public static function thumbnailRegenerate() {
270
- if ( is_file( SIS_DIR . '/templates/options-media.php' ) ) {
271
- include SIS_DIR . '/templates/options-media.php';
272
- } else {
273
- esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
274
- }
275
- }
276
-
277
- /**
278
- * Add a size by Ajax
279
- *
280
- * @access public
281
- * @return void
282
- * @author Nicolas Juen
283
- */
284
- public static function a_add_size() {
285
-
286
- // Get the nonce
287
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
288
-
289
- // Get old options
290
- $sizes = (array) get_option( SIS_OPTION, [] );
291
- $croppings = SIS_Admin_Main::get_available_crop();
292
- $croppings[ true ] = '';
293
- $croppings[ false ] = '';
294
-
295
- // Check entries
296
- $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
297
- $height = ! isset( $_POST['height'] ) ? 0 : absint( $_POST['height'] );
298
- $width = ! isset( $_POST['width'] ) ? 0 : absint( $_POST['width'] );
299
- $crop = isset( $_POST['crop'] ) && isset( $croppings[ $_POST['crop'] ] ) ? $_POST['crop'] : false;
300
- $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
301
- $cn = isset( $_POST['customName'] ) && ! empty( $_POST['customName'] ) ? sanitize_text_field( $_POST['customName'] ) : $name;
302
-
303
- // Check the nonce
304
- if ( ! wp_verify_nonce( $nonce, 'add_size' ) ) {
305
- die( 0 );
306
- }
307
-
308
- // If no name given do not save
309
- if ( empty( $name ) ) {
310
- die( 0 );
311
- }
312
-
313
- // Make values
314
- $values = [
315
- 'custom' => 1,
316
- 'w' => $width,
317
- 'h' => $height,
318
- 'c' => $crop,
319
- 's' => $show,
320
- 'n' => $cn,
321
- ];
322
-
323
- // If the size have not changed return 2
324
- if ( isset( $sizes[ $name ] ) && $sizes[ $name ] === $values ) {
325
- die( 2 );
326
- }
327
-
328
- // Put the new values
329
- $sizes[ $name ] = $values;
330
-
331
- // display update result
332
- echo (int) update_option( 'custom_image_sizes', $sizes );
333
- die();
334
- }
335
-
336
- /**
337
- * Remove a size by Ajax
338
- *
339
- * @access public
340
- * @return void
341
- * @author Nicolas Juen
342
- */
343
- public static function a_remove_size() {
344
-
345
- // Get old options
346
- $sizes = (array) get_option( SIS_OPTION, [] );
347
-
348
- // Get the nonce and name
349
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
350
- $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
351
-
352
- // Check the nonce
353
- if ( ! wp_verify_nonce( $nonce, 'delete_' . $name ) ) {
354
- die( 0 );
355
- }
356
-
357
- // Remove the size
358
- unset( $sizes[ sanitize_title( $name ) ] );
359
- unset( $sizes[0] );
360
-
361
- // Display the results
362
- echo (int) update_option( SIS_OPTION, $sizes );
363
- die();
364
- }
365
-
366
- /**
367
- * Display the add_image_size for the registered sizes
368
- *
369
- * @access public
370
- * @return void
371
- */
372
- public static function a_get_sizes() {
373
- global $_wp_additional_image_sizes, $wp_version;
374
-
375
- foreach ( get_intermediate_image_sizes() as $s ) {
376
- // Don't make the original sizes
377
- if ( in_array( $s, self::$original ) ) {
378
- continue;
379
- }
380
-
381
- // Set width
382
- $width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
383
-
384
- // Set height
385
- $height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
386
-
387
- //Set crop
388
- $crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
389
-
390
- if ( is_bool( $crop ) || is_numeric( $crop ) || version_compare( $wp_version, '3.9', '<' ) ) {
391
- $crop = ( absint( $crop ) == 0 ) ? 'false' : 'true';
392
- } else {
393
- if ( ! Sis_Admin_Main::is_crop_position( implode( '_', $crop ) ) ) {
394
- $crop = "false";
395
- } else {
396
- $crop = '[ "' . $crop[0] . '", "' . $crop[1] . '")';
397
- }
398
- }
399
- ?>
400
- add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop; ?> );
401
- <br/>
402
- <?php
403
- }
404
-
405
- die();
406
- }
407
-
408
- /**
409
- *
410
- * Get the media list to regenerate
411
- *
412
- * @param : void
413
- *
414
- * @return void
415
- */
416
- public static function a_get_list() {
417
- /**
418
- * @var wpdb $wpdb
419
- */
420
- global $wpdb;
421
-
422
- // Basic vars
423
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
424
-
425
- // Check the nonce
426
- if ( ! wp_verify_nonce( $nonce, 'getList' ) ) {
427
- wp_send_json( [] );
428
- }
429
-
430
- if ( isset( $_POST['post_types'] ) && ! empty( $_POST['post_types'] ) ) {
431
-
432
- foreach ( $_POST['post_types'] as $key => $type ) {
433
- if ( ! post_type_exists( $type ) ) {
434
- unset( $_POST['post_types'][ $key ] );
435
- }
436
- }
437
-
438
- if ( empty( $_POST['post_types'][ $key ] ) ) {
439
- wp_send_json( [] );
440
- }
441
-
442
- // Get image medias.
443
- $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
444
-
445
- // Get all parent from post type.
446
- $attachments = $wpdb->get_var( "SELECT COUNT( ID )
447
- FROM $wpdb->posts
448
- WHERE 1 = 1
449
- AND post_type = 'attachment'
450
- $whichmimetype
451
- AND post_parent IN (
452
- SELECT DISTINCT ID
453
- FROM $wpdb->posts
454
- WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
455
- )" );
456
- // Return the Id's and Title of medias
457
- wp_send_json( [ 'total' => $attachments ] );
458
-
459
- } else {
460
- $attachments = get_children( [
461
- 'post_type' => 'attachment',
462
- 'post_mime_type' => 'image',
463
- 'numberposts' => - 1,
464
- 'post_status' => null,
465
- 'post_parent' => null, // any parent
466
- 'output' => 'ids',
467
- ] );
468
- // Return the Id's and Title of medias
469
- wp_send_json( [ 'total' => count( $attachments ) ] );
470
- }
471
-
472
- }
473
-
474
- /**
475
- * Regenerate the thumbnails ajax action
476
- *
477
- * @param void
478
- *
479
- * @author Nicolas Juen
480
- */
481
- public static function a_thumbnails_rebuild() {
482
- /**
483
- * @var $wpdb wpdb
484
- */
485
- global $wpdb;
486
-
487
- // Get the nonce
488
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
489
- $offset = isset( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 0;
490
- $post_types = isset( $_POST['post_types'] ) ? $_POST['post_types'] : 'any';
491
- $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
492
-
493
- // Check the nonce
494
- if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
495
- wp_send_json( [ 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ] );
496
- }
497
-
498
- if ( 'any' !== $post_types ) {
499
-
500
- foreach ( $_POST['post_types'] as $key => $type ) {
501
- if ( ! post_type_exists( $type ) ) {
502
- unset( $_POST['post_types'][ $key ] );
503
- }
504
- }
505
-
506
- if ( empty( $_POST['post_types'] ) ) {
507
- wp_send_json( [] );
508
- }
509
-
510
- // Get image medias
511
- $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
512
-
513
- // Get all parent from post type
514
- $attachment = $wpdb->get_var( $wpdb->prepare( "SELECT ID
515
- FROM $wpdb->posts
516
- WHERE 1 = 1
517
- AND post_type = 'attachment'
518
- $whichmimetype
519
- AND post_parent IN (
520
- SELECT DISTINCT ID
521
- FROM $wpdb->posts
522
- WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
523
- )
524
- LIMIT %d,1
525
- ", $offset ) );
526
-
527
- } else {
528
- $attachment = get_posts( [
529
- 'post_type' => 'attachment',
530
- 'post_mime_type' => 'image',
531
- 'numberposts' => 1,
532
- 'post_status' => 'any',
533
- 'output' => 'object',
534
- 'offset' => $offset,
535
- ] );
536
-
537
- $attachment = ! empty( $attachment ) ? $attachment[0]->ID : 0;
538
- }
539
-
540
- if ( empty( $attachment ) ) {
541
- wp_send_json( [
542
- 'message' => __( 'Regeneration ended', 'simple-image-sizes' )
543
- ] );
544
- }
545
- wp_send_json( SIS_Admin_Main::thumbnail_rebuild( $attachment, $thumbnails ) );
546
- }
547
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/admin/post.php DELETED
@@ -1,269 +0,0 @@
1
- <?php
2
-
3
- Class SIS_Admin_Post {
4
- public function __construct() {
5
-
6
- add_filter( 'image_size_names_choose', [ __CLASS__, 'add_thumbnail_name' ] );
7
-
8
- add_action( 'admin_enqueue_scripts', [ __CLASS__, 'enqueue_assets' ], 11 );
9
-
10
- // Rebuilt the image.
11
- add_action( 'wp_ajax_sis_rebuild_image', [ __CLASS__, 'a_thumbnail_rebuild' ] );
12
-
13
- // Rebuild featured.
14
- add_action( 'wp_ajax_sis_rebuild_featured', [ __CLASS__, 'a_featured_rebuild' ] );
15
-
16
- // Add action in media row quick actions.
17
- add_filter( 'media_row_actions', [ __CLASS__, 'add_actions_list' ], 10, 2 );
18
-
19
- // Add filter for the Media single.
20
- add_filter( 'attachment_fields_to_edit', [ __CLASS__, 'add_field_regenerate' ], 9, 2 );
21
-
22
- // Media regenerate on admin featured.
23
- add_filter( 'admin_post_thumbnail_html', [ __CLASS__, 'admin_post_thumbnail_html' ], 10, 2 );
24
- }
25
-
26
- /**
27
- * Generate HTML on the featured image size.
28
- *
29
- * @param string $content : the content of the post_thumbnail view.
30
- * @param int $ID : the ID of the content concerned.
31
- *
32
- * @return string
33
- */
34
- public static function admin_post_thumbnail_html( $content, $ID ) {
35
- /**
36
- * Allow to not display the regenerate image link
37
- */
38
- if ( false === apply_filters( 'SIS/Admin/Post/Display_Thumbnail_Regenerate', true ) ) {
39
- return $content;
40
- }
41
-
42
- /**
43
- * Do not display if post_Type does not support it
44
- */
45
- if ( false === post_type_supports( get_post_type(), 'thumbnail' ) ) {
46
- return $content;
47
- }
48
-
49
- $content .= '<span class="spinner"></span>';
50
- $content .= sprintf(
51
- "<a id='sis_featured_regenerate' data-nonce='%s' href='#' >%s</a>",
52
- wp_create_nonce( 'sis-regenerate-featured-' . $ID ),
53
- esc_html__( 'Regenerate image sizes', 'simple-image-sizes' )
54
- );
55
- $content .= '<div class="sis_message"></div>';
56
-
57
- return $content;
58
- }
59
-
60
- /**
61
- * Rebuild the image size of a content featured image
62
- */
63
- public static function a_featured_rebuild() {
64
- // Get the nonce.
65
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
66
-
67
- // Get the thumbnails.
68
- $id = isset( $_POST['id'] ) ? $_POST['id'] : null;
69
-
70
- // Check the nonce.
71
- if ( ! wp_verify_nonce( $nonce, 'sis-regenerate-featured-' . $id ) ) {
72
- wp_send_json( [ 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ] );
73
- }
74
-
75
- $attachment_id = get_post_thumbnail_id( $id );
76
-
77
- if ( ! has_post_thumbnail( $id ) || is_null( $attachment_id ) ) {
78
- wp_send_json( [ 'error' => __( 'There is no media attached to this content.', 'simple-image-sizes' ) ] );
79
- }
80
-
81
- // Get the id.
82
- wp_send_json( SIS_Admin_Main::thumbnail_rebuild( $attachment_id ) );
83
- }
84
-
85
- /**
86
- * Register javascripts and css.
87
- *
88
- * @access public
89
- *
90
- * @param string $hook_suffix : the hook for the current page.
91
- *
92
- * @author Nicolas Juen
93
- */
94
- public static function enqueue_assets( $hook_suffix = '' ) {
95
- if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
96
- return;
97
- }
98
-
99
- /**
100
- * Enqueue the assets for the featured image only on the edit pages and the post types that supports it
101
- */
102
- if ( in_array( $hook_suffix, [ 'post-new.php', 'post.php' ] ) ) {
103
- if ( post_type_supports( get_post_type( get_post() ), 'thumbnail' ) ) {
104
- // Add javascript.
105
- wp_enqueue_script( 'sis_js' );
106
- }
107
- }
108
-
109
- if ( 'upload.php' == $hook_suffix || ( 'post.php' == $hook_suffix && isset( $_GET['post'] ) && isset( $_GET['action'] ) && 'edit' == $_GET['action'] ) ) {
110
- // Add javascript.
111
- wp_enqueue_script( 'sis_js' );
112
-
113
- // Add underscore template.
114
- add_action( 'admin_footer', [ 'SIS_Admin_Main', 'add_template' ] );
115
- }
116
- }
117
-
118
- /**
119
- * Rebuild the image
120
- *
121
- * @access public
122
- * @return void
123
- * @author Nicolas Juen
124
- */
125
- public static function a_thumbnail_rebuild() {
126
- // Get the nonce.
127
- $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
128
-
129
- // Get the thumbnails.
130
- $thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
131
-
132
- // Check the nonce.
133
- if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
134
- wp_send_json( [ 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ] );
135
- }
136
-
137
- // Get the id.
138
- $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
139
- wp_send_json( SIS_Admin_Main::thumbnail_rebuild( $id, $thumbnails ) );
140
- }
141
-
142
- /**
143
- * Add the thumbnail name in the post insertion, based on new WP filter
144
- *
145
- * @access public
146
- *
147
- * @param array $sizes : the sizes.
148
- *
149
- * @return array
150
- * @since 2.3
151
- * @author Nicolas Juen
152
- * @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
153
- */
154
- public static function add_thumbnail_name( array $sizes ) {
155
- // Get options.
156
- $sizes_custom = get_option( SIS_OPTION, [] );
157
-
158
- // init size array.
159
- $add_sizes = [];
160
-
161
- // check there is custom sizes.
162
- if ( is_array( $sizes_custom ) && ! empty( $sizes_custom ) ) {
163
- foreach ( $sizes_custom as $key => $value ) {
164
- // If we show this size in the admin.
165
- if ( ! isset( $value['s'] ) || 1 !== (int) $value['s'] ) {
166
- continue;
167
- }
168
- $add_sizes[ $key ] = self::get_thumbnail_name( $key );
169
- }
170
- }
171
-
172
- // Merge the two array.
173
- $new_sizes = array_merge( $sizes, $add_sizes );
174
-
175
- // Add new size.
176
- return $new_sizes;
177
- }
178
-
179
- /**
180
- * Get a thumbnail name from its slug
181
- *
182
- * @access private
183
- *
184
- * @param string $thumbnail_slug : the slug of the thumbnail.
185
- *
186
- * @return string
187
- * @since 2.3
188
- * @author Nicolas Juen
189
- */
190
- private static function get_thumbnail_name( $thumbnail_slug = '' ) {
191
-
192
- // get the options.
193
- $sizes_custom = get_option( SIS_OPTION );
194
-
195
- if ( ! isset( $sizes_custom[ $thumbnail_slug ] ) ) {
196
- // return slug if not found.
197
- return $thumbnail_slug;
198
- }
199
-
200
- // If the name exists return it, slug by default.
201
- if ( isset( $sizes_custom[ $thumbnail_slug ]['n'] ) && ! empty( $sizes_custom[ $thumbnail_slug ]['n'] ) ) {
202
- return $sizes_custom[ $thumbnail_slug ]['n'];
203
- }
204
-
205
- return $thumbnail_slug;
206
- }
207
-
208
-
209
- /**
210
- * Add action in media row
211
- *
212
- * @since 2.2
213
- * @access public
214
- *
215
- * @param array $actions : array of actions and content to display.
216
- * @param WP_Post $object : the WordPress object for the actions.
217
- *
218
- * @return array $actions
219
- * @author Nicolas Juen
220
- */
221
- public static function add_actions_list( $actions, $object ) {
222
- if ( ! wp_attachment_is_image( $object->ID ) ) {
223
- return $actions;
224
- }
225
- // Add action for regeneration.
226
- $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' ) );
227
-
228
- // Return actions.
229
- return $actions;
230
- }
231
-
232
-
233
- /**
234
- * Get a thumbnail name from its slug
235
- *
236
- * @access public
237
- *
238
- * @param array $fields : the fields of the media.
239
- * @param object $post : the post object.
240
- *
241
- * @return array
242
- * @since 2.3.1
243
- * @author Nicolas Juen
244
- */
245
- public static function add_field_regenerate( $fields, $post ) {
246
- // Check this is an image.
247
- if ( false === strpos( $post->post_mime_type, 'image' ) ) {
248
- return $fields;
249
- }
250
-
251
- $fields['sis-regenerate'] = [
252
- 'label' => __( 'Regenerate Thumbnails', 'simple-image-sizes' ),
253
- 'input' => 'html',
254
- 'html' => sprintf( '
255
- <input type="button" data-id="%s" class="button title sis-regenerate-one" value="%s" />
256
- <span class="spinner"></span>
257
- <span class="title"><em></em></span>
258
- <input type="hidden" class="regen" value="%s" />',
259
- esc_attr( $post->ID ),
260
- esc_attr__( 'Regenerate Thumbnails', 'simple-image-sizes' ),
261
- wp_create_nonce( 'regen' )
262
- ),
263
- 'show_in_edit' => true,
264
- 'show_in_modal' => false,
265
- ];
266
-
267
- return $fields;
268
- }
269
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/main.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
-
3
- Class SIS_Client {
4
-
5
- public function __construct() {
6
- // Make new image sizes.
7
- add_action( 'init', [ __CLASS__, 'after_setup_theme' ], 1 );
8
-
9
- // Add translation.
10
- add_action( 'init', [ __CLASS__, 'init_translation' ], 2 );
11
- }
12
-
13
- /**
14
- * Override the images by the plugin images
15
- *
16
- * @access public
17
- * @return void
18
- * @author Nicolas Juen
19
- */
20
- public static function after_setup_theme() {
21
- // Get initial options.
22
- $sizes = get_option( SIS_OPTION, [] );
23
-
24
- // Return false if empty.
25
- if ( empty( $sizes ) || ! is_array( $sizes ) ) {
26
- return;
27
- }
28
-
29
- // Set the new sizes.
30
- foreach ( $sizes as $name => $size ) {
31
- if ( empty( $size ) || ! isset( $size['w'] ) || ! isset( $size['h'] ) ) {
32
- continue;
33
- }
34
-
35
- $crop = ( isset( $size['c'] ) && ! empty( $size['c'] ) ) ? $size['c'] : false;
36
-
37
- if ( is_bool( $crop ) || is_numeric( $crop ) ) {
38
- $crop = ( 0 === absint( $crop ) ) ? false : true;
39
- } elseif ( is_string( $crop ) ) {
40
- $crop = explode( '_', $crop );
41
- }
42
-
43
- // Add the images sizes.
44
- add_image_size( $name, $size['w'], $size['h'], $crop );
45
- }
46
- }
47
-
48
- /**
49
- * Load the plugin text domain
50
- *
51
- * @return void
52
- * @author Nicolas Juen
53
- */
54
- public static function init_translation() {
55
- load_plugin_textdomain( 'simple-image-sizes', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
56
- }
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/Aristo/images/bg_fallback.png ADDED
Binary file
css/Aristo/images/icon_sprite.png ADDED
Binary file
css/Aristo/images/progress_bar.gif ADDED
Binary file
css/Aristo/images/slider_handles.png ADDED
Binary file
css/Aristo/images/ui-icons_222222_256x240.png ADDED
Binary file
css/Aristo/images/ui-icons_454545_256x240.png ADDED
Binary file
css/Aristo/jquery-ui-1.8.7.custom.css ADDED
@@ -0,0 +1,740 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
gulpfile.js DELETED
@@ -1,40 +0,0 @@
1
- /*Load all plugin define in package.json*/
2
- var gulp = require('gulp'),
3
- gulpLoadPlugins = require('gulp-load-plugins'),
4
- plugins = gulpLoadPlugins(),
5
- concat = require('gulp-concat-sourcemap');
6
-
7
- /*JS task*/
8
- gulp.task('dist', function () {
9
- gulp.src([
10
- 'assets/js/src/sis.js',
11
- 'assets/js/src/attachments.js',
12
- 'assets/js/src/featured.js'
13
- ])
14
- .pipe(plugins.uglify())
15
- .pipe(concat('app.min.js', { sourceRoot : '../../' }))
16
- .pipe(gulp.dest('assets/js/dist/'));
17
-
18
- gulp.src([
19
- 'assets/css/sis-style.css'
20
- ])
21
- .pipe(plugins.cssmin())
22
- .pipe(plugins.rename( { 'suffix' : '.min' } ))
23
- .pipe(gulp.dest('assets/css/'));
24
- });
25
-
26
- gulp.task('dev', function () {
27
- return gulp.src([
28
- 'assets/js/src/sis.js',
29
- 'assets/js/src/attachments.js',
30
- 'assets/js/src/featured.js'
31
- ])
32
- .pipe(plugins.jshint())
33
- .pipe(concat('app.js', { sourceRoot : '../../' }))
34
- .pipe(gulp.dest('assets/js/dist/'));
35
- });
36
-
37
- // On default task, just compile on demand
38
- gulp.task('default', function() {
39
- gulp.watch( [ 'assets/js/src/*.js', '!assets/js/src/*.min.js' ], [ 'dev' ] );
40
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/class.admin.php ADDED
@@ -0,0 +1,803 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
19
+ add_filter( 'attachment_fields_to_edit', array( &$this, 'sizesInForm' ), 11, 2 ); // Add our sizes to media forms
20
+
21
+ // Add link in plugins list
22
+ add_filter('plugin_action_links', array( &$this,'addSettingsLink'), 10, 2 );
23
+
24
+ // Add action in media row quick actions
25
+ add_filter( 'media_row_actions', array(&$this, 'addActionsList'), 10, 2 );
26
+ }
27
+
28
+ /**
29
+ * Register javascripts and css.
30
+ *
31
+ * @access public
32
+ * @return void
33
+ * @author Nicolas Juen
34
+ */
35
+ public function registerScripts($hook_suffix = '' ) {
36
+ if( !isset( $hook_suffix ) || empty( $hook_suffix ) )
37
+ return false;
38
+
39
+ if( $hook_suffix == 'options-media.php' ) {
40
+ // Add javascript
41
+ wp_enqueue_script( 'sis-jquery-ui-sis', SIS_URL.'js/jquery-ui-1.8.16.custom.min.js', array('jquery'), '1.8.16' );
42
+ wp_enqueue_script( 'sis_js', SIS_URL.'js/sis.min.js', array('jquery','sis-jquery-ui-sis'), SIS_VERSION );
43
+
44
+ // Add javascript translation
45
+ wp_localize_script( 'sis_js', 'sis', $this->localizeVars() );
46
+
47
+ // Add CSS
48
+ wp_enqueue_style( 'jquery-ui-sis', SIS_URL.'css/Aristo/jquery-ui-1.8.7.custom.css', array(), '1.8.7' );
49
+ wp_enqueue_style( 'sis_css', SIS_URL.'css/sis-style.css', array(), SIS_VERSION );
50
+ } elseif( $hook_suffix == 'upload.php' ) {
51
+ // Add javascript
52
+ wp_enqueue_script( 'sis_js', SIS_URL.'js/sis-attachments.min.js', array( 'jquery' ), SIS_VERSION );
53
+
54
+ // Add javascript translation
55
+ wp_localize_script( 'sis_js', 'sis', $this->localizeVars() );
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Localize the var for javascript
61
+ *
62
+ * @access public
63
+ * @return void
64
+ * @author Nicolas Juen
65
+ */
66
+ public function localizeVars() {
67
+ return array(
68
+ 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
69
+ 'reading' => __( 'Reading attachments...', 'sis' ),
70
+ 'maximumWidth' => __( 'Maximum width', 'sis' ),
71
+ 'maximumHeight' => __( 'Maximum height', 'sis' ),
72
+ 'crop' => __( 'Crop ?', 'sis' ),
73
+ 'tr' => __( 'yes', 'sis' ),
74
+ 'fl' => __( 'no', 'sis' ),
75
+ 'show' => __( 'Show in post insertion ?', 'sis' ),
76
+ 'of' => __( ' of ', 'sis' ),
77
+ 'or' => __( ' or ', 'sis' ),
78
+ 'beforeEnd' => __( ' before the end.', 'sis' ),
79
+ 'deleteImage' => __( 'Delete', 'sis' ),
80
+ 'noMedia' => __( 'No media in your site to regenerate !', 'sis' ),
81
+ 'regenerating' => __( 'Regenerating ', 'sis'),
82
+ 'validate' => __( 'Validate image size name', 'sis' ),
83
+ 'done' => __( 'Done.', 'sis' ),
84
+ 'size' => __( 'Size', 'sis' ),
85
+ 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'sis' ),
86
+ 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'sis' ),
87
+ 'confirmDelete' => __( 'Do you really want to delete these size ?', 'sis' ),
88
+ 'update' => __( 'Update', 'sis' ),
89
+ 'ajaxErrorHandler' => __( 'Error requesting page', 'sis' ),
90
+ 'messageRegenerated' => __( 'images have been regenerated !', 'sis' ),
91
+ 'validateButton' => __( 'Validate', 'sis' ),
92
+ 'startedAt' => __( ' started at', 'sis' ),
93
+ 'finishedAt' => __( ' finished at :', 'sis' ),
94
+ 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'sis' ),
95
+ 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'sis' ),
96
+ 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'sis' ),
97
+ );
98
+ }
99
+
100
+ /**
101
+ * Add action in media row
102
+ *
103
+ * @since 2.2
104
+ * @access public
105
+ * @return $actions : array of actions and content to display
106
+ * @author Nicolas Juen
107
+ */
108
+ function addActionsList( $actions, $object ) {
109
+
110
+ // Add action for regeneration
111
+ $actions['sis-regenerate'] = "<a href='#' class='sis-regenerate-one'>".__( 'Regenerate thumbnails', 'sis' )."</a>".'<input type="hidden" class="regen" value="'.wp_create_nonce( 'regen' ).'" />';
112
+
113
+ // Return actions
114
+ return $actions;
115
+ }
116
+
117
+ /**
118
+ * Add a link to the setting option page
119
+ *
120
+ * @access public
121
+ * @param array $links
122
+ * @param string $file
123
+ * @return void
124
+ * @author Nicolas Juen
125
+ */
126
+ public function addSettingsLink( $links, $file ) {
127
+
128
+ if( $file != 'simple-image-sizes/simple_image_sizes.php' )
129
+ return $links;
130
+
131
+ $settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'sis' ).' </a>';
132
+ array_unshift($links, $settings_link);
133
+
134
+ return $links;
135
+ }
136
+
137
+ /**
138
+ * Init for the option page
139
+ *
140
+ * @access public
141
+ * @return void
142
+ * @author Nicolas Juen
143
+ */
144
+ function init() {
145
+ // Check if admin
146
+ if( !is_admin() )
147
+ return false;
148
+
149
+ // Get the image sizes
150
+ global $_wp_additional_image_sizes;
151
+ $options = get_option( SIS_OPTION );
152
+
153
+ // Get the sizes and add the settings
154
+ foreach ( get_intermediate_image_sizes() as $s ) {
155
+ // Don't make the original sizes or numeric sizes that appear
156
+ if( in_array( $s, $this->original ) || is_integer( $s ) )
157
+ continue;
158
+
159
+ // Set width
160
+ if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) // For theme-added sizes
161
+ $width = intval( $_wp_additional_image_sizes[$s]['width'] );
162
+ else // For default sizes set in options
163
+ $width = get_option( "{$s}_size_w" );
164
+
165
+ // Set height
166
+ if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) // For theme-added sizes
167
+ $height = intval( $_wp_additional_image_sizes[$s]['height'] );
168
+ else // For default sizes set in options
169
+ $height = get_option( "{$s}_size_h" );
170
+
171
+ //Set crop
172
+ if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) { // For theme-added sizes
173
+ $crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
174
+ } else {
175
+ // For default sizes set in options
176
+ $crop = get_option( "{$s}_crop" );
177
+ }
178
+
179
+ // Add the setting field for this size
180
+ 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 ) );
181
+ }
182
+
183
+ // Register the setting for media option page
184
+ register_setting( 'media', SIS_OPTION );
185
+
186
+ // Add the button
187
+ add_settings_field( 'add_size_button', __( 'Add a new size', 'sis' ), array( &$this, 'addSizeButton' ), 'media' );
188
+
189
+ // Add legend
190
+ add_settings_field( 'add_legend', __( 'Legend of the sizes', 'sis' ), array( &$this, 'addLegend' ), 'media' );
191
+
192
+ // Add php button
193
+ add_settings_field( 'get_php_button', __( 'Get php for theme', 'sis' ), array( &$this, 'getPhpButton' ), 'media' );
194
+
195
+ // Add section for the thumbnail regeneration
196
+ add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'sis' ), array( &$this, 'thumbnailRegenerate' ), 'media' );
197
+ }
198
+
199
+ /**
200
+ * Display the row of the image size
201
+ *
202
+ * @access public
203
+ * @param mixed $args
204
+ * @return void
205
+ * @author Nicolas Juen
206
+ */
207
+ public function imageSizes( $args ) {
208
+
209
+ if( is_integer( $args['name'] ) )
210
+ return false;
211
+
212
+ // Get the options
213
+ $sizes = (array)get_option( SIS_OPTION );
214
+
215
+ // Get the vars
216
+ $height = isset( $sizes[$args['name']]['h'] )? $sizes[$args['name']]['h'] : $args['height'] ;
217
+ $width = isset( $sizes[$args['name']]['w'] )? $sizes[$args['name']]['w'] : $args['width'] ;
218
+ $crop = isset( $sizes[$args['name']]['c'] ) && !empty( $sizes[$args['name']]['c'] )? $sizes[$args['name']]['c'] : $args['c'] ;
219
+ $show = isset( $sizes[$args['name']]['s'] ) && !empty( $sizes[$args['name']]['s'] )? '1' : '0' ;
220
+ $custom = isset( $sizes[$args['name']]['custom'] ) && !empty( $sizes[$args['name']]['custom'] )? '1' : '0' ;
221
+ ?>
222
+ <input type="hidden" value="<?php esc_attr_e( $args['name'] ); ?>" name="image_name" />
223
+ <?php if( $custom ): ?>
224
+ <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" type="hidden" id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][custom]' ); ?>" value="1" />
225
+ <?php else: ?>
226
+ <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" type="hidden" id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][theme]' ); ?>" value="1" />
227
+ <?php endif; ?>
228
+ <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>">
229
+ <?php _e( 'Maximum width', 'sis'); ?>
230
+ <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" class='w small-text' type="number" step='1' min='0' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][w]' ); ?>" base_w='<?php esc_attr_e( $width ); ?>' value="<?php esc_attr_e( $width ); ?>" />
231
+ </label>
232
+ <label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>">
233
+ <?php _e( 'Maximum height', 'sis'); ?>
234
+ <input name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" class='h small-text' type="number" step='1' min='0' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][h]' ); ?>" base_h='<?php esc_attr_e( $height ); ?>' value="<?php esc_attr_e( $height ); ?>" />
235
+ </label>
236
+ <span class="size_options">
237
+ <input type='checkbox' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" <?php checked( $crop, 1 ) ?> class="c crop" base_c='<?php esc_attr_e( $crop ); ?>' name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" value="1" />
238
+ <label class="c" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Crop ?', 'sis'); ?></label>
239
+
240
+ <input type='checkbox' id="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][s]'); ?>" <?php checked( $show, 1 ) ?> class="s show" base_s='<?php esc_attr_e( $show ); ?>' name="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][s]'); ?>" value="1" />
241
+ <label class="s" for="<?php esc_attr_e( 'custom_image_sizes['.$args['name'].'][s]'); ?>"><?php _e( 'Show in post insertion ?', 'sis'); ?></label>
242
+ </span>
243
+ <span class="delete_size"><?php _e( 'Delete', 'sis'); ?></span>
244
+ <span class="add_size validate_size"><?php _e( 'Update', 'sis'); ?></span>
245
+
246
+ <input type="hidden" class="deleteSize" value='<?php echo wp_create_nonce( 'delete_'.$args['name'] ); ?>' />
247
+ <?php }
248
+
249
+ /**
250
+ * Add the button to add a size
251
+ *
252
+ * @access public
253
+ * @return void
254
+ * @author Nicolas Juen
255
+ */
256
+ public function addSizeButton() { ?>
257
+ <input type="button" class="button-secondary action" id="add_size" value="<?php esc_attr_e( 'Add a new size of thumbnail', 'sis'); ?>" />
258
+ <?php
259
+ }
260
+
261
+ /**
262
+ * Add the button to get the php for th sizes
263
+ *
264
+ * @access public
265
+ * @return void
266
+ * @author Nicolas Juen
267
+ */
268
+ public function getPhpButton() { ?>
269
+ <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'sis'); ?>" />
270
+ <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>
271
+ <code></code>
272
+ <?php
273
+ }
274
+
275
+ /**
276
+ * Add the legend fo the colors
277
+ *
278
+ * @access public
279
+ * @return void
280
+ * @author Nicolas Juen
281
+ */
282
+ public function addLegend() { ?>
283
+ <?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'); ?>
284
+ <?php
285
+ }
286
+
287
+ /**
288
+ * Display the Table of sizes and post types for regenerating
289
+ *
290
+ * @access public
291
+ * @return void
292
+ * @author Nicolas Juen
293
+ */
294
+ public function thumbnailRegenerate() {
295
+ // Get the sizes
296
+ global $_wp_additional_image_sizes;
297
+ ?>
298
+ <input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>' />
299
+ <input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>' />
300
+ <input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>' />
301
+ <div id="sis-regen">
302
+ <div class="wrapper" style="">
303
+ <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'sis'); ?> </h4>
304
+ <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
305
+ <thead>
306
+ <tr>
307
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
308
+ <th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
309
+ <th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
310
+ <th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
311
+ <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
312
+ </tr>
313
+ </thead>
314
+ <tbody>
315
+ <?php
316
+ // Display the sizes in the array
317
+ foreach ( get_intermediate_image_sizes() as $s ):
318
+ // Don't make or numeric sizes that appear
319
+ if( is_integer( $s ) )
320
+ continue;
321
+
322
+ if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) // For theme-added sizes
323
+ $width = intval( $_wp_additional_image_sizes[$s]['width'] );
324
+ else // For default sizes set in options
325
+ $width = get_option( "{$s}_size_w" );
326
+
327
+ if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) // For theme-added sizes
328
+ $height = intval( $_wp_additional_image_sizes[$s]['height'] );
329
+ else // For default sizes set in options
330
+ $height = get_option( "{$s}_size_h" );
331
+
332
+ if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) // For theme-added sizes
333
+ $crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
334
+ else // For default sizes set in options
335
+ $crop = get_option( "{$s}_crop" );
336
+ ?>
337
+ <tr>
338
+ <th class="check-column">
339
+ <input type="checkbox" class="thumbnails" id="<?php echo $s ?>" name="thumbnails[]" checked="checked" value="<?php echo esc_attr( $s ); ?>" />
340
+ </th>
341
+ <th>
342
+ <label for="<?php esc_attr_e( $s ); ?>">
343
+ <?php esc_html_e( $s ); ?>
344
+ </label>
345
+ </th>
346
+ <th>
347
+ <label for="<?php esc_attr_e( $s ); ?>">
348
+ <?php esc_html_e( $width); ?> px
349
+ </label>
350
+ </th>
351
+ <th>
352
+ <label for="<?php esc_attr_e( $s ); ?>">
353
+ <?php esc_html_e( $height ); ?> px
354
+ </label>
355
+ </th>
356
+ <th>
357
+ <label for="<?php esc_attr_e( $s ); ?>">
358
+ <?php echo ( $crop == 1 )? __( 'yes', 'sis' ):__( 'no', 'sis' ); ?>
359
+ </label>
360
+ </th>
361
+ </tr>
362
+ <?php endforeach;?>
363
+ </tbody>
364
+ <tfoot>
365
+ <tr>
366
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
367
+ <th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
368
+ <th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
369
+ <th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
370
+ <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
371
+ </tr>
372
+ </tfoot>
373
+ </table>
374
+
375
+ <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'sis'); ?></h4>
376
+ <table cellspacing="0" class="widefat page fixed sis">
377
+ <thead>
378
+ <tr>
379
+ <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
380
+ <th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
381
+ </tr>
382
+ </thead>
383
+ <tbody>
384
+ <?php
385
+ // Diplay the post types table
386
+ foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $ptype ):
387
+ ?>
388
+ <tr>
389
+ <th class="check-column">
390
+ <label for="<?php esc_attr_e( $ptype->name ); ?>">
391
+ <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 ); ?>" />
392
+ </label>
393
+ </th>
394
+ <th>
395
+ <label for="<?php esc_attr_e( $ptype->name ); ?>">
396
+ <em><?php esc_html_e( $ptype->labels->name ); ?></em>
397
+ </label>
398
+ </th>
399
+ </tr>
400
+ <?php endforeach;?>
401
+ </tbody>
402
+ <tfoot>
403
+ <tr>
404
+ <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
405
+ <th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
406
+ </tr>
407
+ </tfoot>
408
+ </table>
409
+ </div>
410
+ </div>
411
+ <div >
412
+ <div id="regenerate_message"></div>
413
+ <div class="progress">
414
+ <div class=" progress-percent ui-widget">
415
+ <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
416
+ <p>
417
+ <span class="ui-icon ui-icon-info" style="float: left; margin-right: .7em;"></span>
418
+ <span class="text">0%</span>
419
+ </p>
420
+ </div>
421
+ </div>
422
+ </div>
423
+ <div class="ui-widget" id="time">
424
+ <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
425
+ <p>
426
+ <span class="ui-icon ui-icon-info" style="float: left; margin-right: .7em;"></span>
427
+ <span><strong><?php _e( 'End time calculated :', 'sis' ); ?></strong> <span class='time_message'>Calculating...</span> </span>
428
+ </p>
429
+ <ul class="messages"></ul>
430
+ </div>
431
+ </div>
432
+ <div id="error_messages">
433
+ <p>
434
+ <ol class="messages">
435
+ </ol>
436
+ </p>
437
+ </div>
438
+ <div id="thumb"><h4><?php _e( 'Last image:', 'sis'); ?></h4><img id="thumb-img" /></div>
439
+ <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'sis' ) ?>" />
440
+ </div>
441
+ <?php
442
+ }
443
+
444
+ /**
445
+ * Add a size by Ajax
446
+ *
447
+ * @access public
448
+ * @return void
449
+ * @author Nicolas Juen
450
+ */
451
+ public function ajaxAddSize() {
452
+
453
+ // Get the nonce
454
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
455
+
456
+ // Get old options
457
+ $sizes = (array)get_option( SIS_OPTION );
458
+
459
+ // Check entries
460
+ $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ): '' ;
461
+ $height = !isset( $_POST['height'] )? 0 : absint( $_POST['height'] );
462
+ $width = !isset( $_POST['width'] )? 0 : absint( $_POST['width'] );
463
+ $crop = isset( $_POST['crop'] ) && $_POST['crop'] == 'false' ? false : true;
464
+ $show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
465
+
466
+ // Check the nonce
467
+ if( !wp_verify_nonce( $nonce , 'add_size' ) ) {
468
+ echo 0;
469
+ die();
470
+ }
471
+
472
+ // If no name given do not save
473
+ if( empty( $name ) ) {
474
+ echo 0;
475
+ die();
476
+ }
477
+
478
+ // Make values
479
+ $values = array( 'custom' => 1, 'w' => $width , 'h' => $height, 'c' => $crop, 's' => $show );
480
+
481
+ // If the size have not changed return 2
482
+ if( isset( $sizes[$name] ) && $sizes[$name] === $values ) {
483
+ echo 2;
484
+ die();
485
+ }
486
+
487
+ // Put the new values
488
+ $sizes[$name] = $values;
489
+
490
+ // display update result
491
+ echo (int)update_option( 'custom_image_sizes', $sizes );
492
+ die();
493
+ }
494
+
495
+ /**
496
+ * Remove a size by Ajax
497
+ *
498
+ * @access public
499
+ * @return void
500
+ * @author Nicolas Juen
501
+ */
502
+ public function ajaxRemoveSize() {
503
+
504
+ // Get old options
505
+ $sizes = (array)get_option( SIS_OPTION );
506
+
507
+ // Get the nonce and name
508
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
509
+ $name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ): '' ;
510
+
511
+ // Check the nonce
512
+ if( !wp_verify_nonce( $nonce , 'delete_'.$name ) ) {
513
+ echo 0;
514
+ die();
515
+ }
516
+
517
+ // Remove the size
518
+ unset( $sizes[sanitize_title( $name )] );
519
+ unset( $sizes[0] );
520
+
521
+ // Display the results
522
+ echo (int)update_option( SIS_OPTION, $sizes );
523
+ die();
524
+ }
525
+
526
+ /**
527
+ * Display the add_image_size for the registered sizes
528
+ *
529
+ * @access public
530
+ * @return void
531
+ */
532
+ public function ajaxGetSizes() {
533
+ global $_wp_additional_image_sizes;
534
+
535
+ foreach ( get_intermediate_image_sizes() as $s ):
536
+
537
+ // Don't make the original sizes
538
+ if( in_array( $s, $this->original ) )
539
+ continue;
540
+
541
+ if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) // For theme-added sizes
542
+ $width = intval( $_wp_additional_image_sizes[$s]['width'] );
543
+ else // For default sizes set in options
544
+ $width = get_option( "{$s}_size_w" );
545
+
546
+ if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) // For theme-added sizes
547
+ $height = intval( $_wp_additional_image_sizes[$s]['height'] );
548
+ else // For default sizes set in options
549
+ $height = get_option( "{$s}_size_h" );
550
+
551
+ if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) // For theme-added sizes
552
+ $crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
553
+ else // For default sizes set in options
554
+ $crop = get_option( "{$s}_crop" );
555
+
556
+ $crop = ( $crop == 0 )? 'false' : 'true' ;
557
+ ?>
558
+ add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop ?> );<br />
559
+ <?php endforeach;
560
+
561
+ die();
562
+ }
563
+
564
+ /**
565
+ * Rebuild the image
566
+ *
567
+ * @access public
568
+ * @return void
569
+ * @author Nicolas Juen
570
+ */
571
+ public function ajaxThumbnailRebuildAjax() {
572
+ global $wpdb;
573
+
574
+ // Get the nonce
575
+ $nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
576
+
577
+ // Time a the begining
578
+ $start_time = microtime(true);
579
+
580
+ // Get the action
581
+ $action = $_POST["do"];
582
+
583
+ // Get the thumbnails
584
+ $thumbnails = isset( $_POST['thumbnails'] )? $_POST['thumbnails'] : NULL;
585
+
586
+ if ( $action == "getlist" ) {
587
+ // Check the nonce
588
+ if( !wp_verify_nonce( $nonce , 'getList' ) ) {
589
+ echo json_encode( array( ) );
590
+ die();
591
+ }
592
+
593
+ if ( isset( $_POST['post_types'] ) && !empty( $_POST['post_types'] ) ) {
594
+
595
+ // Get image medias
596
+ $whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
597
+
598
+ // Get all parent from post type
599
+ $attachments = $wpdb->get_results( "SELECT *
600
+ FROM $wpdb->posts
601
+ WHERE 1 = 1
602
+ AND post_type = 'attachment'
603
+ $whichmimetype
604
+ AND post_parent IN (
605
+ SELECT DISTINCT ID
606
+ FROM $wpdb->posts
607
+ WHERE post_type IN ('".implode( "', '", $_POST['post_types'] )."')
608
+ )" );
609
+
610
+ } else {
611
+ $attachments =& get_children( array(
612
+ 'post_type' => 'attachment',
613
+ 'post_mime_type' => 'image',
614
+ 'numberposts' => -1,
615
+ 'post_status' => null,
616
+ 'post_parent' => null, // any parent
617
+ 'output' => 'object',
618
+ ) );
619
+ }
620
+
621
+ // Get the attachments
622
+ foreach ( $attachments as $attachment ) {
623
+ $res[] = array('id' => $attachment->ID, 'title' => $attachment->post_title);
624
+ }
625
+ // Return the Id's and Title of medias
626
+ die( json_encode( $res ) );
627
+ } else if ( $action == "regen" ) {
628
+
629
+ // Check the nonce
630
+ if( !wp_verify_nonce( $nonce , 'regen' ) ) {
631
+ echo json_encode( array( 'error' => _e( 'Trying to cheat ?', 'sis' ) ) );
632
+ die();
633
+ }
634
+
635
+ // Get the id
636
+ $id = $_POST["id"];
637
+
638
+ // Check Id
639
+ if( (int)$id == 0 ) {
640
+ die( json_encode( array( 'time' => round( microtime( true ) - $start_time, 4 ), 'error' => __( 'No id given in POST datas.', 'sis' ) ) ) );
641
+ }
642
+
643
+ // Get the path
644
+ $fullsizepath = get_attached_file( $id );
645
+
646
+ // Regen the attachment
647
+ if ( FALSE !== $fullsizepath && @file_exists( $fullsizepath ) ) {
648
+ set_time_limit( 30 );
649
+ if( wp_update_attachment_metadata( $id, $this->wp_generate_attachment_metadata_custom( $id, $fullsizepath, $thumbnails ) ) == false )
650
+ 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 ) ) ) ) );
651
+ } else {
652
+ 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 ) ) ) ) );
653
+ }
654
+ // Display the attachment url for feedback
655
+ die( json_encode( array( 'time' => round( microtime( true ) - $start_time, 4 ) , 'src' => wp_get_attachment_thumb_url( $id ), 'title' => get_the_title( $id ) ) ) );
656
+ }
657
+ }
658
+
659
+ /**
660
+ * Generate post thumbnail attachment meta data.
661
+ *
662
+ * @since 2.1.0
663
+ *
664
+ * @param int $attachment_id Attachment Id to process.
665
+ * @param string $file Filepath of the Attached image.
666
+ * @return mixed Metadata for attachment.
667
+ */
668
+ public function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = NULL ) {
669
+ $attachment = get_post( $attachment_id );
670
+
671
+ $meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
672
+
673
+ $metadata = array();
674
+ if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
675
+ $imagesize = getimagesize( $file );
676
+ $metadata['width'] = $imagesize[0];
677
+ $metadata['height'] = $imagesize[1];
678
+ list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96);
679
+ $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
680
+
681
+ // Make the file path relative to the upload dir
682
+ $metadata['file'] = _wp_relative_upload_path($file);
683
+
684
+ // make thumbnails and other intermediate sizes
685
+ global $_wp_additional_image_sizes;
686
+
687
+ foreach ( get_intermediate_image_sizes() as $s ) {
688
+ $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE );
689
+ if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
690
+ $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes
691
+ else
692
+ $sizes[$s]['width'] = get_option( "{$s}_size_w" ); // For default sizes set in options
693
+ if ( isset( $_wp_additional_image_sizes[$s]['height'] ) )
694
+ $sizes[$s]['height'] = intval( $_wp_additional_image_sizes[$s]['height'] ); // For theme-added sizes
695
+ else
696
+ $sizes[$s]['height'] = get_option( "{$s}_size_h" ); // For default sizes set in options
697
+ if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) )
698
+ $sizes[$s]['crop'] = intval( $_wp_additional_image_sizes[$s]['crop'] ); // For theme-added sizes
699
+ else
700
+ $sizes[$s]['crop'] = get_option( "{$s}_crop" ); // For default sizes set in options
701
+ }
702
+
703
+ $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
704
+
705
+ foreach ( $sizes as $size => $size_data ) {
706
+ if( isset( $thumbnails ) )
707
+ if( !in_array( $size, $thumbnails ) ) {
708
+ continue;
709
+ }
710
+
711
+ $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
712
+
713
+ // Remove the size from the orignal sizes for after work
714
+ unset( $meta_datas['size'][$size] );
715
+
716
+ if ( $resized )
717
+ $metadata['sizes'][$size] = $resized;
718
+ }
719
+
720
+ // Only if not all sizes
721
+ if( is_array( $thumbnails ) ) {
722
+ // Fill the array with the other sizes not have to be done
723
+ foreach( $meta_datas['sizes'] as $name => $fsize ) {
724
+ $metadata['sizes'][$name] = $fsize;
725
+ }
726
+ }
727
+
728
+ // fetch additional metadata from exif/iptc
729
+ $image_meta = wp_read_image_metadata( $file );
730
+ if ( $image_meta )
731
+ $metadata['image_meta'] = $image_meta;
732
+ }
733
+ return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
734
+ }
735
+
736
+ /**
737
+ * Add the custom sizes to the image sizes in article edition
738
+ *
739
+ * @access public
740
+ * @param array $form_fields
741
+ * @param object $post
742
+ * @return void
743
+ * @author Nicolas Juen
744
+ * @author Additional Image Sizes (zui)
745
+ */
746
+ public function sizesInForm( $form_fields, $post ) {
747
+ // Protect from being view in Media editor where there are no sizes
748
+ if ( isset( $form_fields['image-size'] ) ) {
749
+ $out = NULL;
750
+ $size_names = array();
751
+ $sizes_custom = get_option( SIS_OPTION );
752
+
753
+ if ( is_array( $sizes_custom ) ) {
754
+ foreach( $sizes_custom as $key => $value ) {
755
+ if( isset( $value['s'] ) && $value['s'] == 1 )
756
+ $size_names[$key] = $key;
757
+ }
758
+ }
759
+ foreach ( $size_names as $size => $label ) {
760
+ $downsize = image_downsize( $post->ID, $size );
761
+
762
+ // is this size selectable?
763
+ $enabled = ( $downsize[3] || 'full' == $size );
764
+ $css_id = "image-size-{$size}-{$post->ID}";
765
+
766
+ // We must do a clumsy search of the existing html to determine is something has been checked yet
767
+ if ( FALSE === strpos( 'checked="checked"', $form_fields['image-size']['html'] ) ) {
768
+
769
+ if ( empty($check) )
770
+ $check = get_user_setting( 'imgsize' ); // See if they checked a custom size last time
771
+
772
+ $checked = '';
773
+
774
+ // if this size is the default but that's not available, don't select it
775
+ if ( $size == $check || str_replace( " ", "", $size ) == $check ) {
776
+ if ( $enabled )
777
+ $checked = " checked='checked'";
778
+ else
779
+ $check = '';
780
+ } elseif ( !$check && $enabled && 'thumbnail' != $size ) {
781
+ // if $check is not enabled, default to the first available size that's bigger than a thumbnail
782
+ $check = $size;
783
+ $checked = " checked='checked'";
784
+ }
785
+ }
786
+ $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 />";
787
+
788
+ $html .= "<label for='{$css_id}'>$label</label>";
789
+ // only show the dimensions if that choice is available
790
+ if ( $enabled )
791
+ $html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d&nbsp;&times;&nbsp;%d)", $downsize[1], $downsize[2] ). "</label>";
792
+
793
+ $html .= '</div>';
794
+
795
+ $out .= $html;
796
+ }
797
+ $form_fields['image-size']['html'] .= $out;
798
+ } // End protect from Media editor
799
+
800
+ return $form_fields;
801
+ }
802
+ }
803
+ ?>
inc/class.client.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function(){
2
+ jQuery( '.sis-regenerate-one' ).click( function( e ) {
3
+ e.preventDefault();
4
+ var regenerate = {
5
+ list : '',
6
+ percent : '' ,
7
+ el : '',
8
+ id : '',
9
+ messageZone : '',
10
+ init: function( el ) {
11
+ this.el = jQuery( el );
12
+ id = jQuery( el ).attr( 'id' );
13
+ this.id = id.replace( 'post-', '' );
14
+
15
+ this.list = { 'id' : this.id, 'title' : 'titre' };
16
+
17
+ if( this.el.find('.title em').size() == 0 )
18
+ this.el.find('.title strong').after('<em/>');
19
+ this.messageZone = this.el.find('.title em');
20
+
21
+ if( !this.el.hasClass( 'ajaxing' ) )
22
+ this.regenItem();
23
+ },
24
+ setMessage : function( msg ) {
25
+ // Display the message
26
+ this.messageZone.html( ' - '+ msg ).addClass( 'updated' ).addClass( 'fade' ).show();
27
+ },
28
+ regenItem : function( ) {
29
+ var _self = this;
30
+ var wp_nonce = jQuery('input.regen').val();
31
+
32
+ jQuery.ajax( {
33
+ url: sis.ajaxUrl,
34
+ type: "POST",
35
+ dataType: 'json',
36
+ data: "action=sis_ajax_thumbnail_rebuild&do=regen&id=" + this.list.id+'&nonce='+wp_nonce,
37
+ beforeSend : function() {
38
+ _self.el.fadeTo( 'fast' ,'0.2' ).addClass('ajaxing');
39
+ },
40
+ success: function( r ) {
41
+ var message ='';
42
+ // Check if error or a message in response
43
+ if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
44
+ if( typeof r !== 'object' )
45
+ message = sis.phpError;
46
+ else
47
+ message = r.error
48
+ } else {
49
+ message = sis.soloRegenerated.replace( '%s', r.time );
50
+ }
51
+ _self.setMessage( message );
52
+ _self.el.fadeTo( 'fast' ,'1' ).removeClass('ajaxing');
53
+ }
54
+ });
55
+
56
+ }
57
+ }
58
+ regenerate.init( jQuery( this ).closest( 'tr' ) );
59
+ });
60
+ });
js/sis-attachments.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ jQuery(function(){jQuery(".sis-regenerate-one").click(function(c){c.preventDefault();({list:"",percent:"",el:"",id:"",messageZone:"",init:function(a){this.el=jQuery(a);id=jQuery(a).attr("id");this.id=id.replace("post-","");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(a){this.messageZone.html(" - "+a).addClass("updated").addClass("fade").show()},
2
+ regenItem:function(){var a=this,c=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="+c,beforeSend:function(){a.el.fadeTo("fast","0.2").addClass("ajaxing")},success:function(b){var c="",c=!b.src||!b.time||b.error||"object"!==typeof b?"object"!==typeof b?sis.phpError:b.error:sis.soloRegenerated.replace("%s",b.time);a.setMessage(c);a.el.fadeTo("fast","1").removeClass("ajaxing")}})}}).init(jQuery(this).closest("tr"))})});
js/sis.js ADDED
@@ -0,0 +1,685 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ els = jQuery( '<span />' )
305
+ .addClass( 'size_options' )
306
+ .append(
307
+ jQuery( '<input />' )
308
+ .attr( {
309
+ type: 'checkbox',
310
+ name: 'custom_image_sizes[' + name + '][c]',
311
+ id: 'custom_image_sizes[' + name + '][c]',
312
+ base_c:0
313
+ } )
314
+ .val( "1" )
315
+ .addClass( 'c crop' )
316
+ )
317
+ .append(
318
+ jQuery( '<label />' )
319
+ .attr( {
320
+ 'for': 'custom_image_sizes[' + name + '][c]',
321
+ id: 'custom_image_sizes[' + name + '][c]',
322
+ 'class': 'c',
323
+ title:sis.crop
324
+ } )
325
+ .text( sis.crop )
326
+ )
327
+ .append(
328
+ jQuery( '<input />' )
329
+ .attr( {
330
+ type: 'checkbox',
331
+ name: 'custom_image_sizes[' + name + '][s]',
332
+ id: 'custom_image_sizes[' + name + '][s]',
333
+ base_s:0
334
+ } )
335
+ .val( "1" )
336
+ .addClass( 's show' )
337
+ )
338
+ .append(
339
+ jQuery( '<label />' )
340
+ .attr( {
341
+ 'for': 'custom_image_sizes[' + name + '][s]',
342
+ id: 'custom_image_sizes[' + name + '][s]',
343
+ 'class': 's',
344
+ title:sis.show
345
+ } )
346
+ .text( sis.show )
347
+ );
348
+ els.appendTo(tdEl);
349
+
350
+ jQuery( '<div />' ).text( sis.deleteImage ).addClass('delete_size').appendTo( tdEl );
351
+ jQuery( '<div />' ).text( sis.validateButton ).addClass('add_size validate_size').appendTo( tdEl );
352
+
353
+ // Add the row to the current list
354
+ jQuery('#' + id).closest( 'tr' ).html( thEl.after( tdEl ) );
355
+
356
+ if( sis_small == true ){
357
+ // Refresh the buttons
358
+ this.setButtonsSmall();
359
+ } else {
360
+ // Refresh the buttons
361
+ this.setButtons();
362
+ }
363
+ },
364
+ deleteSize: function( e, el ) {
365
+ e.preventDefault();
366
+ // Check if user want to delete or not
367
+ var confirmation = confirm( sis.confirmDelete );
368
+
369
+ // Delete if ok else not delete
370
+ if( confirmation == true ) {
371
+ // Remove from the list and the array
372
+ jQuery( el ).closest( 'tr' ).remove();
373
+ this.ajaxUnregister( el );
374
+ }
375
+ },
376
+ getPhp : function( e, el ) {
377
+ e.preventDefault();
378
+ // Get parent element
379
+ var parent = jQuery( el ).closest( 'tr' );
380
+
381
+ jQuery.ajax( {
382
+ url: sis.ajaxUrl,
383
+ type: "POST",
384
+ data: { action : "get_sizes" },
385
+ beforeSend: function() {
386
+ // Remove classes of status
387
+ parent.removeClass( 'addPending' );
388
+ parent.addClass( 'addPending' );
389
+ },
390
+ success: function( result ) {
391
+ // Add the classes for the status
392
+ jQuery( '#get_php' ).nextAll( 'code' ).html( '<br />' + result).show().css( { 'display' : 'block' } );
393
+ parent.removeClass( 'addPending' );
394
+ }
395
+ } );
396
+ },
397
+ ajaxRegister: function( e, el ) {
398
+ e.preventDefault();
399
+
400
+ // Get the vars
401
+ var _self = this;
402
+ var parentTable = jQuery( el ).closest( 'table' );
403
+ var timer;
404
+ var wp_nonce = jQuery( '.addSize' ).val();
405
+ var parent = jQuery( el ).closest( 'tr' );
406
+ var n = parent.find( 'input[name="image_name"]' ).val();
407
+ var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
408
+ var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
409
+
410
+ if( c == false || c == undefined ) {
411
+ c = false;
412
+ } else {
413
+ c = true;
414
+ }
415
+
416
+ if( s == false || s == undefined ) {
417
+ s = false;
418
+ } else {
419
+ s = true;
420
+ }
421
+
422
+ var w = parseInt( parent.find( 'input.w' ).val() );
423
+ var h = parseInt( parent.find( 'input.h' ).val() );
424
+
425
+ if( !parentTable.hasClass( 'ajaxing' ) ) {
426
+ jQuery.ajax({
427
+ url: sis.ajaxUrl,
428
+ type: "POST",
429
+ dataType :'json',
430
+ data: { action : "add_size", width: w, height: h, crop: c, name: n, show: s, nonce : wp_nonce },
431
+ beforeSend: function() {
432
+ // Remove status and set pending
433
+ parent.removeClass();
434
+ parent.addClass( 'addPending' );
435
+ parentTable.addClass( 'ajaxing' );
436
+ },
437
+ success: function(result) {
438
+ // Set basic class and remove pending
439
+ var classTr = '';
440
+ parent.removeClass();
441
+ parentTable.removeClass( 'ajaxing' )
442
+
443
+ // Check the result for the different messages
444
+ if( result == 0 ) {
445
+ classTr = 'errorAdding';
446
+ } else if( result == 2 ) {
447
+ classTr = 'notChangedAdding';
448
+
449
+ // add/update to the array with the status class
450
+ _self.addToArray( n, w, h, c, classTr );
451
+ } else {
452
+ classTr = 'successAdding';
453
+
454
+ // add/update to the array with the status class
455
+ _self.addToArray( n, w, h, c, classTr );
456
+ }
457
+
458
+ // Add the new sizes values for checking of changed or not
459
+ parent.find( 'input.h' ).attr( { base_h : h } );
460
+ parent.find( 'input.w' ).attr( { base_w : w } );
461
+ parent.find( 'input.c' ).attr( { base_c : c } );
462
+ parent.find( 'input.s' ).attr( { base_s : s } );
463
+
464
+ // Add the generated class
465
+ parent.addClass( classTr );
466
+ parent.find( 'td' ).removeClass( "notSaved" );
467
+
468
+ // Change the button text
469
+ parent.find( '.add_size' ).removeClass('validate_size').hide().children('.ui-button-text' ).text( sis.update ) ;
470
+
471
+ clearTimeout( timer );
472
+ // Remove classes after 3 seconds
473
+ timer = setTimeout(function() {
474
+ parent.removeClass( 'errorAdding notChangedAdding successAdding' );
475
+ }, 3 * 1000 );
476
+ }
477
+ });
478
+ }
479
+ },
480
+ ajaxUnregister: function( el ) {
481
+ // Get name and _self object
482
+ var _self = this;
483
+ var n = jQuery( el ).closest('tr').find( 'input[name="image_name"]' ).val();
484
+ var wp_nonce = jQuery( el ).closest('tr').find( 'input.deleteSize' ).val();
485
+
486
+ // Make the ajax call
487
+ jQuery.ajax({
488
+ url: sis.ajaxUrl,
489
+ type: "POST",
490
+ data: { action : "remove_size", name: n, nonce : wp_nonce },
491
+ success: function(result) {
492
+ _self.removeFromArray( el );
493
+ }
494
+ });
495
+ },
496
+ addToArray: function( n, w, h, c, s ) {
497
+ // Get the row for editing or updating
498
+ var testRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+n+'"]' );
499
+ var newRow = '';
500
+ var timer;
501
+
502
+ // Get the right newRow, updating or adding ?
503
+ if( testRow.length != 0 )
504
+ newRow = testRow.closest( 'tr' );
505
+ else
506
+ newRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody > tr:first' ).clone();
507
+
508
+ if( c == true )
509
+ c = sis.tr;
510
+ else
511
+ c = sis.fl;
512
+
513
+ // Set the datas with the given datas
514
+ newRow.find( 'th > label' ).attr( 'for', n )
515
+ .end()
516
+ .find( 'input.thumbnails' ).val( n ).attr( 'id', n ).end()
517
+ .find( 'th:nth-child(2) > label' ).text( n )
518
+ .end()
519
+ .find( 'th:nth-child(3) > label' ).text( w+'px' )
520
+ .end()
521
+ .find( 'th:nth-child(4) > label' ).text( h+'px' )
522
+ .end()
523
+ .find( 'th:nth-child(5) > label' ).text( c );
524
+
525
+ // If new then add the row
526
+ if( testRow.length == 0 )
527
+ newRow.appendTo( '#sis-regen .wrapper > table#sis_sizes > tbody' );
528
+
529
+ // Remove the previous status classes and add the status class
530
+ newRow.removeClass( 'errorAdding notChangedAdding successAdding' ).addClass( s );
531
+
532
+ clearTimeout( timer );
533
+ // Remove the statuses classes
534
+ timer = setTimeout(function() {
535
+ newRow.removeClass( 'errorAdding notChangedAdding successAdding' );
536
+ }, 3 * 1000 );
537
+ },
538
+ removeFromArray: function( el ) {
539
+ // get the name
540
+ var n = jQuery( el ).closest( 'tr' ).find( 'input[name=image_name]' ).val();
541
+
542
+ // Remove the given name from the array
543
+ jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody input[value="'+n+'"]' ).closest( 'tr' ).remove();
544
+ },
545
+ setButtons: function() {
546
+ // UI for delete,crop and add buttons
547
+ jQuery(".delete_size").button( {
548
+ icons: {
549
+ primary: 'ui-icon-circle-close'
550
+ },
551
+ text: true
552
+ } );
553
+ jQuery(".add_size").button( {
554
+ icons: {
555
+ primary: 'ui-icon-check'
556
+ },
557
+ text: true
558
+ } );
559
+ jQuery(".crop").button({
560
+ icons: {
561
+ primary: 'ui-icon-arrow-4-diag'
562
+ },
563
+ text: true
564
+ });
565
+ jQuery(".show").button({
566
+ icons: {
567
+ primary: 'ui-icon-lightbulb'
568
+ },
569
+ text: true
570
+ });
571
+ jQuery( '.size_options' ).buttonset();
572
+ },
573
+ setButtonsSmall: function() {
574
+ // UI for delete,crop and add buttons
575
+ jQuery(".delete_size").button( {icons: {
576
+ primary: 'ui-icon-circle-close'
577
+ },text: false} );
578
+ jQuery(".add_size").button( { icons: {
579
+ primary: 'ui-icon-check'
580
+ },text: false} );
581
+ jQuery(".crop").button({icons: {
582
+ primary: 'ui-icon-arrow-4-diag'
583
+ },text: false});
584
+ jQuery(".show").button( {icons: {
585
+ primary: 'ui-icon-lightbulb'
586
+ },text: false});
587
+ },
588
+ displayChange : function( el ) {
589
+ el = jQuery( el );
590
+ var parent = el.closest( 'tr' );
591
+
592
+ // Check not new size
593
+ if( parent.hasClass( 'new_size' ) )
594
+ return false;
595
+
596
+ var h_el = parent.find( 'input.h' );
597
+ var w_el = parent.find( 'input.w' );
598
+ var c_el = parent.find( 'input.c' );
599
+ var s_el = parent.find( 'input.s' );
600
+
601
+ var h = h_el.val();
602
+ var w = w_el.val();
603
+ var c = parent.find( 'label.c' ).hasClass( 'ui-state-active' );
604
+ var s = parent.find( 'label.s' ).hasClass( 'ui-state-active' );
605
+
606
+ var base_h = h_el.attr( 'base_h' );
607
+ var base_w = w_el.attr( 'base_w' );
608
+ var base_c = c_el.attr( 'base_c' );
609
+ var base_s = s_el.attr( 'base_s' );
610
+
611
+ if( base_c == '0' )
612
+ base_c = false;
613
+ else
614
+ base_c = true;
615
+
616
+ if( base_s == '0' )
617
+ base_s = false;
618
+ else
619
+ base_s = true;
620
+
621
+
622
+
623
+ if( h != base_h || w != base_w || c != base_c || s != base_s ) {
624
+ el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
625
+ } else {
626
+ el.closest( 'td' ).removeClass( 'notSaved' ).find('.add_size').css( 'display', 'none' );
627
+ }
628
+ }
629
+ }
630
+ jQuery(function() {
631
+
632
+ // Regeneration listener
633
+ jQuery( '#ajax_thumbnail_rebuild' ).click( function() { regenerate.checkStartRegenerating(); } );
634
+
635
+ // Add size button listener
636
+ jQuery('#add_size').click(function( e ){ sizes.add( e, this ); });
637
+
638
+ // Registering a new size listener
639
+ jQuery('.add_size_name').live( 'click',function( e ) { sizes.register( e, this ); } );
640
+
641
+ // Delete and Adding buttons
642
+ jQuery('.delete_size').live( 'click', function( e ) { sizes.deleteSize( e, this ); } );
643
+ jQuery('.add_size').live( 'click', function( e ) { sizes.ajaxRegister( e, this ); } );
644
+
645
+ jQuery( '.h,.w,.c,.s' ).live( 'click', function( e ) { sizes.displayChange( this ); } );
646
+
647
+ // Seup the getphp
648
+ jQuery('#get_php').click( function( e ){ sizes.getPhp( e, this ) } );
649
+ jQuery('#get_php').nextAll('code').hide();
650
+
651
+ // Colors for the theme / custom sizes
652
+ jQuery('span.custom_size').closest('tr').children('th').css( {
653
+ 'color': '#89D76A'
654
+ } );
655
+ jQuery('span.theme_size').closest('tr').children('th').css( {
656
+ 'color': '#F2A13A'
657
+ } );
658
+
659
+
660
+ jQuery(".add_size").hide();
661
+
662
+ // Error ajax handler
663
+ 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 );
664
+
665
+ // Display the errors of ajax queries
666
+ jQuery("#msg").ajaxError( function(event, request, settings ) {
667
+ 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 );
668
+ });
669
+
670
+ // Check resizing of the window
671
+ jQuery(window).bind('resize', sisCheckWindowSize );
672
+
673
+ function sisCheckWindowSize() {
674
+ if( window.innerWidth <= 820 && sis_small == false ) {
675
+ sizes.setButtonsSmall();
676
+ sis_small = true;
677
+ } else if( window.innerWidth > 820 && sis_small == true ){
678
+ sizes.setButtons();
679
+ sis_small = false;
680
+ }
681
+ }
682
+
683
+ // Set the buttons
684
+ sizes.setButtons();
685
+ });
js/sis.min.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ sis_small=!0;
2
+ var regenerate={post_types:"",thumbnails:"",list:"",cur:0,timeScript:[],dateScript:"",percent:"",getThumbnails:function(){var a=this,b=jQuery("input.thumbnails:checked");b.length!=jQuery('input.thumbnails[type="checkbox"]').length&&b.each(function(){a.thumbnails+="&thumbnails[]="+jQuery(this).val()})},getPostTypes:function(){var a=this,b=jQuery("input.post_types:checked");b.length!=jQuery('input.post_types[type="checkbox"]').length&&b.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,b=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="+b,beforeSend:function(){jQuery("#ajax_thumbnail_rebuild").attr("disabled",!0);a.setMessage(sis.reading);a.getThumbnails();a.getPostTypes()},success:function(c){if("object"!==typeof c)return a.reInit(),a.setMessage(sis.phpError),!1;jQuery("#time").show();a.list=c;a.curr=0;jQuery(".progress").show();a.regenItem()}})},regenItem:function(){var a=this,b=jQuery("input.regen").val();if(!this.list)return this.reInit(),
5
+ this.setMessage(sis.noMedia),!1;this.curr>=this.list.length?(b=new Date,this.reInit(),this.setMessage(sis.done+this.curr+" "+sis.messageRegenerated+sis.startedAt+" "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+sis.finishedAt+" "+b.getHours()+":"+b.getMinutes()+":"+b.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="+b,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(c){if(!c.src||!c.time||c.error||"object"!==typeof c){var b="",b="object"!==typeof c?sis.phpError:c.error;jQuery("#error_messages").addClass("error message");jQuery("#error_messages ul.messages").prepend("<li>"+
7
+ b+"</li>")}else{c.message&&jQuery("#time ul.messages").prepend("<li>"+c.message+"</li>");var b=new Date,g=new Date;jQuery("#thumb").show();jQuery("#thumb-img").attr("src",c.src);a.timeScript.push(c.time);for(var c=a.timeScript.length,e=0,d=0;d<c;d++)e+=a.timeScript[d];c=Math.round(1E3*e/c*a.list.length);b.setTime(a.dateScript.getTime()+c);g=a.s2t((b.getTime()-g.getTime())/1E3);a.setTimeMessage(b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+sis.or+g+sis.beforeEnd)}a.curr++;a.regenItem()}}))},s2t:function(a){var a=
8
+ a%86400,b=new Date(1970,0,1);b.setSeconds(a);var c=b.toTimeString().substr(0,8);86399<a&&(c=Math.floor((b-Date.parse("1/1/70"))/36E5)+c.substr(2));return c},reInit:function(){jQuery("#ajax_thumbnail_rebuild").removeAttr("disabled");jQuery(".progress, #thumb").hide()}},sizes={i:0,add:function(a,b){a.preventDefault();var c=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(c);
9
+ jQuery("<td />").append(jQuery("<input />").attr({type:"button",id:"validate_"+this.i}).val(sis.validate).addClass("button-secondary action add_size_name")).appendTo(c);jQuery(b).closest("tr").before(c);this.i++},register:function(a,b){a.preventDefault();var c=jQuery(b).closest("tr").children("th").find("input").val(),f=jQuery(b).closest("tr").children("th").find("input").attr("id"),g=jQuery(b).closest("tbody").find('input[value="'+c+'"]').length;if("thumbnail"==c||"medium"==c||"large"==c)return alert(sis.notOriginal),
10
+ !1;if(0!=g)return alert(sis.alreadyPresent),!1;var g=jQuery("<th />").attr("scope","row").text(sis.size+" "+c),e=jQuery("<td />");jQuery("<input />").attr({type:"hidden",name:"image_name"}).val(c).appendTo(e);jQuery("<input />").attr({type:"hidden",name:"custom_image_sizes["+c+"][custom]"}).val("1").appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+c+"][w]").addClass("sis-label").text(sis.maximumWidth).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+c+"][w]",
11
+ step:1,min:0,id:"custom_image_sizes["+c+"][w]",base_w:0}).val("0").addClass("w small-text")).appendTo(e);jQuery("<label />").attr("for","custom_image_sizes["+c+"][h]").addClass("sis-label").text(sis.maximumHeight).append(jQuery("<input />").attr({type:"number",name:"custom_image_sizes["+c+"][h]",step:1,min:0,id:"custom_image_sizes["+c+"][h]",base_h:0}).val("0").addClass("h small-text")).appendTo(e);els=jQuery("<span />").addClass("size_options").append(jQuery("<input />").attr({type:"checkbox",name:"custom_image_sizes["+
12
+ c+"][c]",id:"custom_image_sizes["+c+"][c]",base_c:0}).val("1").addClass("c crop")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+c+"][c]",id:"custom_image_sizes["+c+"][c]","class":"c",title:sis.crop}).text(sis.crop)).append(jQuery("<input />").attr({type:"checkbox",name:"custom_image_sizes["+c+"][s]",id:"custom_image_sizes["+c+"][s]",base_s:0}).val("1").addClass("s show")).append(jQuery("<label />").attr({"for":"custom_image_sizes["+c+"][s]",id:"custom_image_sizes["+c+"][s]","class":"s",
13
+ 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():this.setButtons()},deleteSize:function(a,b){a.preventDefault();!0==confirm(sis.confirmDelete)&&(jQuery(b).closest("tr").remove(),this.ajaxUnregister(b))},getPhp:function(a,b){a.preventDefault();var c=jQuery(b).closest("tr");
14
+ jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"get_sizes"},beforeSend:function(){c.removeClass("addPending");c.addClass("addPending")},success:function(a){jQuery("#get_php").nextAll("code").html("<br />"+a).show().css({display:"block"});c.removeClass("addPending")}})},ajaxRegister:function(a,b){a.preventDefault();var c=this,f=jQuery(b).closest("table"),g,e=jQuery(".addSize").val(),d=jQuery(b).closest("tr"),i=d.find('input[name="image_name"]').val(),h=d.find("label.c").hasClass("ui-state-active"),
15
+ j=d.find("label.s").hasClass("ui-state-active"),h=!1==h||void 0==h?!1:!0,j=!1==j||void 0==j?!1:!0,k=parseInt(d.find("input.w").val()),l=parseInt(d.find("input.h").val());f.hasClass("ajaxing")||jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:{action:"add_size",width:k,height:l,crop:h,name:i,show:j,nonce:e},beforeSend:function(){d.removeClass();d.addClass("addPending");f.addClass("ajaxing")},success:function(a){var b="";d.removeClass();f.removeClass("ajaxing");0==a?b="errorAdding":(b=
16
+ 2==a?"notChangedAdding":"successAdding",c.addToArray(i,k,l,h,b));d.find("input.h").attr({base_h:l});d.find("input.w").attr({base_w:k});d.find("input.c").attr({base_c:h});d.find("input.s").attr({base_s:j});d.addClass(b);d.find("td").removeClass("notSaved");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 b=this,
17
+ c=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:c,nonce:f},success:function(){b.removeFromArray(a)}})},addToArray:function(a,b,c,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",
18
+ 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(b+"px").end().find("th:nth-child(4) > label").text(c+"px").end().find("th:nth-child(5) > label").text(f);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=
19
+ 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"},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()},
20
+ 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});jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!1})},displayChange:function(a){var a=jQuery(a),b=a.closest("tr");if(b.hasClass("new_size"))return!1;var c=b.find("input.h"),f=b.find("input.w"),g=b.find("input.c"),e=b.find("input.s"),d=
21
+ c.val(),i=f.val(),h=b.find("label.c").hasClass("ui-state-active"),b=b.find("label.s").hasClass("ui-state-active"),c=c.attr("base_h"),f=f.attr("base_w"),g=g.attr("base_c"),e=e.attr("base_s");d!=c||i!=f||h!=("0"==g?!1:!0)||b!=("0"==e?!1:!0)?a.closest("td").addClass("notSaved").find(".add_size").css("display","inline-block"):a.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}};
22
+ 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").live("click",function(){sizes.displayChange(this)});jQuery("#get_php").click(function(a){sizes.getPhp(a,
23
+ 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);
24
+ jQuery("#msg").ajaxError(function(a,b,c){jQuery(this).find(".msg").append("<li>"+sis.ajaxErrorHandler+" "+c.url+", status "+b.status+" : "+b.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 DELETED
Binary file
languages/simple-image-sizes-de_DE.po DELETED
@@ -1,367 +0,0 @@
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 DELETED
Binary file
languages/simple-image-sizes-fr_FR.po DELETED
@@ -1,324 +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: 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 DELETED
Binary file
languages/simple-image-sizes-he_IL.po DELETED
@@ -1,471 +0,0 @@
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 DELETED
@@ -1,274 +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: 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 ADDED
Binary file
languages/sis-de_DE.po ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
Binary file
languages/sis-fr_FR.po ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 2011-12-19 23:02+0100\n"
8
+ "PO-Revision-Date: 2011-12-19 23:04+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:69
22
+ msgid "Reading attachments..."
23
+ msgstr "Chargement des médias..."
24
+
25
+ #: inc/class.admin.php:70
26
+ #: inc/class.admin.php:229
27
+ msgid "Maximum width"
28
+ msgstr "Largeur maximum"
29
+
30
+ #: inc/class.admin.php:71
31
+ #: inc/class.admin.php:233
32
+ msgid "Maximum height"
33
+ msgstr "Hauteur maximum"
34
+
35
+ #: inc/class.admin.php:72
36
+ #: inc/class.admin.php:238
37
+ #: inc/class.admin.php:311
38
+ #: inc/class.admin.php:370
39
+ msgid "Crop ?"
40
+ msgstr "Rogner ?"
41
+
42
+ #: inc/class.admin.php:73
43
+ #: inc/class.admin.php:358
44
+ msgid "yes"
45
+ msgstr "oui"
46
+
47
+ #: inc/class.admin.php:74
48
+ #: inc/class.admin.php:358
49
+ msgid "no"
50
+ msgstr "non"
51
+
52
+ #: inc/class.admin.php:75
53
+ #: inc/class.admin.php:241
54
+ msgid "Show in post insertion ?"
55
+ msgstr "Afficher dans l'insertion ?"
56
+
57
+ #: inc/class.admin.php:76
58
+ msgid " of "
59
+ msgstr " de "
60
+
61
+ #: inc/class.admin.php:77
62
+ msgid " or "
63
+ msgstr " ou "
64
+
65
+ #: inc/class.admin.php:78
66
+ msgid " before the end."
67
+ msgstr " avant la fin."
68
+
69
+ #: inc/class.admin.php:79
70
+ #: inc/class.admin.php:243
71
+ msgid "Delete"
72
+ msgstr "Supprimer"
73
+
74
+ #: inc/class.admin.php:80
75
+ msgid "No media in your site to regenerate !"
76
+ msgstr "Pas de médias à regénérer !"
77
+
78
+ #: inc/class.admin.php:81
79
+ msgid "Regenerating "
80
+ msgstr "Regénération "
81
+
82
+ #: inc/class.admin.php:82
83
+ msgid "Validate image size name"
84
+ msgstr "Valider le nom de la taille d'image"
85
+
86
+ #: inc/class.admin.php:83
87
+ msgid "Done."
88
+ msgstr "Fini."
89
+
90
+ #: inc/class.admin.php:84
91
+ msgid "Size"
92
+ msgstr "Taille "
93
+
94
+ #: inc/class.admin.php:85
95
+ msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
96
+ msgstr "N'utilisez pas les tailles par défaut de WordPress comme nom de taille, éditez leurs valeurs avec le formulaire ci-dessus."
97
+
98
+ #: inc/class.admin.php:86
99
+ msgid "This size is already registered, edit it instead of recreating it."
100
+ msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
101
+
102
+ #: inc/class.admin.php:87
103
+ msgid "Do you really want to delete these size ?"
104
+ msgstr "Voulez-vous réellement supprimer cette taille ?"
105
+
106
+ #: inc/class.admin.php:88
107
+ #: inc/class.admin.php:244
108
+ msgid "Update"
109
+ msgstr "Mettre à jour"
110
+
111
+ #: inc/class.admin.php:89
112
+ msgid "Error requesting page"
113
+ msgstr "Erreur lors de la requête vers la page"
114
+
115
+ #: inc/class.admin.php:90
116
+ msgid "images have been regenerated !"
117
+ msgstr "images ont été regénérées !"
118
+
119
+ #: inc/class.admin.php:91
120
+ msgid "Validate"
121
+ msgstr "Valider"
122
+
123
+ #: inc/class.admin.php:92
124
+ msgid " started at"
125
+ msgstr " commencé à "
126
+
127
+ #: inc/class.admin.php:93
128
+ msgid " finished at :"
129
+ msgstr " terminé à :"
130
+
131
+ #: inc/class.admin.php:94
132
+ msgid "Error during the php treatment, be sure to not have php errors in your page"
133
+ msgstr "Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans votre page"
134
+
135
+ #: inc/class.admin.php:95
136
+ msgid "All the sizes you have modifed are not saved, continue anyway ?"
137
+ msgstr "Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer tout de même ?"
138
+
139
+ #: inc/class.admin.php:96
140
+ #, php-format
141
+ msgid "This image has been regenerated in %s seconds"
142
+ msgstr "Cette image a été regénérée en %s secondes"
143
+
144
+ #: inc/class.admin.php:111
145
+ msgid "Regenerate thumbnails"
146
+ msgstr "Régénérer les vignettes"
147
+
148
+ #: inc/class.admin.php:131
149
+ msgid "Settings"
150
+ msgstr "Paramètres"
151
+
152
+ #: inc/class.admin.php:180
153
+ #, php-format
154
+ msgid "%s size"
155
+ msgstr "Taille %s"
156
+
157
+ #: inc/class.admin.php:187
158
+ msgid "Add a new size"
159
+ msgstr "Ajouter une nouvelle taille"
160
+
161
+ #: inc/class.admin.php:190
162
+ msgid "Legend of the sizes"
163
+ msgstr "Légende des tailles"
164
+
165
+ #: inc/class.admin.php:193
166
+ msgid "Get php for theme"
167
+ msgstr "Récupérer le PHP pour le thème"
168
+
169
+ #: inc/class.admin.php:196
170
+ msgid "Thumbnail regeneration"
171
+ msgstr "Régénération des vignettes"
172
+
173
+ #: inc/class.admin.php:270
174
+ msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
175
+ 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."
176
+
177
+ #: inc/class.admin.php:283
178
+ 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>."
179
+ 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>."
180
+
181
+ #: inc/class.admin.php:303
182
+ msgid "Select which thumbnails you want to rebuild:"
183
+ msgstr "Sélectionnez les tailles de vignettes à régénérer"
184
+
185
+ #: inc/class.admin.php:308
186
+ #: inc/class.admin.php:367
187
+ msgid "Size name"
188
+ msgstr "Nom de la taille"
189
+
190
+ #: inc/class.admin.php:309
191
+ #: inc/class.admin.php:368
192
+ msgid "Width"
193
+ msgstr "Largeur"
194
+
195
+ #: inc/class.admin.php:310
196
+ #: inc/class.admin.php:369
197
+ msgid "Height"
198
+ msgstr "Hauteur"
199
+
200
+ #: inc/class.admin.php:375
201
+ msgid "Select which post type source thumbnails you want to rebuild:"
202
+ msgstr "Sélectionnez quelles vignettes de quel type de contenu vous souhaitez régénérer : "
203
+
204
+ #: inc/class.admin.php:380
205
+ #: inc/class.admin.php:405
206
+ msgid "Post type"
207
+ msgstr "Type de contenu"
208
+
209
+ #: inc/class.admin.php:427
210
+ msgid "End time calculated :"
211
+ msgstr "Fin du traitement calculé :"
212
+
213
+ #: inc/class.admin.php:438
214
+ msgid "Last image:"
215
+ msgstr "Dernière image :"
216
+
217
+ #: inc/class.admin.php:439
218
+ msgid "Regenerate Thumbnails"
219
+ msgstr "Régénérer les vignettes"
220
+
221
+ #: inc/class.admin.php:631
222
+ msgid "Trying to cheat ?"
223
+ msgstr "Cheater ?"
224
+
225
+ #: inc/class.admin.php:640
226
+ msgid "No id given in POST datas."
227
+ msgstr "Pas d'id donné dans les données du POST."
228
+
229
+ #: inc/class.admin.php:650
230
+ #, php-format
231
+ msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
232
+ 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>"
233
+
234
+ #: inc/class.admin.php:652
235
+ #, php-format
236
+ msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
237
+ 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>"
238
+
239
+ #~ msgid "Size "
240
+ #~ msgstr "Taille "
241
+
242
+ #~ msgid "Theme size"
243
+ #~ msgstr "Taille de thème"
244
+
245
+ #~ msgid "Add a new size of thumbnail"
246
+ #~ msgstr "Ajouter une nouvelle taille de vignette"
247
+
248
+ #~ msgid "Get the PHP for the theme"
249
+ #~ msgstr "Récupérer le PHP pour le thème"
250
+
251
+ #~ msgid "Resize ?"
252
+ #~ msgstr "Regénérer ?"
languages/sis.pot ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: http://wordpress.org/tag/simple-image-sizes\n"
7
+ "POT-Creation-Date: 2011-07-05 19:34:56+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: inc/class.admin.php:57
16
+ msgid "Reading attachments..."
17
+ msgstr ""
18
+
19
+ #: inc/class.admin.php:58 inc/class.admin.php:198
20
+ msgid "Maximum width"
21
+ msgstr ""
22
+
23
+ #: inc/class.admin.php:59 inc/class.admin.php:203
24
+ msgid "Maximum height"
25
+ msgstr ""
26
+
27
+ #: inc/class.admin.php:60 inc/class.admin.php:209 inc/class.admin.php:281
28
+ #: inc/class.admin.php:342
29
+ msgid "Crop ?"
30
+ msgstr ""
31
+
32
+ #: inc/class.admin.php:61 inc/class.admin.php:330
33
+ msgid "yes"
34
+ msgstr ""
35
+
36
+ #: inc/class.admin.php:62 inc/class.admin.php:330
37
+ msgid "no"
38
+ msgstr ""
39
+
40
+ #: inc/class.admin.php:63 inc/class.admin.php:214
41
+ msgid "Show in post insertion ?"
42
+ msgstr ""
43
+
44
+ #: inc/class.admin.php:64
45
+ msgid " of "
46
+ msgstr ""
47
+
48
+ #: inc/class.admin.php:65
49
+ msgid " or "
50
+ msgstr ""
51
+
52
+ #: inc/class.admin.php:66
53
+ msgid " before the end."
54
+ msgstr ""
55
+
56
+ #: inc/class.admin.php:67 inc/class.admin.php:217
57
+ msgid "Delete"
58
+ msgstr ""
59
+
60
+ #: inc/class.admin.php:68
61
+ msgid "No media in your site to regenerate !"
62
+ msgstr ""
63
+
64
+ #: inc/class.admin.php:69
65
+ msgid "Regenerating "
66
+ msgstr ""
67
+
68
+ #: inc/class.admin.php:70
69
+ msgid "Validate image size name"
70
+ msgstr ""
71
+
72
+ #: inc/class.admin.php:71
73
+ msgid "Done."
74
+ msgstr ""
75
+
76
+ #: inc/class.admin.php:72
77
+ msgid "Size"
78
+ msgstr ""
79
+
80
+ #: inc/class.admin.php:73
81
+ msgid ""
82
+ "Don't use the basic Wordpress thumbnail size name, use the form above to "
83
+ "edit them"
84
+ msgstr ""
85
+
86
+ #: inc/class.admin.php:74
87
+ msgid "This size is already registered, edit it instead of recreating it."
88
+ msgstr ""
89
+
90
+ #: inc/class.admin.php:75
91
+ msgid "Do you really want to delete these size ?"
92
+ msgstr ""
93
+
94
+ #: inc/class.admin.php:76 inc/class.admin.php:218
95
+ msgid "Update"
96
+ msgstr ""
97
+
98
+ #: inc/class.admin.php:77
99
+ msgid "Error requesting page"
100
+ msgstr ""
101
+
102
+ #: inc/class.admin.php:78
103
+ msgid "images have been regenerated !"
104
+ msgstr ""
105
+
106
+ #: inc/class.admin.php:79
107
+ msgid "Validate"
108
+ msgstr ""
109
+
110
+ #: inc/class.admin.php:97
111
+ msgid "Settings"
112
+ msgstr ""
113
+
114
+ #: inc/class.admin.php:147
115
+ msgid "Size "
116
+ msgstr ""
117
+
118
+ #: inc/class.admin.php:154
119
+ msgid "Add a new size"
120
+ msgstr ""
121
+
122
+ #: inc/class.admin.php:157
123
+ msgid "Legend of the sizes"
124
+ msgstr ""
125
+
126
+ #: inc/class.admin.php:160
127
+ msgid "Get php for theme"
128
+ msgstr ""
129
+
130
+ #: inc/class.admin.php:163
131
+ msgid "Thumbnail regeneration"
132
+ msgstr ""
133
+
134
+ #: inc/class.admin.php:191
135
+ msgid "Custom size"
136
+ msgstr ""
137
+
138
+ #: inc/class.admin.php:194
139
+ msgid "Theme size"
140
+ msgstr ""
141
+
142
+ #: inc/class.admin.php:229
143
+ msgid "Add a new size of thumbnail"
144
+ msgstr ""
145
+
146
+ #: inc/class.admin.php:241
147
+ msgid "Get the PHP for the theme"
148
+ msgstr ""
149
+
150
+ #: inc/class.admin.php:242
151
+ msgid ""
152
+ "Copy and paste the code below into your Wordpress theme function file if you "
153
+ "wanted to save them and deactivate the plugin."
154
+ msgstr ""
155
+
156
+ #: inc/class.admin.php:255
157
+ msgid ""
158
+ "The images created on your theme are <span style=\"color:#F2A13A\">orange</"
159
+ "span> and your custom size are <span style=\"color:#89D76A\"> green </span>."
160
+ msgstr ""
161
+
162
+ #: inc/class.admin.php:273
163
+ msgid "Select which thumbnails you want to rebuild:"
164
+ msgstr ""
165
+
166
+ #: inc/class.admin.php:277 inc/class.admin.php:338 inc/class.admin.php:351
167
+ #: inc/class.admin.php:377
168
+ msgid "Resize ?"
169
+ msgstr ""
170
+
171
+ #: inc/class.admin.php:278 inc/class.admin.php:339
172
+ msgid "Size name"
173
+ msgstr ""
174
+
175
+ #: inc/class.admin.php:279 inc/class.admin.php:340
176
+ msgid "Width"
177
+ msgstr ""
178
+
179
+ #: inc/class.admin.php:280 inc/class.admin.php:341
180
+ msgid "Height"
181
+ msgstr ""
182
+
183
+ #: inc/class.admin.php:347
184
+ msgid "Select which post type source thumbnails you want to rebuild:"
185
+ msgstr ""
186
+
187
+ #: inc/class.admin.php:352 inc/class.admin.php:378
188
+ msgid "Post type"
189
+ msgstr ""
190
+
191
+ #: inc/class.admin.php:400
192
+ msgid "End time calculated :"
193
+ msgstr ""
194
+
195
+ #: inc/class.admin.php:411
196
+ msgid "Last image:"
197
+ msgstr ""
198
+
199
+ #: inc/class.admin.php:412
200
+ msgid "Regenerate Thumbnails"
201
+ msgstr ""
202
+
203
+ #: inc/class.admin.php:577
204
+ msgid "No id given in POST datas."
205
+ msgstr ""
206
+
207
+ #: inc/class.admin.php:587 inc/class.admin.php:589
208
+ msgid ""
209
+ "This file does not exists and have not been regenerated :<br/><a target="
210
+ "\"_blank\" href=\"%1$s\" >%2$s</a>"
211
+ msgstr ""
package.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "name": "simple-image-sizes",
3
- "version": "3.2.0",
4
- "description": "Simple image sizes for WordPress",
5
- "author": "Nicolas Juen",
6
- "license": "GPL-2.0",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/Rahe/simple-image-sizes"
10
- },
11
- "devDependencies": {
12
- "gulp": "*",
13
- "gulp-concat-sourcemap": "*",
14
- "gulp-cssmin": "*",
15
- "gulp-jshint": "*",
16
- "gulp-load-plugins": "*",
17
- "gulp-rename": "*",
18
- "gulp-uglify": "*",
19
- "gulp-watch": "*",
20
- "matchdep": "*"
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.md DELETED
@@ -1,221 +0,0 @@
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.0
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 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.0
68
- * Compatibility to 4.9.X
69
- * Reformat code and improve maintenability
70
- * 3.1.1
71
- * Make translatable the link on admin featured image metabox
72
- * Add filter to allow to remove the button : filter SIS/Admin/Post/Display_Thumbnail_Regenerate
73
- * 3.1.0
74
- * Regenerate images from the featured image
75
- * Use wp_send_json since the minimum WordPress version is 3.5
76
- * 3.0.10
77
- * Remove text-domain on the header for language pack
78
- * 3.0.9
79
- * Reuse the after_setup_theme for image size registering
80
- * Code formatting and cleaning
81
- * Check compatibility wth 4.3
82
- * 3.0.8
83
- * Fix potential bug on error ajax
84
- * Stop using init hook and use after_setup_theme for image size registering
85
- * Update underscore cdn version for WP install without it
86
- * Remove useless timer_start
87
- * 3.0.6
88
- * Fix bug for the image adding
89
- * 3.0.5
90
- * Fix bug on condition
91
- * 3.0.4
92
- * Fix global add_image_size
93
- * 3.0.3
94
- * Add Hebrew translations thanks to Atar4U
95
- * 3.0.2
96
- * Fix version check for the image crop positions
97
- * Add Hebrew translations thanks to Atar4U
98
- * 3.0.1
99
- * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
100
- * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
101
- * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
102
- * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
103
- * 3.0
104
- * Revamping all the code, change classes and structure
105
- * Use grunt for compiling files
106
- * Handle the 3.9 new cropping position
107
- * Remove aristo css
108
- * Use UI from WordPress
109
- * 2.4.3
110
- * Remove some php notices
111
- * Remove notice when wrong image size
112
- * 2.4.2
113
- * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
114
- * 2.4.1
115
- * Remove function not working on admin file
116
- * 2.4
117
- * Made for 3.5 and up
118
- * Refactoring PHP/Javascript code
119
- * Javascript improvements
120
- * Remove useless UI
121
- * UI improvements
122
- * Global PHP performance improvements
123
- * 2.3.1
124
- * Add Ajax bulk actions on medias list
125
- * Add ajax thumbnail rebuild on single media
126
- * 2.3
127
- * Add the custom size name in the attachment insertion
128
- * Exclude post_type wich do not support the post-thumbnail feature
129
- * 2.2.5
130
- * Debug the regeneration buggy !
131
- * Complete the french translation
132
- * Security update for single regeneration, include the nonce this time :)
133
- * 2.2.4
134
- * Add security nonces for every actions
135
- * Put the messages at the begining of the log
136
- * Add a select all checkbox Thank to cocola
137
- * Add the german translation thanks to glueckpress
138
- * Remove notice tnahks to christianwach
139
- * Remove useless and buggy for my scripting pointers
140
- * 2.2.3
141
- * Do not force network usage
142
- * 2.2.2
143
- * Debug js for the buttons
144
- * Remove console.log calls
145
- * 2.2.1
146
- * Use buttonset for the checkboxes
147
- * Add Pointer for WordPress 3.3
148
- * Fix translation in French
149
- * Some medias queries for small windows ( change size of buttons and alignment )
150
- * 2.2
151
- * Add new version of css aristo
152
- * Add some icons
153
- * Display button for saving changes only when changes detected
154
- * Display message when a size is modified but not saved and wanted to regenerate
155
- * Debug functionnality when regenerating only some sizes, metas not crushed
156
- * Add solo regenerating
157
- * Remove displaying for theme/not theme sizes
158
- * Use WordPress class for small inputs
159
- * 2.1
160
- * Add javascript timer
161
- * Improve javascript and more IE friendly
162
- * You can now choose if you want to display the image sizes in image insertion or not
163
- * Handle errors and messages
164
- * Remove some css useless rules
165
- * Fix bad translation for french
166
- * Remove accents in image sizes
167
- * Do not update size properties if there is an ajax query for an another size name
168
- * 2.0.3
169
- * Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
170
- * 2.0.2
171
- * Remove debug on php for javascript
172
- * Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
173
- * 2.0.1
174
- * Resolve javascript issue when clicking on delete button
175
- * Resolve issue of never unchecking crop button
176
- * 2.0
177
- * Code refactoring
178
- * Update translations
179
- * Ajaxification of the process
180
- * Deleting by Ajax
181
- * Updating by Ajax
182
- * Adding by Ajax
183
- * Change UI
184
- * Change theme
185
- * Handle ajax errors
186
- * Handle not modified sizes, cropped
187
- * Handle same names
188
- * Sanitize the names
189
- * Customize jQuery ui
190
- * Customize jQuery ui theme
191
- * HTML5 Elements
192
- * CSS3 Animations
193
- * 1.0.6
194
- * Minify javascript names
195
- * Change progressbar style
196
- * Add animations on progressbar
197
- * 1.0.5
198
- * Only add css and js script in the media page to avoid any javascript error in other pages
199
- * Rectify css
200
- * Add function to get the code for the function.php file of the theme
201
- * Don't redefine the Wordpress basic size names
202
- * 1.0.4
203
- * Fix the add_image_size issue ( height and width reversed )
204
- * 1.0.3
205
- * Fix the plugin language
206
- * Add some translations
207
- * Externalise some css
208
- * Add sizes in the image adding to an article
209
- * Add setting link in the plugins list
210
- * Use admin_url instead of home_url
211
- * Add legend for colors
212
- * Some code refactoring
213
- * 1.0.2
214
- * Fix the plugin license
215
- * 1.0.1
216
- * Add POT file
217
- * Add french translation
218
- * 1.0
219
- * First release
220
- * Thumbnail regenerate
221
- * Image size generation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,12 +2,9 @@
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.0
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
 
@@ -17,14 +14,10 @@ You can now get all the code to copy and paste to your function theme file.
17
  Now you can use the generated sizes directly into your posts and insert images at the right size !
18
  Now you choose if you want display the size in the post insert image.
19
  Now you can regenerate the images one by one in the 'Medias' general pane.
20
- Now you can regenerate the images by bulk action in the 'Medias' general pane.
21
- Now you can regenerate the image sizes on single attachment edit page.
22
 
23
  I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
24
  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.
25
 
26
- Contribute on https://github.com/Rahe/Simple-image-sizes
27
-
28
  == Installation ==
29
  **PHP5 Required.**
30
 
@@ -33,86 +26,14 @@ Contribute on https://github.com/Rahe/Simple-image-sizes
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.0
53
- * Compatibility to 4.9.X
54
- * Reformat and clean some code and improve maintenability
55
- * 3.1.1
56
- * Make translatable the link on admin featured image metabox
57
- * Add filter to allow to remove the button : filter SIS/Admin/Post/Display_Thumbnail_Regenerate
58
- * 3.1.0
59
- * Regenerate images from the featured image
60
- * Use wp_send_json since the minimum WordPress version is 3.5
61
- * 3.0.10
62
- * Remove text-domain on the header for language pack
63
- * 3.0.9
64
- * Reuse the after_setup_theme for image size registering
65
- * Code formatting and cleaning
66
- * Check compatibility wth 4.3
67
- * 3.0.8
68
- * Fix potential bug on error ajax
69
- * Stop using init hook and use after_setup_theme for image size registering
70
- * Update underscore cdn version for WP install without it
71
- * Remove useless timer_start
72
- * 3.0.7
73
- * Fix bug on single image regeneration upload page
74
- * Fix bug https://github.com/Rahe/Simple-image-sizes/issues/30
75
- * 3.0.6
76
- * Fix bug for the image adding
77
- * 3.0.5
78
- * Fix bug on condition
79
- * 3.0.4
80
- * Fix global add_image_size
81
- * 3.0.3
82
- * Add Hebrew translations thanks to Atar4U
83
- * 3.0.2
84
- * Fix version check for the image crop positions
85
- * 3.0.1
86
- * Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
87
- * Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
88
- * Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
89
- * Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
90
- * 3.0
91
- * Revamping all the code, change classes and structure
92
- * Use grunt for compiling files
93
- * Handle the 3.9 new cropping position
94
- * Remove aristo css
95
- * Use UI from WordPress
96
- * 2.4.3
97
- * Remove some php notices
98
- * Remove notice when wrong image size
99
- * 2.4.2
100
- * Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
101
- * 2.4.1
102
- * Remove function not working on admin file
103
- * 2.4
104
- * Made for 3.5 and up
105
- * Refactoring PHP/Javascript code
106
- * Javascript improvements
107
- * Remove useless UI
108
- * UI improvements
109
- * Global PHP performance improvements
110
- * 2.3.1
111
- * Add Ajax bulk actions on medias list
112
- * Add ajax thumbnail rebuild on single media
113
- * 2.3
114
- * Add the custom size name in the attachment insertion
115
- * Exclude post_type wich do not support the post-thumbnail feature
116
  * 2.2.5
117
  * Debug the regeneration buggy !
118
  * Complete the french translation
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
7
+ Stable tag: 2.2.5
 
 
 
8
 
9
  == Description ==
10
 
14
  Now you can use the generated sizes directly into your posts and insert images at the right size !
15
  Now you choose if you want display the size in the post insert image.
16
  Now you can regenerate the images one by one in the 'Medias' general pane.
 
 
17
 
18
  I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
19
  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.
20
 
 
 
21
  == Installation ==
22
  **PHP5 Required.**
23
 
26
  3. Go to Settings > Medias
27
  4. Configure your new image sizes and regenerate the thumbnails !
28
 
 
 
 
 
 
 
 
 
 
29
  == Screenshots ==
30
 
31
  1. Settings page
32
  2. Get PHP for the theme
33
+ 3. Choose the sizes to regenerate
34
+ 4. Regenerating image sizes
35
 
36
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  * 2.2.5
38
  * Debug the regeneration buggy !
39
  * Complete the french translation
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png ADDED
Binary file
simple_image_sizes.php CHANGED
@@ -1,15 +1,14 @@
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.0
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,35 +27,22 @@ along with this program; if not, write to the Free Software
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.0' );
34
  define( 'SIS_OPTION', 'custom_image_sizes' );
35
 
36
- // Function for easy load files
37
- function _sis_load_files( $dir, $files, $prefix = '' ) {
38
- foreach ( $files as $file ) {
39
- if ( is_file( $dir . $prefix . $file . '.php' ) ) {
40
- require_once( $dir . $prefix . $file . '.php' );
41
- }
42
- }
 
 
 
 
 
43
  }
44
-
45
- // Plugin client classes
46
- _sis_load_files( SIS_DIR . 'classes/', array( 'main' ) );
47
-
48
- if ( is_admin() ) {
49
- // Admins classes
50
- _sis_load_files( SIS_DIR . 'classes/admin/', array( 'main', 'post', 'media' ) );
51
- }
52
-
53
- add_action( 'plugins_loaded', 'init_sis' );
54
- function init_sis() {
55
- if ( is_admin() ) {
56
- new SIS_Admin_Main();
57
- new SIS_Admin_Post();
58
- new SIS_Admin_Media();
59
- }
60
-
61
- new SIS_Client();
62
- }
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.2.5
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
  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.2.5' );
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
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/admin-js.html DELETED
@@ -1,45 +0,0 @@
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 }}" class="button-secondary action add_size_name">
8
- </td>
9
- </tr>
10
- </script>
11
- <script type="text/html" id="sis-new_size_row">
12
- <th scope="row">{{ data.size }}{{ data.size_name }}</th>
13
- <td>
14
- <input type="hidden" name="image_name" value="{{ data.size_name }}">
15
- <input type="hidden" name="custom_image_sizes[{{ data.size_name }}][custom]" value="1">
16
- <label for="custom_image_sizes[{{ data.size_name }}][w]" class="sis-label">
17
- {{ data.maximumWidth }}
18
- <input type="number" name="custom_image_sizes[{{ data.size_name }}][w]" value="1" step="1" min="0" id="custom_image_sizes[{{ data.size_name }}][w]" base_w="0" class="w small-text">
19
- </label>
20
- <label for="custom_image_sizes[{{ data.size_name }}][h]" class="sis-label">
21
- {{ data.maximumHeight }}
22
- <input type="number" name="custom_image_sizes[{{ data.size_name }}][h]" value="1" step="1" min="0" id="custom_image_sizes[{{ data.size_name }}][h]" base_h="0" class="h small-text">
23
- </label>
24
- <label for="custom_image_sizes[{{ data.size_name }}][n]" class="sis-label">
25
- {{ data.customName }}
26
- <input type="text" name="custom_image_sizes[{{ data.size_name }}][n]" id="custom_image_sizes[{{ data.size_name }}][n]" base_n="{{ data.size_name }}" class="n">
27
- </label>
28
- <span class="size_options">
29
- <label for="custom_image_sizes[{{ data.size_name }}][c]" id="custom_image_sizes[{{ data.size_name }}][c]" class="c" title="{{ data.crop }}">
30
- {{ data.crop }}
31
- </label>
32
- <select type="checkbox" name="custom_image_sizes[{{ data.size_name }}][c]" id="custom_image_sizes[{{ data.size_name }}][c]" base_c="0" class="c crop">
33
- <# _.each( sis.crop_positions, function( label, name ) { #>
34
- <option value="{{ name }}"> {{ label }} </option>
35
- <# }); #>
36
- </select>
37
- <input type="checkbox" name="custom_image_sizes[{{ data.size_name }}][s]" id="custom_image_sizes[{{ data.size_name }}][s]" base_s="0" value="1" class="s show">
38
- <label for="custom_image_sizes[{{ data.size_name }}][s]" id="custom_image_sizes[{{ data.size_name }}][s]" class="s" title="{{ data.show }}">
39
- {{ data.show }}
40
- </label>
41
- </span>
42
- <div class="delete_size button-secondary">{{ data.deleteImage }}</div>
43
- <div class="add_size button-primary">{{ data.validateButton }}</div>
44
- </td>
45
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/options-media.php DELETED
@@ -1,153 +0,0 @@
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 = Sis_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>