mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-09-24 10:50:17 +00:00
Fixes bug 24088: WikiEditor toolbar RTL icons
This commit is contained in:
parent
cbbfb346f1
commit
6e998359f0
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 21 KiB |
BIN
modules/images/toolbar/format-indent-rtl.png
Normal file
BIN
modules/images/toolbar/format-indent-rtl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,019 B |
BIN
modules/images/toolbar/format-olist-rtl.png
Normal file
BIN
modules/images/toolbar/format-olist-rtl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 359 B |
BIN
modules/images/toolbar/format-ulist-rtl.png
Normal file
BIN
modules/images/toolbar/format-ulist-rtl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 227 B |
BIN
modules/images/toolbar/insert-redirect-rtl.png
Normal file
BIN
modules/images/toolbar/insert-redirect-rtl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -149,14 +149,16 @@ $.wikiEditor = {
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Provides a way to extract a property of an object in a certain language, falling back on the property keyed as
|
* Provides a way to extract a property of an object in a certain language, falling back on the property keyed as
|
||||||
* 'default'. If such key doesn't exist, the object itself is considered the actual value, which should ideally
|
* 'default' or 'default-rtl'. If such key doesn't exist, the object itself is considered the actual value, which
|
||||||
* be the case so that you may use a string or object of any number of strings keyed by language with a default.
|
* should ideally be the case so that you may use a string or object of any number of strings keyed by language
|
||||||
|
* with a default.
|
||||||
*
|
*
|
||||||
* @param object Object to extract property from
|
* @param object Object to extract property from
|
||||||
* @param lang Language code, defaults to wgUserLanguage
|
* @param lang Language code, defaults to wgUserLanguage
|
||||||
*/
|
*/
|
||||||
'autoLang': function( object, lang ) {
|
'autoLang': function( object, lang ) {
|
||||||
return object[lang || wgUserLanguage] || object['default'] || object;
|
var defaultKey = $( 'body' ).hasClass( 'rtl' ) ? 'default-rtl' : 'default';
|
||||||
|
return object[lang || wgUserLanguage] || object[defaultKey] || object['default'] || object;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Provides a way to extract the path of an icon in a certain language, automatically appending a version number for
|
* Provides a way to extract the path of an icon in a certain language, automatically appending a version number for
|
||||||
|
|
|
@ -261,8 +261,14 @@ getDefaultConfig: function() {
|
||||||
'ulist': {
|
'ulist': {
|
||||||
'labelMsg': 'wikieditor-toolbar-tool-ulist',
|
'labelMsg': 'wikieditor-toolbar-tool-ulist',
|
||||||
'type': 'button',
|
'type': 'button',
|
||||||
'icon': 'format-ulist.png',
|
'icon': {
|
||||||
'offset': [2, -1366],
|
'default': 'format-ulist.png',
|
||||||
|
'default-rtl': 'format-ulist-rtl.png'
|
||||||
|
},
|
||||||
|
'offset': {
|
||||||
|
'default': [2, -1366],
|
||||||
|
'default-rtl': [-70, -286]
|
||||||
|
},
|
||||||
'action': {
|
'action': {
|
||||||
'type': 'encapsulate',
|
'type': 'encapsulate',
|
||||||
'options': {
|
'options': {
|
||||||
|
@ -277,8 +283,14 @@ getDefaultConfig: function() {
|
||||||
'olist': {
|
'olist': {
|
||||||
'labelMsg': 'wikieditor-toolbar-tool-olist',
|
'labelMsg': 'wikieditor-toolbar-tool-olist',
|
||||||
'type': 'button',
|
'type': 'button',
|
||||||
'icon': 'format-olist.png',
|
'icon': {
|
||||||
'offset': [2, -1078],
|
'default': 'format-olist.png',
|
||||||
|
'default-rtl': 'format-olist-rtl.png'
|
||||||
|
},
|
||||||
|
'offset': {
|
||||||
|
'default': [2, -1078],
|
||||||
|
'default-rtl': [-70, -358]
|
||||||
|
},
|
||||||
'action': {
|
'action': {
|
||||||
'type': 'encapsulate',
|
'type': 'encapsulate',
|
||||||
'options': {
|
'options': {
|
||||||
|
@ -293,8 +305,14 @@ getDefaultConfig: function() {
|
||||||
'indent': {
|
'indent': {
|
||||||
'labelMsg': 'wikieditor-toolbar-tool-indent',
|
'labelMsg': 'wikieditor-toolbar-tool-indent',
|
||||||
'type': 'button',
|
'type': 'button',
|
||||||
'icon': 'format-indent.png',
|
'icon': {
|
||||||
'offset': [2, -646],
|
'default': 'format-indent.png',
|
||||||
|
'default-rtl': 'format-indent-rtl.png'
|
||||||
|
},
|
||||||
|
'offset': {
|
||||||
|
'default': [2, -646],
|
||||||
|
'default-rtl': [-70, -430]
|
||||||
|
},
|
||||||
'action': {
|
'action': {
|
||||||
'type': 'encapsulate',
|
'type': 'encapsulate',
|
||||||
'options': {
|
'options': {
|
||||||
|
@ -433,8 +451,14 @@ getDefaultConfig: function() {
|
||||||
'redirect': {
|
'redirect': {
|
||||||
'labelMsg': 'wikieditor-toolbar-tool-redirect',
|
'labelMsg': 'wikieditor-toolbar-tool-redirect',
|
||||||
'type': 'button',
|
'type': 'button',
|
||||||
'icon': 'insert-redirect.png',
|
'icon': {
|
||||||
'offset': [-70, -142],
|
'default': 'insert-redirect.png',
|
||||||
|
'default-rtl': 'insert-redirect-rtl.png'
|
||||||
|
},
|
||||||
|
'offset': {
|
||||||
|
'default': [-70, -142],
|
||||||
|
'default-rtl': [-70, -502],
|
||||||
|
},
|
||||||
'action': {
|
'action': {
|
||||||
'type': 'encapsulate',
|
'type': 'encapsulate',
|
||||||
'options': {
|
'options': {
|
||||||
|
|
Loading…
Reference in a new issue