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 importScriptURI('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  addPersonalItem('cleanup', '/wiki/StrategyWiki:Cleanup project/Daily tasks', 'Cleanup', 'preferences');

// Add a button to the search form for searching a category var newSearch = document.createElement('span'); newSearch.className = 'searchButton'; newSearch.innerHTML = 'Category'; newSearch.onclick = function { window.location.href = 'http://strategywiki.org/w/index.php?ns14=1&search='+document.getElementById('searchInput').value.replace(/ /g,'+')+'&title=Special:Search&fulltext=1' }; document.getElementById('searchform').firstChild.insertBefore(newSearch, document.getElementById('searchGoButton').nextSibling); });