Zum Inhalt springen

„MediaWiki:Gadget-old-movepage.js“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
Inhalt gelöscht Inhalt hinzugefügt
K -using 'mediawiki.special.movePage'
K correct label for to new input
Zeile 16: Zeile 16:
wpNewTitleNs.remove(); //the scroll down box
wpNewTitleNs.remove(); //the scroll down box
$( '#new-movepage-hint' ).remove(); //remove hint to new function in [[MediaWiki:Movepagetext-noredirectfixer]]
$( '#new-movepage-hint' ).remove(); //remove hint to new function in [[MediaWiki:Movepagetext-noredirectfixer]]
$( 'label[for="wpNewTitleMain"]' ).attr( 'for', 'wpNewTitle' ); //correct label for to new input
});
});
}
}

Version vom 7. Mai 2012, 16:53 Uhr

/* This scripts replaced the new scrolldown/input field ([[rev:110209]]) on the movepage with the old one */
if( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Movepage' ) {
 $( function() {
  var wpNewTitleMain = $( '#wpNewTitleMain' );
  var wpNewTitleNs = $( '#wpNewTitleNs' );
  if( !wpNewTitleMain.length || !wpNewTitleNs.length ) {
   return;
  }
  //build the title from the scrolldown
  var namespaceText = mw.config.get( 'wgFormattedNamespaces' )[ wpNewTitleNs.val() ];
  var titleText = wpNewTitleMain.val();
  var preloadTitle = namespaceText !== '' ? namespaceText + ':' + titleText : titleText;
  var input = $( '<input name="wpNewTitle" size="60" type="text" id="wpNewTitle" />' );
  input.val( preloadTitle ); //preload input with a title
  wpNewTitleMain.replaceWith( input ); //replace the new input with the old
  wpNewTitleNs.remove(); //the scroll down box
  $( '#new-movepage-hint' ).remove(); //remove hint to new function in [[MediaWiki:Movepagetext-noredirectfixer]]
  $( 'label[for="wpNewTitleMain"]' ).attr( 'for', 'wpNewTitle' ); //correct label for to new input
 });
}