Didn't work at all in Monobook, Modern, Vector, or any derived skin, for
who knows how long. Only one caller, which was using it to autofocus,
which is a bad idea anyway because it will cause the focus to happen too
late, often after the user has already interacted with the page. Any
legitimate callers may as well just add the onload in pure JS without
adding an attribute to the body.
$classes[] = $attribs['class'];
$attribs['class'] = implode( ' ', $classes );
}
-
- # Set focus to the edit box on load, except on preview or diff, where it would interfere with the display
- if ( !$this->preview && !$this->diff ) {
- global $wgOut;
- $wgOut->setOnloadHandler( 'document.editform.wpTextbox1.focus();' );
- }
$this->showTextbox( isset($textoverride) ? $textoverride : $this->textbox1, 'wpTextbox1', $attribs );
}
var $mAllowUserJs;
var $mSuppressQuickbar = false;
- var $mOnloadHandler = '';
var $mDoNothing = false;
var $mContainsOldMagic = 0, $mContainsNewMagic = 0;
var $mIsArticleRelated = true;
public function setPrintable() { $this->mPrintable = true; }
public function isPrintable() { return $this->mPrintable; }
public function getFeedAppendQuery() { return $this->mFeedLinksAppendQuery; }
- public function setOnloadHandler( $js ) { $this->mOnloadHandler = $js; }
- public function getOnloadHandler() { return $this->mOnloadHandler; }
public function disable() { $this->mDoNothing = true; }
public function isDisabled() { return $this->mDoNothing; }
$s = 'document.location = "' .Xml::escapeJsString( $s ) .'";';
$a += array( 'ondblclick' => $s );
}
- $a['onload'] = $wgOut->getOnloadHandler();
$a['class'] =
'mediawiki' .
' '.( $wgContLang->getDir() ).