Benutzer:Ireas/monobook.js
aus Wikipedia, der freien Enzyklopädie
Hinweis: Leere nach dem Speichern den Browser-Cache, um die Änderungen zu sehen: Mozilla/Firefox: Shift-Strg-R, Internet Explorer: Strg-F5, Opera: F5, Safari: ⌘-R (bzw. Strg-R), Konqueror: Strg-R.
//<pre><nowiki> // ursprünglich von DerHexer if (wgUserName == 'Ireas') { if (document.cookie) { var monobooktype = ''; var cookies = document.cookie; cookies = cookies.split(';'); for (i=0; i<cookies.length; i++) { var cookienames = cookies[i].split('=')[0]; var cookievalues = cookies[i].split('=')[1]; if (cookienames.search('monobooktype') != -1) { monobooktype = cookievalues; } } if (monobooktype == '') monobooktype='PDD'; } addOnloadHook(function() { // put onload in wikibits.js // From [[:en:Wikipedia:WikiProject_User_scripts/Scripts/Add_LI_link]] function aswcAddlilink(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); // to end ta_hi = document.getElementById('ca-history'); // to versions tab if (ta_hi) tabs.insertBefore(li, ta_hi); if (id) { if (key && title) ta[id] = [key, title]; else if (key) ta[id] = [key, '']; else if (title) ta[id] = ['', title]; } akeytt(); // re-render the title and accesskeys from existing code in wikibits.js return li }; aswcAddlilink(document.getElementById('p-cactions').getElementsByTagName('ul')[0], "javascript:changemonobook();", /* LOCALIZABLE STRINGS START */ "Change" , "ca-change", "change", "" /* LOCALIZABLE STRINGS END */); }); function changemonobook() { addition = new Date(); addition = new Date(addition.getTime() +1000*60*60*24*365); if (document.cookie) { var cookies = document.cookie; cookies = cookies.split(';'); for (i=0; i<cookies.length; i++) { var cookienames = cookies[i].split('=')[0]; var cookievalues = cookies[i].split('=')[1]; if (cookienames.search('monobooktype') != -1) { if (cookievalues.search('PDD') != -1) { monobooktype = "1"; } else { monobooktype = "PDD"; } document.cookie = 'monobooktype=' + monobooktype + '; path=/; expires=' + addition.toGMTString + ';'; location.href = location; } else { document.cookie = 'monobooktype=PDD; path=/; expires=' + addition.toGMTString + ';'; } } } } document.write('<script type="text/javascript" src="' + 'http://de.wikipedia.org/w/index.php?title=Benutzer:Ireas/monobook-' + monobooktype + '.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); } else { document.write('<script type="text/javascript" src="' + 'http://de.wikipedia.org/w/index.php?title=Benutzer:Ireas/monobook-PDD.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); } //</nowiki></pre> //DÜP-Monobook-Import ([[Benutzer:Forrester/düp-monobook.js]]) importScript('Benutzer:Forrester/düp-monobook.js');