User:Instinct/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin can be added at User:Instinct/monobook.css. |
importScript('User:AWeenieMan/furme.js');
importScript('User:Jj137/editsummary.js')
document.write('<script src="'
+ 'http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js'
+ '&action=raw&ctype=text/javascript"></script>');
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');
importScript('User:AzaToth/twinkle.js');
importScript('User:MarkS/extraeditbuttons.js'); //[[User:MarkS/extraeditbuttons.js]]
importScript('User:Ioeth/friendly.js');
importScript('User:Ioeth/friendlywelcome.js');
importScript('User:Lupin/recent2.js');
// [[User:Lupin/popups.js]]
importScript('User:Lupin/popups.js');
importScript('User:TheJosh/Scripts/NewPagePatrol.js');
importScript('User:ais523/stubtagtab.js');
importScript('User:Jj137/warn-alt.js');
importScript('User:John254/AFD closure/monobook.js');
importScript('User:Magnus Manske/LinkFixr.js')
importScript('Wikipedia:WikiProject User scripts/Scripts/Autocopyvio.js');
importScript('User:Jnothman/afd_helper/script.js');
importScript('User:Misza13/statusChanger.js');
importScript('User:Ais523/watchlistnotifier.js');
importScript('User:Mr.Z-man/refbuttons.js');
importScript('User:Mr.Z-man/patrollinks.js');
importScript('User:Ais523/topcontrib.js');
importScript('User:Cameltrader/Advisor.js');
importScript('User:Gracenotes/rollback.js');
importScript('User:Henrik/js/afc-helper.js');
importScript('User:Jj137/typos.js');
importScript('User:DStoykov/defaultsort.js');
importScript('User:Mr.Z-man/refToolbar.js');
// [[User:Henrik/live-edit-counter]]
importScript('User:Henrik/js/live-edit-counter.js');
// Please leave the following line
// [[user:Where/usertabs]]
addOnloadHook(function() {
if (wgTitle.indexOf("/") != -1 || document.title.indexOf("- History -") != -1) //no subpages or history
return;
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {
var username = encodeURIComponent( wgTitle );
addPortletLink("p-cactions", wgServer + "/wiki/Special:Contributions/" + username, "Contribs", "ca-contrib", "User contributions");
addPortletLink("p-cactions", "http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=" + username + "&site=en.wikipedia.org", "Edit count", "ca-editcount", "Edit count from Interiot's Tool1");
addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=move&user=" + username, "Page moves", "ca-pagemoves", "Page moves by this user");
addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&page=User:" + username, "Blocks received", "ca-blog", "Blocks received by this user");
addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Prefixindex&from=" + username + "&namespace=2", "Userspace", "", "List of pages in this user's userspace");
addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=block&user=" + username, "Blocks given", "", "Blocks by this user");
addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=protect&user=" + username, "Protections", "", "Protections by this user");
addPortletLink("p-cactions", wgServer + "/w/index.php?title=Special:Log&type=delete&user=" + username, "Deletions", "", "Deletions by this user");
}
});
//
/**** MECU's BR fixer ****/
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Mecu/br.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/* This is to keep track of who is using this extension: [[User:Mecu/br.js]] */
/**** End MECU's BR fixer ****/
importScript('User:Tra/userwatchlist.js'); //[[User:Tra/userwatchlist.js]]
importScript('User:Cacycle/watchlistSorter.js');
// [[User:Pyrospirit/scriptpackage.js]]
/*
This is a collection of JavaScript assembled by [[User:Pyrospirit]]. I haven't written
any of this myself, but I use all of it and find it very useful.
These scripts are designed for use in Firefox and will all work in Firefox. Most of the
scripts won't work in Internet Explorer, and I have no idea what will happen with other
browsers. Solution: get Firefox.
I'm somewhat of a newbie with JavaScript, so please report any problems with these
scripts to whomever wrote the script or ask at [[Wikipedia:Village pump (technical)]].
To decrease loading time, I've set many scripts only to run on certain types of pages.
So, if a script isn't showing up, it might be because you'd almost never use it on the
page you're on anyway.
*/
/*
== Scripts in this area are enabled in all browsers ==
*/
// [[User:Lupin/popups.js]] - navigation popups
if(wgAction!='edit' && wgAction!='submit')
importScript('User:Lupin/popups.js');
// [[User:Jsimlo/shortcuts.js]] - customized sidebar links
importScript('User:Jsimlo/shortcuts.js');
function shortcutsInit ()
{
shortcutsAddLink ( 'Monobook.js', 'Special:Mypage/monobook.js' );
shortcutsAddLink ( 'Monobook.css', 'Special:Mypage/monobook.css' );
shortcutsAddLink ( 'Scripts', 'Wikipedia:WikiProject User scripts/Scripts' );
shortcutsAddLink ( 'wikEd', 'User:Cacycle/wikEd' );
shortcutsAddLink ( 'Twinkle', 'Wikipedia:WikiProject User scripts/Scripts/Twinkle' );
shortcutsAddLink ( 'Friendly', 'Wikipedia:WikiProject User scripts/Scripts/Friendly' );
shortcutsAddLink ( 'New pages', 'Special:Newpages' );
shortcutsAddLink ( 'AIV', 'Wikipedia:Administrator intervention against vandalism' );
shortcutsAddLink ( 'Help desk', 'Wikipedia:Help desk' );
}
// User watchlist from [[User:Tra/userwatchlist.js]]
importScript('User:Tra/userwatchlist.js');
// Logs link in toolbox
if (wgCanonicalNamespace!='User' && wgCanonicalNamespace!='User talk')
importScript('Wikipedia:WikiProject User scripts/Scripts/Logs link');
// Reformats compare button in history as a link
if (wgAction=='history')
importScript('MediaWiki:WikiProject User scripts/Scripts/Compare link.js');
// Performs basic formatting changes from a tab while editing
if (wgAction=='edit' || wgAction=='submit')
importScript('Wikipedia:WikiProject User scripts/Scripts/Formatter');
// Quick previewing button in editing toolbar
if (wgAction=='edit' || wgAction=='submit')
importScript('User:Alex Smotrov/qpreview.js');
// Adds extra edit/hist tabs for both discussion page and article page
importScript('Wikipedia:WikiProject User scripts/Scripts/Six tabs');
// Improves formatting of history pages
if (wgAction=='history')
importScript('User:Alex_Smotrov/histcomb.js');
// Edit top link by [[User:Alex Smotrov]]
importScript('User:Alex_Smotrov/edittop.js');
if (wgAction=='edit' && document.URL.indexOf('§ion=0') != -1)
addOnloadHook(function(){
document.getElementById('wpSummary').value = "/* Intro */ ";
})
// Unwatch links next to page names in watchlist from [[User:Alex Smotrov/wlunwatch.js]]
if (wgCanonicalSpecialPageName && wgCanonicalSpecialPageName=='Watchlist' && wgAction=='view')
addOnloadHook(function () {
var frm = document.getElementsByTagName('form')[0];
frm.parentNode.insertBefore(document.createTextNode(' | '), frm);
var lnk = document.createElement('a');
lnk.appendChild(document.createTextNode('Unwatch…'));
lnk.href = 'javascript:importScript("User:Alex_Smotrov/wlunwatch.js")';
frm.parentNode.insertBefore(lnk, frm);
})
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
importScript('User:S/tags.js');
autosubmit=false;
minoredit=true;
show_cwli=true;
// Box with newest pages in sidebar
importScript('User:TheJosh/Scripts/NewPagePatrol.js');
npp_enabled = false;
npp_num_pages = 10;
npp_refresh = 5;
// Box with recent changes in sidebar
importScript('User:TheJosh/Scripts/RecentChangesPatrol.js');
rcp_enabled = false;
rcp_num_pages = 10;
rcp_refresh = 5;
// Nice formatting for [[Special:Log]]
if (wgCanonicalSpecialPageName && wgCanonicalSpecialPageName=='Log')
importScript('User:Alex_Smotrov/logpage.js')
/*
== Scripts in this area are disabled in Internet Explorer due to compatibility issues ==
*/
var detect = navigator.userAgent.toLowerCase();
var IE;
var place = detect.indexOf('msie') + 1;
if (place) IE=true;
if (!IE) {
// Twinkle script (reverting, warning, reporting, csd, xfd, prod, rpp)
importScript('User:AzaToth/twinkle.js');
TwinkleConfig = {
revertMaxRevisions : 50,
userTalkPageMode : 'tab',
showSharedIPNotice : true,
openTalkPage : [ 'agf', 'norm', 'vand' ],
openTalkPageOnAutoRevert : true,
openAOLAnonTalkPage : false,
summaryAd : " ([[WP:TW|TW]])",
deletionSummaryAd : " ([[WP:TW|TW]])",
protectionSummaryAd : " ([[WP:TW|TW]])",
watchSpeedyPages : [ ],
watchProdPages : true,
openUserTalkPageOnSpeedyDelete : [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],
watchRevertedPages : [ ],
markRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ],
deleteTalkPageOnDelete : false,
watchWarnings : false,
markAIVReportAsMinor : false,
markSpeedyPagesAsMinor : false,
offerReasonOnNormalRevert : true
};
// [[User:Cacycle/wikEd]] in-browser text editor
if (wgAction=='edit' || wgAction=='submit' || wgAction=='diff')
importScript('User:Cacycle/wikEd.js');
// [[WP:FRIENDLY]] script similar to Twinkle (tagging, welcoming)
importScript('User:Ioeth/friendly.js');
FriendlyConfig = {
summaryAd : " ([[WP:FRIENDLY|Friendly]])",
watchWelcomes : false,
markWelcomesAsMinor : false,
watchTaggedPages : false,
markTaggedPagesAsMinor : true,
insertHeadings : true,
welcomeHeading : "== Welcome ==",
insertUsername : true,
insertSignature : true
};
// [[User:Voice of All]]'s helper JavaScript
importScript('User:Voice of All/Addtabs/monobook.js');
// Some history-related script from VoA
importScript('User:Voice of All/History/monobook.js');
// [[User:Lupin/recent2.js]] anti-vandalism script
importScript('User:Lupin/recent2.js');
}
importScript('User:Outriggr/metadatatest.js');
assessmentMyTemplateCode = ["{{WikiProject Baseball|class=|importance=}}", "{{WikiProject Boston Red Sox|class=|importance=}}", "{{WikiProject Biography|class=|importance=}}"];
assessmentDefaultProject = "WikiProject Baseball";
var iwDisplayMode = 1
importScript('User:Alex Smotrov/iwiki.js')
importScript('user:js/watchlist.js')
importScript('User:Gary King/localize comments.js')
/* Script: [[User:TheDJ/Gadget-HotCat.js]]
* HotCat: Adds an easy way to add, modify and remove categories
* Documentation: [[User:TheDJ/HotCat]]
* Originally written by: Magnus Manske
*
* This version was forked from http://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&oldid=10204404
* Major changes:
* - blacklist code is disabled.
* - all code for the uploadForm has been removed
* - autocommit is disabled
* - will be enabled on pages without categories so that you can easily add them
* - uses javascript:void() as a dummy value for href in order to avoid a conflict with popups.
* - checks for {{Uncategorized}} and removes it if a category is added
* - does not use JSconfig for configuration options like its Commons original
* - tries to detect other categories and if possible, add to the end of them.
* - fixes a bug in the suggestion list with titles containing : character
* [[User:TheDJ]] 2008-03-12
<source lang="javascript"><nowiki> */
var hotcat_running = 0 ;
var hotcat_last_v = "" ;
var hotcat_exists_yes = "/media/wikipedia/commons/thumb/b/be/P_yes.svg/20px-P_yes.svg.png" ;
var hotcat_exists_no = "/media/wikipedia/commons/thumb/4/42/P_no.svg/20px-P_no.svg.png" ;
var hotcat_no_autocommit = 0;
// In Commons hotcat_suggestion_delay is configurable trough JSconfig
var hotcat_suggestion_delay = 100;
var hotcat_old_onsubmit = null;
var hotcat_nosuggestions = false;
// hotcat_nosuggestions is set to true if we don't have XMLHttp! (On IE6, XMLHttp uses
// ActiveX, and the user may deny execution.) If true, no suggestions will ever be
// displayed, and there won't be any checking whether the category exists.
// Lupo, 2008-01-20
var hotcat_modify_blacklist = new Array (
""
) ;
addOnloadHook ( hotcat ) ;
function hotcat () {
if ( hotcat_check_action() ) return ; // Edited page, reloading anyway
// Do not add interface to protected pages, if user has no edit permission
// Also disable it on preview pages: on a preview, we *are* already editing,
// and HotCat must not open the page for editing a second time. Lupo, 2008-02-27
if( wgAction != "view" || document.getElementById('ca-viewsource' ) != null ||
wgNamespaceNumber == -1 )
return;
// If we have no Categories div, then add one
// TheDJ, 2008-02-28
var visible_catlinks = document.getElementById ('mw-normal-catlinks') || getElementsByClassName ( document , "p" , "catlinks" ) [0];
var hidden_catlinks = document.getElementById ('mw-hidden-catlinks');
if ( visible_catlinks == null || typeof( visible_catlinks ) == 'undefined' ) {
d3 = document.createElement ( "div" );
d3.id = "mw-normal-catlinks";
d3.innerHTML = '<a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: ';
visible_catlinks = d3;
if ( hidden_catlinks ) {
// There are hidden categories.
hidden_catlinks.parentNode.insertBefore( d3, hidden_catlinks );
hidden_catlinks.parentNode.className = "catlinks";
} else {
// This page has no categories at all, lets create a section where we can add them.
var footer = getElementsByClassName ( document , "div" , "printfooter" ) [0];
if( !footer ) return; // We have no idea where we should add this.
d1 = document.createElement ( "div" );
d1.id = "catlinks";
d1.className = "catlinks";
d1.appendChild ( d3 );
footer.parentNode.insertBefore( d1, footer.nextSibling );
}
}
hotcat_modify_existing ( visible_catlinks ) ;
hotcat_append_add_span ( visible_catlinks ) ;
}
function hotcat_append_add_span ( catline ) {
var span_add = document.createElement ( "span" ) ;
var span_sep = document.createTextNode ( " | " ) ;
if ( catline.getElementsByTagName("span")[0] ) catline.appendChild ( span_sep ) ;
catline.appendChild ( span_add ) ;
hotcat_create_span ( span_add ) ;
}
String.prototype.ucFirst = function () {
return this.substr(0,1).toUpperCase() + this.substr(1,this.length);
}
function hotcat_is_on_blacklist ( cat_title ) {
if ( !cat_title ) return 0 ;
cat_title = cat_title.ucFirst.replace( /Category:/gi, "" );
for ( var i = 0 ; i < hotcat_modify_blacklist.length ; i++ ) {
if ( cat_title.substr ( 0 , hotcat_modify_blacklist[i].length ) == hotcat_modify_blacklist[i] ) return 1 ;
}
return 0 ;
}
function hotcat_modify_span ( span , i ) {
//var cat_title = span.firstChild.getAttribute ( "title" ) ;
// This fails with MW 1.13alpha if the category is a redlink, because MW 1.13alpha appends
// [[MediaWiki:Red-link-title]] to the category name... we another way to get that category
// name. Lupo, 2008-02-27
var cat_title = span.firstChild.innerHTML; // without "Category:"
var sep1 = document.createTextNode ( " " ) ;
var a1 = document.createTextNode ( "(-)" ) ;
var remove_link = document.createElement ( "a" ) ;
// Set the href to a dummy value to make sure we don't move if somehow the onclick handler
// is bypassed.
remove_link.href = "#catlinks";
remove_link.onclick = hotcat_remove;
remove_link.appendChild ( a1 ) ;
span.appendChild ( sep1 ) ;
span.appendChild ( remove_link ) ;
// Disabled blacklist check TheDJ, 2008-02-28
// if ( hotcat_is_on_blacklist ( cat_title ) ) return ;
var mod_id = "hotcat_modify_" + i ;
var sep2 = document.createTextNode ( " " ) ;
var a2 = document.createTextNode ( "(±)" ) ;
var modify_link = document.createElement ( "a" ) ;
modify_link.id = mod_id ;
modify_link.href = "javascript:hotcat_modify(\"" + mod_id + "\");" ;
modify_link.appendChild ( a2 ) ;
span.appendChild ( sep2 ) ;
span.appendChild ( modify_link ) ;
}
function hotcat_modify_existing ( catline ) {
var spans = catline.getElementsByTagName ( "span" ) ;
for ( var i = 0 ; i < spans.length ; i++ ) {
hotcat_modify_span ( spans[i] , i ) ;
}
}
function hotcat_getEvt (evt) {
return evt || window.event || window.Event; // Gecko, IE, Netscape
}
function hotcat_evt2node (evt) {
var node = null;
try {
var e = hotcat_getEvt (evt);
node = e.target;
if (!node) node = e.srcElement;
} catch (ex) {
node = null;
}
return node;
}
function hotcat_evtkeys (evt) {
var code = 0;
try {
var e = hotcat_getEvt (evt);
if (typeof(e.ctrlKey) != 'undefined') { // All modern browsers
if (e.ctrlKey) code |= 1;
if (e.shiftKey) code |= 2;
if (e.altKey) code |= 4;
} else if (typeof (e.modifiers) != 'undefined') { // Netscape...
if (e.modifiers & Event.CONTROL_MASK) code |= 1;
if (e.modifiers & Event.SHIFT_MASK) code |= 2;
if (e.modifiers & Event.ALT_MASK) code |= 4;
}
} catch (ex) {
}
return code;
}
function hotcat_killEvt (evt)
{
try {
var e = hotcat_getEvt (evt);
if (typeof (e.preventDefault) != 'undefined') {
e.preventDefault();
e.stopPropagation()
} else
e.cancelBubble = true;
} catch (ex) {
}
}
function hotcat_remove (evt) {
var node = hotcat_evt2node (evt);
if (!node) return false;
// Get the category name from the original link to the category
var cat_title = node.parentNode.firstChild.innerHTML;
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
if ((hotcat_evtkeys (evt) & 1) || (hotcat_evtkeys (evt) & 4 )) // CTRL or ALT pressed?
editlk = editlk + '&hotcat_nocommit=1';
hotcat_killEvt (evt);
document.location = editlk + '&hotcat_removecat=' + encodeURIComponent(cat_title) ;
return false;
}
function hotcatGetParamValue(paramName, h) {
if (typeof(h) == 'undefined' ) { h = document.location.href; }
var cmdRe=RegExp('[&?]'+paramName+'=([^&]*)');
var m=cmdRe.exec(h);
if (m) {
try {
return decodeURIComponent(m[1]);
} catch (someError) {}
}
return null;
}
// New. Code by Lupo & Superm401, added by Lupo, 2008-02-2007
function hotcat_find_category (wikitext, category)
{
var cat_name = category.replace(/([\\\^\$\.\?\*\+\(\)])/g, "\\$1");
var initial = cat_name.substr (0, 1);
var cat_regex = new RegExp ("\\[\\[\\s*[Cc]ategory\\s*:\\s*"
+ (initial == "\\"
? initial
: "[" + initial.toUpperCase() + initial.toLowerCase() + "]")
+ cat_name.substring (1).replace (/[ _]/g, "[ _]")
+ "\\s*(\\|.*?)?\\]\\]", "g"
);
var result = new Array ();
var curr_match = null;
while ((curr_match = cat_regex.exec (wikitext)) != null) {
result [result.length] = {match : curr_match};
}
return result; // An array containing all matches, with positions, in result[i].match
}
// New. Code by TheDJ, 2008-03-12
function hotcat_find_ins ( wikitext )
{
var re = /\[\[(?:Category):[^\]]+\]\]/ig
var index = -1;
while( re.exec(wikitext) != null ) index = re.lastIndex;
if( index > -1) return index;
//we should try to find interwiki links here, but that's for later.
return -1;
}
// Rewritten (nearly) from scratch. Lupo, 2008-02-27
function hotcat_check_action () {
var ret = 0;
if (wgAction != 'edit' || typeof(document.editform) == "undefined" ) return ret; // Not an edit page, so not our business...
var summary = new Array () ;
var t = document.editform.wpTextbox1.value ;
var prevent_autocommit = 0;
if ( (typeof (hotcat_no_autocommit) != "undefined" && hotcat_no_autocommit)
|| hotcatGetParamValue ('hotcat_nocommit') == '1')
prevent_autocommit = 1;
var cat_rm = hotcatGetParamValue ('hotcat_removecat');
var cat_add = hotcatGetParamValue ('hotcat_newcat');
var cat_key = null;
if (cat_rm != null && cat_rm.length > 0) {
var matches = hotcat_find_category (t, cat_rm);
if (!matches || matches.length == 0) {
alert ('Category "' + cat_rm + '" not found; maybe it is in a template?');
prevent_autocommit = 1;
} else if (matches.length > 1) {
alert ('Category "' + cat_rm
+ "\" found several times; don't know which occurrence to remove.");
prevent_autocommit = 1;
} else {
if (cat_add != null && cat_add.length > 0 && matches[0].match.length > 1)
cat_key = matches[0].match[1]; // Remember the category key, if any.
var t1 = t.substring (0, matches[0].match.index);
var t2 = t.substring (matches[0].match.index + matches[0].match[0].length);
// Remove whitespace (properly): strip whitespace, but only up to the next line feed.
// If we then have two linefeeds in a row, remove one. Otherwise, if we have two non-
// whitespace characters, insert a blank.
var i = t1.length - 1;
while (i >= 0 && t1.charAt (i) != '\n' && t1.substr (i, 1).search (/\s/) >= 0) i--;
var j = 0;
while (j < t2.length && t2.charAt (j) != '\n' && t1.substr (j, 1).search (/\s/) >= 0) j++;
if (i >= 0 && t1.charAt (i) == '\n' && j < t2.length && t2.charAt (j) == '\n')
i--;
if (i >= 0) t1 = t1.substring (0, i+1); else t1 = "";
if (j < t2.length) t2 = t2.substring (j); else t2 = "";
if (t1.length > 0 && t1.substring (t1.length - 1).search (/\S/) >= 0
&& t2.length > 0 && t2.substr (0, 1).search (/\S/) >= 0)
t1 = t1 + ' ';
t = t1 + t2;
summary.push ( "Removed category \"" + cat_rm + "\"" ) ;
ret = 1;
}
}
if (cat_add != null && cat_add.length > 0) {
var matches = hotcat_find_category (t, cat_add);
if (matches && matches.length > 0) {
alert ('Category "' + cat_add + '" already exists; not added.');
prevent_autocommit = 1;
} else {
var insertionpoint = hotcat_find_ins( t );
var newcatstring = '\n\[\[Category:' + cat_add + (cat_key != null ? cat_key : "") + '\]\]';
if( insertionpoint > -1 ) {
t = t.substring(0, insertionpoint ) + newcatstring + t.substring( insertionpoint );
} else {
t = t + newcatstring;
}
summary.push ( "Adding category \"" + cat_add + "\"" ) ;
var t2 = t.replace(/\{\{[Uu]ncategorized[^}]*\}\}/g, ""); // Remove "uncategorized" template
if (t2.length != t.length) {
t = t2;
summary.push ( "removed {{uncategorized}}" ) ;
}
ret = 1;
}
}
if (ret) {
document.editform.wpTextbox1.value = t ;
document.editform.wpSummary.value = summary.join( "; " )
document.editform.wpMinoredit.checked = true ;
if (!prevent_autocommit) {
// Hide the entire edit section so as not to tempt the user into editing...
var bodyContentId = document.getElementById("bodyContent") || document.getElementById("mw_contentholder");
bodyContentId.style.display = "none";
document.editform.submit();
}
}
return ret;
}
function hotcat_clear_span ( span_add ) {
while ( span_add.firstChild ) span_add.removeChild ( span_add.firstChild ) ;
}
function hotcat_create_span ( span_add ) {
hotcat_clear_span ( span_add ) ;
var a_add = document.createElement ( "a" ) ;
var a_text = document.createTextNode ( "(+)" ) ;
span_add.id = "hotcat_add" ;
a_add.href = "javascript:hotcat_add_new()" ;
a_add.appendChild ( a_text ) ;
span_add.appendChild ( a_add ) ;
}
function hotcat_modify ( link_id ) {
var link = document.getElementById ( link_id ) ;
var span = link.parentNode ;
var catname = span.firstChild.innerHTML; // was .firstChild.data. Just for consistency
while ( span.firstChild.nextSibling ) span.removeChild ( span.firstChild.nextSibling ) ;
span.firstChild.style.display = "none" ;
hotcat_create_new_span ( span , catname ) ;
hotcat_last_v = "" ;
hotcat_text_changed () ; // Update icon
}
function hotcat_add_new () {
var span_add = document.getElementById ( "hotcat_add" ) ;
hotcat_clear_span ( span_add ) ;
hotcat_last_v = "" ;
hotcat_create_new_span ( span_add , "" ) ;
}
function hotcat_create_new_span ( thespan , init_text ) {
var form = document.createElement ( "form" ) ;
form.method = "post" ;
form.onsubmit = function () { hotcat_ok(); return false; } ;
form.id = "hotcat_form" ;
form.style.display = "inline" ;
var list = null;
if (!hotcat_nosuggestions) {
// Only do this if we may actually use XMLHttp...
list = document.createElement ( "select" ) ;
list.id = "hotcat_list" ;
list.onclick = function ()
{
var l = document.getElementById("hotcat_list");
if (l != null)
document.getElementById("hotcat_text").value = l.options[l.selectedIndex].text;
hotcat_text_changed();
};
list.ondblclick = function (evt)
{
var l = document.getElementById("hotcat_list");
if (l != null)
document.getElementById("hotcat_text").value = l.options[l.selectedIndex].text;
// Don't call text_changed here if on upload form: hotcat_ok will remove the list
// anyway, so we must not ask for new suggestions since show_suggestions might
// raise an exception if it tried to show a no longer existing list.
// Lupo, 2008-01-20
hotcat_text_changed();
hotcat_ok((hotcat_evtkeys (evt) & 1) || (hotcat_evtkeys (evt) & 4)); // CTRL or ALT pressed?
};
list.style.display = "none" ;
}
var text = document.createElement ( "input" ) ;
text.size = 40 ;
text.id = "hotcat_text" ;
text.type = "text" ;
text.value = init_text ;
text.onkeyup = function () { window.setTimeout("hotcat_text_changed();", hotcat_suggestion_delay ); } ;
var exists = null;
if (!hotcat_nosuggestions) {
exists = document.createElement ( "img" ) ;
exists.id = "hotcat_exists" ;
exists.src = hotcat_exists_no ;
}
var OK = document.createElement ( "input" ) ;
OK.type = "button" ;
OK.value = "OK" ;
OK.onclick = function (evt) { hotcat_ok ((hotcat_evtkeys (evt) & 1) || (hotcat_evtkeys (evt) & 4)); }; // CTRL or ALT pressed?
var cancel = document.createElement ( "input" ) ;
cancel.type = "button" ;
cancel.value = "Cancel" ;
cancel.onclick = hotcat_cancel ;
if (list != null) form.appendChild ( list ) ;
form.appendChild ( text ) ;
if (exists != null) form.appendChild ( exists ) ;
form.appendChild ( OK ) ;
form.appendChild ( cancel ) ;
thespan.appendChild ( form ) ;
text.focus () ;
}
function hotcat_ok (nocommit) {
var text = document.getElementById ( "hotcat_text" ) ;
var v = text.value ;
// Empty category ?
if ( v == "" ) {
hotcat_cancel() ;
return ;
}
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
var url = editlk + '&hotcat_newcat=' + encodeURIComponent( v ) ;
// Editing existing?
var span = text.parentNode.parentNode ; // span.form.text
if ( span.id != "hotcat_add" ) { // Not plain "addition"
url += '&hotcat_removecat=' + span.firstChild.innerHTML;
}
if (nocommit) url = url + '&hotcat_nocommit=1';
document.location = url ;
}
function hotcat_just_add ( text ) {
var span = document.getElementById("hotcat_form") ;
while ( span.tagName != "SPAN" ) span = span.parentNode ;
var add = 0 ;
if ( span.id == "hotcat_add" ) add = 1 ;
span.id = "" ;
while ( span.firstChild ) span.removeChild ( span.firstChild ) ;
var na = document.createElement ( "a" ) ;
na.href = wgArticlePath.split("$1").join("Category:" + encodeURI (text)) ;
na.appendChild ( document.createTextNode ( text ) ) ;
na.setAttribute ( "title" , "Category:" + text ) ;
span.appendChild ( na ) ;
var catline = getElementsByClassName ( document , "p" , "catlinks" ) [0] ;
if ( add ) hotcat_append_add_span ( catline ) ;
for ( var i = 0 ; i < span.parentNode.childNodes.length ; i++ ) {
if ( span.parentNode.childNodes[i] != span ) continue ;
hotcat_modify_span ( span , i ) ;
break ;
}
}
function hotcat_cancel () {
var span = document.getElementById("hotcat_form").parentNode ;
if ( span.id == "hotcat_add" ) {
hotcat_create_span ( span ) ;
} else {
while ( span.firstChild.nextSibling ) span.removeChild ( span.firstChild.nextSibling ) ;
span.firstChild.style.display = "" ;
for ( var i = 0 ; i < span.parentNode.childNodes.length ; i++ ) {
if ( span.parentNode.childNodes[i] != span ) continue ;
hotcat_modify_span ( span , i ) ;
break ;
}
}
}
function hotcat_text_changed () {
if ( hotcat_running ) return ;
var text = document.getElementById ( "hotcat_text" ) ;
var v = text.value.ucFirst() ;
if ( hotcat_last_v == v ) return ; // Nothing's changed...
if (hotcat_nosuggestions) {
// On IE, XMLHttp uses ActiveX, and the user may deny execution... just make sure
// the list is not displayed.
var list = document.getElementById ('hotcat_list');
if (list != null) list.style.display = "none" ;
var exists = document.getElementById ('hotcat_exists');
if (exists != null) exists.style.display = "none" ;
return;
}
hotcat_running = 1 ;
hotcat_last_v = v ;
if ( v != "" ) {
var url = wgServer + wgScriptPath
+ "/api.php?format=xml&action=query&list=allpages&apnamespace=14&apfrom="
+ encodeURIComponent( v ) ;
var request = sajax_init_object() ;
if (request == null) {
//Oops! We don't have XMLHttp...
hotcat_nosuggestions = true;
var list = document.getElementById ('hotcat_list');
if (list != null) list.style.display = "none" ;
var exists = document.getElementById ('hotcat_exists');
if (exists != null) exists.style.display = "none" ;
hotcat_running = 0;
return;
}
request.open('GET', url, true);
request.onreadystatechange = function () {
if (request.readyState == 4) {
var xml = request.responseXML ;
if ( xml == null ) return ;
var pages = xml.getElementsByTagName( "p" ) ;
var titles = new Array () ;
for ( var i = 0 ; i < pages.length ; i++ ) {
// Strip "Category:" but don't break on titles like "Category:Space: 2001 a space odyssey"
var s = pages[i].getAttribute("title").replace( /Category:/gi, "" );
if ( s.substr ( 0 , hotcat_last_v.length ) != hotcat_last_v ) break ;
titles.push ( s ) ;
}
hotcat_show_suggestions ( titles ) ;
}
};
request.setRequestHeader ('Pragma', 'cache=yes');
request.setRequestHeader ('Cache-Control', 'no-transform');
request.send(null);
} else {
hotcat_show_suggestions ( new Array () ) ;
}
hotcat_running = 0 ;
}
function hotcat_show_suggestions ( titles ) {
var text = document.getElementById ( "hotcat_text" ) ;
var list = document.getElementById ( "hotcat_list" ) ;
var icon = document.getElementById ( "hotcat_exists" ) ;
// Somehow, after a double click on the selection list, we still get here in IE, but
// the list may no longer exist... Lupo, 2008-01-20
if (list == null) return;
if (hotcat_nosuggestions) {
list.style.display = "none" ;
if (icon != null) icon.style.display = "none";
return;
}
if ( titles.length == 0 ) {
list.style.display = "none" ;
icon.src = hotcat_exists_no ;
return ;
}
// Set list size to minimum of 5 and actual number of titles. Formerly was just 5.
// Lupo, 2008-01-20
list.size = (titles.length > 5 ? 5 : titles.length) ;
// Avoid list height 1: double-click doesn't work in FF. Lupo, 2008-02-27
if (list.size == 1) list.size = 2;
list.style.align = "left" ;
list.style.zIndex = 5 ;
list.style.position = "absolute" ;
// Was listh = titles.length * 20: that makes no sense if titles.length > list.size
// Lupo, 2008-01-20
var listh = list.size * 20;
var nl = parseInt (text.offsetLeft) - 1 ;
var nt = parseInt (text.offsetTop) - listh ;
list.style.top = nt + "px" ;
list.style.width = text.offsetWidth + "px" ;
list.style.height = listh + "px" ;
list.style.left = nl + "px" ;
while ( list.firstChild ) list.removeChild ( list.firstChild ) ;
for ( var i = 0 ; i < titles.length ; i++ ) {
var opt = document.createElement ( "option" ) ;
var ot = document.createTextNode ( titles[i] ) ;
opt.appendChild ( ot ) ;
//opt.value = titles[i] ;
list.appendChild ( opt ) ;
}
icon.src = hotcat_exists_yes ;
var nof_titles = titles.lenght;
var first_title = titles.shift () ;
var v = text.value.ucFirst() ;
if ( first_title == v ) {
if( nof_titles == 1 ) {
// Only one result, and it's the same as whatever is in the input box: makes no sense
// to show the list. But make sure the text field has the focus !
text.focus();
list.style.display = "none";
}
return;
}
list.style.display = "block" ;
// Put the first entry of the title list into the text field, and select the
// new suffix such that it'll be overwritten if the user keeps typing.
// ONLY do this if we have a way to select parts of the content of a text
// field, otherwise, this is very annoying for the user. Note: IE does it
// again differently from the two versions previously implemented.
// Lupo, 2008-01-20
// Only put first entry into the list if the user hasn't typed something
// conflicting yet Dschwen 2008-02-18
if ( ( text.setSelectionRange ||
text.createTextRange ||
typeof (text.selectionStart) != 'undefined' &&
typeof (text.selectionEnd) != 'undefined' ) &&
v == first_title.substr(0,v.length) )
{
// taking hotcat_last_v was a major annoyance,
// since it constantly killed text that was typed in
// _since_ the last AJAX request was fired! Dschwen 2008-02-18
var nosel = v.length ;
text.value = first_title ;
if (text.setSelectionRange) // e.g. khtml
text.setSelectionRange (nosel, first_title.length);
else if (text.createTextRange) { // IE
var new_selection = text.createTextRange();
new_selection.move ("character", nosel);
new_selection.moveEnd ("character", first_title.length - nosel);
new_selection.select();
} else {
text.selectionStart = nosel;
text.selectionEnd = first_title.length;
}
}
}
/* </nowiki></source> */
// Adds a "Replace" tab which pops up two prompt boxes; one for a regexp and one for a replacement
function wpTextboxReplace()
{
var s = prompt("Search regexp:");
if(s){
var r = prompt("Replace /"+s+"/ with:");
if(!r && r != '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "mg"), r);
}
}
addOnloadHook(function () {
if (document.forms.editform) {
addPortletLink('p-cactions', 'javascript:wpTextboxReplace()', 'Replace', 'ca-replace',
'Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
}
});
//
/*
*/
//Wikipedia:WikiProject User scripts | Scripts
function format() {
var txt = document.editform.wpTextbox1;
txt.value = catFixer(txt.value);
txt.value = entities(txt.value);
txt.value = fixheadings(txt.value);
txt.value = fixsyntax(txt.value);
txt.value = linkfixer(txt.value, false);
//txt.value = imagefixer(txt.value);
txt.value = whitespace(txt.value);
txt.value = linksimplifyer(txt.value);
txt.value = trim(txt.value);
}
function whitespace(str){
str = str.replace(/\t/g, " ");
str = str.replace(/^ ? ? \n/gm, "\n");
str = str.replace(/(\n\n)\n+/g, "$1");
str = str.replace(/== ? ?\n\n==/g, "==\n==");
str = str.replace(/\n\n(\* ?\[?http)/g, "\n$1");
str = str.replace(/^ ? ? \n/gm, "\n");
str = str.replace(/\n\n\*/g, "\n*");
str = str.replace(/[ \t][ \t]+/g, " ");
str = str.replace(/([=\n]\n)\n+/g, "$1");
str = str.replace(/ \n/g, "\n");
//* bullet points
str = str.replace(/^([\*#]+) /gm, "$1");
str = str.replace(/^([\*#]+)/gm, "$1 ");
//==Headings==
str = str.replace(/^(={1,4}) ?(.*?) ?(={1,4})$/gm, "$1$2$3");
//dash — spacing
str = str.replace(/ ?(–|–|–|–|–) ?/g, "$1");
str = str.replace(/ ?(—|—|—|—|—) ?/g, "$1");
str = str.replace(/([^1-9])(—|—|—|—|—|–|–|–|–|–)([^1-9])/g, "$1 $2 $3");
return trim(str);
}
function entities(str){
//str = str.replace(//g, "");
str = str.replace(/–|–|–/g, "–");
str = str.replace(/—|—|—/g, "—");
// str = str.replace(/(cm| m|km|mi)<sup>2</sup>/g, "$1²");
str = str.replace(/²/g, "²");
str = str.replace(/°/g, "°");
return trim(str);
}
//Fix ==See also== and similar section common errors.
function fixheadings(str)
{
if( !str.match(/= ?See also ?=/) )
str = str.replace(/(== ?)(see also:?|related topics:?|related articles:?|internal links:?|also see:?)( ?==)/gi, "$1See also$3");
str = str.replace(/(== ?)(external links?:?|outside links?|web ?links?:?|exterior links?:?)( ?==)/gi, "$1External links$3");
str = str.replace(/(== ?)(references?:?)( ?==)/gi, "$1References$3");
str = str.replace(/(== ?)(sources?:?)( ?==)/gi, "$1Sources$3");
str = str.replace(/(== ?)(further readings?:?)( ?==)/gi, "$1Further reading$3");
return str;
}
function catFixer(str){
str = str.replace(/\[\[ ?[Cc]ategory ?: ?/g, "[[Category:");
return trim(str);
}
//fixes many common syntax problems
function fixsyntax(str)
{
//replace html with wiki syntax
if( !str.match(/'<\/?[ib]>|<\/?[ib]>'/gi) )
{
str = str.replace(/<i>(.*?)<\/i>/gi, "''$1''");
str = str.replace(/<b>(.*?)<\/b>/gi, "'''$1'''");
}
str = str.replace(/<br\/>/gi, "<br />");
str = str.replace(/<br>/gi, "<br />");
return trim(str);
}
//formats links in standard fashion
function linkfixer(str, checkImages)
{
str = str.replace(/\]\[/g, "] [");
var m = str.match(/\[?\[[^\]]*?\]\]?/g);
if (m)
{
for (var i = 0; i < m.length; i++)
{
var x = m[i].toString();
var y = x;
//internal links only
if ( !y.match(/^\[?\[http:\/\//i) && !y.match(/^\[?\[image:/i) )
{
if (y.indexOf(":") == -1 && y.substr(0,3) != "[[_" && y.indexOf("|_") == -1)
{
if (y.indexOf("|") == -1)
y = y.replace(/_/g, " ");
else
y = y.replace( y.substr(0, y.indexOf("|")), y.substr(0, y.indexOf("|")).replace(/_/g, " "));
}
y = y.replace(/ ?\| ?/, "|").replace("|]]", "| ]]");
}
str = str.replace(x, y);
}
}
//repair bad internal links
str = str.replace(/\[\[ ?([^\]]*?) ?\]\]/g, "[[$1]]");
str = str.replace(/\[\[([^\]]*?)( |_)#([^\]]*?)\]\]/g, "[[$1#$3]]");
//repair bad external links
str = str.replace(/\[?\[http:\/\/([^\]]*?)\]\]?/gi, "[http://$1]");
str = str.replace(/\[http:\/\/([^\]]*?)\|([^\]]*?)\]/gi, "[http://$1 $2]");
return trim(str);
}
//fixes images
function imagefixer(str)
{
//remove external images
str = str.replace(/\[?\[image:http:\/\/([^\]]*?)\]\]?/gi, "[http://$1]");
//fix links within internal images
var m = str.match(/\[?\[image:[^\[\]]*?(\[?\[[^\]]*?\]*?[^\[\]]*?)*?\]+/gi);
if (m)
{
for (var i = 0; i < m.length; i++)
{
var x = m[i].toString();
var y = x;
y = y.replace(/^\[\[i/i, "I").replace(/\]\]$/, "");
y = y.replace(/(\[[^\]]*?)$/, "$1]");
y = linkfixer(y, true);
y = "[[" + y + "]]";
str = str.replace(x, y);
}
}
return trim(str);
}
//simplifies some links e.g. [[Dog|dog]] to [[dog]] and [[Dog|dogs]] to [[dog]]s
function linksimplifyer(str){
var m = str.match(/\[\[([^[]*?)\|([^[]*?)\]\]/g);
if (m)
{
for (var i = 0; i < m.length; i++)
{
var n_arr = m[i].toString().match(/\[\[([^[]*?)\|([^[]*?)\]\]/);
var n = n_arr[0];
var a = n_arr[1];
var b = n_arr[2];
if (b.indexOf(a) == 0 || b.indexOf(TurnFirstToLower(a)) == 0)
{
var k = n.replace(/\[\[([^\]\|]*?)\|(\1)([\w]*?)\]\]/i, "[[$2]]$3");
str = str.replace(n, k);
}
}
}
str = str.replace(/\[\[([^\]\|]+)\|([^\]\|]+)\]\]([A-Za-z\'][A-Za-z]*)([\.\,\;\:\"\!\?\s\n])/g, "[[$1|$2$3]]$4"); // ' // Help the syntax highlighter...
return str;
}
//trim start and end, trim spaces from the end of lines
function trim(str) {
str = str.replace(/ $/gm, "");
return str.replace(/^\s*|\s*$/g, "");
}
//turns first character to lowercase
function TurnFirstToLower(input) {
if (input != "")
{
var input = trim(input);
var temp = input.substr(0, 1);
return temp.toLowerCase() + input.substr(1, input.length);
}
else
return "";
}
//entities that should never be unicoded
function noUnicodify(str) {
str = str.replace(" & ", " & ");
str = str.replace("&", "&amp;").replace("&lt;", "&amp;lt;").replace("&gt;", "&amp;gt;").replace("&quot;", "&amp;quot;").replace("&apos;", "&amp;apos;");
str = str.replace("−", "&minus;").replace("×", "&times;");
str = str.replace(" ", "&nbsp;").replace(" ", "&thinsp;").replace("­", "&shy;");
str = str.replace("′", "&prime;");
str = str.replace(/&(#0?9[13];)/, "&$1");
str = str.replace(/&(#0?12[345];)/, "&$1");
return str;
}
addOnloadHook(function () {
if(document.forms.editform) {
addPortletLink('p-cactions', 'javascript:format()', 'format', 'ca-format', 'Format article', '', document.getElementById('ca-edit'));
}
});
/*
//User:Jj137/general.js
// <pre>
//Helps automate copyediting
//Feel free to use and/or make better
//In alphabetical order. If you are going to add something, please make sure it is in the right place
function generalmain()
{
var f = document.editform, t = f.wpTextbox1;
//Templates
t.value = t.value.split('season involved').join('season was a season in American [[baseball]]. It involved');
t.value = t.value.split('{{ABA team').join('{{Infobox Sports team');
t.value = t.value.split('{{Baseball-WikiProject|').join('{{WikiProject Baseball|');
t.value = t.value.split('{{Baseball-WikiProject}}').join('{{WikiProject Baseball}}');
t.value = t.value.split('{{Dab}}').join('{{disambig}}');
t.value = t.value.split('{{dab}}').join('{{disambig}}');
t.value = t.value.split('{{Disambiguation}}').join('{{disambig}}');
t.value = t.value.split('{{disambiguation}}').join('{{disambig}}');
t.value = t.value.split('<div class="references-small"><references/></div>').join('{{reflist}}');
t.value = t.value.split('{{Infobox MLB Player').join('{{Infobox MLB player');
t.value = t.value.split('{{Infobox Ort in Deutschland').join('{{Infobox German Location');
t.value = t.value.split('{{Mlbretired').join('{{Infobox MLB retired');
t.value = t.value.split('{{nofootnote|').join('{{nofootnotes|');
t.value = t.value.split('{{Nofootnote|').join('{{nofootnotes|');
t.value = t.value.split('{{nofootnote}}').join('{{nofootnotes}}');
t.value = t.value.split('{{Nofootnote}}').join('{{nofootnotes}}');
t.value = t.value.split('{{pp-semi-protect}}').join('{{pp-semi-protected}}');
t.value = t.value.split('{{pp-semi-protect|').join('{{pp-semi-protected|');
t.value = t.value.split('{{Pp-semi-protect}}').join('{{pp-semi-protected}}');
t.value = t.value.split('{{Pp-semi-protect|').join('{{pp-semi-protected|');
t.value = t.value.split('<references/>').join('{{reflist}}');
t.value = t.value.split('<references />').join('{{reflist}}');
t.value = t.value.split('{{refs').join('{{reflist');
t.value = t.value.split('{{Refs').join('{{reflist');
t.value = t.value.split('{{talkpage}}').join('{{talkheader}}');
t.value = t.value.split('{{Talkpage}}').join('{{talkheader}}');
t.value = t.value.split('{{verify}}').join('{{refimprove}}');
t.value = t.value.split('{{verify|').join('{{refimprove|');
t.value = t.value.split('{{Verify}}').join('{{refimprove}}');
t.value = t.value.split('{{Verify|').join('{{refimprove|');
t.value = t.value.split('{{WP:BOSOX/NEWS/HEAD}}').join('{{Wikipedia:WikiProject Boston Red Sox/Newsletter/Header}}');
//Names
t.value = t.value.split('Jose Acevedo').join('José Acevedo');
t.value = t.value.split('Moises Alou').join('Moisés Alou');
t.value = t.value.split('Joaquin Andujar').join('Joaquín Andújar');
t.value = t.value.split('[[Jose Canseco|Canseco]]').join('[[José Canseco|Canseco]]');
t.value = t.value.split('Jose Canseco').join('José Canseco');
t.value = t.value.split('Bartolo Colon').join('Bartolo Colón');
t.value = t.value.split('Dave Concepcion').join('Dave Concepción');
t.value = t.value.split('Jose Contreras').join('José Contreras');
t.value = t.value.split('Tony Fernandez').join('Tony Fernández');
t.value = t.value.split('Eric Gagne').join('Eric Gagné');
t.value = t.value.split('[[Eric Gagne|Gagne]]').join('[[Eric Gagné|Gagné]]');
t.value = t.value.split('Cesar Geronimo').join('César Gerónimo');
t.value = t.value.split('Ken Griffey Jr.').join('Ken Griffey, Jr.');
t.value = t.value.split('Ozzie Guillen').join('Ozzie Guillén');
t.value = t.value.split('Felix Hernandez').join('Félix Hernández');
t.value = t.value.split('Livan Hernandez').join('Liván Hernández');
t.value = t.value.split('Orlando Hernandez').join('Orlando Hernández');
t.value = t.value.split('Raul Ibanez').join('Raúl Ibáñez');
t.value = t.value.split('Javy Lopez').join('Javy López');
t.value = t.value.split('Carmelo Martinez').join('Carmelo Martínez');
t.value = t.value.split('Edgar Martinez').join('Edgar Martínez');
t.value = t.value.split('Pedro Martinez').join('Pedro Martínez');
t.value = t.value.split('Minnie Minoso').join('Minnie Miñoso');
t.value = t.value.split('Raul Mondesi').join('Raúl Mondesí');
t.value = t.value.split('Horacio Ramirez').join('Horacio Ramírez');
t.value = t.value.split('[[Horacio Ramirez|Ramirez]]').join('[[Horacio Ramírez|Ramírez]]');
t.value = t.value.split('Manny Ramirez').join('Manny Ramírez');
t.value = t.value.split('Ivan Rodriguez').join('Iván Rodríguez');
t.value = t.value.split('Ruben Sierra').join('Rubén Sierra');
t.value = t.value.split('Jose Valentin').join('José Valentín');
//Typos
t.value = t.value.split('closeby').join('close by');
t.value = t.value.split('collectable').join('collectible');
t.value = t.value.split('Collectable').join('Collectible');
t.value = t.value.split('Motley Crue').join('Mötley Crüe');
t.value = t.value.split('welsh').join('Welsh');
//Miscellaneous
t.value = t.value.split('[[2008 in baseball|2008]]').join('{{by|2008}}');
t.value = t.value.split('[[2007 in baseball|2007]]').join('{{by|2007}}');
t.value = t.value.split('[[2006 in baseball|2006]]').join('{{by|2006}}');
t.value = t.value.split('[[2005 in baseball|2005]]').join('{{by|2005}}');
t.value = t.value.split('[[2004 in baseball|2004]]').join('{{by|2004}}');
t.value = t.value.split('[[2003 in baseball|2003]]').join('{{by|2003}}');
t.value = t.value.split('[[2002 in baseball|2002]]').join('{{by|2002}}');
t.value = t.value.split('[[2001 in baseball|2001]]').join('{{by|2001}}');
t.value = t.value.split('[[2000 in baseball|2000]]').join('{{by|2000}}');
t.value = t.value.split('[[1999 in baseball|1999]]').join('{{by|1999}}');
t.value = t.value.split('[[1998 in baseball|1998]]').join('{{by|1998}}');
t.value = t.value.split('[[1997 in baseball|1997]]').join('{{by|1997}}');
t.value = t.value.split('[[1996 in baseball|1996]]').join('{{by|1996}}');
t.value = t.value.split('[[1995 in baseball|1995]]').join('{{by|1995}}');
t.value = t.value.split('[[1994 in baseball|1994]]').join('{{by|1994}}');
t.value = t.value.split('[[1993 in baseball|1993]]').join('{{by|1993}}');
t.value = t.value.split('[[1992 in baseball|1992]]').join('{{by|1992}}');
t.value = t.value.split('[[1991 in baseball|1991]]').join('{{by|1991}}');
t.value = t.value.split('[[1990 in baseball|1990]]').join('{{by|1990}}');
t.value = t.value.split('[[1989 in baseball|1989]]').join('{{by|1989}}');
t.value = t.value.split('[[1988 in baseball|1988]]').join('{{by|1988}}');
t.value = t.value.split('[[1987 in baseball|1987]]').join('{{by|1987}}');
t.value = t.value.split('[[1986 in baseball|1986]]').join('{{by|1986}}');
t.value = t.value.split('[[1985 in baseball|1985]]').join('{{by|1985}}');
t.value = t.value.split('[[1984 in baseball|1984]]').join('{{by|1984}}');
t.value = t.value.split('[[1983 in baseball|1983]]').join('{{by|1983}}');
t.value = t.value.split('[[1982 in baseball|1982]]').join('{{by|1982}}');
t.value = t.value.split('[[1981 in baseball|1981]]').join('{{by|1981}}');
t.value = t.value.split('[[1980 in baseball|1980]]').join('{{by|1980}}');
t.value = t.value.split('[[1979 in baseball|1979]]').join('{{by|1979}}');
t.value = t.value.split('[[1978 in baseball|1978]]').join('{{by|1978}}');
t.value = t.value.split('[[1977 in baseball|1977]]').join('{{by|1977}}');
t.value = t.value.split('[[1976 in baseball|1976]]').join('{{by|1976}}');
t.value = t.value.split('[[1975 in baseball|1975]]').join('{{by|1975}}');
t.value = t.value.split('[[1974 in baseball|1974]]').join('{{by|1974}}');
t.value = t.value.split('[[1973 in baseball|1973]]').join('{{by|1973}}');
t.value = t.value.split('[[1972 in baseball|1972]]').join('{{by|1972}}');
t.value = t.value.split('[[1971 in baseball|1971]]').join('{{by|1971}}');
t.value = t.value.split('[[1970 in baseball|1970]]').join('{{by|1970}}');
t.value = t.value.split('[[1969 in baseball|1969]]').join('{{by|1969}}');
t.value = t.value.split('[[1968 in baseball|1968]]').join('{{by|1968}}');
t.value = t.value.split('[[1967 in baseball|1967]]').join('{{by|1967}}');
t.value = t.value.split('[[1966 in baseball|1966]]').join('{{by|1966}}');
t.value = t.value.split('[[1965 in baseball|1965]]').join('{{by|1965}}');
t.value = t.value.split('[[1964 in baseball|1964]]').join('{{by|1964}}');
t.value = t.value.split('[[1963 in baseball|1963]]').join('{{by|1963}}');
t.value = t.value.split('[[1962 in baseball|1962]]').join('{{by|1962}}');
t.value = t.value.split('[[1961 in baseball|1961]]').join('{{by|1961}}');
t.value = t.value.split('[[1960 in baseball|1960]]').join('{{by|1960}}');
t.value = t.value.split('[[1959 in baseball|1959]]').join('{{by|1959}}');
t.value = t.value.split('[[1958 in baseball|1958]]').join('{{by|1958}}');
t.value = t.value.split('[[1957 in baseball|1957]]').join('{{by|1957}}');
t.value = t.value.split('[[1956 in baseball|1956]]').join('{{by|1956}}');
t.value = t.value.split('[[1955 in baseball|1955]]').join('{{by|1955}}');
t.value = t.value.split('[[1954 in baseball|1954]]').join('{{by|1954}}');
t.value = t.value.split('[[1953 in baseball|1953]]').join('{{by|1953}}');
t.value = t.value.split('[[1952 in baseball|1952]]').join('{{by|1952}}');
t.value = t.value.split('[[1951 in baseball|1951]]').join('{{by|1951}}');
t.value = t.value.split('[[1950 in baseball|1950]]').join('{{by|1950}}');
t.value = t.value.split('[[1949 in baseball|1949]]').join('{{by|1949}}');
t.value = t.value.split('[[1948 in baseball|1948]]').join('{{by|1948}}');
t.value = t.value.split('[[1947 in baseball|1947]]').join('{{by|1947}}');
t.value = t.value.split('[[1946 in baseball|1946]]').join('{{by|1946}}');
t.value = t.value.split('[[1945 in baseball|1945]]').join('{{by|1945}}');
t.value = t.value.split('[[1944 in baseball|1944]]').join('{{by|1944}}');
t.value = t.value.split('[[1943 in baseball|1943]]').join('{{by|1943}}');
t.value = t.value.split('[[1942 in baseball|1942]]').join('{{by|1942}}');
t.value = t.value.split('[[1941 in baseball|1941]]').join('{{by|1941}}');
t.value = t.value.split('[[1940 in baseball|1940]]').join('{{by|1940}}');
t.value = t.value.split('[[1939 in baseball|1939]]').join('{{by|1939}}');
t.value = t.value.split('[[1938 in baseball|1938]]').join('{{by|1938}}');
t.value = t.value.split('[[1937 in baseball|1937]]').join('{{by|1937}}');
t.value = t.value.split('[[1936 in baseball|1936]]').join('{{by|1936}}');
t.value = t.value.split('[[1935 in baseball|1935]]').join('{{by|1935}}');
t.value = t.value.split('[[1934 in baseball|1934]]').join('{{by|1934}}');
t.value = t.value.split('[[1933 in baseball|1933]]').join('{{by|1933}}');
t.value = t.value.split('[[1932 in baseball|1932]]').join('{{by|1932}}');
t.value = t.value.split('[[1931 in baseball|1931]]').join('{{by|1931}}');
t.value = t.value.split('[[1930 in baseball|1930]]').join('{{by|1930}}');
t.value = t.value.split('[[1929 in baseball|1929]]').join('{{by|1929}}');
t.value = t.value.split('[[1928 in baseball|1928]]').join('{{by|1928}}');
t.value = t.value.split('[[1927 in baseball|1927]]').join('{{by|1927}}');
t.value = t.value.split('[[1926 in baseball|1926]]').join('{{by|1926}}');
t.value = t.value.split('[[1925 in baseball|1925]]').join('{{by|1925}}');
t.value = t.value.split('[[1924 in baseball|1924]]').join('{{by|1924}}');
t.value = t.value.split('[[1923 in baseball|1923]]').join('{{by|1923}}');
t.value = t.value.split('[[1922 in baseball|1922]]').join('{{by|1922}}');
t.value = t.value.split('[[1921 in baseball|1921]]').join('{{by|1921}}');
t.value = t.value.split('[[1920 in baseball|1920]]').join('{{by|1920}}');
t.value = t.value.split('[[1919 in baseball|1919]]').join('{{by|1919}}');
t.value = t.value.split('[[1918 in baseball|1918]]').join('{{by|1918}}');
t.value = t.value.split('[[1917 in baseball|1917]]').join('{{by|1917}}');
t.value = t.value.split('[[1916 in baseball|1916]]').join('{{by|1916}}');
t.value = t.value.split('[[1915 in baseball|1915]]').join('{{by|1915}}');
t.value = t.value.split('[[1914 in baseball|1914]]').join('{{by|1914}}');
t.value = t.value.split('[[1913 in baseball|1913]]').join('{{by|1913}}');
t.value = t.value.split('[[1912 in baseball|1912]]').join('{{by|1912}}');
t.value = t.value.split('[[1911 in baseball|1911]]').join('{{by|1911}}');
t.value = t.value.split('[[1910 in baseball|1910]]').join('{{by|1910}}');
t.value = t.value.split('[[1909 in baseball|1909]]').join('{{by|1909}}');
t.value = t.value.split('[[1908 in baseball|1908]]').join('{{by|1908}}');
t.value = t.value.split('[[1907 in baseball|1907]]').join('{{by|1907}}');
t.value = t.value.split('[[1906 in baseball|1906]]').join('{{by|1906}}');
t.value = t.value.split('[[1905 in baseball|1905]]').join('{{by|1905}}');
t.value = t.value.split('[[1904 in baseball|1904]]').join('{{by|1904}}');
t.value = t.value.split('[[1903 in baseball|1903]]').join('{{by|1903}}');
t.value = t.value.split('[[1902 in baseball|1902]]').join('{{by|1902}}');
t.value = t.value.split('[[1901 in baseball|1901]]').join('{{by|1901}}');
t.value = t.value.split('[[1900 in baseball|1900]]').join('{{by|1900}}');
t.value = t.value.split('[[Chargers]]').join('[[San Diego Chargers|Chargers]]');
t.value = t.value.split('==External Links==').join('==External links==');
t.value = t.value.split('==See Also==').join('==See also==');
document.editform.wpMinoredit.checked = true;
f.wpSummary.value = "Copyedited.";
}
function gentab()
{
// Only add for pages with the right string somewhere in the title
if (document.title.indexOf("Editing ") != -1)
{
addPortletLink('p-cactions', 'javascript:generalmain()', "Copyedit");
}
}
addOnloadHook(gentab);
// </pre>