From StrategyWiki, the video game walkthrough and strategy guide wiki
Jump to navigation Jump to search
m (minor fixes)
(test worked)
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
// 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)
// FIND AND REPLACE (modified)
//
//
Line 13: Line 5:
//  Desc: Adds a dropdown utility under the edit toolbar for search and replace terms.
//  Desc: Adds a dropdown utility under the edit toolbar for search and replace terms.


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


// AJAX PATROL V1.1 (modified)
// AJAX PATROL V1.1 (modified)
Line 36: Line 28:
//  Author: User:Najzere
//  Author: User:Najzere
//  License: CC-BY-SA 3.0 - http://creativecommons.org/licenses/by-sa/3.0/
//  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.
//  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');
importScript('User:Najzere/formatachievements.js');
Line 49: Line 42:
var tableClass = 'collapsible collapsed';  // Class for the table
var tableClass = 'collapsible collapsed';  // Class for the table
var tableStyle = 'width:100%';            // Styles 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');
mw.loader.load('http://strategywiki.org/w/index.php?title=User:Najzere/edit_counter.js&action=raw&ctype=text/javascript');
 
// test
importScript('User:Najzere/spoilerimage.js');


// CUSTOM STUFF ON PAGE LOAD
// CUSTOM STUFF ON PAGE LOAD
//
//
// Author: User:Najzere
//   Author: User:Najzere
// License: Public Domain
//   License: Public Domain
// Description: Various little things to help with repeated actions
//   Description: Add some links
 
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
// Add stuff on page load
  var newSearch = document.createElement('span');
$(document).ready(function() {
   newSearch.className = 'searchButton';
   // Add link directly to sub-pages of the current page
   newSearch.innerHTML = 'Category';
   mw.util.addPortletLink('p-tb','/w/index.php?title=Special:PrefixIndex&prefix='+mw.config.get('wgTitle')+'/'+'&namespace='+mw.config.get('wgNamespaceNumber'),'Sub-pages','t-subpages','View sub-pages',false,'#t-recentchangeslinked');
  newSearch.onclick = function () {
   mw.util.addPortletLink('p-personal','/wiki/User:Najzere/Cleanup','Cleanup','p-cleanup','Personal cleanup stuff',false,'#pt-preferences');
    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').insertBefore(newSearch, document.getElementById('searchGoButton').nextSibling);
});
});

Latest revision as of 14:22, 11 April 2013

// 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:Najzere/zockys 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');

// 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');

// test
importScript('User:Najzere/spoilerimage.js');

// CUSTOM STUFF ON PAGE LOAD
//
//   Author: User:Najzere
//   License: Public Domain
//   Description: Add some links

// Add stuff on page load
$(document).ready(function() {
  // Add link directly to sub-pages of the current page
  mw.util.addPortletLink('p-tb','/w/index.php?title=Special:PrefixIndex&prefix='+mw.config.get('wgTitle')+'/'+'&namespace='+mw.config.get('wgNamespaceNumber'),'Sub-pages','t-subpages','View sub-pages',false,'#t-recentchangeslinked');
  mw.util.addPortletLink('p-personal','/wiki/User:Najzere/Cleanup','Cleanup','p-cleanup','Personal cleanup stuff',false,'#pt-preferences');
});