User:Zefram/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. If this is a .js page, the code will be executed when previewing the page.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
 /*
  * Section0-Edit-Button
  * basiert auf [[Benutzer:St-fl/nurEinleitungbearbeiten.js]] (Version 22:25, 22. Jan. 2007)
  */
 addOnloadHook(function () {
     // Link einfügen wenn id='ca-edit' vorhanden
     if ( document.getElementById('ca-edit') ) {
         // id='ca-edit' als id='ca-edittop' clonen und entsprechend anpassen
         var editTop = document.getElementById('ca-edit').cloneNode(true);
         editTop.id = 'ca-edittop';
         editTop.class = 'istalk';
         // geclonten Link usw. anpassen
         var editTopLink = editTop.firstChild;
         editTopLink.accessKey = '';
         editTopLink.title = 'Nur Einleitung bearbeiten.';
         editTopLink.href = editTopLink.href.replace(/&action=edit/g, '&action=edit&section=0');
         editTopLink.firstChild.nodeValue = 'S0';
         // id='ca-edittop' ins DOM hinter id='ca-edit' einfügen
         document.getElementById('ca-edit').parentNode.insertBefore(editTop, document.getElementById('ca-edit').nextSibling);
     }
     // Falls URL „editTop“ besagt
     if( window.location.href.indexOf('&action=edit&section=0') > 0 ) {
         // Falls Bearbeiten-Fenster vorhanden
         if ( document.editform ) {
             // Falls Zusammenfassung leer
             if ( document.editform.wpSummary.value == '' ) {
                 // Dann Zusammenfassung == '/* Einleitung */ '
                 document.editform.wpSummary.value = '/* Einleitung */ ';
             }
         }
     }
});
 /*
  * Ende Section0-Edit-Button
  */
 
 
 /*
  * Umbenennungen
  */
 function Umbenennungen() {
     document.getElementById('ca-talk').firstChild.firstChild.nodeValue = 'Disk';
     document.getElementById('ca-edit').firstChild.firstChild.nodeValue = 'Edit';
     document.getElementById('ca-history').firstChild.firstChild.nodeValue = 'History';
     document.getElementById('ca-move').firstChild.firstChild.nodeValue = 'Move';
     document.getElementById('ca-unwatch').firstChild.firstChild.nodeValue = 'Entobachten';
 }
 addOnloadHook(Umbenennungen);
 /*
  * Ende Umbenennungen
  */