* (bug 2314) Add links to users custom CSS and JS into Special:Preferences
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 4 Aug 2008 18:44:01 +0000 (18:44 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 4 Aug 2008 18:44:01 +0000 (18:44 +0000)
** Attn Betawiki: Message 'skinpreview' renamed to 'skin-preview': brackets outside of the hyperlink(s) now: (Preview | associated CSS | associated JS)

RELEASE-NOTES
includes/specials/SpecialPreferences.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 268e045..0eedf64 100644 (file)
@@ -44,6 +44,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   ables into into the output of Skin::makeVariablesScript
 * Added $wgAddGroups and $wgRemoveGroups display on Special:ListGroupRights
 * (bug 14377) Add a date selector to history pages
+* (bug 2314) Add links to users custom CSS and JS into Special:Preferences
 
 === Bug fixes in 1.14 ===
 
index c3eea3a..b08e774 100644 (file)
@@ -814,9 +814,14 @@ class PreferencesForm {
 
                # Skin
                #
-               $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg('skin') . "</legend>\n" );
+               $wgOut->addHTML(
+                       Xml::openElement( 'fieldset' ) .
+                       Xml::element( 'legend', null, wfMsg( 'skin' ) ) . "\n" .
+                       wfMsg( 'skin-header' ) . "<br /><br />"
+               );
+
                $mptitle = Title::newMainPage();
-               $previewtext = wfMsg('skinpreview');
+               $previewtext = wfMsg('skin-preview');
                # Only show members of Skin::getSkinNames() rather than
                # $skinNames (skins is all skin names from Language.php)
                $validSkinNames = Skin::getSkinNames();
@@ -832,15 +837,20 @@ class PreferencesForm {
                        if ( in_array( $skinkey, $wgSkipSkins ) ) {
                                continue;
                        }
+                       $pageCSS = Title::makeTitle( NS_USER, $wgUser->getName() . '/' . $skinkey . '.css' );
+                       $pageJS = Title::makeTitle( NS_USER, $wgUser->getName() . '/' . $skinkey . '.js' );
+                       $linkToCSS = $sk->link( $pageCSS, wfMsg( 'skin-link-to-css' ) );
+                       $linkToJS = $sk->link( $pageJS, wfMsg( 'skin-link-to-js' ) );
                        $checked = $skinkey == $this->mSkin ? ' checked="checked"' : '';
 
                        $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey"));
-                       $previewlink = "<a target='_blank' href=\"$mplink\">$previewtext</a>";
-                       if( $skinkey == $wgDefaultSkin )
+                       $linkLine = " (<a target='_blank' href=\"$mplink\">$previewtext</a> | " . $linkToCSS . " | " . $linkToJS . ')';
+                       if( $skinkey == $wgDefaultSkin ) {
                                $sn .= ' (' . wfMsg( 'default' ) . ')';
-                       $wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked /> <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink<br />\n" );
+                       }
+                       $wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked /> <label for=\"wpSkin$skinkey\">{$sn}</label>$linkLine<br />\n" );
                }
-               $wgOut->addHTML( "</fieldset>\n\n" );
+               $wgOut->addHTML( Xml::closeElement( 'fieldset' ) );
 
                # Math
                #
index f4de898..bbd7a6f 100644 (file)
@@ -537,8 +537,6 @@ XHTML id names.
 'underline-never'   => 'Never',
 'underline-default' => 'Browser default',
 
-'skinpreview' => '(Preview)',
-
 # Dates
 'sunday'        => 'Sunday',
 'monday'        => 'Monday',
@@ -1405,6 +1403,10 @@ Note that their indexes of {{SITENAME}} content may be out of date.',
 'qbsettings-floatingright' => 'Floating right',
 'changepassword'           => 'Change password',
 'skin'                     => 'Skin',
+'skin-header'              => 'Available skins. You can customize each skin with the associated cascading style sheet (CSS) and JavaScript pages.',
+'skin-preview'             => 'Preview',
+'skin-link-to-css'         => 'associated CSS',
+'skin-link-to-js'          => 'associated JS',
 'math'                     => 'Math',
 'dateformat'               => 'Date format',
 'datedefault'              => 'No preference',
index e802a8d..c8bd6e1 100644 (file)
@@ -58,9 +58,6 @@ $wgMessageStructure = array(
                'underline-never',
                'underline-default',
        ),
-       'skinpreview' => array(
-               'skinpreview',
-       ),
        'dates' => array(
                'sunday',
                'monday',
@@ -754,6 +751,10 @@ $wgMessageStructure = array(
                'qbsettings-floatingright',
                'changepassword',
                'skin',
+               'skin-header',
+               'skin-preview',
+               'skin-link-to-css',
+               'skin-link-to-js',
                'math',
                'dateformat',
                'datedefault',
@@ -2626,7 +2627,6 @@ XHTML id it should only appear once and include characters that are legal
 XHTML id names.",
        'toggles'             => 'User preference toggles',
        'underline'           => '',
-       'skinpreview'         => '',
        'dates'               => 'Dates',
        'categorypages'       => 'Categories related messages',
        'mainpage'            => '',