http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88963
Revision: 88963
Author: janpaul123
Date: 2011-05-27 10:38:58 +0000 (Fri, 27 May 2011)
Log Message:
-----------
Added a default image that is used when no image is specified
Modified Paths:
--------------
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
Modified: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
===================================================================
--- trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
2011-05-27 09:42:25 UTC (rev 88962)
+++ trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
2011-05-27 10:38:58 UTC (rev 88963)
@@ -266,10 +266,14 @@
$( '#mw-wikilove-preview' ).hide();
$( '#mw-wikilove-dialog' ).find( '.mw-wikilove-error'
).remove();
- if( typeof $.wikiLove.currentTypeOrSubtype.gallery == 'object'
) {
- if ( $( '#mw-wikilove-image' ).val().length <= 0 ) {
+
+ if ( $( '#mw-wikilove-image' ).val().length <= 0 ) {
+ if( typeof $.wikiLove.currentTypeOrSubtype.gallery ==
'object' ) {
$.wikiLove.showError( 'wikilove-err-image' );
return false;
}
+ else {
+ $( '#mw-wikilove-image' ).val(
$.wikiLove.options.defaultImage );
+ }
}
if( $( '#mw-wikilove-header' ).val().length <= 0 ) {
$.wikiLove.showError( 'wikilove-err-header' ); return
false;
Modified:
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
===================================================================
---
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
2011-05-27 09:42:25 UTC (rev 88962)
+++
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
2011-05-27 10:38:58 UTC (rev 88963)
@@ -1,7 +1,7 @@
( function( $ ) {
$.wikiLove.optionsHook = function() { return {
defaultText: '{| style="background-color: $5; border: 1px solid $6;"\n\
-|rowspan="2" style="vertical-align: middle; padding: 5px;" | [[Image:$3|$4]]\n\
+|rowspan="2" style="vertical-align: middle; padding: 5px;" | [[File:$3|$4]]\n\
|style="font-size: x-large; padding: 3px; height: 1.5em;" | \'\'\'$2\'\'\'\n\
|-\n\
|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\
@@ -9,6 +9,7 @@
defaultBackgroundColor: '#fdffe7',
defaultBorderColor: '#fceb92',
defaultImageSize: '100px',
+ defaultImage: 'Emblem-fun.svg',
types: {
// example type, could be removed later (also no i18n)
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs