Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js |
— | — | @@ -241,14 +241,14 @@ |
242 | 242 | 'food': { |
243 | 243 | name: 'Food and drink', // name of the type (appears in the types menu) |
244 | 244 | select: 'Select food or drink item:', // subtype select label |
| 245 | + text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
| 246 | +|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
| 247 | +|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
| 248 | +|}', // custom text |
245 | 249 | subtypes: { // some different subtypes |
246 | 250 | // note that when not using subtypes you should use these subtype options |
247 | 251 | // for the top-level type |
248 | 252 | 'baklava': { |
249 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
250 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
251 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
252 | | -|}', // custom text |
253 | 253 | fields: [ 'header', 'message' ], // fields to ask for in form |
254 | 254 | option: 'Baklava', // option listed in the select list |
255 | 255 | header: 'Some baklava for you!', // header that appears at the top of the talk page post (optional) |
— | — | @@ -256,10 +256,6 @@ |
257 | 257 | imageSize: '135px' // size to display image |
258 | 258 | }, |
259 | 259 | 'beer': { |
260 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
261 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
262 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
263 | | -|}', |
264 | 260 | fields: [ 'header', 'message' ], |
265 | 261 | option: 'Beer', |
266 | 262 | header: 'A beer for you!', |
— | — | @@ -267,10 +263,6 @@ |
268 | 264 | imageSize: '70px' |
269 | 265 | }, |
270 | 266 | 'brownie': { |
271 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
272 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
273 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
274 | | -|}', |
275 | 267 | fields: [ 'header', 'message' ], |
276 | 268 | option: 'Brownie', |
277 | 269 | header: 'A brownie for you!', |
— | — | @@ -278,10 +270,6 @@ |
279 | 271 | imageSize: '120px' |
280 | 272 | }, |
281 | 273 | 'bubble tea': { |
282 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
283 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
284 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
285 | | -|}', // custom text |
286 | 274 | fields: [ 'header', 'message' ], |
287 | 275 | option: 'Bubble tea', |
288 | 276 | header: 'Some bubble tea for you!', |
— | — | @@ -289,10 +277,6 @@ |
290 | 278 | imageSize: '65px' |
291 | 279 | }, |
292 | 280 | 'cheeseburger': { |
293 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
294 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
295 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
296 | | -|}', |
297 | 281 | fields: [ 'header', 'message' ], |
298 | 282 | option: 'Cheeseburger', |
299 | 283 | header: 'A cheeseburger for you!', |
— | — | @@ -300,10 +284,6 @@ |
301 | 285 | imageSize: '120px' |
302 | 286 | }, |
303 | 287 | 'cookie': { |
304 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
305 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
306 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
307 | | -|}', |
308 | 288 | fields: [ 'header', 'message' ], |
309 | 289 | option: 'Cookie', |
310 | 290 | header: 'A cookie for you!', |
— | — | @@ -311,10 +291,6 @@ |
312 | 292 | imageSize: '120px' |
313 | 293 | }, |
314 | 294 | 'coffee': { |
315 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
316 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
317 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
318 | | -|}', |
319 | 295 | fields: [ 'header', 'message' ], |
320 | 296 | option: 'Cup of coffee', |
321 | 297 | header: 'A cup of coffee for you!', |
— | — | @@ -322,10 +298,6 @@ |
323 | 299 | imageSize: '120px' |
324 | 300 | }, |
325 | 301 | 'tea': { |
326 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
327 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
328 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
329 | | -|}', |
330 | 302 | fields: [ 'header', 'message' ], |
331 | 303 | option: 'Cup of tea', |
332 | 304 | header: 'A cup of tea for you!', |
— | — | @@ -333,10 +305,6 @@ |
334 | 306 | imageSize: '120px' |
335 | 307 | }, |
336 | 308 | 'cupcake': { |
337 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
338 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
339 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
340 | | -|}', |
341 | 309 | fields: [ 'header', 'message' ], |
342 | 310 | option: 'Cupcake', |
343 | 311 | header: 'A cupcake for you!', |
— | — | @@ -344,10 +312,6 @@ |
345 | 313 | imageSize: '120px' |
346 | 314 | }, |
347 | 315 | 'pie': { |
348 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
349 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
350 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
351 | | -|}', |
352 | 316 | fields: [ 'header', 'message' ], |
353 | 317 | option: 'Pie', |
354 | 318 | header: 'A pie for you!', |
— | — | @@ -355,10 +319,6 @@ |
356 | 320 | imageSize: '120px' |
357 | 321 | }, |
358 | 322 | 'stroopwafels': { |
359 | | - text: '{| style="background-color: $5; border: 1px solid $6;"\n\ |
360 | | -|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\ |
361 | | -|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\ |
362 | | -|}', |
363 | 323 | fields: [ 'header', 'message' ], |
364 | 324 | option: 'Stroopwafels', |
365 | 325 | header: 'Some stroopwafels for you!', |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -411,7 +411,7 @@ |
412 | 412 | * After the form is validated, perform preview. |
413 | 413 | */ |
414 | 414 | submitPreview: function() { |
415 | | - var text = $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.defaultText ); |
| 415 | + var text = $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.types[currentTypeId].text || options.defaultText ); |
416 | 416 | $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + "==\n" + text ); |
417 | 417 | }, |
418 | 418 | |
— | — | @@ -544,7 +544,7 @@ |
545 | 545 | |
546 | 546 | var submitData = { |
547 | 547 | 'header': $( '#mw-wikilove-header' ).val(), |
548 | | - 'text': $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.defaultText ), |
| 548 | + 'text': $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.types[currentTypeId].text || options.defaultText ), |
549 | 549 | 'message': $( '#mw-wikilove-message' ).val(), |
550 | 550 | 'type': currentTypeId |
551 | 551 | + (currentSubtypeId !== null ? '-' + currentSubtypeId : '') |