User:PresN/monobook.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.
// [[User:Outriggr/metadatatest.js]] importScript('User:Outriggr/metadatatest.js'); defaultProject = "Cvgproj"; //Interiot's javascript edit counter if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) { document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); } //AddLiLink function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) { if(key && title) { ta[id] = [key, title]; } else if(key) { ta[id] = [key, '']; } else if(title) { ta[id] = ['', title]; } } // re-render the title and accesskeys from existing code in wikibits.js akeytt(); return li; } //AddTab function addTab(url, name, id, title, key){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; return addlilink(tabs, url, name, id, title, key) }; // From code by [[User:Raylu|raylu]] // // // This script adds a "CVG Deletion" tab to the top of article pages // when in edit mode. It is disabled for the User namespace. function doCvgdeletion() { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '{' + '{' + 'subst' + ':' + 'CVG' + ' ' + 'deletion' + '}' + '}'; document.editform.wpSummary.value = 'Now a CVG deletion.'; document.editform.wpMinoredit.checked = true; document.editform.submit(); } function addCvgdeletion() { addTab("javascript:doCvgdeletion()", "cvgdeletion", "ca-cvgdeletion", "CVG Deletion", ""); akeytt(); } addOnloadHook(function() { if (document.title.indexOf("User:") != -1 || document.title.indexOf("User talk:") != -1) { return; } if (document.title.indexOf("Editing ") != -1) { addOnloadHook(addCvgdeletion); } }); //Tag article as a CVG proj page, no class or importance function doCvgproj() { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '{' + '{' + 'cvgproj' + '}' + '}'; document.editform.wpSummary.value = 'Part of the Video Games Wikiproject'; document.editform.wpMinoredit.checked = true; document.editform.submit(); } function addCvgproj() { addTab("javascript:doCvgproj()", "cvgproj", "ca-cvgproj", "CVG Project", ""); akeytt(); } addOnloadHook(function() { if (document.title.indexOf("User:") != -1 || document.title.indexOf("User talk:") != -1) { return; } if (document.title.indexOf("Editing ") != -1) { addOnloadHook(addCvgproj); } }); //Tag article as a CVG proj stub page, no importance rating function doCvgstub() { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '{' + '{' + 'cvgproj' + '|' + 'class' + '=' + 'stub' + '|' + 'importance' + '=' + '}' + '}'; document.editform.wpSummary.value = 'Tagged as a stub-class article of the Video Games Wikiproject'; document.editform.wpMinoredit.checked = true; document.editform.submit(); } function addCvgstub() { addTab("javascript:doCvgstub()", "cvgstub", "ca-cvgstub", "CVG Project Stub", ""); akeytt(); } addOnloadHook(function() { if (document.title.indexOf("User:") != -1 || document.title.indexOf("User talk:") != -1) { return; } if (document.title.indexOf("Editing ") != -1) { addOnloadHook(addCvgstub); } }); //Tag article as a CVG proj start page, no importance rating function doCvgstart() { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '{' + '{' + 'cvgproj' + '|' + 'class' + '=' + 'start' + '|' + 'importance' + '=' + '}' + '}'; document.editform.wpSummary.value = 'Tagged as a start-class article of the Video Games Wikiproject'; document.editform.wpMinoredit.checked = true; document.editform.submit(); } function addCvgstart() { addTab("javascript:doCvgstart()", "cvgstart", "ca-cvgstart", "CVG Project Start", ""); akeytt(); } addOnloadHook(function() { if (document.title.indexOf("User:") != -1 || document.title.indexOf("User talk:") != -1) { return; } if (document.title.indexOf("Editing ") != -1) { addOnloadHook(addCvgstart); } }); //Tell user to join CVGproj function doCvgjoin() { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '==New Video Game Article==' +'\n\n' + 'Hey! I saw that you created a new video game related article- consider joining the ' + '[' + '[' + 'Wikipedia:WikiProject_Video_games' + '|' + 'Video Games WikiProject' + ']' + ']' + '! I have added your article to the list of ' + '[' + '[' + 'Wikipedia:WikiProject Video games#New Articles' + '|' + 'new articles' + ']' + ']' + ', and attributed it to you. --' + '~' + '~' + '~' + '~'; document.editform.wpSummary.value = '==New Video Game Article=='; document.editform.wpMinoredit.checked = false; document.editform.submit(); } function addCvgjoin() { addTab("javascript:doCvgjoin()", "cvgjoin", "ca-cvgjoin", "CVG Project Join", ""); akeytt(); } addOnloadHook(function() { if (document.title.indexOf("Editing ") != -1) { addOnloadHook(addCvgjoin); } });