http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90567

Revision: 90567
Author:   kaldari
Date:     2011-06-22 00:55:27 +0000 (Wed, 22 Jun 2011)
Log Message:
-----------
making message field configurable in preparation for welcome templates, 
disabling email for barnstars for now (per Howie and Alolita), making label 
verbiage consistant

Modified Paths:
--------------
    trunk/extensions/WikiLove/WikiLove.i18n.php
    trunk/extensions/WikiLove/WikiLove.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.i18n.php
===================================================================
--- trunk/extensions/WikiLove/WikiLove.i18n.php 2011-06-22 00:44:39 UTC (rev 
90566)
+++ trunk/extensions/WikiLove/WikiLove.i18n.php 2011-06-22 00:55:27 UTC (rev 
90567)
@@ -24,9 +24,10 @@
        'wikilove-get-started-list-2' => 'Add details to your WikiLove',
        'wikilove-get-started-list-3' => 'Send your WikiLove!',
        'wikilove-add-details' => 'Add details',
-       'wikilove-image' => 'Image:',
-       'wikilove-header' => 'Header:',
-       'wikilove-title' => 'Title:',
+       'wikilove-image' => 'Enter an image:',
+       'wikilove-select-image' => 'Select an image:',
+       'wikilove-header' => 'Enter a header:',
+       'wikilove-title' => 'Enter a title:',
        'wikilove-enter-message' => 'Enter a message:',
        'wikilove-omit-sig' => '(without a signature)',
        'wikilove-button-preview' => 'Preview',

Modified: trunk/extensions/WikiLove/WikiLove.php
===================================================================
--- trunk/extensions/WikiLove/WikiLove.php      2011-06-22 00:44:39 UTC (rev 
90566)
+++ trunk/extensions/WikiLove/WikiLove.php      2011-06-22 00:55:27 UTC (rev 
90567)
@@ -98,6 +98,7 @@
                        'wikilove-get-started-list-3',
                        'wikilove-add-details',
                        'wikilove-image',
+                       'wikilove-select-image',
                        'wikilove-header',
                        'wikilove-title',
                        'wikilove-enter-message',

Modified: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js
===================================================================
--- trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js 
2011-06-22 00:44:39 UTC (rev 90566)
+++ trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js 
2011-06-22 00:55:27 UTC (rev 90567)
@@ -66,7 +66,7 @@
                <label for="mw-wikilove-subtype" 
id="mw-wikilove-subtype-label"></label>\
                <select id="mw-wikilove-subtype"></select>\
                <div id="mw-wikilove-subtype-description"></div>\
-               <label id="mw-wikilove-gallery-label"><html:msg 
key="wikilove-image"/></label>\
+               <label id="mw-wikilove-gallery-label"><html:msg 
key="wikilove-select-image"/></label>\
                <div id="mw-wikilove-gallery">\
                        <div id="mw-wikilove-gallery-error">\
                                <html:msg key="wikilove-err-gallery"/>\
@@ -82,7 +82,7 @@
                <label for="mw-wikilove-image" 
id="mw-wikilove-image-label"><html:msg key="wikilove-image"/></label>\
                <input type="text" class="text" id="mw-wikilove-image"/>\
                <label for="mw-wikilove-message" 
id="mw-wikilove-message-label"><html:msg key="wikilove-enter-message"/></label>\
-               <span class="mw-wikilove-note"><html:msg 
key="wikilove-omit-sig"/></span>\
+               <span class="mw-wikilove-note" 
id="mw-wikilove-message-note"><html:msg key="wikilove-omit-sig"/></span>\
                <textarea id="mw-wikilove-message"></textarea>\
                <div id="mw-wikilove-notify">\
                        <input type="checkbox" id="mw-wikilove-notify-checkbox" 
name="notify"/>\
@@ -210,21 +210,21 @@
                        $( '#mw-wikilove-subtype-description').hide();
                }
                
-               // show or hide header label and textbox depending on whether a 
predefined header exists
+               // show or hide header label and textbox depending on fields 
configuration
                $( '#mw-wikilove-header, #mw-wikilove-header-label' )
                        .toggle( $.inArray( 'header', 
currentTypeOrSubtype.fields ) >= 0 );
                
                // set the new text for the header textbox
                $( '#mw-wikilove-header' ).val( currentTypeOrSubtype.header || 
'' );
                
-               // show or hide title label and textbox depending on whether a 
predefined title exists
+               // show or hide title label and textbox depending on fields 
configuration
                $( '#mw-wikilove-title, #mw-wikilove-title-label')
                        .toggle( $.inArray( 'title', 
currentTypeOrSubtype.fields ) >= 0 );
                
                // set the new text for the title textbox
                $( '#mw-wikilove-title' ).val( currentTypeOrSubtype.title || '' 
);
                
-               // show or hide image label and textbox depending on whether a 
predefined image exists
+               // show or hide image label and textbox depending on fields 
configuration
                $( '#mw-wikilove-image, #mw-wikilove-image-label')
                        .toggle( $.inArray( 'image', 
currentTypeOrSubtype.fields ) >= 0 );
                
@@ -241,6 +241,13 @@
                        $( '#mw-wikilove-gallery, #mw-wikilove-gallery-label' 
).hide();
                }
                
+               // show or hide message label and textbox depending on fields 
configuration
+               $( '#mw-wikilove-message, #mw-wikilove-message-label, 
#mw-wikilove-message-note' )
+                       .toggle( $.inArray( 'message', 
currentTypeOrSubtype.fields ) >= 0 );
+                       
+               // set the new text for the message textbox
+               $( '#mw-wikilove-message' ).val( currentTypeOrSubtype.message 
|| '' );
+               
                if( $.inArray( 'notify', currentTypeOrSubtype.fields ) >= 0 && 
emailable ) {
                        $( '#mw-wikilove-notify' ).show();
                } else {

Modified: 
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js
===================================================================
--- 
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js   
    2011-06-22 00:44:39 UTC (rev 90566)
+++ 
trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.defaultOptions.js   
    2011-06-22 00:55:27 UTC (rev 90567)
@@ -20,7 +20,7 @@
                                // note that when not using subtypes you should 
use these subtype options
                                // for the top-level type
                                'original': {
-                                       fields: [ 'notify' ], // fields to ask 
for in form
+                                       fields: [ 'message' ], // fields to ask 
for in form
                                        option: 'Original Barnstar', // option 
listed in the select list
                                        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
                                        header: 'A barnstar for you!', // 
header that appears at the top of the talk page post (optional)
@@ -29,7 +29,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.' // message to use in email notification; $7 is replaced by the 
recipient's username
                                },
                                'admins': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Admin\'s Barnstar',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -38,7 +38,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'antivandalism': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Anti-Vandalism Barnstar',
                                        descr: 'The Anti-Vandalism Barnstar may 
be awarded to those who show great contributions to protecting and reverting 
attacks of vandalism on Wikipedia.',
                                        header: 'A barnstar for you!',
@@ -47,7 +47,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'diligence': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Barnstar of Diligence',
                                        descr: 'The Barnstar of Diligence may 
be awarded in recognition of a combination of extraordinary scrutiny, precision 
and community service.',
                                        header: 'A barnstar for you!',
@@ -56,7 +56,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'diplomacy': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Barnstar of Diplomacy',
                                        descr: 'The Barnstar of Diplomacy is 
awarded to users who have helped to resolve, peacefully, conflicts on 
Wikipedia.',
                                        header: 'A barnstar for you!',
@@ -65,7 +65,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'goodhumor': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Barnstar of Good Humor',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -74,7 +74,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'brilliant': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Brilliant Idea Barnstar',
                                        descr: 'The Brilliant Idea Barnstar may 
be awarded to a user who figures out an elegant solution to a particularly 
difficult problem.',
                                        header: 'A barnstar for you!',
@@ -83,7 +83,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'citation': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Citation Barnstar',
                                        descr: 'The Citation Barnstar is 
awarded to users who provide references and in-line citations to previously 
unsourced articles.',
                                        header: 'A barnstar for you!',
@@ -92,7 +92,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'civility': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Civility Barnstar',
                                        descr: 'The Civility Barnstar may be 
awarded to any user who excels at maintaining civility in the midst of 
contentious situations.',
                                        header: 'A barnstar for you!',
@@ -101,7 +101,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'copyeditor': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Copyeditor\'s Barnstar',
                                        descr: 'The Copyeditor\'s Barnstar is 
awarded for excellence in correcting spelling, grammar, punctuation, and style 
issues.',
                                        header: 'A barnstar for you!',
@@ -110,7 +110,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'defender': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Defender of the Wiki Barnstar',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -119,7 +119,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'editors': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Editor\'s Barnstar',
                                        descr: 'The Editor\'s Barnstar is 
awarded to individuals who display particularly fine decisions in general 
editing.',
                                        header: 'A barnstar for you!',
@@ -128,7 +128,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'designers': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Graphic Designer\'s Barnstar',
                                        descr: 'The Graphic Designer\'s 
Barnstar may be awarded to those who work tirelessly to provide Wikipedia with 
free, high-quality graphics.',
                                        header: 'A barnstar for you!',
@@ -137,7 +137,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'half': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Half Barnstar',
                                        descr: 'The Half Barnstar is awarded 
for excellence in cooperation, especially for productive editing with someone 
who holds an opposing viewpoint.',
                                        header: 'A barnstar for you!',
@@ -146,7 +146,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'minor': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Minor Barnstar',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -155,7 +155,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'antispam': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'No Spam Barnstar',
                                        descr: 'The Anti-Spam Barnstar is 
awarded to users who do an exceptional job fighting against spam on Wikipedia.',
                                        header: 'A barnstar for you!',
@@ -164,7 +164,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'photographers': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Photographer\'s Barnstar',
                                        descr: 'The Photographer\'s Barnstar is 
awarded to those individuals who tirelessly improve the Wikipedia with their 
photographic skills and contributions.',
                                        header: 'A barnstar for you!',
@@ -173,7 +173,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'kindness': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Random Acts of Kindness 
Barnstar',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -182,7 +182,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'reallife': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Real Life Barnstar',
                                        descr: 'The Real Life Barnstar is 
awarded to editors who make contributions both online and offline, by 
organizing wiki-related real-life events.',
                                        header: 'A barnstar for you!',
@@ -191,7 +191,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'resilient': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Resilient Barnstar',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -200,7 +200,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'rosetta': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Rosetta Barnstar',
                                        descr: 'The Rosetta Barnstar may be 
given to any editor who exhibits outstanding translation efforts on Wikipedia.',
                                        header: 'A barnstar for you!',
@@ -209,7 +209,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'special': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Special Barnstar',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -218,7 +218,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'surreal': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Surreal Barnstar',
                                        descr: 'The Surreal Barnstar may be 
awarded to any Wikipedian who adds "special flavor" to the community by acting 
as a sort of wildcard.',
                                        header: 'A barnstar for you!',
@@ -227,7 +227,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'teamwork': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Teamwork Barnstar',
                                        descr: 'The Teamwork Barnstar may be 
awarded when several editors work together to improve an article.',
                                        header: 'A barnstar for you!',
@@ -236,7 +236,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'technical': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Technical Barnstar',
                                        descr: 'The Technical Barnstar may be 
awarded to anyone who has enhanced Wikipedia through their technical work 
(programming, bot building, link repair, etc.).',
                                        header: 'A barnstar for you!',
@@ -245,7 +245,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'tireless': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Tireless Contributor Barnstar',
                                        descr: 'The Tireless Contributor 
Barnstar is awarded to especially tireless Wikipedians who contribute an 
especially large body of work without sacrificing quality.',
                                        header: 'A barnstar for you!',
@@ -254,7 +254,7 @@
                                        email: 'Hello $7!\n\nI just awarded you 
a barnstar.'
                                },
                                'writers': {
-                                       fields: [ 'notify' ],
+                                       fields: [ 'message' ],
                                        option: 'Writer\'s Barnstar',
                                        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.',
                                        header: 'A barnstar for you!',
@@ -267,7 +267,7 @@
                },
                'beer': {
                        name: 'Beer',
-                       fields: [ 'header' ],
+                       fields: [ 'header', 'message' ],
                        header: 'A beer for you!',
                        text: '[[$3|left|150px]]\n$1\n\n~~~~\n<br style="clear: 
both"/>', // custom text
                        gallery: {
@@ -277,9 +277,28 @@
                        },
                        icon: mw.config.get( 'wgExtensionAssetsPath' ) + 
'/WikiLove/modules/ext.wikiLove/images/icons/wikilove-icon-beer.png' // icon 
for left-side menu
                },
+               'food': {
+                       name: 'Food', // name of the type (appears in the types 
menu)
+                       select: 'Select food:', // subtype select label
+                       subtypes: { // some different subtypes
+                               // note that when not using subtypes you should 
use these subtype options
+                               // for the top-level type
+                               'cookie': {
+                                       text: '{| style="background-color: $5; 
border: 1px solid $6;"\n\
+|style="vertical-align: middle; padding: 5px;" | [[$3|$4]]\n\
+|style="vertical-align: middle; padding: 3px;" | $1 ~~~~\n\
+|}',
+                                       fields: [ 'header', 'message' ], // 
fields to ask for in form
+                                       option: 'Cookie', // option listed in 
the select list
+                                       header: 'A cookie for you!', // header 
that appears at the top of the talk page post (optional)
+                                       image: 'Choco_chip_cookie.png' // image 
for the award
+                               }
+                       },
+                       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
+               },
                'kitten': {
                        name: 'Kitten',
-                       fields: [ 'header' ],
+                       fields: [ 'header', 'message' ],
                        header: 'A kitten for you!',
                        text: '[[$3|left|150px]]\n$1\n\n~~~~\n<br style="clear: 
both"/>', // $3 is the image filename
                        gallery: {
@@ -292,7 +311,7 @@
                // 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' ],
+                       fields: [ 'header', 'title', 'image', 'message' ],
                        imageSize: '150px',
                        icon: mw.config.get( 'wgExtensionAssetsPath' ) + 
'/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

Reply via email to