r88783 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88782‎ | r88783 | r88784 >
Date:11:32, 25 May 2011
Author:janpaul123
Status:ok
Tags:
Comment:
Modified paths:
  • /trunk/extensions/WikiLove/wikiLove.css (modified) (history)
  • /trunk/extensions/WikiLove/wikiLove.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiLove/wikiLove.css
@@ -42,24 +42,24 @@
4343 }
4444
4545 /* dialog */
46 -#wikiLoveDialog {
 46+#mw-wikilove-dialog {
4747 margin: 10px;
4848 }
4949
5050 /* dialog type selection */
51 -#wikiLoveDialog #wlSelectType {
 51+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type {
5252 float: left;
5353 width: 250px;
5454 }
5555
56 -#wikiLoveDialog #wlSelectType ul {
 56+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type ul {
5757 list-style: none;
5858 margin: 0;
5959 padding: 0;
6060 }
6161
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
6464 {
6565 display: block;
6666 width: 250px;
@@ -71,19 +71,19 @@
7272 outline: none;
7373 }
7474
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 {
7777 text-decoration:none;
7878 }
7979
8080 /* 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 {
8383 display: inline-block;
8484 }
8585
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 {
8888 padding: 0;
8989 margin: 0;
9090 width: 6px;
@@ -92,45 +92,45 @@
9393 top: 0px;
9494 }
9595
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 {
9999 /* @embed */
100100 background-image: url(images/select-sprite.png);
101101 background-repeat: no-repeat;
102102 }
103103
104 -#wikiLoveDialog #wlSelectType a .wlLeftCap {
 104+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-left-cap {
105105 /* @noflip */
106106 left: 0px;
107107 background-position: 0px 0px;
108108 }
109109
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 {
112112 background-position: -6px 0px;
113113 }
114114
115 -#wikiLoveDialog #wlSelectType a.selected .wlLeftCap {
 115+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-left-cap {
116116 background-position: -12px 0px;
117117 }
118118
119 -#wikiLoveDialog #wlSelectType a .wlRightCap {
 119+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-right-cap {
120120 /* @noflip */
121121 right: 0px;
122122 background-position: -18px 0px;
123123 }
124124
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 {
127127 background-position: -25px 0px;
128128 }
129129
130 -#wikiLoveDialog #wlSelectType a.selected .wlRightCap {
 130+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-right-cap {
131131 background-position: -32px 0px;
132132 }
133133
134 -#wikiLoveDialog #wlSelectType a .wlInside {
 134+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-inside {
135135 padding: 0;
136136 margin: 0;
137137 width: 238px;
@@ -145,16 +145,16 @@
146146 background-repeat: repeat-x;
147147 }
148148
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 {
151151 background-position: 0px -66px;
152152 }
153153
154 -#wikiLoveDialog #wlSelectType a.selected .wlInside {
 154+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-inside {
155155 background-position: 0px -132px;
156156 }
157157
158 -#wikiLoveDialog #wlSelectType a .wlIconBox {
 158+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-icon-box {
159159 padding: 0;
160160 margin: 0;
161161 width: 53px;
@@ -165,7 +165,7 @@
166166 background-position: -42px 0px;
167167 }
168168
169 -#wikiLoveDialog #wlSelectType a .wlIconBox img {
 169+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-icon-box img {
170170 padding: 0;
171171 margin: 0;
172172 width: 53px;
@@ -175,16 +175,16 @@
176176 left: 0px;
177177 }
178178
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 {
181181 background-position: -97px 0px;
182182 }
183183
184 -#wikiLoveDialog #wlSelectType a.selected .wlIconBox {
 184+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a.selected .mw-wikilove-icon-box {
185185 background-position: -152px 0px;
186186 }
187187
188 -#wikiLoveDialog #wlSelectType a .wlLinkText {
 188+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-link-text {
189189 padding: 0;
190190 margin: 0;
191191 width: 170px;
@@ -199,12 +199,12 @@
200200 color: white;
201201 }
202202
203 -#wikiLoveDialog #wlSelectType a .wlNoIcon .wlLinkText {
 203+/*#mw-wikilove-dialog*/ #mw-wikilove-select-type a .mw-wikilove-no-icon .mw-wikilove-link-text {
204204 left: 3px;
205205 }
206206
207207 /* dialog get started */
208 -#wikiLoveDialog #wlGetStarted {
 208+/*#mw-wikilove-dialog*/ #mw-wikilove-get-started {
209209 float: right;
210210 width: 380px;
211211 margin-top: 40px;
@@ -218,44 +218,44 @@
219219 background-repeat: no-repeat;
220220 }
221221
222 -#wikiLoveDialog #wlGetStarted h2 {
 222+/*#mw-wikilove-dialog*/ #mw-wikilove-get-started h2 {
223223 border: none;
224224 font-weight: bold;
225225 }
226226
227 -#wikiLoveDialog #wlGetStarted ol {
 227+/*#mw-wikilove-dialog*/ #mw-wikilove-get-started ol {
228228 margin-left: 1.5em;
229229 }
230230
231231 /* dialog add details */
232 -#wikiLoveDialog #wlAddDetails {
 232+/*#mw-wikilove-dialog*/ #mw-wikilove-add-details {
233233 float: right;
234234 width: 480px;
235235 margin-bottom: 5px;
236236 }
237237
238 -#wikiLoveDialog #wlAddDetails label {
 238+/*#mw-wikilove-dialog*/ #mw-wikilove-add-details label {
239239 font-weight: bold;
240240 font-size: 1.1em;
241241 }
242242
243 -#wikiLoveDialog #wlAddDetails .text {
 243+/*#mw-wikilove-dialog*/ #mw-wikilove-add-details .text {
244244 display: block;
245245 width: 300px;
246246 }
247247
248 -#wikiLoveDialog #wlAddDetails .wlNote {
 248+/*#mw-wikilove-dialog*/ #mw-wikilove-add-details .mw-wikilove-note {
249249 font-weight: light;
250250 font-size: 0.9em;
251251 float: right;
252252 color: #999;
253253 }
254254
255 -#wikiLoveDialog #wlAddDetails textarea {
 255+/*#mw-wikilove-dialog*/ #mw-wikilove-add-details textarea {
256256 resize: none;
257257 }
258258
259 -#wikiLoveDialog .wlSpinner {
 259+#mw-wikilove-dialog .mw-wikilove-spinner {
260260 float: right;
261261 margin-top: 0.9em;
262262 display: none;
@@ -269,30 +269,27 @@
270270 }
271271
272272 /* add details gallery */
273 -#wikiLoveDialog #wlGallery {
 273+/*#mw-wikilove-dialog*/ #mw-wikilove-gallery {
274274 min-height: 40px;
 275+ position: relative;
275276 }
276277
277 -#wikiLoveDialog #wlGallery img {
 278+/*#mw-wikilove-dialog*/ #mw-wikilove-gallery img {
278279 margin-right: 5px;
279280 margin-bottom: 5px;
280281 padding: 5px;
281282 }
282283
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 {
285286 background-color: #aacfe9;
286287 }
287288
288 -#wikiLoveDialog #wlGallery a.selected img {
 289+/*#mw-wikilove-dialog*/ #mw-wikilove-gallery a.selected img {
289290 background-color: #f56427;
290291 }
291292
292 -#wikiLoveDialog #wlGallerySpinner {
293 - position: relative;
294 -}
295 -
296 -#wikiLoveDialog #wlGallerySpinner .wlSpinner {
 293+/*#mw-wikilove-dialog*/ #mw-wikilove-gallery-spinner {
297294 float: none;
298295 position: absolute;
299296 top: 0;
@@ -302,59 +299,50 @@
303300 }
304301
305302 /* dialog preview */
306 -#wikiLoveDialog #wlPreview {
 303+/*#mw-wikilove-dialog*/ #mw-wikilove-preview {
307304 float: right;
308305 width: 480px;
309306 }
310307
311 -#wikiLoveDialog #wlPreview #wlPreviewArea {
 308+/*#mw-wikilove-dialog #mw-wikilove-preview*/ #mw-wikilove-preview-area {
312309 margin-left: 15px;
313310 width: 465px;
314311 overflow: auto;
315312 }
316313
317 -#wikiLoveDialog #wlPreview #wlPreviewArea .editsection {
 314+/*#mw-wikilove-dialog #mw-wikilove-preview*/ #mw-wikilove-preview-area .editsection {
318315 display: none;
319316 }
320317
321318 /* 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 {
325322 margin: 5px 0px 5px 15px;
326323 max-width: 460px;
327324 display: block;
328325 }
329326
330 -#wikiLoveDialog #wlSubtypeDescription {
 327+/*#mw-wikilove-dialog*/ #wlSubtypeDescription {
331328 margin: 5px 0px 8px 15px;
332329 font-size: 1.0em;
333330 line-height: 1.2em;
334331 }
335332
336 -#wikiLoveDialog input[type=checkbox] {
 333+#mw-wikilove-dialog input[type=checkbox] {
337334 display:inline-box;
338335 margin: 5px 0px 5px 0px;
339336 }
340337
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 {
351339 padding: 1px 0;
352340 }
353341
354 -#wikiLoveDialog .submit {
 342+#mw-wikilove-dialog .submit {
355343 float: right;
356344 }
357345
358 -#wikiLoveDialog .wlNumber {
 346+#mw-wikilove-dialog .mw-wikilove-number {
359347 color: white;
360348 float: left;
361349 display: block;
@@ -372,7 +360,7 @@
373361 background-repeat: no-repeat;
374362 }
375363
376 -#wikiLoveDialog .wlError {
 364+#mw-wikilove-dialog .mw-wikilove-error {
377365 /* @embed */
378366 background-image: url(images/alert.png);
379367 background-position: center left;
Index: trunk/extensions/WikiLove/wikiLove.js
@@ -30,36 +30,36 @@
3131 $.wikiLove.emailable = $( '#t-emailuser' ).length ? true : false;
3232
3333 // Build a type list like this:
34 - var $typeList = $( '<ul id="wlTypes"></ul>' );
 34+ var $typeList = $( '<ul id="mw-wikilove-types"></ul>' );
3535 for( var typeId in $.wikiLove.types ) {
3636 var $button = $( '<a href="#"></a>' );
37 - var $buttonInside = $( '<div class="wlInside"></div>' );
 37+ var $buttonInside = $( '<div class="mw-wikilove-inside"></div>' );
3838
3939 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="'
4141 + mw.html.escape( $.wikiLove.types[typeId].icon ) + '"/></div>' );
4242 }
4343 else {
44 - $buttonInside.addClass( 'wlNoIcon' );
 44+ $buttonInside.addClass( 'mw-wikilove-no-icon' );
4545 }
4646
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>' );
4848
49 - $button.append( '<div class="wlLeftCap"></div>');
 49+ $button.append( '<div class="mw-wikilove-left-cap"></div>');
5050 $button.append( $buttonInside );
51 - $button.append( '<div class="wlRightCap"></div>');
 51+ $button.append( '<div class="mw-wikilove-right-cap"></div>');
5252 $button.data( 'typeId', typeId );
5353 $typeList.append( $( '<li tabindex="0"></li>' ).append( $button ) );
5454 }
5555
5656 $.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>\
6060 <h3><html:msg key="wikilove-select-type"/></h3>\
61 - <ul id="wlTypes"></ul>\
 61+ <ul id="mw-wikilove-types"></ul>\
6262 </div>\
63 -<div id="wlGetStarted">\
 63+<div id="mw-wikilove-get-started">\
6464 <h2><html:msg key="wikilove-get-started-header"/></h2>\
6565 <ol>\
6666 <li><html:msg key="wikilove-get-started-list-1"/></li>\
@@ -67,40 +67,42 @@
6868 <li><html:msg key="wikilove-get-started-list-3"/></li>\
6969 </ol>\
7070 </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>\
7373 <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>\
9382 </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>\
9698 </form>\
9799 </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>\
100102 <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>\
105107 </form>\
106108 </div>\
107109 </div>' );
@@ -115,17 +117,17 @@
116118 resizable: false
117119 });
118120
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 );
124126
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
130132 }
131133
132134 $.wikiLove.$dialog.dialog( 'open' );
@@ -137,45 +139,45 @@
138140 */
139141 clickType: function( e ) {
140142 e.preventDefault();
141 - $( '#wlGetStarted' ).hide(); // always hide the get started section
 143+ $( '#mw-wikilove-get-started' ).hide(); // always hide the get started section
142144
143145 var newTypeId = $( this ).data( 'typeId' );
144146 if( $.wikiLove.currentTypeId != newTypeId ) { // only do stuff when a different type is selected
145147 $.wikiLove.currentTypeId = newTypeId;
146148 $.wikiLove.currentSubtypeId = null; // reset the subtype id
147149
148 - $( '#wlTypes a' ).removeClass( 'selected' );
 150+ $( '#mw-wikilove-types a' ).removeClass( 'selected' );
149151 $( this ).addClass( 'selected' ); // highlight the new type in the menu
150152
151153 if( typeof $.wikiLove.types[$.wikiLove.currentTypeId].subtypes == 'object' ) {
152154 // we're dealing with subtypes here
153155 $.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
155157
156158 for( var subtypeId in $.wikiLove.types[$.wikiLove.currentTypeId].subtypes ) {
157159 // add all the subtypes to the menu while setting their subtype ids in jQuery data
158160 var subtype = $.wikiLove.types[$.wikiLove.currentTypeId].subtypes[subtypeId];
159 - $( '#wlSubtype' ).append(
 161+ $( '#mw-wikilove-subtype' ).append(
160162 $( '<option></option>' ).text( subtype.option ).data( 'subtypeId', subtypeId )
161163 );
162164 }
163 - $( '#wlSubtype' ).show();
 165+ $( '#mw-wikilove-subtype' ).show();
164166
165167 // 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();
168170 $.wikiLove.changeSubtype(); // update controls depending on the currently selected (i.e. first) subtype
169171 }
170172 else {
171173 // there are no subtypes, just use this type for the current (sub)type
172174 $.wikiLove.currentTypeOrSubtype = $.wikiLove.types[$.wikiLove.currentTypeId];
173 - $( '#wlSubtype' ).hide();
174 - $( '#wlSubtypeLabel' ).hide();
 175+ $( '#mw-wikilove-subtype' ).hide();
 176+ $( '#mw-wikilove-subtype-label' ).hide();
175177 $.wikiLove.updateAllDetails(); // update controls depending on this type
176178 }
177179
178 - $( '#wlAddDetails' ).show();
179 - $( '#wlPreview' ).hide();
 180+ $( '#mw-wikilove-add-details' ).show();
 181+ $( '#mw-wikilove-preview' ).hide();
180182 $.wikiLove.previewData = null;
181183 }
182184 },
@@ -185,14 +187,14 @@
186188 */
187189 changeSubtype: function() {
188190 // 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' );
190192 if( $.wikiLove.currentSubtypeId != newSubtypeId ) { // only change stuff when a different subtype is selected
191193 $.wikiLove.currentSubtypeId = newSubtypeId;
192194 $.wikiLove.currentTypeOrSubtype = $.wikiLove.types[$.wikiLove.currentTypeId]
193195 .subtypes[$.wikiLove.currentSubtypeId];
194 - $( '#wlSubtypeDescription' ).html( $.wikiLove.currentTypeOrSubtype.descr );
 196+ $( '#mw-wikilove-subtype-description' ).html( $.wikiLove.currentTypeOrSubtype.descr );
195197 $.wikiLove.updateAllDetails();
196 - $( '#wlPreview' ).hide();
 198+ $( '#mw-wikilove-preview' ).hide();
197199 $.wikiLove.previewData = null;
198200 }
199201 },
@@ -201,67 +203,67 @@
202204 * Called when type or subtype changes, updates controls.
203205 */
204206 updateAllDetails: function() {
205 - $( '#wikiLoveDialog' ).find( '.wlError' ).remove();
 207+ $( '#wikiLoveDialog' ).find( '.mw-wikilove-error' ).remove();
206208
207209 // only show the description if it exists for this type or subtype
208210 if( typeof $.wikiLove.currentTypeOrSubtype.descr == 'string' ) {
209 - $( '#wlSubtypeDescription').show();
 211+ $( '#mw-wikilove-subtype-description').show();
210212 } else {
211 - $( '#wlSubtypeDescription').hide();
 213+ $( '#mw-wikilove-subtype-description').hide();
212214 }
213215
214216 // show or hide header label and textbox depending on whether a predefined header exists
215217 if( $.inArray( 'header', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 ) {
216 - $( '#wlHeaderLabel').show();
217 - $( '#wlHeader' ).show();
 218+ $( '#mw-wikilove-header-label').show();
 219+ $( '#mw-wikilove-header' ).show();
218220 } else {
219 - $( '#wlHeaderLabel').hide();
220 - $( '#wlHeader' ).hide();
 221+ $( '#mw-wikilove-header-label').hide();
 222+ $( '#mw-wikilove-header' ).hide();
221223 }
222 - $( '#wlHeader' ).val( $.wikiLove.currentTypeOrSubtype.header || '' );
 224+ $( '#mw-wikilove-header' ).val( $.wikiLove.currentTypeOrSubtype.header || '' );
223225
224226 // show or hide title label and textbox depending on whether a predefined title exists
225227 if( $.inArray( 'title', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 ) {
226 - $( '#wlTitleLabel').show();
227 - $( '#wlTitle' ).show();
 228+ $( '#mw-wikilove-title-label').show();
 229+ $( '#mw-wikilove-title' ).show();
228230 } else {
229 - $( '#wlTitleLabel').hide();
230 - $( '#wlTitle' ).hide();
 231+ $( '#mw-wikilove-title-label').hide();
 232+ $( '#mw-wikilove-title' ).hide();
231233 }
232 - $( '#wlTitle' ).val( $.wikiLove.currentTypeOrSubtype.title || '' );
 234+ $( '#mw-wikilove-title' ).val( $.wikiLove.currentTypeOrSubtype.title || '' );
233235
234236 // show or hide image label and textbox depending on whether a predefined image exists
235237 if( $.inArray( 'image', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 ) {
236 - $( '#wlImageLabel').show();
237 - $( '#wlImage' ).show();
 238+ $( '#mw-wikilove-image-label').show();
 239+ $( '#mw-wikilove-image' ).show();
238240 } else {
239 - $( '#wlImageLabel').hide();
240 - $( '#wlImage' ).hide();
 241+ $( '#mw-wikilove-image-label').hide();
 242+ $( '#mw-wikilove-image' ).hide();
241243 }
242 - $( '#wlImage' ).val( $.wikiLove.currentTypeOrSubtype.image || '' );
 244+ $( '#mw-wikilove-image' ).val( $.wikiLove.currentTypeOrSubtype.image || '' );
243245
244246 if( typeof $.wikiLove.currentTypeOrSubtype.gallery == 'object' ) {
245247 if( $.wikiLove.currentTypeOrSubtype.gallery.imageList instanceof Array) {
246 - $( '#wlGalleryLabel' ).show();
247 - $( '#wlGallery' ).show();
 248+ $( '#mw-wikilove-gallery-label' ).show();
 249+ $( '#mw-wikilove-gallery' ).show();
248250 $.wikiLove.showGallery(); // build gallery from array of images
249251 } else {
250252 // gallery is a category
251 - $( '#wlGalleryLabel' ).show();
252 - $( '#wlGallery' ).show();
 253+ $( '#mw-wikilove-gallery-label' ).show();
 254+ $( '#mw-wikilove-gallery' ).show();
253255 $.wikiLove.makeGallery(); // build gallery from category
254256 }
255257 }
256258 else {
257 - $( '#wlGalleryLabel' ).hide();
258 - $( '#wlGallery' ).hide();
 259+ $( '#mw-wikilove-gallery-label' ).hide();
 260+ $( '#mw-wikilove-gallery' ).hide();
259261 }
260262
261263 if( $.inArray( 'notify', $.wikiLove.currentTypeOrSubtype.fields ) >= 0 && $.wikiLove.emailable ) {
262 - $( '#wlNotify' ).show();
 264+ $( '#mw-wikilove-notify' ).show();
263265 } else {
264 - $( '#wlNotify' ).hide();
265 - $( '#wlNotifyCheckbox' ).attr('checked', false);
 266+ $( '#mw-wikilove-notify' ).hide();
 267+ $( '#mw-wikilove-notify-checkbox' ).attr('checked', false);
266268 }
267269 },
268270
@@ -270,23 +272,23 @@
271273 */
272274 submitPreview: function( e ) {
273275 e.preventDefault();
274 - $( '#wlPreview' ).hide();
 276+ $( '#mw-wikilove-preview' ).hide();
275277 $( '#wikiLoveDialog' ).find( '.wlError' ).remove();
276278
277279 if( typeof $.wikiLove.currentTypeOrSubtype.gallery == 'object' ) {
278 - if ( $( '#wlImage' ).val().length <= 0 ) {
 280+ if ( $( '#mw-wikilove-image' ).val().length <= 0 ) {
279281 $.wikiLove.showError( 'wikilove-err-image' ); return false;
280282 }
281283 }
282 - if( $( '#wlHeader' ).val().length <= 0 ) {
 284+ if( $( '#mw-wikilove-header' ).val().length <= 0 ) {
283285 $.wikiLove.showError( 'wikilove-err-header' ); return false;
284286 }
285 - if( $( '#wlMessage' ).val().length <= 0 ) {
 287+ if( $( '#mw-wikilove-message' ).val().length <= 0 ) {
286288 $.wikiLove.showError( 'wikilove-err-msg' ); return false;
287289 }
288290
289291 // 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 ) {
291293 $.wikiLove.showError( 'wikilove-err-sig' ); return false;
292294 }
293295
@@ -297,21 +299,21 @@
298300 $.wikiLove.currentTypeOrSubtype.borderColor
299301 );
300302
301 - $.wikiLove.doPreview( '==' + $( '#wlHeader' ).val() + "==\n" + msg );
 303+ $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + "==\n" + msg );
302304 $.wikiLove.previewData = {
303 - 'header': $( '#wlHeader' ).val(),
 305+ 'header': $( '#mw-wikilove-header' ).val(),
304306 'msg': msg,
305307 'type': $.wikiLove.currentTypeId
306308 + ($.wikiLove.currentSubtypeId !== null ? '-' + $.wikiLove.currentSubtypeId : '')
307309 };
308310
309 - if ( $( '#wlNotifyCheckbox:checked' ).val() && $.wikiLove.emailable ) {
 311+ if ( $( '#mw-wikilove-notify-checkbox:checked' ).val() && $.wikiLove.emailable ) {
310312 $.wikiLove.previewData.mail = $.wikiLove.prepareMsg( $.wikiLove.currentTypeOrSubtype.mail );
311313 }
312314 },
313315
314316 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 ) ) );
316318 },
317319
318320 /*
@@ -326,9 +328,9 @@
327329 */
328330 prepareMsg: function( msg, imageSize, backgroundColor, borderColor ) {
329331
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
333335
334336 var myImageSize = imageSize || $.wikiLove.defaultImageSize;
335337 var myBackgroundColor = backgroundColor || $.wikiLove.defaultBackgroundColor;
@@ -347,7 +349,7 @@
348350 * Fires AJAX request for previewing wikitext.
349351 */
350352 doPreview: function( wikitext ) {
351 - $( '#wlPreviewSpinner' ).fadeIn( 200 );
 353+ $( '#mw-wikilove-preview-spinner' ).fadeIn( 200 );
352354 $.ajax({
353355 url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php?',
354356 data: {
@@ -361,7 +363,7 @@
362364 type: 'POST',
363365 success: function( data ) {
364366 $.wikiLove.showPreview( data.parse.text['*'] );
365 - $( '#wlPreviewSpinner' ).fadeOut( 200 );
 367+ $( '#mw-wikilove-preview-spinner' ).fadeOut( 200 );
366368 }
367369 });
368370 },
@@ -370,8 +372,8 @@
371373 * Callback for the preview function. Sets the preview area with the HTML and fades it in.
372374 */
373375 showPreview: function( html ) {
374 - $( '#wlPreviewArea' ).html( html );
375 - $( '#wlPreview' ).fadeIn( 200 );
 376+ $( '#mw-wikilove-preview-area' ).html( html );
 377+ $( '#mw-wikilove-preview' ).fadeIn( 200 );
376378 },
377379
378380 /*
@@ -389,7 +391,7 @@
390392 * Fires the final AJAX request and then redirects to the talk page where the content is added.
391393 */
392394 doSend: function( subject, wikitext, type, mail ) {
393 - $( '#wlSendSpinner' ).fadeIn( 200 );
 395+ $( '#mw-wikilove-send-spinner' ).fadeIn( 200 );
394396
395397 var sendData = {
396398 'action': 'wikilove',
@@ -411,10 +413,10 @@
412414 dataType: 'json',
413415 type: 'POST',
414416 success: function( data ) {
415 - $( '#wlSendSpinner' ).fadeOut( 200 );
 417+ $( '#mw-wikilove-send-spinner' ).fadeOut( 200 );
416418
417419 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>' );
419421 return;
420422 }
421423
@@ -438,9 +440,9 @@
439441 * thumbnails from the API, and constructs a thumbnail gallery with them.
440442 */
441443 showGallery: function() {
442 - $( '#wlGallery' ).html( '' );
 444+ $( '#mw-wikilove-gallery-content' ).html( '' );
443445 $.wikiLove.gallery = {};
444 - $( '#wlGallerySpinner' ).fadeIn( 200 );
 446+ $( '#mw-wikilove-gallery-spinner' ).fadeIn( 200 );
445447
446448 $.each( $.wikiLove.currentTypeOrSubtype.gallery.imageList, function(index, value) {
447449
@@ -457,7 +459,7 @@
458460 dataType: 'json',
459461 type: 'POST',
460462 success: function( data ) {
461 - $( '#wlGallerySpinner' ).fadeOut( 200 );
 463+ $( '#mw-wikilove-gallery-spinner' ).fadeOut( 200 );
462464
463465 if ( !data || !data.query || !data.query.pages ) {
464466 return;
@@ -470,18 +472,18 @@
471473 .attr( 'width', $.wikiLove.currentTypeOrSubtype.gallery.width )
472474 .hide()
473475 .load( function() { $( this ).css( 'display', 'inline-block' ); } );
474 - $( '#wlGallery' ).append(
 476+ $( '#mw-wikilove-gallery-content' ).append(
475477 $( '<a href="#"></a>' )
476 - .attr( 'id', 'wlGalleryImg' + index )
 478+ .attr( 'id', 'mw-wikilove-gallery-img-' + index )
477479 .append( $img )
478480 .click( function( e ) {
479481 e.preventDefault();
480 - $( '#wlGallery a' ).removeClass( 'selected' );
 482+ $( '#mw-wikilove-gallery a' ).removeClass( 'selected' );
481483 $( this ).addClass( 'selected' );
482 - $( '#wlImage' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] );
 484+ $( '#mw-wikilove-image' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] );
483485 })
484486 );
485 - $.wikiLove.gallery['wlGalleryImg' + index] = page.title;
 487+ $.wikiLove.gallery['mw-wikilove-gallery-img-' + index] = page.title;
486488 }
487489 } );
488490 }
@@ -497,9 +499,9 @@
498500 * also allows for using remote galleries such as Commons, which is now prohibited by JS.
499501 */
500502 makeGallery: function() {
501 - $( '#wlGallery' ).html( '' );
 503+ $( '#mw-wikilove-gallery-content' ).html( '' );
502504 $.wikiLove.gallery = {};
503 - $( '#wlGallerySpinner' ).fadeIn( 200 );
 505+ $( '#mw-wikilove-gallery-spinner' ).fadeIn( 200 );
504506
505507 $.ajax({
506508 url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php',
@@ -519,7 +521,7 @@
520522 type: 'POST',
521523 success: function( data ) {
522524 // clear
523 - $( '#wlGallery' ).html( '' );
 525+ $( '#mw-wikilove-gallery-content' ).html( '' );
524526 $.wikiLove.gallery = {};
525527
526528 // if we have any images at all
@@ -549,31 +551,31 @@
550552 .load( function() { $( this ).css( 'display', 'inline-block' ); } );
551553
552554 // append the image to the gallery and also make sure it's selectable
553 - $( '#wlGallery' ).append(
 555+ $( '#mw-wikilove-gallery-content' ).append(
554556 $( '<a href="#"></a>' )
555 - .attr( 'id', 'wlGalleryImg' + i )
 557+ .attr( 'id', 'mw-wikilove-gallery-img-' + i )
556558 .append( $img )
557559 .click( function( e ) {
558560 e.preventDefault();
559 - $( '#wlGallery a' ).removeClass( 'selected' );
 561+ $( '#mw-wikilove-gallery a' ).removeClass( 'selected' );
560562 $( this ).addClass( 'selected' );
561 - $( '#wlImage' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] );
 563+ $( '#mw-wikilove-image' ).val( $.wikiLove.gallery[$( this ).attr( 'id' )] );
562564 })
563565 );
564566
565567 // 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;
567569 break;
568570 }
569571 }
570572 }
571573 }
572574 if( $.wikiLove.gallery.length <= 0 ) {
573 - $( '#wlGallery' ).hide();
574 - $( '#wlGalleryTitle' ).hide();
 575+ $( '#mw-wikilove-gallery' ).hide();
 576+ $( '#mw-wikilove-gallery-label' ).hide();
575577 }
576578
577 - $( '#wlGallerySpinner' ).fadeOut( 200 );
 579+ $( '#mw-wikilove-gallery-spinner' ).fadeOut( 200 );
578580 }
579581 });
580582 },

Status & tagging log