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