MediaWiki:WikiLove.js: Difference between revisions
Jump to navigation
Jump to search
(←Created page with '→* * Basic documentation on configuration: * https://www.mediawiki.org/wiki/Extension:WikiLove * * This script extends the default configuration in the following way: * - Use MediaWiki messages directly where possible. * - In headings, it's a bad idea to use those mw-messages because this is confusing. * - Delete barnstars that are not required at Commons.: →global jQuery:false: →jshint curly:false: // jshint valid //<nowiki> ( function...') |
|||
| Line 186: | Line 186: | ||
}( jQuery ) ); | }( jQuery ) ); | ||
| + | |||
| + | // Adding falafel to food options | ||
| + | $.wikiLoveOptions.types.food.subtypes.falafel = { | ||
| + | fields: [ 'header', 'message' ], // fields to ask for in form | ||
| + | option: 'Falafel', // option listed in the select list | ||
| + | descr: 'Falafel is a popular Middle Eastern street food made from ground chickpeas or fava beans and topped with salads, vegetables, and sauces. It is typically served in a pocket of pita bread.', | ||
| + | header: 'Some falafel for you!', // header that appears at the top of the talk page post (optional) | ||
| + | image: 'Falafel award.png', // image for the item | ||
| + | imageSize: '120px' // size to display image (optional) | ||
| + | }; | ||
| + | |||
| + | // Adding more kitten images ^-.-^ | ||
| + | $.wikiLoveOptions.types.kitten.gallery.imageList = ['Cucciolo gatto Bibo.jpg', 'Kitten (06) by Ron.jpg', 'Kitten-stare.jpg', 'Red Kitten 01.jpg', 'Kitten in a helmet.jpg', 'Cute grey kitten.jpg', 'Iris cat.jpg', 'Young cats.jpg', 'Youngkitten.JPG']; | ||
| + | |||
| + | // Adding toast sandwich to food options | ||
| + | $.wikiLoveOptions.types.food.subtypes.toastsandwich = { | ||
| + | fields: [ 'header', 'message' ], | ||
| + | option: 'Toast sandwich', | ||
| + | descr: 'Toast sandwiches are made by putting a thin slice of toast between two thin slices of bread with a layer of butter, and adding salt and pepper to taste. Its origins can be traced to the Victorian years.', | ||
| + | header: 'A toast sandwich for you!', | ||
| + | image: 'An image of a toast sandwich, shot from the side.jpg', | ||
| + | imageSize: '120px' | ||
| + | }; | ||
| + | |||
//</nowiki> | //</nowiki> | ||
Latest revision as of 05:58, 7 February 2022
/**
* Basic documentation on configuration:
* https://www.mediawiki.org/wiki/Extension:WikiLove
*
* This script extends the default configuration in the following way:
* - Use MediaWiki messages directly where possible.
* - In headings, it's a bad idea to use those mw-messages because this is confusing.
* - Delete barnstars that are not required at Commons.
*/
/*global jQuery:false */
/*jshint curly:false */
// jshint valid
//<nowiki>
( function ( $ ) {
'use strict';
$.extend(true, $.wikiLoveOptions, {
types: {
'barnstar': {
// some different subtypes
subtypes: {
// note that when not using subtypes you should use these subtype options for the top-level type
'photographers': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-photographers-title}}'
},
'designers': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-designers-title}}'
},
'copyrightwatch': {
fields: [ 'message' ],
option: 'Copyright Watcher Barnstar',
descr: 'The Copyright Watcher Barnstar may be awarded to those who helped keeping Wikimedia Commons clean from copyright violations.',
header: 'A barnstar for you!',
title: 'The Copyright Watcher Barnstar',
image: 'Control copyright icon.svg'
},
'antivandalism': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-antivandalism-title}}'
},
'antispam': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-antispam-title}}'
},
'admins': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-admins-title}}'
},
'original': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-original-title}}'
},
'teamwork': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-teamwork-title}}'
},
'technical': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-technical-title}}'
},
'tireless': {
fields: [ 'message' ],
option: 'Tireless Contributor Barnstar',
descr: 'The Tireless Contributor Barnstar is awarded to especially tireless Wikimedians who contribute an especially large body of work without sacrificing quality.',
header: 'A barnstar for you!',
title: 'The Tireless Contributor Barnstar',
image: 'Tireless Contributor Barnstar Hires.gif'
},
'diplomacy': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-diplomacy-title}}'
},
'goodhumor': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-goodhumor-title}}'
},
'brilliant': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-brilliant-title}}'
},
'civility': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-civility-title}}'
},
'defender': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-defender-title}}'
},
'half': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-half-title}}'
},
'minor': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-minor-title}}'
},
'kindness': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-kindness-title}}'
},
'reallife': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-reallife-title}}'
},
'resilient': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-resilient-title}}'
},
'rosetta': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-rosetta-title}}'
},
'special': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-special-title}}'
},
'surreal': {
header: 'A barnstar for you!',
title: '{{int:wikilove-barnstar-surreal-title}}'
}
}
},
'food': {
subtypes: {
'baklava': {
header: 'Some baklava for you!'
},
'beer': {
header: 'A beer for you!'
},
'brownie': {
header: 'A brownie for you!'
},
'bubbletea': {
header: 'Some bubble tea for you!'
},
'cheeseburger': {
header: 'A cheeseburger for you!'
},
'cookie': {
header: 'A cookie for you!'
},
'coffee': {
header: 'A cup of coffee for you!'
},
'tea': {
header: 'A cup of tea for you!'
},
'cupcake': {
header: 'A cupcake for you!'
},
'falafel': {
header: 'Some falafel for you!'
},
'pie': {
header: 'A pie for you!'
},
'strawberries': {
header: 'A bowl of strawberries for you!'
},
'stroopwafels': {
header: 'Some stroopwafels for you!'
}
}
},
'kitten': {
header: 'A kitten for you!'
}
}
});
var bst = $.wikiLoveOptions.types.barnstar.subtypes,
del_bst = function (what) {
if (bst[what]) {
delete bst[what];
}
};
del_bst('writers');
del_bst('editors');
del_bst('copyeditor');
del_bst('citation');
}( jQuery ) );
// Adding falafel to food options
$.wikiLoveOptions.types.food.subtypes.falafel = {
fields: [ 'header', 'message' ], // fields to ask for in form
option: 'Falafel', // option listed in the select list
descr: 'Falafel is a popular Middle Eastern street food made from ground chickpeas or fava beans and topped with salads, vegetables, and sauces. It is typically served in a pocket of pita bread.',
header: 'Some falafel for you!', // header that appears at the top of the talk page post (optional)
image: 'Falafel award.png', // image for the item
imageSize: '120px' // size to display image (optional)
};
// Adding more kitten images ^-.-^
$.wikiLoveOptions.types.kitten.gallery.imageList = ['Cucciolo gatto Bibo.jpg', 'Kitten (06) by Ron.jpg', 'Kitten-stare.jpg', 'Red Kitten 01.jpg', 'Kitten in a helmet.jpg', 'Cute grey kitten.jpg', 'Iris cat.jpg', 'Young cats.jpg', 'Youngkitten.JPG'];
// Adding toast sandwich to food options
$.wikiLoveOptions.types.food.subtypes.toastsandwich = {
fields: [ 'header', 'message' ],
option: 'Toast sandwich',
descr: 'Toast sandwiches are made by putting a thin slice of toast between two thin slices of bread with a layer of butter, and adding salt and pepper to taste. Its origins can be traced to the Victorian years.',
header: 'A toast sandwich for you!',
image: 'An image of a toast sandwich, shot from the side.jpg',
imageSize: '120px'
};
//</nowiki>