RIFF"WEBPVP8 Е�* �>�T�M'��%�u|�� gk�ZaQb�����o����lN���s�_�3��S+���c�€R��y����//����~��H�@�2oF�X ���R@'�:�ꞓ}��a�M,.� ��o��=�p�U�&g<�:���~���t��.�1���cyW�� We�M=�f�Y6v�����(nO���������^- �9(b _�s%{�C|�p�@�����37�}B0��u���i�Գ���� ������5�}���֮M?dz���q�e��N�~�&�N��K�av$]hO�i�C�,��"]�����@����M@�o O[�Æ*;�e]��_; }�p�?��)�'VC� J��L�y� v����18��)7c�d�mߛ�]I� ����d��?�{�.����b)49��c��Zy/��c^��%��/z�å̯�t��rS��Z��Uͩ�h��2����` �7�:��~��zP���Z����?v�R��TD���G����CJ���}�o��fs��̜#b��e"k9,���3�{Or�i��x":���{/ۈ�`�7RČ����(�p:I��%:�ͺ��W(|�=KP��3�7}���������ed��;�3�;�e��8�g�4�9 %v,B�GU�����T% ֯��B+�tR���p������F7�sT��oϱq �h�Rݧ�~*�܈_�Ck���}�nY�>��C�PQ�B��(o�६�qxy������f ���]��}����%=CW�k^t�—]����M�cX�i��%��!�Y������:N=|��wj<9ł��,�s�O�,,�U�!�������e���{���W��989�y*z�=�"E�CyW���N�2�ę��LN�HW��?����`V���DJ=#׶×ܽ$eF���o;b� ��0��&�W���Y�bR�� �Fֵ� `J�an�-Є@�tR�v��e2W��Mn�p��4P1�q ���®w���ũur*�җ.�#�4b���������:���g��ʧ�`R�4�+G�f���niU����$�K-'A�zE&]��Y�H2�4� ��˄�t��Q�4%��L�#��0FS8�Bu����ژ��"����۹�[�JK��4��z�v�ڌ��L*jD0.����?�ڃN��H��J����n�w��6Q(i;��I,.3?|�`���y���D_��(��w��������[��ZYhe�')��D*��kb����c��@� �|S�S3���- ���iq!*��w������Ł��ܩ��*FY���jV�4Q���4�,�ʑV!��N�.�1�KT,��Zp� ���iL�r��Ȧ����"y�tU���PS�ģ��?�QGng_�#yEk��B̝��1hr��ѕ�z*Ԧ�L8T�����H�^�k�-�g�z������w��N����v��RH��E��!0Cؚ)R�@�q�J�qA�r�$k4���om���Ьnu���x�������������y$�8�Z���v� &�+2�|���\r:[,!�Y�C#c��͊�{��7Щ��Y�LVę]�j��)��^���󶦙$�_����Hx>����[ +K�ڏ�1������Q�7@�^{�ik�;'H{�8 �ȇe vR����^� Meq�����Y�MC��U<��O�۫�nAfBf317���x��O�.u@3R}e�`�D��\�z���L��P������y8�?����I�"s`�b 3��ٹd�0��A�/���� ��{b�b������1� ����ka�&T�z�_4���I��PN��8��}N�r��]�՜���ӿ��9�|/.��� �fˑ.�`r�r��U-���7�Rx8L��d$H�m��Ǒ�*x�P{�D�����k��o�ueV�-.��j}���U2��g絍g���s �������aN�X�ҍ���C�� ��X��B�EF���8%p57<�x�Y�e�cϔ�\��C �OAj&N�V���!v��U��~J��j��4�V|��8�R�v�fD�)�HA�3�G��ds�7Z.���= ����+kI2�0=�'� K �H,`�ɴāTE\����E�'/��;���;��a���0"��� �x$J�T��#U=������j-�8�����y c8W����Ԋ�K��_��Y� '%Vg$I�Пq�shE�y�:�m�}�F1(:b�U�~� ���0}�C�}0����#�#}���e�S9��.��SP�m���<�~�y��� ��ɭ�ٮ6N��� ğ��t��A��N�V ������f�+�w�O1�Jq���U�B�T��į���� ��*�=z�x"yU S���� ��// ����W᫮��R�O�2W�M��<-�;�F�`9 �����t�:C{a�8�� <�r'���:�g8%�9J̞�˦��eV�7l�~�#����.yY)$��k�|�!�3���m���XS���J4B���`�����oL[]��aT[�C��@h�T�l��_�e>�����K<'��P�zgk�#fm��V�]�ݽ�j1����H��J��J58��ڱ��@�e&*�w��e���Q��HT8�ֽ��\�Fa�栆�A�ڝӚ׹@�:9`��G�h�7����t<���_˒|�\bU�O�����,M�a�oynGf�޶7�w�i`�m[��XE4�*�8}5��U1���^�B*��_%[����Yb�^���S�l�"A�1�T��ڈ��(???)j�S�n�8v%� Eo��� mE��|�Έ�Ai�3uy5O����7Rܽ���"L��X���1�@�=?5�_'��{j�����Z3L��k��^x6g3i�����r.��N��&��9[��ɓW[+�� 7�����fe�3�K�%��0F��+V�ϛ+3�B�p,y;Z�NGK�uWg䁯9�v��t��ǒx�JY�O��K�iY��#FJy�Bzt�Q^�Y��Uϲ-͖��9��g�X,�X] f�P/�]d�䠾�̔m%Q��겓\q(�%'����/EN�P�1�o��� ���}��'��c�F��Ju��4��0ck�N��w�1��&]a ��^I�)����֓��\;�1��3��� �L��{>�+���a��Jg��#����P���>�5�a<�`>>˔�]�ߎey�-T���ʵ���r���8`dmNm���_mӐK�Ҏ-޴�� ��RQ%�d�l"��l�_��ie0.�$Xh|.jv,���l\ uyj�u\�/� B:�܀�]� _��T��I���lz�&c�A�g{g��O˂�O���O�M�t��7Y�~? ቶ`�7��'�w��#���˚�\��_��� a��d���[Ҭњ��]ɢ�A$ �l�v=E�66d �WA\̬fsǭ}x;';���?�UW�O��{�&|_a�C� |ȹ��pka�|���zf[S�������[�Jcf�A�&�L�U)Pd+)�_�$1�0�z�'�v\u�' +;�!���dž�]h�N�{ku��<��a��.0�,��]q��ZKao=ILo�z�rb&�{@K�i*7nX).�/�̶��ӒU�v �B֝���a��n��تx ���P�AG7M4N�?r;Z�����7�@�wA�q��RM5�8ۭ ��g��8�g���G�Tſ�O�{2��P3r��6�W,/��kC���p�V���~�"���T���6�/<�4�U�>��T�H�Fc�T�D�^I���!�����=&\Em�>b�,|T��d���n��=@\Wzi���D��&�f���1�t�mC�Ih��m��&�������84�!H�i�|�Z���� ��W���g����8�h�B] OvQ�u����+�}n�� FE�+q�&j����I�u��&��=!��T�b�@�ք0 �D�W�W�t�V}�������^�g�Erb`j��2 �wr�\Y5��L�Ρ���_�bNU�)~�e�Z�U�*�����:�vƀu2�W-W��W{KKo0�)��G�K.��{̮���v�/��p� !�� �w;`��b ������F���/���:����I�lm��Vc�,x~m<=|�_�>n����(A�����{�膾���m�,{3 �ӀH=٘�%��[USd��!J�|�f_�/ �߻��)I%���G�ܑ�G |N������d��BU5��qvG�c,���A?!��w��� �S��-i���Fr�P�_��E�+��)��V��f��������~�����������}"sk��cHN�<� 5I�r��1gu�ݗ�,N�I��f��k�s���0��: 0�<�\ͩB�܄ �:�f2A��mҞ�Z�6��3��t�����͟~����J�R9�] �,h������Z�@�{����9��W�il!�:��P��P���wK)���p���!���KuB\�7 uI�?(���/��r3����v,\'�8��qUa�ء���!��(b��n?�YfӸ����r�$���ה�~��_�&�8g�<(Mx$ZO�������u`q��:�N�Q !�%`���h:�� �~>�D���m�^��[V!y�6=� ��m��ѡ��p4�Iꎸ��1cE��QS�ٷ��W�C����*�����Q��=��3���&���-#,åCCG�������9�i��3�C��S[t>���qm����B��s���������o��� J�^s|����r��\ԺΦ�a�{��1��wT'���� �̓Q���B��\xx}��8��Of!��U�n��f�����bA��UD�cC} �r�������c ���^�X���k�Ɩk�6��^E�C�E�sՀ`�Ⱦ,i��v�� ٺe˟�!�co�64x4��A�ah��ˏ<��%�@�*|�\�TY����#:9��|?S�[������G hUw9���z]��D��-J6�m,ʭ��2�Iz�4W9��&���t�߁ R�Z�gP��H�dj�`%ap}�^떟��*fb{�Q) Dd_V����$��,�߁� @D�&f�2��S6��M�ɤ�)Q\F�i���5p��Wb'PN�R�>�����9��]��\8{B8�� ��ю�������%� ӏۙ{]�j,_Y>��!�l���'���H�["��;c?cy��1< 0ϑ���/�AAЛ�� ; �j�(!��1 [)5ݻK ��A7��"[�%"���{��H ���V�� ���m�K���VLn��9鿹8�At΀@����f`�1y�rЅ��q��7Nf���x)y��, 0e�"{�ƨ�"� o �6� �.|Tm.���-r �G� [ed���–q���]�X�oG*�1>�� م�p_Y{δ(N�|s��^{i�`��͒ QӴx+X.ݕ�kP�g]�޿�4��Q|�O��h�*c�W�G�4{~x�k��A:�{Yu�倀#ތM�K!�e�;ȩ����r������'���D&H�$�0�ߜ�w��Sq dH��P�y����z����h��d��"�;0��#I2�F{����. W�wl���|>s�\ŌO�&bO/4(z9ܭua��`��_3d�Qpt�/�P -��#5�,�M��� �pA:©�q�����NW��ډ�A���� �9nʺج���� �TSM��{J6?7��r�@�\����D��� �׶���s�f�TJj?"��D��`?��̒� b�#�%�C*v�$�{�$����5Ծ�F�s��y�e/8��h-�f�̰&(����Gj�L:U� 2�� ����v�_k����Y��gp,�k�WF�R������_C�R��N@���R�@�ߔ?A�w9���F("iNa-S���Q�o�3tDMLh*�#4k�T/iQ��Y*�G��m����)��8�hBm/�I�,g�ﯖ���Z��}�Cz�q@´��d.����L�ŕ�,��1�Z�܌�: ̪���F+J-'��c�tvJ8��]Q-��b��y �6;*J`r_�d ��'�G ~p��)'�C,�%F��E(��2�k�����lР�z�!�=t ��_�0��f7��� ;�p�|�U �%Filtered {0} from {1}', // when not all of the options are visible due to the filter infoTextEmpty: 'Empty list', // when there are no options present in the list filterOnValues: false // filter by selector's values, boolean , buttonClass: 'btn-white btn-bold'//ACE }, // Selections are invisible on android if the containing select is styled with CSS // http://code.google.com/p/android/issues/detail?id=16922 isBuggyAndroid = /android/i.test(navigator.userAgent.toLowerCase()); // The actual plugin constructor function BootstrapDualListbox(element, options) { this.element = $(element); // jQuery has an extend method which merges the contents of two or // more objects, storing the result in the first object. The first object // is generally empty as we don't want to alter the default options for // future instances of the plugin this.settings = $.extend({}, defaults, options); this._defaults = defaults; this._name = pluginName; this.init(); } function triggerChangeEvent(dualListbox) { dualListbox.element.trigger('change'); } function updateSelectionStates(dualListbox) { dualListbox.element.find('option').each(function(index, item) { var $item = $(item); if (typeof($item.data('original-index')) === 'undefined') { $item.data('original-index', dualListbox.elementCount++); } if (typeof($item.data('_selected')) === 'undefined') { $item.data('_selected', false); } }); } function changeSelectionState(dualListbox, original_index, selected) { dualListbox.element.find('option').each(function(index, item) { var $item = $(item); if ($item.data('original-index') === original_index) { $item.prop('selected', selected); } }); } function formatString(s, args) { return s.replace(/\{(\d+)\}/g, function(match, number) { return typeof args[number] !== 'undefined' ? args[number] : match; }); } function refreshInfo(dualListbox) { if (!dualListbox.settings.infoText) { return; } var visible1 = dualListbox.elements.select1.find('option').length, visible2 = dualListbox.elements.select2.find('option').length, all1 = dualListbox.element.find('option').length - dualListbox.selectedElements, all2 = dualListbox.selectedElements, content = ''; if (all1 === 0) { content = dualListbox.settings.infoTextEmpty; } else if (visible1 === all1) { content = formatString(dualListbox.settings.infoText, [visible1, all1]); } else { content = formatString(dualListbox.settings.infoTextFiltered, [visible1, all1]); } dualListbox.elements.info1.html(content); dualListbox.elements.box1.toggleClass('filtered', !(visible1 === all1 || all1 === 0)); if (all2 === 0) { content = dualListbox.settings.infoTextEmpty; } else if (visible2 === all2) { content = formatString(dualListbox.settings.infoText, [visible2, all2]); } else { content = formatString(dualListbox.settings.infoTextFiltered, [visible2, all2]); } dualListbox.elements.info2.html(content); dualListbox.elements.box2.toggleClass('filtered', !(visible2 === all2 || all2 === 0)); } function refreshSelects(dualListbox) { dualListbox.selectedElements = 0; dualListbox.elements.select1.empty(); dualListbox.elements.select2.empty(); dualListbox.element.find('option').each(function(index, item) { var $item = $(item); if ($item.prop('selected')) { dualListbox.selectedElements++; dualListbox.elements.select2.append($item.clone(true).prop('selected', $item.data('_selected'))); } else { dualListbox.elements.select1.append($item.clone(true).prop('selected', $item.data('_selected'))); } }); if (dualListbox.settings.showFilterInputs) { filter(dualListbox, 1); filter(dualListbox, 2); } refreshInfo(dualListbox); } function filter(dualListbox, selectIndex) { if (!dualListbox.settings.showFilterInputs) { return; } saveSelections(dualListbox, selectIndex); dualListbox.elements['select'+selectIndex].empty().scrollTop(0); var regex = new RegExp($.trim(dualListbox.elements['filterInput'+selectIndex].val()), 'gi'), options = dualListbox.element; if (selectIndex === 1) { options = options.find('option').not(':selected'); } else { options = options.find('option:selected'); } options.each(function(index, item) { var $item = $(item), isFiltered = true; if (item.text.match(regex) || (dualListbox.settings.filterOnValues && $item.attr('value').match(regex) ) ) { isFiltered = false; dualListbox.elements['select'+selectIndex].append($item.clone(true).prop('selected', $item.data('_selected'))); } dualListbox.element.find('option').eq($item.data('original-index')).data('filtered'+selectIndex, isFiltered); }); refreshInfo(dualListbox); } function saveSelections(dualListbox, selectIndex) { dualListbox.elements['select'+selectIndex].find('option').each(function(index, item) { var $item = $(item); dualListbox.element.find('option').eq($item.data('original-index')).data('_selected', $item.prop('selected')); }); } function sortOptions(select) { select.find('option').sort(function(a, b) { return ($(a).data('original-index') > $(b).data('original-index')) ? 1 : -1; }).appendTo(select); } function clearSelections(dualListbox) { dualListbox.elements.select1.find('option').each(function() { dualListbox.element.find('option').data('_selected', false); }); } function move(dualListbox) { if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 1); saveSelections(dualListbox, 2); } else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 1); } dualListbox.elements.select1.find('option:selected').each(function(index, item) { var $item = $(item); if (!$item.data('filtered1')) { changeSelectionState(dualListbox, $item.data('original-index'), true); } }); refreshSelects(dualListbox); triggerChangeEvent(dualListbox); sortOptions(dualListbox.elements.select2); } function remove(dualListbox) { if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 1); saveSelections(dualListbox, 2); } else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 2); } dualListbox.elements.select2.find('option:selected').each(function(index, item) { var $item = $(item); if (!$item.data('filtered2')) { changeSelectionState(dualListbox, $item.data('original-index'), false); } }); refreshSelects(dualListbox); triggerChangeEvent(dualListbox); sortOptions(dualListbox.elements.select1); } function moveAll(dualListbox) { if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 1); saveSelections(dualListbox, 2); } else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 1); } dualListbox.element.find('option').each(function(index, item) { var $item = $(item); if (!$item.data('filtered1')) { $item.prop('selected', true); } }); refreshSelects(dualListbox); triggerChangeEvent(dualListbox); } function removeAll(dualListbox) { if (dualListbox.settings.preserveSelectionOnMove === 'all' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 1); saveSelections(dualListbox, 2); } else if (dualListbox.settings.preserveSelectionOnMove === 'moved' && !dualListbox.settings.moveOnSelect) { saveSelections(dualListbox, 2); } dualListbox.element.find('option').each(function(index, item) { var $item = $(item); if (!$item.data('filtered2')) { $item.prop('selected', false); } }); refreshSelects(dualListbox); triggerChangeEvent(dualListbox); } function bindEvents(dualListbox) { dualListbox.elements.form.submit(function(e) { if (dualListbox.elements.filterInput1.is(':focus')) { e.preventDefault(); dualListbox.elements.filterInput1.focusout(); } else if (dualListbox.elements.filterInput2.is(':focus')) { e.preventDefault(); dualListbox.elements.filterInput2.focusout(); } }); dualListbox.element.on('bootstrapDualListbox.refresh', function(e, mustClearSelections){ dualListbox.refresh(mustClearSelections); }); dualListbox.elements.filterClear1.on('click', function() { dualListbox.setNonSelectedFilter('', true); }); dualListbox.elements.filterClear2.on('click', function() { dualListbox.setSelectedFilter('', true); }); dualListbox.elements.moveButton.on('click', function() { move(dualListbox); }); dualListbox.elements.moveAllButton.on('click', function() { moveAll(dualListbox); }); dualListbox.elements.removeButton.on('click', function() { remove(dualListbox); }); dualListbox.elements.removeAllButton.on('click', function() { removeAll(dualListbox); }); dualListbox.elements.filterInput1.on('change keyup', function() { filter(dualListbox, 1); }); dualListbox.elements.filterInput2.on('change keyup', function() { filter(dualListbox, 2); }); } BootstrapDualListbox.prototype = { init: function () { // Add the custom HTML template this.container = $('' + '
' + '
' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + ' ' + ' ' + '
' + ' ' + '
' + '
' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + ' ' + ' ' + '
' + ' ' + '
' + '
') .insertBefore(this.element); // Cache the inner elements this.elements = { originalSelect: this.element, box1: $('.box1', this.container), box2: $('.box2', this.container), filterInput1: $('.box1 .filter', this.container), filterInput2: $('.box2 .filter', this.container), filterClear1: $('.box1 .clear1', this.container), filterClear2: $('.box2 .clear2', this.container), label1: $('.box1 > label', this.container), label2: $('.box2 > label', this.container), info1: $('.box1 .info', this.container), info2: $('.box2 .info', this.container), select1: $('.box1 select', this.container), select2: $('.box2 select', this.container), moveButton: $('.box1 .move', this.container), removeButton: $('.box2 .remove', this.container), moveAllButton: $('.box1 .moveall', this.container), removeAllButton: $('.box2 .removeall', this.container), form: $($('.box1 .filter', this.container)[0].form) }; // Set select IDs this.originalSelectName = this.element.attr('name') || ''; var select1Id = 'bootstrap-duallistbox-nonselected-list_' + this.originalSelectName, select2Id = 'bootstrap-duallistbox-selected-list_' + this.originalSelectName; this.elements.select1.attr('id', select1Id); this.elements.select2.attr('id', select2Id); this.elements.label1.attr('for', select1Id); this.elements.label2.attr('for', select2Id); // Apply all settings this.selectedElements = 0; this.elementCount = 0; this.setBootstrap2Compatible(this.settings.bootstrap2Compatible); this.setFilterTextClear(this.settings.filterTextClear); this.setFilterPlaceHolder(this.settings.filterPlaceHolder); this.setMoveSelectedLabel(this.settings.moveSelectedLabel); this.setMoveAllLabel(this.settings.moveAllLabel); this.setRemoveSelectedLabel(this.settings.removeSelectedLabel); this.setRemoveAllLabel(this.settings.removeAllLabel); this.setMoveOnSelect(this.settings.moveOnSelect); this.setPreserveSelectionOnMove(this.settings.preserveSelectionOnMove); this.setSelectedListLabel(this.settings.selectedListLabel); this.setNonSelectedListLabel(this.settings.nonSelectedListLabel); this.setHelperSelectNamePostfix(this.settings.helperSelectNamePostfix); this.setSelectOrMinimalHeight(this.settings.selectorMinimalHeight); updateSelectionStates(this); this.setShowFilterInputs(this.settings.showFilterInputs); this.setNonSelectedFilter(this.settings.nonSelectedFilter); this.setSelectedFilter(this.settings.selectedFilter); this.setInfoText(this.settings.infoText); this.setInfoTextFiltered(this.settings.infoTextFiltered); this.setInfoTextEmpty(this.settings.infoTextEmpty); this.setFilterOnValues(this.settings.filterOnValues); // Hide the original select this.element.hide(); bindEvents(this); refreshSelects(this); return this.element; }, setBootstrap2Compatible: function(value, refresh) { this.settings.bootstrap2Compatible = value; if (value) { this.container.removeClass('row').addClass('row-fluid bs2compatible'); this.container.find('.box1, .box2').removeClass('col-md-6').addClass('span6'); this.container.find('.clear1, .clear2').removeClass('btn-default btn-xs').addClass('btn-mini'); this.container.find('input, select').removeClass('form-control'); this.container.find('.btn').removeClass('btn-default'); this.container.find('.moveall > i, .move > i').removeClass('glyphicon glyphicon-arrow-right').addClass('icon-arrow-right'); this.container.find('.removeall > i, .remove > i').removeClass('glyphicon glyphicon-arrow-left').addClass('icon-arrow-left'); } else { this.container.removeClass('row-fluid bs2compatible').addClass('row'); this.container.find('.box1, .box2').removeClass('span6').addClass('col-md-6'); this.container.find('.clear1, .clear2').removeClass('btn-mini').addClass('btn-default btn-xs'); this.container.find('input, select').addClass('form-control'); this.container.find('.btn').addClass(this.settings.buttonClass)//ACE;//s.addClass('btn-default'); this.container.find('.moveall > i, .move > i').removeClass('icon-arrow-right').addClass('glyphicon glyphicon-arrow-right'); this.container.find('.removeall > i, .remove > i').removeClass('icon-arrow-left').addClass('glyphicon glyphicon-arrow-left'); } if (refresh) { refreshSelects(this); } return this.element; }, setFilterTextClear: function(value, refresh) { this.settings.filterTextClear = value; this.elements.filterClear1.html(value); this.elements.filterClear2.html(value); if (refresh) { refreshSelects(this); } return this.element; }, setFilterPlaceHolder: function(value, refresh) { this.settings.filterPlaceHolder = value; this.elements.filterInput1.attr('placeholder', value); this.elements.filterInput2.attr('placeholder', value); if (refresh) { refreshSelects(this); } return this.element; }, setMoveSelectedLabel: function(value, refresh) { this.settings.moveSelectedLabel = value; this.elements.moveButton.attr('title', value); if (refresh) { refreshSelects(this); } return this.element; }, setMoveAllLabel: function(value, refresh) { this.settings.moveAllLabel = value; this.elements.moveAllButton.attr('title', value); if (refresh) { refreshSelects(this); } return this.element; }, setRemoveSelectedLabel: function(value, refresh) { this.settings.removeSelectedLabel = value; this.elements.removeButton.attr('title', value); if (refresh) { refreshSelects(this); } return this.element; }, setRemoveAllLabel: function(value, refresh) { this.settings.removeAllLabel = value; this.elements.removeAllButton.attr('title', value); if (refresh) { refreshSelects(this); } return this.element; }, setMoveOnSelect: function(value, refresh) { if (isBuggyAndroid) { value = true; } this.settings.moveOnSelect = value; if (this.settings.moveOnSelect) { this.container.addClass('moveonselect'); var self = this; this.elements.select1.on('change', function() { move(self); }); this.elements.select2.on('change', function() { remove(self); }); } else { this.container.removeClass('moveonselect'); this.elements.select1.off('change'); this.elements.select2.off('change'); } if (refresh) { refreshSelects(this); } return this.element; }, setPreserveSelectionOnMove: function(value, refresh) { // We are forcing to move on select and disabling preserveSelectionOnMove on Android if (isBuggyAndroid) { value = false; } this.settings.preserveSelectionOnMove = value; if (refresh) { refreshSelects(this); } return this.element; }, setSelectedListLabel: function(value, refresh) { this.settings.selectedListLabel = value; if (value) { this.elements.label2.show().html(value); } else { this.elements.label2.hide().html(value); } if (refresh) { refreshSelects(this); } return this.element; }, setNonSelectedListLabel: function(value, refresh) { this.settings.nonSelectedListLabel = value; if (value) { this.elements.label1.show().html(value); } else { this.elements.label1.hide().html(value); } if (refresh) { refreshSelects(this); } return this.element; }, setHelperSelectNamePostfix: function(value, refresh) { this.settings.helperSelectNamePostfix = value; if (value) { this.elements.select1.attr('name', this.originalSelectName + value + '1'); this.elements.select2.attr('name', this.originalSelectName + value + '2'); } else { this.elements.select1.removeAttr('name'); this.elements.select2.removeAttr('name'); } if (refresh) { refreshSelects(this); } return this.element; }, setSelectOrMinimalHeight: function(value, refresh) { this.settings.selectorMinimalHeight = value; var height = this.element.height(); if (this.element.height() < value) { height = value; } this.elements.select1.height(height); this.elements.select2.height(height); if (refresh) { refreshSelects(this); } return this.element; }, setShowFilterInputs: function(value, refresh) { if (!value) { this.setNonSelectedFilter(''); this.setSelectedFilter(''); refreshSelects(this); this.elements.filterInput1.hide(); this.elements.filterInput2.hide(); } else { this.elements.filterInput1.show(); this.elements.filterInput2.show(); } this.settings.showFilterInputs = value; if (refresh) { refreshSelects(this); } return this.element; }, setNonSelectedFilter: function(value, refresh) { if (this.settings.showFilterInputs) { this.settings.nonSelectedFilter = value; this.elements.filterInput1.val(value); if (refresh) { refreshSelects(this); } return this.element; } }, setSelectedFilter: function(value, refresh) { if (this.settings.showFilterInputs) { this.settings.selectedFilter = value; this.elements.filterInput2.val(value); if (refresh) { refreshSelects(this); } return this.element; } }, setInfoText: function(value, refresh) { this.settings.infoText = value; if (refresh) { refreshSelects(this); } return this.element; }, setInfoTextFiltered: function(value, refresh) { this.settings.infoTextFiltered = value; if (refresh) { refreshSelects(this); } return this.element; }, setInfoTextEmpty: function(value, refresh) { this.settings.infoTextEmpty = value; if (refresh) { refreshSelects(this); } return this.element; }, setFilterOnValues: function(value, refresh) { this.settings.filterOnValues = value; if (refresh) { refreshSelects(this); } return this.element; }, getContainer: function() { return this.container; }, refresh: function(mustClearSelections) { updateSelectionStates(this); if (!mustClearSelections) { saveSelections(this, 1); saveSelections(this, 2); } else { clearSelections(this); } refreshSelects(this); }, destroy: function() { this.container.remove(); this.element.show(); $.data(this, 'plugin_' + pluginName, null); return this.element; } }; // A really lightweight plugin wrapper around the constructor, // preventing against multiple instantiations $.fn[ pluginName ] = function (options) { var args = arguments; // Is the first parameter an object (options), or was omitted, instantiate a new instance of the plugin. if (options === undefined || typeof options === 'object') { return this.each(function () { // If this is not a select if (!$(this).is('select')) { $(this).find('select').each(function(index, item) { // For each nested select, instantiate the Dual List Box $(item).bootstrapDualListbox(options); }); } else if (!$.data(this, 'plugin_' + pluginName)) { // Only allow the plugin to be instantiated once so we check that the element has no plugin instantiation yet // if it has no instance, create a new one, pass options to our plugin constructor, // and store the plugin instance in the elements jQuery data object. $.data(this, 'plugin_' + pluginName, new BootstrapDualListbox(this, options)); } }); // If the first parameter is a string and it doesn't start with an underscore or "contains" the `init`-function, // treat this as a call to a public method. } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') { // Cache the method call to make it possible to return a value var returns; this.each(function () { var instance = $.data(this, 'plugin_' + pluginName); // Tests that there's already a plugin-instance and checks that the requested public method exists if (instance instanceof BootstrapDualListbox && typeof instance[options] === 'function') { // Call the method of our plugin instance, and pass it the supplied arguments. returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1)); } }); // If the earlier cached method gives a value back return the value, // otherwise return this to preserve chainability. return returns !== undefined ? returns : this; } }; })(jQuery, window, document);