From 75bd5a967d90168956312bf8145e0aa12496fbdd Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Mon, 4 Aug 2008 18:44:01 +0000 Subject: [PATCH] * (bug 2314) Add links to users custom CSS and JS into Special:Preferences ** Attn Betawiki: Message 'skinpreview' renamed to 'skin-preview': brackets outside of the hyperlink(s) now: (Preview | associated CSS | associated JS) --- RELEASE-NOTES | 1 + includes/specials/SpecialPreferences.php | 22 ++++++++++++++++------ languages/messages/MessagesEn.php | 6 ++++-- maintenance/language/messages.inc | 8 ++++---- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 268e0452cd..0eedf64b4e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index c3eea3a45c..b08e774584 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -814,9 +814,14 @@ class PreferencesForm { # Skin # - $wgOut->addHTML( "
\n\n" . wfMsg('skin') . "\n" ); + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'skin' ) ) . "\n" . + wfMsg( 'skin-header' ) . "

" + ); + $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 = "$previewtext"; - if( $skinkey == $wgDefaultSkin ) + $linkLine = " ($previewtext | " . $linkToCSS . " | " . $linkToJS . ')'; + if( $skinkey == $wgDefaultSkin ) { $sn .= ' (' . wfMsg( 'default' ) . ')'; - $wgOut->addHTML( " $previewlink
\n" ); + } + $wgOut->addHTML( " $linkLine
\n" ); } - $wgOut->addHTML( "
\n\n" ); + $wgOut->addHTML( Xml::closeElement( 'fieldset' ) ); # Math # diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f4de8986e0..bbd7a6f7b6 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index e802a8d3f3..c8bd6e1765 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -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' => '', -- 2.20.1