User:Brunoy Anastasiya Seryozhenko/common.js

// ***************************************************************** // Load various external scripts // ***************************************************************** mw.loader.load('//www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript'); mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript');

/***********************************************************************                        EXTRA EDIT BUTTONS // Extra edit page buttons Tools/Editing_tools

// This is based on the original code on Wikipedia:Tools/Editing tools // // The original code was on the project page and needed to be cut and paste to the user's // monobook.js page. However, this caused problems with the quote marks. So I have moved // it to its own page. // // I do not know a lot about Javascript so please do not ask for a complicated change // // See the User:MarkS/Extra edit buttons for changes log // $(function InsertButtonsToToolBar {	d = new Date;	todayISO = d.getFullYear+"-";	if (d.getMonth > 8)		todayISO += (d.getMonth+1)+"-";	else		todayISO += "0"+(d.getMonth+1)+"-";	if (d.getDate > 9)		todayISO += d.getDate;	else		todayISO += "0"+d.getDate;

if(mw.toolbar) { $('#wpTextbox1').wikiEditor('addToToolbar', {			section: 'main',			group: 'format',			tools: {				//Strike-Out Button				'custom-Strike': {					label: 'Strike',					type: 'button',					icon: '//upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png',					action: {						type: 'encapsulate',						options: {							pre: ' ',							post: ' ',							sampleText: 'Strike-through text'						}					}				},

//Table button 'custom-Table': { label: 'Table', type: 'button', icon: '//upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png', action: { type: 'encapsulate', options: { pre: '\n{| border=\'1\' \n|- \n| 1 || 2\n|- \n| 3 || 4', post: '\n|}\n', sampleText: '' }					}				},

//Line break button 'custom-Line break': { label: 'Line break', type: 'button', icon: '//upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png', action: { type: 'encapsulate', options: { pre: ' ',							post: '', sampleText: '' }					}				},

//Gallery 'custom-Insert a picture gallery': { label: 'Insert a picture gallery', type: 'button', icon: '//upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png', action: { type: 'encapsulate', options: { pre: '\n', sampleText: 'Image:FileName.jpg|Caption1\\Image:FileName2.jpg|Caption2' }					}				},

//Category button 'custom-Category': { label: 'Category', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/5/5a/Button_category_alt.png', action: { type: 'encapsulate', options: { pre: '[[Category:',							post: ']]', sampleText: 'Category title' }					}				},

//Reference link button 'custom-ref': { label: ' ', sampleText: 'Insert reference material' }					}				},

//Reference button 'custom-Reference footer': { label: 'Reference footer', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/a/a0/Button_references_alt.png', action: { type: 'encapsulate', options: { pre: '==References==\n', post: '', sampleText: '' }					}				},

//ref+cite web 'custom-Reference footer': { label: 'Reference footer', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/b/b8/Button_Globe.png', action: { type: 'encapsulate', options: { pre: ' ', sampleText: '' }					}				},

//redirect 'custom-Redirect': { label: 'Redirect', type: 'button', icon: '//upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png', action: { type: 'encapsulate', options: { pre: '#REDIRECT ',							post: '', sampleText: '' }					}				},

//welcome 'custom-Welcome message': { label: 'Welcome message', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/8/83/Button_biocitas.png', action: { type: 'encapsulate', options: { pre: '', post: '', sampleText: '' }					}				}			}		});	} }); //

// ***************************************************************** // Custom automatic delete buttons // ***************************************************************** // Adds customizable one-click deletion buttons to any deletable page. // Requires w:User:Splarka/fastdelete.js in appendScript; // var fdButtons = [ {		'summary': 'nobody cares', 'label': 'UN:N' },	{		'summary': 'Test, please use the sandbox', 'label': 'test' },	{		'summary': 'Please read About this site', 'label': 'site' },	{		'summary': 'Author/User Request', 'label': 'req' } ]; //

/** * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. * @see https://meta.wikimedia.org/wiki/TemplateScript * @update-token */ // $.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function {	pathoschild.TemplateScript.add([ { name:'T', template:'--~', editSummary:'' }, { name:'encyc', template:'--~', editSummary:'' }, { name:'non', template:'--~', editSummary:'' }, { name:'Upload', template:'--~', editSummary:'' } ]); }); //