Version Description
Download this release
Release Info
Developer | Rahe |
Plugin | Simple Image Sizes |
Version | 3.1.0 |
Comparing to | |
See all releases |
Code changes from version 3.0.10 to 3.1.0
- .gitignore +164 -0
- README +215 -212
- assets/css/sis-style.css +62 -62
- assets/js/dist/app.js +785 -0
- assets/js/dist/app.js.map +12 -0
- assets/js/{sis.min.js → dist/app.min.js} +5 -1
- assets/js/dist/app.min.js.map +12 -0
- assets/js/sis-attachments.js +0 -108
- assets/js/sis-attachments.min.js +0 -3
- assets/js/sis-attachments.min.js.map +0 -10
- assets/js/sis.js +0 -579
- assets/js/sis.min.js.map +0 -10
- assets/js/src/attachments.js +108 -0
- assets/js/src/featured.js +71 -0
- assets/js/src/sis.js +602 -0
- classes/admin/main.php +314 -335
- classes/admin/media.php +526 -526
- classes/admin/post.php +333 -266
- classes/main.php +59 -59
- gulpfile.js +39 -41
- languages/simple-image-sizes-de_DE.po +367 -367
- languages/simple-image-sizes-fr_FR.po +324 -324
- languages/simple-image-sizes-he_IL.po +471 -471
- languages/simple-image-sizes.pot +273 -273
- package.json +21 -21
- readme.txt +201 -197
- simple_image_sizes.php +61 -61
- templates/admin-js.html +44 -44
- templates/options-media.php +152 -152
.gitignore
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
CHANGED
@@ -1,212 +1,215 @@
|
|
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.
|
11 |
-
|
12 |
-
**Stable tag:** 3.
|
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.0
|
68 |
-
*
|
69 |
-
* 3.
|
70 |
-
|
71 |
-
*
|
72 |
-
|
73 |
-
*
|
74 |
-
*
|
75 |
-
*
|
76 |
-
|
77 |
-
*
|
78 |
-
*
|
79 |
-
*
|
80 |
-
*
|
81 |
-
|
82 |
-
*
|
83 |
-
|
84 |
-
*
|
85 |
-
|
86 |
-
*
|
87 |
-
|
88 |
-
* Add Hebrew translations thanks to Atar4U
|
89 |
-
* 3.0.
|
90 |
-
*
|
91 |
-
*
|
92 |
-
|
93 |
-
*
|
94 |
-
*
|
95 |
-
*
|
96 |
-
*
|
97 |
-
|
98 |
-
*
|
99 |
-
* Use
|
100 |
-
*
|
101 |
-
* Remove
|
102 |
-
*
|
103 |
-
* 2.4.
|
104 |
-
*
|
105 |
-
*
|
106 |
-
|
107 |
-
*
|
108 |
-
|
109 |
-
*
|
110 |
-
|
111 |
-
*
|
112 |
-
*
|
113 |
-
*
|
114 |
-
*
|
115 |
-
|
116 |
-
*
|
117 |
-
* 2.3
|
118 |
-
|
119 |
-
*
|
120 |
-
* 2.
|
121 |
-
*
|
122 |
-
*
|
123 |
-
|
124 |
-
*
|
125 |
-
*
|
126 |
-
*
|
127 |
-
|
128 |
-
* Add
|
129 |
-
*
|
130 |
-
*
|
131 |
-
*
|
132 |
-
*
|
133 |
-
*
|
134 |
-
|
135 |
-
*
|
136 |
-
* 2.2.
|
137 |
-
*
|
138 |
-
*
|
139 |
-
|
140 |
-
*
|
141 |
-
*
|
142 |
-
*
|
143 |
-
*
|
144 |
-
|
145 |
-
*
|
146 |
-
*
|
147 |
-
*
|
148 |
-
*
|
149 |
-
*
|
150 |
-
*
|
151 |
-
*
|
152 |
-
*
|
153 |
-
|
154 |
-
*
|
155 |
-
*
|
156 |
-
*
|
157 |
-
*
|
158 |
-
*
|
159 |
-
*
|
160 |
-
*
|
161 |
-
*
|
162 |
-
|
163 |
-
* Resolve issue with
|
164 |
-
* 2.0.
|
165 |
-
*
|
166 |
-
* Resolve issue
|
167 |
-
* 2.0
|
168 |
-
*
|
169 |
-
*
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
*
|
178 |
-
*
|
179 |
-
*
|
180 |
-
*
|
181 |
-
*
|
182 |
-
*
|
183 |
-
*
|
184 |
-
*
|
185 |
-
*
|
186 |
-
*
|
187 |
-
|
188 |
-
*
|
189 |
-
*
|
190 |
-
*
|
191 |
-
|
192 |
-
*
|
193 |
-
*
|
194 |
-
*
|
195 |
-
*
|
196 |
-
|
197 |
-
*
|
198 |
-
|
199 |
-
*
|
200 |
-
* Add
|
201 |
-
*
|
202 |
-
* Add
|
203 |
-
*
|
204 |
-
*
|
205 |
-
*
|
206 |
-
*
|
207 |
-
|
208 |
-
*
|
209 |
-
* 1.0
|
210 |
-
*
|
211 |
-
*
|
212 |
-
|
|
|
|
|
|
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.5
|
11 |
+
|
12 |
+
**Stable tag:** 3.1.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.1.0
|
68 |
+
* Regenerate images from the featured image
|
69 |
+
* Use wp_send_json since the minimum WordPress version is 3.5
|
70 |
+
* 3.0.10
|
71 |
+
* Remove text-domain on the header for language pack
|
72 |
+
* 3.0.9
|
73 |
+
* Reuse the after_setup_theme for image size registering
|
74 |
+
* Code formatting and cleaning
|
75 |
+
* Check compatibility wth 4.3
|
76 |
+
* 3.0.8
|
77 |
+
* Fix potential bug on error ajax
|
78 |
+
* Stop using init hook and use after_setup_theme for image size registering
|
79 |
+
* Update underscore cdn version for WP install without it
|
80 |
+
* Remove useless timer_start
|
81 |
+
* 3.0.6
|
82 |
+
* Fix bug for the image adding
|
83 |
+
* 3.0.5
|
84 |
+
* Fix bug on condition
|
85 |
+
* 3.0.4
|
86 |
+
* Fix global add_image_size
|
87 |
+
* 3.0.3
|
88 |
+
* Add Hebrew translations thanks to Atar4U
|
89 |
+
* 3.0.2
|
90 |
+
* Fix version check for the image crop positions
|
91 |
+
* Add Hebrew translations thanks to Atar4U
|
92 |
+
* 3.0.1
|
93 |
+
* Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
|
94 |
+
* Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
|
95 |
+
* Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
|
96 |
+
* Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
|
97 |
+
* 3.0
|
98 |
+
* Revamping all the code, change classes and structure
|
99 |
+
* Use grunt for compiling files
|
100 |
+
* Handle the 3.9 new cropping position
|
101 |
+
* Remove aristo css
|
102 |
+
* Use UI from WordPress
|
103 |
+
* 2.4.3
|
104 |
+
* Remove some php notices
|
105 |
+
* Remove notice when wrong image size
|
106 |
+
* 2.4.2
|
107 |
+
* Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
|
108 |
+
* 2.4.1
|
109 |
+
* Remove function not working on admin file
|
110 |
+
* 2.4
|
111 |
+
* Made for 3.5 and up
|
112 |
+
* Refactoring PHP/Javascript code
|
113 |
+
* Javascript improvements
|
114 |
+
* Remove useless UI
|
115 |
+
* UI improvements
|
116 |
+
* Global PHP performance improvements
|
117 |
+
* 2.3.1
|
118 |
+
* Add Ajax bulk actions on medias list
|
119 |
+
* Add ajax thumbnail rebuild on single media
|
120 |
+
* 2.3
|
121 |
+
* Add the custom size name in the attachment insertion
|
122 |
+
* Exclude post_type wich do not support the post-thumbnail feature
|
123 |
+
* 2.2.5
|
124 |
+
* Debug the regeneration buggy !
|
125 |
+
* Complete the french translation
|
126 |
+
* Security update for single regeneration, include the nonce this time :)
|
127 |
+
* 2.2.4
|
128 |
+
* Add security nonces for every actions
|
129 |
+
* Put the messages at the begining of the log
|
130 |
+
* Add a select all checkbox Thank to cocola
|
131 |
+
* Add the german translation thanks to glueckpress
|
132 |
+
* Remove notice tnahks to christianwach
|
133 |
+
* Remove useless and buggy for my scripting pointers
|
134 |
+
* 2.2.3
|
135 |
+
* Do not force network usage
|
136 |
+
* 2.2.2
|
137 |
+
* Debug js for the buttons
|
138 |
+
* Remove console.log calls
|
139 |
+
* 2.2.1
|
140 |
+
* Use buttonset for the checkboxes
|
141 |
+
* Add Pointer for WordPress 3.3
|
142 |
+
* Fix translation in French
|
143 |
+
* Some medias queries for small windows ( change size of buttons and alignment )
|
144 |
+
* 2.2
|
145 |
+
* Add new version of css aristo
|
146 |
+
* Add some icons
|
147 |
+
* Display button for saving changes only when changes detected
|
148 |
+
* Display message when a size is modified but not saved and wanted to regenerate
|
149 |
+
* Debug functionnality when regenerating only some sizes, metas not crushed
|
150 |
+
* Add solo regenerating
|
151 |
+
* Remove displaying for theme/not theme sizes
|
152 |
+
* Use WordPress class for small inputs
|
153 |
+
* 2.1
|
154 |
+
* Add javascript timer
|
155 |
+
* Improve javascript and more IE friendly
|
156 |
+
* You can now choose if you want to display the image sizes in image insertion or not
|
157 |
+
* Handle errors and messages
|
158 |
+
* Remove some css useless rules
|
159 |
+
* Fix bad translation for french
|
160 |
+
* Remove accents in image sizes
|
161 |
+
* Do not update size properties if there is an ajax query for an another size name
|
162 |
+
* 2.0.3
|
163 |
+
* Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
|
164 |
+
* 2.0.2
|
165 |
+
* Remove debug on php for javascript
|
166 |
+
* Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
|
167 |
+
* 2.0.1
|
168 |
+
* Resolve javascript issue when clicking on delete button
|
169 |
+
* Resolve issue of never unchecking crop button
|
170 |
+
* 2.0
|
171 |
+
* Code refactoring
|
172 |
+
* Update translations
|
173 |
+
* Ajaxification of the process
|
174 |
+
* Deleting by Ajax
|
175 |
+
* Updating by Ajax
|
176 |
+
* Adding by Ajax
|
177 |
+
* Change UI
|
178 |
+
* Change theme
|
179 |
+
* Handle ajax errors
|
180 |
+
* Handle not modified sizes, cropped
|
181 |
+
* Handle same names
|
182 |
+
* Sanitize the names
|
183 |
+
* Customize jQuery ui
|
184 |
+
* Customize jQuery ui theme
|
185 |
+
* HTML5 Elements
|
186 |
+
* CSS3 Animations
|
187 |
+
* 1.0.6
|
188 |
+
* Minify javascript names
|
189 |
+
* Change progressbar style
|
190 |
+
* Add animations on progressbar
|
191 |
+
* 1.0.5
|
192 |
+
* Only add css and js script in the media page to avoid any javascript error in other pages
|
193 |
+
* Rectify css
|
194 |
+
* Add function to get the code for the function.php file of the theme
|
195 |
+
* Don't redefine the Wordpress basic size names
|
196 |
+
* 1.0.4
|
197 |
+
* Fix the add_image_size issue ( height and width reversed )
|
198 |
+
* 1.0.3
|
199 |
+
* Fix the plugin language
|
200 |
+
* Add some translations
|
201 |
+
* Externalise some css
|
202 |
+
* Add sizes in the image adding to an article
|
203 |
+
* Add setting link in the plugins list
|
204 |
+
* Use admin_url instead of home_url
|
205 |
+
* Add legend for colors
|
206 |
+
* Some code refactoring
|
207 |
+
* 1.0.2
|
208 |
+
* Fix the plugin license
|
209 |
+
* 1.0.1
|
210 |
+
* Add POT file
|
211 |
+
* Add french translation
|
212 |
+
* 1.0
|
213 |
+
* First release
|
214 |
+
* Thumbnail regenerate
|
215 |
+
* Image size generation
|
assets/css/sis-style.css
CHANGED
@@ -1,62 +1,62 @@
|
|
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 |
-
}
|
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/js/dist/app.js
ADDED
@@ -0,0 +1,785 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"file": "app.js",
|
4 |
+
"sources": [
|
5 |
+
"assets/js/src/sis.js",
|
6 |
+
"assets/js/src/attachments.js",
|
7 |
+
"assets/js/src/featured.js"
|
8 |
+
],
|
9 |
+
"names": [],
|
10 |
+
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
|
11 |
+
"sourceRoot": "../../"
|
12 |
+
}
|
assets/js/{sis.min.js → dist/app.min.js}
RENAMED
@@ -1,3 +1,7 @@
|
|
1 |
var rahe;if(rahe){if("object"!=typeof rahe)throw new Error("rahe already exists and not an object")}else rahe={};if(rahe.sis){if("object"!=typeof rahe.sis)throw new Error("rahe.sis already exists and not an object")}else rahe.sis={};rahe.sis.regenerate={post_types:[],thumbnails:[],total:0,cur:0,timeScript:[],dateScript:"",percent:"",percentText:null,progress:null,messageZone:null,sisZone:null,time:null,timeZone:null,buttonRegenerate:null,errorZone:null,errorMessages:null,thumb:null,thumbImg:null,init:function(){this.sisZone=jQuery(".sis"),this.percentText=jQuery("#sis_progress-percent"),this.progress=jQuery(".progress"),this.messageZone=this.sisZone.find(".regenerate_message"),this.time=this.sisZone.find(".time"),this.timeZone=this.time.find("p span.time_message"),this.buttonRegenerate=jQuery("#ajax_thumbnail_rebuild"),this.errorZone=jQuery("#error_messages"),this.errorMessages=this.errorZone.find("ul.messages"),this.thumb=this.sisZone.find(".thumb"),this.thumbImg=this.sisZone.find(".thumb-img")},getThumbnails:function(){var e=this,t=jQuery("input.thumbnails:checked");t.length!=jQuery('input.thumbnails[type="checkbox"]').length&&t.each(function(t){e.thumbnails.push(this.value)})},getPostTypes:function(){var e=this,t=jQuery("input.post_types:checked");t.length!=jQuery('input.post_types[type="checkbox"]').length&&t.each(function(){e.post_types.push(this.value)})},setMessage:function(e){this.messageZone.html("<p>"+e+"</p>").addClass("updated").addClass("fade").show()},setTimeMessage:function(e){this.timeZone.html(e)},checkStartRegenerating:function(){if(jQuery(".notSaved").size()>0){var e=confirm(sis.notSaved);if(1!=e)return!1;this.startRegenerating()}else this.startRegenerating()},startRegenerating:function(){var e=this,t=jQuery("input.getList").val();e.getThumbnails(),e.getPostTypes(),this.dateScript=new Date,jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"sis_get_list",post_types:e.post_types,nonce:t},beforeSend:function(){e.buttonRegenerate.attr("disabled",!0),e.setMessage(sis.reading)},success:function(t){return"object"!=typeof t?(e.reInit(),e.setMessage(sis.phpError),!1):(e.time.show(),e.total=t.total,e.curr=0,e.progress.show().parent().show(),void e.regenItem())}})},regenItem:function(){var e=this,s=jQuery("input.regen").val();if(0==this.total||_.isUndefined(this.total))return this.reInit(),this.setMessage(sis.noMedia),!1;if(this.curr>=this.total){var i=new Date;return this.reInit(),void this.setMessage(sis.done+this.curr+" "+sis.messageRegenerated+sis.startedAt+" "+this.dateScript.getHours()+":"+this.dateScript.getMinutes()+":"+this.dateScript.getSeconds()+sis.finishedAt+" "+i.getHours()+":"+i.getMinutes()+":"+i.getSeconds())}this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.total),this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.total),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"sis_rebuild_images",offset:this.curr,thumbnails:this.thumbnails,nonce:s},beforeSend:function(){e.percent=e.curr/e.total*100,e.progress.find(".bar").width(e.percent+"%").find(".percent").html(e.percent+"%"),e.percentText.removeClass("hidden").html(Math.round(e.percent)+"%")},success:function(s){if(s.src&&s.time&&!s.error&&"object"==typeof s){s.message&&e.time.find("ul.messages").prepend("<li>"+s.message+"</li>"),e.thumb.show(),e.thumbImg.attr("src",s.src);var i=new Date,n=new Date,a=0,r=0,o=0,d=0,l="";for(e.timeScript.push(parseFloat(s.time.replace(",","."),10)),a=e.timeScript.length,o;a>o;o++)r+=e.timeScript[o];d=r/a,t=Math.round(d*e.total*1e3),i.setTime(e.dateScript.getTime()+t),l=e.s2t(Math.abs(i.getTime()-n.getTime())/1e3),e.setTimeMessage(i.getHours()+":"+i.getMinutes()+":"+i.getSeconds()+sis.or+l+sis.beforeEnd)}else{var u="";u="object"!=typeof s?sis.phpError:s.error,e.errorZone.addClass("error message"),e.errorMessages.prepend("<li>"+u+"</li>")}e.curr++,e.regenItem()}})},s2t:function(e){var e=e%86400,t=new Date(1970,0,1),s=0;return t.setSeconds(e),s=t.toTimeString().substr(0,8),e>86399&&(s=Math.floor((t-Date.parse("1/1/70"))/36e5)+s.substr(2)),s},reInit:function(){this.buttonRegenerate.removeAttr("disabled"),this.thumb.hide(),this.progress.hide(),this.percentText.addClass("hidden")}},rahe.sis.sizes={i:0,add:function(e,t){e.preventDefault();var s=rahe.sis.template("new_size");s=s({size_id:this.i,validate:sis.validate}),jQuery(t).closest("tr").before(s),this.i++},register:function(e,t){e.preventDefault();var s=jQuery(t).closest("tr").children("th").find("input").val(),i=jQuery(t).closest("tr").children("th").find("input").attr("id"),n=jQuery(t).closest("tbody").find('input[value="'+s+'"]').length;if("thumbnail"==s||"medium"==s||"large"==s)return alert(sis.notOriginal),!1;if(0!=n)return alert(sis.alreadyPresent),!1;var a=rahe.sis.template("new_size_row");a=a({size:sis.size,size_name:s,maximumWidth:sis.maximumWidth,maximumHeight:sis.maximumHeight,customName:sis.customName,crop:sis.crop,crop_positions:sis.crop_positions,show:sis.show,deleteImage:sis.deleteImage,validateButton:sis.validateButton}),jQuery("#"+i).closest("tr").html(a)},deleteSize:function(e,t){e.preventDefault();var s=confirm(sis.confirmDelete);1==s&&(jQuery(t).closest("tr").remove(),this.ajaxUnregister(t))},getPhp:function(e,t){e.preventDefault();var s=jQuery(t).closest("tr");jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"sis_get_sizes"},beforeSend:function(){s.removeClass("addPending"),s.addClass("addPending")},success:function(e){jQuery("#get_php").nextAll("code").html("<br />"+e).show().css({display:"block"}),s.removeClass("addPending")}})},ajaxRegister:function(e,t){e.preventDefault();var s,i=this,n=jQuery(t).closest("table"),a=jQuery(".addSize").val(),r=jQuery(t).closest("tr"),o=r.find('input[name="image_name"]').val(),d=r.find("select.crop").val(),l=r.find("input.show").val(),u=r.find("input.n").val(),h=0,c=0;l=0==l||void 0==l?!1:!0,c=parseInt(r.find("input.w").val()),h=parseInt(r.find("input.h").val()),n.hasClass("ajaxing")||jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"sis_add_size",width:c,height:h,crop:d,name:o,show:l,customName:u,nonce:a},beforeSend:function(){r.removeClass(),r.addClass("addPending"),n.addClass("ajaxing")},success:function(e){var t="";r.removeClass(),n.removeClass("ajaxing"),0==e?t="errorAdding":2==e?(t="notChangedAdding",i.addToArray(o,c,h,d,t)):(t="successAdding",i.addToArray(o,c,h,d,t)),r.find("input.h").attr({base_h:h}),r.find("input.w").attr({base_w:c}),r.find("select.c").attr({base_c:d}),r.find("input.s").attr({base_s:l}),r.addClass(t),r.find("td").removeClass("notSaved"),r.find(".add_size").removeClass("validate_size").hide().children(".ui-button-text").text(sis.update),clearTimeout(s),s=setTimeout(function(){r.removeClass("errorAdding notChangedAdding successAdding")},2e3)}})},ajaxUnregister:function(e){var t=this,s=jQuery(e).closest("tr").find('input[name="image_name"]').val(),i=jQuery(e).closest("tr").find("input.deleteSize").val();jQuery.ajax({url:ajaxurl,type:"POST",data:{action:"sis_remove_size",name:s,nonce:i},success:function(s){t.removeFromArray(e)}})},addToArray:function(e,t,s,i,n){var a,r=jQuery("#sis-"+e),o="";o=0!=r.length?r.closest("tr"):jQuery("#sis-regen .wrapper > table#sis_sizes > tbody > tr:first").clone().attr("id","sis-"+e),i=_.isUndefined(sis.crop_positions[i])?sis.fl:sis.crop_positions[i],o.find("th > label").attr("for",e).end().find("input.thumbnails").val(e).attr("id",e).end().find("th:nth-child(2) > label").text(e).end().find("th:nth-child(3) > label").text(t+"px").end().find("th:nth-child(4) > label").text(s+"px").end().find("th:nth-child(5) > label").text(i),0==r.length&&o.appendTo("#sis-regen .wrapper > table#sis_sizes > tbody"),o.removeClass("errorAdding notChangedAdding successAdding").addClass(n),clearTimeout(a),a=setTimeout(function(){o.removeClass("errorAdding notChangedAdding successAdding")},3e3)},removeFromArray:function(e){var t=jQuery(e).closest("tr").find("input[name=image_name]").val();jQuery("#sis-"+t).remove()},displayChange:function(e){var e=jQuery(e),t=e.closest("tr");if(t.hasClass("new_size"))return!1;var s=t.find("input.h"),i=t.find("input.w"),n=t.find("select.c"),a=t.find("input.s"),r=t.find("input.n"),o=s.val(),d=i.val(),l=n.val(),u=a.val(),h=r.val(),c=s.attr("base_h"),p=i.attr("base_w"),g=n.attr("base_c"),m=a.attr("base_s"),f=r.attr("base_n");g="0"==g?!1:!0,m="0"==m?!1:!0,o!=c||d!=p||l!=g||u!=m||h!=f?e.closest("td").addClass("notSaved").find(".add_size").css("display","inline-block"):e.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}},rahe.sis.template=_.memoize(function(e){var t,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(i){return(t=t||_.template(jQuery("#sis-"+e).html(),null,s))(i)}}),jQuery(function(){rahe.sis.regenerate.init();var e=jQuery("#wpbody-content");jQuery("#ajax_thumbnail_rebuild").click(function(){rahe.sis.regenerate.checkStartRegenerating()}),e.on("click","#add_size",function(e){rahe.sis.sizes.add(e,this)}).on("click",".add_size_name",function(e){rahe.sis.sizes.register(e,this)}).on("click",".delete_size",function(e){rahe.sis.sizes.deleteSize(e,this)}).on("click",".add_size",function(e){rahe.sis.sizes.ajaxRegister(e,this)}).on("click keyup change",".h,.w,.c,.s,.n",function(e){rahe.sis.sizes.displayChange(this)}).on("click","#get_php",function(e){rahe.sis.sizes.getPhp(e,this)}),jQuery("#get_php").nextAll("code").hide(),jQuery(".add_size").hide()});
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
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),console.log(s),e.setMessage(s),e.parent.find(".spinner").removeClass("is-active"),e.parent.find("#sis_featured_regenerate").removeAttr("disabled")}})}},jQuery(function(){rahe.sis.featured.init()});
|
6 |
+
|
7 |
+
//# sourceMappingURL=app.min.js.map
|
assets/js/dist/app.min.js.map
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"file": "app.min.js",
|
4 |
+
"sources": [
|
5 |
+
"assets/js/src/sis.js",
|
6 |
+
"assets/js/src/attachments.js",
|
7 |
+
"assets/js/src/featured.js"
|
8 |
+
],
|
9 |
+
"names": [],
|
10 |
+
"mappings": "AAAA;;ACAA;;ACAA",
|
11 |
+
"sourceRoot": "../../"
|
12 |
+
}
|
assets/js/sis-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/sis-attachments.min.js
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
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))}});
|
2 |
-
|
3 |
-
//# sourceMappingURL=sis-attachments.min.js.map
|
|
|
|
|
|
assets/js/sis-attachments.min.js.map
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"version": 3,
|
3 |
-
"file": "sis-attachments.min.js",
|
4 |
-
"sources": [
|
5 |
-
"assets/js/sis-attachments.js"
|
6 |
-
],
|
7 |
-
"names": [],
|
8 |
-
"mappings": "AAAA",
|
9 |
-
"sourceRoot": "../../"
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/sis.js
DELETED
@@ -1,579 +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: { action : "sis_add_size", width: w, height: h, crop: c, name: n, show: s, customName : cn , nonce : wp_nonce },
|
388 |
-
beforeSend: function() {
|
389 |
-
// Remove status and set pending
|
390 |
-
parent.removeClass();
|
391 |
-
parent.addClass( 'addPending' );
|
392 |
-
parentTable.addClass( 'ajaxing' );
|
393 |
-
},
|
394 |
-
success: function(result) {
|
395 |
-
// Set basic class and remove pending
|
396 |
-
var classTr = '';
|
397 |
-
parent.removeClass();
|
398 |
-
parentTable.removeClass( 'ajaxing' )
|
399 |
-
|
400 |
-
// Check the result for the different messages
|
401 |
-
if( result == 0 ) {
|
402 |
-
classTr = 'errorAdding';
|
403 |
-
} else if( result == 2 ) {
|
404 |
-
classTr = 'notChangedAdding';
|
405 |
-
|
406 |
-
// add/update to the array with the status class
|
407 |
-
self.addToArray( n, w, h, c, classTr );
|
408 |
-
} else {
|
409 |
-
classTr = 'successAdding';
|
410 |
-
|
411 |
-
// add/update to the array with the status class
|
412 |
-
self.addToArray( n, w, h, c, classTr );
|
413 |
-
}
|
414 |
-
|
415 |
-
// Add the new sizes values for checking of changed or not
|
416 |
-
parent.find( 'input.h' ).attr( { base_h : h } );
|
417 |
-
parent.find( 'input.w' ).attr( { base_w : w } );
|
418 |
-
parent.find( 'select.c' ).attr( { base_c : c } );
|
419 |
-
parent.find( 'input.s' ).attr( { base_s : s } );
|
420 |
-
|
421 |
-
// Add the generated class
|
422 |
-
parent.addClass( classTr );
|
423 |
-
parent.find( 'td' ).removeClass( "notSaved" );
|
424 |
-
|
425 |
-
// Change the button text
|
426 |
-
parent.find( '.add_size' ).removeClass('validate_size').hide().children('.ui-button-text' ).text( sis.update ) ;
|
427 |
-
|
428 |
-
clearTimeout( timer );
|
429 |
-
// Remove classes after 3 seconds
|
430 |
-
timer = setTimeout(function() {
|
431 |
-
parent.removeClass( 'errorAdding notChangedAdding successAdding' );
|
432 |
-
}, 2 * 1000 );
|
433 |
-
}
|
434 |
-
});
|
435 |
-
}
|
436 |
-
},
|
437 |
-
ajaxUnregister: function( el ) {
|
438 |
-
// Get name and self object
|
439 |
-
var self = this,
|
440 |
-
n = jQuery( el ).closest('tr').find( 'input[name="image_name"]' ).val(),
|
441 |
-
wp_nonce = jQuery( el ).closest('tr').find( 'input.deleteSize' ).val();
|
442 |
-
|
443 |
-
// Make the ajax call
|
444 |
-
jQuery.ajax({
|
445 |
-
url: ajaxurl,
|
446 |
-
type: "POST",
|
447 |
-
data: { action : "sis_remove_size", name: n, nonce : wp_nonce },
|
448 |
-
success: function(result) {
|
449 |
-
self.removeFromArray( el );
|
450 |
-
}
|
451 |
-
});
|
452 |
-
},
|
453 |
-
addToArray: function( n, w, h, c, s ) {
|
454 |
-
// Get the row for editing or updating
|
455 |
-
var testRow = jQuery( '#sis-'+n ),
|
456 |
-
newRow = '',
|
457 |
-
timer;
|
458 |
-
|
459 |
-
// Get the right newRow, updating or adding ?
|
460 |
-
if( testRow.length != 0 ) {
|
461 |
-
newRow = testRow.closest( 'tr' );
|
462 |
-
} else {
|
463 |
-
newRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody > tr:first' ).clone().attr( 'id', 'sis-'+n );
|
464 |
-
}
|
465 |
-
|
466 |
-
c = !_.isUndefined( sis.crop_positions[c] ) ? sis.crop_positions[c] : sis.fl ;
|
467 |
-
|
468 |
-
// Set the datas with the given datas
|
469 |
-
newRow.find( 'th > label' ).attr( 'for', n )
|
470 |
-
.end()
|
471 |
-
.find( 'input.thumbnails' ).val( n ).attr( 'id', n )
|
472 |
-
.end()
|
473 |
-
.find( 'th:nth-child(2) > label' ).text( n )
|
474 |
-
.end()
|
475 |
-
.find( 'th:nth-child(3) > label' ).text( w+'px' )
|
476 |
-
.end()
|
477 |
-
.find( 'th:nth-child(4) > label' ).text( h+'px' )
|
478 |
-
.end()
|
479 |
-
.find( 'th:nth-child(5) > label' ).text( c );
|
480 |
-
|
481 |
-
// If new then add the row
|
482 |
-
if( testRow.length == 0 ) {
|
483 |
-
newRow.appendTo( '#sis-regen .wrapper > table#sis_sizes > tbody' );
|
484 |
-
}
|
485 |
-
|
486 |
-
// Remove the previous status classes and add the status class
|
487 |
-
newRow.removeClass( 'errorAdding notChangedAdding successAdding' ).addClass( s );
|
488 |
-
|
489 |
-
clearTimeout( timer );
|
490 |
-
// Remove the statuses classes
|
491 |
-
timer = setTimeout(function() {
|
492 |
-
newRow.removeClass( 'errorAdding notChangedAdding successAdding' );
|
493 |
-
}, 3 * 1000 );
|
494 |
-
},
|
495 |
-
removeFromArray: function( el ) {
|
496 |
-
// get the name
|
497 |
-
var n = jQuery( el ).closest( 'tr' ).find( 'input[name=image_name]' ).val();
|
498 |
-
|
499 |
-
// Remove the given name from the array
|
500 |
-
jQuery( '#sis-'+n ).remove();
|
501 |
-
},
|
502 |
-
displayChange : function( el ) {
|
503 |
-
var el = jQuery( el ),
|
504 |
-
parent = el.closest( 'tr' );
|
505 |
-
|
506 |
-
// Check not new size
|
507 |
-
if( parent.hasClass( 'new_size' ) ) {
|
508 |
-
return false;
|
509 |
-
}
|
510 |
-
|
511 |
-
var h_el = parent.find( 'input.h' ),
|
512 |
-
w_el = parent.find( 'input.w' ),
|
513 |
-
c_el = parent.find( 'select.c' ),
|
514 |
-
s_el = parent.find( 'input.s' ),
|
515 |
-
n_el = parent.find( 'input.n' ),
|
516 |
-
|
517 |
-
h = h_el.val(),
|
518 |
-
w = w_el.val(),
|
519 |
-
c = c_el.val(),
|
520 |
-
s = s_el.val(),
|
521 |
-
n = n_el.val(),
|
522 |
-
|
523 |
-
base_h = h_el.attr( 'base_h' ),
|
524 |
-
base_w = w_el.attr( 'base_w' ),
|
525 |
-
base_c = c_el.attr( 'base_c' ),
|
526 |
-
base_s = s_el.attr( 'base_s' ),
|
527 |
-
base_n = n_el.attr( 'base_n' );
|
528 |
-
|
529 |
-
|
530 |
-
base_c = base_c == '0' ? false : true;
|
531 |
-
base_s = base_s == '0' ? false : true;
|
532 |
-
|
533 |
-
if( h != base_h || w != base_w || c != base_c || s != base_s || n != base_n ) {
|
534 |
-
el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
|
535 |
-
} else {
|
536 |
-
el.closest( 'td' ).removeClass( 'notSaved' ).find('.add_size').css( 'display', 'none' );
|
537 |
-
}
|
538 |
-
}
|
539 |
-
}
|
540 |
-
|
541 |
-
rahe.sis.template = _.memoize( function ( id ) {
|
542 |
-
var compiled,
|
543 |
-
options = {
|
544 |
-
evaluate: /<#([\s\S]+?)#>/g,
|
545 |
-
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
546 |
-
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
|
547 |
-
variable: 'data'
|
548 |
-
};
|
549 |
-
|
550 |
-
return function ( data ) {
|
551 |
-
compiled = compiled || _.template( jQuery( '#sis-' + id ).html(), null, options );
|
552 |
-
return compiled( data );
|
553 |
-
};
|
554 |
-
});
|
555 |
-
|
556 |
-
jQuery(function() {
|
557 |
-
rahe.sis.regenerate.init();
|
558 |
-
var bodyContent = jQuery( '#wpbody-content');
|
559 |
-
// Regeneration listener
|
560 |
-
jQuery( '#ajax_thumbnail_rebuild' ).click( function() { rahe.sis.regenerate.checkStartRegenerating(); } );
|
561 |
-
|
562 |
-
// Add size button listener
|
563 |
-
bodyContent.on( 'click', '#add_size',function( e ) { rahe.sis.sizes.add( e, this ); } )
|
564 |
-
|
565 |
-
// Registering a new size listener
|
566 |
-
.on( 'click', '.add_size_name', function( e ) { rahe.sis.sizes.register( e, this ); } )
|
567 |
-
|
568 |
-
// Delete and Adding buttons
|
569 |
-
.on( 'click', '.delete_size', function( e ) { rahe.sis.sizes.deleteSize( e, this ); } )
|
570 |
-
.on( 'click', '.add_size', function( e ) { rahe.sis.sizes.ajaxRegister( e, this ); } )
|
571 |
-
|
572 |
-
.on( 'click keyup change', '.h,.w,.c,.s,.n', function( e ) { rahe.sis.sizes.displayChange( this ); } )
|
573 |
-
|
574 |
-
// Seup the getphp
|
575 |
-
.on( 'click', '#get_php', function( e ){ rahe.sis.sizes.getPhp( e, this ) } );
|
576 |
-
jQuery('#get_php').nextAll('code').hide();
|
577 |
-
|
578 |
-
jQuery(".add_size").hide();
|
579 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/sis.min.js.map
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"version": 3,
|
3 |
-
"file": "sis.min.js",
|
4 |
-
"sources": [
|
5 |
-
"assets/js/sis.js"
|
6 |
-
],
|
7 |
-
"names": [],
|
8 |
-
"mappings": "AAAA",
|
9 |
-
"sourceRoot": "../../"
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/src/attachments.js
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
console.log(message);
|
60 |
+
self.setMessage( message );
|
61 |
+
|
62 |
+
self.parent.find('.spinner').removeClass( 'is-active');
|
63 |
+
self.parent.find( '#sis_featured_regenerate' ).removeAttr( 'disabled' );
|
64 |
+
}
|
65 |
+
});
|
66 |
+
}
|
67 |
+
};
|
68 |
+
|
69 |
+
jQuery(function () {
|
70 |
+
rahe.sis.featured.init();
|
71 |
+
} );
|
assets/js/src/sis.js
ADDED
@@ -0,0 +1,602 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
CHANGED
@@ -1,336 +1,315 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
Class SIS_Admin_Main {
|
4 |
-
|
5 |
-
public function __construct() {
|
6 |
-
add_action( 'admin_init', array( __CLASS__, 'register_assets' ) );
|
7 |
-
}
|
8 |
-
|
9 |
-
/**
|
10 |
-
*
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
'jquery
|
20 |
-
'
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
*
|
37 |
-
*
|
38 |
-
* @
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
'
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'
|
49 |
-
'
|
50 |
-
'
|
51 |
-
'
|
52 |
-
'
|
53 |
-
'
|
54 |
-
'
|
55 |
-
'
|
56 |
-
'
|
57 |
-
'
|
58 |
-
'
|
59 |
-
'
|
60 |
-
'
|
61 |
-
'
|
62 |
-
'
|
63 |
-
'
|
64 |
-
'
|
65 |
-
'
|
66 |
-
'
|
67 |
-
'
|
68 |
-
'
|
69 |
-
'
|
70 |
-
'
|
71 |
-
'
|
72 |
-
'
|
73 |
-
'
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
*
|
81 |
-
*
|
82 |
-
*
|
83 |
-
* @
|
84 |
-
*
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
'
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
'
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
'
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
*
|
131 |
-
*
|
132 |
-
* @
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
*
|
151 |
-
*
|
152 |
-
* @
|
153 |
-
*
|
154 |
-
* @
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
'
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
'
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
*
|
196 |
-
*
|
197 |
-
* @
|
198 |
-
*
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
$crops
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
*
|
210 |
-
*
|
211 |
-
*
|
212 |
-
* @
|
213 |
-
*
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
$crops
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
*
|
229 |
-
*
|
230 |
-
* @param $
|
231 |
-
*
|
232 |
-
* @
|
233 |
-
*
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
}
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
$resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
|
316 |
-
|
317 |
-
if ( isset( $meta_datas['size'][ $size ] ) ) {
|
318 |
-
// Remove the size from the orignal sizes for after work
|
319 |
-
unset( $meta_datas['size'][ $size ] );
|
320 |
-
}
|
321 |
-
|
322 |
-
if ( $resized ) {
|
323 |
-
$metadata['sizes'][ $size ] = $resized;
|
324 |
-
}
|
325 |
-
}
|
326 |
-
|
327 |
-
// fetch additional metadata from exif/iptc
|
328 |
-
$image_meta = wp_read_image_metadata( $file );
|
329 |
-
if ( $image_meta ) {
|
330 |
-
$metadata['image_meta'] = $image_meta;
|
331 |
-
}
|
332 |
-
}
|
333 |
-
|
334 |
-
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
|
335 |
-
}
|
336 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
Class SIS_Admin_Main {
|
4 |
+
|
5 |
+
public function __construct() {
|
6 |
+
add_action( 'admin_init', array( __CLASS__, 'register_assets' ) );
|
7 |
+
}
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Register all the assets for the admin
|
11 |
+
*
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
public static function register_assets() {
|
15 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min';
|
16 |
+
// Add javascript
|
17 |
+
wp_register_script( 'underscore', 'https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.0/underscore-min.js', array(), '1.8.0' );
|
18 |
+
wp_register_script( 'sis_js', SIS_URL . 'assets/js/dist/app' . $suffix . '.js', array(
|
19 |
+
'jquery',
|
20 |
+
'jquery-ui-button',
|
21 |
+
'jquery-ui-progressbar',
|
22 |
+
'underscore',
|
23 |
+
), SIS_VERSION );
|
24 |
+
|
25 |
+
// Add javascript translations
|
26 |
+
wp_localize_script( 'sis_js', 'sis', self::localize_vars() );
|
27 |
+
|
28 |
+
// Add CSS
|
29 |
+
wp_enqueue_style( 'sis_css', SIS_URL . 'assets/css/sis-style' . $suffix . '.css', array(), SIS_VERSION );
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Localize the var for javascript
|
35 |
+
*
|
36 |
+
* @access public
|
37 |
+
* @return array
|
38 |
+
* @author Nicolas Juen
|
39 |
+
*/
|
40 |
+
public static function localize_vars() {
|
41 |
+
return array(
|
42 |
+
'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
|
43 |
+
'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
|
44 |
+
'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
|
45 |
+
'crop' => __( 'Crop', 'simple-image-sizes' ),
|
46 |
+
'tr' => __( 'yes', 'simple-image-sizes' ),
|
47 |
+
'fl' => __( 'no', 'simple-image-sizes' ),
|
48 |
+
'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
|
49 |
+
'of' => __( ' of ', 'simple-image-sizes' ),
|
50 |
+
'or' => __( ' or ', 'simple-image-sizes' ),
|
51 |
+
'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
|
52 |
+
'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
|
53 |
+
'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
|
54 |
+
'regenerating' => __( 'Regenerating ', 'simple-image-sizes' ),
|
55 |
+
'regenerate' => __( 'Regenerate ', 'simple-image-sizes' ),
|
56 |
+
'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
|
57 |
+
'done' => __( 'Done.', 'simple-image-sizes' ),
|
58 |
+
'size' => __( 'Size', 'simple-image-sizes' ),
|
59 |
+
'notOriginal' => __( 'Don\'t use the basic WordPress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
|
60 |
+
'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
|
61 |
+
'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
|
62 |
+
'update' => __( 'Update', 'simple-image-sizes' ),
|
63 |
+
'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
|
64 |
+
'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
|
65 |
+
'validateButton' => __( 'Validate', 'simple-image-sizes' ),
|
66 |
+
'startedAt' => __( ' started at', 'simple-image-sizes' ),
|
67 |
+
'customName' => __( 'Public name', 'simple-image-sizes' ),
|
68 |
+
'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
|
69 |
+
'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
|
70 |
+
'notSaved' => __( 'All the sizes you have modified are not saved, continue anyway ?', 'simple-image-sizes' ),
|
71 |
+
'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
|
72 |
+
'crop_positions' => self::get_available_crop(),
|
73 |
+
'regen_one' => wp_create_nonce( 'regen' ),
|
74 |
+
);
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Rebuild the given attribute with the given thumbnails
|
79 |
+
*
|
80 |
+
* @param $att_id
|
81 |
+
* @param $thumbnails
|
82 |
+
*
|
83 |
+
* @return array
|
84 |
+
* @author Nicolas Juen
|
85 |
+
*/
|
86 |
+
public static function thumbnail_rebuild( $att_id, $thumbnails = null ) {
|
87 |
+
// Time a the begining
|
88 |
+
timer_start();
|
89 |
+
|
90 |
+
// Check Id
|
91 |
+
if ( (int) $att_id <= 0 ) {
|
92 |
+
return array(
|
93 |
+
'time' => timer_stop( false, 4 ),
|
94 |
+
'error' => __( 'No id given in POST datas.', 'simple-image-sizes' ),
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
// Get the path
|
99 |
+
$fullsizepath = get_attached_file( $att_id );
|
100 |
+
|
101 |
+
// Regen the attachment
|
102 |
+
if ( false !== $fullsizepath && file_exists( $fullsizepath ) ) {
|
103 |
+
if ( false == wp_update_attachment_metadata( $att_id, self::wp_generate_attachment_metadata_custom( $att_id, $fullsizepath, $thumbnails ) ) ) {
|
104 |
+
return array(
|
105 |
+
'src' => wp_get_attachment_thumb_url( $att_id ),
|
106 |
+
'time' => timer_stop( false, 4 ),
|
107 |
+
'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 ) ),
|
108 |
+
);
|
109 |
+
}
|
110 |
+
} else {
|
111 |
+
return array(
|
112 |
+
'src' => wp_get_attachment_thumb_url( $att_id ),
|
113 |
+
'time' => timer_stop( false, 4 ),
|
114 |
+
'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 ) ),
|
115 |
+
);
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
// Display the attachment url for feedback
|
120 |
+
return array(
|
121 |
+
'time' => timer_stop( false, 4 ),
|
122 |
+
'src' => wp_get_attachment_thumb_url( $att_id ),
|
123 |
+
'title' => get_the_title( $att_id ),
|
124 |
+
);
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Include the javascript template
|
129 |
+
*
|
130 |
+
* @param void
|
131 |
+
*
|
132 |
+
* @return bool
|
133 |
+
*/
|
134 |
+
public static function add_template() {
|
135 |
+
global $pagenow;
|
136 |
+
if ( 'options-media.php' !== $pagenow ) {
|
137 |
+
return false;
|
138 |
+
}
|
139 |
+
|
140 |
+
if ( is_file( SIS_DIR . '/templates/admin-js.html' ) ) {
|
141 |
+
include( SIS_DIR . '/templates/admin-js.html' );
|
142 |
+
}
|
143 |
+
|
144 |
+
return true;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Get all the available cropping
|
149 |
+
*
|
150 |
+
* @return array
|
151 |
+
*
|
152 |
+
* @param void
|
153 |
+
*
|
154 |
+
* @author Nicolas Juen
|
155 |
+
*/
|
156 |
+
public static function get_available_crop() {
|
157 |
+
global $wp_version;
|
158 |
+
|
159 |
+
// Return the only possible
|
160 |
+
if ( version_compare( $wp_version, '3.9', '<' ) ) {
|
161 |
+
return array();
|
162 |
+
}
|
163 |
+
|
164 |
+
$x = array(
|
165 |
+
'left' => __( 'Left', 'simple-image-sizes' ),
|
166 |
+
'center' => __( 'Center', 'simple-image-sizes' ),
|
167 |
+
'right' => __( 'Right', 'simple-image-sizes' ),
|
168 |
+
);
|
169 |
+
|
170 |
+
$y = array(
|
171 |
+
'top' => __( 'top', 'simple-image-sizes' ),
|
172 |
+
'center' => __( 'center', 'simple-image-sizes' ),
|
173 |
+
'bottom' => __( 'bottom', 'simple-image-sizes' ),
|
174 |
+
);
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Base crops
|
178 |
+
*/
|
179 |
+
$crops = array(
|
180 |
+
0 => __( 'No','simple-image-sizes' ),
|
181 |
+
1 => __( 'Yes','simple-image-sizes' ),
|
182 |
+
);
|
183 |
+
foreach ( $x as $x_pos => $x_pos_label ) {
|
184 |
+
foreach ( $y as $y_pos => $y_pos_label ) {
|
185 |
+
$crops[ $x_pos . '_' . $y_pos ] = $x_pos_label . ' ' . $y_pos_label;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
return $crops;
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Check if the crop is available
|
194 |
+
*
|
195 |
+
* @param string $crop_position
|
196 |
+
*
|
197 |
+
* @return bool
|
198 |
+
* @author Nicolas Juen
|
199 |
+
*/
|
200 |
+
public static function is_crop_position( $crop_position ) {
|
201 |
+
$crops = self::get_available_crop();
|
202 |
+
|
203 |
+
return is_bool( $crop_position ) ? $crop_position : isset( $crops[ $crop_position ] );
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Return the crop position label from the slug
|
208 |
+
*
|
209 |
+
*
|
210 |
+
* @param string $crop_position
|
211 |
+
*
|
212 |
+
* @return string
|
213 |
+
* @author Nicolas Juen
|
214 |
+
*/
|
215 |
+
public static function get_crop_position_label( $crop_position ) {
|
216 |
+
if ( ! self::is_crop_position( $crop_position ) ) {
|
217 |
+
return '';
|
218 |
+
}
|
219 |
+
$crops = self::get_available_crop();
|
220 |
+
|
221 |
+
return $crops[ $crop_position ];
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Generate post thumbnail attachment meta data.
|
226 |
+
*
|
227 |
+
* @since 2.1.0
|
228 |
+
*
|
229 |
+
* @param int $attachment_id Attachment Id to process.
|
230 |
+
* @param string $file Filepath of the Attached image.
|
231 |
+
*
|
232 |
+
* @param null|array $thumbnails: thumbnails to regenerate, if null all
|
233 |
+
*
|
234 |
+
* @return mixed Metadata for attachment.
|
235 |
+
*/
|
236 |
+
public static function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = null ) {
|
237 |
+
$attachment = get_post( $attachment_id );
|
238 |
+
|
239 |
+
$meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
|
240 |
+
|
241 |
+
$metadata = array();
|
242 |
+
if ( preg_match( '!^image/!', get_post_mime_type( $attachment ) ) && file_is_displayable_image( $file ) ) {
|
243 |
+
$imagesize = getimagesize( $file );
|
244 |
+
$metadata['width'] = $imagesize[0];
|
245 |
+
$metadata['height'] = $imagesize[1];
|
246 |
+
list( $uwidth, $uheight ) = wp_constrain_dimensions( $metadata['width'], $metadata['height'], 128, 96 );
|
247 |
+
$metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
|
248 |
+
|
249 |
+
// Make the file path relative to the upload dir
|
250 |
+
$metadata['file'] = _wp_relative_upload_path( $file );
|
251 |
+
|
252 |
+
// make thumbnails and other intermediate sizes
|
253 |
+
global $_wp_additional_image_sizes;
|
254 |
+
|
255 |
+
foreach ( get_intermediate_image_sizes() as $s ) {
|
256 |
+
$sizes[ $s ] = array( 'width' => '', 'height' => '', 'crop' => false );
|
257 |
+
if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
|
258 |
+
$sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
|
259 |
+
} // For theme-added sizes
|
260 |
+
else {
|
261 |
+
$sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
|
262 |
+
} // For default sizes set in options
|
263 |
+
if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
|
264 |
+
$sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
|
265 |
+
} // For theme-added sizes
|
266 |
+
else {
|
267 |
+
$sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
|
268 |
+
} // For default sizes set in options
|
269 |
+
if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
|
270 |
+
$sizes[ $s ]['crop'] = intval( $_wp_additional_image_sizes[ $s ]['crop'] );
|
271 |
+
} // For theme-added sizes
|
272 |
+
else {
|
273 |
+
$sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
|
274 |
+
} // For default sizes set in options
|
275 |
+
}
|
276 |
+
|
277 |
+
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
|
278 |
+
|
279 |
+
// Only if not all sizes
|
280 |
+
if ( isset( $thumbnails ) && is_array( $thumbnails ) && isset( $meta_datas['sizes'] ) && ! empty( $meta_datas['sizes'] ) ) {
|
281 |
+
// Fill the array with the other sizes not have to be done
|
282 |
+
foreach ( $meta_datas['sizes'] as $name => $fsize ) {
|
283 |
+
$metadata['sizes'][ $name ] = $fsize;
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
foreach ( $sizes as $size => $size_data ) {
|
288 |
+
if ( isset( $thumbnails ) ) {
|
289 |
+
if ( ! in_array( $size, $thumbnails ) ) {
|
290 |
+
continue;
|
291 |
+
}
|
292 |
+
}
|
293 |
+
|
294 |
+
$resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
|
295 |
+
|
296 |
+
if ( isset( $meta_datas['size'][ $size ] ) ) {
|
297 |
+
// Remove the size from the orignal sizes for after work
|
298 |
+
unset( $meta_datas['size'][ $size ] );
|
299 |
+
}
|
300 |
+
|
301 |
+
if ( $resized ) {
|
302 |
+
$metadata['sizes'][ $size ] = $resized;
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
// fetch additional metadata from exif/iptc
|
307 |
+
$image_meta = wp_read_image_metadata( $file );
|
308 |
+
if ( $image_meta ) {
|
309 |
+
$metadata['image_meta'] = $image_meta;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
|
314 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
}
|
classes/admin/media.php
CHANGED
@@ -1,526 +1,526 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
Class SIS_Admin_Media {
|
4 |
-
|
5 |
-
// Original sizes
|
6 |
-
public static $original = array( 'thumbnail', 'medium', 'large' );
|
7 |
-
|
8 |
-
public function __construct() {
|
9 |
-
// Init
|
10 |
-
add_action( 'admin_menu', array( __CLASS__, 'init' ) );
|
11 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
|
12 |
-
|
13 |
-
// Add ajax action
|
14 |
-
// Option page
|
15 |
-
add_action( 'wp_ajax_' . 'sis_get_list', array( __CLASS__, 'a_get_list' ) );
|
16 |
-
add_action( 'wp_ajax_' . 'sis_rebuild_images', array( __CLASS__, 'a_thumbnails_rebuild' ) );
|
17 |
-
add_action( 'wp_ajax_' . 'sis_get_sizes', array( __CLASS__, 'a_get_sizes' ) );
|
18 |
-
add_action( 'wp_ajax_' . 'sis_add_size', array( __CLASS__, 'a_add_size' ) );
|
19 |
-
add_action( 'wp_ajax_' . 'sis_remove_size', array( __CLASS__, 'a_remove_size' ) );
|
20 |
-
|
21 |
-
// Add link in plugins list
|
22 |
-
add_filter( 'plugin_action_links', array( __CLASS__, 'add_settings_link' ), 10, 2 );
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Register javascripts and css.
|
27 |
-
*
|
28 |
-
* @access public
|
29 |
-
*
|
30 |
-
* @
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
*
|
54 |
-
*
|
55 |
-
* @
|
56 |
-
*
|
57 |
-
*
|
58 |
-
* @
|
59 |
-
*
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
*
|
77 |
-
*
|
78 |
-
* @
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
*
|
138 |
-
*
|
139 |
-
*
|
140 |
-
*
|
141 |
-
*
|
142 |
-
*
|
143 |
-
* @
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
$
|
157 |
-
$
|
158 |
-
$
|
159 |
-
$
|
160 |
-
$
|
161 |
-
|
162 |
-
|
163 |
-
<?php
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
<span class="
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
*
|
220 |
-
*
|
221 |
-
* @
|
222 |
-
* @
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
*
|
233 |
-
*
|
234 |
-
* @
|
235 |
-
* @
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
<code
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
*
|
248 |
-
*
|
249 |
-
* @
|
250 |
-
* @
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
*
|
263 |
-
*
|
264 |
-
* @
|
265 |
-
* @
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
$
|
275 |
-
$croppings
|
276 |
-
$croppings[
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
$
|
281 |
-
$
|
282 |
-
$
|
283 |
-
$
|
284 |
-
$
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
*
|
315 |
-
*
|
316 |
-
* @
|
317 |
-
* @
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
$
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
unset( $sizes[
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
*
|
345 |
-
*
|
346 |
-
* @
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
*
|
387 |
-
*
|
388 |
-
*
|
389 |
-
*
|
390 |
-
*
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
401 |
-
|
402 |
-
// Check the nonce
|
403 |
-
if ( ! wp_verify_nonce( $nonce, 'getList' ) ) {
|
404 |
-
|
405 |
-
}
|
406 |
-
|
407 |
-
if ( isset( $_POST['post_types'] ) && ! empty( $_POST['post_types'] ) ) {
|
408 |
-
|
409 |
-
foreach ( $_POST['post_types'] as $key => $type ) {
|
410 |
-
if ( ! post_type_exists( $type ) ) {
|
411 |
-
unset( $_POST['post_types'][ $key ] );
|
412 |
-
}
|
413 |
-
}
|
414 |
-
|
415 |
-
if ( empty( $_POST['post_types'][ $key ] ) ) {
|
416 |
-
|
417 |
-
}
|
418 |
-
|
419 |
-
// Get image medias
|
420 |
-
$whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
|
421 |
-
|
422 |
-
// Get all parent from post type
|
423 |
-
$attachments = $wpdb->get_var( "SELECT COUNT( ID )
|
424 |
-
FROM $wpdb->posts
|
425 |
-
WHERE 1 = 1
|
426 |
-
AND post_type = 'attachment'
|
427 |
-
$whichmimetype
|
428 |
-
AND post_parent IN (
|
429 |
-
SELECT DISTINCT ID
|
430 |
-
FROM $wpdb->posts
|
431 |
-
WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
|
432 |
-
)" );
|
433 |
-
// Return the Id's and Title of medias
|
434 |
-
|
435 |
-
|
436 |
-
} else {
|
437 |
-
$attachments = get_children( array(
|
438 |
-
'post_type' => 'attachment',
|
439 |
-
'post_mime_type' => 'image',
|
440 |
-
'numberposts' => - 1,
|
441 |
-
'post_status' => null,
|
442 |
-
'post_parent' => null, // any parent
|
443 |
-
'output' => 'ids',
|
444 |
-
) );
|
445 |
-
// Return the Id's and Title of medias
|
446 |
-
|
447 |
-
}
|
448 |
-
|
449 |
-
}
|
450 |
-
|
451 |
-
/**
|
452 |
-
* Regenerate the thumbnails ajax action
|
453 |
-
*
|
454 |
-
* @return array
|
455 |
-
*
|
456 |
-
* @param void
|
457 |
-
*
|
458 |
-
* @author Nicolas Juen
|
459 |
-
*/
|
460 |
-
public static function a_thumbnails_rebuild() {
|
461 |
-
/**
|
462 |
-
* @var $wpdb wpdb
|
463 |
-
*/
|
464 |
-
global $wpdb;
|
465 |
-
|
466 |
-
// Get the nonce
|
467 |
-
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
468 |
-
$offset = isset( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 0;
|
469 |
-
$post_types = isset( $_POST['post_types'] ) ? $_POST['post_types'] : 'any';
|
470 |
-
$thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
|
471 |
-
|
472 |
-
// Check the nonce
|
473 |
-
if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
|
474 |
-
|
475 |
-
}
|
476 |
-
|
477 |
-
if ( 'any' !== $post_types ) {
|
478 |
-
|
479 |
-
foreach ( $_POST['post_types'] as $key => $type ) {
|
480 |
-
if ( ! post_type_exists( $type ) ) {
|
481 |
-
unset( $_POST['post_types'][ $key ] );
|
482 |
-
}
|
483 |
-
}
|
484 |
-
|
485 |
-
if ( empty( $_POST['post_types'] ) ) {
|
486 |
-
|
487 |
-
}
|
488 |
-
|
489 |
-
// Get image medias
|
490 |
-
$whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
|
491 |
-
|
492 |
-
// Get all parent from post type
|
493 |
-
$attachment = $wpdb->get_var( $wpdb->prepare( "SELECT ID
|
494 |
-
FROM $wpdb->posts
|
495 |
-
WHERE 1 = 1
|
496 |
-
AND post_type = 'attachment'
|
497 |
-
$whichmimetype
|
498 |
-
AND post_parent IN (
|
499 |
-
SELECT DISTINCT ID
|
500 |
-
FROM $wpdb->posts
|
501 |
-
WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
|
502 |
-
)
|
503 |
-
LIMIT %d,1
|
504 |
-
", $offset ) );
|
505 |
-
|
506 |
-
} else {
|
507 |
-
$attachment = get_posts( array(
|
508 |
-
'post_type' => 'attachment',
|
509 |
-
'post_mime_type' => 'image',
|
510 |
-
'numberposts' => 1,
|
511 |
-
'post_status' => 'any',
|
512 |
-
'output' => 'object',
|
513 |
-
'offset' => $offset,
|
514 |
-
) );
|
515 |
-
|
516 |
-
$attachment = ! empty( $attachment ) ? $attachment[0]->ID : 0;
|
517 |
-
}
|
518 |
-
|
519 |
-
if ( empty( $attachment ) ) {
|
520 |
-
return array(
|
521 |
-
'message' => __( 'Regeneration ended', 'simple-image-sizes' )
|
522 |
-
);
|
523 |
-
}
|
524 |
-
|
525 |
-
}
|
526 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
Class SIS_Admin_Media {
|
4 |
+
|
5 |
+
// Original sizes
|
6 |
+
public static $original = array( 'thumbnail', 'medium', 'large' );
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
// Init
|
10 |
+
add_action( 'admin_menu', array( __CLASS__, 'init' ) );
|
11 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
|
12 |
+
|
13 |
+
// Add ajax action
|
14 |
+
// Option page
|
15 |
+
add_action( 'wp_ajax_' . 'sis_get_list', array( __CLASS__, 'a_get_list' ) );
|
16 |
+
add_action( 'wp_ajax_' . 'sis_rebuild_images', array( __CLASS__, 'a_thumbnails_rebuild' ) );
|
17 |
+
add_action( 'wp_ajax_' . 'sis_get_sizes', array( __CLASS__, 'a_get_sizes' ) );
|
18 |
+
add_action( 'wp_ajax_' . 'sis_add_size', array( __CLASS__, 'a_add_size' ) );
|
19 |
+
add_action( 'wp_ajax_' . 'sis_remove_size', array( __CLASS__, 'a_remove_size' ) );
|
20 |
+
|
21 |
+
// Add link in plugins list
|
22 |
+
add_filter( 'plugin_action_links', array( __CLASS__, 'add_settings_link' ), 10, 2 );
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Register javascripts and css.
|
27 |
+
*
|
28 |
+
* @access public
|
29 |
+
*
|
30 |
+
* @param string $hook_suffix
|
31 |
+
*
|
32 |
+
* @author Nicolas Juen
|
33 |
+
*/
|
34 |
+
public static function enqueue_assets( $hook_suffix = '' ) {
|
35 |
+
if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
|
39 |
+
if ( 'options-media.php' == $hook_suffix ) {
|
40 |
+
// Add javascript
|
41 |
+
wp_enqueue_script( 'sis_js' );
|
42 |
+
|
43 |
+
// Add CSS
|
44 |
+
wp_enqueue_style( 'sis_css' );
|
45 |
+
|
46 |
+
// Add underscore template
|
47 |
+
add_action( 'admin_footer', array( 'SIS_Admin_Main', 'add_template' ) );
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Add a link to the setting option page
|
54 |
+
*
|
55 |
+
* @access public
|
56 |
+
*
|
57 |
+
* @param array $links
|
58 |
+
* @param string $file
|
59 |
+
*
|
60 |
+
* @return string
|
61 |
+
* @author Nicolas Juen
|
62 |
+
*/
|
63 |
+
public static function add_settings_link( $links, $file ) {
|
64 |
+
|
65 |
+
if ( 'simple-image-sizes/simple_image_sizes.php' !== $file ) {
|
66 |
+
return $links;
|
67 |
+
}
|
68 |
+
|
69 |
+
$settings_link = '<a href="' . admin_url( 'options-media.php' ) . '"> ' . __( 'Settings', 'simple-image-sizes' ) . ' </a>';
|
70 |
+
array_unshift( $links, $settings_link );
|
71 |
+
|
72 |
+
return $links;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Init for the option page
|
77 |
+
*
|
78 |
+
* @access public
|
79 |
+
* @return void
|
80 |
+
* @author Nicolas Juen
|
81 |
+
*/
|
82 |
+
public static function init() {
|
83 |
+
// Check if admin
|
84 |
+
if ( ! is_admin() ) {
|
85 |
+
return;
|
86 |
+
}
|
87 |
+
|
88 |
+
// Get the image sizes
|
89 |
+
global $_wp_additional_image_sizes;
|
90 |
+
|
91 |
+
// Get the sizes and add the settings
|
92 |
+
foreach ( get_intermediate_image_sizes() as $s ) {
|
93 |
+
// Don't make the original sizes or numeric sizes that appear
|
94 |
+
if ( in_array( $s, self::$original ) || is_integer( $s ) ) {
|
95 |
+
continue;
|
96 |
+
}
|
97 |
+
|
98 |
+
// Set width
|
99 |
+
$width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
|
100 |
+
|
101 |
+
// Set height
|
102 |
+
$height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
|
103 |
+
|
104 |
+
//Set crop
|
105 |
+
$crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? intval( $_wp_additional_image_sizes[ $s ]['crop'] ) : get_option( "{$s}_crop" );
|
106 |
+
|
107 |
+
// Add the setting field for this size
|
108 |
+
add_settings_field( 'image_size_' . $s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), array(
|
109 |
+
__CLASS__,
|
110 |
+
'image_sizes'
|
111 |
+
), 'media', 'default', array( 'name' => $s, 'width' => $width, 'height' => $height, 'c' => $crop ) );
|
112 |
+
}
|
113 |
+
|
114 |
+
// Register the setting for media option page
|
115 |
+
register_setting( 'media', SIS_OPTION );
|
116 |
+
|
117 |
+
// Add the button
|
118 |
+
add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), array(
|
119 |
+
__CLASS__,
|
120 |
+
'addSizeButton'
|
121 |
+
), 'media' );
|
122 |
+
|
123 |
+
// Add php button
|
124 |
+
add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), array(
|
125 |
+
__CLASS__,
|
126 |
+
'getPhpButton'
|
127 |
+
), 'media' );
|
128 |
+
|
129 |
+
// Add section for the thumbnail regeneration
|
130 |
+
add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), array(
|
131 |
+
__CLASS__,
|
132 |
+
'thumbnailRegenerate'
|
133 |
+
), 'media' );
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Display the row of the image size
|
138 |
+
*
|
139 |
+
* @access public
|
140 |
+
*
|
141 |
+
* @param mixed $args
|
142 |
+
*
|
143 |
+
* @return void
|
144 |
+
* @author Nicolas Juen
|
145 |
+
*/
|
146 |
+
public static function image_sizes( $args ) {
|
147 |
+
|
148 |
+
if ( is_integer( $args['name'] ) ) {
|
149 |
+
return;
|
150 |
+
}
|
151 |
+
|
152 |
+
// Get the options
|
153 |
+
$sizes = (array) get_option( SIS_OPTION, array() );
|
154 |
+
|
155 |
+
// Get the vars
|
156 |
+
$height = isset( $sizes[ $args['name'] ]['h'] ) ? $sizes[ $args['name'] ]['h'] : $args['height'];
|
157 |
+
$width = isset( $sizes[ $args['name'] ]['w'] ) ? $sizes[ $args['name'] ]['w'] : $args['width'];
|
158 |
+
$crop = isset( $sizes[ $args['name'] ]['c'] ) && ! empty( $sizes[ $args['name'] ]['c'] ) ? $sizes[ $args['name'] ]['c'] : $args['c'];
|
159 |
+
$show = isset( $sizes[ $args['name'] ]['s'] ) && ! empty( $sizes[ $args['name'] ]['s'] ) ? '1' : '0';
|
160 |
+
$custom = isset( $sizes[ $args['name'] ]['custom'] ) && ! empty( $sizes[ $args['name'] ]['custom'] ) ? '1' : '0';
|
161 |
+
$name = isset( $sizes[ $args['name'] ]['n'] ) && ! empty( $sizes[ $args['name'] ]['n'] ) ? esc_html( $sizes[ $args['name'] ]['n'] ) : esc_html( $args['name'] );
|
162 |
+
?>
|
163 |
+
<input type="hidden" value="<?php echo esc_attr( $args['name'] ); ?>" name="image_name"/>
|
164 |
+
<?php if ( $custom ): ?>
|
165 |
+
<input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" type="hidden"
|
166 |
+
id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][custom]' ); ?>" value="1"/>
|
167 |
+
<?php else: ?>
|
168 |
+
<input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" type="hidden"
|
169 |
+
id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][theme]' ); ?>" value="1"/>
|
170 |
+
<?php endif; ?>
|
171 |
+
<label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>">
|
172 |
+
<?php _e( 'Maximum width', 'simple-image-sizes' ); ?>
|
173 |
+
<input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>" class='w small-text'
|
174 |
+
type="number" step='1' min='0'
|
175 |
+
id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][w]' ); ?>"
|
176 |
+
base_w='<?php echo esc_attr( $width ); ?>' value="<?php echo esc_attr( $width ); ?>"/>
|
177 |
+
</label>
|
178 |
+
<label class="sis-label" for="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>">
|
179 |
+
<?php _e( 'Maximum height', 'simple-image-sizes' ); ?>
|
180 |
+
<input name="<?php esc_attr_e( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>" class='h small-text'
|
181 |
+
type="number" step='1' min='0'
|
182 |
+
id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][h]' ); ?>"
|
183 |
+
base_h='<?php echo esc_attr( $height ); ?>' value="<?php echo esc_attr( $height ); ?>"/>
|
184 |
+
</label>
|
185 |
+
<label class="sis-label" for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>">
|
186 |
+
<?php _e( 'Public name', 'simple-image-sizes' ); ?>
|
187 |
+
<input name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>" class='n'
|
188 |
+
type="text" id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][n]' ); ?>"
|
189 |
+
base_n='<?php echo $name; ?>' value="<?php echo $name ?>"/>
|
190 |
+
</label>
|
191 |
+
<span class="size_options">
|
192 |
+
<label class="c"
|
193 |
+
for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes' ); ?></label>
|
194 |
+
<select id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>" class="c crop"
|
195 |
+
base_c='<?php echo esc_attr( $crop ); ?>'
|
196 |
+
name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][c]' ); ?>">
|
197 |
+
|
198 |
+
<?php foreach ( SIS_Admin_Main::get_available_crop() as $crop_position => $label ): ?>
|
199 |
+
<option <?php selected( $crop_position, $crop ); ?>
|
200 |
+
value="<?php echo esc_attr( $crop_position ) ?>"><?php echo esc_html( $label ); ?></option>
|
201 |
+
<?php endforeach; ?>
|
202 |
+
</select>
|
203 |
+
|
204 |
+
<input type='checkbox'
|
205 |
+
id="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" <?php checked( $show, 1 ) ?>
|
206 |
+
class="s show" base_s='<?php echo esc_attr( $show ); ?>'
|
207 |
+
name="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>" value="1"/>
|
208 |
+
<label class="s"
|
209 |
+
for="<?php echo esc_attr( 'custom_image_sizes[' . $args['name'] . '][s]' ); ?>"><?php _e( 'Show in post insertion ?', 'simple-image-sizes' ); ?></label>
|
210 |
+
</span>
|
211 |
+
<span class="delete_size button-secondary"><?php _e( 'Delete', 'simple-image-sizes' ); ?></span>
|
212 |
+
<span class="add_size validate_size button-primary"><?php _e( 'Update', 'simple-image-sizes' ); ?></span>
|
213 |
+
|
214 |
+
<input type="hidden" class="deleteSize button-primary"
|
215 |
+
value='<?php echo wp_create_nonce( 'delete_' . $args['name'] ); ?>'/>
|
216 |
+
<?php }
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Add the button to add a size
|
220 |
+
*
|
221 |
+
* @access public
|
222 |
+
* @return void
|
223 |
+
* @author Nicolas Juen
|
224 |
+
*/
|
225 |
+
public static function addSizeButton() { ?>
|
226 |
+
<input type="button" class="button-secondary action" id="add_size"
|
227 |
+
value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes' ); ?>"/>
|
228 |
+
<?php
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Add the button to get the php for th sizes
|
233 |
+
*
|
234 |
+
* @access public
|
235 |
+
* @return void
|
236 |
+
* @author Nicolas Juen
|
237 |
+
*/
|
238 |
+
public static function getPhpButton() { ?>
|
239 |
+
<input type="button" class="button-secondary action" id="get_php"
|
240 |
+
value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes' ); ?>"/>
|
241 |
+
<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>
|
242 |
+
<code></code>
|
243 |
+
<?php
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Display the Table of sizes and post types for regenerating
|
248 |
+
*
|
249 |
+
* @access public
|
250 |
+
* @return void
|
251 |
+
* @author Nicolas Juen
|
252 |
+
*/
|
253 |
+
public static function thumbnailRegenerate() {
|
254 |
+
if ( is_file( SIS_DIR . '/templates/options-media.php' ) ) {
|
255 |
+
include( SIS_DIR . '/templates/options-media.php' );
|
256 |
+
} else {
|
257 |
+
esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Add a size by Ajax
|
263 |
+
*
|
264 |
+
* @access public
|
265 |
+
* @return void
|
266 |
+
* @author Nicolas Juen
|
267 |
+
*/
|
268 |
+
public static function a_add_size() {
|
269 |
+
|
270 |
+
// Get the nonce
|
271 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
272 |
+
|
273 |
+
// Get old options
|
274 |
+
$sizes = (array) get_option( SIS_OPTION, array() );
|
275 |
+
$croppings = SIS_Admin_Main::get_available_crop();
|
276 |
+
$croppings[ true ] = '';
|
277 |
+
$croppings[ false ] = '';
|
278 |
+
|
279 |
+
// Check entries
|
280 |
+
$name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
|
281 |
+
$height = ! isset( $_POST['height'] ) ? 0 : absint( $_POST['height'] );
|
282 |
+
$width = ! isset( $_POST['width'] ) ? 0 : absint( $_POST['width'] );
|
283 |
+
$crop = isset( $_POST['crop'] ) && isset( $croppings[ $_POST['crop'] ] ) ? $_POST['crop'] : false;
|
284 |
+
$show = isset( $_POST['show'] ) && $_POST['show'] == 'false' ? false : true;
|
285 |
+
$cn = isset( $_POST['customName'] ) && ! empty( $_POST['customName'] ) ? sanitize_text_field( $_POST['customName'] ) : $name;
|
286 |
+
|
287 |
+
// Check the nonce
|
288 |
+
if ( ! wp_verify_nonce( $nonce, 'add_size' ) ) {
|
289 |
+
die( 0 );
|
290 |
+
}
|
291 |
+
|
292 |
+
// If no name given do not save
|
293 |
+
if ( empty( $name ) ) {
|
294 |
+
die( 0 );
|
295 |
+
}
|
296 |
+
|
297 |
+
// Make values
|
298 |
+
$values = array( 'custom' => 1, 'w' => $width, 'h' => $height, 'c' => $crop, 's' => $show, 'n' => $cn );
|
299 |
+
|
300 |
+
// If the size have not changed return 2
|
301 |
+
if ( isset( $sizes[ $name ] ) && $sizes[ $name ] === $values ) {
|
302 |
+
die( 2 );
|
303 |
+
}
|
304 |
+
|
305 |
+
// Put the new values
|
306 |
+
$sizes[ $name ] = $values;
|
307 |
+
|
308 |
+
// display update result
|
309 |
+
echo (int) update_option( 'custom_image_sizes', $sizes );
|
310 |
+
die();
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Remove a size by Ajax
|
315 |
+
*
|
316 |
+
* @access public
|
317 |
+
* @return void
|
318 |
+
* @author Nicolas Juen
|
319 |
+
*/
|
320 |
+
public static function a_remove_size() {
|
321 |
+
|
322 |
+
// Get old options
|
323 |
+
$sizes = (array) get_option( SIS_OPTION, array() );
|
324 |
+
|
325 |
+
// Get the nonce and name
|
326 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
327 |
+
$name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ) : '';
|
328 |
+
|
329 |
+
// Check the nonce
|
330 |
+
if ( ! wp_verify_nonce( $nonce, 'delete_' . $name ) ) {
|
331 |
+
die( 0 );
|
332 |
+
}
|
333 |
+
|
334 |
+
// Remove the size
|
335 |
+
unset( $sizes[ sanitize_title( $name ) ] );
|
336 |
+
unset( $sizes[0] );
|
337 |
+
|
338 |
+
// Display the results
|
339 |
+
echo (int) update_option( SIS_OPTION, $sizes );
|
340 |
+
die();
|
341 |
+
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* Display the add_image_size for the registered sizes
|
345 |
+
*
|
346 |
+
* @access public
|
347 |
+
* @return void
|
348 |
+
*/
|
349 |
+
public static function a_get_sizes() {
|
350 |
+
global $_wp_additional_image_sizes, $wp_version;
|
351 |
+
|
352 |
+
foreach ( get_intermediate_image_sizes() as $s ) {
|
353 |
+
// Don't make the original sizes
|
354 |
+
if ( in_array( $s, self::$original ) ) {
|
355 |
+
continue;
|
356 |
+
}
|
357 |
+
|
358 |
+
// Set width
|
359 |
+
$width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
|
360 |
+
|
361 |
+
// Set height
|
362 |
+
$height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
|
363 |
+
|
364 |
+
//Set crop
|
365 |
+
$crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
|
366 |
+
|
367 |
+
if ( is_bool( $crop ) || is_numeric( $crop ) || version_compare( $wp_version, '3.9', '<' ) ) {
|
368 |
+
$crop = ( absint( $crop ) == 0 ) ? 'false' : 'true';
|
369 |
+
} else {
|
370 |
+
if ( ! Sis_Admin_Main::is_crop_position( implode( '_', $crop ) ) ) {
|
371 |
+
$crop = "false";
|
372 |
+
} else {
|
373 |
+
$crop = 'array( "' . $crop[0] . '", "' . $crop[1] . '")';
|
374 |
+
}
|
375 |
+
}
|
376 |
+
?>
|
377 |
+
add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop; ?> );
|
378 |
+
<br/>
|
379 |
+
<?php
|
380 |
+
}
|
381 |
+
|
382 |
+
die();
|
383 |
+
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
*
|
387 |
+
* Get the media list to regenerate
|
388 |
+
*
|
389 |
+
* @param : void
|
390 |
+
*
|
391 |
+
* @return void
|
392 |
+
*/
|
393 |
+
public static function a_get_list() {
|
394 |
+
/**
|
395 |
+
* @var $wpdb wpdb
|
396 |
+
*/
|
397 |
+
global $wpdb;
|
398 |
+
|
399 |
+
// Basic vars
|
400 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
401 |
+
|
402 |
+
// Check the nonce
|
403 |
+
if ( ! wp_verify_nonce( $nonce, 'getList' ) ) {
|
404 |
+
wp_send_json();
|
405 |
+
}
|
406 |
+
|
407 |
+
if ( isset( $_POST['post_types'] ) && ! empty( $_POST['post_types'] ) ) {
|
408 |
+
|
409 |
+
foreach ( $_POST['post_types'] as $key => $type ) {
|
410 |
+
if ( ! post_type_exists( $type ) ) {
|
411 |
+
unset( $_POST['post_types'][ $key ] );
|
412 |
+
}
|
413 |
+
}
|
414 |
+
|
415 |
+
if ( empty( $_POST['post_types'][ $key ] ) ) {
|
416 |
+
wp_send_json();
|
417 |
+
}
|
418 |
+
|
419 |
+
// Get image medias
|
420 |
+
$whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
|
421 |
+
|
422 |
+
// Get all parent from post type
|
423 |
+
$attachments = $wpdb->get_var( "SELECT COUNT( ID )
|
424 |
+
FROM $wpdb->posts
|
425 |
+
WHERE 1 = 1
|
426 |
+
AND post_type = 'attachment'
|
427 |
+
$whichmimetype
|
428 |
+
AND post_parent IN (
|
429 |
+
SELECT DISTINCT ID
|
430 |
+
FROM $wpdb->posts
|
431 |
+
WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
|
432 |
+
)" );
|
433 |
+
// Return the Id's and Title of medias
|
434 |
+
wp_send_json( array( 'total' => $attachments ) );
|
435 |
+
|
436 |
+
} else {
|
437 |
+
$attachments = get_children( array(
|
438 |
+
'post_type' => 'attachment',
|
439 |
+
'post_mime_type' => 'image',
|
440 |
+
'numberposts' => - 1,
|
441 |
+
'post_status' => null,
|
442 |
+
'post_parent' => null, // any parent
|
443 |
+
'output' => 'ids',
|
444 |
+
) );
|
445 |
+
// Return the Id's and Title of medias
|
446 |
+
wp_send_json( array( 'total' => count( $attachments ) ) );
|
447 |
+
}
|
448 |
+
|
449 |
+
}
|
450 |
+
|
451 |
+
/**
|
452 |
+
* Regenerate the thumbnails ajax action
|
453 |
+
*
|
454 |
+
* @return array
|
455 |
+
*
|
456 |
+
* @param void
|
457 |
+
*
|
458 |
+
* @author Nicolas Juen
|
459 |
+
*/
|
460 |
+
public static function a_thumbnails_rebuild() {
|
461 |
+
/**
|
462 |
+
* @var $wpdb wpdb
|
463 |
+
*/
|
464 |
+
global $wpdb;
|
465 |
+
|
466 |
+
// Get the nonce
|
467 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
468 |
+
$offset = isset( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 0;
|
469 |
+
$post_types = isset( $_POST['post_types'] ) ? $_POST['post_types'] : 'any';
|
470 |
+
$thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
|
471 |
+
|
472 |
+
// Check the nonce
|
473 |
+
if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
|
474 |
+
wp_send_json( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
|
475 |
+
}
|
476 |
+
|
477 |
+
if ( 'any' !== $post_types ) {
|
478 |
+
|
479 |
+
foreach ( $_POST['post_types'] as $key => $type ) {
|
480 |
+
if ( ! post_type_exists( $type ) ) {
|
481 |
+
unset( $_POST['post_types'][ $key ] );
|
482 |
+
}
|
483 |
+
}
|
484 |
+
|
485 |
+
if ( empty( $_POST['post_types'] ) ) {
|
486 |
+
wp_send_json();
|
487 |
+
}
|
488 |
+
|
489 |
+
// Get image medias
|
490 |
+
$whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
|
491 |
+
|
492 |
+
// Get all parent from post type
|
493 |
+
$attachment = $wpdb->get_var( $wpdb->prepare( "SELECT ID
|
494 |
+
FROM $wpdb->posts
|
495 |
+
WHERE 1 = 1
|
496 |
+
AND post_type = 'attachment'
|
497 |
+
$whichmimetype
|
498 |
+
AND post_parent IN (
|
499 |
+
SELECT DISTINCT ID
|
500 |
+
FROM $wpdb->posts
|
501 |
+
WHERE post_type IN ('" . implode( "', '", $_POST['post_types'] ) . "')
|
502 |
+
)
|
503 |
+
LIMIT %d,1
|
504 |
+
", $offset ) );
|
505 |
+
|
506 |
+
} else {
|
507 |
+
$attachment = get_posts( array(
|
508 |
+
'post_type' => 'attachment',
|
509 |
+
'post_mime_type' => 'image',
|
510 |
+
'numberposts' => 1,
|
511 |
+
'post_status' => 'any',
|
512 |
+
'output' => 'object',
|
513 |
+
'offset' => $offset,
|
514 |
+
) );
|
515 |
+
|
516 |
+
$attachment = ! empty( $attachment ) ? $attachment[0]->ID : 0;
|
517 |
+
}
|
518 |
+
|
519 |
+
if ( empty( $attachment ) ) {
|
520 |
+
return array(
|
521 |
+
'message' => __( 'Regeneration ended', 'simple-image-sizes' )
|
522 |
+
);
|
523 |
+
}
|
524 |
+
wp_send_json( SIS_Admin_Main::thumbnail_rebuild( $attachment, $thumbnails ) );
|
525 |
+
}
|
526 |
+
}
|
classes/admin/post.php
CHANGED
@@ -1,267 +1,334 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
Class SIS_Admin_Post {
|
4 |
-
public function __construct() {
|
5 |
-
// Add image sizes in the form, check if 3.3 is installed or not
|
6 |
-
if ( ! function_exists( 'is_main_query' ) ) {
|
7 |
-
add_filter( 'attachment_fields_to_edit', array(
|
8 |
-
__CLASS__,
|
9 |
-
'sizes_in_form'
|
10 |
-
), 11, 2 ); // Add our sizes to media forms
|
11 |
-
} else {
|
12 |
-
add_filter( 'image_size_names_choose', array( __CLASS__, 'add_thumbnail_name' ) );
|
13 |
-
}
|
14 |
-
|
15 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
|
16 |
-
|
17 |
-
// Rebuilt the image
|
18 |
-
add_action( 'wp_ajax_' . 'sis_rebuild_image', array( __CLASS__, 'a_thumbnail_rebuild' ) );
|
19 |
-
|
20 |
-
//
|
21 |
-
|
22 |
-
|
23 |
-
// Add
|
24 |
-
add_filter( '
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
*
|
54 |
-
*/
|
55 |
-
public static function
|
56 |
-
// Get the nonce
|
57 |
-
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
58 |
-
|
59 |
-
// Get the thumbnails
|
60 |
-
$
|
61 |
-
|
62 |
-
// Check the nonce
|
63 |
-
if ( ! wp_verify_nonce( $nonce, '
|
64 |
-
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
*
|
79 |
-
*
|
80 |
-
* @
|
81 |
-
*
|
82 |
-
* @
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
if
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
*
|
213 |
-
*
|
214 |
-
* @
|
215 |
-
*
|
216 |
-
* @return
|
217 |
-
* @
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
return
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
Class SIS_Admin_Post {
|
4 |
+
public function __construct() {
|
5 |
+
// Add image sizes in the form, check if 3.3 is installed or not
|
6 |
+
if ( ! function_exists( 'is_main_query' ) ) {
|
7 |
+
add_filter( 'attachment_fields_to_edit', array(
|
8 |
+
__CLASS__,
|
9 |
+
'sizes_in_form'
|
10 |
+
), 11, 2 ); // Add our sizes to media forms
|
11 |
+
} else {
|
12 |
+
add_filter( 'image_size_names_choose', array( __CLASS__, 'add_thumbnail_name' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_assets' ), 11 );
|
16 |
+
|
17 |
+
// Rebuilt the image
|
18 |
+
add_action( 'wp_ajax_' . 'sis_rebuild_image', array( __CLASS__, 'a_thumbnail_rebuild' ) );
|
19 |
+
|
20 |
+
// Rebuild featured
|
21 |
+
add_action( 'wp_ajax_' . 'sis_rebuild_featured', array( __CLASS__, 'a_featured_rebuild' ) );
|
22 |
+
|
23 |
+
// Add action in media row quick actions
|
24 |
+
add_filter( 'media_row_actions', array( __CLASS__, 'add_actions_list' ), 10, 2 );
|
25 |
+
|
26 |
+
// Add filter for the Media single
|
27 |
+
add_filter( 'attachment_fields_to_edit', array( __CLASS__, 'add_field_regenerate' ), 9, 2 );
|
28 |
+
|
29 |
+
add_filter( 'admin_post_thumbnail_html', array( __CLASS__, 'admin_post_thumbnail_html' ), 10, 2 );
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Generate HTML on the featured image size
|
34 |
+
*
|
35 |
+
* @param $content
|
36 |
+
* @param $ID
|
37 |
+
*
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
public static function admin_post_thumbnail_html( $content, $ID ) {
|
41 |
+
|
42 |
+
$content .= '<span class="spinner"></span>';
|
43 |
+
$content .= get_submit_button( 'Regenerate image sizes', 'primary', 'sis_featured', false, array(
|
44 |
+
'id' => 'sis_featured_regenerate',
|
45 |
+
'data-nonce' => wp_create_nonce( 'sis-regenerate-featured-'.$ID ),
|
46 |
+
) );
|
47 |
+
$content .= '<div class="sis_message"></div>';
|
48 |
+
|
49 |
+
return $content;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Rebuild the image size of a content featured image
|
54 |
+
*/
|
55 |
+
public static function a_featured_rebuild() {
|
56 |
+
// Get the nonce
|
57 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
58 |
+
|
59 |
+
// Get the thumbnails
|
60 |
+
$id = isset( $_POST['id'] ) ? $_POST['id'] : null;
|
61 |
+
|
62 |
+
// Check the nonce
|
63 |
+
if ( ! wp_verify_nonce( $nonce, 'sis-regenerate-featured-'.$id ) ) {
|
64 |
+
wp_send_json( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
|
65 |
+
}
|
66 |
+
|
67 |
+
$attachment_id = get_post_thumbnail_id( $id );
|
68 |
+
|
69 |
+
if( ! has_post_thumbnail( $id ) || is_null( $attachment_id ) ) {
|
70 |
+
wp_send_json( array( 'error' => __( 'There is no media attached to this content.', 'simple-image-sizes' ) ) );
|
71 |
+
}
|
72 |
+
|
73 |
+
// Get the id
|
74 |
+
wp_send_json( SIS_Admin_Main::thumbnail_rebuild( $attachment_id ) );
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Register javascripts and css.
|
79 |
+
*
|
80 |
+
* @access public
|
81 |
+
*
|
82 |
+
* @param string $hook_suffix
|
83 |
+
*
|
84 |
+
* @author Nicolas Juen
|
85 |
+
*/
|
86 |
+
public static function enqueue_assets( $hook_suffix = '' ) {
|
87 |
+
if ( ! isset( $hook_suffix ) || empty( $hook_suffix ) ) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Enqueue the assets for the featured image only on the edit pages and the post types that supports it
|
93 |
+
*/
|
94 |
+
if( in_array( $hook_suffix, array( 'post-new.php', 'post.php' ) ) ) {
|
95 |
+
if( post_type_supports( get_post_type( get_post() ), 'thumbnail' ) ) {
|
96 |
+
// Add javascript
|
97 |
+
wp_enqueue_script( 'sis_js' );
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
101 |
+
|
102 |
+
if ( 'upload.php' == $hook_suffix || ( 'post.php' == $hook_suffix && isset( $_GET['post'] ) && isset( $_GET['action'] ) && 'edit' == $_GET['action'] ) ) {
|
103 |
+
// Add javascript
|
104 |
+
wp_enqueue_script( 'sis_js' );
|
105 |
+
|
106 |
+
// Add underscore template
|
107 |
+
add_action( 'admin_footer', array( 'SIS_Admin_Main', 'add_template' ) );
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Rebuild the image
|
113 |
+
*
|
114 |
+
* @access public
|
115 |
+
* @return void
|
116 |
+
* @author Nicolas Juen
|
117 |
+
*/
|
118 |
+
public static function a_thumbnail_rebuild() {
|
119 |
+
// Get the nonce
|
120 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
121 |
+
|
122 |
+
// Get the thumbnails
|
123 |
+
$thumbnails = isset( $_POST['thumbnails'] ) ? $_POST['thumbnails'] : null;
|
124 |
+
|
125 |
+
// Check the nonce
|
126 |
+
if ( ! wp_verify_nonce( $nonce, 'regen' ) ) {
|
127 |
+
wp_send_json( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
|
128 |
+
}
|
129 |
+
|
130 |
+
// Get the id
|
131 |
+
$id = isset( $_POST['id'] ) ? $_POST['id'] : 0;
|
132 |
+
wp_send_json( SIS_Admin_Main::thumbnail_rebuild( $id, $thumbnails ) );
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Add the custom sizes to the image sizes in article edition
|
137 |
+
*
|
138 |
+
* @access public
|
139 |
+
*
|
140 |
+
* @param array $form_fields
|
141 |
+
* @param object $post
|
142 |
+
*
|
143 |
+
* @return string
|
144 |
+
* @author Nicolas Juen
|
145 |
+
* @author Additional Image Sizes (zui)
|
146 |
+
*/
|
147 |
+
public static function sizes_in_form( $form_fields, $post ) {
|
148 |
+
// Protect from being view in Media editor where there are no sizes
|
149 |
+
if ( ! isset( $form_fields['image-size'] ) ) {
|
150 |
+
return $form_fields;
|
151 |
+
}
|
152 |
+
|
153 |
+
$out = null;
|
154 |
+
$size_names = array();
|
155 |
+
$sizes_custom = get_option( SIS_OPTION, array() );
|
156 |
+
|
157 |
+
if ( is_array( $sizes_custom ) ) {
|
158 |
+
foreach ( $sizes_custom as $key => $value ) {
|
159 |
+
if ( isset( $value['s'] ) && $value['s'] == 1 ) {
|
160 |
+
$size_names[ $key ] = self::_get_thumbnail_name( $key );;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
}
|
164 |
+
foreach ( $size_names as $size => $label ) {
|
165 |
+
$downsize = image_downsize( $post->ID, $size );
|
166 |
+
|
167 |
+
// is this size selectable?
|
168 |
+
$enabled = ( $downsize[3] || 'full' == $size );
|
169 |
+
$css_id = "image-size-{$size}-{$post->ID}";
|
170 |
+
|
171 |
+
// We must do a clumsy search of the existing html to determine is something has been checked yet
|
172 |
+
if ( false === strpos( 'checked="checked"', $form_fields['image-size']['html'] ) ) {
|
173 |
+
if ( empty( $check ) ) {
|
174 |
+
$check = get_user_setting( 'imgsize' );
|
175 |
+
} // See if they checked a custom size last time
|
176 |
+
|
177 |
+
$checked = '';
|
178 |
+
|
179 |
+
// if this size is the default but that's not available, don't select it
|
180 |
+
if ( $size == $check || str_replace( " ", "", $size ) == $check ) {
|
181 |
+
if ( $enabled ) {
|
182 |
+
$checked = " checked='checked'";
|
183 |
+
} else {
|
184 |
+
$check = '';
|
185 |
+
}
|
186 |
+
} elseif ( ! $check && $enabled && 'thumbnail' != $size ) {
|
187 |
+
// if $check is not enabled, default to the first available size that's bigger than a thumbnail
|
188 |
+
$check = $size;
|
189 |
+
$checked = " checked='checked'";
|
190 |
+
}
|
191 |
+
}
|
192 |
+
$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 />";
|
193 |
+
|
194 |
+
$html .= "<label for='{$css_id}'>$label</label>";
|
195 |
+
// only show the dimensions if that choice is available
|
196 |
+
if ( $enabled ) {
|
197 |
+
$html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d × %d)", $downsize[1], $downsize[2] ) . "</label>";
|
198 |
+
}
|
199 |
+
|
200 |
+
$html .= '</div>';
|
201 |
+
|
202 |
+
$out .= $html;
|
203 |
+
}
|
204 |
+
$form_fields['image-size']['html'] .= $out;
|
205 |
+
|
206 |
+
return $form_fields;
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Add the thumbnail name in the post insertion, based on new WP filter
|
211 |
+
*
|
212 |
+
* @access public
|
213 |
+
*
|
214 |
+
* @param array $sizes
|
215 |
+
*
|
216 |
+
* @return array
|
217 |
+
* @since 2.3
|
218 |
+
* @author Nicolas Juen
|
219 |
+
* @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
|
220 |
+
*/
|
221 |
+
public static function add_thumbnail_name( $sizes ) {
|
222 |
+
// Get options
|
223 |
+
$sizes_custom = get_option( SIS_OPTION, array() );
|
224 |
+
// init size array
|
225 |
+
$add_sizes = array();
|
226 |
+
|
227 |
+
// check there is custom sizes
|
228 |
+
if ( is_array( $sizes_custom ) && ! empty( $sizes_custom ) ) {
|
229 |
+
foreach ( $sizes_custom as $key => $value ) {
|
230 |
+
// If we show this size in the admin
|
231 |
+
if ( isset( $value['s'] ) && 1 == $value['s'] ) {
|
232 |
+
$add_sizes[ $key ] = self::_get_thumbnail_name( $key );
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
// Merge the two array
|
238 |
+
$new_sizes = array_merge( $sizes, $add_sizes );
|
239 |
+
|
240 |
+
// Add new size
|
241 |
+
return $new_sizes;
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Get a thumbnail name from its slug
|
246 |
+
*
|
247 |
+
* @access private
|
248 |
+
*
|
249 |
+
* @param string $thumbnailSlug : the slug of the thumbnail
|
250 |
+
*
|
251 |
+
* @return array
|
252 |
+
* @since 2.3
|
253 |
+
* @author Nicolas Juen
|
254 |
+
*/
|
255 |
+
private static function _get_thumbnail_name( $thumbnailSlug = '' ) {
|
256 |
+
|
257 |
+
// get the options
|
258 |
+
$sizes_custom = get_option( SIS_OPTION );
|
259 |
+
|
260 |
+
if ( ! isset( $sizes_custom[ $thumbnailSlug ] ) ) {
|
261 |
+
// return slug if not found
|
262 |
+
return $thumbnailSlug;
|
263 |
+
}
|
264 |
+
|
265 |
+
// If the name exists return it, slug by default
|
266 |
+
if ( isset( $sizes_custom[ $thumbnailSlug ]['n'] ) && ! empty( $sizes_custom[ $thumbnailSlug ]['n'] ) ) {
|
267 |
+
return $sizes_custom[ $thumbnailSlug ]['n'];
|
268 |
+
}
|
269 |
+
|
270 |
+
return $thumbnailSlug;
|
271 |
+
}
|
272 |
+
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Add action in media row
|
276 |
+
*
|
277 |
+
* @since 2.2
|
278 |
+
* @access public
|
279 |
+
*
|
280 |
+
* @param $actions : array of actions and content to display
|
281 |
+
* @param WP_Post $object
|
282 |
+
*
|
283 |
+
* @return string $actions
|
284 |
+
* @author Nicolas Juen
|
285 |
+
*/
|
286 |
+
public static function add_actions_list( $actions, $object ) {
|
287 |
+
if ( ! wp_attachment_is_image( $object->ID ) ) {
|
288 |
+
return $actions;
|
289 |
+
}
|
290 |
+
// Add action for regeneration
|
291 |
+
$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' ) );
|
292 |
+
|
293 |
+
// Return actions
|
294 |
+
return $actions;
|
295 |
+
}
|
296 |
+
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Get a thumbnail name from its slug
|
300 |
+
*
|
301 |
+
* @access public
|
302 |
+
*
|
303 |
+
* @param array $fields : the fields of the media
|
304 |
+
* @param object $post : the post object
|
305 |
+
*
|
306 |
+
* @return array
|
307 |
+
* @since 2.3.1
|
308 |
+
* @author Nicolas Juen
|
309 |
+
*/
|
310 |
+
public static function add_field_regenerate( $fields, $post ) {
|
311 |
+
// Check this is an image
|
312 |
+
if ( false === strpos( $post->post_mime_type, 'image' ) ) {
|
313 |
+
return $fields;
|
314 |
+
}
|
315 |
+
|
316 |
+
$fields['sis-regenerate'] = array(
|
317 |
+
'label' => __( 'Regenerate Thumbnails', 'simple-image-sizes' ),
|
318 |
+
'input' => 'html',
|
319 |
+
'html' => sprintf( '
|
320 |
+
<input type="button" data-id="%s" class="button title sis-regenerate-one" value="%s" />
|
321 |
+
<span class="spinner"></span>
|
322 |
+
<span class="title"><em></em></span>
|
323 |
+
<input type="hidden" class="regen" value="%s" />',
|
324 |
+
esc_attr( $post->ID ),
|
325 |
+
esc_attr__( 'Regenerate Thumbnails', 'simple-image-sizes' ),
|
326 |
+
wp_create_nonce( 'regen' )
|
327 |
+
),
|
328 |
+
'show_in_edit' => true,
|
329 |
+
'show_in_modal' => false,
|
330 |
+
);
|
331 |
+
|
332 |
+
return $fields;
|
333 |
+
}
|
334 |
}
|
classes/main.php
CHANGED
@@ -1,60 +1,60 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
Class SIS_Client {
|
4 |
-
|
5 |
-
// Set the original
|
6 |
-
var $original = array( 'thumbnail', 'medium', 'large' );
|
7 |
-
|
8 |
-
function __construct() {
|
9 |
-
// Make new image sizes
|
10 |
-
add_action( 'init', array( __CLASS__, 'after_setup_theme' ), 1 );
|
11 |
-
|
12 |
-
// Add translation
|
13 |
-
add_action( 'init', array( __CLASS__, 'init_translation' ), 2 );
|
14 |
-
}
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Override the images by the plugin images
|
18 |
-
*
|
19 |
-
* @access public
|
20 |
-
* @return void
|
21 |
-
* @author Nicolas Juen
|
22 |
-
*/
|
23 |
-
public static function after_setup_theme() {
|
24 |
-
// Get inital options
|
25 |
-
$sizes = get_option( SIS_OPTION, array() );
|
26 |
-
|
27 |
-
// Return false if empty
|
28 |
-
if ( empty( $sizes ) || ! is_array( $sizes ) ) {
|
29 |
-
return;
|
30 |
-
}
|
31 |
-
|
32 |
-
// Set the new sizes
|
33 |
-
foreach ( $sizes as $name => $size ) {
|
34 |
-
if ( empty( $size ) || ! isset( $size['w'] ) || ! isset( $size['h'] ) ) {
|
35 |
-
continue;
|
36 |
-
}
|
37 |
-
|
38 |
-
$crop = ( isset( $size['c'] ) && ! empty( $size['c'] ) ) ? $size['c'] : false;
|
39 |
-
|
40 |
-
if ( is_string( $crop ) ) {
|
41 |
-
$crop = explode( '_', $crop );
|
42 |
-
}
|
43 |
-
|
44 |
-
// Add the images sizes
|
45 |
-
add_image_size( $name, $size['w'], $size['h'], $crop );
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Load the plugin text domain
|
51 |
-
*
|
52 |
-
* @param void
|
53 |
-
*
|
54 |
-
* @return void
|
55 |
-
* @author Nicolas Juen
|
56 |
-
*/
|
57 |
-
public static function init_translation() {
|
58 |
-
load_plugin_textdomain( 'simple-image-sizes', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
|
59 |
-
}
|
60 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
Class SIS_Client {
|
4 |
+
|
5 |
+
// Set the original
|
6 |
+
var $original = array( 'thumbnail', 'medium', 'large' );
|
7 |
+
|
8 |
+
function __construct() {
|
9 |
+
// Make new image sizes
|
10 |
+
add_action( 'init', array( __CLASS__, 'after_setup_theme' ), 1 );
|
11 |
+
|
12 |
+
// Add translation
|
13 |
+
add_action( 'init', array( __CLASS__, 'init_translation' ), 2 );
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Override the images by the plugin images
|
18 |
+
*
|
19 |
+
* @access public
|
20 |
+
* @return void
|
21 |
+
* @author Nicolas Juen
|
22 |
+
*/
|
23 |
+
public static function after_setup_theme() {
|
24 |
+
// Get inital options
|
25 |
+
$sizes = get_option( SIS_OPTION, array() );
|
26 |
+
|
27 |
+
// Return false if empty
|
28 |
+
if ( empty( $sizes ) || ! is_array( $sizes ) ) {
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Set the new sizes
|
33 |
+
foreach ( $sizes as $name => $size ) {
|
34 |
+
if ( empty( $size ) || ! isset( $size['w'] ) || ! isset( $size['h'] ) ) {
|
35 |
+
continue;
|
36 |
+
}
|
37 |
+
|
38 |
+
$crop = ( isset( $size['c'] ) && ! empty( $size['c'] ) ) ? $size['c'] : false;
|
39 |
+
|
40 |
+
if ( is_string( $crop ) ) {
|
41 |
+
$crop = explode( '_', $crop );
|
42 |
+
}
|
43 |
+
|
44 |
+
// Add the images sizes
|
45 |
+
add_image_size( $name, $size['w'], $size['h'], $crop );
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Load the plugin text domain
|
51 |
+
*
|
52 |
+
* @param void
|
53 |
+
*
|
54 |
+
* @return void
|
55 |
+
* @author Nicolas Juen
|
56 |
+
*/
|
57 |
+
public static function init_translation() {
|
58 |
+
load_plugin_textdomain( 'simple-image-sizes', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
|
59 |
+
}
|
60 |
}
|
gulpfile.js
CHANGED
@@ -1,42 +1,40 @@
|
|
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/sis.js'
|
11 |
-
|
12 |
-
.
|
13 |
-
|
14 |
-
.pipe(
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
gulp.task('default', function() {
|
41 |
-
gulp.watch( [ 'assets/js/*.js', '!assets/js/*.min.js' ], [ 'dev' ] );
|
42 |
});
|
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 |
});
|
languages/simple-image-sizes-de_DE.po
CHANGED
@@ -1,367 +1,367 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: \n"
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2014-04-20 15:24+0100\n"
|
6 |
-
"PO-Revision-Date: 2014-04-20 15:32+0100\n"
|
7 |
-
"Last-Translator: Nicolas Juen <nicolas.juen@gmail.com>\n"
|
8 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
-
"Language: de_DE\n"
|
10 |
-
"MIME-Version: 1.0\n"
|
11 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
-
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
-
"X-Poedit-SourceCharset: utf-8\n"
|
15 |
-
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
16 |
-
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
17 |
-
"X-Poedit-Basepath: .\n"
|
18 |
-
"X-Textdomain-Support: yes\n"
|
19 |
-
"X-Generator: Poedit 1.6.3\n"
|
20 |
-
"X-Poedit-SearchPath-0: .\n"
|
21 |
-
|
22 |
-
# @ sis
|
23 |
-
#: ../classes/admin/main.php:39
|
24 |
-
msgid "Reading attachments..."
|
25 |
-
msgstr "Lese Anhänge…"
|
26 |
-
|
27 |
-
# @ sis
|
28 |
-
#: ../classes/admin/main.php:40 ../classes/admin/media.php:154
|
29 |
-
msgid "Maximum width"
|
30 |
-
msgstr "Maximale Breite"
|
31 |
-
|
32 |
-
# @ sis
|
33 |
-
#: ../classes/admin/main.php:41 ../classes/admin/media.php:158
|
34 |
-
msgid "Maximum height"
|
35 |
-
msgstr "Maximale Höhe"
|
36 |
-
|
37 |
-
# @ sis
|
38 |
-
#: ../classes/admin/main.php:42
|
39 |
-
msgid "Crop"
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
# @ sis
|
43 |
-
#: ../classes/admin/main.php:43
|
44 |
-
msgid "yes"
|
45 |
-
msgstr "ja"
|
46 |
-
|
47 |
-
# @ sis
|
48 |
-
#: ../classes/admin/main.php:44
|
49 |
-
msgid "no"
|
50 |
-
msgstr "nein"
|
51 |
-
|
52 |
-
# @ sis
|
53 |
-
#: ../classes/admin/main.php:45 ../classes/admin/media.php:176
|
54 |
-
msgid "Show in post insertion ?"
|
55 |
-
msgstr "Beim Einfügen in den Beitrag anzeigen?"
|
56 |
-
|
57 |
-
# @ sis
|
58 |
-
#: ../classes/admin/main.php:46
|
59 |
-
msgid " of "
|
60 |
-
msgstr "von"
|
61 |
-
|
62 |
-
# @ sis
|
63 |
-
#: ../classes/admin/main.php:47
|
64 |
-
msgid " or "
|
65 |
-
msgstr "oder"
|
66 |
-
|
67 |
-
# @ sis
|
68 |
-
#: ../classes/admin/main.php:48
|
69 |
-
msgid " before the end."
|
70 |
-
msgstr "vor dem Ende."
|
71 |
-
|
72 |
-
# @ sis
|
73 |
-
#: ../classes/admin/main.php:49 ../classes/admin/media.php:178
|
74 |
-
msgid "Delete"
|
75 |
-
msgstr "Löschen"
|
76 |
-
|
77 |
-
# @ sis
|
78 |
-
#: ../classes/admin/main.php:50
|
79 |
-
msgid "No media in your site to regenerate !"
|
80 |
-
msgstr "Keine Medien neu zu generieren!"
|
81 |
-
|
82 |
-
# @ sis
|
83 |
-
#: ../classes/admin/main.php:51
|
84 |
-
msgid "Regenerating "
|
85 |
-
msgstr "Neu generieren"
|
86 |
-
|
87 |
-
# @ sis
|
88 |
-
#: ../classes/admin/main.php:52
|
89 |
-
msgid "Regenerate "
|
90 |
-
msgstr ""
|
91 |
-
|
92 |
-
# @ sis
|
93 |
-
#: ../classes/admin/main.php:53
|
94 |
-
msgid "Validate image size name"
|
95 |
-
msgstr "Bildgrößenbezeichnung überprüfen"
|
96 |
-
|
97 |
-
# @ sis
|
98 |
-
#: ../classes/admin/main.php:54
|
99 |
-
msgid "Done."
|
100 |
-
msgstr "Fertig."
|
101 |
-
|
102 |
-
# @ sis
|
103 |
-
#: ../classes/admin/main.php:55
|
104 |
-
msgid "Size"
|
105 |
-
msgstr "Bildgröße"
|
106 |
-
|
107 |
-
# @ sis
|
108 |
-
#: ../classes/admin/main.php:56
|
109 |
-
msgid ""
|
110 |
-
"Don't use the basic Wordpress thumbnail size name, use the form above to "
|
111 |
-
"edit them"
|
112 |
-
msgstr ""
|
113 |
-
"Nutze nicht die vorgegebene Thumbnail-Bezeichnung in WordPress! Nutze das "
|
114 |
-
"Formular, um diese zu bearbeiten."
|
115 |
-
|
116 |
-
# @ sis
|
117 |
-
#: ../classes/admin/main.php:57
|
118 |
-
msgid "This size is already registered, edit it instead of recreating it."
|
119 |
-
msgstr ""
|
120 |
-
"Die Bildgröße existiert bereits. Du kannst sie bearbeiten, anstatt sie "
|
121 |
-
"doppelt anzulegen."
|
122 |
-
|
123 |
-
# @ sis
|
124 |
-
#: ../classes/admin/main.php:58
|
125 |
-
msgid "Do you really want to delete these size ?"
|
126 |
-
msgstr "Willst du diese Bildgröße/n wirklich löschen?"
|
127 |
-
|
128 |
-
# @ sis
|
129 |
-
#: ../classes/admin/main.php:59 ../classes/admin/media.php:179
|
130 |
-
msgid "Update"
|
131 |
-
msgstr "Aktualisieren"
|
132 |
-
|
133 |
-
# @ sis
|
134 |
-
#: ../classes/admin/main.php:60
|
135 |
-
msgid "Error requesting page"
|
136 |
-
msgstr "Fehler beim Abruf der Seite"
|
137 |
-
|
138 |
-
# @ sis
|
139 |
-
#: ../classes/admin/main.php:61
|
140 |
-
msgid "images have been regenerated !"
|
141 |
-
msgstr "Bilder wurden neu generiert!"
|
142 |
-
|
143 |
-
# @ sis
|
144 |
-
#: ../classes/admin/main.php:62
|
145 |
-
msgid "Validate"
|
146 |
-
msgstr "Überprüfen"
|
147 |
-
|
148 |
-
# @ sis
|
149 |
-
#: ../classes/admin/main.php:63
|
150 |
-
msgid " started at"
|
151 |
-
msgstr "begonnen: "
|
152 |
-
|
153 |
-
# @ sis
|
154 |
-
#: ../classes/admin/main.php:64 ../classes/admin/media.php:162
|
155 |
-
msgid "Public name"
|
156 |
-
msgstr ""
|
157 |
-
|
158 |
-
# @ sis
|
159 |
-
#: ../classes/admin/main.php:65
|
160 |
-
msgid " finished at :"
|
161 |
-
msgstr "beendet: "
|
162 |
-
|
163 |
-
# @ sis
|
164 |
-
#: ../classes/admin/main.php:66
|
165 |
-
msgid ""
|
166 |
-
"Error during the php treatment, be sure to not have php errors in your page"
|
167 |
-
msgstr ""
|
168 |
-
"Fehler während des PHP-Durchlaufs! Stelle sicher, dass sich keine PHP-Fehler "
|
169 |
-
"in deiner Seite befinden."
|
170 |
-
|
171 |
-
# @ sis
|
172 |
-
#: ../classes/admin/main.php:67
|
173 |
-
msgid "All the sizes you have modifed are not saved, continue anyway ?"
|
174 |
-
msgstr ""
|
175 |
-
"Deine veränderten Bildgrößen wurden noch nicht gespeichert. Trotzdem "
|
176 |
-
"fortfahren?"
|
177 |
-
|
178 |
-
# @ sis
|
179 |
-
#: ../classes/admin/main.php:68
|
180 |
-
#, php-format
|
181 |
-
msgid "This image has been regenerated in %s seconds"
|
182 |
-
msgstr "Dieses Bild wurde neu generiert in %s Sekunden."
|
183 |
-
|
184 |
-
# @ sis
|
185 |
-
#: ../classes/admin/main.php:91
|
186 |
-
msgid "No id given in POST datas."
|
187 |
-
msgstr "Keine ID in den POST-Daten gegeben."
|
188 |
-
|
189 |
-
# @ sis
|
190 |
-
#: ../classes/admin/main.php:104
|
191 |
-
#, php-format
|
192 |
-
msgid ""
|
193 |
-
"This file already exists in this size and have not been regenerated :<br/><a "
|
194 |
-
"target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
195 |
-
msgstr ""
|
196 |
-
|
197 |
-
# @ sis
|
198 |
-
#: ../classes/admin/main.php:111
|
199 |
-
#, php-format
|
200 |
-
msgid ""
|
201 |
-
"This file does not exists and have not been regenerated :<br/><a target="
|
202 |
-
"\"_blank\" href=\"%1$s\" >%2$s</a>"
|
203 |
-
msgstr ""
|
204 |
-
"Diese Datei existiert nicht und wurde nicht neu generiert:<br/><a target="
|
205 |
-
"\"_blank\" href=\"%1$s\" >%2$s</a>"
|
206 |
-
|
207 |
-
#: ../classes/admin/main.php:158
|
208 |
-
msgid "Left"
|
209 |
-
msgstr ""
|
210 |
-
|
211 |
-
#: ../classes/admin/main.php:159
|
212 |
-
msgid "Center"
|
213 |
-
msgstr ""
|
214 |
-
|
215 |
-
# @ sis
|
216 |
-
#: ../classes/admin/main.php:160
|
217 |
-
msgid "Right"
|
218 |
-
msgstr ""
|
219 |
-
|
220 |
-
#: ../classes/admin/main.php:164
|
221 |
-
msgid "top"
|
222 |
-
msgstr ""
|
223 |
-
|
224 |
-
#: ../classes/admin/main.php:165
|
225 |
-
msgid "center"
|
226 |
-
msgstr ""
|
227 |
-
|
228 |
-
#: ../classes/admin/main.php:166
|
229 |
-
msgid "bottom"
|
230 |
-
msgstr ""
|
231 |
-
|
232 |
-
# @ sis
|
233 |
-
#: ../classes/admin/media.php:66
|
234 |
-
msgid "Settings"
|
235 |
-
msgstr "Einstellungen"
|
236 |
-
|
237 |
-
# @ sis
|
238 |
-
#: ../classes/admin/media.php:106
|
239 |
-
#, php-format
|
240 |
-
msgid "%s size"
|
241 |
-
msgstr "Bildgröße „%s“"
|
242 |
-
|
243 |
-
# @ sis
|
244 |
-
#: ../classes/admin/media.php:113
|
245 |
-
msgid "Add a new size"
|
246 |
-
msgstr "Neue Bildgröße hinzufügen"
|
247 |
-
|
248 |
-
# @ sis
|
249 |
-
#: ../classes/admin/media.php:116
|
250 |
-
msgid "Get php for theme"
|
251 |
-
msgstr "PHP für dein Theme generieren"
|
252 |
-
|
253 |
-
# @ sis
|
254 |
-
#: ../classes/admin/media.php:119
|
255 |
-
msgid "Thumbnail regeneration"
|
256 |
-
msgstr "Artikelbilder neu generieren"
|
257 |
-
|
258 |
-
#: ../classes/admin/media.php:155 ../classes/admin/media.php:157
|
259 |
-
#: ../classes/admin/media.php:159
|
260 |
-
msgid "custom_image_sizes["
|
261 |
-
msgstr ""
|
262 |
-
|
263 |
-
#: ../classes/admin/media.php:166
|
264 |
-
msgid "Cropping"
|
265 |
-
msgstr ""
|
266 |
-
|
267 |
-
#: ../classes/admin/media.php:168 ../templates/options-media.php:39
|
268 |
-
msgid "No"
|
269 |
-
msgstr ""
|
270 |
-
|
271 |
-
# @ sis
|
272 |
-
#: ../classes/admin/media.php:169 ../templates/options-media.php:39
|
273 |
-
msgid "Yes"
|
274 |
-
msgstr "Ja"
|
275 |
-
|
276 |
-
# @ sis
|
277 |
-
#: ../classes/admin/media.php:192
|
278 |
-
msgid "Add a new size of thumbnail"
|
279 |
-
msgstr "Neue Bildgröße für Thumbnail hinzufügen"
|
280 |
-
|
281 |
-
# @ sis
|
282 |
-
#: ../classes/admin/media.php:204
|
283 |
-
msgid "Get the PHP for the theme"
|
284 |
-
msgstr "Hol‘ dir den PHP-Code für dein Theme!"
|
285 |
-
|
286 |
-
# @ sis
|
287 |
-
#: ../classes/admin/media.php:205
|
288 |
-
msgid ""
|
289 |
-
"Copy and paste the code below into your Wordpress theme function file if you "
|
290 |
-
"wanted to save them and deactivate the plugin."
|
291 |
-
msgstr ""
|
292 |
-
"Falls du deine Bildgrößen behalten und das Plugin deaktivieren möchtest, "
|
293 |
-
"kopiere diesen PHP-Code in die Datei functions.php deines Theme."
|
294 |
-
|
295 |
-
#: ../classes/admin/media.php:221
|
296 |
-
msgid "Admin option-media template missing"
|
297 |
-
msgstr ""
|
298 |
-
|
299 |
-
#: ../classes/admin/media.php:425 ../classes/admin/post.php:65
|
300 |
-
msgid "Trying to cheat ?"
|
301 |
-
msgstr ""
|
302 |
-
|
303 |
-
# @ sis
|
304 |
-
#: ../classes/admin/media.php:472
|
305 |
-
msgid "Regeneration ended"
|
306 |
-
msgstr ""
|
307 |
-
|
308 |
-
# @ sis
|
309 |
-
#: ../classes/admin/post.php:216
|
310 |
-
msgid "Regenerate thumbnails"
|
311 |
-
msgstr "Artikelbilder neu generieren"
|
312 |
-
|
313 |
-
# @ sis
|
314 |
-
#: ../classes/admin/post.php:240 ../classes/admin/post.php:243
|
315 |
-
#: ../templates/options-media.php:138
|
316 |
-
msgid "Regenerate Thumbnails"
|
317 |
-
msgstr "Artikelbilder neu generieren"
|
318 |
-
|
319 |
-
# @ sis
|
320 |
-
#: ../templates/options-media.php:10
|
321 |
-
msgid "Select which thumbnails you want to rebuild:"
|
322 |
-
msgstr "Wähle die Artikelbilder aus, die neu generiert werden sollen:"
|
323 |
-
|
324 |
-
# @ sis
|
325 |
-
#: ../templates/options-media.php:15 ../templates/options-media.php:67
|
326 |
-
msgid "Size name"
|
327 |
-
msgstr "Bildgrößenbezeichnung"
|
328 |
-
|
329 |
-
# @ sis
|
330 |
-
#: ../templates/options-media.php:16 ../templates/options-media.php:68
|
331 |
-
msgid "Width"
|
332 |
-
msgstr "Breite"
|
333 |
-
|
334 |
-
# @ sis
|
335 |
-
#: ../templates/options-media.php:17 ../templates/options-media.php:69
|
336 |
-
msgid "Height"
|
337 |
-
msgstr "Höhe"
|
338 |
-
|
339 |
-
# @ sis
|
340 |
-
#: ../templates/options-media.php:18 ../templates/options-media.php:70
|
341 |
-
msgid "Crop ?"
|
342 |
-
msgstr "Beschneiden?"
|
343 |
-
|
344 |
-
# @ sis
|
345 |
-
#: ../templates/options-media.php:75
|
346 |
-
msgid "Select which post type source thumbnails you want to rebuild:"
|
347 |
-
msgstr ""
|
348 |
-
"Wähle die Inhaltstypen aus, deren Artikelbilder du neu generieren willst:"
|
349 |
-
|
350 |
-
# @ sis
|
351 |
-
#: ../templates/options-media.php:80 ../templates/options-media.php:107
|
352 |
-
msgid "Post type"
|
353 |
-
msgstr "Inhaltstyp"
|
354 |
-
|
355 |
-
# @ sis
|
356 |
-
#: ../templates/options-media.php:126
|
357 |
-
msgid "End time calculated :"
|
358 |
-
msgstr "Berechnetes Ende:"
|
359 |
-
|
360 |
-
#: ../templates/options-media.php:126
|
361 |
-
msgid "Calculating..."
|
362 |
-
msgstr ""
|
363 |
-
|
364 |
-
# @ sis
|
365 |
-
#: ../templates/options-media.php:137
|
366 |
-
msgid "Last image:"
|
367 |
-
msgstr "Letztes Bild:"
|
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.po
CHANGED
@@ -1,324 +1,324 @@
|
|
1 |
-
# Copyright (C) 2010
|
2 |
-
# This file is distributed under the same license as the package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Simple image sizes\n"
|
6 |
-
"Report-Msgid-Bugs-To: \n"
|
7 |
-
"POT-Creation-Date: 2014-04-20 15:24+0100\n"
|
8 |
-
"PO-Revision-Date: 2015-08-20 14:35+0100\n"
|
9 |
-
"Last-Translator: Nicolas Juen <njuen@beapi.fr>\n"
|
10 |
-
"Language-Team: Beapi <njuen@beapi.fr>\n"
|
11 |
-
"Language: fr_FR\n"
|
12 |
-
"MIME-Version: 1.0\n"
|
13 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
-
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"X-Poedit-SourceCharset: utf-8\n"
|
16 |
-
"X-Poedit-KeywordsList: __;_e;__\n"
|
17 |
-
"X-Poedit-Basepath: ../\n"
|
18 |
-
"X-Generator: Poedit 1.7.5\n"
|
19 |
-
"X-Poedit-SearchPath-0: .\n"
|
20 |
-
|
21 |
-
#: templates/options-media.php:10
|
22 |
-
msgid "Select which thumbnails you want to rebuild:"
|
23 |
-
msgstr "Sélectionnez les tailles de vignettes à régénérer"
|
24 |
-
|
25 |
-
#: templates/options-media.php:17 templates/options-media.php:73
|
26 |
-
msgid "Size name"
|
27 |
-
msgstr "Nom de la taille"
|
28 |
-
|
29 |
-
#: templates/options-media.php:18 templates/options-media.php:74
|
30 |
-
msgid "Width"
|
31 |
-
msgstr "Largeur"
|
32 |
-
|
33 |
-
#: templates/options-media.php:19 templates/options-media.php:75
|
34 |
-
msgid "Height"
|
35 |
-
msgstr "Hauteur"
|
36 |
-
|
37 |
-
#: templates/options-media.php:20 templates/options-media.php:76
|
38 |
-
msgid "Crop ?"
|
39 |
-
msgstr "Rogner ?"
|
40 |
-
|
41 |
-
#: templates/options-media.php:42 classes/admin/main.php:183
|
42 |
-
msgid "Yes"
|
43 |
-
msgstr "Oui"
|
44 |
-
|
45 |
-
#: templates/options-media.php:42 classes/admin/main.php:182
|
46 |
-
msgid "No"
|
47 |
-
msgstr "Non"
|
48 |
-
|
49 |
-
#: templates/options-media.php:81
|
50 |
-
msgid "Select which post type source thumbnails you want to rebuild:"
|
51 |
-
msgstr ""
|
52 |
-
"Sélectionnez quelles vignettes de quel type de contenu vous souhaitez "
|
53 |
-
"régénérer : "
|
54 |
-
|
55 |
-
#: templates/options-media.php:88 templates/options-media.php:119
|
56 |
-
msgid "Post type"
|
57 |
-
msgstr "Type de contenu"
|
58 |
-
|
59 |
-
#: templates/options-media.php:138
|
60 |
-
msgid "End time calculated :"
|
61 |
-
msgstr "Fin du traitement calculé :"
|
62 |
-
|
63 |
-
#: templates/options-media.php:139
|
64 |
-
msgid "Calculating..."
|
65 |
-
msgstr "Calcul en cours..."
|
66 |
-
|
67 |
-
#: templates/options-media.php:150
|
68 |
-
msgid "Last image:"
|
69 |
-
msgstr "Dernière image :"
|
70 |
-
|
71 |
-
#: templates/options-media.php:152 classes/admin/post.php:250
|
72 |
-
#: classes/admin/post.php:258
|
73 |
-
msgid "Regenerate Thumbnails"
|
74 |
-
msgstr "Régénérer les vignettes"
|
75 |
-
|
76 |
-
#: classes/admin/post.php:64 classes/admin/media.php:474
|
77 |
-
msgid "Trying to cheat ?"
|
78 |
-
msgstr "Cheater ?"
|
79 |
-
|
80 |
-
#: classes/admin/post.php:224
|
81 |
-
msgid "Regenerate thumbnails"
|
82 |
-
msgstr "Régénérer les vignettes"
|
83 |
-
|
84 |
-
#: classes/admin/main.php:44
|
85 |
-
msgid "Reading attachments..."
|
86 |
-
msgstr "Chargement des médias..."
|
87 |
-
|
88 |
-
#: classes/admin/main.php:45 classes/admin/media.php:171
|
89 |
-
msgid "Maximum width"
|
90 |
-
msgstr "Largeur maximum"
|
91 |
-
|
92 |
-
#: classes/admin/main.php:46 classes/admin/media.php:178
|
93 |
-
msgid "Maximum height"
|
94 |
-
msgstr "Hauteur maximum"
|
95 |
-
|
96 |
-
#: classes/admin/main.php:47
|
97 |
-
msgid "Crop"
|
98 |
-
msgstr "Rogner"
|
99 |
-
|
100 |
-
#: classes/admin/main.php:48
|
101 |
-
msgid "yes"
|
102 |
-
msgstr "oui"
|
103 |
-
|
104 |
-
#: classes/admin/main.php:49
|
105 |
-
msgid "no"
|
106 |
-
msgstr "non"
|
107 |
-
|
108 |
-
#: classes/admin/main.php:50 classes/admin/media.php:208
|
109 |
-
msgid "Show in post insertion ?"
|
110 |
-
msgstr "Afficher dans l'insertion ?"
|
111 |
-
|
112 |
-
#: classes/admin/main.php:51
|
113 |
-
msgid " of "
|
114 |
-
msgstr " de "
|
115 |
-
|
116 |
-
#: classes/admin/main.php:52
|
117 |
-
msgid " or "
|
118 |
-
msgstr " ou "
|
119 |
-
|
120 |
-
#: classes/admin/main.php:53
|
121 |
-
msgid " before the end."
|
122 |
-
msgstr " avant la fin."
|
123 |
-
|
124 |
-
#: classes/admin/main.php:54 classes/admin/media.php:210
|
125 |
-
msgid "Delete"
|
126 |
-
msgstr "Supprimer"
|
127 |
-
|
128 |
-
#: classes/admin/main.php:55
|
129 |
-
msgid "No media in your site to regenerate !"
|
130 |
-
msgstr "Pas de médias à regénérer !"
|
131 |
-
|
132 |
-
#: classes/admin/main.php:56
|
133 |
-
msgid "Regenerating "
|
134 |
-
msgstr "Regénération "
|
135 |
-
|
136 |
-
#: classes/admin/main.php:57
|
137 |
-
msgid "Regenerate "
|
138 |
-
msgstr "Regénérer "
|
139 |
-
|
140 |
-
#: classes/admin/main.php:58
|
141 |
-
msgid "Validate image size name"
|
142 |
-
msgstr "Valider le nom de la taille d'image"
|
143 |
-
|
144 |
-
#: classes/admin/main.php:59
|
145 |
-
msgid "Done."
|
146 |
-
msgstr "Fini."
|
147 |
-
|
148 |
-
#: classes/admin/main.php:60
|
149 |
-
msgid "Size"
|
150 |
-
msgstr "Taille "
|
151 |
-
|
152 |
-
#: classes/admin/main.php:61
|
153 |
-
msgid ""
|
154 |
-
"Don't use the basic WordPress thumbnail size name, use the form above to "
|
155 |
-
"edit them"
|
156 |
-
msgstr ""
|
157 |
-
"N'utilisez pas les tailles par défaut de WordPress comme nom de taille, "
|
158 |
-
"éditez leurs valeurs avec le formulaire ci-dessus."
|
159 |
-
|
160 |
-
#: classes/admin/main.php:62
|
161 |
-
msgid "This size is already registered, edit it instead of recreating it."
|
162 |
-
msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
|
163 |
-
|
164 |
-
#: classes/admin/main.php:63
|
165 |
-
msgid "Do you really want to delete these size ?"
|
166 |
-
msgstr "Voulez-vous réellement supprimer cette taille ?"
|
167 |
-
|
168 |
-
#: classes/admin/main.php:64 classes/admin/media.php:211
|
169 |
-
msgid "Update"
|
170 |
-
msgstr "Mettre à jour"
|
171 |
-
|
172 |
-
#: classes/admin/main.php:65
|
173 |
-
msgid "Error requesting page"
|
174 |
-
msgstr "Erreur lors de la requête vers la page"
|
175 |
-
|
176 |
-
#: classes/admin/main.php:66
|
177 |
-
msgid "images have been regenerated !"
|
178 |
-
msgstr "images ont été regénérées !"
|
179 |
-
|
180 |
-
#: classes/admin/main.php:67
|
181 |
-
msgid "Validate"
|
182 |
-
msgstr "Valider"
|
183 |
-
|
184 |
-
#: classes/admin/main.php:68
|
185 |
-
msgid " started at"
|
186 |
-
msgstr " commencé à "
|
187 |
-
|
188 |
-
#: classes/admin/main.php:69 classes/admin/media.php:185
|
189 |
-
msgid "Public name"
|
190 |
-
msgstr "Nom public"
|
191 |
-
|
192 |
-
#: classes/admin/main.php:70
|
193 |
-
msgid " finished at :"
|
194 |
-
msgstr " terminé à :"
|
195 |
-
|
196 |
-
#: classes/admin/main.php:71
|
197 |
-
msgid ""
|
198 |
-
"Error during the php treatment, be sure to not have php errors in your page"
|
199 |
-
msgstr ""
|
200 |
-
"Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans "
|
201 |
-
"votre page"
|
202 |
-
|
203 |
-
#: classes/admin/main.php:72
|
204 |
-
msgid "All the sizes you have modified are not saved, continue anyway ?"
|
205 |
-
msgstr ""
|
206 |
-
"Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer "
|
207 |
-
"tout de même ?"
|
208 |
-
|
209 |
-
#: classes/admin/main.php:73
|
210 |
-
msgid "This image has been regenerated in %s seconds"
|
211 |
-
msgstr "Cette image a été regénérée en %s secondes"
|
212 |
-
|
213 |
-
#: classes/admin/main.php:96
|
214 |
-
msgid "No id given in POST datas."
|
215 |
-
msgstr "Pas d'id donné dans les données du POST."
|
216 |
-
|
217 |
-
#: classes/admin/main.php:109
|
218 |
-
msgid ""
|
219 |
-
"This file already exists in this size and have not been regenerated :<br/><a "
|
220 |
-
"target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
221 |
-
msgstr ""
|
222 |
-
"Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
|
223 |
-
"regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
224 |
-
|
225 |
-
#: classes/admin/main.php:116
|
226 |
-
msgid ""
|
227 |
-
"This file does not exists and have not been regenerated :<br/><a target="
|
228 |
-
"\"_blank\" href=\"%1$s\" >%2$s</a>"
|
229 |
-
msgstr ""
|
230 |
-
"Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
|
231 |
-
"regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
232 |
-
|
233 |
-
#: classes/admin/main.php:167
|
234 |
-
msgid "Left"
|
235 |
-
msgstr "Gauche"
|
236 |
-
|
237 |
-
#: classes/admin/main.php:168
|
238 |
-
msgid "Center"
|
239 |
-
msgstr "Centre"
|
240 |
-
|
241 |
-
#: classes/admin/main.php:169
|
242 |
-
msgid "Right"
|
243 |
-
msgstr "Droite"
|
244 |
-
|
245 |
-
#: classes/admin/main.php:173
|
246 |
-
msgid "top"
|
247 |
-
msgstr "haut"
|
248 |
-
|
249 |
-
#: classes/admin/main.php:174
|
250 |
-
msgid "center"
|
251 |
-
msgstr "centre"
|
252 |
-
|
253 |
-
#: classes/admin/main.php:175
|
254 |
-
msgid "bottom"
|
255 |
-
msgstr "bas"
|
256 |
-
|
257 |
-
#: classes/admin/media.php:67
|
258 |
-
msgid "Settings"
|
259 |
-
msgstr "Paramètres"
|
260 |
-
|
261 |
-
#: classes/admin/media.php:107
|
262 |
-
msgid "%s size"
|
263 |
-
msgstr "Taille %s"
|
264 |
-
|
265 |
-
#: classes/admin/media.php:117
|
266 |
-
msgid "Add a new size"
|
267 |
-
msgstr "Ajouter une nouvelle taille"
|
268 |
-
|
269 |
-
#: classes/admin/media.php:123
|
270 |
-
msgid "Get php for theme"
|
271 |
-
msgstr "Récupérer le PHP pour le thème"
|
272 |
-
|
273 |
-
#: classes/admin/media.php:129
|
274 |
-
msgid "Thumbnail regeneration"
|
275 |
-
msgstr "Régénération des vignettes"
|
276 |
-
|
277 |
-
#: classes/admin/media.php:192
|
278 |
-
msgid "Cropping"
|
279 |
-
msgstr "Rognage"
|
280 |
-
|
281 |
-
#: classes/admin/media.php:226
|
282 |
-
msgid "Add a new size of thumbnail"
|
283 |
-
msgstr "Ajouter une nouvelle taille de vignette"
|
284 |
-
|
285 |
-
#: classes/admin/media.php:239
|
286 |
-
msgid "Get the PHP for the theme"
|
287 |
-
msgstr "Récupérer le PHP pour le thème"
|
288 |
-
|
289 |
-
#: classes/admin/media.php:240
|
290 |
-
msgid ""
|
291 |
-
"Copy and paste the code below into your Wordpress theme function file if you "
|
292 |
-
"wanted to save them and deactivate the plugin."
|
293 |
-
msgstr ""
|
294 |
-
"Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre "
|
295 |
-
"thème WordPress si vous voulez les conserver et désactiver ce plugin."
|
296 |
-
|
297 |
-
#: classes/admin/media.php:256
|
298 |
-
msgid "Admin option-media template missing"
|
299 |
-
msgstr "Template d'affichage admin manquant"
|
300 |
-
|
301 |
-
#: classes/admin/media.php:521
|
302 |
-
msgid "Regeneration ended"
|
303 |
-
msgstr "Regénération terminée"
|
304 |
-
|
305 |
-
#~ msgid "Legend of the sizes"
|
306 |
-
#~ msgstr "Légende des tailles"
|
307 |
-
|
308 |
-
#~ msgid ""
|
309 |
-
#~ "The images created on your theme are <span style=\"color:#F2A13A"
|
310 |
-
#~ "\">orange</span> and your custom size are <span style=\"color:#89D76A\"> "
|
311 |
-
#~ "green </span>."
|
312 |
-
#~ msgstr ""
|
313 |
-
#~ "Les tailles d'images crées par votre thème sont en <span style=\"color:"
|
314 |
-
#~ "#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style="
|
315 |
-
#~ "\"color:#89D76A\"> vert </span>."
|
316 |
-
|
317 |
-
#~ msgid "Size "
|
318 |
-
#~ msgstr "Taille "
|
319 |
-
|
320 |
-
#~ msgid "Theme size"
|
321 |
-
#~ msgstr "Taille de thème"
|
322 |
-
|
323 |
-
#~ msgid "Resize ?"
|
324 |
-
#~ msgstr "Regénérer ?"
|
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.po
CHANGED
@@ -1,471 +1,471 @@
|
|
1 |
-
# This file was generated by WPML
|
2 |
-
# WPML is a WordPress plugin that can turn any WordPress or WordPressMU site into a full featured multilingual content management system.
|
3 |
-
# http://wpml.org
|
4 |
-
msgid ""
|
5 |
-
msgstr ""
|
6 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
7 |
-
"Content-Transfer-Encoding: 8bit\n"
|
8 |
-
"Project-Id-Version: simple-image-sizes\n"
|
9 |
-
"POT-Creation-Date: \n"
|
10 |
-
"PO-Revision-Date: \n"
|
11 |
-
"Last-Translator: Ahrale <contact@atar4u.com>\n"
|
12 |
-
"Language-Team: Ahrale, Atar4U.com <contact@atar4u.com>\n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Language: he_IL\n"
|
15 |
-
"X-Generator: Poedit 1.7.3\n"
|
16 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
-
|
18 |
-
# 'center' => __( 'center', 'simple-image-sizes' ),
|
19 |
-
# 'bottom' => __( 'bottom', 'simple-image-sizes' ),
|
20 |
-
# );
|
21 |
-
# wpml-name: 71f262d796bed1ab30e8a2d5a8ddee6f
|
22 |
-
msgid "bottom"
|
23 |
-
msgstr "למטה"
|
24 |
-
|
25 |
-
# 'center' => __( 'center', 'simple-image-sizes' ),
|
26 |
-
# 'bottom' => __( 'bottom', 'simple-image-sizes' ),
|
27 |
-
# );
|
28 |
-
# wpml-name: adb115059e28d960fa8badfac5516667
|
29 |
-
msgid "center"
|
30 |
-
msgstr "מרכז"
|
31 |
-
|
32 |
-
# $y = array(
|
33 |
-
# 'top' => __( 'top', 'simple-image-sizes' ),
|
34 |
-
# 'center' => __( 'center', 'simple-image-sizes' ),
|
35 |
-
# wpml-name: b28354b543375bfa94dabaeda722927f
|
36 |
-
msgid "top"
|
37 |
-
msgstr "למעלה"
|
38 |
-
|
39 |
-
# 'center' => __( 'Center', 'simple-image-sizes' ),
|
40 |
-
# 'right' => __( 'Right', 'simple-image-sizes' ),
|
41 |
-
# );
|
42 |
-
# wpml-name: 92b09c7c48c520c3c55e497875da437c
|
43 |
-
msgid "Right"
|
44 |
-
msgstr "ימין"
|
45 |
-
|
46 |
-
# 'top' => __( 'top', 'simple-image-sizes' ),
|
47 |
-
# 'center' => __( 'center', 'simple-image-sizes' ),
|
48 |
-
# 'bottom' => __( 'bottom', 'simple-image-sizes' ),
|
49 |
-
# wpml-name: 4f1f6016fc9f3f2353c0cc7c67b292bd
|
50 |
-
msgid "Center"
|
51 |
-
msgstr "אמצע"
|
52 |
-
|
53 |
-
# $x = array(
|
54 |
-
# 'left' => __( 'Left', 'simple-image-sizes' ),
|
55 |
-
# 'center' => __( 'Center', 'simple-image-sizes' ),
|
56 |
-
# wpml-name: 945d5e233cf7d6240f6b783b36a374ff
|
57 |
-
msgid "Left"
|
58 |
-
msgstr "שמאל"
|
59 |
-
|
60 |
-
# 'time' => timer_stop( false, 4 ),
|
61 |
-
# 'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
|
62 |
-
# );
|
63 |
-
# wpml-name: a97ca0c87f209ef404682709c928fb77
|
64 |
-
msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
65 |
-
msgstr "קובץ זה אינו קיים ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
66 |
-
|
67 |
-
# 'time' => timer_stop( false, 4 ),
|
68 |
-
# 'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'simple-image-sizes'), get_edit_post_link( $att_id ), get_the_title( $att_id ) )
|
69 |
-
# );
|
70 |
-
# wpml-name: 5aa7d495ab0ac8335d6c1019be44de71
|
71 |
-
msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
72 |
-
msgstr "קובץ זה כבר קיים בגודל זה ולא נוצר מחדש :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
73 |
-
|
74 |
-
# 'time' => timer_stop( false, 4 ),
|
75 |
-
# 'error' => __( 'No id given in POST datas.', 'simple-image-sizes' )
|
76 |
-
# );
|
77 |
-
# wpml-name: 31644e7c5c9ebc483f0e6e3497caf08e
|
78 |
-
msgid "No id given in POST datas."
|
79 |
-
msgstr "אין מזהה בנתוני הפוסט."
|
80 |
-
|
81 |
-
# 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
|
82 |
-
# 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
|
83 |
-
# 'crop_positions' => self::get_available_crop(),
|
84 |
-
# wpml-name: 368cc8aa10b0843efcd7d24789f8f6b7
|
85 |
-
msgid "This image has been regenerated in %s seconds"
|
86 |
-
msgstr "תמונה זו נוצרה מחדש ב %s שניות"
|
87 |
-
|
88 |
-
# 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
|
89 |
-
# 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
|
90 |
-
# 'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'simple-image-sizes' ),
|
91 |
-
# wpml-name: 63b1eca818d85423d99421224064c83f
|
92 |
-
msgid "All the sizes you have modifed are not saved, continue anyway ?"
|
93 |
-
msgstr "כל המידות ששינית לא נשמרו, להמשיך בכל זאת ?"
|
94 |
-
|
95 |
-
# 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
|
96 |
-
# 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
|
97 |
-
# 'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'simple-image-sizes' ),
|
98 |
-
# wpml-name: 2e2e3b980040e2e5ff60122457a2d94e
|
99 |
-
msgid "Error during the php treatment, be sure to not have php errors in your page"
|
100 |
-
msgstr "שגיאה במהלך טיפול ה php, וודא שאין שגיאות php בעמוד שלך"
|
101 |
-
|
102 |
-
# 'customName' => __( 'Public name', 'simple-image-sizes' ),
|
103 |
-
# 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
|
104 |
-
# 'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'simple-image-sizes' ),
|
105 |
-
# wpml-name: 250efec0f456647c37b218d66fbf1cd1
|
106 |
-
msgid " finished at :"
|
107 |
-
msgstr " הסתיים ב :"
|
108 |
-
|
109 |
-
# 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
|
110 |
-
# 'startedAt' => __( ' started at', 'simple-image-sizes' ),
|
111 |
-
# 'customName' => __( 'Public name', 'simple-image-sizes' ),
|
112 |
-
# wpml-name: a8a392d1e0802a5f793863ae847d8d1a
|
113 |
-
msgid " started at"
|
114 |
-
msgstr "התחיל ב"
|
115 |
-
|
116 |
-
# 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
|
117 |
-
# 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
|
118 |
-
# 'startedAt' => __( ' started at', 'simple-image-sizes' ),
|
119 |
-
# wpml-name: ad3d06d03d94223fa652babc913de686
|
120 |
-
msgid "Validate"
|
121 |
-
msgstr "אמת"
|
122 |
-
|
123 |
-
# 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
|
124 |
-
# 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
|
125 |
-
# 'validateButton' => __( 'Validate', 'simple-image-sizes' ),
|
126 |
-
# wpml-name: 2be848adf7d74af67397cd8d7afe649f
|
127 |
-
msgid "images have been regenerated !"
|
128 |
-
msgstr "תמונות נוצרו מחדש !"
|
129 |
-
|
130 |
-
# 'update' => __( 'Update', 'simple-image-sizes' ),
|
131 |
-
# 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
|
132 |
-
# 'messageRegenerated' => __( 'images have been regenerated !', 'simple-image-sizes' ),
|
133 |
-
# wpml-name: fe0bfb1709b1de3ce5b316f877845254
|
134 |
-
msgid "Error requesting page"
|
135 |
-
msgstr "שגיאה בבקשת העמוד"
|
136 |
-
|
137 |
-
# 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
|
138 |
-
# 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
|
139 |
-
# 'update' => __( 'Update', 'simple-image-sizes' ),
|
140 |
-
# wpml-name: aa795e0c2898239890d9a04b3225b71d
|
141 |
-
msgid "Do you really want to delete these size ?"
|
142 |
-
msgstr "האם אתה באמת רוצה למחוק את הגודל הזה ?"
|
143 |
-
|
144 |
-
# 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
|
145 |
-
# 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
|
146 |
-
# 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
|
147 |
-
# wpml-name: 580c280158be3a37af3f1a396fa8fa48
|
148 |
-
msgid "This size is already registered, edit it instead of recreating it."
|
149 |
-
msgstr "גודל זה כבר רשום, ערוך אותו במקום ליצור אותו מחדש."
|
150 |
-
|
151 |
-
# 'size' => __( 'Size', 'simple-image-sizes' ),
|
152 |
-
# 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
|
153 |
-
# 'alreadyPresent' => __( 'This size is already registered, edit it instead of recreating it.', 'simple-image-sizes' ),
|
154 |
-
# wpml-name: 09ec5b94f6e7373427b84771c2ec9fda
|
155 |
-
msgid "Don't use the basic Wordpress thumbnail size name, use the form above to edit them"
|
156 |
-
msgstr "אל תשתמש בשם התמונה הממוזערת של הוורדפרס הבסיסי, השתמש בטופס לעיל כדי לערוך אותם"
|
157 |
-
|
158 |
-
# 'done' => __( 'Done.', 'simple-image-sizes' ),
|
159 |
-
# 'size' => __( 'Size', 'simple-image-sizes' ),
|
160 |
-
# 'notOriginal' => __( 'Don\'t use the basic Wordpress thumbnail size name, use the form above to edit them', 'simple-image-sizes' ),
|
161 |
-
# wpml-name: 6f6cb72d544962fa333e2e34ce64f719
|
162 |
-
msgid "Size"
|
163 |
-
msgstr "גודל"
|
164 |
-
|
165 |
-
# 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
|
166 |
-
# 'done' => __( 'Done.', 'simple-image-sizes' ),
|
167 |
-
# 'size' => __( 'Size', 'simple-image-sizes' ),
|
168 |
-
# wpml-name: f5940523060652e3a7d9c269ce48de50
|
169 |
-
msgid "Done."
|
170 |
-
msgstr "בוצע."
|
171 |
-
|
172 |
-
# 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
|
173 |
-
# 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
|
174 |
-
# 'done' => __( 'Done.', 'simple-image-sizes' ),
|
175 |
-
# wpml-name: 7a50a2d7840041d6668f889ea35fa548
|
176 |
-
msgid "Validate image size name"
|
177 |
-
msgstr "אמת את שם הגודל"
|
178 |
-
|
179 |
-
# 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
|
180 |
-
# 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
|
181 |
-
# 'validate' => __( 'Validate image size name', 'simple-image-sizes' ),
|
182 |
-
# wpml-name: 69314e19325b39027d107d0c79a9897d
|
183 |
-
msgid "Regenerate "
|
184 |
-
msgstr "צור מחדש "
|
185 |
-
|
186 |
-
# 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
|
187 |
-
# 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
|
188 |
-
# 'regenerate' => __( 'Regenerate ', 'simple-image-sizes'),
|
189 |
-
# wpml-name: 2d2ed670c4cb53daf32909b501fa4620
|
190 |
-
msgid "Regenerating "
|
191 |
-
msgstr "יוצר מחדש"
|
192 |
-
|
193 |
-
# 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
|
194 |
-
# 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
|
195 |
-
# 'regenerating' => __( 'Regenerating ', 'simple-image-sizes'),
|
196 |
-
# wpml-name: 37b1d0785260f44322eb6aa55ef3b1ad
|
197 |
-
msgid "No media in your site to regenerate !"
|
198 |
-
msgstr "אין מדיה באתר שלך ליצור מחדש !"
|
199 |
-
|
200 |
-
# 'or' => __( ' or ', 'simple-image-sizes' ),
|
201 |
-
# 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
|
202 |
-
# 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
|
203 |
-
# wpml-name: b08355a64e809c27c91ee20706e66d1b
|
204 |
-
msgid " before the end."
|
205 |
-
msgstr "לפני הסוף."
|
206 |
-
|
207 |
-
# 'of' => __( ' of ', 'simple-image-sizes' ),
|
208 |
-
# 'or' => __( ' or ', 'simple-image-sizes' ),
|
209 |
-
# 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
|
210 |
-
# wpml-name: 8e0c4e984dbb4b30a86c232b15df8490
|
211 |
-
msgid " or "
|
212 |
-
msgstr "או "
|
213 |
-
|
214 |
-
# 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
|
215 |
-
# 'of' => __( ' of ', 'simple-image-sizes' ),
|
216 |
-
# 'or' => __( ' or ', 'simple-image-sizes' ),
|
217 |
-
# wpml-name: 7e7e076a81fa5dc64f44b8ff14199cbf
|
218 |
-
msgid " of "
|
219 |
-
msgstr " של "
|
220 |
-
|
221 |
-
# <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
|
222 |
-
# <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
|
223 |
-
# <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
|
224 |
-
# wpml-name: 7fa3b767c460b54a2be4d49030b349c7
|
225 |
-
msgid "no"
|
226 |
-
msgstr "לא"
|
227 |
-
|
228 |
-
# <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
|
229 |
-
# <option value="0" <?php selected( 0, $crop ); ?>><?php esc_html_e( 'No', 'simple-image-sizes' ); ?></option>
|
230 |
-
# <option value="1" <?php selected( 1, $crop ); ?>><?php esc_html_e( 'Yes', 'simple-image-sizes' ); ?></option>
|
231 |
-
# wpml-name: a6105c0a611b41b08f1209506350279e
|
232 |
-
msgid "yes"
|
233 |
-
msgstr "כן"
|
234 |
-
|
235 |
-
# 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
|
236 |
-
# 'crop' => __( 'Crop', 'simple-image-sizes' ),
|
237 |
-
# 'tr' => __( 'yes', 'simple-image-sizes' ),
|
238 |
-
# wpml-name: d388632d05e8826abe4b95de0b110529
|
239 |
-
msgid "Crop"
|
240 |
-
msgstr "חתוך"
|
241 |
-
|
242 |
-
# 'ajaxUrl' => admin_url( '/admin-ajax.php' ),
|
243 |
-
# 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
|
244 |
-
# 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
|
245 |
-
# wpml-name: 6a98035cbc4c133b74c77491ce876940
|
246 |
-
msgid "Reading attachments..."
|
247 |
-
msgstr "קורא קבצים מצורפים..."
|
248 |
-
|
249 |
-
# 'html' => '
|
250 |
-
# <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
|
251 |
-
# <span class="spinner"></span>
|
252 |
-
# wpml-name: 258606ef5a3ed5cd7e39da08435adec0
|
253 |
-
msgid "Regenerate thumbnails"
|
254 |
-
msgstr "יוצר מחדש תמונות ממוזערות"
|
255 |
-
|
256 |
-
# } else {
|
257 |
-
# esc_html_e( 'Admin option-media template missing', 'simple-image-sizes' );
|
258 |
-
# }
|
259 |
-
# wpml-name: f528f9b0d97ba7592b85a85f0c9f9c13
|
260 |
-
msgid "Admin option-media template missing"
|
261 |
-
msgstr "חסרה תבנית ניהול אפשרות-מדיה"
|
262 |
-
|
263 |
-
# public static function getPhpButton() { ?>
|
264 |
-
# <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
|
265 |
-
# <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
|
266 |
-
# wpml-name: bb3db310d06bffcbddaf06323583e91d
|
267 |
-
msgid "Get the PHP for the theme"
|
268 |
-
msgstr "קבל את ה PHP עבור ערכת הנושא"
|
269 |
-
|
270 |
-
# public static function addSizeButton() { ?>
|
271 |
-
# <input type="button" class="button-secondary action" id="add_size" value="<?php esc_attr_e( 'Add a new size of thumbnail', 'simple-image-sizes'); ?>" />
|
272 |
-
# <?php
|
273 |
-
# wpml-name: 786741aec3b7c066357245ef98dc9fde
|
274 |
-
msgid "Add a new size of thumbnail"
|
275 |
-
msgstr "הוסף גודל חדש של תמונה ממוזערת"
|
276 |
-
|
277 |
-
# if( !wp_verify_nonce( $nonce , 'regen' ) ) {
|
278 |
-
# SIS_Admin_Main::displayJson( array( 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ) );
|
279 |
-
# }
|
280 |
-
# wpml-name: b57077974e73b05d05c5ab21a7bb35fe
|
281 |
-
msgid "Trying to cheat ?"
|
282 |
-
msgstr "מנסה לרמות ?"
|
283 |
-
|
284 |
-
# <input type="button" class="button-secondary action" id="get_php" value="<?php esc_attr_e( 'Get the PHP for the theme', 'simple-image-sizes'); ?>" />
|
285 |
-
# <p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'simple-image-sizes'); ?> </p>
|
286 |
-
# <code></code>
|
287 |
-
# wpml-name: 265103d3ca486243e0f00a62d6dfd2b7
|
288 |
-
msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
|
289 |
-
msgstr "העתק והדבק את הקוד שלהלן אל קובץ function.php בערכת הנושא של הוורדפרס שלך אם אתה רוצה לשמור אותם ולכבות את התוסף."
|
290 |
-
|
291 |
-
# 'confirmDelete' => __( 'Do you really want to delete these size ?', 'simple-image-sizes' ),
|
292 |
-
# 'update' => __( 'Update', 'simple-image-sizes' ),
|
293 |
-
# 'ajaxErrorHandler' => __( 'Error requesting page', 'simple-image-sizes' ),
|
294 |
-
# wpml-name: 06933067aafd48425d67bcb01bba5cb6
|
295 |
-
msgid "Update"
|
296 |
-
msgstr "עדכן"
|
297 |
-
|
298 |
-
# 'beforeEnd' => __( ' before the end.', 'simple-image-sizes' ),
|
299 |
-
# 'deleteImage' => __( 'Delete', 'simple-image-sizes' ),
|
300 |
-
# 'noMedia' => __( 'No media in your site to regenerate !', 'simple-image-sizes' ),
|
301 |
-
# wpml-name: f2a6c498fb90ee345d997f888fce3b18
|
302 |
-
msgid "Delete"
|
303 |
-
msgstr "מחיקה"
|
304 |
-
|
305 |
-
# 'fl' => __( 'no', 'simple-image-sizes' ),
|
306 |
-
# 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
|
307 |
-
# 'of' => __( ' of ', 'simple-image-sizes' ),
|
308 |
-
# wpml-name: b223790b250471a6cae35deb5a4b0aa4
|
309 |
-
msgid "Show in post insertion ?"
|
310 |
-
msgstr "להציג בהוספה לפוסט ?"
|
311 |
-
|
312 |
-
# <span class="size_options">
|
313 |
-
# <label class="c" for="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>"><?php _e( 'Cropping', 'simple-image-sizes'); ?></label>
|
314 |
-
# <select id="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" class="c crop" base_c='<?php echo esc_attr( $crop ); ?>' name="<?php echo esc_attr( 'custom_image_sizes['.$args['name'].'][c]' ); ?>" >
|
315 |
-
# wpml-name: 57bb299f73bf5946a8d4790cc4bbd8fb
|
316 |
-
msgid "Cropping"
|
317 |
-
msgstr "חיתוך"
|
318 |
-
|
319 |
-
# 'startedAt' => __( ' started at', 'simple-image-sizes' ),
|
320 |
-
# 'customName' => __( 'Public name', 'simple-image-sizes' ),
|
321 |
-
# 'finishedAt' => __( ' finished at :', 'simple-image-sizes' ),
|
322 |
-
# wpml-name: d274013ea65428454962a59b7b373a41
|
323 |
-
msgid "Public name"
|
324 |
-
msgstr "שם ציבורי"
|
325 |
-
|
326 |
-
# 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
|
327 |
-
# 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
|
328 |
-
# 'crop' => __( 'Crop', 'simple-image-sizes' ),
|
329 |
-
# wpml-name: d3c7d075cfb70ed08d062facb1a056e8
|
330 |
-
msgid "Maximum height"
|
331 |
-
msgstr "גובה מירבי"
|
332 |
-
|
333 |
-
# 'reading' => __( 'Reading attachments...', 'simple-image-sizes' ),
|
334 |
-
# 'maximumWidth' => __( 'Maximum width', 'simple-image-sizes' ),
|
335 |
-
# 'maximumHeight' => __( 'Maximum height', 'simple-image-sizes' ),
|
336 |
-
# wpml-name: 614a998c745fcc3009bf6c6daf18562e
|
337 |
-
msgid "Maximum width"
|
338 |
-
msgstr "רוחב מירבי"
|
339 |
-
|
340 |
-
# return array(
|
341 |
-
# 'message' => __( 'Regeneration ended', 'simple-image-sizes')
|
342 |
-
# );
|
343 |
-
# wpml-name: cd4e39700ffd7ae49e430859c97834c2
|
344 |
-
msgid "Regeneration ended"
|
345 |
-
msgstr "היצירה מחדש הסתיימה"
|
346 |
-
|
347 |
-
# // Add section for the thumbnail regeneration
|
348 |
-
# add_settings_section( 'thumbnail_regenerate', __( 'Thumbnail regeneration', 'simple-image-sizes' ), array( __CLASS__, 'thumbnailRegenerate' ), 'media' );
|
349 |
-
# }
|
350 |
-
# wpml-name: 99e4f0028f10ce4b38eb35c5488c1bba
|
351 |
-
msgid "Thumbnail regeneration"
|
352 |
-
msgstr "יצירה מחדש של תמונה ממוזערת"
|
353 |
-
|
354 |
-
# // Add php button
|
355 |
-
# add_settings_field( 'get_php_button', __( 'Get php for theme', 'simple-image-sizes' ), array( __CLASS__, 'getPhpButton' ), 'media' );
|
356 |
-
#
|
357 |
-
# wpml-name: fea30a43d377bbead8aace51d915477a
|
358 |
-
msgid "Get php for theme"
|
359 |
-
msgstr "קבל php עבור ערכת הנושא"
|
360 |
-
|
361 |
-
# // Add the button
|
362 |
-
# add_settings_field( 'add_size_button', __( 'Add a new size', 'simple-image-sizes' ), array( __CLASS__, 'addSizeButton' ), 'media' );
|
363 |
-
#
|
364 |
-
# wpml-name: a2da7c2e28e5e69b7daaa13377ee29e4
|
365 |
-
msgid "Add a new size"
|
366 |
-
msgstr "הוספת גודל חדש"
|
367 |
-
|
368 |
-
# // Add the setting field for this size
|
369 |
-
# add_settings_field( 'image_size_'.$s, sprintf( __( '%s size', 'simple-image-sizes' ), $s ), array( __CLASS__, 'image_sizes' ), 'media' , 'default', array( 'name' => $s , 'width' => $width , 'height' => $height, 'c' => $crop ) );
|
370 |
-
# }
|
371 |
-
# wpml-name: be74017300bae51721e39b611652ee22
|
372 |
-
msgid "%s size"
|
373 |
-
msgstr "גודל %s"
|
374 |
-
|
375 |
-
#
|
376 |
-
# $settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'simple-image-sizes' ).' </a>';
|
377 |
-
# array_unshift( $links, $settings_link );
|
378 |
-
# wpml-name: f4f70727dc34561dfde1a3c529b6205c
|
379 |
-
msgid "Settings"
|
380 |
-
msgstr "הגדרות"
|
381 |
-
|
382 |
-
# 'html' => '
|
383 |
-
# <input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'simple-image-sizes' ).'" />
|
384 |
-
# <span class="spinner"></span>
|
385 |
-
# wpml-name: 6f8330b0bc479531022cb9002cffde14
|
386 |
-
msgid "Regenerate Thumbnails"
|
387 |
-
msgstr "צור מחדש תמונות ממוזערות"
|
388 |
-
|
389 |
-
# </div>
|
390 |
-
# <div class="thumb"><h4><?php _e( 'Last image:', 'simple-image-sizes'); ?></h4><img class="thumb-img" /></div>
|
391 |
-
# <input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'simple-image-sizes' ) ?>" />
|
392 |
-
# wpml-name: c9d4436607c99b571f4d84ff0e1a8fb5
|
393 |
-
msgid "Last image:"
|
394 |
-
msgstr "תמונה אחרונה:"
|
395 |
-
|
396 |
-
# <span class="ui-icon ui-icon-info"></span>
|
397 |
-
# <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
|
398 |
-
# </p>
|
399 |
-
# wpml-name: 0582cd2fd62743a89db5f715fd51e532
|
400 |
-
msgid "Calculating..."
|
401 |
-
msgstr "מחשב..."
|
402 |
-
|
403 |
-
# <span class="ui-icon ui-icon-info"></span>
|
404 |
-
# <span><strong><?php _e( 'End time calculated :', 'simple-image-sizes' ); ?></strong> <span class='time_message'><?php _e( 'Calculating...', 'simple-image-sizes' ) ?></span> </span>
|
405 |
-
# </p>
|
406 |
-
# wpml-name: fe5a9d159a95ad346f9443464115edfc
|
407 |
-
msgid "End time calculated :"
|
408 |
-
msgstr "חישוב זמן סיום :"
|
409 |
-
|
410 |
-
# <th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
|
411 |
-
# <th class="manage-column" scope="col"><?php _e( 'Post type', 'simple-image-sizes'); ?></th>
|
412 |
-
# </tr>
|
413 |
-
# wpml-name: 363c969ebde35c09236f5355c6dff165
|
414 |
-
msgid "Post type"
|
415 |
-
msgstr "סוג מאמר"
|
416 |
-
|
417 |
-
#
|
418 |
-
# <h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'simple-image-sizes'); ?></h4>
|
419 |
-
# <table cellspacing="0" class="widefat page fixed sis">
|
420 |
-
# wpml-name: 4f02f535b1a39a2fc34c244b5fe5c828
|
421 |
-
msgid "Select which post type source thumbnails you want to rebuild:"
|
422 |
-
msgstr "בחר אילו תמונות ממוזערות של אילו סוגי פוסט אתה רוצה לבנות מחדש:"
|
423 |
-
|
424 |
-
# <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
|
425 |
-
# <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
|
426 |
-
# </tr>
|
427 |
-
# wpml-name: 8ae8aaf1c06d7eeee38c66ba6f6c4f00
|
428 |
-
msgid "Crop ?"
|
429 |
-
msgstr "לחתוך ?"
|
430 |
-
|
431 |
-
# <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
|
432 |
-
# <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
|
433 |
-
# <th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes'); ?></th>
|
434 |
-
# wpml-name: eec6c4bdbd339edf8cbea68becb85244
|
435 |
-
msgid "Height"
|
436 |
-
msgstr "גובה"
|
437 |
-
|
438 |
-
# <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
|
439 |
-
# <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
|
440 |
-
# <th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes'); ?></th>
|
441 |
-
# wpml-name: 32954654ac8fe66a1d09be19001de2d4
|
442 |
-
msgid "Width"
|
443 |
-
msgstr "רוחב"
|
444 |
-
|
445 |
-
# <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
|
446 |
-
# <th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes'); ?></th>
|
447 |
-
# <th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes'); ?></th>
|
448 |
-
# wpml-name: 3e6a625faef0050601371de85af0630d
|
449 |
-
msgid "Size name"
|
450 |
-
msgstr "שם המידה"
|
451 |
-
|
452 |
-
# <div class="wrapper" style="">
|
453 |
-
# <h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes'); ?> </h4>
|
454 |
-
# <table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
|
455 |
-
# wpml-name: d3108e30b8046e29dd3baa9b3c455d35
|
456 |
-
msgid "Select which thumbnails you want to rebuild:"
|
457 |
-
msgstr "בחר אילו תמונות ממוזערות אתה רוצה לבנות מחדש:"
|
458 |
-
|
459 |
-
# 'tr' => __( 'yes', 'simple-image-sizes' ),
|
460 |
-
# 'fl' => __( 'no', 'simple-image-sizes' ),
|
461 |
-
# 'show' => __( 'Show in post insertion ?', 'simple-image-sizes' ),
|
462 |
-
# wpml-name: bafd7322c6e97d25b6299b5d6fe8920b
|
463 |
-
msgid "No"
|
464 |
-
msgstr "לא"
|
465 |
-
|
466 |
-
# 'crop' => __( 'Crop', 'simple-image-sizes' ),
|
467 |
-
# 'tr' => __( 'yes', 'simple-image-sizes' ),
|
468 |
-
# 'fl' => __( 'no', 'simple-image-sizes' ),
|
469 |
-
# wpml-name: 93cba07454f06a4a960172bbd6e2a435
|
470 |
-
msgid "Yes"
|
471 |
-
msgstr "כן"
|
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
CHANGED
@@ -1,274 +1,274 @@
|
|
1 |
-
# Copyright (C) 2010
|
2 |
-
# This file is distributed under the same license as the package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: \n"
|
6 |
-
"Report-Msgid-Bugs-To: \n"
|
7 |
-
"POT-Creation-Date: 2014-04-20 15:24+0100\n"
|
8 |
-
"PO-Revision-Date: 2014-04-20 15:24+0100\n"
|
9 |
-
"Last-Translator: \n"
|
10 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
11 |
-
"MIME-Version: 1.0\n"
|
12 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
-
"Content-Transfer-Encoding: 8bit\n"
|
14 |
-
|
15 |
-
#: templates/options-media.php:10
|
16 |
-
msgid "Select which thumbnails you want to rebuild:"
|
17 |
-
msgstr ""
|
18 |
-
|
19 |
-
#: templates/options-media.php:17 templates/options-media.php:73
|
20 |
-
msgid "Size name"
|
21 |
-
msgstr ""
|
22 |
-
|
23 |
-
#: templates/options-media.php:18 templates/options-media.php:74
|
24 |
-
msgid "Width"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: templates/options-media.php:19 templates/options-media.php:75
|
28 |
-
msgid "Height"
|
29 |
-
msgstr ""
|
30 |
-
|
31 |
-
#: templates/options-media.php:20 templates/options-media.php:76
|
32 |
-
msgid "Crop ?"
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: templates/options-media.php:42 classes/admin/main.php:183
|
36 |
-
msgid "Yes"
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
#: templates/options-media.php:42 classes/admin/main.php:182
|
40 |
-
msgid "No"
|
41 |
-
msgstr ""
|
42 |
-
|
43 |
-
#: templates/options-media.php:81
|
44 |
-
msgid "Select which post type source thumbnails you want to rebuild:"
|
45 |
-
msgstr ""
|
46 |
-
|
47 |
-
#: templates/options-media.php:88 templates/options-media.php:119
|
48 |
-
msgid "Post type"
|
49 |
-
msgstr ""
|
50 |
-
|
51 |
-
#: templates/options-media.php:138
|
52 |
-
msgid "End time calculated :"
|
53 |
-
msgstr ""
|
54 |
-
|
55 |
-
#: templates/options-media.php:139
|
56 |
-
msgid "Calculating..."
|
57 |
-
msgstr ""
|
58 |
-
|
59 |
-
#: templates/options-media.php:150
|
60 |
-
msgid "Last image:"
|
61 |
-
msgstr ""
|
62 |
-
|
63 |
-
#: templates/options-media.php:152 classes/admin/post.php:250
|
64 |
-
#: classes/admin/post.php:258
|
65 |
-
msgid "Regenerate Thumbnails"
|
66 |
-
msgstr ""
|
67 |
-
|
68 |
-
#: classes/admin/post.php:64 classes/admin/media.php:474
|
69 |
-
msgid "Trying to cheat ?"
|
70 |
-
msgstr ""
|
71 |
-
|
72 |
-
#: classes/admin/post.php:224
|
73 |
-
msgid "Regenerate thumbnails"
|
74 |
-
msgstr ""
|
75 |
-
|
76 |
-
#: classes/admin/main.php:44
|
77 |
-
msgid "Reading attachments..."
|
78 |
-
msgstr ""
|
79 |
-
|
80 |
-
#: classes/admin/main.php:45 classes/admin/media.php:171
|
81 |
-
msgid "Maximum width"
|
82 |
-
msgstr ""
|
83 |
-
|
84 |
-
#: classes/admin/main.php:46 classes/admin/media.php:178
|
85 |
-
msgid "Maximum height"
|
86 |
-
msgstr ""
|
87 |
-
|
88 |
-
#: classes/admin/main.php:47
|
89 |
-
msgid "Crop"
|
90 |
-
msgstr ""
|
91 |
-
|
92 |
-
#: classes/admin/main.php:48
|
93 |
-
msgid "yes"
|
94 |
-
msgstr ""
|
95 |
-
|
96 |
-
#: classes/admin/main.php:49
|
97 |
-
msgid "no"
|
98 |
-
msgstr ""
|
99 |
-
|
100 |
-
#: classes/admin/main.php:50 classes/admin/media.php:208
|
101 |
-
msgid "Show in post insertion ?"
|
102 |
-
msgstr ""
|
103 |
-
|
104 |
-
#: classes/admin/main.php:51
|
105 |
-
msgid " of "
|
106 |
-
msgstr ""
|
107 |
-
|
108 |
-
#: classes/admin/main.php:52
|
109 |
-
msgid " or "
|
110 |
-
msgstr ""
|
111 |
-
|
112 |
-
#: classes/admin/main.php:53
|
113 |
-
msgid " before the end."
|
114 |
-
msgstr ""
|
115 |
-
|
116 |
-
#: classes/admin/main.php:54 classes/admin/media.php:210
|
117 |
-
msgid "Delete"
|
118 |
-
msgstr ""
|
119 |
-
|
120 |
-
#: classes/admin/main.php:55
|
121 |
-
msgid "No media in your site to regenerate !"
|
122 |
-
msgstr ""
|
123 |
-
|
124 |
-
#: classes/admin/main.php:56
|
125 |
-
msgid "Regenerating "
|
126 |
-
msgstr ""
|
127 |
-
|
128 |
-
#: classes/admin/main.php:57
|
129 |
-
msgid "Regenerate "
|
130 |
-
msgstr ""
|
131 |
-
|
132 |
-
#: classes/admin/main.php:58
|
133 |
-
msgid "Validate image size name"
|
134 |
-
msgstr ""
|
135 |
-
|
136 |
-
#: classes/admin/main.php:59
|
137 |
-
msgid "Done."
|
138 |
-
msgstr ""
|
139 |
-
|
140 |
-
#: classes/admin/main.php:60
|
141 |
-
msgid "Size"
|
142 |
-
msgstr ""
|
143 |
-
|
144 |
-
#: classes/admin/main.php:61
|
145 |
-
msgid "Don't use the basic WordPress thumbnail size name, use the form above to edit them"
|
146 |
-
msgstr ""
|
147 |
-
|
148 |
-
#: classes/admin/main.php:62
|
149 |
-
msgid "This size is already registered, edit it instead of recreating it."
|
150 |
-
msgstr ""
|
151 |
-
|
152 |
-
#: classes/admin/main.php:63
|
153 |
-
msgid "Do you really want to delete these size ?"
|
154 |
-
msgstr ""
|
155 |
-
|
156 |
-
#: classes/admin/main.php:64 classes/admin/media.php:211
|
157 |
-
msgid "Update"
|
158 |
-
msgstr ""
|
159 |
-
|
160 |
-
#: classes/admin/main.php:65
|
161 |
-
msgid "Error requesting page"
|
162 |
-
msgstr ""
|
163 |
-
|
164 |
-
#: classes/admin/main.php:66
|
165 |
-
msgid "images have been regenerated !"
|
166 |
-
msgstr ""
|
167 |
-
|
168 |
-
#: classes/admin/main.php:67
|
169 |
-
msgid "Validate"
|
170 |
-
msgstr ""
|
171 |
-
|
172 |
-
#: classes/admin/main.php:68
|
173 |
-
msgid " started at"
|
174 |
-
msgstr ""
|
175 |
-
|
176 |
-
#: classes/admin/main.php:69 classes/admin/media.php:185
|
177 |
-
msgid "Public name"
|
178 |
-
msgstr ""
|
179 |
-
|
180 |
-
#: classes/admin/main.php:70
|
181 |
-
msgid " finished at :"
|
182 |
-
msgstr ""
|
183 |
-
|
184 |
-
#: classes/admin/main.php:71
|
185 |
-
msgid "Error during the php treatment, be sure to not have php errors in your page"
|
186 |
-
msgstr ""
|
187 |
-
|
188 |
-
#: classes/admin/main.php:72
|
189 |
-
msgid "All the sizes you have modified are not saved, continue anyway ?"
|
190 |
-
msgstr ""
|
191 |
-
|
192 |
-
#: classes/admin/main.php:73
|
193 |
-
msgid "This image has been regenerated in %s seconds"
|
194 |
-
msgstr ""
|
195 |
-
|
196 |
-
#: classes/admin/main.php:96
|
197 |
-
msgid "No id given in POST datas."
|
198 |
-
msgstr ""
|
199 |
-
|
200 |
-
#: classes/admin/main.php:109
|
201 |
-
msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
202 |
-
msgstr ""
|
203 |
-
|
204 |
-
#: classes/admin/main.php:116
|
205 |
-
msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
206 |
-
msgstr ""
|
207 |
-
|
208 |
-
#: classes/admin/main.php:167
|
209 |
-
msgid "Left"
|
210 |
-
msgstr ""
|
211 |
-
|
212 |
-
#: classes/admin/main.php:168
|
213 |
-
msgid "Center"
|
214 |
-
msgstr ""
|
215 |
-
|
216 |
-
#: classes/admin/main.php:169
|
217 |
-
msgid "Right"
|
218 |
-
msgstr ""
|
219 |
-
|
220 |
-
#: classes/admin/main.php:173
|
221 |
-
msgid "top"
|
222 |
-
msgstr ""
|
223 |
-
|
224 |
-
#: classes/admin/main.php:174
|
225 |
-
msgid "center"
|
226 |
-
msgstr ""
|
227 |
-
|
228 |
-
#: classes/admin/main.php:175
|
229 |
-
msgid "bottom"
|
230 |
-
msgstr ""
|
231 |
-
|
232 |
-
#: classes/admin/media.php:67
|
233 |
-
msgid "Settings"
|
234 |
-
msgstr ""
|
235 |
-
|
236 |
-
#: classes/admin/media.php:107
|
237 |
-
msgid "%s size"
|
238 |
-
msgstr ""
|
239 |
-
|
240 |
-
#: classes/admin/media.php:117
|
241 |
-
msgid "Add a new size"
|
242 |
-
msgstr ""
|
243 |
-
|
244 |
-
#: classes/admin/media.php:123
|
245 |
-
msgid "Get php for theme"
|
246 |
-
msgstr ""
|
247 |
-
|
248 |
-
#: classes/admin/media.php:129
|
249 |
-
msgid "Thumbnail regeneration"
|
250 |
-
msgstr ""
|
251 |
-
|
252 |
-
#: classes/admin/media.php:192
|
253 |
-
msgid "Cropping"
|
254 |
-
msgstr ""
|
255 |
-
|
256 |
-
#: classes/admin/media.php:226
|
257 |
-
msgid "Add a new size of thumbnail"
|
258 |
-
msgstr ""
|
259 |
-
|
260 |
-
#: classes/admin/media.php:239
|
261 |
-
msgid "Get the PHP for the theme"
|
262 |
-
msgstr ""
|
263 |
-
|
264 |
-
#: classes/admin/media.php:240
|
265 |
-
msgid "Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin."
|
266 |
-
msgstr ""
|
267 |
-
|
268 |
-
#: classes/admin/media.php:256
|
269 |
-
msgid "Admin option-media template missing"
|
270 |
-
msgstr ""
|
271 |
-
|
272 |
-
#: classes/admin/media.php:521
|
273 |
-
msgid "Regeneration ended"
|
274 |
msgstr ""
|
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 ""
|
package.json
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
{
|
2 |
-
"name": "simple-image-sizes",
|
3 |
-
"version": "3.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 |
}
|
1 |
+
{
|
2 |
+
"name": "simple-image-sizes",
|
3 |
+
"version": "3.1.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.txt
CHANGED
@@ -1,198 +1,202 @@
|
|
1 |
-
=== Simple Image Sizes ===
|
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.
|
7 |
-
Stable tag: 3.0
|
8 |
-
License: GPLv2 or later
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
-
|
11 |
-
== Description ==
|
12 |
-
|
13 |
-
This plugin allow create custom image sizes for your site. Override your theme sizes directly on the media option page.
|
14 |
-
You can regenerate all the sizes you have just created and choose which one you wanted to regenerate.
|
15 |
-
You can now get all the code to copy and paste to your function theme file.
|
16 |
-
Now you can use the generated sizes directly into your posts and insert images at the right size !
|
17 |
-
Now you choose if you want display the size in the post insert image.
|
18 |
-
Now you can regenerate the images one by one in the 'Medias' general pane.
|
19 |
-
Now you can regenerate the images by bulk action in the 'Medias' general pane.
|
20 |
-
Now you can regenerate the image sizes on single attachment edit page.
|
21 |
-
|
22 |
-
I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
|
23 |
-
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.
|
24 |
-
|
25 |
-
Contribute on https://github.com/Rahe/Simple-image-sizes
|
26 |
-
|
27 |
-
== Installation ==
|
28 |
-
**PHP5 Required.**
|
29 |
-
|
30 |
-
1. Download, unzip and upload to your WordPress plugins directory
|
31 |
-
2. Activate the plugin within you WordPress Administration Backend
|
32 |
-
3. Go to Settings > Medias
|
33 |
-
4. Configure your new image sizes and regenerate the thumbnails !
|
34 |
-
|
35 |
-
== Frequently Asked Questions ==
|
36 |
-
|
37 |
-
= Where can I add image sizes ? =
|
38 |
-
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.
|
39 |
-
The best is to use something like my-custom-size.
|
40 |
-
Then you have several fields for configuring the image size, the widht, the height, cropping.
|
41 |
-
And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
|
42 |
-
|
43 |
-
|
44 |
-
== Screenshots ==
|
45 |
-
|
46 |
-
1. Settings page
|
47 |
-
2. Get PHP for the theme
|
48 |
-
3. Choose the sizes to regenerate and regenerate them
|
49 |
-
|
50 |
-
== Changelog ==
|
51 |
-
|
52 |
-
|
53 |
-
*
|
54 |
-
*
|
55 |
-
|
56 |
-
*
|
57 |
-
* 3.0.
|
58 |
-
*
|
59 |
-
*
|
60 |
-
*
|
61 |
-
|
62 |
-
*
|
63 |
-
*
|
64 |
-
*
|
65 |
-
*
|
66 |
-
|
67 |
-
*
|
68 |
-
* Fix bug
|
69 |
-
* 3.0.
|
70 |
-
|
71 |
-
* 3.0.
|
72 |
-
|
73 |
-
* 3.0.
|
74 |
-
* Fix
|
75 |
-
* 3.0.
|
76 |
-
*
|
77 |
-
|
78 |
-
*
|
79 |
-
|
80 |
-
*
|
81 |
-
*
|
82 |
-
*
|
83 |
-
*
|
84 |
-
|
85 |
-
*
|
86 |
-
*
|
87 |
-
*
|
88 |
-
* Remove
|
89 |
-
*
|
90 |
-
|
91 |
-
*
|
92 |
-
* Remove
|
93 |
-
* 2.4
|
94 |
-
*
|
95 |
-
|
96 |
-
*
|
97 |
-
|
98 |
-
*
|
99 |
-
*
|
100 |
-
*
|
101 |
-
*
|
102 |
-
*
|
103 |
-
*
|
104 |
-
|
105 |
-
*
|
106 |
-
*
|
107 |
-
|
108 |
-
*
|
109 |
-
*
|
110 |
-
* 2.2.
|
111 |
-
*
|
112 |
-
*
|
113 |
-
*
|
114 |
-
|
115 |
-
*
|
116 |
-
*
|
117 |
-
*
|
118 |
-
*
|
119 |
-
*
|
120 |
-
*
|
121 |
-
|
122 |
-
*
|
123 |
-
|
124 |
-
*
|
125 |
-
*
|
126 |
-
|
127 |
-
*
|
128 |
-
* Add
|
129 |
-
*
|
130 |
-
*
|
131 |
-
|
132 |
-
*
|
133 |
-
* Add
|
134 |
-
*
|
135 |
-
*
|
136 |
-
*
|
137 |
-
* Add
|
138 |
-
*
|
139 |
-
*
|
140 |
-
|
141 |
-
*
|
142 |
-
*
|
143 |
-
*
|
144 |
-
*
|
145 |
-
*
|
146 |
-
*
|
147 |
-
*
|
148 |
-
*
|
149 |
-
|
150 |
-
*
|
151 |
-
|
152 |
-
*
|
153 |
-
* 2
|
154 |
-
|
155 |
-
*
|
156 |
-
*
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
*
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
*
|
165 |
-
*
|
166 |
-
*
|
167 |
-
*
|
168 |
-
*
|
169 |
-
*
|
170 |
-
*
|
171 |
-
*
|
172 |
-
*
|
173 |
-
*
|
174 |
-
* 1.0.
|
175 |
-
*
|
176 |
-
*
|
177 |
-
* Add
|
178 |
-
|
179 |
-
*
|
180 |
-
*
|
181 |
-
*
|
182 |
-
*
|
183 |
-
|
184 |
-
*
|
185 |
-
|
186 |
-
*
|
187 |
-
*
|
188 |
-
*
|
189 |
-
*
|
190 |
-
*
|
191 |
-
*
|
192 |
-
*
|
193 |
-
*
|
194 |
-
|
195 |
-
*
|
196 |
-
|
197 |
-
*
|
|
|
|
|
|
|
|
|
198 |
* Image size generation
|
1 |
+
=== Simple Image Sizes ===
|
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.5
|
7 |
+
Stable tag: 3.1.0
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
This plugin allow create custom image sizes for your site. Override your theme sizes directly on the media option page.
|
14 |
+
You can regenerate all the sizes you have just created and choose which one you wanted to regenerate.
|
15 |
+
You can now get all the code to copy and paste to your function theme file.
|
16 |
+
Now you can use the generated sizes directly into your posts and insert images at the right size !
|
17 |
+
Now you choose if you want display the size in the post insert image.
|
18 |
+
Now you can regenerate the images one by one in the 'Medias' general pane.
|
19 |
+
Now you can regenerate the images by bulk action in the 'Medias' general pane.
|
20 |
+
Now you can regenerate the image sizes on single attachment edit page.
|
21 |
+
|
22 |
+
I have added a timer so when you regeneration your thumbnails, you can know approximately when the regeneration will be ended.
|
23 |
+
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.
|
24 |
+
|
25 |
+
Contribute on https://github.com/Rahe/Simple-image-sizes
|
26 |
+
|
27 |
+
== Installation ==
|
28 |
+
**PHP5 Required.**
|
29 |
+
|
30 |
+
1. Download, unzip and upload to your WordPress plugins directory
|
31 |
+
2. Activate the plugin within you WordPress Administration Backend
|
32 |
+
3. Go to Settings > Medias
|
33 |
+
4. Configure your new image sizes and regenerate the thumbnails !
|
34 |
+
|
35 |
+
== Frequently Asked Questions ==
|
36 |
+
|
37 |
+
= Where can I add image sizes ? =
|
38 |
+
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.
|
39 |
+
The best is to use something like my-custom-size.
|
40 |
+
Then you have several fields for configuring the image size, the widht, the height, cropping.
|
41 |
+
And then you can choose if the image is displayed on the media insertion or not ( this will be displayed on the dropdown list ).
|
42 |
+
|
43 |
+
|
44 |
+
== Screenshots ==
|
45 |
+
|
46 |
+
1. Settings page
|
47 |
+
2. Get PHP for the theme
|
48 |
+
3. Choose the sizes to regenerate and regenerate them
|
49 |
+
|
50 |
+
== Changelog ==
|
51 |
+
|
52 |
+
* 3.1.0
|
53 |
+
* Regenerate images from the featured image
|
54 |
+
* Use wp_send_json since the minimum WordPress version is 3.5
|
55 |
+
* 3.0.10
|
56 |
+
* Remove text-domain on the header for language pack
|
57 |
+
* 3.0.9
|
58 |
+
* Reuse the after_setup_theme for image size registering
|
59 |
+
* Code formatting and cleaning
|
60 |
+
* Check compatibility wth 4.3
|
61 |
+
* 3.0.8
|
62 |
+
* Fix potential bug on error ajax
|
63 |
+
* Stop using init hook and use after_setup_theme for image size registering
|
64 |
+
* Update underscore cdn version for WP install without it
|
65 |
+
* Remove useless timer_start
|
66 |
+
* 3.0.7
|
67 |
+
* Fix bug on single image regeneration upload page
|
68 |
+
* Fix bug https://github.com/Rahe/Simple-image-sizes/issues/30
|
69 |
+
* 3.0.6
|
70 |
+
* Fix bug for the image adding
|
71 |
+
* 3.0.5
|
72 |
+
* Fix bug on condition
|
73 |
+
* 3.0.4
|
74 |
+
* Fix global add_image_size
|
75 |
+
* 3.0.3
|
76 |
+
* Add Hebrew translations thanks to Atar4U
|
77 |
+
* 3.0.2
|
78 |
+
* Fix version check for the image crop positions
|
79 |
+
* 3.0.1
|
80 |
+
* Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
|
81 |
+
* Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
|
82 |
+
* Right code for counting the elements on backoffice : https://github.com/Rahe/Simple-image-sizes/issues/20
|
83 |
+
* Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
|
84 |
+
* 3.0
|
85 |
+
* Revamping all the code, change classes and structure
|
86 |
+
* Use grunt for compiling files
|
87 |
+
* Handle the 3.9 new cropping position
|
88 |
+
* Remove aristo css
|
89 |
+
* Use UI from WordPress
|
90 |
+
* 2.4.3
|
91 |
+
* Remove some php notices
|
92 |
+
* Remove notice when wrong image size
|
93 |
+
* 2.4.2
|
94 |
+
* Selective regeneration fix by g100g on http://wordpress.org/support/topic/regenerating-fix
|
95 |
+
* 2.4.1
|
96 |
+
* Remove function not working on admin file
|
97 |
+
* 2.4
|
98 |
+
* Made for 3.5 and up
|
99 |
+
* Refactoring PHP/Javascript code
|
100 |
+
* Javascript improvements
|
101 |
+
* Remove useless UI
|
102 |
+
* UI improvements
|
103 |
+
* Global PHP performance improvements
|
104 |
+
* 2.3.1
|
105 |
+
* Add Ajax bulk actions on medias list
|
106 |
+
* Add ajax thumbnail rebuild on single media
|
107 |
+
* 2.3
|
108 |
+
* Add the custom size name in the attachment insertion
|
109 |
+
* Exclude post_type wich do not support the post-thumbnail feature
|
110 |
+
* 2.2.5
|
111 |
+
* Debug the regeneration buggy !
|
112 |
+
* Complete the french translation
|
113 |
+
* Security update for single regeneration, include the nonce this time :)
|
114 |
+
* 2.2.4
|
115 |
+
* Add security nonces for every actions
|
116 |
+
* Put the messages at the begining of the log
|
117 |
+
* Add a select all checkbox Thank to cocola
|
118 |
+
* Add the german translation thanks to glueckpress
|
119 |
+
* Remove notice tnahks to christianwach
|
120 |
+
* Remove useless and buggy for my scripting pointers
|
121 |
+
* 2.2.3
|
122 |
+
* Do not force network usage
|
123 |
+
* 2.2.2
|
124 |
+
* Debug js for the buttons
|
125 |
+
* Remove console.log calls
|
126 |
+
* 2.2.1
|
127 |
+
* Use buttonset for the checkboxes
|
128 |
+
* Add Pointer for WordPress 3.3
|
129 |
+
* Fix translation in French
|
130 |
+
* Some medias queries for small windows ( change size of buttons and alignment )
|
131 |
+
* 2.2
|
132 |
+
* Add new version of css aristo
|
133 |
+
* Add some icons
|
134 |
+
* Display button for saving changes only when changes detected
|
135 |
+
* Display message when a size is modified but not saved and wanted to regenerate
|
136 |
+
* Debug functionnality when regenerating only some sizes, metas not crushed
|
137 |
+
* Add solo regenerating
|
138 |
+
* Remove displaying for theme/not theme sizes
|
139 |
+
* Use WordPress class for small inputs
|
140 |
+
* 2.1
|
141 |
+
* Add javascript timer
|
142 |
+
* Improve javascript and more IE friendly
|
143 |
+
* You can now choose if you want to display the image sizes in image insertion or not
|
144 |
+
* Handle errors and messages
|
145 |
+
* Remove some css useless rules
|
146 |
+
* Fix bad translation for french
|
147 |
+
* Remove accents in image sizes
|
148 |
+
* Do not update size properties if there is an ajax query for an another size name
|
149 |
+
* 2.0.3
|
150 |
+
* Resolve issue with theme sizes witch by default are displayed as not cropped. Thanks to momo360modena for the bug signalment.
|
151 |
+
* 2.0.2
|
152 |
+
* Remove debug on php for javascript
|
153 |
+
* Resolve issue with the different versions on jquery ( like in WP3.2 ) with attr return for checked components
|
154 |
+
* 2.0.1
|
155 |
+
* Resolve javascript issue when clicking on delete button
|
156 |
+
* Resolve issue of never unchecking crop button
|
157 |
+
* 2.0
|
158 |
+
* Code refactoring
|
159 |
+
* Update translations
|
160 |
+
* Ajaxification of the process
|
161 |
+
* Deleting by Ajax
|
162 |
+
* Updating by Ajax
|
163 |
+
* Adding by Ajax
|
164 |
+
* Change UI
|
165 |
+
* Change theme
|
166 |
+
* Handle ajax errors
|
167 |
+
* Handle not modified sizes, cropped
|
168 |
+
* Handle same names
|
169 |
+
* Sanitize the names
|
170 |
+
* Customize jQuery ui
|
171 |
+
* Customize jQuery ui theme
|
172 |
+
* HTML5 Elements
|
173 |
+
* CSS3 Animations
|
174 |
+
* 1.0.6
|
175 |
+
* Minify javascript names
|
176 |
+
* Change progressbar style
|
177 |
+
* Add animations on progressbar
|
178 |
+
* 1.0.5
|
179 |
+
* Only add css and js script in the media page to avoid any javascript error in other pages
|
180 |
+
* Rectify css
|
181 |
+
* Add function to get the code for the function.php file of the theme
|
182 |
+
* Don't redefine the Wordpress basic size names
|
183 |
+
* 1.0.4
|
184 |
+
* Fix the add_image_size issue ( height and width reversed )
|
185 |
+
* 1.0.3
|
186 |
+
* Fix the plugin language
|
187 |
+
* Add some translations
|
188 |
+
* Externalise some css
|
189 |
+
* Add sizes in the image adding to an article
|
190 |
+
* Add setting link in the plugins list
|
191 |
+
* Use admin_url instead of home_url
|
192 |
+
* Add legend for colors
|
193 |
+
* Some code refactoring
|
194 |
+
* 1.0.2
|
195 |
+
* Fix the plugin license
|
196 |
+
* 1.0.1
|
197 |
+
* Add POT file
|
198 |
+
* Add french translation
|
199 |
+
* 1.0
|
200 |
+
* First release
|
201 |
+
* Thumbnail regenerate
|
202 |
* Image size generation
|
simple_image_sizes.php
CHANGED
@@ -1,62 +1,62 @@
|
|
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.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 |
-
|
16 |
-
This program is free software; you can redistribute it and/or modify
|
17 |
-
it under the terms of the GNU General Public License as published by
|
18 |
-
the Free Software Foundation; either version 2 of the License, or
|
19 |
-
(at your option) any later version.
|
20 |
-
|
21 |
-
This program is distributed in the hope that it will be useful,
|
22 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
-
GNU General Public License for more details.
|
25 |
-
|
26 |
-
You should have received a copy of the GNU General Public License
|
27 |
-
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.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 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.1.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 |
+
|
16 |
+
This program is free software; you can redistribute it and/or modify
|
17 |
+
it under the terms of the GNU General Public License as published by
|
18 |
+
the Free Software Foundation; either version 2 of the License, or
|
19 |
+
(at your option) any later version.
|
20 |
+
|
21 |
+
This program is distributed in the hope that it will be useful,
|
22 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
+
GNU General Public License for more details.
|
25 |
+
|
26 |
+
You should have received a copy of the GNU General Public License
|
27 |
+
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.1.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 |
}
|
templates/admin-js.html
CHANGED
@@ -1,45 +1,45 @@
|
|
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>
|
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
CHANGED
@@ -1,153 +1,153 @@
|
|
1 |
-
<?php
|
2 |
-
// Get the sizes
|
3 |
-
global $_wp_additional_image_sizes, $_wp_post_type_features;
|
4 |
-
?>
|
5 |
-
<input type="hidden" class="addSize" value='<?php echo wp_create_nonce( 'add_size' ); ?>'/>
|
6 |
-
<input type="hidden" class="regen" value='<?php echo wp_create_nonce( 'regen' ); ?>'/>
|
7 |
-
<input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>'/>
|
8 |
-
<div id="sis-regen">
|
9 |
-
<div class="wrapper" style="">
|
10 |
-
<h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'simple-image-sizes' ); ?> </h4>
|
11 |
-
<table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
|
12 |
-
<thead>
|
13 |
-
<tr>
|
14 |
-
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked"
|
15 |
-
type="checkbox">
|
16 |
-
</th>
|
17 |
-
<th class="manage-column" scope="col"><?php _e( 'Size name', 'simple-image-sizes' ); ?></th>
|
18 |
-
<th class="manage-column" scope="col"><?php _e( 'Width', 'simple-image-sizes' ); ?></th>
|
19 |
-
<th class="manage-column" scope="col"><?php _e( 'Height', 'simple-image-sizes' ); ?></th>
|
20 |
-
<th class="manage-column" scope="col"><?php _e( 'Crop ?', 'simple-image-sizes' ); ?></th>
|
21 |
-
</tr>
|
22 |
-
</thead>
|
23 |
-
<tbody>
|
24 |
-
<?php
|
25 |
-
// Display the sizes in the array
|
26 |
-
foreach ( get_intermediate_image_sizes() as $s ):
|
27 |
-
// Don't make or numeric sizes that appear
|
28 |
-
if ( is_integer( $s ) ) {
|
29 |
-
continue;
|
30 |
-
}
|
31 |
-
|
32 |
-
// Set width
|
33 |
-
$width = isset( $_wp_additional_image_sizes[ $s ]['width'] ) ? intval( $_wp_additional_image_sizes[ $s ]['width'] ) : get_option( "{$s}_size_w" );
|
34 |
-
|
35 |
-
// Set height
|
36 |
-
$height = isset( $_wp_additional_image_sizes[ $s ]['height'] ) ? intval( $_wp_additional_image_sizes[ $s ]['height'] ) : get_option( "{$s}_size_h" );
|
37 |
-
|
38 |
-
//Set crop
|
39 |
-
$crop = isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ? $_wp_additional_image_sizes[ $s ]['crop'] : get_option( "{$s}_crop" );
|
40 |
-
|
41 |
-
if ( is_numeric( $crop ) || is_bool( $crop ) || is_string( $crop ) ) {
|
42 |
-
$crop = absint( $crop ) > 0 ? __( 'Yes', 'simple-image-sizes' ) : __( 'No', 'simple-image-sizes' );
|
43 |
-
} else {
|
44 |
-
$crop = 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>
|
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>
|