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

Aus Watch-Wiki
Zur Navigation springen Zur Suche springen
(+ Edit Script Teil 1)
(+ Edit Script Teil 1a)
Zeile 6: Zeile 6:
  
 
if ( wgAction=="edit" &&
 
if ( wgAction=="edit" &&
     wgNamespaceNumber==0 &&
+
     wgNamespaceNumber==0 )
    document.getElementById( 'wpTextbox1' ).value.indexOf('{{Andere Sprachen|') != -1)
 
 
addOnloadHook(function() {
 
addOnloadHook(function() {
 
   
 
   
Zeile 22: Zeile 21:
  
 
function do_new_action() {
 
function do_new_action() {
   alert( 'Go' );
+
   if ( document.getElementById( 'wpTextbox1' ).value.indexOf('{{Andere Sprachen|') != -1 ) {
 +
      alert( 'Go' );
 +
  }
 
}
 
}

Version vom 27. Juli 2011, 06:43 Uhr

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

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

if ( wgAction=="edit" &&
     wgNamespaceNumber==0 )
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() {
   if ( document.getElementById( 'wpTextbox1' ).value.indexOf('{{Andere Sprachen|') != -1 ) {
      alert( 'Go' );
   }
}