From: Aryeh Gregor Date: Fri, 15 Jan 2010 00:55:51 +0000 (+0000) Subject: Remove OutputPage::{get,set}OnloadHandler() X-Git-Tag: 1.31.0-rc.0~38266 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=2f0d048cc69a1edfea1075b00251ed13507967d2;p=lhc%2Fweb%2Fwiklou.git Remove OutputPage::{get,set}OnloadHandler() 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. --- diff --git a/includes/EditPage.php b/includes/EditPage.php index bb325b8032..db2935ee77 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1684,12 +1684,6 @@ INPUTS $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 ); } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 6b2a97d63c..8bd6906cb3 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -21,7 +21,6 @@ class OutputPage { var $mAllowUserJs; var $mSuppressQuickbar = false; - var $mOnloadHandler = ''; var $mDoNothing = false; var $mContainsOldMagic = 0, $mContainsNewMagic = 0; var $mIsArticleRelated = true; @@ -388,8 +387,6 @@ class OutputPage { 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; } diff --git a/includes/Skin.php b/includes/Skin.php index ced9b16280..9cc94f487d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -672,7 +672,6 @@ CSS; $s = 'document.location = "' .Xml::escapeJsString( $s ) .'";'; $a += array( 'ondblclick' => $s ); } - $a['onload'] = $wgOut->getOnloadHandler(); $a['class'] = 'mediawiki' . ' '.( $wgContLang->getDir() ).