Mwalker has uploaded a new change for review.

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


Change subject: Making Multiselectors Pretty in CN
......................................................................

Making Multiselectors Pretty in CN

Because it's just getting rediculous! So, I bastardized someone
elses multiselect plugin. :)

Change-Id: I9aae04d047ed1b235f3fb46e46017a8150a3382c
---
M CentralNotice.i18n.php
M CentralNotice.php
M modules/ext.centralNotice.interface/centralnotice.css
M modules/ext.centralNotice.interface/centralnotice.js
A modules/jquery.ui.multiselect/ui.multiselect.css
A modules/jquery.ui.multiselect/ui.multiselect.js
M special/SpecialCentralNotice.php
7 files changed, 414 insertions(+), 59 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/12/52212/1

diff --git a/CentralNotice.i18n.php b/CentralNotice.i18n.php
index e19501f..1722bcf 100644
--- a/CentralNotice.i18n.php
+++ b/CentralNotice.i18n.php
@@ -77,8 +77,9 @@
        'centralnotice-hours' => 'Hour',
        'centralnotice-min' => 'Minute',
        'centralnotice-project-lang' => 'Project language',
-       'centralnotice-select' => 'Select: $1',
-       'centralnotice-top-ten-languages' => 'Top 10 languages',
+       'centralnotice-select-all' => 'Select all',
+       'centralnotice-remove-all' => 'Remove all',
+       'centralnotice-items-selected' => '{{PLURAL:$1|1 item|$1 items}} 
selected',
        'centralnotice-project-name' => 'Project name',
        'centralnotice-start-date' => 'Start date',
        'centralnotice-start-time' => 'Start time (UTC)',
@@ -285,7 +286,9 @@
        'centralnotice-month' => '{{Identical|Month}}',
        'centralnotice-hours' => '{{Identical|Hour}}',
        'centralnotice-min' => '{{Identical|Minute}}',
-       'centralnotice-select' => '{{Identical|Select}}',
+       'centralnotice-select-all' => 'Select all items in a list',
+       'centralnotice-remove-all' => 'Remove all items from a list',
+       'centralnotice-items-selected' => 'Identifies the number of items in a 
list. $1 is the number.',
        'centralnotice-project-name' => '{{Identical|Project name}}',
        'centralnotice-start-date' => 'Used in 
[[meta:Special:CentralNotice|Central Notice]] special page.
 
diff --git a/CentralNotice.php b/CentralNotice.php
index 4a7fb5e..586a1ca 100644
--- a/CentralNotice.php
+++ b/CentralNotice.php
@@ -43,17 +43,33 @@
 $wgExtensionFunctions[] = 'efCentralNoticeSetup';
 
 // Register ResourceLoader modules
+$wgResourceModules[ 'jquery.ui.multiselect' ] = array(
+       'localBasePath' => $dir . '/modules',
+       'remoteExtPath' => 'CentralNotice/modules',
+       'dependencies'  => array(
+               'jquery.ui.core',
+               'jquery.ui.sortable',
+               'jquery.ui.draggable',
+               'jquery.ui.droppable'
+       ),
+       'scripts'       => 'jquery.ui.multiselect/ui.multiselect.js',
+       'styles'        => 'jquery.ui.multiselect/ui.multiselect.css',
+);
 $wgResourceModules[ 'ext.centralNotice.interface' ] = array(
        'localBasePath' => $dir . '/modules',
        'remoteExtPath' => 'CentralNotice/modules',
        'dependencies' => array(
                'jquery.ui.datepicker',
+               'jquery.ui.multiselect'
        ),
        'scripts'       => 'ext.centralNotice.interface/centralnotice.js',
        'styles'        => 'ext.centralNotice.interface/centralnotice.css',
        'messages'      => array(
                'centralnotice-documentwrite-error',
                'centralnotice-close-title',
+               'centralnotice-select-all',
+               'centralnotice-remove-all',
+               'centralnotice-items-selected'
        )
 );
 $wgResourceModules[ 'ext.centralNotice.bannerStats' ] = array(
diff --git a/modules/ext.centralNotice.interface/centralnotice.css 
b/modules/ext.centralNotice.interface/centralnotice.css
index 8e33999..7a65f2f 100644
--- a/modules/ext.centralNotice.interface/centralnotice.css
+++ b/modules/ext.centralNotice.interface/centralnotice.css
@@ -115,6 +115,11 @@
        background: url('up-arrow-ltr.png') no-repeat scroll left top 
transparent;
 }
 
+.cn-multiselect {
+       width: 500px;
+       height: 175px;
+}
+
 /* Vector-specific definitions */
 body.skin-vector #preferences fieldset.prefsection {
        border-color:#CCCCCC;
diff --git a/modules/ext.centralNotice.interface/centralnotice.js 
b/modules/ext.centralNotice.interface/centralnotice.js
index b186110..859b96a 100644
--- a/modules/ext.centralNotice.interface/centralnotice.js
+++ b/modules/ext.centralNotice.interface/centralnotice.js
@@ -36,32 +36,6 @@
        window.location = baseUrl + '?log=' + logType;
 };
 
-window.selectProjects = function ( selectAll ) {
-       var selectBox = document.getElementById( 'projects[]' );
-       var firstSelect = selectBox.options.length - 1;
-       for ( var i = firstSelect; i >= 0; i-- ) {
-               selectBox.options[i].selected = selectAll;
-       }
-};
-window.selectLanguages = function( selectAll ) {
-       var selectBox = document.getElementById( 'project_languages[]' );
-       var firstSelect = selectBox.options.length - 1;
-       for ( var i = firstSelect; i >= 0; i-- ) {
-               selectBox.options[i].selected = selectAll;
-       }
-};
-window.top10Languages = function() {
-       var selectBox = document.getElementById( 'project_languages[]' );
-       var top10 = ['en', 'de', 'fr', 'it', 'pt', 'ja', 'es', 'pl', 'ru', 
'nl'];
-       selectLanguages(false);
-       for ( var i = 0; i < selectBox.options.length; i++ ) {
-               var lang = selectBox.options[i].value;
-               if ( top10.toString().indexOf( lang ) !== -1 ) {
-                       selectBox.options[i].selected = true;
-               }
-       }
-};
-
 // Insert banner close button
 window.insertButton = function( buttonType ) {
        var buttonValue, sel;
@@ -135,7 +109,13 @@
                }
        );
 
+       // Do the fancy multiselector
+       $('select[multiple="multiple"]').multiselect({sortable: false, 
dividerLocation: 0.5});
+
        // Reveal the geoMultiSelector when the geotargetted checkbox is checked
+       if( !$('#geotargeted' ).checked ) {
+               $( '#geoMultiSelector' ).fadeOut( 'fast' );
+       }
        $( '#geotargeted' ).click(function () {
                if ( this.checked ) {
                        $( '#geoMultiSelector' ).fadeIn( 'fast' );
diff --git a/modules/jquery.ui.multiselect/ui.multiselect.css 
b/modules/jquery.ui.multiselect/ui.multiselect.css
new file mode 100644
index 0000000..2838cbe
--- /dev/null
+++ b/modules/jquery.ui.multiselect/ui.multiselect.css
@@ -0,0 +1,30 @@
+/* Multiselect
+----------------------------------*/
+
+.ui-multiselect { border: solid 1px #CCCCCC; font-size: 0.8em; }
+.ui-multiselect ul { -moz-user-select: none; }
+.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 
20px; height: 20px; font-size: 11px; list-style: none; }
+.ui-multiselect li a { color: #0645AD; text-decoration: none; padding: 0; 
display: block; float: left; cursor: pointer;}
+.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; }
+
+.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; 
border: 0; float:left; }
+.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; 
overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; 
position: relative; width: 100%; }
+.ui-multiselect ul.selected li { }
+
+.ui-multiselect div.available { position: relative; padding: 0; margin: 0; 
border: 0; float:left; border-left: 1px solid #CCCCCC; }
+.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; 
overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; 
width: 100%; }
+.ui-multiselect ul.available li { padding-left: 10px; }
+
+.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; 
position: relative; padding-left: 20px;}
+.ui-multiselect .ui-state-hover { border: none; }
+.ui-multiselect .ui-widget-header {border: none; font-size: 11px; 
margin-bottom: 1px;}
+
+.ui-multiselect .add-all { float: right; padding: 7px; color: #0645AD}
+.ui-multiselect .remove-all { float: right; padding: 7px; color: #0645AD}
+.ui-multiselect .search { float: left; padding: 4px}
+.ui-multiselect .count { float: left; padding: 7px;}
+
+.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 
2px; }
+.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; }
+
+.ui-multiselect input.search { height: 14px; padding: 1px; margin: 4px; width: 
125px; }
\ No newline at end of file
diff --git a/modules/jquery.ui.multiselect/ui.multiselect.js 
b/modules/jquery.ui.multiselect/ui.multiselect.js
new file mode 100644
index 0000000..a361ed6
--- /dev/null
+++ b/modules/jquery.ui.multiselect/ui.multiselect.js
@@ -0,0 +1,334 @@
+/*
+ * jQuery UI Multiselect
+ *
+ * Authors:
+ *  Michael Aufreiter (quasipartikel.at)
+ *  Yanick Rochon (yanick.rochon[at]gmail[dot]com)
+ * 
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ * 
+ * http://www.quasipartikel.at/multiselect/
+ *
+ * 
+ * Depends:
+ *     ui.core.js
+ *     ui.sortable.js
+ *
+ * Optional:
+ * localization (http://plugins.jquery.com/project/localisation)
+ * scrollTo (http://plugins.jquery.com/project/ScrollTo)
+ * 
+ * Todo:
+ *  Make batch actions faster
+ *  Implement dynamic insertion through remote calls
+ */
+
+
+(function($, mw) {
+
+       $.widget("ui.multiselect", {
+               options: {
+                       sortable: true,
+                       searchable: true,
+                       doubleClickable: true,
+                       animated: 'fast',
+                       show: 'slideDown',
+                       hide: 'slideUp',
+                       dividerLocation: 0.6,
+                       availableFirst: false,
+                       nodeComparator: function(node1,node2) {
+                               var text1 = node1.text(),
+                                       text2 = node2.text();
+                               return text1 === text2 ? 0 : (text1 < text2 ? 
-1 : 1);
+                       }
+               },
+               _create: function() {
+                       var countStr = 
mw.message('centralnotice-items-selected', 0),
+                               that;
+
+                       this.element.hide();
+                       this.id = this.element.attr("id");
+                       this.container = $('<div class="ui-multiselect 
ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
+                       this.count = 0; // number of currently selected options
+                       this.selectedContainer = $('<div 
class="selected"></div>').appendTo(this.container);
+                       this.availableContainer = $('<div 
class="available"></div>')[this.options.availableFirst?'prependTo': 
'appendTo'](this.container);
+                       this.selectedActions = $('<div class="actions 
ui-widget-header ui-helper-clearfix"><span class="count">'+countStr+'</span><a 
href="#" 
class="remove-all">'+mw.message('centralnotice-remove-all')+'</a></div>').appendTo(this.selectedContainer);
+                       this.availableActions = $('<div class="actions 
ui-widget-header ui-helper-clearfix"><input type="text" class="search empty 
ui-widget-content ui-corner-all"/><a href="#" 
class="add-all">'+mw.message('centralnotice-select-all')+'</a></div>').appendTo(this.availableContainer);
+                       this.selectedList = $('<ul class="selected 
connected-list"><li 
class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', 
function(){return false;}).appendTo(this.selectedContainer);
+                       this.availableList = $('<ul class="available 
connected-list"><li 
class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', 
function(){return false;}).appendTo(this.availableContainer);
+
+                       that = this;
+
+                       // set dimensions
+                       this.container.width(this.element.width()+1);
+                       
this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
+                       
this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
+
+                       // fix list height to match <option> depending on their 
individual header's heights
+                       
this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
+                       
this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
+
+                       if ( !this.options.animated ) {
+                               this.options.show = 'show';
+                               this.options.hide = 'hide';
+                       }
+
+                       // init lists
+                       this._populateLists(this.element.find('option'));
+
+                       // make selection sortable
+                       if (this.options.sortable) {
+                               this.selectedList.sortable({
+                                       placeholder: 'ui-state-highlight',
+                                       axis: 'y',
+                                       update: function(event, ui) {
+                                               // apply the new sort order to 
the original selectbox
+                                               
that.selectedList.find('li').each(function() {
+                                               if ($(this).data('optionLink'))
+                                                       
$(this).data('optionLink').remove().appendTo(that.element);
+                                               });
+                                       },
+                                       receive: function(event, ui) {
+                                               
ui.item.data('optionLink').attr('selected', true);
+                                               // increment count
+                                               that.count += 1;
+                                               that._updateCount();
+                                               // workaround, because there's 
no way to reference
+                                               // the new element, see 
http://dev.jqueryui.com/ticket/4303
+                                               
that.selectedList.children('.ui-draggable').each(function() {
+                                                       
$(this).removeClass('ui-draggable');
+                                                       
$(this).data('optionLink', ui.item.data('optionLink'));
+                                                       $(this).data('idx', 
ui.item.data('idx'));
+                                                       
that._applyItemState($(this), true);
+                                               });
+
+                                               // workaround according to 
http://dev.jqueryui.com/ticket/4088
+                                               setTimeout(function() { 
ui.item.remove(); }, 1);
+                                       }
+                               });
+                       }
+
+                       // set up livesearch
+                       if (this.options.searchable) {
+                               
this._registerSearchEvents(this.availableContainer.find('input.search'));
+                       } else {
+                               $('.search').hide();
+                       }
+
+                       // batch actions
+                       this.container.find(".remove-all").click(function() {
+                               
that._populateLists(that.element.find('option').removeAttr('selected'));
+                               return false;
+                       });
+
+                       this.container.find(".add-all").click(function() {
+                               var options = 
that.element.find('option').not(":selected");
+                               if 
(that.availableList.children('li:hidden').length > 1) {
+                                       
that.availableList.children('li').each(function(i) {
+                                               if ($(this).is(":visible")) 
$(options[i-1]).attr('selected', 'selected');
+                                       });
+                               } else {
+                                       options.attr('selected', 'selected');
+                               }
+                               
that._populateLists(that.element.find('option'));
+                               return false;
+                       });
+               },
+               destroy: function() {
+                       this.element.show();
+                       this.container.remove();
+
+                       $.Widget.prototype.destroy.apply(this, arguments);
+               },
+               _populateLists: function(options) {
+                       this.selectedList.children('.ui-element').remove();
+                       this.availableList.children('.ui-element').remove();
+                       this.count = 0;
+
+                       var that = this;
+                       var items = $(options.map(function(i) {
+                               var item = 
that._getOptionNode(this).appendTo(this.selected ? that.selectedList : 
that.availableList).show();
+
+                               if (this.selected) that.count += 1;
+                               that._applyItemState(item, this.selected);
+                               item.data('idx', i);
+                               return item[0];
+                       }));
+
+                       // update count
+                       this._updateCount();
+                       
that._filter.apply(this.availableContainer.find('input.search'), 
[that.availableList]);
+               },
+               _updateCount: function() {
+                       this.element.trigger('change');
+                       
this.selectedContainer.find('span.count').text(mw.message('centralnotice-items-selected',
 this.count));
+               },
+               _getOptionNode: function(option) {
+                       option = $(option);
+                       var node = $('<li class="ui-state-default ui-element" 
title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" 
class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
+                       node.data('optionLink', option);
+                       return node;
+               },
+               // clones an item with associated data
+               // didn't find a smarter away around this
+               _cloneWithData: function(clonee) {
+                       var clone = clonee.clone(false,false);
+                       clone.data('optionLink', clonee.data('optionLink'));
+                       clone.data('idx', clonee.data('idx'));
+                       return clone;
+               },
+               _setSelected: function(item, selected) {
+                       item.data('optionLink').attr('selected', selected);
+
+                       if (selected) {
+                               var selectedItem = this._cloneWithData(item);
+                               item[this.options.hide](this.options.animated, 
function() { $(this).remove(); });
+                               
selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
+
+                               this._applyItemState(selectedItem, true);
+                               return selectedItem;
+                       } else {
+
+                               // look for successor based on initial option 
index
+                               var items = this.availableList.find('li'), 
comparator = this.options.nodeComparator;
+                               var succ = null, i = item.data('idx'), 
direction = comparator(item, $(items[i]));
+
+                               // TODO: test needed for dynamic list populating
+                               if ( direction ) {
+                                       while (i>=0 && i<items.length) {
+                                               direction > 0 ? i++ : i--;
+                                               if ( direction != 
comparator(item, $(items[i])) ) {
+                                                       // going up, go back 
one item down, otherwise leave as is
+                                                       succ = items[direction 
> 0 ? i : i+1];
+                                                       break;
+                                               }
+                                       }
+                               } else {
+                                       succ = items[i];
+                               }
+
+                               var availableItem = this._cloneWithData(item);
+                               succ ? availableItem.insertBefore($(succ)) : 
availableItem.appendTo(this.availableList);
+                               item[this.options.hide](this.options.animated, 
function() { $(this).remove(); });
+                               
availableItem.hide()[this.options.show](this.options.animated);
+
+                               this._applyItemState(availableItem, false);
+                               return availableItem;
+                       }
+               },
+               _applyItemState: function(item, selected) {
+                       if (selected) {
+                               if (this.options.sortable)
+                                       
item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
+                               else
+                                       
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
+                               item.find('a.action 
span').addClass('ui-icon-minus').removeClass('ui-icon-plus');
+                               
this._registerRemoveEvents(item.find('a.action'));
+
+                       } else {
+                               
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
+                               item.find('a.action 
span').addClass('ui-icon-plus').removeClass('ui-icon-minus');
+                               this._registerAddEvents(item.find('a.action'));
+                       }
+
+                       this._registerDoubleClickEvents(item);
+                       this._registerHoverEvents(item);
+               },
+               // taken from John Resig's liveUpdate script
+               _filter: function(list) {
+                       var input = $(this);
+                       var rows = list.children('li'),
+                               cache = rows.map(function(){
+
+                                       return $(this).text().toLowerCase();
+                               });
+
+                       var term = $.trim(input.val().toLowerCase()), scores = 
[];
+
+                       if (!term) {
+                               rows.show();
+                       } else {
+                               rows.hide();
+
+                               cache.each(function(i) {
+                                       if (this.indexOf(term)>-1) { 
scores.push(i); }
+                               });
+
+                               $.each(scores, function() {
+                                       $(rows[this]).show();
+                               });
+                       }
+               },
+               _registerDoubleClickEvents: function(elements) {
+                       if (!this.options.doubleClickable) return;
+                       elements.dblclick(function(ev) {
+                               if ($(ev.target).closest('.action').length === 
0) {
+                                       // This may be triggered with rapid 
clicks on actions as well. In that
+                                       // case don't trigger an additional 
click.
+                                       elements.find('a.action').click();
+                               }
+                       });
+               },
+               _registerHoverEvents: function(elements) {
+                       elements.removeClass('ui-state-hover');
+                       elements.mouseover(function() {
+                               $(this).addClass('ui-state-hover');
+                       });
+                       elements.mouseout(function() {
+                               $(this).removeClass('ui-state-hover');
+                       });
+               },
+               _registerAddEvents: function(elements) {
+                       var that = this;
+                       elements.click(function() {
+                               var item = that._setSelected($(this).parent(), 
true);
+                               that.count += 1;
+                               that._updateCount();
+                               return false;
+                       });
+
+                       // make draggable
+                       if (this.options.sortable) {
+                               elements.each(function() {
+                                       $(this).parent().draggable({
+                                               connectToSortable: 
that.selectedList,
+                                               helper: function() {
+                                                       var selectedItem = 
that._cloneWithData($(this)).width($(this).width() - 50);
+                                                       
selectedItem.width($(this).width());
+                                                       return selectedItem;
+                                               },
+                                               appendTo: that.container,
+                                               containment: that.container,
+                                               revert: 'invalid'
+                                       });
+                               });
+                       }
+               },
+               _registerRemoveEvents: function(elements) {
+                       var that = this;
+                       elements.click(function() {
+                               that._setSelected($(this).parent(), false);
+                               that.count -= 1;
+                               that._updateCount();
+                               return false;
+                       });
+               },
+               _registerSearchEvents: function(input) {
+                       var that = this;
+
+                       input.focus(function() {
+                                       $(this).addClass('ui-state-active');
+                               })
+                               .blur(function() {
+                                       $(this).removeClass('ui-state-active');
+                               })
+                               .keypress(function(e) {
+                                       if (e.keyCode === 13) { return false; }
+                               })
+                               .keyup(function() {
+                                       that._filter.apply(this, 
[that.availableList]);
+                               });
+               }
+       });
+})(jQuery, mediaWiki);
\ No newline at end of file
diff --git a/special/SpecialCentralNotice.php b/special/SpecialCentralNotice.php
index 0e75691..91cc627 100644
--- a/special/SpecialCentralNotice.php
+++ b/special/SpecialCentralNotice.php
@@ -988,12 +988,7 @@
                                                $readonly,
                                                array( 'value' => $notice, 'id' 
=> 'geotargeted' ) ) ) );
                        $htmlOut .= Xml::closeElement( 'tr' );
-                       if ( $isGeotargeted ) {
-                               $htmlOut .= Xml::openElement( 'tr', array( 
'id'=> 'geoMultiSelector' ) );
-                       } else {
-                               $htmlOut .= Xml::openElement( 'tr',
-                                       array( 'id'=> 'geoMultiSelector', 
'style'=> 'display:none;' ) );
-                       }
+                       $htmlOut .= Xml::openElement( 'tr', array( 'id'=> 
'geoMultiSelector' ) );
                        $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ),
                                $this->msg( 'centralnotice-countries' 
)->escaped() );
                        $htmlOut .= Xml::tags( 'td', array(), 
$this->geoMultiSelector( $countries ) );
@@ -1304,19 +1299,13 @@
                $htmlOut = '';
                if ( $this->editable ) {
                        $htmlOut .= Xml::tags( 'select',
-                               array( 'multiple' => 'multiple', 'size' => 6, 
'id' => 'project_languages[]', 'name' => 'project_languages[]' ),
+                               array( 'multiple' => 'multiple',
+                                        'size' => 6,
+                                        'id' =>'project_languages',
+                                        'name' => 'project_languages[]',
+                                        'class' => 'cn-multiselect'
+                               ),
                                $options
-                       );
-                       $buttons = array();
-                       $buttons[ ] = '<a href="#" 
onclick="selectLanguages(true);return false;">' .
-                               $this->msg( 'powersearch-toggleall' )->text() . 
'</a>';
-                       $buttons[ ] = '<a href="#" 
onclick="selectLanguages(false);return false;">' .
-                               $this->msg( 'powersearch-togglenone' )->text() 
. '</a>';
-                       $buttons[ ] = '<a href="#" 
onclick="top10Languages();return false;">' .
-                               $this->msg( 'centralnotice-top-ten-languages' 
)->text() . '</a>';
-                       $htmlOut .= Xml::tags( 'div',
-                               array( 'class' => 'select-hint' ),
-                               $this->msg( 'centralnotice-select', 
$this->getLanguage()->commaList( $buttons ) )->text()
                        );
                } else {
                        $htmlOut .= Xml::tags( 'select',
@@ -1354,17 +1343,14 @@
                $htmlOut = '';
                if ( $this->editable ) {
                        $htmlOut .= Xml::tags( 'select',
-                               array( 'multiple' => 'multiple', 'size' => 5, 
'id' => 'projects[]', 'name' => 'projects[]' ),
+                               array(
+                                        'multiple' => 'multiple',
+                                        'size' => 6,
+                                        'id' =>'projects',
+                                        'name' => 'projects[]',
+                                        'class' => 'cn-multiselect'
+                               ),
                                $options
-                       );
-                       $buttons = array();
-                       $buttons[ ] = '<a href="#" 
onclick="selectProjects(true);return false;">' .
-                               $this->msg( 'powersearch-toggleall' )->text() . 
'</a>';
-                       $buttons[ ] = '<a href="#" 
onclick="selectProjects(false);return false;">' .
-                               $this->msg( 'powersearch-togglenone' )->text() 
. '</a>';
-                       $htmlOut .= Xml::tags( 'div',
-                               array( 'class' => 'select-hint' ),
-                               $this->msg( 'centralnotice-select', 
$this->getLanguage()->commaList( $buttons ) )->text()
                        );
                } else {
                        $htmlOut .= Xml::tags( 'select',
@@ -1431,8 +1417,9 @@
                                array(
                                        'multiple' => 'multiple',
                                        'size'     => 6,
-                                       'id'       => 'geo_countries[]',
-                                       'name'     => 'geo_countries[]'
+                                       'id'       => 'geo_countries',
+                                       'name'     => 'geo_countries[]',
+                                       'class'    => 'cn-multiselect'
                                ),
                                $options
                        );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9aae04d047ed1b235f3fb46e46017a8150a3382c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Mwalker <[email protected]>

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

Reply via email to