Version Description
- Fixed some javascript issues
- Added Italian translation
Download this release
Release Info
Developer | sewpafly |
Plugin | Post Thumbnail Editor |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- README.txt +7 -0
- i18n/post-thumbnail-editor-it_IT.mo +0 -0
- i18n/post-thumbnail-editor-it_IT.po +242 -0
- i18n/post-thumbnail-editor.pot +30 -19
- js/pte.coffee +16 -5
- js/pte.full.js +16 -5
- js/pte.full.min.js +33 -32
- php/functions.php +19 -4
- post-thumbnail-editor.php +2 -2
README.txt
CHANGED
@@ -63,6 +63,10 @@ Using a version with [json_encode](http://www.php.net/manual/en/function.json-en
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
66 |
= 1.0.2 =
|
67 |
* Problem with SVN commit of 1.0.1
|
68 |
|
@@ -88,6 +92,9 @@ Using a version with [json_encode](http://www.php.net/manual/en/function.json-en
|
|
88 |
|
89 |
== Upgrade Notice ==
|
90 |
|
|
|
|
|
|
|
91 |
= 1.0.2 =
|
92 |
Problem with SVN commit of 1.0.1
|
93 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 1.0.3 =
|
67 |
+
* Fixed some javascript issues
|
68 |
+
* Added Italian translation
|
69 |
+
|
70 |
= 1.0.2 =
|
71 |
* Problem with SVN commit of 1.0.1
|
72 |
|
92 |
|
93 |
== Upgrade Notice ==
|
94 |
|
95 |
+
= 1.0.3 =
|
96 |
+
Fixed javascript problems & added italian translation
|
97 |
+
|
98 |
= 1.0.2 =
|
99 |
Problem with SVN commit of 1.0.1
|
100 |
|
i18n/post-thumbnail-editor-it_IT.mo
ADDED
Binary file
|
i18n/post-thumbnail-editor-it_IT.po
ADDED
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2010 Post Thumbnail Editor
|
2 |
+
# This file is distributed under the same license as the Post Thumbnail Editor package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: Post Thumbnail Editor 1.0.2\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/post-thumbnail-editor\n"
|
7 |
+
"POT-Creation-Date: 2011-09-06 15:57:59+00:00\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2011-09-07 14:33+0100\n"
|
12 |
+
"Last-Translator: Mac\n"
|
13 |
+
"Language-Team: Marco Rossi <macitaly@gmail.com>\n"
|
14 |
+
"X-Poedit-Language: Italian\n"
|
15 |
+
"X-Poedit-Country: ITALY\n"
|
16 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
+
|
18 |
+
#: html/pte.php:20
|
19 |
+
msgid "Post Thumbnail Editor - Step 1"
|
20 |
+
msgstr "Modifica delle miniature - Passo 1"
|
21 |
+
|
22 |
+
#: html/pte.php:33
|
23 |
+
msgid "Create Thumbnails"
|
24 |
+
msgstr "Crea miniatura"
|
25 |
+
|
26 |
+
#: html/pte.php:39
|
27 |
+
msgid "Choose the images/thumbnails that you want to edit:"
|
28 |
+
msgstr "Scegli le immagini/miniature che vuoi modificare:"
|
29 |
+
|
30 |
+
#: html/pte.php:42
|
31 |
+
msgid "Select: %1$sAll%2$s | %3$sNone%4$s"
|
32 |
+
msgstr "Seleziona: %1$sTutte%2$s | %3$sNessuna%4$s"
|
33 |
+
|
34 |
+
#: html/pte.php:59
|
35 |
+
msgid "Current image:"
|
36 |
+
msgstr "Dimensione Miniatura:"
|
37 |
+
|
38 |
+
#: html/pte.php:78
|
39 |
+
msgid "Back"
|
40 |
+
msgstr "Indietro"
|
41 |
+
|
42 |
+
#: html/pte.php:80
|
43 |
+
msgid "Post Thumbnail Editor - Step 2"
|
44 |
+
msgstr "Modifica delle miniature - Passo 2"
|
45 |
+
|
46 |
+
#: html/pte.php:83
|
47 |
+
#: html/pte.php:144
|
48 |
+
msgid "We noticed some potential issues:"
|
49 |
+
msgstr "Abbiamo rilevato alcuni potenziali problemi:"
|
50 |
+
|
51 |
+
#: html/pte.php:86
|
52 |
+
msgid "View %1$slogs%2$s for further information"
|
53 |
+
msgstr "Esamina i %1$slogs%2$s per avere ulteriori informazioni"
|
54 |
+
|
55 |
+
#: html/pte.php:91
|
56 |
+
msgid "%1$sEnable debugging%2$s for additional information"
|
57 |
+
msgstr "%1$sAbilita il debugging%2$s per avere ulteriori informazioni"
|
58 |
+
|
59 |
+
#: html/pte.php:101
|
60 |
+
msgid "Select the images you want to keep: %1$sAll%2$s | %3$sNone%4$s"
|
61 |
+
msgstr "Seleziona le immagini che vuoi mantenere: %1$sTutte%2$s | %3$sNessuna%4$s"
|
62 |
+
|
63 |
+
#: html/pte.php:124
|
64 |
+
msgid "Okay, these look good..."
|
65 |
+
msgstr "Ok, queste vanno bene..."
|
66 |
+
|
67 |
+
#: html/pte.php:128
|
68 |
+
msgid "I'd rather start over..."
|
69 |
+
msgstr "Preferisco riprovare ..."
|
70 |
+
|
71 |
+
#. #-#-#-#-# post-thumbnail-editor.pot (Post Thumbnail Editor 1.0.1-alpha2) #-#-#-#-#
|
72 |
+
#. Plugin Name of the plugin/theme
|
73 |
+
#: html/pte.php:135
|
74 |
+
#: post-thumbnail-editor.php:113
|
75 |
+
#: post-thumbnail-editor.php:178
|
76 |
+
#: post-thumbnail-editor.php:179
|
77 |
+
#: php/options.php:64
|
78 |
+
msgid "Post Thumbnail Editor"
|
79 |
+
msgstr "Post Thumbnail Editor"
|
80 |
+
|
81 |
+
#: html/pte.php:138
|
82 |
+
msgid "Images were created successfully."
|
83 |
+
msgstr "Le nuove immagini sono state create perfettamente."
|
84 |
+
|
85 |
+
#: html/pte.php:140
|
86 |
+
msgid "Click %1$shere%2$s to modify another thumbnail."
|
87 |
+
msgstr "Clicca %1$squi%2$s per modificare altre miniature."
|
88 |
+
|
89 |
+
#: html/pte.php:156
|
90 |
+
msgid "Please wait"
|
91 |
+
msgstr "Si prega di attendere"
|
92 |
+
|
93 |
+
#: html/pte.php:160
|
94 |
+
msgid "Click here to show application logs"
|
95 |
+
msgstr "Clicca qui per mostrare i logs dell'applicazione"
|
96 |
+
|
97 |
+
#: html/pte.php:162
|
98 |
+
#: php/options.php:30
|
99 |
+
msgid "Debug"
|
100 |
+
msgstr "Debug"
|
101 |
+
|
102 |
+
#: html/pte.php:167
|
103 |
+
msgid "If you are having any issues with this plugin, create a problem report on %1$sgithub%2$s or %3$swordpress.org%4$s so that I can look into it. Copy these log statements and include some information about what you were trying to do, the expected output, and the output you got (the more information the better). Thanks and good luck!"
|
104 |
+
msgstr "Se hai problemi con questo plugin, apri un rapporto su %1$sgithub%2$s o %3$swordpress.org%4$s in modo da permettermi di esaminarlo. Copia il testo di questi logs e includi tutte le informazioni necessarie su cosa stavi facendo quando si è verificato il problema, il risultato che ti aspettavi e quello che, invece, hai ottenuto (più informazioni fornisci, meglio sarà).Grazie e buona fortuna!"
|
105 |
+
|
106 |
+
#: html/pte.php:181
|
107 |
+
msgid "Send to Pastebin"
|
108 |
+
msgstr "Invia a Pastebin"
|
109 |
+
|
110 |
+
#: html/pte.php:182
|
111 |
+
msgid "Clear Messages"
|
112 |
+
msgstr "Cancella messaggi"
|
113 |
+
|
114 |
+
#: html/pte.php:185
|
115 |
+
msgid "Run Tests"
|
116 |
+
msgstr "Esegui i tests"
|
117 |
+
|
118 |
+
#: html/pte.php:186
|
119 |
+
msgid "Close"
|
120 |
+
msgstr "Chiudi"
|
121 |
+
|
122 |
+
#: post-thumbnail-editor.php:167
|
123 |
+
msgid "Edit Thumbnails"
|
124 |
+
msgstr "Modifica Miniature"
|
125 |
+
|
126 |
+
#: post-thumbnail-editor.php:168
|
127 |
+
#: php/options.php:51
|
128 |
+
msgid "Thumbnails"
|
129 |
+
msgstr "Modifica Miniature"
|
130 |
+
|
131 |
+
#: php/log.php:15
|
132 |
+
msgid "ERROR"
|
133 |
+
msgstr "ERRORE"
|
134 |
+
|
135 |
+
#: php/log.php:18
|
136 |
+
msgid "WARNING"
|
137 |
+
msgstr "AVVISO"
|
138 |
+
|
139 |
+
#: php/log.php:21
|
140 |
+
msgid "DEBUG"
|
141 |
+
msgstr "DEBUG"
|
142 |
+
|
143 |
+
#: php/log.php:99
|
144 |
+
msgid "ERROR Logging Message: %s"
|
145 |
+
msgstr "ERRORE messaggio di logging: %s"
|
146 |
+
|
147 |
+
#: php/options.php:8
|
148 |
+
msgid "These site-wide settings can only be changed by an administrator"
|
149 |
+
msgstr "Queste impostazioni generali, possono essere cambiate solo dall'amministratore.<br /> Scegli quali, tra le miniature usate nel sito, vuoi mostrare o nascondere nella finestra delle modifiche (di default, sono mostrate)."
|
150 |
+
|
151 |
+
#: php/options.php:19
|
152 |
+
msgid "User Options"
|
153 |
+
msgstr "Opzioni utente"
|
154 |
+
|
155 |
+
#: php/options.php:24
|
156 |
+
msgid "Thickbox dimensions"
|
157 |
+
msgstr "Dimensione Finestra di modifica"
|
158 |
+
|
159 |
+
#: php/options.php:36
|
160 |
+
msgid "Reset to defaults"
|
161 |
+
msgstr "Ripristina la configurazione iniziale"
|
162 |
+
|
163 |
+
#: php/options.php:47
|
164 |
+
msgid "Site Options"
|
165 |
+
msgstr "Opzioni del sito"
|
166 |
+
|
167 |
+
#: php/options.php:72
|
168 |
+
msgid "Save Changes"
|
169 |
+
msgstr "Registra le modifiche"
|
170 |
+
|
171 |
+
#: php/options.php:86
|
172 |
+
msgid "Only users with the 'manage_options' capability may make changes to these settings."
|
173 |
+
msgstr "Solo gli utenti con i permessi di 'manage_options' possono cambiare queste configurazioni."
|
174 |
+
|
175 |
+
#: php/options.php:118
|
176 |
+
msgid "Thickbox width must be at least 750 pixels."
|
177 |
+
msgstr "La larghezza dev'essere almeno di 750 pixels."
|
178 |
+
|
179 |
+
#: php/options.php:128
|
180 |
+
msgid "Thickbox height must be greater than 550 pixels."
|
181 |
+
msgstr "L'altezza dev'essere almeno di 550 pixels."
|
182 |
+
|
183 |
+
#: php/options.php:142
|
184 |
+
msgid "Width:"
|
185 |
+
msgstr "Larghezza:"
|
186 |
+
|
187 |
+
#: php/options.php:146
|
188 |
+
msgid "Set this to a value greater than 750."
|
189 |
+
msgstr "Inserire un valore di almeno 750px ."
|
190 |
+
|
191 |
+
#: php/options.php:153
|
192 |
+
msgid "Height:"
|
193 |
+
msgstr "Altezza:"
|
194 |
+
|
195 |
+
#: php/options.php:157
|
196 |
+
msgid "Set this to a value greater than 550."
|
197 |
+
msgstr "Inserire un valore di almeno 550px ."
|
198 |
+
|
199 |
+
#: php/options.php:169
|
200 |
+
msgid "Enable debugging"
|
201 |
+
msgstr "Abilita il debugging"
|
202 |
+
|
203 |
+
#: php/options.php:178
|
204 |
+
msgid "Reset User Options"
|
205 |
+
msgstr "Cancella le opzioni utente"
|
206 |
+
|
207 |
+
#: php/options.php:204
|
208 |
+
msgid "Post Thumbnail"
|
209 |
+
msgstr "Tipi di Miniature"
|
210 |
+
|
211 |
+
#: php/options.php:205
|
212 |
+
msgid "Hidden"
|
213 |
+
msgstr "Nascondi"
|
214 |
+
|
215 |
+
#: php/functions.php:257
|
216 |
+
msgid "Sorry, there was a problem trying to send to pastebin"
|
217 |
+
msgstr "Spiacente, c'è stato un problema nell'invio a Pastebin"
|
218 |
+
|
219 |
+
#: php/functions.php:258
|
220 |
+
msgid "PASTEBIN URL:"
|
221 |
+
msgstr "PASTEBIN URL:"
|
222 |
+
|
223 |
+
#: php/functions.php:259
|
224 |
+
msgid "Disabling aspect ratio"
|
225 |
+
msgstr "Le miniature selezionate sono di proporzioni diverse"
|
226 |
+
|
227 |
+
#. Plugin URI of the plugin/theme
|
228 |
+
msgid "http://wordpress.org/extend/plugins/post-thumbnail-editor/"
|
229 |
+
msgstr "http://wordpress.org/extend/plugins/post-thumbnail-editor/"
|
230 |
+
|
231 |
+
#. Description of the plugin/theme
|
232 |
+
msgid "Individually manage your post thumbnails"
|
233 |
+
msgstr "Gestione individuale delle miniature"
|
234 |
+
|
235 |
+
#. Author of the plugin/theme
|
236 |
+
msgid "sewpafly"
|
237 |
+
msgstr "sewpafly"
|
238 |
+
|
239 |
+
#. Author URI of the plugin/theme
|
240 |
+
msgid "http://sewpafly.github.com/post-thumbnail-editor"
|
241 |
+
msgstr "http://sewpafly.github.com/post-thumbnail-editor"
|
242 |
+
|
i18n/post-thumbnail-editor.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the Post Thumbnail Editor package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Post Thumbnail Editor 1.0.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/post-thumbnail-editor\n"
|
7 |
-
"POT-Creation-Date: 2011-09-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -64,11 +64,10 @@ msgstr ""
|
|
64 |
msgid "I'd rather start over..."
|
65 |
msgstr ""
|
66 |
|
67 |
-
#. #-#-#-#-# post-thumbnail-editor.pot (Post Thumbnail Editor 1.0.
|
68 |
#. Plugin Name of the plugin/theme
|
69 |
-
#: html/pte.php:135 post-thumbnail-editor.php:113
|
70 |
#: post-thumbnail-editor.php:178 post-thumbnail-editor.php:179
|
71 |
-
#: php/options.php:64
|
72 |
msgid "Post Thumbnail Editor"
|
73 |
msgstr ""
|
74 |
|
@@ -117,12 +116,28 @@ msgstr ""
|
|
117 |
msgid "Close"
|
118 |
msgstr ""
|
119 |
|
120 |
-
#:
|
121 |
-
msgid "
|
122 |
msgstr ""
|
123 |
|
124 |
-
#:
|
125 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
msgstr ""
|
127 |
|
128 |
#: php/log.php:15
|
@@ -161,6 +176,10 @@ msgstr ""
|
|
161 |
msgid "Site Options"
|
162 |
msgstr ""
|
163 |
|
|
|
|
|
|
|
|
|
164 |
#: php/options.php:72
|
165 |
msgid "Save Changes"
|
166 |
msgstr ""
|
@@ -211,16 +230,8 @@ msgstr ""
|
|
211 |
msgid "Hidden"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#:
|
215 |
-
msgid "
|
216 |
-
msgstr ""
|
217 |
-
|
218 |
-
#: php/functions.php:258
|
219 |
-
msgid "PASTEBIN URL:"
|
220 |
-
msgstr ""
|
221 |
-
|
222 |
-
#: php/functions.php:259
|
223 |
-
msgid "Disabling aspect ratio"
|
224 |
msgstr ""
|
225 |
|
226 |
#. Plugin URI of the plugin/theme
|
2 |
# This file is distributed under the same license as the Post Thumbnail Editor package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Post Thumbnail Editor 1.0.3\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/post-thumbnail-editor\n"
|
7 |
+
"POT-Creation-Date: 2011-09-08 15:17:02+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
64 |
msgid "I'd rather start over..."
|
65 |
msgstr ""
|
66 |
|
67 |
+
#. #-#-#-#-# post-thumbnail-editor.pot (Post Thumbnail Editor 1.0.3) #-#-#-#-#
|
68 |
#. Plugin Name of the plugin/theme
|
69 |
+
#: html/pte.php:135 php/options.php:64 post-thumbnail-editor.php:113
|
70 |
#: post-thumbnail-editor.php:178 post-thumbnail-editor.php:179
|
|
|
71 |
msgid "Post Thumbnail Editor"
|
72 |
msgstr ""
|
73 |
|
116 |
msgid "Close"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: php/functions.php:257
|
120 |
+
msgid "Sorry, there was a problem trying to send to pastebin"
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: php/functions.php:258
|
124 |
+
msgid "PASTEBIN URL:"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: php/functions.php:259
|
128 |
+
msgid "Disabling aspect ratio"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: php/functions.php:260
|
132 |
+
msgid "Error parsing selection information"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: php/functions.php:278
|
136 |
+
msgid "Invalid meta data for POST #%d: %s"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: php/functions.php:283
|
140 |
+
msgid "Please contact support"
|
141 |
msgstr ""
|
142 |
|
143 |
#: php/log.php:15
|
176 |
msgid "Site Options"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: php/options.php:51 post-thumbnail-editor.php:168
|
180 |
+
msgid "Thumbnails"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
#: php/options.php:72
|
184 |
msgid "Save Changes"
|
185 |
msgstr ""
|
230 |
msgid "Hidden"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: post-thumbnail-editor.php:167
|
234 |
+
msgid "Edit Thumbnails"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
msgstr ""
|
236 |
|
237 |
#. Plugin URI of the plugin/theme
|
js/pte.coffee
CHANGED
@@ -72,6 +72,7 @@ $.fn.extend
|
|
72 |
# if this object is currently hidden, show it
|
73 |
# if this object is currently shown, hide it
|
74 |
isVisible = $elem.is(':visible')
|
|
|
75 |
if (not isVisible)
|
76 |
$elem.show 0, ->
|
77 |
$(this).animate {'left': move_to}, options.speed, options.easing, next
|
@@ -79,12 +80,15 @@ $.fn.extend
|
|
79 |
$elem.animate {'left': move_to}, options.speed, options.easing
|
80 |
$elem.hide 0, next
|
81 |
true
|
82 |
-
if
|
83 |
pte_queue.queue (next) ->
|
84 |
if options.callbackargs?
|
85 |
-
|
|
|
86 |
else
|
|
|
87 |
options.callback.apply this
|
|
|
88 |
next()
|
89 |
return this
|
90 |
|
@@ -196,13 +200,15 @@ do (pte) ->
|
|
196 |
offset = $("#pte-sizes").offset()
|
197 |
window_height = $(window).height() - offset.top - 2
|
198 |
$("#pte-sizes").height window_height
|
|
|
|
|
|
|
|
|
|
|
199 |
, 100
|
200 |
# Add to the resize and load events
|
201 |
$(window).resize(reflow.doFunc).load(reflow.doFunc)
|
202 |
|
203 |
-
# Set the left position of stages2,3
|
204 |
-
$('#stage2, #stage3').css
|
205 |
-
left: $(window).width()
|
206 |
true
|
207 |
|
208 |
|
@@ -243,6 +249,7 @@ do (pte) ->
|
|
243 |
zIndex: 1200
|
244 |
instance: true
|
245 |
onSelectEnd: (img, s) ->
|
|
|
246 |
if s.width && s.width > 0 and s.height && s.height > 0 and $('.pte-size').filter(':checked').size() > 0
|
247 |
$('#pte-submit').removeAttr('disabled')
|
248 |
else
|
@@ -322,6 +329,10 @@ do (pte) ->
|
|
322 |
'h': Math.floor(selection.height/scale_factor)
|
323 |
log "===== RESIZE-IMAGES ====="
|
324 |
log submit_data
|
|
|
|
|
|
|
|
|
325 |
ias_instance.setOptions
|
326 |
hide: true
|
327 |
x1: 0
|
72 |
# if this object is currently hidden, show it
|
73 |
# if this object is currently shown, hide it
|
74 |
isVisible = $elem.is(':visible')
|
75 |
+
log [direction,move_to,isVisible]
|
76 |
if (not isVisible)
|
77 |
$elem.show 0, ->
|
78 |
$(this).animate {'left': move_to}, options.speed, options.easing, next
|
80 |
$elem.animate {'left': move_to}, options.speed, options.easing
|
81 |
$elem.hide 0, next
|
82 |
true
|
83 |
+
if options.callback?
|
84 |
pte_queue.queue (next) ->
|
85 |
if options.callbackargs?
|
86 |
+
log "running callback with arguments"
|
87 |
+
options.callback.apply this, options.callbackargs
|
88 |
else
|
89 |
+
log "running callback with no arguments"
|
90 |
options.callback.apply this
|
91 |
+
log "finished running callback"
|
92 |
next()
|
93 |
return this
|
94 |
|
200 |
offset = $("#pte-sizes").offset()
|
201 |
window_height = $(window).height() - offset.top - 2
|
202 |
$("#pte-sizes").height window_height
|
203 |
+
# Set the left position of stages2,3
|
204 |
+
log """WINDOW WIDTH: #{$(window).width()}"""
|
205 |
+
$('#stage2, #stage3').filter(":hidden").css
|
206 |
+
left: $(window).width()
|
207 |
+
true
|
208 |
, 100
|
209 |
# Add to the resize and load events
|
210 |
$(window).resize(reflow.doFunc).load(reflow.doFunc)
|
211 |
|
|
|
|
|
|
|
212 |
true
|
213 |
|
214 |
|
249 |
zIndex: 1200
|
250 |
instance: true
|
251 |
onSelectEnd: (img, s) ->
|
252 |
+
# Check that getSelection returns valid information...
|
253 |
if s.width && s.width > 0 and s.height && s.height > 0 and $('.pte-size').filter(':checked').size() > 0
|
254 |
$('#pte-submit').removeAttr('disabled')
|
255 |
else
|
329 |
'h': Math.floor(selection.height/scale_factor)
|
330 |
log "===== RESIZE-IMAGES ====="
|
331 |
log submit_data
|
332 |
+
if isNaN(submit_data.x) or isNaN(submit_data.y) or isNaN(submit_data.w) or isNaN(submit_data.h)
|
333 |
+
alert objectL10n.crop_submit_data_error
|
334 |
+
log "ERROR with submit_data and NaN's"
|
335 |
+
return false
|
336 |
ias_instance.setOptions
|
337 |
hide: true
|
338 |
x1: 0
|
js/pte.full.js
CHANGED
@@ -773,6 +773,7 @@
|
|
773 |
direction = options.direction === 'left' ? -1 : 1;
|
774 |
move_to = $elem.css('left') === "0px" ? $(window).width() * direction : 0;
|
775 |
isVisible = $elem.is(':visible');
|
|
|
776 |
if (!isVisible) {
|
777 |
$elem.show(0, function() {
|
778 |
return $(this).animate({
|
@@ -788,13 +789,16 @@
|
|
788 |
return true;
|
789 |
}, this));
|
790 |
});
|
791 |
-
if (options.callback) {
|
792 |
pte_queue.queue(function(next) {
|
793 |
if (options.callbackargs != null) {
|
|
|
794 |
options.callback.apply(this, options.callbackargs);
|
795 |
} else {
|
|
|
796 |
options.callback.apply(this);
|
797 |
}
|
|
|
798 |
return next();
|
799 |
});
|
800 |
}
|
@@ -905,12 +909,14 @@
|
|
905 |
pte.fixThickbox(window.parent);
|
906 |
offset = $("#pte-sizes").offset();
|
907 |
window_height = $(window).height() - offset.top - 2;
|
908 |
-
|
|
|
|
|
|
|
|
|
|
|
909 |
}, 100);
|
910 |
$(window).resize(reflow.doFunc).load(reflow.doFunc);
|
911 |
-
$('#stage2, #stage3').css({
|
912 |
-
left: $(window).width()
|
913 |
-
});
|
914 |
return true;
|
915 |
};
|
916 |
addRowListeners = function() {
|
@@ -1021,6 +1027,11 @@
|
|
1021 |
};
|
1022 |
log("===== RESIZE-IMAGES =====");
|
1023 |
log(submit_data);
|
|
|
|
|
|
|
|
|
|
|
1024 |
ias_instance.setOptions({
|
1025 |
hide: true,
|
1026 |
x1: 0,
|
773 |
direction = options.direction === 'left' ? -1 : 1;
|
774 |
move_to = $elem.css('left') === "0px" ? $(window).width() * direction : 0;
|
775 |
isVisible = $elem.is(':visible');
|
776 |
+
log([direction, move_to, isVisible]);
|
777 |
if (!isVisible) {
|
778 |
$elem.show(0, function() {
|
779 |
return $(this).animate({
|
789 |
return true;
|
790 |
}, this));
|
791 |
});
|
792 |
+
if (options.callback != null) {
|
793 |
pte_queue.queue(function(next) {
|
794 |
if (options.callbackargs != null) {
|
795 |
+
log("running callback with arguments");
|
796 |
options.callback.apply(this, options.callbackargs);
|
797 |
} else {
|
798 |
+
log("running callback with no arguments");
|
799 |
options.callback.apply(this);
|
800 |
}
|
801 |
+
log("finished running callback");
|
802 |
return next();
|
803 |
});
|
804 |
}
|
909 |
pte.fixThickbox(window.parent);
|
910 |
offset = $("#pte-sizes").offset();
|
911 |
window_height = $(window).height() - offset.top - 2;
|
912 |
+
$("#pte-sizes").height(window_height);
|
913 |
+
log("WINDOW WIDTH: " + ($(window).width()));
|
914 |
+
$('#stage2, #stage3').filter(":hidden").css({
|
915 |
+
left: $(window).width()
|
916 |
+
});
|
917 |
+
return true;
|
918 |
}, 100);
|
919 |
$(window).resize(reflow.doFunc).load(reflow.doFunc);
|
|
|
|
|
|
|
920 |
return true;
|
921 |
};
|
922 |
addRowListeners = function() {
|
1027 |
};
|
1028 |
log("===== RESIZE-IMAGES =====");
|
1029 |
log(submit_data);
|
1030 |
+
if (isNaN(submit_data.x) || isNaN(submit_data.y) || isNaN(submit_data.w) || isNaN(submit_data.h)) {
|
1031 |
+
alert(objectL10n.crop_submit_data_error);
|
1032 |
+
log("ERROR with submit_data and NaN's");
|
1033 |
+
return false;
|
1034 |
+
}
|
1035 |
ias_instance.setOptions({
|
1036 |
hide: true,
|
1037 |
x1: 0,
|
js/pte.full.min.js
CHANGED
@@ -1,32 +1,33 @@
|
|
1 |
-
(function(
|
2 |
-
function(
|
3 |
-
function(c,
|
4 |
-
"');}return __;")}function
|
5 |
-
|
6 |
-
c,
|
7 |
-
|
8 |
-
return
|
9 |
-
if(
|
10 |
-
"string"
|
11 |
-
|
12 |
-
|
13 |
-
(function(){var
|
14 |
-
|
15 |
-
|
16 |
-
i
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
function(){this.checked||
|
27 |
-
|
28 |
-
|
29 |
-
"pte-sizes[]":
|
30 |
-
a("#stage2").html(
|
31 |
-
d,c)});return c=function(
|
32 |
-
a("#pte-selectors .all").click(
|
|
1 |
+
(function(b){function t(j,c,g,e){e={data:e||e===0||e===!1?e:c?c.data:{},_wrap:c?c._wrap:null,tmpl:null,parent:c||null,nodes:[],calls:x,nest:y,wrap:f,html:z,update:a};j&&b.extend(e,j,{nodes:[],parent:c});if(g)e.tmpl=g,e._ctnt=e._ctnt||e.tmpl(b,e),e.key=++s,(o.length?k:i)[s]=e;return e}function r(a,c,g){var e,g=g?b.map(g,function(b){return typeof b==="string"?a.key?b.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+l+'="'+a.key+'" $2'):b:r(b,a,b._ctnt)}):a;if(c)return g;g=g.join("");g.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,
|
2 |
+
function(g,c,a,j){e=b(a).get();n(e);c&&(e=v(c).concat(e));j&&(e=e.concat(v(j)))});return e?e:v(g)}function v(a){var c=document.createElement("div");c.innerHTML=a;return b.makeArray(c.childNodes)}function A(a){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+b.trim(a).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
|
3 |
+
function(c,g,e,a,j,h,d){c=b.tmpl.tag[e];if(!c)throw"Unknown template tag: "+e;e=c._default||[];h&&!/\w$/.test(j)&&(j+=h,h="");j?(j=u(j),d=d?","+u(d)+")":h?")":"",d=h?j.indexOf(".")>-1?j+u(h):"("+j+").call($item"+d:j,h=h?d:"(typeof("+j+")==='function'?("+j+").call($item):("+j+"))"):h=d=e.$1||"null";a=u(a);return"');"+c[g?"close":"open"].split("$notnull_1").join(j?"typeof("+j+")!=='undefined' && ("+j+")!=null":"true").split("$1a").join(h).split("$1").join(d).split("$2").join(a||e.$2||"")+"__.push('"})+
|
4 |
+
"');}return __;")}function w(a,c){a._wrap=r(a,!0,b.isArray(c)?c:[d.test(c)?c:b(c).html()]).join("")}function u(b){return b?b.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function n(a){function c(a){function c(b){var B;b+=g;B=d[b]=d[b]||t(h,i[h.parent.key+g]||h.parent),h=B}var e,j=a,h,f;if(f=a.getAttribute(l)){for(;j.parentNode&&(j=j.parentNode).nodeType===1&&!(e=j.getAttribute(l)););if(e!==f){j=j.parentNode?j.nodeType===11?0:j.getAttribute(l)||0:0;if(!(h=i[f]))h=k[f],h=t(h,i[j]||k[j]),h.key=++s,
|
5 |
+
i[s]=h;p&&c(f)}a.removeAttribute(l)}else if(p&&(h=b.data(a,"tmplItem")))c(h.key),i[h.key]=h,j=(j=b.data(a.parentNode,"tmplItem"))?j.key:0;if(h){for(e=h;e&&e.key!=j;)e.nodes.push(a),e=e.parent;delete h._ctnt;delete h._wrap;b.data(a,"tmplItem",h)}}var g="_"+p,e,h,d={},f,q,m;f=0;for(q=a.length;f<q;f++)if((e=a[f]).nodeType===1){h=e.getElementsByTagName("*");for(m=h.length-1;m>=0;m--)c(h[m]);c(e)}}function x(b,a,g,e){if(!b)return o.pop();o.push({_:b,tmpl:a,item:this,data:g,options:e})}function y(a,c,g){return b.tmpl(b.template(a),
|
6 |
+
c,g,this)}function f(a,c){var g=a.options||{};g.wrapped=c;return b.tmpl(b.template(a.tmpl),a.data,g,a.item)}function z(a,c){var g=this._wrap;return b.map(b(b.isArray(g)?g.join(""):g).filter(a||"*"),function(b){if(c)b=b.innerText||b.textContent;else{var a;if(!(a=b.outerHTML))a=document.createElement("div"),a.appendChild(b.cloneNode(!0)),a=a.innerHTML;b=a}return b})}function a(){var a=this.nodes;b.tmpl(null,null,null,this).insertBefore(a[0]);b(a).remove()}var h=b.fn.domManip,l="_tmplitem",d=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
|
7 |
+
i={},k={},m,q={key:0,data:{}},s=0,p=0,o=[];b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,c){b.fn[a]=function(g){var e=[],g=b(g),h,d,l;h=this.length===1&&this[0].parentNode;m=i||{};if(h&&h.nodeType===11&&h.childNodes.length===1&&g.length===1)g[c](this[0]),e=this;else{d=0;for(l=g.length;d<l;d++)p=d,h=(d>0?this.clone(!0):this).get(),b(g[d])[c](h),e=e.concat(h);p=0;e=this.pushStack(e,a,g.selector)}g=m;m=null;b.tmpl.complete(g);
|
8 |
+
return e}});b.fn.extend({tmpl:function(a,c,g){return b.tmpl(this[0],a,c,g)},tmplItem:function(){return b.tmplItem(this[0])},template:function(a){return b.template(a,this[0])},domManip:function(a,c,g,e){if(a[0]&&b.isArray(a[0])){for(var d=b.makeArray(arguments),l=a[0],f=l.length,k=0,q;k<f&&!(q=b.data(l[k++],"tmplItem")););q&&p&&(d[2]=function(a){b.tmpl.afterManip(this,a,g)});h.apply(this,d)}else h.apply(this,arguments);p=0;m||b.tmpl.complete(i);return this}});b.extend({tmpl:function(a,c,g,e){var h=
|
9 |
+
!e;if(h)e=q,a=b.template[a]||b.template(null,a),k={};else if(!a)return a=e.tmpl,i[e.key]=e,e.nodes=[],e.wrapped&&w(e,e.wrapped),b(r(e,null,e.tmpl(b,e)));if(!a)return[];typeof c==="function"&&(c=c.call(e||{}));g&&g.wrapped&&w(g,g.wrapped);c=b.isArray(c)?b.map(c,function(b){return b?t(g,e,a,b):null}):[t(g,e,a,c)];return h?b(r(e,null,c)):c},tmplItem:function(a){var c;for(a instanceof b&&(a=a[0]);a&&a.nodeType===1&&!(c=b.data(a,"tmplItem"))&&(a=a.parentNode););return c||q},template:function(a,c){return c?
|
10 |
+
(typeof c==="string"?c=A(c):c instanceof b&&(c=c[0]||{}),c.nodeType&&(c=b.data(c,"tmpl")||b.data(c,"tmpl",A(c.innerHTML))),typeof a==="string"?b.template[a]=c:c):a?typeof a!=="string"?b.template(null,a):b.template[a]||b.template(null,d.test(a)?a:b(a)):null},encode:function(a){return(""+a).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}});b.extend(b.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},
|
11 |
+
open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){i={}},afterManip:function(a,
|
12 |
+
c,h){var e=c.nodeType===11?b.makeArray(c.childNodes):c.nodeType===1?[c]:[];h.call(a,c);n(e);p++}})})(jQuery);
|
13 |
+
(function(){var b,t,r,v,A,w,u,n,x,y,f,z=function(a,b){return function(){return a.apply(b,arguments)}};f=this;b=f.jQuery;f.pte=n=n||{};(function(a){return a.fixThickbox=function(a){var b,d,i,k;b=a.jQuery;if(!(b===null||a.frames.length<1))if(log("===== FIXING THICKBOX ====="),k=f.options.pte_tb_width+30,i=f.options.pte_tb_height+38,d=b("#TB_window"),!(d.width()>=k&&d.height()>=i))return log("THICKBOX: "+d.width()+" x "+d.height()),d.css({"margin-left":0-k/2,width:k,height:i}).children("iframe").css({width:k}),
|
14 |
+
a.setTimeout(function(){if(!(b("iframe",d).height()>i))return b("iframe",d).css({height:i}),log("THICKBOX: "+d.width()+" x "+d.height()),!0},1E3)}})(n);y=function(a){return{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};t=function(){function a(a){this.message=a;this.date=new Date}a.prototype.toString=function(){var a,l,d,i,f,m,q;m=function(a,b){for(;(""+a).length<b;)a="0"+a;return a};d=this.date;q=m(d.getUTCFullYear(),4);l=m(d.getUTCMonth()+1,2);a=m(d.getUTCDate(),2);i=m(d.getUTCHours(),
|
15 |
+
2);f=m(d.getUTCMinutes(),2);m=m(d.getUTCSeconds(),2);switch(y(this.message)){case "string":d=this.message;break;default:d=b.toJSON(this.message)}return""+q+l+a+" "+i+":"+f+":"+m+" - ["+y(this.message)+"] "+d};return a}();(function(a){a.messages=[];a.log=function(h){if(!f.options.pte_debug)return!0;try{a.messages.push(new t(h)),console.log(h),b("#pte-log-messages textarea").filter(":visible").val(a.formatLog())}catch(l){}};a.formatLog=function(){var b,l,d,i,f;b="";f=a.messages;d=0;for(i=f.length;d<
|
16 |
+
i;d++)l=f[d],b+=""+l+"\n";return b};a.parseServerLog=function(a){var b,d,f;log("===== SERVER LOG =====");if((a!=null?a.length:void 0)!=null&&a.length>0){d=0;for(f=a.length;d<f;d++)b=a[d],log(b)}return!0};a.sendToPastebin=function(a){return b.ajax({url:"http://dpastey.appspot.com/",data:{title:"PostThumbnailEditor Log",content:a,lexer:"text",format:"json",expire_options:"2592000"},dataType:"json",global:!1,type:"POST",error:function(a,h,f){b("#pte-log").fadeOut("900");alert(objectL10n.pastebin_create_error);
|
17 |
+
log(a);log(h);return log(f)},success:function(a){b("#pte-log").fadeOut("900");return prompt(objectL10n.pastebin_url,a.url)}})};return!0})(n);f.log=n.log;b(document).ready(function(a){a("#test").click(function(a){a.stopImmediatePropagation();return!0});a("#pastebin").click(function(){return n.sendToPastebin(n.formatLog())});a("#clear-log").click(function(){n.messages=[];return a("#pte-log-messages textarea").val(n.formatLog())});a("#close-log").click(function(){return a("#pte-log").fadeOut("900")});
|
18 |
+
a("#pte-log-tools a").click(function(a){return a.preventDefault()});return a("body").delegate(".show-log-messages","click",function(b){b.preventDefault();a("#pte-log-messages textarea").val(n.formatLog());return a("#pte-log").fadeIn("900")})});(function(a){return a.admin=function(){var a,l,d,i,k,m;m="&TB_iframe=true&height="+f.options.pte_tb_height+"&width="+f.options.pte_tb_width;d=null;k=function(a){a=a||d||b("#attachment-id").val();return""+ajaxurl+"?action=pte_ajax&pte-action=launch&id="+a+m};
|
19 |
+
a=function(a){return b('<a class="thickbox" href="'+k(a)+'">'+objectL10n.PTE+"</a>")};l=function(a){log("Start PTE...");if(f.parent.frames.length>0)return log("Modifying thickbox..."),z(function(){f.parent.tb_click();return!0},this)(),a.stopPropagation()};i=function(){var k;k=b("#imgedit-save-target-"+d);return(k!=null?k.size():void 0)<1?(f.log("Edit Thumbnail Menu not visible, waiting for 300ms"),f.setTimeout(i,300),!1):k.append(a().click(l))};return function(){b(".media-item").each(function(d,f){var i;
|
20 |
+
i=f.id.replace("media-item-","");return a(i).css({"font-size":".8em","margin-left":"5px"}).click(l).appendTo(b("tr.image-size th.label",f))});if(imageEdit.open!=null)imageEdit.oldopen=imageEdit.open,imageEdit.open=function(a,b){d=a;imageEdit.oldopen(a,b);return i()};return!0}()}})(n);r=function(){function a(a,b){this.fn=a;this.timeout=b;this.doFunc=z(this.doFunc,this);this.timer=null}a.prototype.doFunc=function(){f.clearTimeout(this.timer);this.timer=f.setTimeout(this.fn,this.timeout);return!0};return a}();
|
21 |
+
f.randomness=function(){return Math.floor(Math.random()*1000001).toString(16)};f.debugTmpl=function(a){log("===== TEMPLATE DEBUG DATA FOLLOWS =====");log(a);return!0};v=function(a){a={id:a,action:"pte_ajax","pte-action":"delete-images","pte-nonce":b("#pte-delete-nonce").val()};return b.ajax({url:ajaxurl,data:a,global:!1,dataType:"json",success:A})};A=function(a){log("===== DELETE SUCCESSFUL, DATA DUMP FOLLOWS =====");log(a);return n.parseServerLog(a.log)};x=b({});b.fn.extend({move:function(a){a=b.extend({direction:"left",
|
22 |
+
speed:500,easing:"swing",toggle:!0,callback:null,callbackargs:null},a);this.each(function(){return x.queue(z(function(h){var l,d,i,k;l=b(this);d=a.direction==="left"?-1:1;k=l.css("left")==="0px"?b(f).width()*d:0;i=l.is(":visible");log([d,k,i]);i?(l.animate({left:k},a.speed,a.easing),l.hide(0,h)):l.show(0,function(){return b(this).animate({left:k},a.speed,a.easing,h)});return!0},this))});a.callback!=null&&x.queue(function(b){a.callbackargs!=null?(log("running callback with arguments"),a.callback.apply(this,
|
23 |
+
a.callbackargs)):(log("running callback with no arguments"),a.callback.apply(this));log("finished running callback");return b()});return this},moveRight:function(a){a=b.extend(a,{direction:"right"});return this.move(a)},moveLeft:function(a){a=b.extend(a,{direction:"left"});return this.move(a)}});f.goBack=function(a){a!=null&&a.preventDefault();b("#stage2").moveRight();b("#stage1").moveRight({callback:function(){v(b("#pte-post-id").val());return b("#stage2").html("")}});return!0};u=function(a,b){if(a===
|
24 |
+
0)return b;for(;b>0;)a>b?a-=b:b-=a;return a<0||b<0?null:a};w=function(a,b){var f,d,i,k;f=b.crop;k=b.width;i=b.height;f=+f;k=+k;i=+i;d=u(k,i);if(f!=null&&f>0){f=null;(k!=null)>0&&(i!=null)>0&&(f=d!=null?""+k/d+":"+i/d:""+k+":"+i);if(a!=null&&f!=null&&f!==a)throw objectL10n.aspect_ratio_disabled;a=f}return a};n.functions={determineAspectRatio:w};(function(a){var h,l,d,i,k,m,n,s,p,o,j;a.editor=function(){n();d();j();l();i();k();h();m();return!0};m=function(){var a,g;a=b("#pte-loading");g=function(){a.hide();
|
25 |
+
return!0};b("#pte-preview").load(g);a.ajaxStart(function(){return b(this).fadeIn(200)}).ajaxStop(function(){return b(this).fadeOut(200)});f.setTimeout(g,2E3);return!0};n=function(){var c;c=new r(function(){var c;log("===== REFLOW =====");a.fixThickbox(f.parent);c=b("#pte-sizes").offset();c=b(f).height()-c.top-2;b("#pte-sizes").height(c);log("WINDOW WIDTH: "+b(f).width());b("#stage2, #stage3").filter(":hidden").css({left:b(f).width()});return!0},100);b(f).resize(c.doFunc).load(c.doFunc);return!0};
|
26 |
+
d=function(){var a;a=function(a){a.delegate("tr","click",function(a){a.target.type!=="checkbox"&&b("input:checkbox",this).click();return!0});return a.delegate("input:checkbox","click",function(){this.checked||b(this).is("input:checked")?b(this).parents("tr").first().removeClass("selected"):b(this).parents("tr").first().addClass("selected");return!0})};a(b("#stage2"));return a(b("#stage1"))};o=null;p={keys:!0,minWidth:3,minHeight:3,handles:!0,zIndex:1200,instance:!0,onSelectEnd:function(a,g){return g.width&&
|
27 |
+
g.width>0&&g.height&&g.height>0&&b(".pte-size").filter(":checked").size()>0?b("#pte-submit").removeAttr("disabled"):b("#pte-submit").attr("disabled",!0)}};j=function(){return a.ias=o=b("#pte-image img").imgAreaSelect(p)};s=function(a){log("===== SETTING ASPECTRATIO: "+a+" =====");o.setOptions({aspectRatio:a});return o.update()};l=function(){var c,g;g=new r(function(){log("===== CHECK SUBMIT BUTTON =====");b(".pte-confirm").filter(":checked").size()>0?(log("ENABLE"),b("#pte-confirm").removeAttr("disabled")):
|
28 |
+
(log("DISABLE"),b("#pte-confirm").attr("disabled",!0));return!0},50);c=new r(function(){var a;a=null;b("input.pte-size").filter(":checked").each(function(c,g){try{a=w(a,thumbnail_info[b(g).val()])}catch(d){return a=null,a!==o.getOptions().aspectRatio&&alert(d),!1}return!0});s(a);p.onSelectEnd(null,o.getSelection());return!0},50);b.extend(a.functions,{pteVerifySubmitButtonHandler:g});b("input.pte-size").click(c.doFunc);return b(".pte-confirm").live("click",function(){return g.doFunc()})};i=function(){var c;
|
29 |
+
b("#pte-submit").click(function(){var a,e;e=o.getSelection();a=b("#pte-sizer").val();a={id:b("#pte-post-id").val(),action:"pte_ajax","pte-action":"resize-images","pte-sizes[]":b(".pte-size").filter(":checked").map(function(){return b(this).val()}).get(),x:Math.floor(e.x1/a),y:Math.floor(e.y1/a),w:Math.floor(e.width/a),h:Math.floor(e.height/a)};log("===== RESIZE-IMAGES =====");log(a);if(isNaN(a.x)||isNaN(a.y)||isNaN(a.w)||isNaN(a.h))return alert(objectL10n.crop_submit_data_error),log("ERROR with submit_data and NaN's"),
|
30 |
+
!1;o.setOptions({hide:!0,x1:0,y1:0,x2:0,y2:0});b("#pte-submit").attr("disabled",!0);b.getJSON(ajaxurl,a,c);return!0});return c=function(c){log("===== RESIZE-IMAGES SUCCESS =====");log(c);a.parseServerLog(c.log);if(c.error!=null&&c.thumbnails==null)alert(c.error);else return b("#stage1").moveLeft(),b("#stage2").html(b("#stage2template").tmpl(c)).moveLeft({callback:a.functions.pteVerifySubmitButtonHandler.doFunc}),!1}};k=function(){var c;b("#pte-confirm").live("click",function(){var a,e;e={};b("input.pte-confirm").filter(":checked").each(function(a,
|
31 |
+
c){var d;d=b(c).val();return e[d]=b("#pte-"+d+"-file").val()});a={id:b("#pte-post-id").val(),action:"pte_ajax","pte-action":"confirm-images","pte-nonce":b("#pte-nonce").val(),"pte-confirm":e};log("===== CONFIRM-IMAGES =====");log(a);return b.getJSON(ajaxurl,a,c)});return c=function(c){log("===== CONFIRM-IMAGES SUCCESS =====");log(c);a.parseServerLog(c.log);b("#stage2").moveLeft();b("#stage3").html(b("#stage3template").tmpl(c)).moveLeft();return!1}};h=function(){var a,d;d=function(a){var e;var c,d;
|
32 |
+
a!=null&&a.preventDefault();e=(c=(d=a.data)!=null?d.selector:void 0)!=null?c:".pte-size",a=e;return b(a).filter(":checked").click()};a=function(a){var e;var c,d;a!=null&&a.preventDefault();e=(c=a!=null?(d=a.data)!=null?d.selector:void 0:void 0)!=null?c:".pte-size",a=e;return b(a).not(":checked").click()};b("#pte-selectors .all").click(a);b("#pte-selectors .none").click(d).click();b("#stage2").delegate("#pte-stage2-selectors .all","click",{selector:".pte-confirm"},a);b("#stage2").delegate("#pte-stage2-selectors .none",
|
33 |
+
"click",{selector:".pte-confirm"},d);return!0};return b.extend(a.functions,{iasSetAR:s})})(n)}).call(this);
|
php/functions.php
CHANGED
@@ -167,7 +167,7 @@ function pte_get_image_data( $id, $size, $size_data ){
|
|
167 |
$size_data['crop']
|
168 |
);
|
169 |
if ($resized){
|
170 |
-
$metadata = wp_get_attachment_metadata($id);
|
171 |
$metadata['sizes'][$size] = $resized;
|
172 |
wp_update_attachment_metadata( $id, $metadata);
|
173 |
}
|
@@ -257,6 +257,7 @@ function pte_launch(){
|
|
257 |
, array( 'pastebin_create_error' => __( 'Sorry, there was a problem trying to send to pastebin', PTE_DOMAIN )
|
258 |
, 'pastebin_url' => __( 'PASTEBIN URL:', PTE_DOMAIN )
|
259 |
, 'aspect_ratio_disabled' => __( 'Disabling aspect ratio', PTE_DOMAIN )
|
|
|
260 |
)
|
261 |
);
|
262 |
|
@@ -267,12 +268,26 @@ function pte_launch(){
|
|
267 |
// Get the information needed for image preview
|
268 |
// (See wp-admin/includes/image-edit.php)
|
269 |
$nonce = wp_create_nonce("image_editor-$id");
|
270 |
-
$meta = wp_get_attachment_metadata($id);
|
271 |
|
272 |
-
if ( is_array($meta) && isset($meta['width']) )
|
273 |
$big = max( $meta['width'], $meta['height'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
$sizer = $big > 400 ? 400 / $big : 1;
|
|
|
|
|
|
|
|
|
276 |
|
277 |
require( PTE_PLUGINPATH . "html/pte.php" );
|
278 |
}
|
@@ -585,7 +600,7 @@ function pte_confirm_images(){
|
|
585 |
list( $w, $h, $type ) = $image_dimensions;
|
586 |
//print("IMAGE DIMENSIONS...");
|
587 |
//print_r( $image_dimensions );
|
588 |
-
$metadata = wp_get_attachment_metadata( $id );
|
589 |
$metadata['sizes'][$size] = array(
|
590 |
'file' => basename( $new_file ),
|
591 |
'width' => $w,
|
167 |
$size_data['crop']
|
168 |
);
|
169 |
if ($resized){
|
170 |
+
$metadata = wp_get_attachment_metadata($id, true);
|
171 |
$metadata['sizes'][$size] = $resized;
|
172 |
wp_update_attachment_metadata( $id, $metadata);
|
173 |
}
|
257 |
, array( 'pastebin_create_error' => __( 'Sorry, there was a problem trying to send to pastebin', PTE_DOMAIN )
|
258 |
, 'pastebin_url' => __( 'PASTEBIN URL:', PTE_DOMAIN )
|
259 |
, 'aspect_ratio_disabled' => __( 'Disabling aspect ratio', PTE_DOMAIN )
|
260 |
+
, 'crop_submit_data_error' => __( 'Error parsing selection information', PTE_DOMAIN )
|
261 |
)
|
262 |
);
|
263 |
|
268 |
// Get the information needed for image preview
|
269 |
// (See wp-admin/includes/image-edit.php)
|
270 |
$nonce = wp_create_nonce("image_editor-$id");
|
271 |
+
$meta = wp_get_attachment_metadata($id, true);
|
272 |
|
273 |
+
if ( is_array($meta) && isset( $meta['width'] ) ){
|
274 |
$big = max( $meta['width'], $meta['height'] );
|
275 |
+
}
|
276 |
+
else {
|
277 |
+
$logger->error(
|
278 |
+
sprintf( __( "Invalid meta data for POST #%d: %s" )
|
279 |
+
, $id
|
280 |
+
, print_r( $meta, true )
|
281 |
+
)
|
282 |
+
);
|
283 |
+
$logger->error( __( "Please contact support", PTE_DOMAIN ) );
|
284 |
+
}
|
285 |
|
286 |
$sizer = $big > 400 ? 400 / $big : 1;
|
287 |
+
$sizer = sprintf( "%.8F", $sizer );
|
288 |
+
$logger->debug( "USER-AGENT: " . $_SERVER['HTTP_USER_AGENT'] );
|
289 |
+
$logger->debug( "WORDPRESS: " . $GLOBALS['wp_version'] );
|
290 |
+
$logger->debug( "SIZER: ${sizer}" );
|
291 |
|
292 |
require( PTE_PLUGINPATH . "html/pte.php" );
|
293 |
}
|
600 |
list( $w, $h, $type ) = $image_dimensions;
|
601 |
//print("IMAGE DIMENSIONS...");
|
602 |
//print_r( $image_dimensions );
|
603 |
+
$metadata = wp_get_attachment_metadata( $id, true );
|
604 |
$metadata['sizes'][$size] = array(
|
605 |
'file' => basename( $new_file ),
|
606 |
'width' => $w,
|
post-thumbnail-editor.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin URI: http://wordpress.org/extend/plugins/post-thumbnail-editor/
|
4 |
Author: sewpafly
|
5 |
Author URI: http://sewpafly.github.com/post-thumbnail-editor
|
6 |
-
Version: 1.0.
|
7 |
Description: Individually manage your post thumbnails
|
8 |
|
9 |
LICENSE
|
@@ -35,7 +35,7 @@
|
|
35 |
define( 'PTE_PLUGINURL', plugins_url(basename( dirname(__FILE__))) . "/");
|
36 |
define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/");
|
37 |
define( 'PTE_DOMAIN', "post-thumbnail-editor");
|
38 |
-
define( 'PTE_VERSION', "1.0.
|
39 |
|
40 |
/*
|
41 |
* Option Functionality
|
3 |
Plugin URI: http://wordpress.org/extend/plugins/post-thumbnail-editor/
|
4 |
Author: sewpafly
|
5 |
Author URI: http://sewpafly.github.com/post-thumbnail-editor
|
6 |
+
Version: 1.0.3
|
7 |
Description: Individually manage your post thumbnails
|
8 |
|
9 |
LICENSE
|
35 |
define( 'PTE_PLUGINURL', plugins_url(basename( dirname(__FILE__))) . "/");
|
36 |
define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/");
|
37 |
define( 'PTE_DOMAIN', "post-thumbnail-editor");
|
38 |
+
define( 'PTE_VERSION', "1.0.3");
|
39 |
|
40 |
/*
|
41 |
* Option Functionality
|