MediaWiki talk:Common.js/Archive 12
Appearance
Log page field labels
Perhaps there have been more people than me feeling that the field labels on the Special:Log doesn't always fit. I propose following script, that will update the field names according to the wanted action, at the moment, only for block is changed, but it's easy to update for the other actions also. →AzaToth 01:18, 2 November 2007 (UTC)
if( wgCanonicalSpecialPageName == 'Log' ) {
var form = document.forms[0];
var labels = form.getElementsByTagName( 'label' );
// Save the given text from the beginning, first one is the "user" field, and the nect one is the "page" field;
var old = {};
old.user = labels[0].textContent;
old.page = labels[1].textContent;
var logLabelCallback = function logLabelCallback( event ) {
var form = event.target;
var value = form.type.value;
labels = form.getElementsByTagName( 'label' );
switch( value ) {
case 'block':
labels[0].textContent = 'Blocker:';
labels[1].textContent = 'Blockee:';
break;
default:
labels[0].textContent = old.user;
labels[1].textContent = old.page;
break;
}
}
// We add an event listener to the callback in the form element
form.addEventListener( 'change', logLabelCallback, false );
// to make it "pop up" on load, we initiate an change event
var evt = document.createEvent( "Event" );
evt.initEvent( 'change', true, true );
form.dispatchEvent( evt );
}
- 1) I don't think it's important enough to warrant a script; 2) this would break interface for users with custom language in preferences; 3) stop trying to make Common.js IE-incompatible, you've yet to come back and fix Sysop.js :) ∴ AlexSm 04:22, 2 November 2007 (UTC)
- Agree with Alex, this adds way to much code for such a minor fix. This sohuld just be fixed in MediaWiki instead. —Ruud 16:32, 2 November 2007 (UTC)