r86853 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86852‎ | r86853 | r86854 >
Date:12:26, 25 April 2011
Author:janpaul123
Status:ok (Comments)
Tags:
Comment:
Fixes bug 24088: WikiEditor toolbar RTL icons
Modified paths:
  • /trunk/extensions/WikiEditor/modules/images/toolbar/button-sprite.png (modified) (history)
  • /trunk/extensions/WikiEditor/modules/images/toolbar/format-indent-rtl.png (added) (history)
  • /trunk/extensions/WikiEditor/modules/images/toolbar/format-olist-rtl.png (added) (history)
  • /trunk/extensions/WikiEditor/modules/images/toolbar/format-ulist-rtl.png (added) (history)
  • /trunk/extensions/WikiEditor/modules/images/toolbar/insert-redirect-rtl.png (added) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.js
@@ -149,14 +149,16 @@
150150 },
151151 /**
152152 * Provides a way to extract a property of an object in a certain language, falling back on the property keyed as
153 - * 'default'. If such key doesn't exist, the object itself is considered the actual value, which should ideally
154 - * be the case so that you may use a string or object of any number of strings keyed by language with a default.
 153+ * 'default' or 'default-rtl'. If such key doesn't exist, the object itself is considered the actual value, which
 154+ * should ideally be the case so that you may use a string or object of any number of strings keyed by language
 155+ * with a default.
155156 *
156157 * @param object Object to extract property from
157158 * @param lang Language code, defaults to wgUserLanguage
158159 */
159160 'autoLang': function( object, lang ) {
160 - return object[lang || wgUserLanguage] || object['default'] || object;
 161+ var defaultKey = $( 'body' ).hasClass( 'rtl' ) ? 'default-rtl' : 'default';
 162+ return object[lang || wgUserLanguage] || object[defaultKey] || object['default'] || object;
161163 },
162164 /**
163165 * Provides a way to extract the path of an icon in a certain language, automatically appending a version number for
Index: trunk/extensions/WikiEditor/modules/images/toolbar/button-sprite.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/WikiEditor/modules/images/toolbar/format-olist-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/WikiEditor/modules/images/toolbar/format-olist-rtl.png
___________________________________________________________________
Added: svn:mime-type
164166 + image/png
Index: trunk/extensions/WikiEditor/modules/images/toolbar/format-ulist-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/WikiEditor/modules/images/toolbar/format-ulist-rtl.png
___________________________________________________________________
Added: svn:mime-type
165167 + image/png
Index: trunk/extensions/WikiEditor/modules/images/toolbar/insert-redirect-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/WikiEditor/modules/images/toolbar/insert-redirect-rtl.png
___________________________________________________________________
Added: svn:mime-type
166168 + image/png
Index: trunk/extensions/WikiEditor/modules/images/toolbar/format-indent-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/WikiEditor/modules/images/toolbar/format-indent-rtl.png
___________________________________________________________________
Added: svn:mime-type
167169 + image/png
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js
@@ -261,8 +261,14 @@
262262 'ulist': {
263263 'labelMsg': 'wikieditor-toolbar-tool-ulist',
264264 'type': 'button',
265 - 'icon': 'format-ulist.png',
266 - 'offset': [2, -1366],
 265+ 'icon': {
 266+ 'default': 'format-ulist.png',
 267+ 'default-rtl': 'format-ulist-rtl.png'
 268+ },
 269+ 'offset': {
 270+ 'default': [2, -1366],
 271+ 'default-rtl': [-70, -286]
 272+ },
267273 'action': {
268274 'type': 'encapsulate',
269275 'options': {
@@ -277,8 +283,14 @@
278284 'olist': {
279285 'labelMsg': 'wikieditor-toolbar-tool-olist',
280286 'type': 'button',
281 - 'icon': 'format-olist.png',
282 - 'offset': [2, -1078],
 287+ 'icon': {
 288+ 'default': 'format-olist.png',
 289+ 'default-rtl': 'format-olist-rtl.png'
 290+ },
 291+ 'offset': {
 292+ 'default': [2, -1078],
 293+ 'default-rtl': [-70, -358]
 294+ },
283295 'action': {
284296 'type': 'encapsulate',
285297 'options': {
@@ -293,8 +305,14 @@
294306 'indent': {
295307 'labelMsg': 'wikieditor-toolbar-tool-indent',
296308 'type': 'button',
297 - 'icon': 'format-indent.png',
298 - 'offset': [2, -646],
 309+ 'icon': {
 310+ 'default': 'format-indent.png',
 311+ 'default-rtl': 'format-indent-rtl.png'
 312+ },
 313+ 'offset': {
 314+ 'default': [2, -646],
 315+ 'default-rtl': [-70, -430]
 316+ },
299317 'action': {
300318 'type': 'encapsulate',
301319 'options': {
@@ -433,8 +451,14 @@
434452 'redirect': {
435453 'labelMsg': 'wikieditor-toolbar-tool-redirect',
436454 'type': 'button',
437 - 'icon': 'insert-redirect.png',
438 - 'offset': [-70, -142],
 455+ 'icon': {
 456+ 'default': 'insert-redirect.png',
 457+ 'default-rtl': 'insert-redirect-rtl.png'
 458+ },
 459+ 'offset': {
 460+ 'default': [-70, -142],
 461+ 'default-rtl': [-70, -502],
 462+ },
439463 'action': {
440464 'type': 'encapsulate',
441465 'options': {

Follow-up revisions

RevisionCommit summaryAuthorDate
r99097(bug 31411) Remove stray comma introduced in r86853, broke WikiEditor in IEcatrope13:15, 6 October 2011

Comments

#Comment by JanPaul123 (talk | contribs)   13:31, 25 April 2011

Note: also fixes bug 28554 and bug 26148.

#Comment by Reedy (talk | contribs)   11:45, 19 September 2011

Untagging 1.18, it is well before the 1.18 branch point of r94275 on 18/07/2011

#Comment by Reedy (talk | contribs)   11:45, 19 September 2011

Untagging 1.18, it is well before the 1.18 branch point of r94275 on 18/07/2011

Status & tagging log