Benutzer:WWWIG/monobook.js: Unterschied zwischen den Versionen

Aus Watch-Wiki
Zur Navigation springen Zur Suche springen
(+ Edit Script Teil 1)
Zeile 4: Zeile 4:
 
importScript('MediaWiki:Gadget-CheckRCForm.js');
 
importScript('MediaWiki:Gadget-CheckRCForm.js');
 
importScript('MediaWiki:Gadget-CatGenRepairForm.js');
 
importScript('MediaWiki:Gadget-CatGenRepairForm.js');
 +
 +
if ( wgAction=="edit" &&
 +
    wgNamespaceNumber==0 &&
 +
    document.getElementById( 'wpTextbox1' ).value.indexOf('{{Andere Sprachen|') != -1)
 +
addOnloadHook(function() {
 +
 +
  if ( t_Position = document.getElementById( 'firstHeading' ) ) {
 +
 +
      var t_NewElement = document.createElement('input');
 +
      t_NewElement.setAttribute( 'id', 'mw-new-element' );
 +
      t_NewElement.setAttribute( 'type', 'button' );
 +
      t_NewElement.setAttribute( 'onclick', 'do_new_action();' );
 +
 +
      t_Position.appendChild( t_NewElement );
 +
  }
 +
});
 +
 +
function do_new_action() {
 +
  alert( 'Go' );
 +
}

Version vom 27. Juli 2011, 06:41 Uhr

/* -- */
// my_vkdebug = true;

importScript('MediaWiki:Gadget-CheckRCForm.js');
importScript('MediaWiki:Gadget-CatGenRepairForm.js');

if ( wgAction=="edit" &&
     wgNamespaceNumber==0 &&
     document.getElementById( 'wpTextbox1' ).value.indexOf('{{Andere Sprachen|') != -1)
addOnloadHook(function() {
 
   if ( t_Position = document.getElementById( 'firstHeading' ) ) {
 
      var t_NewElement = document.createElement('input');
      t_NewElement.setAttribute( 'id', 'mw-new-element' );
      t_NewElement.setAttribute( 'type', 'button' );
      t_NewElement.setAttribute( 'onclick', 'do_new_action();' );
 
      t_Position.appendChild( t_NewElement );
   }
});

function do_new_action() {
   alert( 'Go' );
}