Last modified: 2007-07-10 21:48:09 UTC
In function returnToMain() of OutputPage, use a global variable instead of the magic number 10 so the refresh delay can be configured in LocalSettings.php. The default delay may be too long. For instance with 5 seconds the message still could be read and the user would not have to click the link. Proposed solution: $wgRedirectDelay = 10;
"Too long" and "too short", for reading purposes, is subjective.
Agreed. That's why the wiki administrator should be able to decide the issue. For instance, why 10 instead of 9 or 11?
Why do we have a delayed redirect anyway? Those are evil. Slow readers, opening in another tab, tiny screens so you haven't even scrolled down to the message before it goes away, slow output devices like screen readers . . .
We should remove the delayed redirects entirely; they're poorly accessible and annoying to everyone.
Agreed. I think that would make implementation of Bug 7129 even more valuable.
As a temporary fix until/unless all redirects are made seamless (either via AJAX or removing them entirely), here's a fix for OutputPage.php. Setting $wgRedirectDelay in DefaultSettings to 10 will leave functionality as it is now, but of course users can override that in their LocalSettings Index: OutputPage.php =================================================================== --- OutputPage.php (revision 23952) +++ OutputPage.php (working copy) @@ -1076,7 +1076,7 @@ * @param $returnto page title to return to. Default is Main Page. */ public function returnToMain( $auto = true, $returnto = NULL ) { - global $wgUser, $wgOut, $wgRequest; + global $wgUser, $wgOut, $wgRequest, $wgRedirectDelay; if ( $returnto == NULL ) { $returnto = $wgRequest->getText( 'returnto' ); @@ -1100,7 +1100,7 @@ $r = wfMsg( 'returnto', $link ); if ( $auto ) { - $wgOut->addMeta( 'http:Refresh', '10;url=' . $titleObj->escapeFullURL() ); + $wgOut->addMeta( 'http:Refresh', $wgRedirectDelay';url=' . $titleObj->escapeFullURL() ); } $wgOut->addHTML( "\n<p>$r</p>\n" ); }
Timed redirect removed in r23979.