* Wrap site CSS and JavaScript in a <pre> tag, like user JS/CSS
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 26 Jun 2007 01:01:08 +0000 (01:01 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 26 Jun 2007 01:01:08 +0000 (01:01 +0000)
* (bug 10196) Add classes and dir=ltr to the <pre>s on CSS and JS pages (new
  classes: mw-user-css, mw-user-js, mw-site-css, mw-site-js)
* Merge RELEASE-NOTES regarding the addition of a feature and a change to that feature

RELEASE-NOTES
includes/Article.php

index 18eca46..b519f22 100644 (file)
@@ -75,14 +75,13 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   a path to the AdminSettings.php file
 * (bug 8781) Remind users to check file permissions for LocalSettings.php
   post-installation
-* (bug 10196) Add classes and dir="ltr" to the <pre>s on user CSS and JS pages
-  (new classes: mw-user-css, mw-user-js)
 * Use shared.css for all skins and oldshared.css in place of common.css for
   pre-Monobook skins.  As always, modifications should go in-wiki to MediaWiki:
   Common.css and MediaWiki:Monobook.css.
 * (bug 8869) Introduce Special:Uncategorizedtemplates
 * (bug 8734) Different log message when article protection level is changed
-* (bug 8458) Limit custom signature length to $wgMaxSigChars bytes
+* (bug 8458, 10338) Limit custom signature length to $wgMaxSigChars Unicode
+  characters
 * (bug 10096) Added an ability to query interwiki map table
 * On reupload, add a null revision to the image description page
 * Group log output by date
@@ -101,9 +100,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   enabled by default.
 * Added option to install to MyISAM
 * (bug 9250) Remove hardcoded minimum image name length of three characters
-* (bug 10338) Enforce signature length limit in Unicode characters instead of bytes
 * Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the
   same title as the current page, and enabled per default
+* Wrap site CSS and JavaScript in a <pre> tag, like user JS/CSS
+* (bug 10196) Add classes and dir="ltr" to the <pre>s on CSS and JS pages (new
+  classes: mw-user-css, mw-user-js, mw-site-css, mw-site-js)
 
 == Bugfixes since 1.10 ==
 
index 7925189..b4aa97f 100644 (file)
@@ -777,14 +777,21 @@ class Article {
                }
                if( !$outputDone ) {
                        $wgOut->setRevisionId( $this->getRevIdFetched() );
-                       # wrap user css and user js in pre and don't parse
-                       # XXX: use $this->mTitle->usCssJsSubpage() when php is fixed/ a workaround is found
+                       // Wrap site/user css/js in pre and don't parse.  User pages need
+                       // to be subpages, site pages just need to end in ".css" or ".js".
+
+                       // @todo: use $this->mTitle->isCssJsSubpage() when php is fixed/
+                       // a workaround is found.
                        if (
-                               $ns == NS_USER &&
-                               preg_match('!/[\w]+\.(css|js)$!', $this->mTitle->getDBkey(), $matches)
+                               ($ns == NS_USER and preg_match('#/\w+\.(css|js)$#',$this->mTitle->getDBkey(),$matches))
+                               or ($ns == NS_MEDIAWIKI and preg_match('/.(css|js)$/', $this->mTitle->getDBkey(), $matches))
                        ) {
                                $wgOut->addWikiText( wfMsg('clearyourcache'));
-                               $wgOut->addHTML( "<pre class=\"mw-user-{$matches[1]}\" dir=\"ltr\">".htmlspecialchars($this->mContent)."\n</pre>" );
+                               $classbit = $ns == NS_USER ? 'user' : 'site';
+                               $wgOut->addHTML(
+                                       "<pre class=\"mw-$classbit-{$matches[1]}\" dir=\"ltr\">"
+                                       .htmlspecialchars($this->mContent)."\n</pre>"
+                               );
                        } else if ( $rt = Title::newFromRedirect( $text ) ) {
                                # Display redirect
                                $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';