User:Najzere/common.js

// SKIZZERZ COMMON LIBRARY FUNCTIONS // //  Author: User:Ryan Schmidt //  License: Unstated (CC-BY-SA) //  Description: Add some common scripts, usable in other scripts.

importScript('User:Ryan Schmidt/Scripts/library.js');

// FIND AND REPLACE (modified) // //  Author: User:Zocky @ en.wikipedia.org //  License: (c) 2006, released under GPL //  Desc: Adds a dropdown utility under the edit toolbar for search and replace terms.

importScript('User:Ryan Schmidt/Scripts/SearchBox.js');

// AJAX PATROL V1.1 (modified) // //  Author: User:Ryan Schmidt //  License: Unstated (CC-BY-SA) //  Description: Moves to next diff when you patrol and edit, or removes link if you're on the last one.

var AjaxPatrolAutoNext = true; // set to "true" to turn on, or "false" to turn off importScript('User:Najzere/ajaxpatrol.js');

// URL SOURCE ON UPLOAD // //  Author: User:Najzere //  License: CC-BY-SA 3.0 - http://creativecommons.org/licenses/by-sa/3.0/ //  Description: Adds image source to upload summary when uploading from URL

importScript('User:Najzere/adduploadurl.js');

// ACHIEVEMENTS QUICK-FORMATTING // //  Author: User:Najzere //  License: CC-BY-SA 3.0 - http://creativecommons.org/licenses/by-sa/3.0/ //  Description: Adds a button to the edit toolbar that attempts to format //               copy/paste from xbox360achievements.com into SW achievements table.

importScript('User:Najzere/formatachievements.js');

// LIST SORTER // //  Author: Brian Huisman @ http://my.opera.com/GreyWyvern/blog/show.dml/1671288 //  License: ?? seems to be open //  Description: Alphanumeric sorting of highlighted, multi-line text lists. //               Each list item goes on a separate line with no blank lines in between. //               Then highlight the list and click for ascending or descending sort.

importScript('User:Najzere/listsort.js');

// EDIT COUNTER // //  Author: User:Najzere //  License: CC-BY-SA 3.0 - http://creativecommons.org/licenses/by-sa/3.0/ //  Description: Adds a button to the toolbox that generates a table of your edit counts by namespace.

var editPage = 'Edit count';              // Page in userspace where table is written to var tableClass = 'collapsible collapsed';  // Class for the table var tableStyle = 'width:100%';            // Styles for the table mw.loader.load('http://strategywiki.org/w/index.php?title=User:Najzere/edit_counter.js&action=raw&ctype=text/javascript');

// CUSTOM STUFF ON PAGE LOAD // //  Author: User:Najzere //  License: Public Domain //  Description: Various little things to help with repeated actions

addOnloadHook( function { // Add a button linking to the cleanup project daily tasks at the top of the page  addPortletLink('p-personal', '/wiki/User:Najzere/Cleanup', 'Cleanup', 'p-cleanup', 'Personal cleanup stuff', '9', document.getElementById('pt-preferences'));  // Add links to main page and upload page in navlist  var mainpage = document.createElement('a');  var upload = document.createElement('a');  mainpage.href = '/wiki/Main Page';  mainpage.innerHTML = 'Main Page';  upload.href = '/wiki/Special:Upload';  upload.innerHTML = 'Upload';  var list1 = document.createElement('li');  var list2 = document.createElement('li');  list1.appendChild(mainpage);  list2.appendChild(upload);  document.getElementById('navlist').insertBefore(list2, document.getElementById('navlist').childNodes[0]);  document.getElementById('navlist').insertBefore(list1, document.getElementById('navlist').childNodes[0]); });