http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89055
Revision: 89055
Author: janpaul123
Date: 2011-05-28 18:42:11 +0000 (Sat, 28 May 2011)
Log Message:
-----------
Some minor things
Modified Paths:
--------------
trunk/extensions/WikiLove/WikiLove.api.php
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
Modified: trunk/extensions/WikiLove/WikiLove.api.php
===================================================================
--- trunk/extensions/WikiLove/WikiLove.api.php 2011-05-28 18:33:01 UTC (rev
89054)
+++ trunk/extensions/WikiLove/WikiLove.api.php 2011-05-28 18:42:11 UTC (rev
89055)
@@ -123,6 +123,7 @@
'message' => 'Actual message the user has entered, for
logging purposes',
'token' => 'Edit token. You can get one of these
through prop=info',
'subject' => 'Subject header of the new section',
+ 'email' => 'Content of the optional e-mail message to
send to the user',
'type' => array( 'Type of WikiLove (for statistics);
this corresponds with a type',
'selected in the left menu, and
optionally a subtype after that',
'(e.g. "barnstar-normal" or "kitten")',
Modified: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
===================================================================
--- trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
2011-05-28 18:33:01 UTC (rev 89054)
+++ trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
2011-05-28 18:42:11 UTC (rev 89055)
@@ -281,12 +281,7 @@
$.wikiLove.showError( 'wikilove-err-sig' ); return
false;
}
- var text = $.wikiLove.prepareMsg(
- currentTypeOrSubtype.text || options.defaultText,
- currentTypeOrSubtype.imageSize,
- currentTypeOrSubtype.backgroundColor,
- currentTypeOrSubtype.borderColor
- );
+ var text = $.wikiLove.prepareMsg( currentTypeOrSubtype.text ||
options.defaultText );
$.wikiLove.doPreview( '==' + $( '#mw-wikilove-header' ).val() +
"==\n" + text );
previewData = {
@@ -316,20 +311,14 @@
* $6: border color
* $7: username of the recipient
*/
- prepareMsg: function( msg, imageSize, backgroundColor, borderColor ) {
+ prepareMsg: function( msg ) {
msg = msg.replace( '$1', $( '#mw-wikilove-message' ).val() );
// replace the raw message
msg = msg.replace( '$2', $( '#mw-wikilove-title' ).val() ); //
replace the title
msg = msg.replace( '$3', $( '#mw-wikilove-image' ).val() ); //
replace the image
-
- var myImageSize = imageSize || options.defaultImageSize;
- var myBackgroundColor = backgroundColor ||
options.defaultBackgroundColor;
- var myBorderColor = borderColor || options.defaultBorderColor;
-
- msg = msg.replace( '$4', myImageSize ); // replace the image
size
- msg = msg.replace( '$5', myBackgroundColor ); // replace the
background color
- msg = msg.replace( '$6', myBorderColor ); // replace the border
color
-
+ msg = msg.replace( '$4', currentTypeOrSubtype.imageSize ||
options.defaultImageSize ); // replace the image size
+ msg = msg.replace( '$5', currentTypeOrSubtype.backgroundColor
|| options.defaultBackgroundColor ); // replace the background color
+ msg = msg.replace( '$6', currentTypeOrSubtype.borderColor ||
options.defaultBorderColor ); // replace the border color
msg = msg.replace( '$7', mw.config.get( 'wikilove-recipient' )
); // replace the username we're sending to
return msg;
Modified:
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
===================================================================
---
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
2011-05-28 18:33:01 UTC (rev 89054)
+++
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
2011-05-28 18:42:11 UTC (rev 89055)
@@ -263,7 +263,7 @@
email: 'Hello $7!\n\nI just awarded you
a barnstar.'
}
},
- 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
+ icon: mw.config.get( 'wgExtensionAssetsPath' ) +
'/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-barnstar.png'
// icon for left-side menu
},
'beer': {
name: 'Beer',
@@ -275,7 +275,7 @@
width: 145,
number: 3
},
- 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
+ icon: mw.config.get( 'wgExtensionAssetsPath' ) +
'/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-beer.png'
// icon for left-side menu
},
'kitten': {
name: 'Kitten',
@@ -287,14 +287,14 @@
width: 145,
number: 3
},
- 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
+ icon: mw.config.get( 'wgExtensionAssetsPath' ) +
'/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-kitten.png'
// icon for left-side menu
},
// default type, nice to leave this one in place when adding
other types
'makeyourown': {
name: mw.msg( 'wikilove-type-makeyourown' ),
fields: [ 'header', 'title', 'image', 'notify' ],
imageSize: '150px',
- 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
+ icon: mw.config.get( 'wgExtensionAssetsPath' ) +
'/extensions/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-create.png'
// icon for left-side menu
}
}
}; };
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs