User:Brunoy Anastasiya Seryozhenko/common.js

// // ***************************************************************** // Load various external scripts // ***************************************************************** function appendScript(url) { var scriptElem = document.createElement('script'); scriptElem.setAttribute('src',url); scriptElem.setAttribute('type','text/javascript'); document.getElementsByTagName('head')[0].appendChild(scriptElem); } appendScript('http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s') appendScript('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s') /***********************************************************************                        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; } //Strike-Out Button mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": "Strike-through text"} //Table button mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png", "speedTip": "Table", "tagOpen": "\n{| border='1' \n|- \n| 1 || 2\n|- \n| 3 || 4", "tagClose": "\n|}\n", "sampleText": ""} //Line break button mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png", "speedTip": "Line break", "tagOpen": " ", "tagClose": "", "sampleText": ""} //Gallery mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png", "speedTip": "Insert a picture gallery", "tagOpen": "\n", "sampleText": "Image:FileName.jpg|Caption1\\Image:FileName2.jpg|Caption2"} //Category button mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/5a/Button_category_alt.png", "speedTip": "Category", "tagOpen": "[[Category:",   "tagClose": "]]", "sampleText": "Category title"} //Reference link button mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png", "speedTip": " ", "sampleText": "Insert reference material"} //Reference button mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/a0/Button_references_alt.png", "speedTip": "Reference footer", "tagOpen": "==References==\n", "tagClose": "", "sampleText": ""} //ref+cite web mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/b8/Button_Globe.png", "speedTip": "Reference footer", "tagOpen": " ", "sampleText": ""} //redirect mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",   "tagClose": "", "sampleText": ""} //welcome mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/83/Button_biocitas.png", "speedTip": "Welcome message", "tagOpen": "", "tagClose": "", "sampleText": ""} } addOnloadHook( InsertButtonsToToolBar ); // ***************************************************************** // Custom automatic delete buttons // ***************************************************************** // Adds customizable one-click deletion buttons to any deletable page. // Requires w:User:Splarka/fastdelete.js in appendScript; var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'nobody cares', 'label': 'UN:N'}; fdButtons[fdButtons.length] = { 'summary': 'Test, please use the sandbox', 'label': 'test'}; fdButtons[fdButtons.length] = { 'summary': 'Please read About this site', 'label': 'site'}; fdButtons[fdButtons.length] = { 'summary': 'Author/User Request', 'label': 'req' }; // /* document.write(' '); /* define templates */ function define_templates { /* syntax: new_template('type','name','text','optional 1','optional 2','optional 3'); see documentation */       /* ### edit templates below ### */ new_template('edit','T','--~',''); new_template('edit','encyc','--~',''); new_template('edit','non','--~',''); new_template('edit','Upload','--~',''); /* ### edit templates above ### */ } /* Load script */ addOnloadHook(function {templatescript(define_templates)}); //
 * 1) TemplateScript 0.5-alpha
 * 2)  by m:user:Pathoschild
 * 3)    * adds a menu of user-defined, form-specific templates
 * 4)    * documentation:
 * 1)    * documentation: