Index: trunk/extensions/WikiLove/WikiLove.php |
— | — | @@ -98,6 +98,7 @@ |
99 | 99 | 'wikilove-get-started-list-3', |
100 | 100 | 'wikilove-add-details', |
101 | 101 | 'wikilove-image', |
| 102 | + 'wikilove-select-image', |
102 | 103 | 'wikilove-header', |
103 | 104 | 'wikilove-title', |
104 | 105 | 'wikilove-enter-message', |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | // note that when not using subtypes you should use these subtype options |
22 | 22 | // for the top-level type |
23 | 23 | 'original': { |
24 | | - fields: [ 'notify' ], // fields to ask for in form |
| 24 | + fields: [ 'message' ], // fields to ask for in form |
25 | 25 | option: 'Original Barnstar', // option listed in the select list |
26 | 26 | descr: 'This barnstar is given to recognize particularly fine contributions to Wikipedia, to let people know that their hard work is seen and appreciated.', // description |
27 | 27 | header: 'A barnstar for you!', // header that appears at the top of the talk page post (optional) |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | email: 'Hello $7!\n\nI just awarded you a barnstar.' // message to use in email notification; $7 is replaced by the recipient's username |
31 | 31 | }, |
32 | 32 | 'admins': { |
33 | | - fields: [ 'notify' ], |
| 33 | + fields: [ 'message' ], |
34 | 34 | option: 'Admin\'s Barnstar', |
35 | 35 | descr: 'The Admin\'s Barnstar may be awarded to an administrator who made a particularly difficult decision or performed a tedious but needed admin task.', |
36 | 36 | header: 'A barnstar for you!', |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
40 | 40 | }, |
41 | 41 | 'antivandalism': { |
42 | | - fields: [ 'notify' ], |
| 42 | + fields: [ 'message' ], |
43 | 43 | option: 'Anti-Vandalism Barnstar', |
44 | 44 | descr: 'The Anti-Vandalism Barnstar may be awarded to those who show great contributions to protecting and reverting attacks of vandalism on Wikipedia.', |
45 | 45 | header: 'A barnstar for you!', |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
49 | 49 | }, |
50 | 50 | 'diligence': { |
51 | | - fields: [ 'notify' ], |
| 51 | + fields: [ 'message' ], |
52 | 52 | option: 'Barnstar of Diligence', |
53 | 53 | descr: 'The Barnstar of Diligence may be awarded in recognition of a combination of extraordinary scrutiny, precision and community service.', |
54 | 54 | header: 'A barnstar for you!', |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
58 | 58 | }, |
59 | 59 | 'diplomacy': { |
60 | | - fields: [ 'notify' ], |
| 60 | + fields: [ 'message' ], |
61 | 61 | option: 'Barnstar of Diplomacy', |
62 | 62 | descr: 'The Barnstar of Diplomacy is awarded to users who have helped to resolve, peacefully, conflicts on Wikipedia.', |
63 | 63 | header: 'A barnstar for you!', |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
67 | 67 | }, |
68 | 68 | 'goodhumor': { |
69 | | - fields: [ 'notify' ], |
| 69 | + fields: [ 'message' ], |
70 | 70 | option: 'Barnstar of Good Humor', |
71 | 71 | descr: 'The Barnstar of Good Humor may be awarded to Wikipedians who consistently lighten the mood, defuse conflicts, and make Wikipedia a better place to be.', |
72 | 72 | header: 'A barnstar for you!', |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
76 | 76 | }, |
77 | 77 | 'brilliant': { |
78 | | - fields: [ 'notify' ], |
| 78 | + fields: [ 'message' ], |
79 | 79 | option: 'Brilliant Idea Barnstar', |
80 | 80 | descr: 'The Brilliant Idea Barnstar may be awarded to a user who figures out an elegant solution to a particularly difficult problem.', |
81 | 81 | header: 'A barnstar for you!', |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
85 | 85 | }, |
86 | 86 | 'citation': { |
87 | | - fields: [ 'notify' ], |
| 87 | + fields: [ 'message' ], |
88 | 88 | option: 'Citation Barnstar', |
89 | 89 | descr: 'The Citation Barnstar is awarded to users who provide references and in-line citations to previously unsourced articles.', |
90 | 90 | header: 'A barnstar for you!', |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
94 | 94 | }, |
95 | 95 | 'civility': { |
96 | | - fields: [ 'notify' ], |
| 96 | + fields: [ 'message' ], |
97 | 97 | option: 'Civility Barnstar', |
98 | 98 | descr: 'The Civility Barnstar may be awarded to any user who excels at maintaining civility in the midst of contentious situations.', |
99 | 99 | header: 'A barnstar for you!', |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
103 | 103 | }, |
104 | 104 | 'copyeditor': { |
105 | | - fields: [ 'notify' ], |
| 105 | + fields: [ 'message' ], |
106 | 106 | option: 'Copyeditor\'s Barnstar', |
107 | 107 | descr: 'The Copyeditor\'s Barnstar is awarded for excellence in correcting spelling, grammar, punctuation, and style issues.', |
108 | 108 | header: 'A barnstar for you!', |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
112 | 112 | }, |
113 | 113 | 'defender': { |
114 | | - fields: [ 'notify' ], |
| 114 | + fields: [ 'message' ], |
115 | 115 | option: 'Defender of the Wiki Barnstar', |
116 | 116 | descr: 'The Defender of the Wiki may be awarded to those who have gone above and beyond to prevent Wikipedia from being used for fraudulent purposes.', |
117 | 117 | header: 'A barnstar for you!', |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
121 | 121 | }, |
122 | 122 | 'editors': { |
123 | | - fields: [ 'notify' ], |
| 123 | + fields: [ 'message' ], |
124 | 124 | option: 'Editor\'s Barnstar', |
125 | 125 | descr: 'The Editor\'s Barnstar is awarded to individuals who display particularly fine decisions in general editing.', |
126 | 126 | header: 'A barnstar for you!', |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
130 | 130 | }, |
131 | 131 | 'designers': { |
132 | | - fields: [ 'notify' ], |
| 132 | + fields: [ 'message' ], |
133 | 133 | option: 'Graphic Designer\'s Barnstar', |
134 | 134 | descr: 'The Graphic Designer\'s Barnstar may be awarded to those who work tirelessly to provide Wikipedia with free, high-quality graphics.', |
135 | 135 | header: 'A barnstar for you!', |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
139 | 139 | }, |
140 | 140 | 'half': { |
141 | | - fields: [ 'notify' ], |
| 141 | + fields: [ 'message' ], |
142 | 142 | option: 'Half Barnstar', |
143 | 143 | descr: 'The Half Barnstar is awarded for excellence in cooperation, especially for productive editing with someone who holds an opposing viewpoint.', |
144 | 144 | header: 'A barnstar for you!', |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
148 | 148 | }, |
149 | 149 | 'minor': { |
150 | | - fields: [ 'notify' ], |
| 150 | + fields: [ 'message' ], |
151 | 151 | option: 'Minor Barnstar', |
152 | 152 | descr: 'Minor edits are often overlooked, but are essential contributions to Wikipedia. The Minor Barnstar is awarded for making minor edits of the utmost quality.', |
153 | 153 | header: 'A barnstar for you!', |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
157 | 157 | }, |
158 | 158 | 'antispam': { |
159 | | - fields: [ 'notify' ], |
| 159 | + fields: [ 'message' ], |
160 | 160 | option: 'No Spam Barnstar', |
161 | 161 | descr: 'The Anti-Spam Barnstar is awarded to users who do an exceptional job fighting against spam on Wikipedia.', |
162 | 162 | header: 'A barnstar for you!', |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
166 | 166 | }, |
167 | 167 | 'photographers': { |
168 | | - fields: [ 'notify' ], |
| 168 | + fields: [ 'message' ], |
169 | 169 | option: 'Photographer\'s Barnstar', |
170 | 170 | descr: 'The Photographer\'s Barnstar is awarded to those individuals who tirelessly improve the Wikipedia with their photographic skills and contributions.', |
171 | 171 | header: 'A barnstar for you!', |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
175 | 175 | }, |
176 | 176 | 'kindness': { |
177 | | - fields: [ 'notify' ], |
| 177 | + fields: [ 'message' ], |
178 | 178 | option: 'Random Acts of Kindness Barnstar', |
179 | 179 | descr: 'The Random Acts of Kindness Barnstar may be awarded to those that show a pattern of going the extra mile to be nice, without being asked.', |
180 | 180 | header: 'A barnstar for you!', |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
184 | 184 | }, |
185 | 185 | 'reallife': { |
186 | | - fields: [ 'notify' ], |
| 186 | + fields: [ 'message' ], |
187 | 187 | option: 'Real Life Barnstar', |
188 | 188 | descr: 'The Real Life Barnstar is awarded to editors who make contributions both online and offline, by organizing wiki-related real-life events.', |
189 | 189 | header: 'A barnstar for you!', |
— | — | @@ -191,7 +191,7 @@ |
192 | 192 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
193 | 193 | }, |
194 | 194 | 'resilient': { |
195 | | - fields: [ 'notify' ], |
| 195 | + fields: [ 'message' ], |
196 | 196 | option: 'Resilient Barnstar', |
197 | 197 | descr: 'The Resilient Barnstar may be given to any editor who learns and improves from criticisms, never letting mistakes impede their growth as a Wikipedian.', |
198 | 198 | header: 'A barnstar for you!', |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
202 | 202 | }, |
203 | 203 | 'rosetta': { |
204 | | - fields: [ 'notify' ], |
| 204 | + fields: [ 'message' ], |
205 | 205 | option: 'Rosetta Barnstar', |
206 | 206 | descr: 'The Rosetta Barnstar may be given to any editor who exhibits outstanding translation efforts on Wikipedia.', |
207 | 207 | header: 'A barnstar for you!', |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
211 | 211 | }, |
212 | 212 | 'special': { |
213 | | - fields: [ 'notify' ], |
| 213 | + fields: [ 'message' ], |
214 | 214 | option: 'Special Barnstar', |
215 | 215 | descr: 'The Special Barnstar may be awarded to a user as a gesture of appreciation when there is no other barnstar which would be appropriate.', |
216 | 216 | header: 'A barnstar for you!', |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
220 | 220 | }, |
221 | 221 | 'surreal': { |
222 | | - fields: [ 'notify' ], |
| 222 | + fields: [ 'message' ], |
223 | 223 | option: 'Surreal Barnstar', |
224 | 224 | descr: 'The Surreal Barnstar may be awarded to any Wikipedian who adds "special flavor" to the community by acting as a sort of wildcard.', |
225 | 225 | header: 'A barnstar for you!', |
— | — | @@ -227,7 +227,7 @@ |
228 | 228 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
229 | 229 | }, |
230 | 230 | 'teamwork': { |
231 | | - fields: [ 'notify' ], |
| 231 | + fields: [ 'message' ], |
232 | 232 | option: 'Teamwork Barnstar', |
233 | 233 | descr: 'The Teamwork Barnstar may be awarded when several editors work together to improve an article.', |
234 | 234 | header: 'A barnstar for you!', |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
238 | 238 | }, |
239 | 239 | 'technical': { |
240 | | - fields: [ 'notify' ], |
| 240 | + fields: [ 'message' ], |
241 | 241 | option: 'Technical Barnstar', |
242 | 242 | descr: 'The Technical Barnstar may be awarded to anyone who has enhanced Wikipedia through their technical work (programming, bot building, link repair, etc.).', |
243 | 243 | header: 'A barnstar for you!', |
— | — | @@ -245,7 +245,7 @@ |
246 | 246 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
247 | 247 | }, |
248 | 248 | 'tireless': { |
249 | | - fields: [ 'notify' ], |
| 249 | + fields: [ 'message' ], |
250 | 250 | option: 'Tireless Contributor Barnstar', |
251 | 251 | descr: 'The Tireless Contributor Barnstar is awarded to especially tireless Wikipedians who contribute an especially large body of work without sacrificing quality.', |
252 | 252 | header: 'A barnstar for you!', |
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
256 | 256 | }, |
257 | 257 | 'writers': { |
258 | | - fields: [ 'notify' ], |
| 258 | + fields: [ 'message' ], |
259 | 259 | option: 'Writer\'s Barnstar', |
260 | 260 | descr: 'The Writer\'s Barnstar may be awarded to any user who has written a large number of articles or has contributed a large number of edits.', |
261 | 261 | header: 'A barnstar for you!', |
— | — | @@ -267,7 +267,7 @@ |
268 | 268 | }, |
269 | 269 | 'beer': { |
270 | 270 | name: 'Beer', |
271 | | - fields: [ 'header' ], |
| 271 | + fields: [ 'header', 'message' ], |
272 | 272 | header: 'A beer for you!', |
273 | 273 | text: '[[$3|left|150px]]\n$1\n\n~~~~\n<br style="clear: both"/>', // custom text |
274 | 274 | gallery: { |
— | — | @@ -277,9 +277,28 @@ |
278 | 278 | }, |
279 | 279 | icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-beer.png' // icon for left-side menu |
280 | 280 | }, |
| 281 | + 'food': { |
| 282 | + name: 'Food', // name of the type (appears in the types menu) |
| 283 | + select: 'Select food:', // subtype select label |
| 284 | + subtypes: { // some different subtypes |
| 285 | + // note that when not using subtypes you should use these subtype options |
| 286 | + // for the top-level type |
| 287 | + 'cookie': { |
| 288 | + text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
| 289 | +|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
| 290 | +|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
| 291 | +|}', |
| 292 | + fields: [ 'header', 'message' ], // fields to ask for in form |
| 293 | + option: 'Cookie', // option listed in the select list |
| 294 | + header: 'A cookie for you!', // header that appears at the top of the talk page post (optional) |
| 295 | + image: 'Choco_chip_cookie.png' // image for the award |
| 296 | + } |
| 297 | + }, |
| 298 | + icon: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-cookie.png' // icon for left-side menu |
| 299 | + }, |
281 | 300 | 'kitten': { |
282 | 301 | name: 'Kitten', |
283 | | - fields: [ 'header' ], |
| 302 | + fields: [ 'header', 'message' ], |
284 | 303 | header: 'A kitten for you!', |
285 | 304 | text: '[[$3|left|150px]]\n$1\n\n~~~~\n<br style="clear: both"/>', // $3 is the image filename |
286 | 305 | gallery: { |
— | — | @@ -292,7 +311,7 @@ |
293 | 312 | // default type, nice to leave this one in place when adding other types |
294 | 313 | 'makeyourown': { |
295 | 314 | name: mw.msg( 'wikilove-type-makeyourown' ), |
296 | | - fields: [ 'header', 'title', 'image', 'notify' ], |
| 315 | + fields: [ 'header', 'title', 'image', 'message' ], |
297 | 316 | imageSize: '150px', |
298 | 317 | icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-create.png' // icon for left-side menu |
299 | 318 | } |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | <label for="mw-wikilove-subtype" id="mw-wikilove-subtype-label"></label>\ |
68 | 68 | <select id="mw-wikilove-subtype"></select>\ |
69 | 69 | <div id="mw-wikilove-subtype-description"></div>\ |
70 | | - <label id="mw-wikilove-gallery-label"><html:msg key="wikilove-image"/></label>\ |
| 70 | + <label id="mw-wikilove-gallery-label"><html:msg key="wikilove-select-image"/></label>\ |
71 | 71 | <div id="mw-wikilove-gallery">\ |
72 | 72 | <div id="mw-wikilove-gallery-error">\ |
73 | 73 | <html:msg key="wikilove-err-gallery"/>\ |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | <label for="mw-wikilove-image" id="mw-wikilove-image-label"><html:msg key="wikilove-image"/></label>\ |
84 | 84 | <input type="text" class="text" id="mw-wikilove-image"/>\ |
85 | 85 | <label for="mw-wikilove-message" id="mw-wikilove-message-label"><html:msg key="wikilove-enter-message"/></label>\ |
86 | | - <span class="mw-wikilove-note"><html:msg key="wikilove-omit-sig"/></span>\ |
| 86 | + <span class="mw-wikilove-note" id="mw-wikilove-message-note"><html:msg key="wikilove-omit-sig"/></span>\ |
87 | 87 | <textarea id="mw-wikilove-message"></textarea>\ |
88 | 88 | <div id="mw-wikilove-notify">\ |
89 | 89 | <input type="checkbox" id="mw-wikilove-notify-checkbox" name="notify"/>\ |
— | — | @@ -210,21 +210,21 @@ |
211 | 211 | $( '#mw-wikilove-subtype-description').hide(); |
212 | 212 | } |
213 | 213 | |
214 | | - // show or hide header label and textbox depending on whether a predefined header exists |
| 214 | + // show or hide header label and textbox depending on fields configuration |
215 | 215 | $( '#mw-wikilove-header, #mw-wikilove-header-label' ) |
216 | 216 | .toggle( $.inArray( 'header', currentTypeOrSubtype.fields ) >= 0 ); |
217 | 217 | |
218 | 218 | // set the new text for the header textbox |
219 | 219 | $( '#mw-wikilove-header' ).val( currentTypeOrSubtype.header || '' ); |
220 | 220 | |
221 | | - // show or hide title label and textbox depending on whether a predefined title exists |
| 221 | + // show or hide title label and textbox depending on fields configuration |
222 | 222 | $( '#mw-wikilove-title, #mw-wikilove-title-label') |
223 | 223 | .toggle( $.inArray( 'title', currentTypeOrSubtype.fields ) >= 0 ); |
224 | 224 | |
225 | 225 | // set the new text for the title textbox |
226 | 226 | $( '#mw-wikilove-title' ).val( currentTypeOrSubtype.title || '' ); |
227 | 227 | |
228 | | - // show or hide image label and textbox depending on whether a predefined image exists |
| 228 | + // show or hide image label and textbox depending on fields configuration |
229 | 229 | $( '#mw-wikilove-image, #mw-wikilove-image-label') |
230 | 230 | .toggle( $.inArray( 'image', currentTypeOrSubtype.fields ) >= 0 ); |
231 | 231 | |
— | — | @@ -241,6 +241,13 @@ |
242 | 242 | $( '#mw-wikilove-gallery, #mw-wikilove-gallery-label' ).hide(); |
243 | 243 | } |
244 | 244 | |
| 245 | + // show or hide message label and textbox depending on fields configuration |
| 246 | + $( '#mw-wikilove-message, #mw-wikilove-message-label, #mw-wikilove-message-note' ) |
| 247 | + .toggle( $.inArray( 'message', currentTypeOrSubtype.fields ) >= 0 ); |
| 248 | + |
| 249 | + // set the new text for the message textbox |
| 250 | + $( '#mw-wikilove-message' ).val( currentTypeOrSubtype.message || '' ); |
| 251 | + |
245 | 252 | if( $.inArray( 'notify', currentTypeOrSubtype.fields ) >= 0 && emailable ) { |
246 | 253 | $( '#mw-wikilove-notify' ).show(); |
247 | 254 | } else { |
Index: trunk/extensions/WikiLove/WikiLove.i18n.php |
— | — | @@ -24,9 +24,10 @@ |
25 | 25 | 'wikilove-get-started-list-2' => 'Add details to your WikiLove', |
26 | 26 | 'wikilove-get-started-list-3' => 'Send your WikiLove!', |
27 | 27 | 'wikilove-add-details' => 'Add details', |
28 | | - 'wikilove-image' => 'Image:', |
29 | | - 'wikilove-header' => 'Header:', |
30 | | - 'wikilove-title' => 'Title:', |
| 28 | + 'wikilove-image' => 'Enter an image:', |
| 29 | + 'wikilove-select-image' => 'Select an image:', |
| 30 | + 'wikilove-header' => 'Enter a header:', |
| 31 | + 'wikilove-title' => 'Enter a title:', |
31 | 32 | 'wikilove-enter-message' => 'Enter a message:', |
32 | 33 | 'wikilove-omit-sig' => '(without a signature)', |
33 | 34 | 'wikilove-button-preview' => 'Preview', |