User:Caeonic/monobook.js

importScript('User:AzaToth/twinkle.js'); TwinkleConfig = { revertMaxRevisions             :       50, userTalkPageMode               :       'window', showSharedIPNotice             :       true, openTalkPage                   :       [ 'agf', 'norm', 'vand' ], openTalkPageOnAutoRevert       :       false, openAOLAnonTalkPage            :       false, summaryAd                      :       "", deletionSummaryAd              :       "", protectionSummaryAd            :       "", watchSpeedyPages               :       [ 'g3', 'g5', 'g10', 'g11', 'g12' ], watchProdPages                 :       true, openUserTalkPageOnSpeedyDelete :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ], watchRevertedPages             :       [ 'agf', 'norm', 'vand', 'torev' ], markRevertedPagesAsMinor       :       [ 'agf', 'norm', 'vand', 'torev' ] };

importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklefluff.js');

//Section Zero addOnloadHook(function { var x; if (!(x = document.getElementById('ca-edit') )) return; var url; if (!(url = x.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return; var y = mw.util.addPortletLink('p-cactions', url+"&section=0", '0', 'ca-edit-0', 'Edit the lead section of this page', '0', x.nextSibling);

y.className = x.className; // steal classes from the the edit tab... x.className = 'istalk';    // ...and make the edit tab have no right margin

// exception: don't steal the "selected" class unless actually editing section 0: if (/(^| )selected( |$)/.test(y.className)) { if (!document.editform || !document.editform.wpSection y.className = y.className.replace(/(^| )selected( |$)/g, "$1"); x.className += ' selected'; } } }); //End Section Zero
 * document.editform.wpSection.value != "0") {

//"Changes since my last edit" tab

//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510 function addSinceTab { if (window.location.href.indexOf("&action=history&gotosince=true")!=-1) { do_since_I_last_edited }   else if (wgCanonicalNamespace != "Special") { mw.util.addPortletLink("p-cactions", "/w/index.php?title="+wgPageName+"&action=history&gotosince=true", 'since', '', "since"); } } function do_since_I_last_edited { var csub=document.getElementById("contentSub"); var msg=document.createElement("p"); msg.appendChild(document.createTextNode                       ("Parsing history... please wait...")); msg.className="error"; csub.insertBefore(msg, csub.firstChild)

var username=document.getElementById("pt-userpage").textContent; var hists=document.getElementById("pagehistory").getElementsByTagName('li'); for (n=0;n= 0) addOnloadHook(function{ var pCactions = document.getElementById('p-cactions'); if (!pCactions) return; var caMain = pCactions.getElementsByTagName('li')[0]; var caTalk = document.getElementById('ca-talk'); var caEdit = document.getElementById('ca-edit'); if (!caEdit) caEdit = document.getElementById('ca-viewsource'); var caHistory = document.getElementById('ca-history'); if (!caMain || !caTalk || !caEdit || !caHistory) return; var el_move, el_create, id2; if (wgNamespaceNumber % 2) { //talk space  el_move = caTalk; el_create = caMain; id2 = ''; } else {   el_move = caMain; el_create = caTalk; id2 = 'discussion'; } caEdit.firstChild.innerHTML = 'edit'; caHistory.firstChild.innerHTML = 'hist'; el_move.parentNode.insertBefore(caHistory, el_move.nextSibling); el_move.parentNode.insertBefore(caEdit, el_move.nextSibling); var href = el_create.firstChild.getAttribute('href', 2); if (el_create.className.indexOf('new') < 0){ mw.util.addPortletLink('p-cactions', href + '?action=history', 'hist',    'ca-history-'+id2, id2+' history', '', el_create.nextSibling); mw.util.addPortletLink('p-cactions', href + '?action=edit', 'edit',    'ca-edit-'+id2, 'Edit '+id2, '', el_create.nextSibling); }  caMain.style.marginRight = '0.3em'; caTalk.style.marginRight = '0.3em'; caTalk.style.marginLeft = '1.6em'; })

// install User:Cacycle/wikEdDiff enhanced diff view using ajax document.write(' '); //

//adds "contibs" tab to user and user talk pages if (wgNamespaceNumber == 2 || wgNamespaceNumber == 3) { var uname = wgPageName.match(/[^:]*:([^\/]*)/); if (uname.length > 1) addOnloadHook(function {           mw.util.addPortletLink("p-cactions", "http://en.wikipedia.org/wiki/Special:Contributions/" + uname[1], "contribs", "ca-contribs", "Contributions", undefined, document.getElementById("ca-move") || document.getElementById("ca-watch"));       }); }