r77148 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77147‎ | r77148 | r77149 >
Date:12:57, 23 November 2010
Author:raymond
Status:ok
Tags:
Comment:
(bug 21911) Per Tim Starling's comment #10: Remove hard coded limit for long page warning.
New message [[MediaWiki:Longpage-hint]] (empty per default) can be used instead.
Parameters: $1 shows the formatted textsize in Byte/KB/MB, $2 is the raw number of the textsize in Byte for calculation with PerserFunctions
(yes, I know that PerserFunctions are not in core, unfortunately, but every installation I know or attend have it)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -581,7 +581,7 @@
582582 'copyrightwarning',
583583 'copyrightwarning2',
584584 'editpage-tos-summary',
585 - 'longpagewarning',
 585+ 'longpage-hint',
586586 'longpageerror',
587587 'readonlywarning',
588588 'protectedpagewarning',
Index: trunk/phase3/maintenance/language/messageTypes.inc
@@ -168,6 +168,7 @@
169169 'editpage-tos-summary',
170170 'addsection-preload',
171171 'addsection-editintro',
 172+ 'longpage-hint',
172173 );
173174
174175 /** Optional messages, which may be translated only if changed in the target language. */
Index: trunk/phase3/includes/EditPage.php
@@ -1457,13 +1457,16 @@
14581458 }
14591459
14601460 if ( $this->tooBig || $this->kblength > $wgMaxArticleSize ) {
1461 - $wgOut->addHTML( "<div class='error' id='mw-edit-longpageerror'>\n" );
1462 - $wgOut->addWikiMsg( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) );
1463 - $wgOut->addHTML( "</div>\n" );
1464 - } elseif ( $this->kblength > 29 ) {
1465 - $wgOut->addHTML( "<div id='mw-edit-longpagewarning'>\n" );
1466 - $wgOut->addWikiMsg( 'longpagewarning', $wgLang->formatNum( $this->kblength ) );
1467 - $wgOut->addHTML( "</div>\n" );
 1461+ $wgOut->wrapWikiMsg( "<div class='error' id='mw-edit-longpageerror'>\n$1\n</div>",
 1462+ array( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) ) );
 1463+ } else {
 1464+ $msg = 'longpage-hint';
 1465+ $text = wfMsg( $msg );
 1466+ if( !wfEmptyMsg( $msg, $text ) && $text !== '-' ) {
 1467+ $wgOut->wrapWikiMsg( "<div id='mw-edit-longpage-hint'>\n$1\n</div>",
 1468+ array( 'longpage-hint', $wgLang->formatSize( strlen( $this->textbox1 ) ), strlen( $this->textbox1 ) )
 1469+ );
 1470+ }
14681471 }
14691472 }
14701473
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1337,9 +1337,7 @@
13381338 You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see $1 for details).
13391339 '''Do not submit copyrighted work without permission!'''",
13401340 'editpage-tos-summary' => '-', # do not translate or duplicate this message to other languages
1341 -'longpagewarning' => "'''Warning:''' This page is $1 kilobytes long;
1342 -some browsers may have problems editing pages approaching or longer than 32kb.
1343 -Please consider breaking the page into smaller sections.",
 1341+'longpage-hint' => '-', # do not translate or duplicate this message to other languages
13441342 'longpageerror' => "'''Error: The text you have submitted is $1 kilobytes long, which is longer than the maximum of $2 kilobytes.'''
13451343 It cannot be saved.",
13461344 'readonlywarning' => "'''Warning: The database has been locked for maintenance, so you will not be able to save your edits right now.'''
Index: trunk/phase3/RELEASE-NOTES
@@ -210,6 +210,10 @@
211211 * When viewing a redirect, the redirect arrow and redirection target are both
212212 wrapped in a div that has the class "redirectMsg" so that the redirection
213213 arrow can be customized with CSS
 214+* (bug 21911) Hard coded limit for long page warning removed. New message
 215+ [[MediaWiki:Longpage-hint]] (empty per default) can be used instead.
 216+ Parameters: $1 shows the formatted textsize in Byte/KB/MB, $2 is the raw
 217+ number of the textsize in Byte
214218
215219 === Bug fixes in 1.17 ===
216220 * (bug 17560) Half-broken deletion moved image files to deletion archive

Status & tagging log