From 4edb57d1b27f0474cef849c8826d2879331a4bc1 Mon Sep 17 00:00:00 2001 From: Greg Franko Date: Mon, 14 Jan 2013 02:48:06 -0500 Subject: [PATCH] References #95 - Fixed IE8 bug when copying over attributes --- src/javascripts/jquery.selectBoxIt.core.js | 28 +++++++++++++++++-- .../jquery.selectBoxIt.core.min.js | 2 +- src/javascripts/jquery.selectBoxIt.js | 28 +++++++++++++++++-- src/javascripts/jquery.selectBoxIt.min.js | 2 +- 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/javascripts/jquery.selectBoxIt.core.js b/src/javascripts/jquery.selectBoxIt.core.js index a4e89c2..5adc052 100644 --- a/src/javascripts/jquery.selectBoxIt.core.js +++ b/src/javascripts/jquery.selectBoxIt.core.js @@ -1705,7 +1705,19 @@ var self = this, // Get's all of the properties associated with the select box and turns it into an array - selectBoxProperties = Array.prototype.slice.call(self.selectBox.prop("attributes")), + selectBoxProperties = (function() { + + var arr = [], x, attrs = self.selectBox.prop("attributes"); + + for(x = 0; x <= attrs.length; x += 1) { + + arr.push(attrs[x]); + + } + + return attrs; + + }()), optionProperties; // Add's all attributes to the currently traversed drop down option @@ -1714,8 +1726,20 @@ // Add's all attributes to the drop down items list self.selectItems.each(function(iterator) { + var arr = [], x, attrs = $(this).prop("attributes"); + // Get's all of the properties associated with currently traversed select box option and turns it into an array - optionProperties = Array.prototype.slice.call($(this).prop("attributes")); + optionProperties = (function() { + + for(x = 0; x <= attrs.length; x += 1) { + + arr.push(attrs[x]); + + } + + return attrs; + + }()); // Add's all attributes to the currently traversed drop down option self._addAttributes(optionProperties, self.listItems.eq(iterator)); diff --git a/src/javascripts/jquery.selectBoxIt.core.min.js b/src/javascripts/jquery.selectBoxIt.core.min.js index 4dad42a..870b320 100644 --- a/src/javascripts/jquery.selectBoxIt.core.min.js +++ b/src/javascripts/jquery.selectBoxIt.core.min.js @@ -1 +1 @@ -(function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.widget("selectBox.selectBoxIt",{VERSION:"2.8.0",options:{showEffect:"none",showEffectOptions:{},showEffectSpeed:"medium",hideEffect:"none",hideEffectOptions:{},hideEffectSpeed:"medium",showFirstOption:!0,defaultText:"",defaultIcon:"",downArrowIcon:"",theme:"bootstrap",keydownOpen:!0,isMobile:function(){var e=navigator.userAgent||navigator.vendor||t.opera;return/iPhone|iPod|iPad|Android|BlackBerry|Opera Mini|IEMobile/.test(e)},nostyle:!1,"native":!1,aggressiveChange:!1},_create:function(){var t=this;if(!t.element.is(":visible"))return;return t.originalElem=t.element[0],t.selectBox=t.element,t.selectItems=t.element.find("option"),t.firstSelectItem=t.element.find("option").slice(0,1),t.currentFocus=0,t.blur=!0,t.documentHeight=e(n).height(),t.textArray=[],t.currentIndex=0,t.flipped=!1,t.disabledClasses=function(){return t.options.theme==="bootstrap"?"disabled":t.options.theme==="jqueryui"?"ui-state-disabled":t.options.theme==="jquerymobile"?"ui-disabled":"selectboxit-disabled"}(),t._createdropdown()._createUnorderedList()._addSelectBoxAttributes()._replaceSelectBox()._eventHandlers(),t.originalElem.disabled&&t.disable&&t.disable(),t._ariaAccessibility&&t._ariaAccessibility(),t.options.theme==="bootstrap"?t._twitterbootstrap():this.options.theme==="jqueryui"?t._jqueryui():this.options.theme==="jquerymobile"?t._jquerymobile():t._addClasses(),t._mobile(),t.options["native"]&&this._applyNativeSelect(),t.triggerEvent("create"),t},_createdropdown:function(){var t=this;return t.dropdownText=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItText","class":"selectboxit-text",unselectable:"on",text:t.firstSelectItem.text()}).attr("data-val",t.originalElem.value),t.dropdownImage=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItDefaultIcon","class":"selectboxit-default-icon",unselectable:"on"}),t.dropdown=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxIt","class":"selectboxit "+(t.selectBox.attr("class")||""),name:t.originalElem.name,tabindex:t.selectBox.attr("tabindex")||"0",unselectable:"on"}).append(t.dropdownImage).append(t.dropdownText),t.dropdownContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItContainer","class":"selectboxit-container"}).append(t.dropdown),t},_createUnorderedList:function(){var t=this,n,r,i,s,o,u,a,f="",l=e("
    ",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItOptions","class":"selectboxit-options",tabindex:-1});return t.options.showFirstOption||(t.selectItems=t.selectBox.find("option").slice(1)),t.selectItems.each(function(l){r="",i="",n=e(this).prop("disabled"),s=e(this).data("icon")||"",o=e(this).data("iconurl")||"",u=o?"selectboxit-option-icon-url":"",a=o?"style=\"background-image:url('"+o+"');\"":"",e(this).parent().is("optgroup")&&(r="selectboxit-optgroup-option",e(this).index()===0&&(i=''+e(this).parent().first().attr("label")+"")),f+=i+'
  • "+t.htmlEscape(e(this).text())+"
  • ",t.textArray[l]=e(this).text(),this.selected&&(t.dropdownText.text(e(this).text()),t.currentFocus=l)}),t.options.defaultText&&t.dropdownText.text(t.options.defaultText),t.selectBox.data("text")&&(t.dropdownText.text(t.selectBox.data("text")),t.options.defaultText=t.selectBox.data("text")),l.append(f),t.list=l,t.dropdownContainer.append(t.list),t.listItems=t.list.find("li"),t.listItems.first().addClass("selectboxit-option-first"),t.listItems.last().addClass("selectboxit-option-last"),t.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass(t.disabledClasses),t.currentFocus===0&&!t.options.showFirstOption&&t.listItems.eq(0).hasClass(t.disabledClasses)&&(t.currentFocus=+t.listItems.not(".ui-state-disabled").first().attr("id")),t.dropdownImage.addClass(t.selectBox.data("icon")||t.options.defaultIcon||t.listItems.eq(t.currentFocus).find("i").attr("class")),t.dropdownImage.attr("style",t.listItems.eq(t.currentFocus).find("i").attr("style")),t},_replaceSelectBox:function(){var t=this;t.selectBox.css("display","none").after(t.dropdownContainer);var n=t.dropdown.height();return t.downArrow=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrow","class":"selectboxit-arrow",unselectable:"on"}),t.downArrowContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrowContainer","class":"selectboxit-arrow-container",unselectable:"on"}).append(t.downArrow),t.dropdown.append(this.options.nostyle?t.downArrow:t.downArrowContainer),t.options.nostyle||(t.downArrowContainer.css({height:n+"px"}),t.dropdownText.css({"line-height":t.dropdown.css("height"),"max-width":t.dropdown.outerWidth()-(t.downArrowContainer.outerWidth()+t.dropdownImage.outerWidth())}),t.dropdownImage.css({"margin-top":n/4}),t.listItems.removeClass("selectboxit-selected").eq(t.currentFocus).addClass("selectboxit-selected")),t},_scrollToView:function(e){var t=this,n=t.list.scrollTop(),r=t.listItems.eq(t.currentFocus).height(),i=t.listItems.eq(t.currentFocus).position().top,s=t.list.height();return e==="search"?s-i/g,">")},triggerEvent:function(e){var t=this,n=t.options.showFirstOption?t.currentFocus:t.currentFocus-1>=0?t.currentFocus:0;return t.selectBox.trigger(e,{elem:t.selectBox.eq(n),"dropdown-elem":t.listItems.eq(t.currentFocus)}),t},_addSelectBoxAttributes:function(t){var n=this,r=Array.prototype.slice.call(n.selectBox.prop("attributes")),i;return n._addAttributes(r,n.dropdown),n.selectItems.each(function(t){i=Array.prototype.slice.call(e(this).prop("attributes")),n._addAttributes(i,n.listItems.eq(t))}),n},_addAttributes:function(t,n){var r=this;return t.length&&e.each(t,function(e,t){var r=t.name.toLowerCase(),i=t.value;r!=="id"&&r!=="class"&&r!=="unselectable"&&n.attr(r,i)}),r}})}); \ No newline at end of file +(function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.widget("selectBox.selectBoxIt",{VERSION:"2.8.0",options:{showEffect:"none",showEffectOptions:{},showEffectSpeed:"medium",hideEffect:"none",hideEffectOptions:{},hideEffectSpeed:"medium",showFirstOption:!0,defaultText:"",defaultIcon:"",downArrowIcon:"",theme:"bootstrap",keydownOpen:!0,isMobile:function(){var e=navigator.userAgent||navigator.vendor||t.opera;return/iPhone|iPod|iPad|Android|BlackBerry|Opera Mini|IEMobile/.test(e)},nostyle:!1,"native":!1,aggressiveChange:!1},_create:function(){var t=this;if(!t.element.is(":visible"))return;return t.originalElem=t.element[0],t.selectBox=t.element,t.selectItems=t.element.find("option"),t.firstSelectItem=t.element.find("option").slice(0,1),t.currentFocus=0,t.blur=!0,t.documentHeight=e(n).height(),t.textArray=[],t.currentIndex=0,t.flipped=!1,t.disabledClasses=function(){return t.options.theme==="bootstrap"?"disabled":t.options.theme==="jqueryui"?"ui-state-disabled":t.options.theme==="jquerymobile"?"ui-disabled":"selectboxit-disabled"}(),t._createdropdown()._createUnorderedList()._addSelectBoxAttributes()._replaceSelectBox()._eventHandlers(),t.originalElem.disabled&&t.disable&&t.disable(),t._ariaAccessibility&&t._ariaAccessibility(),t.options.theme==="bootstrap"?t._twitterbootstrap():this.options.theme==="jqueryui"?t._jqueryui():this.options.theme==="jquerymobile"?t._jquerymobile():t._addClasses(),t._mobile(),t.options["native"]&&this._applyNativeSelect(),t.triggerEvent("create"),t},_createdropdown:function(){var t=this;return t.dropdownText=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItText","class":"selectboxit-text",unselectable:"on",text:t.firstSelectItem.text()}).attr("data-val",t.originalElem.value),t.dropdownImage=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItDefaultIcon","class":"selectboxit-default-icon",unselectable:"on"}),t.dropdown=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxIt","class":"selectboxit "+(t.selectBox.attr("class")||""),name:t.originalElem.name,tabindex:t.selectBox.attr("tabindex")||"0",unselectable:"on"}).append(t.dropdownImage).append(t.dropdownText),t.dropdownContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItContainer","class":"selectboxit-container"}).append(t.dropdown),t},_createUnorderedList:function(){var t=this,n,r,i,s,o,u,a,f="",l=e("
      ",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItOptions","class":"selectboxit-options",tabindex:-1});return t.options.showFirstOption||(t.selectItems=t.selectBox.find("option").slice(1)),t.selectItems.each(function(l){r="",i="",n=e(this).prop("disabled"),s=e(this).data("icon")||"",o=e(this).data("iconurl")||"",u=o?"selectboxit-option-icon-url":"",a=o?"style=\"background-image:url('"+o+"');\"":"",e(this).parent().is("optgroup")&&(r="selectboxit-optgroup-option",e(this).index()===0&&(i=''+e(this).parent().first().attr("label")+"")),f+=i+'
    • "+t.htmlEscape(e(this).text())+"
    • ",t.textArray[l]=e(this).text(),this.selected&&(t.dropdownText.text(e(this).text()),t.currentFocus=l)}),t.options.defaultText&&t.dropdownText.text(t.options.defaultText),t.selectBox.data("text")&&(t.dropdownText.text(t.selectBox.data("text")),t.options.defaultText=t.selectBox.data("text")),l.append(f),t.list=l,t.dropdownContainer.append(t.list),t.listItems=t.list.find("li"),t.listItems.first().addClass("selectboxit-option-first"),t.listItems.last().addClass("selectboxit-option-last"),t.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass(t.disabledClasses),t.currentFocus===0&&!t.options.showFirstOption&&t.listItems.eq(0).hasClass(t.disabledClasses)&&(t.currentFocus=+t.listItems.not(".ui-state-disabled").first().attr("id")),t.dropdownImage.addClass(t.selectBox.data("icon")||t.options.defaultIcon||t.listItems.eq(t.currentFocus).find("i").attr("class")),t.dropdownImage.attr("style",t.listItems.eq(t.currentFocus).find("i").attr("style")),t},_replaceSelectBox:function(){var t=this;t.selectBox.css("display","none").after(t.dropdownContainer);var n=t.dropdown.height();return t.downArrow=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrow","class":"selectboxit-arrow",unselectable:"on"}),t.downArrowContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrowContainer","class":"selectboxit-arrow-container",unselectable:"on"}).append(t.downArrow),t.dropdown.append(this.options.nostyle?t.downArrow:t.downArrowContainer),t.options.nostyle||(t.downArrowContainer.css({height:n+"px"}),t.dropdownText.css({"line-height":t.dropdown.css("height"),"max-width":t.dropdown.outerWidth()-(t.downArrowContainer.outerWidth()+t.dropdownImage.outerWidth())}),t.dropdownImage.css({"margin-top":n/4}),t.listItems.removeClass("selectboxit-selected").eq(t.currentFocus).addClass("selectboxit-selected")),t},_scrollToView:function(e){var t=this,n=t.list.scrollTop(),r=t.listItems.eq(t.currentFocus).height(),i=t.listItems.eq(t.currentFocus).position().top,s=t.list.height();return e==="search"?s-i/g,">")},triggerEvent:function(e){var t=this,n=t.options.showFirstOption?t.currentFocus:t.currentFocus-1>=0?t.currentFocus:0;return t.selectBox.trigger(e,{elem:t.selectBox.eq(n),"dropdown-elem":t.listItems.eq(t.currentFocus)}),t},_addSelectBoxAttributes:function(t){var n=this,r=function(){var e=[],t,r=n.selectBox.prop("attributes");for(t=0;t<=r.length;t+=1)e.push(r[t]);return r}(),i;return n._addAttributes(r,n.dropdown),n.selectItems.each(function(t){var r=[],s,o=e(this).prop("attributes");i=function(){for(s=0;s<=o.length;s+=1)r.push(o[s]);return o}(),n._addAttributes(i,n.listItems.eq(t))}),n},_addAttributes:function(t,n){var r=this;return t.length&&e.each(t,function(e,t){var r=t.name.toLowerCase(),i=t.value;r!=="id"&&r!=="class"&&r!=="unselectable"&&n.attr(r,i)}),r}})}); \ No newline at end of file diff --git a/src/javascripts/jquery.selectBoxIt.js b/src/javascripts/jquery.selectBoxIt.js index 70fc328..41b3032 100644 --- a/src/javascripts/jquery.selectBoxIt.js +++ b/src/javascripts/jquery.selectBoxIt.js @@ -1705,7 +1705,19 @@ var self = this, // Get's all of the properties associated with the select box and turns it into an array - selectBoxProperties = Array.prototype.slice.call(self.selectBox.prop("attributes")), + selectBoxProperties = (function() { + + var arr = [], x, attrs = self.selectBox.prop("attributes"); + + for(x = 0; x <= attrs.length; x += 1) { + + arr.push(attrs[x]); + + } + + return attrs; + + }()), optionProperties; // Add's all attributes to the currently traversed drop down option @@ -1714,8 +1726,20 @@ // Add's all attributes to the drop down items list self.selectItems.each(function(iterator) { + var arr = [], x, attrs = $(this).prop("attributes"); + // Get's all of the properties associated with currently traversed select box option and turns it into an array - optionProperties = Array.prototype.slice.call($(this).prop("attributes")); + optionProperties = (function() { + + for(x = 0; x <= attrs.length; x += 1) { + + arr.push(attrs[x]); + + } + + return attrs; + + }()); // Add's all attributes to the currently traversed drop down option self._addAttributes(optionProperties, self.listItems.eq(iterator)); diff --git a/src/javascripts/jquery.selectBoxIt.min.js b/src/javascripts/jquery.selectBoxIt.min.js index eee867e..48d9ae2 100644 --- a/src/javascripts/jquery.selectBoxIt.min.js +++ b/src/javascripts/jquery.selectBoxIt.min.js @@ -1,4 +1,4 @@ -(function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.widget("selectBox.selectBoxIt",{VERSION:"2.8.0",options:{showEffect:"none",showEffectOptions:{},showEffectSpeed:"medium",hideEffect:"none",hideEffectOptions:{},hideEffectSpeed:"medium",showFirstOption:!0,defaultText:"",defaultIcon:"",downArrowIcon:"",theme:"bootstrap",keydownOpen:!0,isMobile:function(){var e=navigator.userAgent||navigator.vendor||t.opera;return/iPhone|iPod|iPad|Android|BlackBerry|Opera Mini|IEMobile/.test(e)},nostyle:!1,"native":!1,aggressiveChange:!1},_create:function(){var t=this;if(!t.element.is(":visible"))return;return t.originalElem=t.element[0],t.selectBox=t.element,t.selectItems=t.element.find("option"),t.firstSelectItem=t.element.find("option").slice(0,1),t.currentFocus=0,t.blur=!0,t.documentHeight=e(n).height(),t.textArray=[],t.currentIndex=0,t.flipped=!1,t.disabledClasses=function(){return t.options.theme==="bootstrap"?"disabled":t.options.theme==="jqueryui"?"ui-state-disabled":t.options.theme==="jquerymobile"?"ui-disabled":"selectboxit-disabled"}(),t._createdropdown()._createUnorderedList()._addSelectBoxAttributes()._replaceSelectBox()._eventHandlers(),t.originalElem.disabled&&t.disable&&t.disable(),t._ariaAccessibility&&t._ariaAccessibility(),t.options.theme==="bootstrap"?t._twitterbootstrap():this.options.theme==="jqueryui"?t._jqueryui():this.options.theme==="jquerymobile"?t._jquerymobile():t._addClasses(),t._mobile(),t.options["native"]&&this._applyNativeSelect(),t.triggerEvent("create"),t},_createdropdown:function(){var t=this;return t.dropdownText=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItText","class":"selectboxit-text",unselectable:"on",text:t.firstSelectItem.text()}).attr("data-val",t.originalElem.value),t.dropdownImage=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItDefaultIcon","class":"selectboxit-default-icon",unselectable:"on"}),t.dropdown=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxIt","class":"selectboxit "+(t.selectBox.attr("class")||""),name:t.originalElem.name,tabindex:t.selectBox.attr("tabindex")||"0",unselectable:"on"}).append(t.dropdownImage).append(t.dropdownText),t.dropdownContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItContainer","class":"selectboxit-container"}).append(t.dropdown),t},_createUnorderedList:function(){var t=this,n,r,i,s,o,u,a,f="",l=e("
        ",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItOptions","class":"selectboxit-options",tabindex:-1});return t.options.showFirstOption||(t.selectItems=t.selectBox.find("option").slice(1)),t.selectItems.each(function(l){r="",i="",n=e(this).prop("disabled"),s=e(this).data("icon")||"",o=e(this).data("iconurl")||"",u=o?"selectboxit-option-icon-url":"",a=o?"style=\"background-image:url('"+o+"');\"":"",e(this).parent().is("optgroup")&&(r="selectboxit-optgroup-option",e(this).index()===0&&(i=''+e(this).parent().first().attr("label")+"")),f+=i+'
      • "+t.htmlEscape(e(this).text())+"
      • ",t.textArray[l]=e(this).text(),this.selected&&(t.dropdownText.text(e(this).text()),t.currentFocus=l)}),t.options.defaultText&&t.dropdownText.text(t.options.defaultText),t.selectBox.data("text")&&(t.dropdownText.text(t.selectBox.data("text")),t.options.defaultText=t.selectBox.data("text")),l.append(f),t.list=l,t.dropdownContainer.append(t.list),t.listItems=t.list.find("li"),t.listItems.first().addClass("selectboxit-option-first"),t.listItems.last().addClass("selectboxit-option-last"),t.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass(t.disabledClasses),t.currentFocus===0&&!t.options.showFirstOption&&t.listItems.eq(0).hasClass(t.disabledClasses)&&(t.currentFocus=+t.listItems.not(".ui-state-disabled").first().attr("id")),t.dropdownImage.addClass(t.selectBox.data("icon")||t.options.defaultIcon||t.listItems.eq(t.currentFocus).find("i").attr("class")),t.dropdownImage.attr("style",t.listItems.eq(t.currentFocus).find("i").attr("style")),t},_replaceSelectBox:function(){var t=this;t.selectBox.css("display","none").after(t.dropdownContainer);var n=t.dropdown.height();return t.downArrow=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrow","class":"selectboxit-arrow",unselectable:"on"}),t.downArrowContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrowContainer","class":"selectboxit-arrow-container",unselectable:"on"}).append(t.downArrow),t.dropdown.append(this.options.nostyle?t.downArrow:t.downArrowContainer),t.options.nostyle||(t.downArrowContainer.css({height:n+"px"}),t.dropdownText.css({"line-height":t.dropdown.css("height"),"max-width":t.dropdown.outerWidth()-(t.downArrowContainer.outerWidth()+t.dropdownImage.outerWidth())}),t.dropdownImage.css({"margin-top":n/4}),t.listItems.removeClass("selectboxit-selected").eq(t.currentFocus).addClass("selectboxit-selected")),t},_scrollToView:function(e){var t=this,n=t.list.scrollTop(),r=t.listItems.eq(t.currentFocus).height(),i=t.listItems.eq(t.currentFocus).position().top,s=t.list.height();return e==="search"?s-i/g,">")},triggerEvent:function(e){var t=this,n=t.options.showFirstOption?t.currentFocus:t.currentFocus-1>=0?t.currentFocus:0;return t.selectBox.trigger(e,{elem:t.selectBox.eq(n),"dropdown-elem":t.listItems.eq(t.currentFocus)}),t},_addSelectBoxAttributes:function(t){var n=this,r=Array.prototype.slice.call(n.selectBox.prop("attributes")),i;return n._addAttributes(r,n.dropdown),n.selectItems.each(function(t){i=Array.prototype.slice.call(e(this).prop("attributes")),n._addAttributes(i,n.listItems.eq(t))}),n},_addAttributes:function(t,n){var r=this;return t.length&&e.each(t,function(e,t){var r=t.name.toLowerCase(),i=t.value;r!=="id"&&r!=="class"&&r!=="unselectable"&&n.attr(r,i)}),r}})}); +(function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.widget("selectBox.selectBoxIt",{VERSION:"2.8.0",options:{showEffect:"none",showEffectOptions:{},showEffectSpeed:"medium",hideEffect:"none",hideEffectOptions:{},hideEffectSpeed:"medium",showFirstOption:!0,defaultText:"",defaultIcon:"",downArrowIcon:"",theme:"bootstrap",keydownOpen:!0,isMobile:function(){var e=navigator.userAgent||navigator.vendor||t.opera;return/iPhone|iPod|iPad|Android|BlackBerry|Opera Mini|IEMobile/.test(e)},nostyle:!1,"native":!1,aggressiveChange:!1},_create:function(){var t=this;if(!t.element.is(":visible"))return;return t.originalElem=t.element[0],t.selectBox=t.element,t.selectItems=t.element.find("option"),t.firstSelectItem=t.element.find("option").slice(0,1),t.currentFocus=0,t.blur=!0,t.documentHeight=e(n).height(),t.textArray=[],t.currentIndex=0,t.flipped=!1,t.disabledClasses=function(){return t.options.theme==="bootstrap"?"disabled":t.options.theme==="jqueryui"?"ui-state-disabled":t.options.theme==="jquerymobile"?"ui-disabled":"selectboxit-disabled"}(),t._createdropdown()._createUnorderedList()._addSelectBoxAttributes()._replaceSelectBox()._eventHandlers(),t.originalElem.disabled&&t.disable&&t.disable(),t._ariaAccessibility&&t._ariaAccessibility(),t.options.theme==="bootstrap"?t._twitterbootstrap():this.options.theme==="jqueryui"?t._jqueryui():this.options.theme==="jquerymobile"?t._jquerymobile():t._addClasses(),t._mobile(),t.options["native"]&&this._applyNativeSelect(),t.triggerEvent("create"),t},_createdropdown:function(){var t=this;return t.dropdownText=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItText","class":"selectboxit-text",unselectable:"on",text:t.firstSelectItem.text()}).attr("data-val",t.originalElem.value),t.dropdownImage=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItDefaultIcon","class":"selectboxit-default-icon",unselectable:"on"}),t.dropdown=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxIt","class":"selectboxit "+(t.selectBox.attr("class")||""),name:t.originalElem.name,tabindex:t.selectBox.attr("tabindex")||"0",unselectable:"on"}).append(t.dropdownImage).append(t.dropdownText),t.dropdownContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItContainer","class":"selectboxit-container"}).append(t.dropdown),t},_createUnorderedList:function(){var t=this,n,r,i,s,o,u,a,f="",l=e("
          ",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItOptions","class":"selectboxit-options",tabindex:-1});return t.options.showFirstOption||(t.selectItems=t.selectBox.find("option").slice(1)),t.selectItems.each(function(l){r="",i="",n=e(this).prop("disabled"),s=e(this).data("icon")||"",o=e(this).data("iconurl")||"",u=o?"selectboxit-option-icon-url":"",a=o?"style=\"background-image:url('"+o+"');\"":"",e(this).parent().is("optgroup")&&(r="selectboxit-optgroup-option",e(this).index()===0&&(i=''+e(this).parent().first().attr("label")+"")),f+=i+'
        • "+t.htmlEscape(e(this).text())+"
        • ",t.textArray[l]=e(this).text(),this.selected&&(t.dropdownText.text(e(this).text()),t.currentFocus=l)}),t.options.defaultText&&t.dropdownText.text(t.options.defaultText),t.selectBox.data("text")&&(t.dropdownText.text(t.selectBox.data("text")),t.options.defaultText=t.selectBox.data("text")),l.append(f),t.list=l,t.dropdownContainer.append(t.list),t.listItems=t.list.find("li"),t.listItems.first().addClass("selectboxit-option-first"),t.listItems.last().addClass("selectboxit-option-last"),t.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass(t.disabledClasses),t.currentFocus===0&&!t.options.showFirstOption&&t.listItems.eq(0).hasClass(t.disabledClasses)&&(t.currentFocus=+t.listItems.not(".ui-state-disabled").first().attr("id")),t.dropdownImage.addClass(t.selectBox.data("icon")||t.options.defaultIcon||t.listItems.eq(t.currentFocus).find("i").attr("class")),t.dropdownImage.attr("style",t.listItems.eq(t.currentFocus).find("i").attr("style")),t},_replaceSelectBox:function(){var t=this;t.selectBox.css("display","none").after(t.dropdownContainer);var n=t.dropdown.height();return t.downArrow=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrow","class":"selectboxit-arrow",unselectable:"on"}),t.downArrowContainer=e("",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrowContainer","class":"selectboxit-arrow-container",unselectable:"on"}).append(t.downArrow),t.dropdown.append(this.options.nostyle?t.downArrow:t.downArrowContainer),t.options.nostyle||(t.downArrowContainer.css({height:n+"px"}),t.dropdownText.css({"line-height":t.dropdown.css("height"),"max-width":t.dropdown.outerWidth()-(t.downArrowContainer.outerWidth()+t.dropdownImage.outerWidth())}),t.dropdownImage.css({"margin-top":n/4}),t.listItems.removeClass("selectboxit-selected").eq(t.currentFocus).addClass("selectboxit-selected")),t},_scrollToView:function(e){var t=this,n=t.list.scrollTop(),r=t.listItems.eq(t.currentFocus).height(),i=t.listItems.eq(t.currentFocus).position().top,s=t.list.height();return e==="search"?s-i/g,">")},triggerEvent:function(e){var t=this,n=t.options.showFirstOption?t.currentFocus:t.currentFocus-1>=0?t.currentFocus:0;return t.selectBox.trigger(e,{elem:t.selectBox.eq(n),"dropdown-elem":t.listItems.eq(t.currentFocus)}),t},_addSelectBoxAttributes:function(t){var n=this,r=function(){var e=[],t,r=n.selectBox.prop("attributes");for(t=0;t<=r.length;t+=1)e.push(r[t]);return r}(),i;return n._addAttributes(r,n.dropdown),n.selectItems.each(function(t){var r=[],s,o=e(this).prop("attributes");i=function(){for(s=0;s<=o.length;s+=1)r.push(o[s]);return o}(),n._addAttributes(i,n.listItems.eq(t))}),n},_addAttributes:function(t,n){var r=this;return t.length&&e.each(t,function(e,t){var r=t.name.toLowerCase(),i=t.value;r!=="id"&&r!=="class"&&r!=="unselectable"&&n.attr(r,i)}),r}})}); (function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.selectBox.selectBoxIt.prototype._ariaAccessibility=function(){var t=this;return t.dropdown.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":t.list.attr("id"),"aria-activedescendant":t.listItems.eq(t.currentFocus).attr("id"),"aria-label":e("label[for='"+t.originalElem.id+"']").text()||"","aria-live":"assertive"}).bind({"disable.selectBoxIt":function(){t.dropdown.attr("aria-disabled","true")},"enable.selectBoxIt":function(){t.dropdown.attr("aria-disabled","false")}}),t.list.attr({role:"listbox","aria-hidden":"true"}),t.listItems.attr({role:"option"}),t.selectBox.bind({"change.selectBoxIt":function(){t.dropdownText.attr("aria-label",t.originalElem.value)},"open.selectBoxIt":function(){t.list.attr("aria-hidden","false"),t.dropdown.attr("aria-expanded","true")},"close.selectBoxIt":function(){t.list.attr("aria-hidden","true"),t.dropdown.attr("aria-expanded","false")}}),t}}); (function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.selectBox.selectBoxIt.prototype.disable=function(t){var n=this;return n.options.disabled||(n.close(),n.triggerEvent("disable"),n.selectBox.attr("disabled","disabled"),n.dropdown.removeAttr("tabindex").addClass("selectboxit-disabled"),e.Widget.prototype.disable.call(n)),n._callbackSupport(t),n},e.selectBox.selectBoxIt.prototype.disableOption=function(e,t){var n=this,r,i,s;return typeof e=="number"&&(n.close(),r=n.selectBox.find("option").eq(e),n.triggerEvent("disable-option"),r.attr("disabled","disabled"),n.listItems.eq(e).attr("data-disabled","true").addClass(n.disabledClasses),n.currentFocus===e&&(i=n.listItems.eq(n.currentFocus).nextAll("li").not("[data-disabled='true']").first().length,s=n.listItems.eq(n.currentFocus).prevAll("li").not("[data-disabled='true']").first().length,i?n.moveDown():s?n.moveUp():n.disable())),n._callbackSupport(t),n},e.selectBox.selectBoxIt.prototype._isDisabled=function(e){var t=this;return t.originalElem.disabled&&t.disable(),t}}); (function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.selectBox.selectBoxIt.prototype._dynamicPositioning=function(){var n=this,r=n.dropdown.offset().top,i=n.list.data("max-height")||n.list.outerHeight(),s=n.dropdown.outerHeight(),o=e(t).height(),u=e(t).scrollTop(),a=r+s+i<=o+u,f=!a;n.list.data("max-height")||n.list.data("max-height",n.list.outerHeight()),n.selectBox.css("display","none");if(!f)n.list.css("max-height",n.list.data("max-height")),n.list.css("top","auto");else if(n.dropdown.offset().top-u>=i)n.list.css("max-height",n.list.data("max-height")),n.list.css("top",n.dropdown.position().top-n.list.outerHeight());else{var l=Math.abs(r+s+i-(o+u)),c=Math.abs(n.dropdown.offset().top-u-i);l