Henning Snater has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/177230

Change subject: Apply "lang" and "dir" attributes to aliases input boxes
......................................................................

Apply "lang" and "dir" attributes to aliases input boxes

Change-Id: Icd6a2010c22eca2d6584e6e74b2428ca68c05fff
---
M lib/resources/jquery.wikibase/jquery.wikibase.aliasesview.js
M lib/resources/jquery.wikibase/resources.php
M repo/resources/jquery.ui/jquery.ui.tagadata.js
3 files changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/30/177230/1

diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.aliasesview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.aliasesview.js
index bbb07c7..dffbf89 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.aliasesview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.aliasesview.js
@@ -58,6 +58,10 @@
 
                if( this.$list.children( 'li' ).length !== 
this.options.value.getTexts().length ) {
                        this.draw();
+               } else {
+                       this.$list
+                       .prop( 'lang', this.options.value.getLanguageCode() )
+                       .prop( 'dir', $.util.getDirectionality( 
this.options.value.getLanguageCode() ) );
                }
        },
 
@@ -77,7 +81,10 @@
                                tagadata.destroy();
                        }
 
-                       this.$list.empty();
+                       this.$list
+                       .empty()
+                       .prop( 'lang', this.options.value.getLanguageCode() )
+                       .prop( 'dir', $.util.getDirectionality( 
this.options.value.getLanguageCode() ) );
 
                        $.each( this.options.value.getTexts(), function() {
                                self.$list.append( mw.wbTemplate( 
'wikibase-aliasesview-list-item', this ) );
diff --git a/lib/resources/jquery.wikibase/resources.php 
b/lib/resources/jquery.wikibase/resources.php
index 985a614..15de426 100644
--- a/lib/resources/jquery.wikibase/resources.php
+++ b/lib/resources/jquery.wikibase/resources.php
@@ -27,6 +27,7 @@
                                'jquery.inputautoexpand',
                                'jquery.ui.tagadata',
                                'jquery.ui.EditableTemplatedWidget',
+                               'jquery.util.getDirectionality',
                                'jquery.wikibase.edittoolbar',
                                'jquery.wikibase.toolbarcontroller',
                                'wikibase.datamodel.MultiTerm',
diff --git a/repo/resources/jquery.ui/jquery.ui.tagadata.js 
b/repo/resources/jquery.ui/jquery.ui.tagadata.js
index d4ddc86..02e7033 100644
--- a/repo/resources/jquery.ui/jquery.ui.tagadata.js
+++ b/repo/resources/jquery.ui/jquery.ui.tagadata.js
@@ -308,7 +308,10 @@
                }
 
                var $label = $( '<span/>' ).addClass( 'tagadata-label' ),
-                       $input = $( '<input />' ).attr( 'name', 
this.options.itemName + '[]' );
+                       $input = $( '<input />' )
+                               .attr( 'name', this.options.itemName + '[]' )
+                               .prop( 'lang', this.element.prop( 'lang' ) || 
'' )
+                               .prop( 'dir', this.element.prop( 'dir' ) || 
'auto' );
 
                $tag = this._createTagNode().addClass( additionalClasses || '' 
).append( $label );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/177230
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd6a2010c22eca2d6584e6e74b2428ca68c05fff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to