r54139 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r54138 | r54139 (on ViewVC) | r54140 >
Date:08:19, 1 August 2009
Author:shinjiman
Status:ok
Tags:
Comment:Show the preview tip for css/js when the page name is both valid or invalid (e.g. skin not in the code), they could be included with other css/js in a valid page name, thanks Splarka.
Modified paths:

Test cases

ParserTests

Test cases are running...

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php	(revision 54138)
+++ trunk/phase3/includes/EditPage.php	(revision 54139)
@@ -1245,16 +1245,15 @@
 		} else {
 			if ( $this->isCssJsSubpage ) {
 				# Check the skin exists
-				if ( $this->isValidCssJsSubpage ) {
-					if ( $this->formtype !== 'preview' ) {
-						if ( $this->isCssSubpage )
-							$wgOut->addWikiMsg( 'usercssyoucanpreview' );
-						if ( $this->isJsSubpage )
-							$wgOut->addWikiMsg( 'userjsyoucanpreview' );
-					}
-				} else {
+				if ( !$this->isValidCssJsSubpage ) {
 					$wgOut->addWikiMsg( 'userinvalidcssjstitle', $wgTitle->getSkinFromCssJsSubpage() );
 				}
+				if ( $this->formtype !== 'preview' ) {
+					if ( $this->isCssSubpage )
+						$wgOut->addWikiMsg( 'usercssyoucanpreview' );
+					if ( $this->isJsSubpage )
+						$wgOut->addWikiMsg( 'userjsyoucanpreview' );
+				}
 			}
 		}
 
Index: trunk/phase3/languages/messages/MessagesQqq.php
===================================================================
--- trunk/phase3/languages/messages/MessagesQqq.php	(revision 54138)
+++ trunk/phase3/languages/messages/MessagesQqq.php	(revision 54139)
@@ -741,7 +741,8 @@
 'noarticletext'                    => 'This is the message that you get if you search for a term that has not yet got any entries on the wiki.',
 'userpage-userdoesnotexist'        => 'Error message displayed when trying to edit or create a page or a subpage that belongs to a user who is not registered on the wiki',
 'clearyourcache'                   => 'Text displayed at the bottom in user preferences',
-'usercssjsyoucanpreview'           => "Text displayed on every css/js page. The 'Show preview' part should be the same as {{msg-mw|showpreview}} (or you can use <nowiki>{{int:showpreview}}</nowiki>).",
+'usercssyoucanpreview'           => "Text displayed on every css page. The 'Show preview' part should be the same as {{msg-mw|showpreview}} (or you can use <nowiki>{{int:showpreview}}</nowiki>).",
+'userjsyoucanpreview'           => "Text displayed on every js page. The 'Show preview' part should be the same as {{msg-mw|showpreview}} (or you can use <nowiki>{{int:showpreview}}</nowiki>).",
 'updated'                          => '{{Identical|Updated}}',
 'previewnote'                      => 'Note displayed when clicking on Show preview',
 'editing'                          => "Shown as page title when editing a page. \$1 is the name of the page that is being edited. Example: \"''Editing Main Page''\".",

Status & tagging log

Views
Toolbox