Index: trunk/extensions/WikiLove/wikiLove.css |
— | — | @@ -42,24 +42,24 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | /* dialog */ |
46 | | -#wikiLoveDialog { |
| 46 | +#mw-wikilove-dialog { |
47 | 47 | margin: 10px; |
48 | 48 | } |
49 | 49 | |
50 | 50 | /* dialog type selection */ |
51 | | -#wikiLoveDialog #wlSelectType { |
| 51 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type { |
52 | 52 | float: left; |
53 | 53 | width: 250px; |
54 | 54 | } |
55 | 55 | |
56 | | -#wikiLoveDialog #wlSelectType ul { |
| 56 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type ul { |
57 | 57 | list-style: none; |
58 | 58 | margin: 0; |
59 | 59 | padding: 0; |
60 | 60 | } |
61 | 61 | |
62 | | -#wikiLoveDialog #wlSelectType ul li, |
63 | | -#wikiLoveDialog #wlSelectType a |
| 62 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type ul li, |
| 63 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a |
64 | 64 | { |
65 | 65 | display: block; |
66 | 66 | width: 250px; |
— | — | @@ -71,19 +71,19 @@ |
72 | 72 | outline: none; |
73 | 73 | } |
74 | 74 | |
75 | | -#wikiLoveDialog #wlSelectType a:hover, |
76 | | -#wikiLoveDialog #wlSelectType a:focus { |
| 75 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:hover, |
| 76 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:focus { |
77 | 77 | text-decoration:none; |
78 | 78 | } |
79 | 79 | |
80 | 80 | /* IGNORED BY IE6 */ |
81 | | -#wikiLoveDialog #wlSelectType ul > li, |
82 | | -#wikiLoveDialog #wlSelectType ul li > a { |
| 81 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type ul > li, |
| 82 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type ul li > a { |
83 | 83 | display: inline-block; |
84 | 84 | } |
85 | 85 | |
86 | | -#wikiLoveDialog #wlSelectType a .wlLeftCap, |
87 | | -#wikiLoveDialog #wlSelectType a .wlRightCap { |
| 86 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-left-cap, |
| 87 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-right-cap { |
88 | 88 | padding: 0; |
89 | 89 | margin: 0; |
90 | 90 | width: 6px; |
— | — | @@ -92,45 +92,45 @@ |
93 | 93 | top: 0px; |
94 | 94 | } |
95 | 95 | |
96 | | -#wikiLoveDialog #wlSelectType a .wlLeftCap, |
97 | | -#wikiLoveDialog #wlSelectType a .wlRightCap, |
98 | | -#wikiLoveDialog #wlSelectType a .wlIconBox { |
| 96 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-left-cap, |
| 97 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-right-cap, |
| 98 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-icon-box { |
99 | 99 | /* @embed */ |
100 | 100 | background-image: url(images/select-sprite.png); |
101 | 101 | background-repeat: no-repeat; |
102 | 102 | } |
103 | 103 | |
104 | | -#wikiLoveDialog #wlSelectType a .wlLeftCap { |
| 104 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-left-cap { |
105 | 105 | /* @noflip */ |
106 | 106 | left: 0px; |
107 | 107 | background-position: 0px 0px; |
108 | 108 | } |
109 | 109 | |
110 | | -#wikiLoveDialog #wlSelectType a:hover .wlLeftCap, |
111 | | -#wikiLoveDialog #wlSelectType a:focus .wlLeftCap { |
| 110 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:hover .mw-wikilove-left-cap, |
| 111 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:focus .mw-wikilove-left-cap { |
112 | 112 | background-position: -6px 0px; |
113 | 113 | } |
114 | 114 | |
115 | | -#wikiLoveDialog #wlSelectType a.selected .wlLeftCap { |
| 115 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-left-cap { |
116 | 116 | background-position: -12px 0px; |
117 | 117 | } |
118 | 118 | |
119 | | -#wikiLoveDialog #wlSelectType a .wlRightCap { |
| 119 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-right-cap { |
120 | 120 | /* @noflip */ |
121 | 121 | right: 0px; |
122 | 122 | background-position: -18px 0px; |
123 | 123 | } |
124 | 124 | |
125 | | -#wikiLoveDialog #wlSelectType a:hover .wlRightCap, |
126 | | -#wikiLoveDialog #wlSelectType a:focus .wlRightCap { |
| 125 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:hover .mw-wikilove-right-cap, |
| 126 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:focus .mw-wikilove-right-cap { |
127 | 127 | background-position: -25px 0px; |
128 | 128 | } |
129 | 129 | |
130 | | -#wikiLoveDialog #wlSelectType a.selected .wlRightCap { |
| 130 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-right-cap { |
131 | 131 | background-position: -32px 0px; |
132 | 132 | } |
133 | 133 | |
134 | | -#wikiLoveDialog #wlSelectType a .wlInside { |
| 134 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-inside { |
135 | 135 | padding: 0; |
136 | 136 | margin: 0; |
137 | 137 | width: 238px; |
— | — | @@ -145,16 +145,16 @@ |
146 | 146 | background-repeat: repeat-x; |
147 | 147 | } |
148 | 148 | |
149 | | -#wikiLoveDialog #wlSelectType a:hover .wlInside, |
150 | | -#wikiLoveDialog #wlSelectType a:focus .wlInside { |
| 149 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:hover .mw-wikilove-inside, |
| 150 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:focus .mw-wikilove-inside { |
151 | 151 | background-position: 0px -66px; |
152 | 152 | } |
153 | 153 | |
154 | | -#wikiLoveDialog #wlSelectType a.selected .wlInside { |
| 154 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-inside { |
155 | 155 | background-position: 0px -132px; |
156 | 156 | } |
157 | 157 | |
158 | | -#wikiLoveDialog #wlSelectType a .wlIconBox { |
| 158 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-icon-box { |
159 | 159 | padding: 0; |
160 | 160 | margin: 0; |
161 | 161 | width: 53px; |
— | — | @@ -165,7 +165,7 @@ |
166 | 166 | background-position: -42px 0px; |
167 | 167 | } |
168 | 168 | |
169 | | -#wikiLoveDialog #wlSelectType a .wlIconBox img { |
| 169 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-icon-box img { |
170 | 170 | padding: 0; |
171 | 171 | margin: 0; |
172 | 172 | width: 53px; |
— | — | @@ -175,16 +175,16 @@ |
176 | 176 | left: 0px; |
177 | 177 | } |
178 | 178 | |
179 | | -#wikiLoveDialog #wlSelectType a:hover .wlIconBox, |
180 | | -#wikiLoveDialog #wlSelectType a:focus .wlIconBox { |
| 179 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:hover .mw-wikilove-icon-box, |
| 180 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a:focus .mw-wikilove-icon-box { |
181 | 181 | background-position: -97px 0px; |
182 | 182 | } |
183 | 183 | |
184 | | -#wikiLoveDialog #wlSelectType a.selected .wlIconBox { |
| 184 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-icon-box { |
185 | 185 | background-position: -152px 0px; |
186 | 186 | } |
187 | 187 | |
188 | | -#wikiLoveDialog #wlSelectType a .wlLinkText { |
| 188 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-link-text { |
189 | 189 | padding: 0; |
190 | 190 | margin: 0; |
191 | 191 | width: 170px; |
— | — | @@ -199,12 +199,12 @@ |
200 | 200 | color: white; |
201 | 201 | } |
202 | 202 | |
203 | | -#wikiLoveDialog #wlSelectType a .wlNoIcon .wlLinkText { |
| 203 | +/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-no-icon .mw-wikilove-link-text { |
204 | 204 | left: 3px; |
205 | 205 | } |
206 | 206 | |
207 | 207 | /* dialog get started */ |
208 | | -#wikiLoveDialog #wlGetStarted { |
| 208 | +/*#mw-wikilove-dialog*/ #mw-wikilove-get-started { |
209 | 209 | float: right; |
210 | 210 | width: 380px; |
211 | 211 | margin-top: 40px; |
— | — | @@ -218,44 +218,44 @@ |
219 | 219 | background-repeat: no-repeat; |
220 | 220 | } |
221 | 221 | |
222 | | -#wikiLoveDialog #wlGetStarted h2 { |
| 222 | +/*#mw-wikilove-dialog*/ #mw-wikilove-get-started h2 { |
223 | 223 | border: none; |
224 | 224 | font-weight: bold; |
225 | 225 | } |
226 | 226 | |
227 | | -#wikiLoveDialog #wlGetStarted ol { |
| 227 | +/*#mw-wikilove-dialog*/ #mw-wikilove-get-started ol { |
228 | 228 | margin-left: 1.5em; |
229 | 229 | } |
230 | 230 | |
231 | 231 | /* dialog add details */ |
232 | | -#wikiLoveDialog #wlAddDetails { |
| 232 | +/*#mw-wikilove-dialog*/ #mw-wikilove-add-details { |
233 | 233 | float: right; |
234 | 234 | width: 480px; |
235 | 235 | margin-bottom: 5px; |
236 | 236 | } |
237 | 237 | |
238 | | -#wikiLoveDialog #wlAddDetails label { |
| 238 | +/*#mw-wikilove-dialog*/ #mw-wikilove-add-details label { |
239 | 239 | font-weight: bold; |
240 | 240 | font-size: 1.1em; |
241 | 241 | } |
242 | 242 | |
243 | | -#wikiLoveDialog #wlAddDetails .text { |
| 243 | +/*#mw-wikilove-dialog*/ #mw-wikilove-add-details .text { |
244 | 244 | display: block; |
245 | 245 | width: 300px; |
246 | 246 | } |
247 | 247 | |
248 | | -#wikiLoveDialog #wlAddDetails .wlNote { |
| 248 | +/*#mw-wikilove-dialog*/ #mw-wikilove-add-details .mw-wikilove-note { |
249 | 249 | font-weight: light; |
250 | 250 | font-size: 0.9em; |
251 | 251 | float: right; |
252 | 252 | color: #999; |
253 | 253 | } |
254 | 254 | |
255 | | -#wikiLoveDialog #wlAddDetails textarea { |
| 255 | +/*#mw-wikilove-dialog*/ #mw-wikilove-add-details textarea { |
256 | 256 | resize: none; |
257 | 257 | } |
258 | 258 | |
259 | | -#wikiLoveDialog .wlSpinner { |
| 259 | +#mw-wikilove-dialog .mw-wikilove-spinner { |
260 | 260 | float: right; |
261 | 261 | margin-top: 0.9em; |
262 | 262 | display: none; |
— | — | @@ -269,30 +269,27 @@ |
270 | 270 | } |
271 | 271 | |
272 | 272 | /* add details gallery */ |
273 | | -#wikiLoveDialog #wlGallery { |
| 273 | +/*#mw-wikilove-dialog*/ #mw-wikilove-gallery { |
274 | 274 | min-height: 40px; |
| 275 | + position: relative; |
275 | 276 | } |
276 | 277 | |
277 | | -#wikiLoveDialog #wlGallery img { |
| 278 | +/*#mw-wikilove-dialog*/ #mw-wikilove-gallery img { |
278 | 279 | margin-right: 5px; |
279 | 280 | margin-bottom: 5px; |
280 | 281 | padding: 5px; |
281 | 282 | } |
282 | 283 | |
283 | | -#wikiLoveDialog #wlGallery a:hover img, |
284 | | -#wikiLoveDialog #wlGallery a:focus img { |
| 284 | +/*#mw-wikilove-dialog*/ #mw-wikilove-gallery a:hover img, |
| 285 | +/*#mw-wikilove-dialog*/ #mw-wikilove-gallery a:focus img { |
285 | 286 | background-color: #aacfe9; |
286 | 287 | } |
287 | 288 | |
288 | | -#wikiLoveDialog #wlGallery a.selected img { |
| 289 | +/*#mw-wikilove-dialog*/ #mw-wikilove-gallery a.selected img { |
289 | 290 | background-color: #f56427; |
290 | 291 | } |
291 | 292 | |
292 | | -#wikiLoveDialog #wlGallerySpinner { |
293 | | - position: relative; |
294 | | -} |
295 | | - |
296 | | -#wikiLoveDialog #wlGallerySpinner .wlSpinner { |
| 293 | +/*#mw-wikilove-dialog*/ #mw-wikilove-gallery-spinner { |
297 | 294 | float: none; |
298 | 295 | position: absolute; |
299 | 296 | top: 0; |
— | — | @@ -302,59 +299,50 @@ |
303 | 300 | } |
304 | 301 | |
305 | 302 | /* dialog preview */ |
306 | | -#wikiLoveDialog #wlPreview { |
| 303 | +/*#mw-wikilove-dialog*/ #mw-wikilove-preview { |
307 | 304 | float: right; |
308 | 305 | width: 480px; |
309 | 306 | } |
310 | 307 | |
311 | | -#wikiLoveDialog #wlPreview #wlPreviewArea { |
| 308 | +/*#mw-wikilove-dialog #mw-wikilove-preview*/ #mw-wikilove-preview-area { |
312 | 309 | margin-left: 15px; |
313 | 310 | width: 465px; |
314 | 311 | overflow: auto; |
315 | 312 | } |
316 | 313 | |
317 | | -#wikiLoveDialog #wlPreview #wlPreviewArea .editsection { |
| 314 | +/*#mw-wikilove-dialog #mw-wikilove-preview*/ #mw-wikilove-preview-area .editsection { |
318 | 315 | display: none; |
319 | 316 | } |
320 | 317 | |
321 | 318 | /* dialog misc */ |
322 | | -#wikiLoveDialog input[type=text], |
323 | | -#wikiLoveDialog textarea, |
324 | | -#wikiLoveDialog select { |
| 319 | +#mw-wikilove-dialog input[type=text], |
| 320 | +#mw-wikilove-dialog textarea, |
| 321 | +#mw-wikilove-dialog select { |
325 | 322 | margin: 5px 0px 5px 15px; |
326 | 323 | max-width: 460px; |
327 | 324 | display: block; |
328 | 325 | } |
329 | 326 | |
330 | | -#wikiLoveDialog #wlSubtypeDescription { |
| 327 | +/*#mw-wikilove-dialog*/ #wlSubtypeDescription { |
331 | 328 | margin: 5px 0px 8px 15px; |
332 | 329 | font-size: 1.0em; |
333 | 330 | line-height: 1.2em; |
334 | 331 | } |
335 | 332 | |
336 | | -#wikiLoveDialog input[type=checkbox] { |
| 333 | +#mw-wikilove-dialog input[type=checkbox] { |
337 | 334 | display:inline-box; |
338 | 335 | margin: 5px 0px 5px 0px; |
339 | 336 | } |
340 | 337 | |
341 | | -/* dialog misc */ |
342 | | -#wikiLoveDialog input[type=text], |
343 | | -#wikiLoveDialog textarea, |
344 | | -#wikiLoveDialog select { |
345 | | - margin: 5px 0px 5px 15px; |
346 | | - max-width: 460px; |
347 | | - display: block; |
348 | | -} |
349 | | - |
350 | | -#wikiLoveDialog select { |
| 338 | +#mw-wikilove-dialog select { |
351 | 339 | padding: 1px 0; |
352 | 340 | } |
353 | 341 | |
354 | | -#wikiLoveDialog .submit { |
| 342 | +#mw-wikilove-dialog .submit { |
355 | 343 | float: right; |
356 | 344 | } |
357 | 345 | |
358 | | -#wikiLoveDialog .wlNumber { |
| 346 | +#mw-wikilove-dialog .mw-wikilove-number { |
359 | 347 | color: white; |
360 | 348 | float: left; |
361 | 349 | display: block; |
— | — | @@ -372,7 +360,7 @@ |
373 | 361 | background-repeat: no-repeat; |
374 | 362 | } |
375 | 363 | |
376 | | -#wikiLoveDialog .wlError { |
| 364 | +#mw-wikilove-dialog .mw-wikilove-error { |
377 | 365 | /* @embed */ |
378 | 366 | background-image: url(images/alert.png); |
379 | 367 | background-position: center left; |
Index: trunk/extensions/WikiLove/wikiLove.js |
— | — | @@ -30,36 +30,36 @@ |
31 | 31 | $.wikiLove.emailable = $( '#t-emailuser' ).length ? true : false; |
32 | 32 | |
33 | 33 | // Build a type list like this: |
34 | | - var $typeList = $( '<ul id="wlTypes"></ul>' ); |
| 34 | + var $typeList = $( '<ul id="mw-wikilove-types"></ul>' ); |
35 | 35 | for( var typeId in $.wikiLove.types ) { |
36 | 36 | var $button = $( '<a href="#"></a>' ); |
37 | | - var $buttonInside = $( '<div class="wlInside"></div>' ); |
| 37 | + var $buttonInside = $( '<div class="mw-wikilove-inside"></div>' ); |
38 | 38 | |
39 | 39 | if( typeof $.wikiLove.types[typeId].icon == 'string' ) { |
40 | | - $buttonInside.append( '<div class="wlIconBox"><img src="' |
| 40 | + $buttonInside.append( '<div class="mw-wikilove-icon-box"><img src="' |
41 | 41 | + mw.html.escape( $.wikiLove.types[typeId].icon ) + '"/></div>' ); |
42 | 42 | } |
43 | 43 | else { |
44 | | - $buttonInside.addClass( 'wlNoIcon' ); |
| 44 | + $buttonInside.addClass( 'mw-wikilove-no-icon' ); |
45 | 45 | } |
46 | 46 | |
47 | | - $buttonInside.append( '<div class="wlLinkText">' + $.wikiLove.types[typeId].name + '</div>' ); |
| 47 | + $buttonInside.append( '<div class="mw-wikilove-link-text">' + $.wikiLove.types[typeId].name + '</div>' ); |
48 | 48 | |
49 | | - $button.append( '<div class="wlLeftCap"></div>'); |
| 49 | + $button.append( '<div class="mw-wikilove-left-cap"></div>'); |
50 | 50 | $button.append( $buttonInside ); |
51 | | - $button.append( '<div class="wlRightCap"></div>'); |
| 51 | + $button.append( '<div class="mw-wikilove-right-cap"></div>'); |
52 | 52 | $button.data( 'typeId', typeId ); |
53 | 53 | $typeList.append( $( '<li tabindex="0"></li>' ).append( $button ) ); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $.wikiLove.$dialog = $( '\ |
57 | | -<div id="wikiLoveDialog">\ |
58 | | -<div id="wlSelectType">\ |
59 | | - <span class="wlNumber">1</span>\ |
| 57 | +<div id="mw-wikilove-dialog">\ |
| 58 | +<div id="mw-wikilove-select-type">\ |
| 59 | + <span class="mw-wikilove-number">1</span>\ |
60 | 60 | <h3><html:msg key="wikilove-select-type"/></h3>\ |
61 | | - <ul id="wlTypes"></ul>\ |
| 61 | + <ul id="mw-wikilove-types"></ul>\ |
62 | 62 | </div>\ |
63 | | -<div id="wlGetStarted">\ |
| 63 | +<div id="mw-wikilove-get-started">\ |
64 | 64 | <h2><html:msg key="wikilove-get-started-header"/></h2>\ |
65 | 65 | <ol>\ |
66 | 66 | <li><html:msg key="wikilove-get-started-list-1"/></li>\ |
— | — | @@ -67,40 +67,42 @@ |
68 | 68 | <li><html:msg key="wikilove-get-started-list-3"/></li>\ |
69 | 69 | </ol>\ |
70 | 70 | </div>\ |
71 | | -<div id="wlAddDetails">\ |
72 | | - <span class="wlNumber">2</span>\ |
| 71 | +<div id="mw-wikilove-add-details">\ |
| 72 | + <span class="mw-wikilove-number">2</span>\ |
73 | 73 | <h3><html:msg key="wikilove-add-details"/></h3>\ |
74 | | - <form id="wlPreviewForm">\ |
75 | | - <label for="wlSubtype" id="wlSubtypeLabel"></label>\ |
76 | | - <select id="wlSubtype"></select>\ |
77 | | - <div id="wlSubtypeDescription"></div>\ |
78 | | - <label id="wlGalleryLabel"><html:msg key="wikilove-image"/></label>\ |
79 | | - <div id="wlGallerySpinner" class="wlSpinner"></div>\ |
80 | | - <div id="wlGallery"></div>\ |
81 | | - <label for="wlHeader" id="wlHeaderLabel"><html:msg key="wikilove-header"/></label>\ |
82 | | - <input type="text" class="text" id="wlHeader"/>\ |
83 | | - <label for="wlTitle" id="wlTitleLabel"><html:msg key="wikilove-title"/></label>\ |
84 | | - <input type="text" class="text" id="wlTitle"/>\ |
85 | | - <label for="wlImage" id="wlImageLabel"><html:msg key="wikilove-image"/></label>\ |
86 | | - <input type="text" class="text" id="wlImage"/>\ |
87 | | - <label for="wlMessage" id="wlMessageLabel"><html:msg key="wikilove-enter-message"/></label>\ |
88 | | - <span class="wlNote"><html:msg key="wikilove-omit-sig"/></span>\ |
89 | | - <textarea id="wlMessage"></textarea>\ |
90 | | - <div id="wlNotify">\ |
91 | | - <input type="checkbox" id="wlNotifyCheckbox" name="notify"/>\ |
92 | | - <label for="wlNotifyCheckbox"><html:msg key="wikilove-notify"/></label>\ |
| 74 | + <form id="mw-wikilove-preview-form">\ |
| 75 | + <label for="mw-wikilove-subtype" id="mw-wikilove-subtype-label"></label>\ |
| 76 | + <select id="mw-wikilove-subtype"></select>\ |
| 77 | + <div id="mw-wikilove-subtype-description"></div>\ |
| 78 | + <label id="mw-wikilove-gallery-label"><html:msg key="wikilove-image"/></label>\ |
| 79 | + <div id="mw-wikilove-gallery">\ |
| 80 | + <div id="mw-wikilove-gallery-spinner" class="mw-wikilove-spinner"></div>\ |
| 81 | + <div id="mw-wikilove-gallery-content"></div>\ |
93 | 82 | </div>\ |
94 | | - <button class="submit" id="wlButtonPreview" type="submit"></button>\ |
95 | | - <div id="wlPreviewSpinner" class="wlSpinner"></div>\ |
| 83 | + <label for="mw-wikilove-header" id="mw-wikilove-header-label"><html:msg key="wikilove-header"/></label>\ |
| 84 | + <input type="text" class="text" id="mw-wikilove-header"/>\ |
| 85 | + <label for="mw-wikilove-title" id="mw-wikilove-title-label"><html:msg key="wikilove-title"/></label>\ |
| 86 | + <input type="text" class="text" id="mw-wikilove-title"/>\ |
| 87 | + <label for="mw-wikilove-image" id="mw-wikilove-image-label"><html:msg key="wikilove-image"/></label>\ |
| 88 | + <input type="text" class="text" id="mw-wikilove-image"/>\ |
| 89 | + <label for="mw-wikilove-message" id="mw-wikilove-message-label"><html:msg key="wikilove-enter-message"/></label>\ |
| 90 | + <span class="mw-wikilove-note"><html:msg key="wikilove-omit-sig"/></span>\ |
| 91 | + <textarea id="mw-wikilove-message"></textarea>\ |
| 92 | + <div id="mw-wikilove-notify">\ |
| 93 | + <input type="checkbox" id="mw-wikilove-notify-checkbox" name="notify"/>\ |
| 94 | + <label for="mw-wikilove-notify-checkbox"><html:msg key="wikilove-notify"/></label>\ |
| 95 | + </div>\ |
| 96 | + <button class="submit" id="mw-wikilove-button-preview" type="submit"></button>\ |
| 97 | + <div id="mw-wikilove-preview-spinner" class="mw-wikilove-spinner"></div>\ |
96 | 98 | </form>\ |
97 | 99 | </div>\ |
98 | | -<div id="wlPreview">\ |
99 | | - <span class="wlNumber">3</span>\ |
| 100 | +<div id="mw-wikilove-preview">\ |
| 101 | + <span class="mw-wikilove-number">3</span>\ |
100 | 102 | <h3><html:msg key="wikilove-preview"/></h3>\ |
101 | | - <div id="wlPreviewArea"></div>\ |
102 | | - <form id="wlSendForm">\ |
103 | | - <button class="submit" id="wlButtonSend" type="submit"></button>\ |
104 | | - <div id="wlSendSpinner" class="wlSpinner"></div>\ |
| 103 | + <div id="mw-wikilove-preview-area"></div>\ |
| 104 | + <form id="mw-wikilove-send-form">\ |
| 105 | + <button class="submit" id="mw-wikilove-button-send" type="submit"></button>\ |
| 106 | + <div id="mw-wikilove-send-spinner" class="mw-wikilove-spinner"></div>\ |
105 | 107 | </form>\ |
106 | 108 | </div>\ |
107 | 109 | </div>' ); |
— | — | @@ -115,17 +117,17 @@ |
116 | 118 | resizable: false |
117 | 119 | }); |
118 | 120 | |
119 | | - $( '#wlButtonPreview' ).button( { label: mw.msg( 'wikilove-button-preview' ), icons: { primary:'ui-icon-search' } } ); |
120 | | - $( '#wlButtonSend' ).button( { label: mw.msg( 'wikilove-button-send' ) } ); |
121 | | - $( '#wlAddDetails' ).hide(); |
122 | | - $( '#wlPreview' ).hide(); |
123 | | - $( '#wlTypes' ).replaceWith( $typeList ); |
| 121 | + $( '#mw-wikilove-button-preview' ).button( { label: mw.msg( 'wikilove-button-preview' ), icons: { primary:'ui-icon-search' } } ); |
| 122 | + $( '#mw-wikilove-button-send' ).button( { label: mw.msg( 'wikilove-button-send' ) } ); |
| 123 | + $( '#mw-wikilove-add-details' ).hide(); |
| 124 | + $( '#mw-wikilove-preview' ).hide(); |
| 125 | + $( '#mw-wikilove-types' ).replaceWith( $typeList ); |
124 | 126 | |
125 | | - $( '#wlTypes a' ).click( $.wikiLove.clickType ); |
126 | | - $( '#wlSubtype' ).change( $.wikiLove.changeSubtype ); |
127 | | - $( '#wlPreviewForm' ).submit( $.wikiLove.submitPreview ); |
128 | | - $( '#wlSendForm' ).click( $.wikiLove.submitSend ); |
129 | | - $( '#wlMessage' ).elastic(); // have the message textarea grow automatically |
| 127 | + $( '#mw-wikilove-types a' ).click( $.wikiLove.clickType ); |
| 128 | + $( '#mw-wikilove-subtype' ).change( $.wikiLove.changeSubtype ); |
| 129 | + $( '#mw-wikilove-preview-form' ).submit( $.wikiLove.submitPreview ); |
| 130 | + $( '#mw-wikilove-send-form' ).click( $.wikiLove.submitSend ); |
| 131 | + $( '#mw-wikilove-message' ).elastic(); // have the message textarea grow automatically |
130 | 132 | } |
131 | 133 | |
132 | 134 | $.wikiLove.$dialog.dialog( 'open' ); |
— | — | @@ -137,45 +139,45 @@ |
138 | 140 | */ |
139 | 141 | clickType: function( e ) { |
140 | 142 | e.preventDefault(); |
141 | | - $( '#wlGetStarted' ).hide(); // always hide the get started section |
| 143 | + $( '#mw-wikilove-get-started' ).hide(); // always hide the get started section |
142 | 144 | |
143 | 145 | var newTypeId = $( this ).data( 'typeId' ); |
144 | 146 | if( $.wikiLove.currentTypeId != newTypeId ) { // only do stuff when a different type is selected |
145 | 147 | $.wikiLove.currentTypeId = newTypeId; |
146 | 148 | $.wikiLove.currentSubtypeId = null; // reset the subtype id |
147 | 149 | |
148 | | - $( '#wlTypes a' ).removeClass( 'selected' ); |
| 150 | + $( '#mw-wikilove-types a' ).removeClass( 'selected' ); |
149 | 151 | $( this ).addClass( 'selected' ); // highlight the new type in the menu |
150 | 152 | |
151 | 153 | if( typeof $.wikiLove.types[$.wikiLove.currentTypeId].subtypes == 'object' ) { |
152 | 154 | // we're dealing with subtypes here |
153 | 155 | $.wikiLove.currentTypeOrSubtype = null; // reset the (sub)type object until a subtype is selected |
154 | | - $( '#wlSubtype' ).html( '' ); // clear the subtype menu |
| 156 | + $( '#mw-wikilove-subtype' ).html( '' ); // clear the subtype menu |
155 | 157 | |
156 | 158 | for( var subtypeId in $.wikiLove.types[$.wikiLove.currentTypeId].subtypes ) { |
157 | 159 | // add all the subtypes to the menu while setting their subtype ids in jQuery data |
158 | 160 | var subtype = $.wikiLove.types[$.wikiLove.currentTypeId].subtypes[subtypeId]; |
159 | | - $( '#wlSubtype' ).append( |
| 161 | + $( '#mw-wikilove-subtype' ).append( |
160 | 162 | $( '<option></option>' ).text( subtype.option ).data( 'subtypeId', subtypeId ) |
161 | 163 | ); |
162 | 164 | } |
163 | | - $( '#wlSubtype' ).show(); |
| 165 | + $( '#mw-wikilove-subtype' ).show(); |
164 | 166 | |
165 | 167 | // change and show the subtype label depending on the type |
166 | | - $( '#wlSubtypeLabel' ).text( $.wikiLove.types[$.wikiLove.currentTypeId].select || mw.msg( 'wikilove-select-type' ) ); |
167 | | - $( '#wlSubtypeLabel' ).show(); |
| 168 | + $( '#mw-wikilove-subtype-label' ).text( $.wikiLove.types[$.wikiLove.currentTypeId].select || mw.msg( 'wikilove-select-type' ) ); |
| 169 | + $( '#mw-wikilove-subtype-label' ).show(); |
168 | 170 | $.wikiLove.changeSubtype(); // update controls depending on the currently selected (i.e. first) subtype |
169 | 171 | } |
170 | 172 | else { |
171 | 173 | // there are no subtypes, just use this type for the current (sub)type |
172 | 174 | $.wikiLove.currentTypeOrSubtype = $.wikiLove.types[$.wikiLove.currentTypeId]; |
173 | | - $( '#wlSubtype' ).hide(); |
174 | | - $( '#wlSubtypeLabel' ).hide(); |
| 175 | + $( '#mw-wikilove-subtype' ).hide(); |
| 176 | + $( '#mw-wikilove-subtype-label' ).hide(); |
175 | 177 | $.wikiLove.updateAllDetails(); // update controls depending on this type |
176 | 178 | } |
177 | 179 | |
178 | | - $( '#wlAddDetails' ).show(); |
179 | | - $( '#wlPreview' ).hide(); |
| 180 | + $( '#mw-wikilove-add-details' ).show(); |
| 181 | + $( '#mw-wikilove-preview' ).hide(); |
180 | 182 | $.wikiLove.previewData = null; |
181 | 183 | } |
182 | 184 | }, |
— | — | @@ -185,14 +187,14 @@ |
186 | 188 | */ |
187 | 189 | changeSubtype: function() { |
188 | 190 | // find out which subtype is selected |
189 | | - var newSubtypeId = $( '#wlSubtype option:selected' ).first().data( 'subtypeId' ); |
| 191 | + var newSubtypeId = $( '#mw-wikilove-subtype option:selected' ).first().data( 'subtypeId' ); |
190 | 192 | if( $.wikiLove.currentSubtypeId != newSubtypeId ) { // only change stuff when a different subtype is selected |
191 | 193 | $.wikiLove.currentSubtypeId = newSubtypeId; |
192 | 194 | $.wikiLove.currentTypeOrSubtype = $.wikiLove.types[$.wikiLove.currentTypeId] |
193 | 195 | .subtypes[$.wikiLove.currentSubtypeId]; |
194 | | - $( '#wlSubtypeDescription' ).html( $.wikiLove.currentTypeOrSubtype.descr ); |
| 196 | + $( '#mw-wikilove-subtype-description' ).html( $.wikiLove.currentTypeOrSubtype.descr ); |
195 | 197 | $.wikiLove.updateAllDetails(); |
196 | | - $( '#wlPreview' ).hide(); |
| 198 | + $( '#mw-wikilove-preview' ).hide(); |
197 | 199 | $.wikiLove.previewData = null; |
198 | 200 | } |
199 | 201 | }, |
— | — | @@ -201,67 +203,67 @@ |
202 | 204 | * Called when type or subtype changes, updates controls. |
203 | 205 | */ |
204 | 206 | updateAllDetails: function() { |
205 | | - $( '#wikiLoveDialog' ).find( '.wlError' ).remove(); |
| 207 | + $( '#wikiLoveDialog' ).find( '.mw-wikilove-error' ).remove(); |
206 | 208 | |
207 | 209 | // only show the description if it exists for this type or subtype |
208 | 210 | if( typeof $.wikiLove.currentTypeOrSubtype.descr == 'string' ) { |
209 | | - $( '#wlSubtypeDescription').show(); |
| 211 | + $( '#mw-wikilove-subtype-description').show(); |
210 | 212 | } else { |
211 | | - $( '#wlSubtypeDescription').hide(); |
| 213 | + $( '#mw-wikilove-subtype-description').hide(); |
212 | 214 | } |
213 | 215 | |
214 | 216 | // show or hide header label and textbox depending on whether a predefined header exists |
215 | 217 | if( $.inArray( 'header', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 ) { |
216 | | - $( '#wlHeaderLabel').show(); |
217 | | - $( '#wlHeader' ).show(); |
| 218 | + $( '#mw-wikilove-header-label').show(); |
| 219 | + $( '#mw-wikilove-header' ).show(); |
218 | 220 | } else { |
219 | | - $( '#wlHeaderLabel').hide(); |
220 | | - $( '#wlHeader' ).hide(); |
| 221 | + $( '#mw-wikilove-header-label').hide(); |
| 222 | + $( '#mw-wikilove-header' ).hide(); |
221 | 223 | } |
222 | | - $( '#wlHeader' ).val( $.wikiLove.currentTypeOrSubtype.header || '' ); |
| 224 | + $( '#mw-wikilove-header' ).val( $.wikiLove.currentTypeOrSubtype.header || '' ); |
223 | 225 | |
224 | 226 | // show or hide title label and textbox depending on whether a predefined title exists |
225 | 227 | if( $.inArray( 'title', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 ) { |
226 | | - $( '#wlTitleLabel').show(); |
227 | | - $( '#wlTitle' ).show(); |
| 228 | + $( '#mw-wikilove-title-label').show(); |
| 229 | + $( '#mw-wikilove-title' ).show(); |
228 | 230 | } else { |
229 | | - $( '#wlTitleLabel').hide(); |
230 | | - $( '#wlTitle' ).hide(); |
| 231 | + $( '#mw-wikilove-title-label').hide(); |
| 232 | + $( '#mw-wikilove-title' ).hide(); |
231 | 233 | } |
232 | | - $( '#wlTitle' ).val( $.wikiLove.currentTypeOrSubtype.title || '' ); |
| 234 | + $( '#mw-wikilove-title' ).val( $.wikiLove.currentTypeOrSubtype.title || '' ); |
233 | 235 | |
234 | 236 | // show or hide image label and textbox depending on whether a predefined image exists |
235 | 237 | if( $.inArray( 'image', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 ) { |
236 | | - $( '#wlImageLabel').show(); |
237 | | - $( '#wlImage' ).show(); |
| 238 | + $( '#mw-wikilove-image-label').show(); |
| 239 | + $( '#mw-wikilove-image' ).show(); |
238 | 240 | } else { |
239 | | - $( '#wlImageLabel').hide(); |
240 | | - $( '#wlImage' ).hide(); |
| 241 | + $( '#mw-wikilove-image-label').hide(); |
| 242 | + $( '#mw-wikilove-image' ).hide(); |
241 | 243 | } |
242 | | - $( '#wlImage' ).val( $.wikiLove.currentTypeOrSubtype.image || '' ); |
| 244 | + $( '#mw-wikilove-image' ).val( $.wikiLove.currentTypeOrSubtype.image || '' ); |
243 | 245 | |
244 | 246 | if( typeof $.wikiLove.currentTypeOrSubtype.gallery == 'object' ) { |
245 | 247 | if( $.wikiLove.currentTypeOrSubtype.gallery.imageList instanceof Array) { |
246 | | - $( '#wlGalleryLabel' ).show(); |
247 | | - $( '#wlGallery' ).show(); |
| 248 | + $( '#mw-wikilove-gallery-label' ).show(); |
| 249 | + $( '#mw-wikilove-gallery' ).show(); |
248 | 250 | $.wikiLove.showGallery(); // build gallery from array of images |
249 | 251 | } else { |
250 | 252 | // gallery is a category |
251 | | - $( '#wlGalleryLabel' ).show(); |
252 | | - $( '#wlGallery' ).show(); |
| 253 | + $( '#mw-wikilove-gallery-label' ).show(); |
| 254 | + $( '#mw-wikilove-gallery' ).show(); |
253 | 255 | $.wikiLove.makeGallery(); // build gallery from category |
254 | 256 | } |
255 | 257 | } |
256 | 258 | else { |
257 | | - $( '#wlGalleryLabel' ).hide(); |
258 | | - $( '#wlGallery' ).hide(); |
| 259 | + $( '#mw-wikilove-gallery-label' ).hide(); |
| 260 | + $( '#mw-wikilove-gallery' ).hide(); |
259 | 261 | } |
260 | 262 | |
261 | 263 | if( $.inArray( 'notify', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 && $.wikiLove.emailable ) { |
262 | | - $( '#wlNotify' ).show(); |
| 264 | + $( '#mw-wikilove-notify' ).show(); |
263 | 265 | } else { |
264 | | - $( '#wlNotify' ).hide(); |
265 | | - $( '#wlNotifyCheckbox' ).attr('checked', false); |
| 266 | + $( '#mw-wikilove-notify' ).hide(); |
| 267 | + $( '#mw-wikilove-notify-checkbox' ).attr('checked', false); |
266 | 268 | } |
267 | 269 | }, |
268 | 270 | |
— | — | @@ -270,23 +272,23 @@ |
271 | 273 | */ |
272 | 274 | submitPreview: function( e ) { |
273 | 275 | e.preventDefault(); |
274 | | - $( '#wlPreview' ).hide(); |
| 276 | + $( '#mw-wikilove-preview' ).hide(); |
275 | 277 | $( '#wikiLoveDialog' ).find( '.wlError' ).remove(); |
276 | 278 | |
277 | 279 | if( typeof $.wikiLove.currentTypeOrSubtype.gallery == 'object' ) { |
278 | | - if ( $( '#wlImage' ).val().length <= 0 ) { |
| 280 | + if ( $( '#mw-wikilove-image' ).val().length <= 0 ) { |
279 | 281 | $.wikiLove.showError( 'wikilove-err-image' ); return false; |
280 | 282 | } |
281 | 283 | } |
282 | | - if( $( '#wlHeader' ).val().length <= 0 ) { |
| 284 | + if( $( '#mw-wikilove-header' ).val().length <= 0 ) { |
283 | 285 | $.wikiLove.showError( 'wikilove-err-header' ); return false; |
284 | 286 | } |
285 | | - if( $( '#wlMessage' ).val().length <= 0 ) { |
| 287 | + if( $( '#mw-wikilove-message' ).val().length <= 0 ) { |
286 | 288 | $.wikiLove.showError( 'wikilove-err-msg' ); return false; |
287 | 289 | } |
288 | 290 | |
289 | 291 | // If there isn't a signature already in the message, throw an error |
290 | | - if ( $( '#wlMessage' ).val().indexOf( '~~~' ) >= 0 ) { |
| 292 | + if ( $( '#mw-wikilove-message' ).val().indexOf( '~~~' ) >= 0 ) { |
291 | 293 | $.wikiLove.showError( 'wikilove-err-sig' ); return false; |
292 | 294 | } |
293 | 295 | |
— | — | @@ -297,21 +299,21 @@ |
298 | 300 | $.wikiLove.currentTypeOrSubtype.borderColor |
299 | 301 | ); |
300 | 302 | |
301 | | - $.wikiLove.doPreview( '==' + $( '#wlHeader' ).val() + "==\n" + msg ); |
| 303 | + $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + "==\n" + msg ); |
302 | 304 | $.wikiLove.previewData = { |
303 | | - 'header': $( '#wlHeader' ).val(), |
| 305 | + 'header': $( '#mw-wikilove-header' ).val(), |
304 | 306 | 'msg': msg, |
305 | 307 | 'type': $.wikiLove.currentTypeId |
306 | 308 | + ($.wikiLove.currentSubtypeId !== null ? '-' + $.wikiLove.currentSubtypeId : '') |
307 | 309 | }; |
308 | 310 | |
309 | | - if ( $( '#wlNotifyCheckbox:checked' ).val() && $.wikiLove.emailable ) { |
| 311 | + if ( $( '#mw-wikilove-notify-checkbox:checked' ).val() && $.wikiLove.emailable ) { |
310 | 312 | $.wikiLove.previewData.mail = $.wikiLove.prepareMsg( $.wikiLove.currentTypeOrSubtype.mail ); |
311 | 313 | } |
312 | 314 | }, |
313 | 315 | |
314 | 316 | showError: function( errmsg ) { |
315 | | - $( '#wlAddDetails' ).append( $( '<div class="wlError"></div>' ).text( mw.msg( errmsg ) ) ); |
| 317 | + $( '#mw-wikilove-add-details' ).append( $( '<div class="mw-wikilove-error"></div>' ).text( mw.msg( errmsg ) ) ); |
316 | 318 | }, |
317 | 319 | |
318 | 320 | /* |
— | — | @@ -326,9 +328,9 @@ |
327 | 329 | */ |
328 | 330 | prepareMsg: function( msg, imageSize, backgroundColor, borderColor ) { |
329 | 331 | |
330 | | - msg = msg.replace( '$1', $( '#wlMessage' ).val() ); // replace the raw message |
331 | | - msg = msg.replace( '$2', $( '#wlTitle' ).val() ); // replace the title |
332 | | - msg = msg.replace( '$3', $( '#wlImage' ).val() ); // replace the image |
| 332 | + msg = msg.replace( '$1', $( '#mw-wikilove-message' ).val() ); // replace the raw message |
| 333 | + msg = msg.replace( '$2', $( '#mw-wikilove-title' ).val() ); // replace the title |
| 334 | + msg = msg.replace( '$3', $( '#mw-wikilove-image' ).val() ); // replace the image |
333 | 335 | |
334 | 336 | var myImageSize = imageSize || $.wikiLove.defaultImageSize; |
335 | 337 | var myBackgroundColor = backgroundColor || $.wikiLove.defaultBackgroundColor; |
— | — | @@ -347,7 +349,7 @@ |
348 | 350 | * Fires AJAX request for previewing wikitext. |
349 | 351 | */ |
350 | 352 | doPreview: function( wikitext ) { |
351 | | - $( '#wlPreviewSpinner' ).fadeIn( 200 ); |
| 353 | + $( '#mw-wikilove-preview-spinner' ).fadeIn( 200 ); |
352 | 354 | $.ajax({ |
353 | 355 | url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php?', |
354 | 356 | data: { |
— | — | @@ -361,7 +363,7 @@ |
362 | 364 | type: 'POST', |
363 | 365 | success: function( data ) { |
364 | 366 | $.wikiLove.showPreview( data.parse.text['*'] ); |
365 | | - $( '#wlPreviewSpinner' ).fadeOut( 200 ); |
| 367 | + $( '#mw-wikilove-preview-spinner' ).fadeOut( 200 ); |
366 | 368 | } |
367 | 369 | }); |
368 | 370 | }, |
— | — | @@ -370,8 +372,8 @@ |
371 | 373 | * Callback for the preview function. Sets the preview area with the HTML and fades it in. |
372 | 374 | */ |
373 | 375 | showPreview: function( html ) { |
374 | | - $( '#wlPreviewArea' ).html( html ); |
375 | | - $( '#wlPreview' ).fadeIn( 200 ); |
| 376 | + $( '#mw-wikilove-preview-area' ).html( html ); |
| 377 | + $( '#mw-wikilove-preview' ).fadeIn( 200 ); |
376 | 378 | }, |
377 | 379 | |
378 | 380 | /* |
— | — | @@ -389,7 +391,7 @@ |
390 | 392 | * Fires the final AJAX request and then redirects to the talk page where the content is added. |
391 | 393 | */ |
392 | 394 | doSend: function( subject, wikitext, type, mail ) { |
393 | | - $( '#wlSendSpinner' ).fadeIn( 200 ); |
| 395 | + $( '#mw-wikilove-send-spinner' ).fadeIn( 200 ); |
394 | 396 | |
395 | 397 | var sendData = { |
396 | 398 | 'action': 'wikilove', |
— | — | @@ -411,10 +413,10 @@ |
412 | 414 | dataType: 'json', |
413 | 415 | type: 'POST', |
414 | 416 | success: function( data ) { |
415 | | - $( '#wlSendSpinner' ).fadeOut( 200 ); |
| 417 | + $( '#mw-wikilove-send-spinner' ).fadeOut( 200 ); |
416 | 418 | |
417 | 419 | if ( typeof data.error !== 'undefined' ) { |
418 | | - $( '#wlPreview' ).append( '<div class="wlError">' + mw.html.escape( data.error.info ) + '<div>' ); |
| 420 | + $( '#mw-wikilove-preview' ).append( '<div class="wlError">' + mw.html.escape( data.error.info ) + '<div>' ); |
419 | 421 | return; |
420 | 422 | } |
421 | 423 | |
— | — | @@ -438,9 +440,9 @@ |
439 | 441 | * thumbnails from the API, and constructs a thumbnail gallery with them. |
440 | 442 | */ |
441 | 443 | showGallery: function() { |
442 | | - $( '#wlGallery' ).html( '' ); |
| 444 | + $( '#mw-wikilove-gallery-content' ).html( '' ); |
443 | 445 | $.wikiLove.gallery = {}; |
444 | | - $( '#wlGallerySpinner' ).fadeIn( 200 ); |
| 446 | + $( '#mw-wikilove-gallery-spinner' ).fadeIn( 200 ); |
445 | 447 | |
446 | 448 | $.each( $.wikiLove.currentTypeOrSubtype.gallery.imageList, function(index, value) { |
447 | 449 | |
— | — | @@ -457,7 +459,7 @@ |
458 | 460 | dataType: 'json', |
459 | 461 | type: 'POST', |
460 | 462 | success: function( data ) { |
461 | | - $( '#wlGallerySpinner' ).fadeOut( 200 ); |
| 463 | + $( '#mw-wikilove-gallery-spinner' ).fadeOut( 200 ); |
462 | 464 | |
463 | 465 | if ( !data || !data.query || !data.query.pages ) { |
464 | 466 | return; |
— | — | @@ -470,18 +472,18 @@ |
471 | 473 | .attr( 'width', $.wikiLove.currentTypeOrSubtype.gallery.width ) |
472 | 474 | .hide() |
473 | 475 | .load( function() { $( this ).css( 'display', 'inline-block' ); } ); |
474 | | - $( '#wlGallery' ).append( |
| 476 | + $( '#mw-wikilove-gallery-content' ).append( |
475 | 477 | $( '<a href="#"></a>' ) |
476 | | - .attr( 'id', 'wlGalleryImg' + index ) |
| 478 | + .attr( 'id', 'mw-wikilove-gallery-img-' + index ) |
477 | 479 | .append( $img ) |
478 | 480 | .click( function( e ) { |
479 | 481 | e.preventDefault(); |
480 | | - $( '#wlGallery a' ).removeClass( 'selected' ); |
| 482 | + $( '#mw-wikilove-gallery a' ).removeClass( 'selected' ); |
481 | 483 | $( this ).addClass( 'selected' ); |
482 | | - $( '#wlImage' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] ); |
| 484 | + $( '#mw-wikilove-image' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] ); |
483 | 485 | }) |
484 | 486 | ); |
485 | | - $.wikiLove.gallery['wlGalleryImg' + index] = page.title; |
| 487 | + $.wikiLove.gallery['mw-wikilove-gallery-img-' + index] = page.title; |
486 | 488 | } |
487 | 489 | } ); |
488 | 490 | } |
— | — | @@ -497,9 +499,9 @@ |
498 | 500 | * also allows for using remote galleries such as Commons, which is now prohibited by JS. |
499 | 501 | */ |
500 | 502 | makeGallery: function() { |
501 | | - $( '#wlGallery' ).html( '' ); |
| 503 | + $( '#mw-wikilove-gallery-content' ).html( '' ); |
502 | 504 | $.wikiLove.gallery = {}; |
503 | | - $( '#wlGallerySpinner' ).fadeIn( 200 ); |
| 505 | + $( '#mw-wikilove-gallery-spinner' ).fadeIn( 200 ); |
504 | 506 | |
505 | 507 | $.ajax({ |
506 | 508 | url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php', |
— | — | @@ -519,7 +521,7 @@ |
520 | 522 | type: 'POST', |
521 | 523 | success: function( data ) { |
522 | 524 | // clear |
523 | | - $( '#wlGallery' ).html( '' ); |
| 525 | + $( '#mw-wikilove-gallery-content' ).html( '' ); |
524 | 526 | $.wikiLove.gallery = {}; |
525 | 527 | |
526 | 528 | // if we have any images at all |
— | — | @@ -549,31 +551,31 @@ |
550 | 552 | .load( function() { $( this ).css( 'display', 'inline-block' ); } ); |
551 | 553 | |
552 | 554 | // append the image to the gallery and also make sure it's selectable |
553 | | - $( '#wlGallery' ).append( |
| 555 | + $( '#mw-wikilove-gallery-content' ).append( |
554 | 556 | $( '<a href="#"></a>' ) |
555 | | - .attr( 'id', 'wlGalleryImg' + i ) |
| 557 | + .attr( 'id', 'mw-wikilove-gallery-img-' + i ) |
556 | 558 | .append( $img ) |
557 | 559 | .click( function( e ) { |
558 | 560 | e.preventDefault(); |
559 | | - $( '#wlGallery a' ).removeClass( 'selected' ); |
| 561 | + $( '#mw-wikilove-gallery a' ).removeClass( 'selected' ); |
560 | 562 | $( this ).addClass( 'selected' ); |
561 | | - $( '#wlImage' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] ); |
| 563 | + $( '#mw-wikilove-image' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] ); |
562 | 564 | }) |
563 | 565 | ); |
564 | 566 | |
565 | 567 | // save the page title into an array so we know which image id maps to which title |
566 | | - $.wikiLove.gallery['wlGalleryImg' + i] = page.title; |
| 568 | + $.wikiLove.gallery['mw-wikilove-gallery-img-' + i] = page.title; |
567 | 569 | break; |
568 | 570 | } |
569 | 571 | } |
570 | 572 | } |
571 | 573 | } |
572 | 574 | if( $.wikiLove.gallery.length <= 0 ) { |
573 | | - $( '#wlGallery' ).hide(); |
574 | | - $( '#wlGalleryTitle' ).hide(); |
| 575 | + $( '#mw-wikilove-gallery' ).hide(); |
| 576 | + $( '#mw-wikilove-gallery-label' ).hide(); |
575 | 577 | } |
576 | 578 | |
577 | | - $( '#wlGallerySpinner' ).fadeOut( 200 ); |
| 579 | + $( '#mw-wikilove-gallery-spinner' ).fadeOut( 200 ); |
578 | 580 | } |
579 | 581 | }); |
580 | 582 | }, |