From da1baaf6632afc506bd95baac784475be2856402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 12 Jul 2013 13:43:45 +0000 Subject: [PATCH] Help links for input settings Bug: 42373 Change-Id: I30c8d6cbe916ac026ad70974755942c5bbea7162 --- Resources.php | 3 +++ UniversalLanguageSelector.i18n.php | 3 +++ i18n/en.json | 1 + resources/css/ext.uls.inputsettings.css | 6 +++++- resources/js/ext.uls.inputsettings.js | 11 +++++++++-- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Resources.php b/Resources.php index be95df26..1dc6cb12 100644 --- a/Resources.php +++ b/Resources.php @@ -71,6 +71,9 @@ $wgResourceModules['ext.uls.inputsettings'] = array( 'ext.uls.ime', 'jquery.i18n', ), + 'messages' => array( + 'uls-ime-helppage', + ), ) + $resourcePaths; // Interface language selection module diff --git a/UniversalLanguageSelector.i18n.php b/UniversalLanguageSelector.i18n.php index 15ac3d8c..4325acda 100644 --- a/UniversalLanguageSelector.i18n.php +++ b/UniversalLanguageSelector.i18n.php @@ -24,12 +24,14 @@ $messages = array(); * English * @author santhosh * @author Amire80 + * @author Nike */ $messages['en'] = array( 'UniversalLanguageSelector' => 'Universal Language Selector', 'uls-desc' => 'Gives the user several ways to select a language and to adjust language settings', 'uls-plang-title-languages' => 'Languages', + 'uls-ime-helppage' => 'https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:UniversalLanguageSelector/Input_methods/$1', ); /** Message documentation (Message documentation) @@ -42,6 +44,7 @@ $messages['qqq'] = array( 'uls-plang-title-languages' => 'A title for the are in the sidebar in which the interlanguage links are supposed to appear. This title is shown when there are no interlanguage links there, but an icon that enables the ULS is shown. {{Identical|Language}}', + 'uls-ime-helppage' => 'Target page for ime helps. $1 is ime id. Intented for wiki local customization.', ); /** Arabic (العربية) diff --git a/i18n/en.json b/i18n/en.json index 55e90b72..25ade838 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -33,6 +33,7 @@ "ext-uls-input-settings-ime-settings": "Input methods for $1", "ext-uls-input-settings-ui-language": "Language used for writing", "ext-uls-back-to-input-settings": "Back to input settings", +"ext-uls-ime-help": "How to use", "ext-uls-disable-input-method": "Use native keyboard", "ext-uls-input-settings-more-languages-tooltip": "More languages", "jquery-ime-other-languages": "Other languages", diff --git a/resources/css/ext.uls.inputsettings.css b/resources/css/ext.uls.inputsettings.css index 26ce754a..17481fc7 100644 --- a/resources/css/ext.uls.inputsettings.css +++ b/resources/css/ext.uls.inputsettings.css @@ -67,7 +67,7 @@ div.input-settings-block { height: 14px; position: absolute; right: 0; - } +} .uls-ime-menu-settings-item > a:hover { background-color: #f0f0f0; @@ -116,3 +116,7 @@ div.input-settings-block { color: #0645AD; cursor: pointer; } + +.uls-input-settings .uls-ime-help { + margin-left: 10px; +} diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 7962eaa8..d3d2b2e9 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -169,7 +169,7 @@ * @return {Object} jQuery object corresponding to the input method item. */ renderInputmethodOption: function ( imeId, selected ) { - var $imeLabel, name, description, inputmethod, $inputMethodItem; + var $imeLabel, name, description, $helplink, inputmethod, $inputMethodItem; if ( imeId !== 'system' && !$.ime.sources[imeId] ) { // imeId not known for jquery.ime. @@ -194,8 +194,14 @@ if ( imeId === 'system' ) { name = $.i18n( 'ext-uls-disable-input-method' ); description = ''; + $helplink = ''; } else { inputmethod = $.ime.inputmethods[imeId]; + $helplink = $( '' ) + .addClass( 'uls-ime-help' ) + .text( $.i18n( 'ext-uls-ime-help' ) ) + .attr( 'href', mw.msg( 'uls-ime-helppage' ).replace( '$1', imeId ) ) + .attr( 'target', '_blank' ); if ( !inputmethod ) { // The input method definition(rules) not loaded. // We will show the name from $.ime.sources @@ -209,7 +215,8 @@ $imeLabel.append( $( '' ).text( name ), - $( '' ).text( description ) + $( '' ).text( description ), + $helplink ); return $imeLabel;