Jump to content

User:Lmcelhiney/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>
    
// [[User:Lupin/popups.js]]      

document.write('<script type="text/javascript" src="'          
+ 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'       
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
  mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }

// installation of the wikEd editing page extension

// install [[User:Cacycle/diff]] text diff code
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Pilaf/Live_Preview]] page preview tool
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Mboverload/RegExTypoFix|RegExTypoFix]] common typo fixer
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/RegExTypoFix.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Cacycle/wikEd international]] translation here

// install [[User:Cacycle/wikEd]] editing page extension
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');


//AUTO ARCHIVE
//Written by GeorgeMoney

//The header to put on top of all archives (if the archive is in 'w' mode (modes explained below))
var archiveheader = 'User:Lmcelhiney Archive';

//Your talk page header for use when archiving. Remember to keep the <noinclude> tags or else your archive will have your talk page header along with it.
var talkheader = '<noinclude>{{User:Lmcelhiney/Archive}}</noinclude>';

//Your talk page archive page. Insert "NUMBER" where the number of archive you are on goes. (Dont put a real number!! just put the text "NUMBER")
var archiveurl = "User_talk:Lmcelhiney/Archive1";

//The mode to archive your talk page. Making this value 'a' will make the script add your archive to the bottom of the current archive. 

//Making it 'w' will totally erase the contents of the current archive (usually you should set the current archive value to a new archive to avoid erasing old archives, 
//where as in append mode (a), you should set it to your current archive to append the contents)
var archivemode = 'a';

//do not edit below this line
var mtyalk = ("User talk:"+wgUserName).replace(/ /g, '_');
var wikiurl = mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace('$1', '');
if(readCookie('archive1') == 'yes' && window.location.href.indexOf('archivestep') == -1) { (window.location.href) = document.getElementById('ca-edit').firstChild.href+'&archivestep=2'; }
function changearccontents() {
document.title = "Archival Script Manager";
document.getElementById('bodyContent').innerHTML = 
'<div class="dontshow" style="display: none !important;"></div>\n' +
'<h1 class="firstHeading" style="display:block;">Archive Script Manager</h1>\n' +
'Current archive number (the one that you haven\'t done yet (like if I want to archive to archive 2 then that is the next one not done)): <br> <input type="text" id="archnuminput" value="' + readCookie('archivenum') + '"  size="1" maxlength="4" /> <input type="button" value="save number" onclick="createCookie(\'archivenum\', document.getElementById(\'archnuminput\').value); document.getElementById(\'arclink\').href = wikiurl+archiveurl.replace(\'NUMBER\',readCookie(\'archivenum\'))+\'?action=edit&archivestep=1\';" /><br><br>\n'+
'<a href="'+wikiurl+archiveurl.replace('NUMBER',readCookie('archivenum'))+'?action=edit&archivestep=1" id="arclink" style="font-size: 2em; font-weight: bold;">Click here to begin the archive</a><br>\n' +
'';
document.write('<style type="text/css">.firstHeading, .editsection {display:none;} .dontshow { display: none !important; } #content {background: honeydew !important; border: 3px solid green;} #p-cactions {display: none;}</style>');
}

if(window.location.href.indexOf('archivemanage') != -1||window.location.href.indexOf('Archivemanage') != -1) {
addOnloadHook(function(){ changearccontents(); });
}
if (window.location.href.indexOf('archivestep=1') != -1 && window.location.href.indexOf('action=edit') != -1) {
addOnloadHook(function (){
  if(!readCookie('archivenum') != 'yes') { (window.location.href) = wikiurl+'User:GeorgeMoney/archivemanage' }
  if(archivemode == 'a') {
  document.getElementById('wpTextbox1').value += "\n{{sub"+"st:"+mytalk+"}}";
  } else {
  document.getElementById('wpTextbox1').value = archiveheader+"\n{{sub"+"st:"+mytalk+"}}";
  }
  document.getElementById('wpSummary').value = "JS: Copying talkpage to archive";
  createCookie('archive1', 'yes');
  document.getElementById('editform').submit();
});
}
if (window.location.href.indexOf('archivestep=2') != -1 && window.location.href.indexOf('action=edit') != -1) {
addOnloadHook(function (){
  if(readCookie('archive1') != 'yes') { alert("You shouldn't be at \"&archivestep=2\" because you haven't completed &archivestep=1. Please read the instructions on this archiving script. Redirecting to archive manager. "); (window.location.href) = wikiurl+'User:GeorgeMoney/archivemanage'; return; }
  createCookie('archive1', 'no');
  document.getElementById('wpTextbox1').value = talkheader;
  document.getElementById('wpSummary').value = "JS: Archiving talk page";
  document.getElementById('editform').submit();
});
}
//-------
//
// </nowiki>