(bug 21911) Per Tim Starling's comment #10: Remove hard coded limit for long page...
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 23 Nov 2010 12:57:27 +0000 (12:57 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 23 Nov 2010 12:57:27 +0000 (12:57 +0000)
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)

RELEASE-NOTES
includes/EditPage.php
languages/messages/MessagesEn.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc

index 9385101..a18e376 100644 (file)
@@ -210,6 +210,10 @@ LocalSettings.php. The specific bugs are listed below in the general notes.
 * When viewing a redirect, the redirect arrow and redirection target are both
   wrapped in a div that has the class "redirectMsg" so that the redirection
   arrow can be customized with CSS
+* (bug 21911) Hard coded limit for long page warning removed. 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
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
index 2f8fadf..1182ef7 100644 (file)
@@ -1457,13 +1457,16 @@ HTML
                }
 
                if ( $this->tooBig || $this->kblength > $wgMaxArticleSize ) {
-                       $wgOut->addHTML( "<div class='error' id='mw-edit-longpageerror'>\n" );
-                       $wgOut->addWikiMsg( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) );
-                       $wgOut->addHTML( "</div>\n" );
-               } elseif ( $this->kblength > 29 ) {
-                       $wgOut->addHTML( "<div id='mw-edit-longpagewarning'>\n" );
-                       $wgOut->addWikiMsg( 'longpagewarning', $wgLang->formatNum( $this->kblength ) );
-                       $wgOut->addHTML( "</div>\n" );
+                       $wgOut->wrapWikiMsg( "<div class='error' id='mw-edit-longpageerror'>\n$1\n</div>",
+                               array( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) ) );
+               } else {
+                       $msg = 'longpage-hint';
+                       $text = wfMsg( $msg );
+                       if( !wfEmptyMsg( $msg, $text ) && $text !== '-' ) {
+                               $wgOut->wrapWikiMsg( "<div id='mw-edit-longpage-hint'>\n$1\n</div>",
+                                       array( 'longpage-hint', $wgLang->formatSize( strlen( $this->textbox1 ) ), strlen( $this->textbox1 ) )
+                               );
+                       }
                }
        }
 
index 94e085a..ab8de9d 100644 (file)
@@ -1337,9 +1337,7 @@ If you do not want your writing to be edited mercilessly, then do not submit it
 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).
 '''Do not submit copyrighted work without permission!'''",
 'editpage-tos-summary'             => '-', # do not translate or duplicate this message to other languages
-'longpagewarning'                  => "'''Warning:''' This page is $1 kilobytes long;
-some browsers may have problems editing pages approaching or longer than 32kb.
-Please consider breaking the page into smaller sections.",
+'longpage-hint'                    => '-', # do not translate or duplicate this message to other languages
 'longpageerror'                    => "'''Error: The text you have submitted is $1 kilobytes long, which is longer than the maximum of $2 kilobytes.'''
 It cannot be saved.",
 'readonlywarning'                  => "'''Warning: The database has been locked for maintenance, so you will not be able to save your edits right now.'''
index a9b25a7..a631d1a 100644 (file)
@@ -168,6 +168,7 @@ $wgIgnoredMessages = array(
        'editpage-tos-summary',
        'addsection-preload',
        'addsection-editintro',
+       'longpage-hint',
 );
 
 /** Optional messages, which may be translated only if changed in the target language. */
index 6754ed4..56ef4e3 100644 (file)
@@ -581,7 +581,7 @@ $wgMessageStructure = array(
                'copyrightwarning',
                'copyrightwarning2',
                'editpage-tos-summary',
-               'longpagewarning',
+               'longpage-hint',
                'longpageerror',
                'readonlywarning',
                'protectedpagewarning',