Benutzer:WWWIG/monobook.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
WWWIG (Diskussion | Beiträge) (+ Edit Script Teil 1c) |
WWWIG (Diskussion | Beiträge) (+ Edit Script Teil 1d) |
||
| Zeile 25: | Zeile 25: | ||
if ( ( t_PositionStart = t_Inhalt.indexOf('{{Andere Sprachen|') ) != -1 ) { | if ( ( t_PositionStart = t_Inhalt.indexOf('{{Andere Sprachen|') ) != -1 ) { | ||
t_PositionEnd = t_Inhalt.indexOf('}}', t_PositionStart ); | t_PositionEnd = t_Inhalt.indexOf('}}', t_PositionStart ); | ||
| − | var t_Andere_Sprachen = t_Inhalt.slice( t_PositionStart, t_PositionEnd ); | + | var t_Andere_Sprachen = t_Inhalt.slice( t_PositionStart, t_PositionEnd + 2 ); |
| + | |||
| + | t_Inhalt = t_Inhalt.replace( t_Andere_Sprachen + "\r\n", "" ); | ||
| + | t_Inhalt = t_Inhalt.replace( t_Andere_Sprachen, "" ); | ||
| + | document.getElementById( 'wpTextbox1' ).value = t_Inhalt; | ||
alert( 'Go' + t_PositionStart + '/' + t_PositionEnd + '/' + t_Andere_Sprachen ); | alert( 'Go' + t_PositionStart + '/' + t_PositionEnd + '/' + t_Andere_Sprachen ); | ||
} | } | ||
} | } | ||
Version vom 27. Juli 2011, 06:18 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' ) ) return;
var t_Inhalt = document.getElementById( 'wpTextbox1' ).value;
if ( ( t_PositionStart = t_Inhalt.indexOf('{{Andere Sprachen|') ) != -1 ) {
t_PositionEnd = t_Inhalt.indexOf('}}', t_PositionStart );
var t_Andere_Sprachen = t_Inhalt.slice( t_PositionStart, t_PositionEnd + 2 );
t_Inhalt = t_Inhalt.replace( t_Andere_Sprachen + "\r\n", "" );
t_Inhalt = t_Inhalt.replace( t_Andere_Sprachen, "" );
document.getElementById( 'wpTextbox1' ).value = t_Inhalt;
alert( 'Go' + t_PositionStart + '/' + t_PositionEnd + '/' + t_Andere_Sprachen );
}
}