Index: trunk/extensions/WikiLove/WikiLove.api.php |
— | — | @@ -123,6 +123,7 @@ |
124 | 124 | 'message' => 'Actual message the user has entered, for logging purposes', |
125 | 125 | 'token' => 'Edit token. You can get one of these through prop=info', |
126 | 126 | 'subject' => 'Subject header of the new section', |
| 127 | + 'email' => 'Content of the optional e-mail message to send to the user', |
127 | 128 | 'type' => array( 'Type of WikiLove (for statistics); this corresponds with a type', |
128 | 129 | 'selected in the left menu, and optionally a subtype after that', |
129 | 130 | '(e.g. "barnstar-normal" or "kitten")', |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js |
— | — | @@ -263,7 +263,7 @@ |
264 | 264 | email: 'Hello $7!\n\nI just awarded you a barnstar.' |
265 | 265 | } |
266 | 266 | }, |
267 | | - icon: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-barnstar.png' // icon for left-side menu |
| 267 | + icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-barnstar.png' // icon for left-side menu |
268 | 268 | }, |
269 | 269 | 'beer': { |
270 | 270 | name: 'Beer', |
— | — | @@ -275,7 +275,7 @@ |
276 | 276 | width: 145, |
277 | 277 | number: 3 |
278 | 278 | }, |
279 | | - icon: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-beer.png' // icon for left-side menu |
| 279 | + icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-beer.png' // icon for left-side menu |
280 | 280 | }, |
281 | 281 | 'kitten': { |
282 | 282 | name: 'Kitten', |
— | — | @@ -287,14 +287,14 @@ |
288 | 288 | width: 145, |
289 | 289 | number: 3 |
290 | 290 | }, |
291 | | - icon: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-kitten.png' // icon for left-side menu |
| 291 | + icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-kitten.png' // icon for left-side menu |
292 | 292 | }, |
293 | 293 | // default type, nice to leave this one in place when adding other types |
294 | 294 | 'makeyourown': { |
295 | 295 | name: mw.msg( 'wikilove-type-makeyourown' ), |
296 | 296 | fields: [ 'header', 'title', 'image', 'notify' ], |
297 | 297 | imageSize: '150px', |
298 | | - icon: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-create.png' // icon for left-side menu |
| 298 | + icon: mw.config.get( 'wgExtensionAssetsPath' ) + '/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-create.png' // icon for left-side menu |
299 | 299 | } |
300 | 300 | } |
301 | 301 | }; }; |
Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -281,12 +281,7 @@ |
282 | 282 | $.wikiLove.showError( 'wikilove-err-sig' ); return false; |
283 | 283 | } |
284 | 284 | |
285 | | - var text = $.wikiLove.prepareMsg( |
286 | | - currentTypeOrSubtype.text || options.defaultText, |
287 | | - currentTypeOrSubtype.imageSize, |
288 | | - currentTypeOrSubtype.backgroundColor, |
289 | | - currentTypeOrSubtype.borderColor |
290 | | - ); |
| 285 | + var text = $.wikiLove.prepareMsg( currentTypeOrSubtype.text || options.defaultText ); |
291 | 286 | |
292 | 287 | $.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() + "==\n" + text ); |
293 | 288 | previewData = { |
— | — | @@ -316,20 +311,14 @@ |
317 | 312 | * $6: border color |
318 | 313 | * $7: username of the recipient |
319 | 314 | */ |
320 | | - prepareMsg: function( msg, imageSize, backgroundColor, borderColor ) { |
| 315 | + prepareMsg: function( msg ) { |
321 | 316 | |
322 | 317 | msg = msg.replace( '$1', $( '#mw-wikilove-message' ).val() ); // replace the raw message |
323 | 318 | msg = msg.replace( '$2', $( '#mw-wikilove-title' ).val() ); // replace the title |
324 | 319 | msg = msg.replace( '$3', $( '#mw-wikilove-image' ).val() ); // replace the image |
325 | | - |
326 | | - var myImageSize = imageSize || options.defaultImageSize; |
327 | | - var myBackgroundColor = backgroundColor || options.defaultBackgroundColor; |
328 | | - var myBorderColor = borderColor || options.defaultBorderColor; |
329 | | - |
330 | | - msg = msg.replace( '$4', myImageSize ); // replace the image size |
331 | | - msg = msg.replace( '$5', myBackgroundColor ); // replace the background color |
332 | | - msg = msg.replace( '$6', myBorderColor ); // replace the border color |
333 | | - |
| 320 | + msg = msg.replace( '$4', currentTypeOrSubtype.imageSize || options.defaultImageSize ); // replace the image size |
| 321 | + msg = msg.replace( '$5', currentTypeOrSubtype.backgroundColor || options.defaultBackgroundColor ); // replace the background color |
| 322 | + msg = msg.replace( '$6', currentTypeOrSubtype.borderColor || options.defaultBorderColor ); // replace the border color |
334 | 323 | msg = msg.replace( '$7', mw.config.get( 'wikilove-recipient' ) ); // replace the username we're sending to |
335 | 324 | |
336 | 325 | return msg; |