You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
193 KiB

{"version":3,"sources":["dropdown.js"],"names":["$","window","document","undefined","Math","self","Function","fn","dropdown","parameters","returnedValue","$allModules","this","$document","moduleSelector","selector","hasTouch","documentElement","time","Date","getTime","performance","query","arguments","methodInvoked","queryArguments","slice","call","each","elementIndex","initialLoad","pageLostFocus","willRefocus","elementNamespace","id","selectObserver","menuObserver","module","settings","isPlainObject","extend","className","message","fields","keys","metadata","namespace","regExp","error","templates","eventNamespace","moduleNamespace","$module","$context","context","$text","find","text","$search","search","$sizer","sizer","$input","input","$icon","icon","$combo","prev","length","$menu","children","menu","$item","item","activated","itemActivated","internalChange","element","instance","data","initialize","debug","is","alreadySetup","setup","reference","layout","refreshData","save","defaults","restore","selected","create","bind","events","observeChanges","instantiate","verbose","destroy","remove","tabbable","off","removeData","disconnect","MutationObserver","event","select","mutation","observe","has","childList","subtree","random","toString","substr","userChoice","values","$userChoices","$userChoice","html","get","userValues","isArray","index","value","addition","add","variables","addResult","attr","addClass","hideAdditions","hidden","userLabels","label","appendTo","insertAfter","minCharacters","filter","hide","firstUnfiltered","selectedItem","not","unselectable","eq","nextAvailable","$selected","$nextAvailable","nextAll","$prevAvailable","prevAll","hasNext","api","apiSettings","urlData","on","returnedObject","prop","insertBefore","multiple","searchSelection","allowTab","set","selectValues","parent","closest","selection","hasClass","missingMultiple","disabled","removeAttr","detach","prependTo","refresh","invoke","$firstModules","$lastModules","refreshSelectors","refreshItems","clearData","defaultText","defaultValue","placeholderText","toggle","active","show","callback","isFunction","can","maxSelections","allResultsFiltered","allFiltered","onShow","animate","click","intent","menuSearch","focusSearch","visible","onHide","hideOthers","hideMenu","transition","hideSubMenus","$subMenus","touchEvents","keyboardEvents","inputEvents","mouseEvents","single","test","mouseenter","keydown","inputEvent","change","mousedown","mouseup","focus","blur","delay","mouseleave","touch","unbind","searchTerm","afterFiltered","filterActive","onNoResults","allowAdditions","empty","noResults","userSuggestion","focusedOnSearch","useLabels","useAPI","queryRemote","noAPI","filterItems","errorDuration","cache","throttle","onError","serverError","onFailure","onSuccess","response","remoteValues","results","escapedTerm","escape","beginsWithRegExp","RegExp","$choice","match","String","choiceText","push","fullTextSearch","exactSearch","fuzzySearch","choiceValue","filteredItem","filtered","term","termLength","queryLength","toLowerCase","characterIndex","nextCharacterIndex","queryCharacter","charCodeAt","indexOf","skipHandler","forceSelection","$currentlySelected","$activeItem","$selectedItem","hasSelected","showOnFocus","activeElement","activeLabel","$target","target","clearTimeout","timer","setTimeout","$label","$labels","$activeLabels","$nextActive","$prevActive","$range","nextUntil","prevUntil","shiftKey","removeClass","ctrlKey","toggleClass","onLabelSelect","apply","activeLabels","toggleBehavior","bubbledLabelClick","bubbledIconClick","determine","eventOnElement","preventDefault","type","stopPropagation","eventInModule","mutations","$addedNode","addedNodes","$removedNode","removedNodes","$changedNodes","isUserAddition","isMessage","$subMenu","$otherMenus","siblings","hasSubMenu","isBubbledEvent","itemTimer","skipRefocus","allowCategorySelection","userAddition","scrollPosition","selectAction","pressedKey","which","isShortcutKey","inObject","$activeLabel","labelIndex","labelCount","hasActiveLabel","hasMultipleActive","isFirstLabel","isLastLabel","isSearch","isFocusedOnSearch","isFocused","focused","caretAtStart","caretPosition","leftArrow","siblingLabel","end","last","rightArrow","first","next","deleteKey","backspace","$nextItem","isSubMenuItem","$visibleItems","addBack","$parentMenu","inVisibleMenu","animating","hasSelectedItem","selectedIsSelectable","delimiterPressed","delimiter","isAdditionWithoutMenu","enter","upArrow","selectOnKeydown","downArrow","pageUp","scrollPage","pageDown","selectedLetter","fromCharCode","trigger","createEvent","inputElement","initEvent","dispatchEvent","action","inDocument","inModule","inVisibleDOM","body","contains","notOnLabel","notInMenu","nothing","activate","hideAndClear","combo","trim","val","searchWidth","ceil","width","selectionCount","count","upward","grep","uniqueArray","array","inArray","range","rangeLength","selectionStart","createRange","moveStart","isEmptyMultiselect","selectInput","split","name","read","remoteData","preserveHTML","clone","menuIcon","oninput","onpropertychange","$option","placeholder","sortSelect","sort","a","b","activeItem","itemWithAdditions","$items","$userItems","hasUserItems","strict","shouldSearch","isMultiple","optionText","optionValue","check","clear","labels","saveRemoteData","Storage","noStorage","sessionStorage","getItem","setItem","clearValue","direction","isWithinRange","$nextSelectedItem","$currentItem","menuHeight","outerHeight","currentScroll","scrollTop","itemHeight","itemsPerPage","floor","newScroll","$selectableItem","isSearchMultiple","searchValue","hasSearchValue","valueIsSet","glyphWidth","css","loading","partialSearch","forceScroll","hasActive","offset","itemOffset","menuOffset","menuScroll","abovePage","belowPage","edgeTolerance","position","top","height","letter","alreadySelectedLetter","firstLetter","$nextValue","onScreen","$element","escapedValue","hasInput","currentValue","stringValue","allowReselection","extendSelect","fireOnInit","onChange","exactly","selectedText","selectedValue","isFiltered","isActive","isUserValue","shouldAnimate","$next","onLabelCreate","variation","duration","$message","hasOption","$addition","$existingItem","alreadyHasValue","hasUserSuggestion","hasCount","hasMaxCount","hasTerm","replace","addedValue","addedText","newValue","concat","join","onAdd","removedValue","removedText","$removedItem","arrayValue","onRemove","$removedLabel","userValue","onLabelRemove","charAt","items","$normalResults","hasValue","calculations","$currentMenu","canOpenDownward","above","below","needle","object","found","property","selectMutation","selectChanged","start","animation","queue","onStart","onComplete","noTransition","multipleValues","isUnparsable","hasQuotes","quote","setting","internal","silent","log","prototype","console","info","currentTime","executionTime","previousTime","Name","Arguments","Element","Execution Time","display","title","totalTime","group","table","groupCollapsed","groupEnd","passedArguments","maxDepth","depth","camelCaseValue","toUpperCase","method","keepOnScreen","$selectedLabels","option","maybeText","maybeDisabled","choice","jQuery"],"mappings":";;;;;;;;;CAUC,SAAWA,EAAGC,EAAQC,EAAUC,GAEjC,YAEAF,GAA2B,mBAAVA,IAAyBA,EAAOG,MAAQA,KACrDH,EACgB,mBAARI,OAAuBA,KAAKD,MAAQA,KAC1CC,KACAC,SAAS,iBAGfN,EAAEO,GAAGC,SAAW,SAASC,GACvB,GAaEC,GAZAC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O0c,EAAO1K,KAAO,SAChF,iCAAmC0K,EAAO1c,MAAQ,KAAO0c,EAAO1K,KAAO,WAG7ErS,GAAQ,UAKVhD,KAAM,SAAS6K,EAAUzM,GACvB,GACEyE,GAASgI,EAASzM,EAAOyE,YACzBG,EAAS,EAeX,OAbAvH,GAAE4B,KAAKwF,EAAQ,SAASO,EAAO2c,GAC7B,GACEC,GAAaD,EAAO3hB,EAAOc,MACvB,cAAgB6gB,EAAO3hB,EAAOc,MAAQ,IACtC,GACJ+gB,EAAiBF,EAAO3hB,EAAO8H,UAC3B,YACA,EAENlD,IAAQ,eAAgBid,EAAe,qBAAuBF,EAAO3hB,EAAOiF,OAAS,IAAM2c,EAAY,IACvGhd,GAAU+c,EAAO3hB,EAAOiX,MACxBrS,GAAQ,WAEHA,GAITe,MAAO,SAASV,EAAOnE,GACrB,MAAOA,GAAO,+BAKhBf,QAAS,SAASA,GAChB,MAAOA,IAITmF,SAAU,SAAS4c,GACjB,MAAOA,MAKPC,OAAQzkB,OAAQC","file":"dropdown.min.js","sourcesContent":["/*!\n * # Semantic UI 2.2.6 - Dropdown\n * http://github.com/semantic-org/semantic-ui/\n *\n *\n * Released under the MIT license\n * http://opensource.org/licenses/MIT\n *\n */\n\n;(function ($, window, document, undefined) {\n\n\"use strict\";\n\nwindow = (typeof window != 'undefined' && window.Math == Math)\n ? window\n : (typeof self != 'undefined' && self.Math == Math)\n ? self\n : Function('return this')()\n;\n\n$.fn.dropdown = function(parameters) {\n var\n $allModules = $(this),\n $document = $(document),\n\n moduleSelector = $allModules.selector || '',\n\n hasTouch = ('ontouchstart' in document.documentElement),\n time = new Date().getTime(),\n performance = [],\n\n query = arguments[0],\n methodInvoked = (typeof query == 'string'),\n queryArguments = [].slice.call(arguments, 1),\n returnedValue\n ;\n\n $allModules\n .each(function(elementIndex) {\n var\n settings = ( $.isPlainObject(parameters) )\n ? $.extend(true, {}, $.fn.dropdown.settings, parameters)\n : $.extend({}, $.fn.dropdown.settings),\n\n className = settings.className,\n message = settings.message,\n fields = settings.fields,\n keys = settings.keys,\n metadata = settings.metadata,\n namespace = settings.namespace,\n regExp = settings.regExp,\n selector = settings.selector,\n error = settings.error,\n templates = settings.templates,\n\n eventNamespace = '.' + namespace,\n moduleNamespace = 'module-' + namespace,\n\n $module = $(this),\n $context = $(settings.context),\n $text = $module.find(selector.text),\n $search = $module.find(selector.search),\n $sizer = $module.find(selector.sizer),\n $input = $module.find(selector.input),\n $icon = $module.find(selector.icon),\n\n $combo = ($module.prev().find(selector.text).length > 0)\n ? $module.prev().find(selector.text)\n : $module.prev(),\n\n $menu = $module.children(selector.menu),\n $item = $menu.find(selector.item),\n\n activated = false,\n itemActivated = false,\n internalChange = false,\n element = this,\n instance = $module.data(moduleNamespace),\n\n initialLoad,\n pageLostFocus,\n willRefocus,\n elementNamespace,\n id,\n selectObserver,\n menuObserver,\n module\n ;\n\n module = {\n\n initialize: function() {\n module.debug('Initializing dropdown', settings);\n\n if( module.is.alreadySetup() ) {\n module.setup.reference();\n }\n else {\n module.setup.layout();\n module.refreshData();\n\n module.save.defaults();\n module.restore.selected();\n\n module.create.id();\n module.bind.events();\n\n module.observeChanges();\n module.instantiate();\n }\n\n },\n\n instantiate: function() {\n module.verbose('Storing instance of dropdown', module);\n instance = module;\n $module\n .data(moduleNamespace, module)\n ;\n },\n\n destroy: function() {\n module.verbose('Destroying previous dropdown', $module);\n module.remove.tabbable();\n $module\n .off(eventNamespace)\n .removeData(moduleNamespace)\n ;\n $menu\n .off(eventNamespace)\n ;\n $document\n .off(elementNamespace)\n ;\n module.disconnect.menuObserver();\n module.disconnect.selectObserver();\n },\n\n observeChanges: function() {\n if('MutationObserver' in window) {\n selectObserver = new MutationObserver(module.event.select.mutation);\n menuObserver = new MutationObserver(module.event.menu.mutation);\n module.debug('Setting up mutation observer', selectObserver, menuObserver);\n module.observe.select();\n module.observe.menu();\n }\n },\n\n disconnect: {\n menuObserver: function() {\n if(menuObserver) {\n menuObserver.disconnect();\n }\n },\n selectObserver: function() {\n if(selectObserver) {\n selectObserver.disconnect();\n }\n }\n },\n observe: {\n select: function() {\n if(module.has.input()) {\n selectObserver.observe($input[0], {\n childList : true,\n subtree : true\n });\n }\n },\n menu: function() {\n if(module.has.menu()) {\n menuObserver.observe($menu[0], {\n childList : true,\n subtree : true\n });\n }\n }\n },\n\n create: {\n id: function() {\n id = (Math.random().toString(16) + '000000000').substr(2, 8);\n elementNamespace = '.' + id;\n module.verbose('Creating unique id for element', id);\n },\n userChoice: function(values) {\n var\n $userChoices,\n $userChoice,\n isUserValue,\n html\n ;\n values = values || module.get.userValues();\n if(!values) {\n return false;\n }\n values = $.isArray(values)\n ? values\n : [values]\n ;\n $.each(values, function(index, value) {\n if(module.get.item(value) === false) {\n html = settings.templates.addition( module.add.variables(message.addResult, value) );\n $userChoice = $('<div />')\n .html(html)\n .attr('data-' + metadata.value, value)\n .attr('data-' + metadata.text, value)\n .addClass(className.addition)\n .addClass(className.item)\n ;\n if(settings.hideAdditions) {\n $userChoice.addClass(className.hidden);\n }\n $userChoices = ($userChoices === undefined)\n ? $userChoice\n : $userChoices.add($userChoice)\n ;\n module.verbose('Creating user choices for value', value, $userChoice);\n }\n });\n return $userChoices;\n },\n userLabels: function(value) {\n var\n userValues = module.get.userValues()\n ;\n if(userValues) {\n module.debug('Adding user labels', userValues);\n $.each(userValues, function(index, value) {\n module.verbose('Adding custom user value');\n module.add.label(value, value);\n });\n }\n },\n menu: function() {\n $menu = $('<div />')\n .addClass(className.menu)\n .appendTo($module)\n ;\n },\n sizer: function() {\n $sizer = $('<span />')\n .addClass(className.sizer)\n .insertAfter($search)\n ;\n }\n },\n\n search: function(query) {\n query = (query !== undefined)\n ? query\n : module.get.query()\n ;\n module.verbose('Searching for query', query);\n if(module.has.minCharacters(query)) {\n module.filter(query);\n }\n else {\n module.hide();\n }\n },\n\n select: {\n firstUnfiltered: function() {\n module.verbose('Selecting first non-filtered element');\n module.remove.selectedItem();\n $item\n .not(selector.unselectable)\n .not(selector.addition + selector.hidden)\n .eq(0)\n .addClass(className.selected)\n ;\n },\n nextAvailable: function($selected) {\n $selected = $selected.eq(0);\n var\n $nextAvailable = $selected.nextAll(selector.item).not(selector.unselectable).eq(0),\n $prevAvailable = $selected.prevAll(selector.item).not(selector.unselectable).eq(0),\n hasNext = ($nextAvailable.length > 0)\n ;\n if(hasNext) {\n module.verbose('Moving selection to', $nextAvailable);\n $nextAvailable.addClass(className.selected);\n }\n else {\n module.verbose('Moving selection to', $prevAvailable);\n $prevAvailable.addClass(className.selected);\n }\n }\n },\n\n setup: {\n api: function() {\n var\n apiSettings = {\n debug : settings.debug,\n urlData : {\n value : module.get.value(),\n query : module.get.query()\n },\n on : false\n }\n ;\n module.verbose('First request, initializing API');\n $module\n .api(apiSettings)\n ;\n },\n layout: function() {\n if( $module.is('select') ) {\n module.setup.select();\n module.setup.returnedObject();\n }\n if( !module.has.menu() ) {\n module.create.menu();\n }\n if( module.is.search() && !module.has.search() ) {\n module.verbose('Adding search input');\n $search = $('<input />')\n .addClass(className.search)\n .prop('autocomplete', 'off')\n .insertBefore($text)\n ;\n }\n if( module.is.multiple() && module.is.searchSelection() && !module.has.sizer()) {\n module.create.sizer();\n }\n if(settings.allowTab) {\n module.set.tabbable();\n }\n },\n select: function() {\n var\n selectValues = module.get.selectValues()\n ;\n module.debug('Dropdown initialized on a select', selectValues);\n if( $module.is('select') ) {\n $input = $module;\n }\n // see if select is placed correctly already\n if($input.parent(selector.dropdown).length > 0) {\n module.debug('UI dropdown already exists. Creating dropdown menu only');\n $module = $input.closest(selector.dropdown);\n if( !module.has.menu() ) {\n module.create.menu();\n }\n $menu = $module.children(selector.menu);\n module.setup.menu(selectValues);\n }\n else {\n module.debug('Creating entire dropdown from select');\n $module = $('<div />')\n .attr('class', $input.attr('class') )\n .addClass(className.selection)\n .addClass(className.dropdown)\n .html( templates.dropdown(selectValues) )\n .insertBefore($input)\n ;\n if($input.hasClass(className.multiple) && $input.prop('multiple') === false) {\n module.error(error.missingMultiple);\n $input.prop('multiple', true);\n }\n if($input.is('[multiple]')) {\n module.set.multiple();\n }\n if ($input.prop('disabled')) {\n module.debug('Disabling dropdown');\n $module.addClass(className.disabled);\n }\n $input\n .removeAttr('class')\n .detach()\n .prependTo($module)\n ;\n }\n module.refresh();\n },\n menu: function(values) {\n $menu.html( templates.menu(values, fields));\n $item = $menu.find(selector.item);\n },\n reference: function() {\n module.debug('Dropdown behavior was called on select, replacing with closest dropdown');\n // replace module reference\n $module = $module.parent(selector.dropdown);\n module.refresh();\n module.setup.returnedObject();\n // invoke method in context of current instance\n if(methodInvoked) {\n instance = module;\n module.invoke(query);\n }\n },\n returnedObject: function() {\n var\n $firstModules = $allModules.slice(0, elementIndex),\n $lastModules = $allModules.slice(elementIndex + 1)\n ;\n // adjust all modules to use correct reference\n $allModules = $firstModules.add($module).add($lastModules);\n }\n },\n\n refresh: function() {\n module.refreshSelectors();\n module.refreshData();\n },\n\n refreshItems: function() {\n $item = $menu.find(selector.item);\n },\n\n refreshSelectors: function() {\n module.verbose('Refreshing selector cache');\n $text = $module.find(selector.text);\n $search = $module.find(selector.search);\n $input = $module.find(selector.input);\n $icon = $module.find(selector.icon);\n $combo = ($module.prev().find(selector.text).length > 0)\n ? $module.prev().find(selector.text)\n : $module.prev()\n ;\n $menu = $module.children(selector.menu);\n $item = $menu.find(selector.item);\n },\n\n refreshData: function() {\n module.verbose('Refreshing cached metadata');\n $item\n .removeData(metadata.text)\n .removeData(metadata.value)\n ;\n },\n\n clearData: function() {\n module.verbose('Clearing metadata');\n $item\n .removeData(metadata.text)\n .removeData(metadata.value)\n ;\n $module\n .removeData(metadata.defaultText)\n .removeData(metadata.defaultValue)\n .removeData(metadata.placeholderText)\n ;\n },\n\n toggle: function() {\n module.verbose('Toggling menu visibility');\n if( !module.is.active() ) {\n module.show();\n }\n else {\n module.hide();\n }\n },\n\n show: function(callback) {\n callback = $.isFunction(callback)\n ? callback\n : function(){}\n ;\n if( module.can.show() && !module.is.active() ) {\n module.debug('Showing dropdown');\n if(module.has.message() && !(module.has.maxSelections() || module.has.allResultsFiltered()) ) {\n module.remove.message();\n }\n if(module.is.allFiltered()) {\n return true;\n }\n if(settings.onShow.call(element) !== false) {\n module.animate.show(function() {\n if( module.can.click() ) {\n module.bind.intent();\n }\n if(module.has.menuSearch()) {\n module.focusSearch();\n }\n module.set.visible();\n callback.call(element);\n });\n }\n }\n },\n\n hide: function(callback) {\n callback = $.isFunction(callback)\n ? callback\n : function(){}\n ;\n if( module.is.active() ) {\n module.debug('Hiding dropdown');\n if(settings.onHide.call(element) !== false) {\n module.animate.hide(function() {\n module.remove.visible();\n callback.call(element);\n });\n }\n }\n },\n\n hideOthers: function() {\n module.verbose('Finding other dropdowns to hide');\n $allModules\n .not($module)\n .has(selector.menu + '.' + className.visible)\n .dropdown('hide')\n ;\n },\n\n hideMenu: function() {\n module.verbose('Hiding menu instantaneously');\n module.remove.active();\n module.remove.visible();\n $menu.transition('hide');\n },\n\n hideSubMenus: function() {\n var\n $subMenus = $menu.children(selector.item).find(selector.menu)\n ;\n module.verbose('Hiding sub menus', $subMenus);\n $subMenus.transition('hide');\n },\n\n bind: {\n events: function() {\n if(hasTouch) {\n module.bind.touchEvents();\n }\n module.bind.keyboardEvents();\n module.bind.inputEvents();\n module.bind.mouseEvents();\n },\n touchEvents: function() {\n module.debug('Touch device detected binding additional touch events');\n if( module.is.searchSelection() ) {\n // do nothing special yet\n }\n else if( module.is.single() ) {\n $module\n .on('touchstart' + eventNamespace, module.event.test.toggle)\n ;\n }\n $menu\n .on('touchstart' + eventNamespace, selector.item, module.event.item.mouseenter)\n ;\n },\n keyboardEvents: function() {\n module.verbose('Binding keyboard events');\n $module\n .on('keydown' + eventNamespace, module.event.keydown)\n ;\n if( module.has.search() ) {\n $module\n .on(module.get.inputEvent() + eventNamespace, selector.search, module.event.input)\n ;\n }\n if( module.is.multiple() ) {\n $document\n .on('keydown' + elementNamespace, module.event.document.keydown)\n ;\n }\n },\n inputEvents: function() {\n module.verbose('Binding input change events');\n $module\n .on('change' + eventNamespace, selector.input, module.event.change)\n ;\n },\n mouseEvents: function() {\n module.verbose('Binding mouse events');\n if(module.is.multiple()) {\n $module\n .on('click' + eventNamespace, selector.label, module.event.label.click)\n .on('click' + eventNamespace, selector.remove, module.event.remove.click)\n ;\n }\n if( module.is.searchSelection() ) {\n $module\n .on('mousedown' + eventNamespace, module.event.mousedown)\n .on('mouseup' + eventNamespace, module.event.mouseup)\n .on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)\n .on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)\n .on('click' + eventNamespace, selector.icon, module.event.icon.click)\n .on('focus' + eventNamespace, selector.search, module.event.search.focus)\n .on('click' + eventNamespace, selector.search, module.event.search.focus)\n .on('blur' + eventNamespace, selector.search, module.event.search.blur)\n .on('click' + eventNamespace, selector.text, module.event.text.focus)\n ;\n if(module.is.multiple()) {\n $module\n .on('click' + eventNamespace, module.event.click)\n ;\n }\n }\n else {\n if(settings.on == 'click') {\n $module\n .on('click' + eventNamespace, selector.icon, module.event.icon.click)\n .on('click' + eventNamespace, module.event.test.toggle)\n ;\n }\n else if(settings.on == 'hover') {\n $module\n .on('mouseenter' + eventNamespace, module.delay.show)\n .on('mouseleave' + eventNamespace, module.delay.hide)\n ;\n }\n else {\n $module\n .on(settings.on + eventNamespace, module.toggle)\n ;\n }\n $module\n .on('mousedown' + eventNamespace, module.event.mousedown)\n .on('mouseup' + eventNamespace, module.event.mouseup)\n .on('focus' + eventNamespace, module.event.focus)\n .on('blur' + eventNamespace, module.event.blur)\n ;\n }\n $menu\n .on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter)\n .on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave)\n .on('click' + eventNamespace, selector.item, module.event.item.click)\n ;\n },\n intent: function() {\n module.verbose('Binding hide intent event to document');\n if(hasTouch) {\n $document\n .on('touchstart' + elementNamespace, module.event.test.touch)\n .on('touchmove' + elementNamespace, module.event.test.touch)\n ;\n }\n $document\n .on('click' + elementNamespace, module.event.test.hide)\n ;\n }\n },\n\n unbind: {\n intent: function() {\n module.verbose('Removing hide intent event from document');\n if(hasTouch) {\n $document\n .off('touchstart' + elementNamespace)\n .off('touchmove' + elementNamespace)\n ;\n }\n $document\n .off('click' + elementNamespace)\n ;\n }\n },\n\n filter: function(query) {\n var\n searchTerm = (query !== undefined)\n ? query\n : module.get.query(),\n afterFiltered = function() {\n if(module.is.multiple()) {\n module.filterActive();\n }\n module.select.firstUnfiltered();\n if( module.has.allResultsFiltered() ) {\n if( settings.onNoResults.call(element, searchTerm) ) {\n if(settings.allowAdditions) {\n if(settings.hideAdditions) {\n module.verbose('User addition with no menu, setting empty style');\n module.set.empty();\n module.hideMenu();\n }\n }\n else {\n module.verbose('All items filtered, showing message', searchTerm);\n module.add.message(message.noResults);\n }\n }\n else {\n module.verbose('All items filtered, hiding dropdown', searchTerm);\n module.hideMenu();\n }\n }\n else {\n module.remove.empty();\n module.remove.message();\n }\n if(settings.allowAdditions) {\n module.add.userSuggestion(query);\n }\n if(module.is.searchSelection() && module.can.show() && module.is.focusedOnSearch() ) {\n module.show();\n }\n }\n ;\n if(settings.useLabels && module.has.maxSelections()) {\n return;\n }\n if(settings.apiSettings) {\n if( module.can.useAPI() ) {\n module.queryRemote(searchTerm, function() {\n afterFiltered();\n });\n }\n else {\n module.error(error.noAPI);\n }\n }\n else {\n module.filterItems(searchTerm);\n afterFiltered();\n }\n },\n\n queryRemote: function(query, callback) {\n var\n apiSettings = {\n errorDuration : false,\n cache : 'local',\n throttle : settings.throttle,\n urlData : {\n query: query\n },\n onError: function() {\n module.add.message(message.serverError);\n callback();\n },\n onFailure: function() {\n module.add.message(message.serverError);\n callback();\n },\n onSuccess : function(response) {\n module.remove.message();\n module.setup.menu({\n values: response[fields.remoteValues]\n });\n callback();\n }\n }\n ;\n if( !$module.api('get request') ) {\n module.setup.api();\n }\n apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings);\n $module\n .api('setting', apiSettings)\n .api('query')\n ;\n },\n\n filterItems: function(query) {\n var\n searchTerm = (query !== undefined)\n ? query\n : module.get.query(),\n results = null,\n escapedTerm = module.escape.regExp(searchTerm),\n beginsWithRegExp = new RegExp('^' + escapedTerm, 'igm')\n ;\n // avoid loop if we're matching nothing\n if( module.has.query() ) {\n results = [];\n\n module.verbose('Searching for matching values', searchTerm);\n $item\n .each(function(){\n var\n $choice = $(this),\n text,\n value\n ;\n if(settings.match == 'both' || settings.match == 'text') {\n text = String(module.get.choiceText($choice, false));\n if(text.search(beginsWithRegExp) !== -1) {\n results.push(this);\n return true;\n }\n else if (settings.fullTextSearch === 'exact' && module.exactSearch(searchTerm, text)) {\n results.push(this);\n return true;\n }\n else if (settings.fullTextSearch === true && module.fuzzySearch(searchTerm, text)) {\n results.push(this);\n return true;\n }\n }\n if(settings.match == 'both' || settings.match == 'value') {\n value = String(module.get.choiceValue($choice, text));\n\n if(value.search(beginsWithRegExp) !== -1) {\n results.push(this);\n return true;\n }\n else if(settings.fullTextSearch && module.fuzzySearch(searchTerm, value)) {\n results.push(this);\n return true;\n }\n }\n })\n ;\n }\n module.debug('Showing only matched items', searchTerm);\n module.remove.filteredItem();\n if(results) {\n $item\n .not(results)\n .addClass(className.filtered)\n ;\n }\n },\n\n fuzzySearch: function(query, term) {\n var\n termLength = term.length,\n queryLength = query.length\n ;\n query = query.toLowerCase();\n term = term.toLowerCase();\n if(queryLength > termLength) {\n return false;\n }\n if(queryLength === termLength) {\n return (query === term);\n }\n search: for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {\n var\n queryCharacter = query.charCodeAt(characterIndex)\n ;\n while(nextCharacterIndex < termLength) {\n if(term.charCodeAt(nextCharacterIndex++) === queryCharacter) {\n continue search;\n }\n }\n return false;\n }\n return true;\n },\n exactSearch: function (query, term) {\n query = query.toLowerCase();\n term = term.toLowerCase();\n if(term.indexOf(query) > -1) {\n return true;\n }\n return false;\n },\n filterActive: function() {\n if(settings.useLabels) {\n $item.filter('.' + className.active)\n .addClass(className.filtered)\n ;\n }\n },\n\n focusSearch: function(skipHandler) {\n if( module.has.search() && !module.is.focusedOnSearch() ) {\n if(skipHandler) {\n $module.off('focus' + eventNamespace, selector.search);\n $search.focus();\n $module.on('focus' + eventNamespace, selector.search, module.event.search.focus);\n }\n else {\n $search.focus();\n }\n }\n },\n\n forceSelection: function() {\n var\n $currentlySelected = $item.not(className.filtered).filter('.' + className.selected).eq(0),\n $activeItem = $item.not(className.filtered).filter('.' + className.active).eq(0),\n $selectedItem = ($currentlySelected.length > 0)\n ? $currentlySelected\n : $activeItem,\n hasSelected = ($selectedItem.length > 0)\n ;\n if(hasSelected) {\n module.debug('Forcing partial selection to selected item', $selectedItem);\n module.event.item.click.call($selectedItem, {}, true);\n return;\n }\n else {\n if(settings.allowAdditions) {\n module.set.selected(module.get.query());\n module.remove.searchTerm();\n }\n else {\n module.remove.searchTerm();\n }\n }\n },\n\n event: {\n change: function() {\n if(!internalChange) {\n module.debug('Input changed, updating selection');\n module.set.selected();\n }\n },\n focus: function() {\n if(settings.showOnFocus && !activated && module.is.hidden() && !pageLostFocus) {\n module.show();\n }\n },\n blur: function(event) {\n pageLostFocus = (document.activeElement === this);\n if(!activated && !pageLostFocus) {\n module.remove.activeLabel();\n module.hide();\n }\n },\n mousedown: function() {\n if(module.is.searchSelection()) {\n // prevent menu hiding on immediate re-focus\n willRefocus = true;\n }\n else {\n // prevents focus callback from occurring on mousedown\n activated = true;\n }\n },\n mouseup: function() {\n if(module.is.searchSelection()) {\n // prevent menu hiding on immediate re-focus\n willRefocus = false;\n }\n else {\n activated = false;\n }\n },\n click: function(event) {\n var\n $target = $(event.target)\n ;\n // focus search\n if($target.is($module)) {\n if(!module.is.focusedOnSearch()) {\n module.focusSearch();\n }\n else {\n module.show();\n }\n }\n },\n search: {\n focus: function() {\n activated = true;\n if(module.is.multiple()) {\n module.remove.activeLabel();\n }\n if(settings.showOnFocus) {\n module.search();\n }\n },\n blur: function(event) {\n pageLostFocus = (document.activeElement === this);\n if(!willRefocus) {\n if(!itemActivated && !pageLostFocus) {\n if(settings.forceSelection) {\n module.forceSelection();\n }\n module.hide();\n }\n }\n willRefocus = false;\n }\n },\n icon: {\n click: function(event) {\n module.toggle();\n }\n },\n text: {\n focus: function(event) {\n activated = true;\n module.focusSearch();\n }\n },\n input: function(event) {\n if(module.is.multiple() || module.is.searchSelection()) {\n module.set.filtered();\n }\n clearTimeout(module.timer);\n module.timer = setTimeout(module.search, settings.delay.search);\n },\n label: {\n click: function(event) {\n var\n $label = $(this),\n $labels = $module.find(selector.label),\n $activeLabels = $labels.filter('.' + className.active),\n $nextActive = $label.nextAll('.' + className.active),\n $prevActive = $label.prevAll('.' + className.active),\n $range = ($nextActive.length > 0)\n ? $label.nextUntil($nextActive).add($activeLabels).add($label)\n : $label.prevUntil($prevActive).add($activeLabels).add($label)\n ;\n if(event.shiftKey) {\n $activeLabels.removeClass(className.active);\n $range.addClass(className.active);\n }\n else if(event.ctrlKey) {\n $label.toggleClass(className.active);\n }\n else {\n $activeLabels.removeClass(className.active);\n $label.addClass(className.active);\n }\n settings.onLabelSelect.apply(this, $labels.filter('.' + className.active));\n }\n },\n remove: {\n click: function() {\n var\n $label = $(this).parent()\n ;\n if( $label.hasClass(className.active) ) {\n // remove all selected labels\n module.remove.activeLabels();\n }\n else {\n // remove this label only\n module.remove.activeLabels( $label );\n }\n }\n },\n test: {\n toggle: function(event) {\n var\n toggleBehavior = (module.is.multiple())\n ? module.show\n : module.toggle\n ;\n if(module.is.bubbledLabelClick(event) || module.is.bubbledIconClick(event)) {\n return;\n }\n if( module.determine.eventOnElement(event, toggleBehavior) ) {\n event.preventDefault();\n }\n },\n touch: function(event) {\n module.determine.eventOnElement(event, function() {\n if(event.type == 'touchstart') {\n module.timer = setTimeout(function() {\n module.hide();\n }, settings.delay.touch);\n }\n else if(event.type == 'touchmove') {\n clearTimeout(module.timer);\n }\n });\n event.stopPropagation();\n },\n hide: function(event) {\n module.determine.eventInModule(event, module.hide);\n }\n },\n select: {\n mutation: function(mutations) {\n module.debug('<select> modified, recreating menu');\n module.setup.select();\n }\n },\n menu: {\n mutation: function(mutations) {\n var\n mutation = mutations[0],\n $addedNode = mutation.addedNodes\n ? $(mutation.addedNodes[0])\n : $(false),\n $removedNode = mutation.removedNodes\n ? $(mutation.removedNodes[0])\n : $(false),\n $changedNodes = $addedNode.add($removedNode),\n isUserAddition = $changedNodes.is(selector.addition) || $changedNodes.closest(selector.addition).length > 0,\n isMessage = $changedNodes.is(selector.message) || $changedNodes.closest(selector.message).length > 0\n ;\n if(isUserAddition || isMessage) {\n module.debug('Updating item selector cache');\n module.refreshItems();\n }\n else {\n module.debug('Menu modified, updating selector cache');\n module.refresh();\n }\n },\n mousedown: function() {\n itemActivated = true;\n },\n mouseup: function() {\n itemActivated = false;\n }\n },\n item: {\n mouseenter: function(event) {\n var\n $target = $(event.target),\n $item = $(this),\n $subMenu = $item.children(selector.menu),\n $otherMenus = $item.siblings(selector.item).children(selector.menu),\n hasSubMenu = ($subMenu.length > 0),\n isBubbledEvent = ($subMenu.find($target).length > 0)\n ;\n if( !isBubbledEvent && hasSubMenu ) {\n clearTimeout(module.itemTimer);\n module.itemTimer = setTimeout(function() {\n module.verbose('Showing sub-menu', $subMenu);\n $.each($otherMenus, function() {\n module.animate.hide(false, $(this));\n });\n module.animate.show(false, $subMenu);\n }, settings.delay.show);\n event.preventDefault();\n }\n },\n mouseleave: function(event) {\n var\n $subMenu = $(this).children(selector.menu)\n ;\n if($subMenu.length > 0) {\n clearTimeout(module.itemTimer);\n module.itemTimer = setTimeout(function() {\n module.verbose('Hiding sub-menu', $subMenu);\n module.animate.hide(false, $subMenu);\n }, settings.delay.hide);\n }\n },\n click: function (event, skipRefocus) {\n var\n $choice = $(this),\n $target = (event)\n ? $(event.target)\n : $(''),\n $subMenu = $choice.find(selector.menu),\n text = module.get.choiceText($choice),\n value = module.get.choiceValue($choice, text),\n hasSubMenu = ($subMenu.length > 0),\n isBubbledEvent = ($subMenu.find($target).length > 0)\n ;\n if(!isBubbledEvent && (!hasSubMenu || settings.allowCategorySelection)) {\n if(module.is.searchSelection()) {\n if(settings.allowAdditions) {\n module.remove.userAddition();\n }\n module.remove.searchTerm();\n if(!module.is.focusedOnSearch() && !(skipRefocus == true)) {\n module.focusSearch(true);\n }\n }\n if(!settings.useLabels) {\n module.remove.filteredItem();\n module.set.scrollPosition($choice);\n }\n module.determine.selectAction.call(this, text, value);\n }\n }\n },\n\n document: {\n // label selection should occur even when element has no focus\n keydown: function(event) {\n var\n pressedKey = event.which,\n isShortcutKey = module.is.inObject(pressedKey, keys)\n ;\n if(isShortcutKey) {\n var\n $label = $module.find(selector.label),\n $activeLabel = $label.filter('.' + className.active),\n activeValue = $activeLabel.data(metadata.value),\n labelIndex = $label.index($activeLabel),\n labelCount = $label.length,\n hasActiveLabel = ($activeLabel.length > 0),\n hasMultipleActive = ($activeLabel.length > 1),\n isFirstLabel = (labelIndex === 0),\n isLastLabel = (labelIndex + 1 == labelCount),\n isSearch = module.is.searchSelection(),\n isFocusedOnSearch = module.is.focusedOnSearch(),\n isFocused = module.is.focused(),\n caretAtStart = (isFocusedOnSearch && module.get.caretPosition() === 0),\n $nextLabel\n ;\n if(isSearch && !hasActiveLabel && !isFocusedOnSearch) {\n return;\n }\n\n if(pressedKey == keys.leftArrow) {\n // activate previous label\n if((isFocused || caretAtStart) && !hasActiveLabel) {\n module.verbose('Selecting previous label');\n $label.last().addClass(className.active);\n }\n else if(hasActiveLabel) {\n if(!event.shiftKey) {\n module.verbose('Selecting previous label');\n $label.removeClass(className.active);\n }\n else {\n module.verbose('Adding previous label to selection');\n }\n if(isFirstLabel && !hasMultipleActive) {\n $activeLabel.addClass(className.active);\n }\n else {\n $activeLabel.prev(selector.siblingLabel)\n .addClass(className.active)\n .end()\n ;\n }\n event.preventDefault();\n }\n }\n else if(pressedKey == keys.rightArrow) {\n // activate first label\n if(isFocused && !hasActiveLabel) {\n $label.first().addClass(className.active);\n }\n // activate next label\n if(hasActiveLabel) {\n if(!event.shiftKey) {\n module.verbose('Selecting next label');\n $label.removeClass(className.active);\n }\n else {\n module.verbose('Adding next label to selection');\n }\n if(isLastLabel) {\n if(isSearch) {\n if(!isFocusedOnSearch) {\n module.focusSearch();\n }\n else {\n $label.removeClass(className.active);\n }\n }\n else if(hasMultipleActive) {\n $activeLabel.next(selector.siblingLabel).addClass(className.active);\n }\n else {\n $activeLabel.addClass(className.active);\n }\n }\n else {\n $activeLabel.next(selector.siblingLabel).addClass(className.active);\n }\n event.preventDefault();\n }\n }\n else if(pressedKey == keys.deleteKey || pressedKey == keys.backspace) {\n if(hasActiveLabel) {\n module.verbose('Removing active labels');\n if(isLastLabel) {\n if(isSearch && !isFocusedOnSearch) {\n module.focusSearch();\n }\n }\n $activeLabel.last().next(selector.siblingLabel).addClass(className.active);\n module.remove.activeLabels($activeLabel);\n event.preventDefault();\n }\n else if(caretAtStart && !hasActiveLabel && pressedKey == keys.backspace) {\n module.verbose('Removing last label on input backspace');\n $activeLabel = $label.last().addClass(className.active);\n module.remove.activeLabels($activeLabel);\n }\n }\n else {\n $activeLabel.removeClass(className.active);\n }\n }\n }\n },\n\n keydown: function(event) {\n var\n pressedKey = event.which,\n isShortcutKey = module.is.inObject(pressedKey, keys)\n ;\n if(isShortcutKey) {\n var\n $currentlySelected = $item.not(selector.unselectable).filter('.' + className.selected).eq(0),\n $activeItem = $menu.children('.' + className.active).eq(0),\n $selectedItem = ($currentlySelected.length > 0)\n ? $currentlySelected\n : $activeItem,\n $visibleItems = ($selectedItem.length > 0)\n ? $selectedItem.siblings(':not(.' + className.filtered +')').addBack()\n : $menu.children(':not(.' + className.filtered +')'),\n $subMenu = $selectedItem.children(selector.menu),\n $parentMenu = $selectedItem.closest(selector.menu),\n inVisibleMenu = ($parentMenu.hasClass(className.visible) || $parentMenu.hasClass(className.animating) || $parentMenu.parent(selector.menu).length > 0),\n hasSubMenu = ($subMenu.length> 0),\n hasSelectedItem = ($selectedItem.length > 0),\n selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0),\n delimiterPressed = (pressedKey == keys.delimiter && settings.allowAdditions && module.is.multiple()),\n isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed) && selectedIsSelectable),\n $nextItem,\n isSubMenuItem,\n newIndex\n ;\n // allow selection with menu closed\n if(isAdditionWithoutMenu) {\n module.verbose('Selecting item from keyboard shortcut', $selectedItem);\n module.event.item.click.call($selectedItem, event);\n if(module.is.searchSelection()) {\n module.remove.searchTerm();\n }\n }\n\n // visible menu keyboard shortcuts\n if( module.is.visible() ) {\n\n // enter (select or open sub-menu)\n if(pressedKey == keys.enter || delimiterPressed) {\n if(pressedKey == keys.enter && hasSelectedItem && hasSubMenu && !settings.allowCategorySelection) {\n module.verbose('Pressed enter on unselectable category, opening sub menu');\n pressedKey = keys.rightArrow;\n }\n else if(selectedIsSelectable) {\n module.verbose('Selecting item from keyboard shortcut', $selectedItem);\n module.event.item.click.call($selectedItem, event);\n if(module.is.searchSelection()) {\n module.remove.searchTerm();\n }\n }\n event.preventDefault();\n }\n\n // sub-menu actions\n if(hasSelectedItem) {\n\n if(pressedKey == keys.leftArrow) {\n\n isSubMenuItem = ($parentMenu[0] !== $menu[0]);\n\n if(isSubMenuItem) {\n module.verbose('Left key pressed, closing sub-menu');\n module.animate.hide(false, $parentMenu);\n $selectedItem\n .removeClass(className.selected)\n ;\n $parentMenu\n .closest(selector.item)\n .addClass(className.selected)\n ;\n event.preventDefault();\n }\n }\n\n // right arrow (show sub-menu)\n if(pressedKey == keys.rightArrow) {\n if(hasSubMenu) {\n module.verbose('Right key pressed, opening sub-menu');\n module.animate.show(false, $subMenu);\n $selectedItem\n .removeClass(className.selected)\n ;\n $subMenu\n .find(selector.item).eq(0)\n .addClass(className.selected)\n ;\n event.preventDefault();\n }\n }\n }\n\n // up arrow (traverse menu up)\n if(pressedKey == keys.upArrow) {\n $nextItem = (hasSelectedItem && inVisibleMenu)\n ? $selectedItem.prevAll(selector.item + ':not(' + selector.unselectable + ')').eq(0)\n : $item.eq(0)\n ;\n if($visibleItems.index( $nextItem ) < 0) {\n module.verbose('Up key pressed but reached top of current menu');\n event.preventDefault();\n return;\n }\n else {\n module.verbose('Up key pressed, changing active item');\n $selectedItem\n .removeClass(className.selected)\n ;\n $nextItem\n .addClass(className.selected)\n ;\n module.set.scrollPosition($nextItem);\n if(settings.selectOnKeydown && module.is.single()) {\n module.set.selectedItem($nextItem);\n }\n }\n event.preventDefault();\n }\n\n // down arrow (traverse menu down)\n if(pressedKey == keys.downArrow) {\n $nextItem = (hasSelectedItem && inVisibleMenu)\n ? $nextItem = $selectedItem.nextAll(selector.item + ':not(' + selector.unselectable + ')').eq(0)\n : $item.eq(0)\n ;\n if($nextItem.length === 0) {\n module.verbose('Down key pressed but reached bottom of current menu');\n event.preventDefault();\n return;\n }\n else {\n module.verbose('Down key pressed, changing active item');\n $item\n .removeClass(className.selected)\n ;\n $nextItem\n .addClass(className.selected)\n ;\n module.set.scrollPosition($nextItem);\n if(settings.selectOnKeydown && module.is.single()) {\n module.set.selectedItem($nextItem);\n }\n }\n event.preventDefault();\n }\n\n // page down (show next page)\n if(pressedKey == keys.pageUp) {\n module.scrollPage('up');\n event.preventDefault();\n }\n if(pressedKey == keys.pageDown) {\n module.scrollPage('down');\n event.preventDefault();\n }\n\n // escape (close menu)\n if(pressedKey == keys.escape) {\n module.verbose('Escape key pressed, closing dropdown');\n module.hide();\n }\n\n }\n else {\n // delimiter key\n if(delimiterPressed) {\n event.preventDefault();\n }\n // down arrow (open menu)\n if(pressedKey == keys.downArrow && !module.is.visible()) {\n module.verbose('Down key pressed, showing dropdown');\n module.select.firstUnfiltered();\n module.show();\n event.preventDefault();\n }\n }\n }\n else {\n if( !module.has.search() ) {\n module.set.selectedLetter( String.fromCharCode(pressedKey) );\n }\n }\n }\n },\n\n trigger: {\n change: function() {\n var\n events = document.createEvent('HTMLEvents'),\n inputElement = $input[0]\n ;\n if(inputElement) {\n module.verbose('Triggering native change event');\n events.initEvent('change', true, false);\n inputElement.dispatchEvent(events);\n }\n }\n },\n\n determine: {\n selectAction: function(text, value) {\n module.verbose('Determining action', settings.action);\n if( $.isFunction( module.action[settings.action] ) ) {\n module.verbose('Triggering preset action', settings.action, text, value);\n module.action[ settings.action ].call(element, text, value, this);\n }\n else if( $.isFunction(settings.action) ) {\n module.verbose('Triggering user action', settings.action, text, value);\n settings.action.call(element, text, value, this);\n }\n else {\n module.error(error.action, settings.action);\n }\n },\n eventInModule: function(event, callback) {\n var\n $target = $(event.target),\n inDocument = ($target.closest(document.documentElement).length > 0),\n inModule = ($target.closest($module).length > 0)\n ;\n callback = $.isFunction(callback)\n ? callback\n : function(){}\n ;\n if(inDocument && !inModule) {\n module.verbose('Triggering event', callback);\n callback();\n return true;\n }\n else {\n module.verbose('Event occurred in dropdown, canceling callback');\n return false;\n }\n },\n eventOnElement: function(event, callback) {\n var\n $target = $(event.target),\n $label = $target.closest(selector.siblingLabel),\n inVisibleDOM = document.body.contains(event.target),\n notOnLabel = ($module.find($label).length === 0),\n notInMenu = ($target.closest($menu).length === 0)\n ;\n callback = $.isFunction(callback)\n ? callback\n : function(){}\n ;\n if(inVisibleDOM && notOnLabel && notInMenu) {\n module.verbose('Triggering event', callback);\n callback();\n return true;\n }\n else {\n module.verbose('Event occurred in dropdown menu, canceling callback');\n return false;\n }\n }\n },\n\n action: {\n\n nothing: function() {},\n\n activate: function(text, value, element) {\n value = (value !== undefined)\n ? value\n : text\n ;\n if( module.can.activate( $(element) ) ) {\n module.set.selected(value, $(element));\n if(module.is.multiple() && !module.is.allFiltered()) {\n return;\n }\n else {\n module.hideAndClear();\n }\n }\n },\n\n select: function(text, value, element) {\n value = (value !== undefined)\n ? value\n : text\n ;\n if( module.can.activate( $(element) ) ) {\n module.set.value(value, $(element));\n if(module.is.multiple() && !module.is.allFiltered()) {\n return;\n }\n else {\n module.hideAndClear();\n }\n }\n },\n\n combo: function(text, value, element) {\n value = (value !== undefined)\n ? value\n : text\n ;\n module.set.selected(value, $(element));\n module.hideAndClear();\n },\n\n hide: function(text, value, element) {\n module.set.value(value, text);\n module.hideAndClear();\n }\n\n },\n\n get: {\n id: function() {\n return id;\n },\n defaultText: function() {\n return $module.data(metadata.defaultText);\n },\n defaultValue: function() {\n return $module.data(metadata.defaultValue);\n },\n placeholderText: function() {\n return $module.data(metadata.placeholderText) || '';\n },\n text: function() {\n return $text.text();\n },\n query: function() {\n return $.trim($search.val());\n },\n searchWidth: function(value) {\n value = (value !== undefined)\n ? value\n : $search.val()\n ;\n $sizer.text(value);\n // prevent rounding issues\n return Math.ceil( $sizer.width() + 1);\n },\n selectionCount: function() {\n var\n values = module.get.values(),\n count\n ;\n count = ( module.is.multiple() )\n ? $.isArray(values)\n ? values.length\n : 0\n : (module.get.value() !== '')\n ? 1\n : 0\n ;\n return count;\n },\n transition: function($subMenu) {\n return (settings.transition == 'auto')\n ? module.is.upward($subMenu)\n ? 'slide up'\n : 'slide down'\n : settings.transition\n ;\n },\n userValues: function() {\n var\n values = module.get.values()\n ;\n if(!values) {\n return false;\n }\n values = $.isArray(values)\n ? values\n : [values]\n ;\n return $.grep(values, function(value) {\n return (module.get.item(value) === false);\n });\n },\n uniqueArray: function(array) {\n return $.grep(array, function (value, index) {\n return $.inArray(value, array) === index;\n });\n },\n caretPosition: function() {\n var\n input = $search.get(0),\n range,\n rangeLength\n ;\n if('selectionStart' in input) {\n return input.selectionStart;\n }\n else if (document.selection) {\n input.focus();\n range = document.selection.createRange();\n rangeLength = range.text.length;\n range.moveStart('character', -input.value.length);\n return range.text.length - rangeLength;\n }\n },\n value: function() {\n var\n value = ($input.length > 0)\n ? $input.val()\n : $module.data(metadata.value),\n isEmptyMultiselect = ($.isArray(value) && value.length === 1 && value[0] === '')\n ;\n // prevents placeholder element from being selected when multiple\n return (value === undefined || isEmptyMultiselect)\n ? ''\n : value\n ;\n },\n values: function() {\n var\n value = module.get.value()\n ;\n if(value === '') {\n return '';\n }\n return ( !module.has.selectInput() && module.is.multiple() )\n ? (typeof value == 'string') // delimited string\n ? value.split(settings.delimiter)\n : ''\n : value\n ;\n },\n remoteValues: function() {\n var\n values = module.get.values(),\n remoteValues = false\n ;\n if(values) {\n if(typeof values == 'string') {\n values = [values];\n }\n $.each(values, function(index, value) {\n var\n name = module.read.remoteData(value)\n ;\n module.verbose('Restoring value from session data', name, value);\n if(name) {\n if(!remoteValues) {\n remoteValues = {};\n }\n remoteValues[value] = name;\n }\n });\n }\n return remoteValues;\n },\n choiceText: function($choice, preserveHTML) {\n preserveHTML = (preserveHTML !== undefined)\n ? preserveHTML\n : settings.preserveHTML\n ;\n if($choice) {\n if($choice.find(selector.menu).length > 0) {\n module.verbose('Retrieving text of element with sub-menu');\n $choice = $choice.clone();\n $choice.find(selector.menu).remove();\n $choice.find(selector.menuIcon).remove();\n }\n return ($choice.data(metadata.text) !== undefined)\n ? $choice.data(metadata.text)\n : (preserveHTML)\n ? $.trim($choice.html())\n : $.trim($choice.text())\n ;\n }\n },\n choiceValue: function($choice, choiceText) {\n choiceText = choiceText || module.get.choiceText($choice);\n if(!$choice) {\n return false;\n }\n return ($choice.data(metadata.value) !== undefined)\n ? String( $choice.data(metadata.value) )\n : (typeof choiceText === 'string')\n ? $.trim(choiceText.toLowerCase())\n : String(choiceText)\n ;\n },\n inputEvent: function() {\n var\n input = $search[0]\n ;\n if(input) {\n return (input.oninput !== undefined)\n ? 'input'\n : (input.onpropertychange !== undefined)\n ? 'propertychange'\n : 'keyup'\n ;\n }\n return false;\n },\n selectValues: function() {\n var\n select = {}\n ;\n select.values = [];\n $module\n .find('option')\n .each(function() {\n var\n $option = $(this),\n name = $option.html(),\n disabled = $option.attr('disabled'),\n value = ( $option.attr('value') !== undefined )\n ? $option.attr('value')\n : name\n ;\n if(settings.placeholder === 'auto' && value === '') {\n select.placeholder = name;\n }\n else {\n select.values.push({\n name : name,\n value : value,\n disabled : disabled\n });\n }\n })\n ;\n if(settings.placeholder && settings.placeholder !== 'auto') {\n module.debug('Setting placeholder value to', settings.placeholder);\n select.placeholder = settings.placeholder;\n }\n if(settings.sortSelect) {\n select.values.sort(function(a, b) {\n return (a.name > b.name)\n ? 1\n : -1\n ;\n });\n module.debug('Retrieved and sorted values from select', select);\n }\n else {\n module.debug('Retrieved values from select', select);\n }\n return select;\n },\n activeItem: function() {\n return $item.filter('.' + className.active);\n },\n selectedItem: function() {\n var\n $selectedItem = $item.not(selector.unselectable).filter('.' + className.selected)\n ;\n return ($selectedItem.length > 0)\n ? $selectedItem\n : $item.eq(0)\n ;\n },\n itemWithAdditions: function(value) {\n var\n $items = module.get.item(value),\n $userItems = module.create.userChoice(value),\n hasUserItems = ($userItems && $userItems.length > 0)\n ;\n if(hasUserItems) {\n $items = ($items.length > 0)\n ? $items.add($userItems)\n : $userItems\n ;\n }\n return $items;\n },\n item: function(value, strict) {\n var\n $selectedItem = false,\n shouldSearch,\n isMultiple\n ;\n value = (value !== undefined)\n ? value\n : ( module.get.values() !== undefined)\n ? module.get.values()\n : module.get.text()\n ;\n shouldSearch = (isMultiple)\n ? (value.length > 0)\n : (value !== undefined && value !== null)\n ;\n isMultiple = (module.is.multiple() && $.isArray(value));\n strict = (value === '' || value === 0)\n ? true\n : strict || false\n ;\n if(shouldSearch) {\n $item\n .each(function() {\n var\n $choice = $(this),\n optionText = module.get.choiceText($choice),\n optionValue = module.get.choiceValue($choice, optionText)\n ;\n // safe early exit\n if(optionValue === null || optionValue === undefined) {\n return;\n }\n if(isMultiple) {\n if($.inArray( String(optionValue), value) !== -1 || $.inArray(optionText, value) !== -1) {\n $selectedItem = ($selectedItem)\n ? $selectedItem.add($choice)\n : $choice\n ;\n }\n }\n else if(strict) {\n module.verbose('Ambiguous dropdown value using strict type check', $choice, value);\n if( optionValue === value || optionText === value) {\n $selectedItem = $choice;\n return true;\n }\n }\n else {\n if( String(optionValue) == String(value) || optionText == value) {\n module.verbose('Found select item by value', optionValue, value);\n $selectedItem = $choice;\n return true;\n }\n }\n })\n ;\n }\n return $selectedItem;\n }\n },\n\n check: {\n maxSelections: function(selectionCount) {\n if(settings.maxSelections) {\n selectionCount = (selectionCount !== undefined)\n ? selectionCount\n : module.get.selectionCount()\n ;\n if(selectionCount >= settings.maxSelections) {\n module.debug('Maximum selection count reached');\n if(settings.useLabels) {\n $item.addClass(className.filtered);\n module.add.message(message.maxSelections);\n }\n return true;\n }\n else {\n module.verbose('No longer at maximum selection count');\n module.remove.message();\n module.remove.filteredItem();\n if(module.is.searchSelection()) {\n module.filterItems();\n }\n return false;\n }\n }\n return true;\n }\n },\n\n restore: {\n defaults: function() {\n module.clear();\n module.restore.defaultText();\n module.restore.defaultValue();\n },\n defaultText: function() {\n var\n defaultText = module.get.defaultText(),\n placeholderText = module.get.placeholderText\n ;\n if(defaultText === placeholderText) {\n module.debug('Restoring default placeholder text', defaultText);\n module.set.placeholderText(defaultText);\n }\n else {\n module.debug('Restoring default text', defaultText);\n module.set.text(defaultText);\n }\n },\n placeholderText: function() {\n module.set.placeholderText();\n },\n defaultValue: function() {\n var\n defaultValue = module.get.defaultValue()\n ;\n if(defaultValue !== undefined) {\n module.debug('Restoring default value', defaultValue);\n if(defaultValue !== '') {\n module.set.value(defaultValue);\n module.set.selected();\n }\n else {\n module.remove.activeItem();\n module.remove.selectedItem();\n }\n }\n },\n labels: function() {\n if(settings.allowAdditions) {\n if(!settings.useLabels) {\n module.error(error.labels);\n settings.useLabels = true;\n }\n module.debug('Restoring selected values');\n module.create.userLabels();\n }\n module.check.maxSelections();\n },\n selected: function() {\n module.restore.values();\n if(module.is.multiple()) {\n module.debug('Restoring previously selected values and labels');\n module.restore.labels();\n }\n else {\n module.debug('Restoring previously selected values');\n }\n },\n values: function() {\n // prevents callbacks from occurring on initial load\n module.set.initialLoad();\n if(settings.apiSettings && settings.saveRemoteData && module.get.remoteValues()) {\n module.restore.remoteValues();\n }\n else {\n module.set.selected();\n }\n module.remove.initialLoad();\n },\n remoteValues: function() {\n var\n values = module.get.remoteValues()\n ;\n module.debug('Recreating selected from session data', values);\n if(values) {\n if( module.is.single() ) {\n $.each(values, function(value, name) {\n module.set.text(name);\n });\n }\n else {\n $.each(values, function(value, name) {\n module.add.label(value, name);\n });\n }\n }\n }\n },\n\n read: {\n remoteData: function(value) {\n var\n name\n ;\n if(window.Storage === undefined) {\n module.error(error.noStorage);\n return;\n }\n name = sessionStorage.getItem(value);\n return (name !== undefined)\n ? name\n : false\n ;\n }\n },\n\n save: {\n defaults: function() {\n module.save.defaultText();\n module.save.placeholderText();\n module.save.defaultValue();\n },\n defaultValue: function() {\n var\n value = module.get.value()\n ;\n module.verbose('Saving default value as', value);\n $module.data(metadata.defaultValue, value);\n },\n defaultText: function() {\n var\n text = module.get.text()\n ;\n module.verbose('Saving default text as', text);\n $module.data(metadata.defaultText, text);\n },\n placeholderText: function() {\n var\n text\n ;\n if(settings.placeholder !== false && $text.hasClass(className.placeholder)) {\n text = module.get.text();\n module.verbose('Saving placeholder text as', text);\n $module.data(metadata.placeholderText, text);\n }\n },\n remoteData: function(name, value) {\n if(window.Storage === undefined) {\n module.error(error.noStorage);\n return;\n }\n module.verbose('Saving remote data to session storage', value, name);\n sessionStorage.setItem(value, name);\n }\n },\n\n clear: function() {\n if(module.is.multiple() && settings.useLabels) {\n module.remove.labels();\n }\n else {\n module.remove.activeItem();\n module.remove.selectedItem();\n }\n module.set.placeholderText();\n module.clearValue();\n },\n\n clearValue: function() {\n module.set.value('');\n },\n\n scrollPage: function(direction, $selectedItem) {\n var\n $currentItem = $selectedItem || module.get.selectedItem(),\n $menu = $currentItem.closest(selector.menu),\n menuHeight = $menu.outerHeight(),\n currentScroll = $menu.scrollTop(),\n itemHeight = $item.eq(0).outerHeight(),\n itemsPerPage = Math.floor(menuHeight / itemHeight),\n maxScroll = $menu.prop('scrollHeight'),\n newScroll = (direction == 'up')\n ? currentScroll - (itemHeight * itemsPerPage)\n : currentScroll + (itemHeight * itemsPerPage),\n $selectableItem = $item.not(selector.unselectable),\n isWithinRange,\n $nextSelectedItem,\n elementIndex\n ;\n elementIndex = (direction == 'up')\n ? $selectableItem.index($currentItem) - itemsPerPage\n : $selectableItem.index($currentItem) + itemsPerPage\n ;\n isWithinRange = (direction == 'up')\n ? (elementIndex >= 0)\n : (elementIndex < $selectableItem.length)\n ;\n $nextSelectedItem = (isWithinRange)\n ? $selectableItem.eq(elementIndex)\n : (direction == 'up')\n ? $selectableItem.first()\n : $selectableItem.last()\n ;\n if($nextSelectedItem.length > 0) {\n module.debug('Scrolling page', direction, $nextSelectedItem);\n $currentItem\n .removeClass(className.selected)\n ;\n $nextSelectedItem\n .addClass(className.selected)\n ;\n if(settings.selectOnKeydown && module.is.single()) {\n module.set.selectedItem($nextSelectedItem);\n }\n $menu\n .scrollTop(newScroll)\n ;\n }\n },\n\n set: {\n filtered: function() {\n var\n isMultiple = module.is.multiple(),\n isSearch = module.is.searchSelection(),\n isSearchMultiple = (isMultiple && isSearch),\n searchValue = (isSearch)\n ? module.get.query()\n : '',\n hasSearchValue = (typeof searchValue === 'string' && searchValue.length > 0),\n searchWidth = module.get.searchWidth(),\n valueIsSet = searchValue !== ''\n ;\n if(isMultiple && hasSearchValue) {\n module.verbose('Adjusting input width', searchWidth, settings.glyphWidth);\n $search.css('width', searchWidth);\n }\n if(hasSearchValue || (isSearchMultiple && valueIsSet)) {\n module.verbose('Hiding placeholder text');\n $text.addClass(className.filtered);\n }\n else if(!isMultiple || (isSearchMultiple && !valueIsSet)) {\n module.verbose('Showing placeholder text');\n $text.removeClass(className.filtered);\n }\n },\n empty: function() {\n $module.addClass(className.empty);\n },\n loading: function() {\n $module.addClass(className.loading);\n },\n placeholderText: function(text) {\n text = text || module.get.placeholderText();\n module.debug('Setting placeholder text', text);\n module.set.text(text);\n $text.addClass(className.placeholder);\n },\n tabbable: function() {\n if( module.has.search() ) {\n module.debug('Added tabindex to searchable dropdown');\n $search\n .val('')\n .attr('tabindex', 0)\n ;\n $menu\n .attr('tabindex', -1)\n ;\n }\n else {\n module.debug('Added tabindex to dropdown');\n if( $module.attr('tabindex') === undefined) {\n $module\n .attr('tabindex', 0)\n ;\n $menu\n .attr('tabindex', -1)\n ;\n }\n }\n },\n initialLoad: function() {\n module.verbose('Setting initial load');\n initialLoad = true;\n },\n activeItem: function($item) {\n if( settings.allowAdditions && $item.filter(selector.addition).length > 0 ) {\n $item.addClass(className.filtered);\n }\n else {\n $item.addClass(className.active);\n }\n },\n partialSearch: function(text) {\n var\n length = module.get.query().length\n ;\n $search.val( text.substr(0 , length));\n },\n scrollPosition: function($item, forceScroll) {\n var\n edgeTolerance = 5,\n $menu,\n hasActive,\n offset,\n itemHeight,\n itemOffset,\n menuOffset,\n menuScroll,\n menuHeight,\n abovePage,\n belowPage\n ;\n\n $item = $item || module.get.selectedItem();\n $menu = $item.closest(selector.menu);\n hasActive = ($item && $item.length > 0);\n forceScroll = (forceScroll !== undefined)\n ? forceScroll\n : false\n ;\n if($item && $menu.length > 0 && hasActive) {\n itemOffset = $item.position().top;\n\n $menu.addClass(className.loading);\n menuScroll = $menu.scrollTop();\n menuOffset = $menu.offset().top;\n itemOffset = $item.offset().top;\n offset = menuScroll - menuOffset + itemOffset;\n if(!forceScroll) {\n menuHeight = $menu.height();\n belowPage = menuScroll + menuHeight < (offset + edgeTolerance);\n abovePage = ((offset - edgeTolerance) < menuScroll);\n }\n module.debug('Scrolling to active item', offset);\n if(forceScroll || abovePage || belowPage) {\n $menu.scrollTop(offset);\n }\n $menu.removeClass(className.loading);\n }\n },\n text: function(text) {\n if(settings.action !== 'select') {\n if(settings.action == 'combo') {\n module.debug('Changing combo button text', text, $combo);\n if(settings.preserveHTML) {\n $combo.html(text);\n }\n else {\n $combo.text(text);\n }\n }\n else {\n if(text !== module.get.placeholderText()) {\n $text.removeClass(className.placeholder);\n }\n module.debug('Changing text', text, $text);\n $text\n .removeClass(className.filtered)\n ;\n if(settings.preserveHTML) {\n $text.html(text);\n }\n else {\n $text.text(text);\n }\n }\n }\n },\n selectedItem: function($item) {\n var\n value = module.get.choiceValue($item),\n text = module.get.choiceText($item, false)\n ;\n module.debug('Setting user selection to item', $item);\n module.remove.activeItem();\n module.set.partialSearch(text);\n module.set.activeItem($item);\n module.set.selected(value, $item);\n module.set.text(text);\n },\n selectedLetter: function(letter) {\n var\n $selectedItem = $item.filter('.' + className.selected),\n alreadySelectedLetter = $selectedItem.length > 0 && module.has.firstLetter($selectedItem, letter),\n $nextValue = false,\n $nextItem\n ;\n // check next of same letter\n if(alreadySelectedLetter) {\n $nextItem = $selectedItem.nextAll($item).eq(0);\n if( module.has.firstLetter($nextItem, letter) ) {\n $nextValue = $nextItem;\n }\n }\n // check all values\n if(!$nextValue) {\n $item\n .each(function(){\n if(module.has.firstLetter($(this), letter)) {\n $nextValue = $(this);\n return false;\n }\n })\n ;\n }\n // set next value\n if($nextValue) {\n module.verbose('Scrolling to next value with letter', letter);\n module.set.scrollPosition($nextValue);\n $selectedItem.removeClass(className.selected);\n $nextValue.addClass(className.selected);\n if(settings.selectOnKeydown && module.is.single()) {\n module.set.selectedItem($nextValue);\n }\n }\n },\n direction: function($menu) {\n if(settings.direction == 'auto') {\n if(module.is.onScreen($menu)) {\n module.remove.upward($menu);\n }\n else {\n module.set.upward($menu);\n }\n }\n else if(settings.direction == 'upward') {\n module.set.upward($menu);\n }\n },\n upward: function($menu) {\n var $element = $menu || $module;\n $element.addClass(className.upward);\n },\n value: function(value, text, $selected) {\n var\n escapedValue = module.escape.value(value),\n hasInput = ($input.length > 0),\n isAddition = !module.has.value(value),\n currentValue = module.get.values(),\n stringValue = (value !== undefined)\n ? String(value)\n : value,\n newValue\n ;\n if(hasInput) {\n if(!settings.allowReselection && stringValue == currentValue) {\n module.verbose('Skipping value update already same value', value, currentValue);\n if(!module.is.initialLoad()) {\n return;\n }\n }\n\n if( module.is.single() && module.has.selectInput() && module.can.extendSelect() ) {\n module.debug('Adding user option', value);\n module.add.optionValue(value);\n }\n module.debug('Updating input value', escapedValue, currentValue);\n internalChange = true;\n $input\n .val(escapedValue)\n ;\n if(settings.fireOnInit === false && module.is.initialLoad()) {\n module.debug('Input native change event ignored on initial load');\n }\n else {\n module.trigger.change();\n }\n internalChange = false;\n }\n else {\n module.verbose('Storing value in metadata', escapedValue, $input);\n if(escapedValue !== currentValue) {\n $module.data(metadata.value, stringValue);\n }\n }\n if(settings.fireOnInit === false && module.is.initialLoad()) {\n module.verbose('No callback on initial load', settings.onChange);\n }\n else {\n settings.onChange.call(element, value, text, $selected);\n }\n },\n active: function() {\n $module\n .addClass(className.active)\n ;\n },\n multiple: function() {\n $module.addClass(className.multiple);\n },\n visible: function() {\n $module.addClass(className.visible);\n },\n exactly: function(value, $selectedItem) {\n module.debug('Setting selected to exact values');\n module.clear();\n module.set.selected(value, $selectedItem);\n },\n selected: function(value, $selectedItem) {\n var\n isMultiple = module.is.multiple(),\n $userSelectedItem\n ;\n $selectedItem = (settings.allowAdditions)\n ? $selectedItem || module.get.itemWithAdditions(value)\n : $selectedItem || module.get.item(value)\n ;\n if(!$selectedItem) {\n return;\n }\n module.debug('Setting selected menu item to', $selectedItem);\n if(module.is.multiple()) {\n module.remove.searchWidth();\n }\n if(module.is.single()) {\n module.remove.activeItem();\n module.remove.selectedItem();\n }\n else if(settings.useLabels) {\n module.remove.selectedItem();\n }\n // select each item\n $selectedItem\n .each(function() {\n var\n $selected = $(this),\n selectedText = module.get.choiceText($selected),\n selectedValue = module.get.choiceValue($selected, selectedText),\n\n isFiltered = $selected.hasClass(className.filtered),\n isActive = $selected.hasClass(className.active),\n isUserValue = $selected.hasClass(className.addition),\n shouldAnimate = (isMultiple && $selectedItem.length == 1)\n ;\n if(isMultiple) {\n if(!isActive || isUserValue) {\n if(settings.apiSettings && settings.saveRemoteData) {\n module.save.remoteData(selectedText, selectedValue);\n }\n if(settings.useLabels) {\n module.add.value(selectedValue, selectedText, $selected);\n module.add.label(selectedValue, selectedText, shouldAnimate);\n module.set.activeItem($selected);\n module.filterActive();\n module.select.nextAvailable($selectedItem);\n }\n else {\n module.add.value(selectedValue, selectedText, $selected);\n module.set.text(module.add.variables(message.count));\n module.set.activeItem($selected);\n }\n }\n else if(!isFiltered) {\n module.debug('Selected active value, removing label');\n module.remove.selected(selectedValue);\n }\n }\n else {\n if(settings.apiSettings && settings.saveRemoteData) {\n module.save.remoteData(selectedText, selectedValue);\n }\n module.set.text(selectedText);\n module.set.value(selectedValue, selectedText, $selected);\n $selected\n .addClass(className.active)\n .addClass(className.selected)\n ;\n }\n })\n ;\n }\n },\n\n add: {\n label: function(value, text, shouldAnimate) {\n var\n $next = module.is.searchSelection()\n ? $search\n : $text,\n escapedValue = module.escape.value(value),\n $label\n ;\n $label = $('<a />')\n .addClass(className.label)\n .attr('data-value', escapedValue)\n .html(templates.label(escapedValue, text))\n ;\n $label = settings.onLabelCreate.call($label, escapedValue, text);\n\n if(module.has.label(value)) {\n module.debug('Label already exists, skipping', escapedValue);\n return;\n }\n if(settings.label.variation) {\n $label.addClass(settings.label.variation);\n }\n if(shouldAnimate === true) {\n module.debug('Animating in label', $label);\n $label\n .addClass(className.hidden)\n .insertBefore($next)\n .transition(settings.label.transition, settings.label.duration)\n ;\n }\n else {\n module.debug('Adding selection label', $label);\n $label\n .insertBefore($next)\n ;\n }\n },\n message: function(message) {\n var\n $message = $menu.children(selector.message),\n html = settings.templates.message(module.add.variables(message))\n ;\n if($message.length > 0) {\n $message\n .html(html)\n ;\n }\n else {\n $message = $('<div/>')\n .html(html)\n .addClass(className.message)\n .appendTo($menu)\n ;\n }\n },\n optionValue: function(value) {\n var\n escapedValue = module.escape.value(value),\n $option = $input.find('option[value=\"' + escapedValue + '\"]'),\n hasOption = ($option.length > 0)\n ;\n if(hasOption) {\n return;\n }\n // temporarily disconnect observer\n module.disconnect.selectObserver();\n if( module.is.single() ) {\n module.verbose('Removing previous user addition');\n $input.find('option.' + className.addition).remove();\n }\n $('<option/>')\n .prop('value', escapedValue)\n .addClass(className.addition)\n .html(value)\n .appendTo($input)\n ;\n module.verbose('Adding user addition as an <option>', value);\n module.observe.select();\n },\n userSuggestion: function(value) {\n var\n $addition = $menu.children(selector.addition),\n $existingItem = module.get.item(value),\n alreadyHasValue = $existingItem && $existingItem.not(selector.addition).length,\n hasUserSuggestion = $addition.length > 0,\n html\n ;\n if(settings.useLabels && module.has.maxSelections()) {\n return;\n }\n if(value === '' || alreadyHasValue) {\n $addition.remove();\n return;\n }\n if(hasUserSuggestion) {\n $addition\n .data(metadata.value, value)\n .data(metadata.text, value)\n .attr('data-' + metadata.value, value)\n .attr('data-' + metadata.text, value)\n .removeClass(className.filtered)\n ;\n if(!settings.hideAdditions) {\n html = settings.templates.addition( module.add.variables(message.addResult, value) );\n $addition\n .html(html)\n ;\n }\n module.verbose('Replacing user suggestion with new value', $addition);\n }\n else {\n $addition = module.create.userChoice(value);\n $addition\n .prependTo($menu)\n ;\n module.verbose('Adding item choice to menu corresponding with user choice addition', $addition);\n }\n if(!settings.hideAdditions || module.is.allFiltered()) {\n $addition\n .addClass(className.selected)\n .siblings()\n .removeClass(className.selected)\n ;\n }\n module.refreshItems();\n },\n variables: function(message, term) {\n var\n hasCount = (message.search('{count}') !== -1),\n hasMaxCount = (message.search('{maxCount}') !== -1),\n hasTerm = (message.search('{term}') !== -1),\n values,\n count,\n query\n ;\n module.verbose('Adding templated variables to message', message);\n if(hasCount) {\n count = module.get.selectionCount();\n message = message.replace('{count}', count);\n }\n if(hasMaxCount) {\n count = module.get.selectionCount();\n message = message.replace('{maxCount}', settings.maxSelections);\n }\n if(hasTerm) {\n query = term || module.get.query();\n message = message.replace('{term}', query);\n }\n return message;\n },\n value: function(addedValue, addedText, $selectedItem) {\n var\n currentValue = module.get.values(),\n newValue\n ;\n if(addedValue === '') {\n module.debug('Cannot select blank values from multiselect');\n return;\n }\n // extend current array\n if($.isArray(currentValue)) {\n newValue = currentValue.concat([addedValue]);\n newValue = module.get.uniqueArray(newValue);\n }\n else {\n newValue = [addedValue];\n }\n // add values\n if( module.has.selectInput() ) {\n if(module.can.extendSelect()) {\n module.debug('Adding value to select', addedValue, newValue, $input);\n module.add.optionValue(addedValue);\n }\n }\n else {\n newValue = newValue.join(settings.delimiter);\n module.debug('Setting hidden input to delimited value', newValue, $input);\n }\n\n if(settings.fireOnInit === false && module.is.initialLoad()) {\n module.verbose('Skipping onadd callback on initial load', settings.onAdd);\n }\n else {\n settings.onAdd.call(element, addedValue, addedText, $selectedItem);\n }\n module.set.value(newValue, addedValue, addedText, $selectedItem);\n module.check.maxSelections();\n }\n },\n\n remove: {\n active: function() {\n $module.removeClass(className.active);\n },\n activeLabel: function() {\n $module.find(selector.label).removeClass(className.active);\n },\n empty: function() {\n $module.removeClass(className.empty);\n },\n loading: function() {\n $module.removeClass(className.loading);\n },\n initialLoad: function() {\n initialLoad = false;\n },\n upward: function($menu) {\n var $element = $menu || $module;\n $element.removeClass(className.upward);\n },\n visible: function() {\n $module.removeClass(className.visible);\n },\n activeItem: function() {\n $item.removeClass(className.active);\n },\n filteredItem: function() {\n if(settings.useLabels && module.has.maxSelections() ) {\n return;\n }\n if(settings.useLabels && module.is.multiple()) {\n $item.not('.' + className.active).removeClass(className.filtered);\n }\n else {\n $item.removeClass(className.filtered);\n }\n module.remove.empty();\n },\n optionValue: function(value) {\n var\n escapedValue = module.escape.value(value),\n $option = $input.find('option[value=\"' + escapedValue + '\"]'),\n hasOption = ($option.length > 0)\n ;\n if(!hasOption || !$option.hasClass(className.addition)) {\n return;\n }\n // temporarily disconnect observer\n if(selectObserver) {\n selectObserver.disconnect();\n module.verbose('Temporarily disconnecting mutation observer');\n }\n $option.remove();\n module.verbose('Removing user addition as an <option>', escapedValue);\n if(selectObserver) {\n selectObserver.observe($input[0], {\n childList : true,\n subtree : true\n });\n }\n },\n message: function() {\n $menu.children(selector.message).remove();\n },\n searchWidth: function() {\n $search.css('width', '');\n },\n searchTerm: function() {\n module.verbose('Cleared search term');\n $search.val('');\n module.set.filtered();\n },\n userAddition: function() {\n $item.filter(selector.addition).remove();\n },\n selected: function(value, $selectedItem) {\n $selectedItem = (settings.allowAdditions)\n ? $selectedItem || module.get.itemWithAdditions(value)\n : $selectedItem || module.get.item(value)\n ;\n\n if(!$selectedItem) {\n return false;\n }\n\n $selectedItem\n .each(function() {\n var\n $selected = $(this),\n selectedText = module.get.choiceText($selected),\n selectedValue = module.get.choiceValue($selected, selectedText)\n ;\n if(module.is.multiple()) {\n if(settings.useLabels) {\n module.remove.value(selectedValue, selectedText, $selected);\n module.remove.label(selectedValue);\n }\n else {\n module.remove.value(selectedValue, selectedText, $selected);\n if(module.get.selectionCount() === 0) {\n module.set.placeholderText();\n }\n else {\n module.set.text(module.add.variables(message.count));\n }\n }\n }\n else {\n module.remove.value(selectedValue, selectedText, $selected);\n }\n $selected\n .removeClass(className.filtered)\n .removeClass(className.active)\n ;\n if(settings.useLabels) {\n $selected.removeClass(className.selected);\n }\n })\n ;\n },\n selectedItem: function() {\n $item.removeClass(className.selected);\n },\n value: function(removedValue, removedText, $removedItem) {\n var\n values = module.get.values(),\n newValue\n ;\n if( module.has.selectInput() ) {\n module.verbose('Input is <select> removing selected option', removedValue);\n newValue = module.remove.arrayValue(removedValue, values);\n module.remove.optionValue(removedValue);\n }\n else {\n module.verbose('Removing from delimited values', removedValue);\n newValue = module.remove.arrayValue(removedValue, values);\n newValue = newValue.join(settings.delimiter);\n }\n if(settings.fireOnInit === false && module.is.initialLoad()) {\n module.verbose('No callback on initial load', settings.onRemove);\n }\n else {\n settings.onRemove.call(element, removedValue, removedText, $removedItem);\n }\n module.set.value(newValue, removedText, $removedItem);\n module.check.maxSelections();\n },\n arrayValue: function(removedValue, values) {\n if( !$.isArray(values) ) {\n values = [values];\n }\n values = $.grep(values, function(value){\n return (removedValue != value);\n });\n module.verbose('Removed value from delimited string', removedValue, values);\n return values;\n },\n label: function(value, shouldAnimate) {\n var\n $labels = $module.find(selector.label),\n $removedLabel = $labels.filter('[data-value=\"' + value +'\"]')\n ;\n module.verbose('Removing label', $removedLabel);\n $removedLabel.remove();\n },\n activeLabels: function($activeLabels) {\n $activeLabels = $activeLabels || $module.find(selector.label).filter('.' + className.active);\n module.verbose('Removing active label selections', $activeLabels);\n module.remove.labels($activeLabels);\n },\n labels: function($labels) {\n $labels = $labels || $module.find(selector.label);\n module.verbose('Removing labels', $labels);\n $labels\n .each(function(){\n var\n $label = $(this),\n value = $label.data(metadata.value),\n stringValue = (value !== undefined)\n ? String(value)\n : value,\n isUserValue = module.is.userValue(stringValue)\n ;\n if(settings.onLabelRemove.call($label, value) === false) {\n module.debug('Label remove callback cancelled removal');\n return;\n }\n module.remove.message();\n if(isUserValue) {\n module.remove.value(stringValue);\n module.remove.label(stringValue);\n }\n else {\n // selected will also remove label\n module.remove.selected(stringValue);\n }\n })\n ;\n },\n tabbable: function() {\n if( module.has.search() ) {\n module.debug('Searchable dropdown initialized');\n $search\n .removeAttr('tabindex')\n ;\n $menu\n .removeAttr('tabindex')\n ;\n }\n else {\n module.debug('Simple selection dropdown initialized');\n $module\n .removeAttr('tabindex')\n ;\n $menu\n .removeAttr('tabindex')\n ;\n }\n }\n },\n\n has: {\n menuSearch: function() {\n return (module.has.search() && $search.closest($menu).length > 0);\n },\n search: function() {\n return ($search.length > 0);\n },\n sizer: function() {\n return ($sizer.length > 0);\n },\n selectInput: function() {\n return ( $input.is('select') );\n },\n minCharacters: function(searchTerm) {\n if(settings.minCharacters) {\n searchTerm = (searchTerm !== undefined)\n ? String(searchTerm)\n : String(module.get.query())\n ;\n return (searchTerm.length >= settings.minCharacters);\n }\n return true;\n },\n firstLetter: function($item, letter) {\n var\n text,\n firstLetter\n ;\n if(!$item || $item.length === 0 || typeof letter !== 'string') {\n return false;\n }\n text = module.get.choiceText($item, false);\n letter = letter.toLowerCase();\n firstLetter = String(text).charAt(0).toLowerCase();\n return (letter == firstLetter);\n },\n input: function() {\n return ($input.length > 0);\n },\n items: function() {\n return ($item.length > 0);\n },\n menu: function() {\n return ($menu.length > 0);\n },\n message: function() {\n return ($menu.children(selector.message).length !== 0);\n },\n label: function(value) {\n var\n escapedValue = module.escape.value(value),\n $labels = $module.find(selector.label)\n ;\n return ($labels.filter('[data-value=\"' + escapedValue +'\"]').length > 0);\n },\n maxSelections: function() {\n return (settings.maxSelections && module.get.selectionCount() >= settings.maxSelections);\n },\n allResultsFiltered: function() {\n var\n $normalResults = $item.not(selector.addition)\n ;\n return ($normalResults.filter(selector.unselectable).length === $normalResults.length);\n },\n userSuggestion: function() {\n return ($menu.children(selector.addition).length > 0);\n },\n query: function() {\n return (module.get.query() !== '');\n },\n value: function(value) {\n var\n values = module.get.values(),\n hasValue = $.isArray(values)\n ? values && ($.inArray(value, values) !== -1)\n : (values == value)\n ;\n return (hasValue)\n ? true\n : false\n ;\n }\n },\n\n is: {\n active: function() {\n return $module.hasClass(className.active);\n },\n bubbledLabelClick: function(event) {\n return $(event.target).is('select, input') && $module.closest('label').length > 0;\n },\n bubbledIconClick: function(event) {\n return $(event.target).closest($icon).length > 0;\n },\n alreadySetup: function() {\n return ($module.is('select') && $module.parent(selector.dropdown).length > 0 && $module.prev().length === 0);\n },\n animating: function($subMenu) {\n return ($subMenu)\n ? $subMenu.transition && $subMenu.transition('is animating')\n : $menu.transition && $menu.transition('is animating')\n ;\n },\n disabled: function() {\n return $module.hasClass(className.disabled);\n },\n focused: function() {\n return (document.activeElement === $module[0]);\n },\n focusedOnSearch: function() {\n return (document.activeElement === $search[0]);\n },\n allFiltered: function() {\n return( (module.is.multiple() || module.has.search()) && !(settings.hideAdditions == false && module.has.userSuggestion()) && !module.has.message() && module.has.allResultsFiltered() );\n },\n hidden: function($subMenu) {\n return !module.is.visible($subMenu);\n },\n initialLoad: function() {\n return initialLoad;\n },\n onScreen: function($subMenu) {\n var\n $currentMenu = $subMenu || $menu,\n canOpenDownward = true,\n onScreen = {},\n calculations\n ;\n $currentMenu.addClass(className.loading);\n calculations = {\n context: {\n scrollTop : $context.scrollTop(),\n height : $context.outerHeight()\n },\n menu : {\n offset: $currentMenu.offset(),\n height: $currentMenu.outerHeight()\n }\n };\n onScreen = {\n above : (calculations.context.scrollTop) <= calculations.menu.offset.top - calculations.menu.height,\n below : (calculations.context.scrollTop + calculations.context.height) >= calculations.menu.offset.top + calculations.menu.height\n };\n if(onScreen.below) {\n module.verbose('Dropdown can fit in context downward', onScreen);\n canOpenDownward = true;\n }\n else if(!onScreen.below && !onScreen.above) {\n module.verbose('Dropdown cannot fit in either direction, favoring downward', onScreen);\n canOpenDownward = true;\n }\n else {\n module.verbose('Dropdown cannot fit below, opening upward', onScreen);\n canOpenDownward = false;\n }\n $currentMenu.removeClass(className.loading);\n return canOpenDownward;\n },\n inObject: function(needle, object) {\n var\n found = false\n ;\n $.each(object, function(index, property) {\n if(property == needle) {\n found = true;\n return true;\n }\n });\n return found;\n },\n multiple: function() {\n return $module.hasClass(className.multiple);\n },\n single: function() {\n return !module.is.multiple();\n },\n selectMutation: function(mutations) {\n var\n selectChanged = false\n ;\n $.each(mutations, function(index, mutation) {\n if(mutation.target && $(mutation.target).is('select')) {\n selectChanged = true;\n return true;\n }\n });\n return selectChanged;\n },\n search: function() {\n return $module.hasClass(className.search);\n },\n searchSelection: function() {\n return ( module.has.search() && $search.parent(selector.dropdown).length === 1 );\n },\n selection: function() {\n return $module.hasClass(className.selection);\n },\n userValue: function(value) {\n return ($.inArray(value, module.get.userValues()) !== -1);\n },\n upward: function($menu) {\n var $element = $menu || $module;\n return $element.hasClass(className.upward);\n },\n visible: function($subMenu) {\n return ($subMenu)\n ? $subMenu.hasClass(className.visible)\n : $menu.hasClass(className.visible)\n ;\n }\n },\n\n can: {\n activate: function($item) {\n if(settings.useLabels) {\n return true;\n }\n if(!module.has.maxSelections()) {\n return true;\n }\n if(module.has.maxSelections() && $item.hasClass(className.active)) {\n return true;\n }\n return false;\n },\n click: function() {\n return (hasTouch || settings.on == 'click');\n },\n extendSelect: function() {\n return settings.allowAdditions || settings.apiSettings;\n },\n show: function() {\n return !module.is.disabled() && (module.has.items() || module.has.message());\n },\n useAPI: function() {\n return $.fn.api !== undefined;\n }\n },\n\n animate: {\n show: function(callback, $subMenu) {\n var\n $currentMenu = $subMenu || $menu,\n start = ($subMenu)\n ? function() {}\n : function() {\n module.hideSubMenus();\n module.hideOthers();\n module.set.active();\n },\n transition\n ;\n callback = $.isFunction(callback)\n ? callback\n : function(){}\n ;\n module.verbose('Doing menu show animation', $currentMenu);\n module.set.direction($subMenu);\n transition = module.get.transition($subMenu);\n if( module.is.selection() ) {\n module.set.scrollPosition(module.get.selectedItem(), true);\n }\n if( module.is.hidden($currentMenu) || module.is.animating($currentMenu) ) {\n if(transition == 'none') {\n start();\n $currentMenu.transition('show');\n callback.call(element);\n }\n else if($.fn.transition !== undefined && $module.transition('is supported')) {\n $currentMenu\n .transition({\n animation : transition + ' in',\n debug : settings.debug,\n verbose : settings.verbose,\n duration : settings.duration,\n queue : true,\n onStart : start,\n onComplete : function() {\n callback.call(element);\n }\n })\n ;\n }\n else {\n module.error(error.noTransition, transition);\n }\n }\n },\n hide: function(callback, $subMenu) {\n var\n $currentMenu = $subMenu || $menu,\n duration = ($subMenu)\n ? (settings.duration * 0.9)\n : settings.duration,\n start = ($subMenu)\n ? function() {}\n : function() {\n if( module.can.click() ) {\n module.unbind.intent();\n }\n module.remove.active();\n },\n transition = module.get.transition($subMenu)\n ;\n callback = $.isFunction(callback)\n ? callback\n : function(){}\n ;\n if( module.is.visible($currentMenu) || module.is.animating($currentMenu) ) {\n module.verbose('Doing menu hide animation', $currentMenu);\n\n if(transition == 'none') {\n start();\n $currentMenu.transition('hide');\n callback.call(element);\n }\n else if($.fn.transition !== undefined && $module.transition('is supported')) {\n $currentMenu\n .transition({\n animation : transition + ' out',\n duration : settings.duration,\n debug : settings.debug,\n verbose : settings.verbose,\n queue : true,\n onStart : start,\n onComplete : function() {\n if(settings.direction == 'auto') {\n module.remove.upward($subMenu);\n }\n callback.call(element);\n }\n })\n ;\n }\n else {\n module.error(error.transition);\n }\n }\n }\n },\n\n hideAndClear: function() {\n module.remove.searchTerm();\n if( module.has.maxSelections() ) {\n return;\n }\n if(module.has.search()) {\n module.hide(function() {\n module.remove.filteredItem();\n });\n }\n else {\n module.hide();\n }\n },\n\n delay: {\n show: function() {\n module.verbose('Delaying show event to ensure user intent');\n clearTimeout(module.timer);\n module.timer = setTimeout(module.show, settings.delay.show);\n },\n hide: function() {\n module.verbose('Delaying hide event to ensure user intent');\n clearTimeout(module.timer);\n module.timer = setTimeout(module.hide, settings.delay.hide);\n }\n },\n\n escape: {\n value: function(value) {\n var\n multipleValues = $.isArray(value),\n stringValue = (typeof value === 'string'),\n isUnparsable = (!stringValue && !multipleValues),\n hasQuotes = (stringValue && value.search(regExp.quote) !== -1),\n values = []\n ;\n if(!module.has.selectInput() || isUnparsable || !hasQuotes) {\n return value;\n }\n module.debug('Encoding quote values for use in select', value);\n if(multipleValues) {\n $.each(value, function(index, value){\n values.push(value.replace(regExp.quote, '&quot;'));\n });\n return values;\n }\n return value.replace(regExp.quote, '&quot;');\n },\n regExp: function(text) {\n text = String(text);\n return text.replace(regExp.escape, '\\\\$&');\n }\n },\n\n setting: function(name, value) {\n module.debug('Changing setting', name, value);\n if( $.isPlainObject(name) ) {\n $.extend(true, settings, name);\n }\n else if(value !== undefined) {\n if($.isPlainObject(settings[name])) {\n $.extend(true, settings[name], value);\n }\n else {\n settings[name] = value;\n }\n }\n else {\n return settings[name];\n }\n },\n internal: function(name, value) {\n if( $.isPlainObject(name) ) {\n $.extend(true, module, name);\n }\n else if(value !== undefined) {\n module[name] = value;\n }\n else {\n return module[name];\n }\n },\n debug: function() {\n if(!settings.silent && settings.debug) {\n if(settings.performance) {\n module.performance.log(arguments);\n }\n else {\n module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');\n module.debug.apply(console, arguments);\n }\n }\n },\n verbose: function() {\n if(!settings.silent && settings.verbose && settings.debug) {\n if(settings.performance) {\n module.performance.log(arguments);\n }\n else {\n module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');\n module.verbose.apply(console, arguments);\n }\n }\n },\n error: function() {\n if(!settings.silent) {\n module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');\n module.error.apply(console, arguments);\n }\n },\n performance: {\n log: function(message) {\n var\n currentTime,\n executionTime,\n previousTime\n ;\n if(settings.performance) {\n currentTime = new Date().getTime();\n previousTime = time || currentTime;\n executionTime = currentTime - previousTime;\n time = currentTime;\n performance.push({\n 'Name' : message[0],\n 'Arguments' : [].slice.call(message, 1) || '',\n 'Element' : element,\n 'Execution Time' : executionTime\n });\n }\n clearTimeout(module.performance.timer);\n module.performance.timer = setTimeout(module.performance.display, 500);\n },\n display: function() {\n var\n title = settings.name + ':',\n totalTime = 0\n ;\n time = false;\n clearTimeout(module.performance.timer);\n $.each(performance, function(index, data) {\n totalTime += data['Execution Time'];\n });\n title += ' ' + totalTime + 'ms';\n if(moduleSelector) {\n title += ' \\'' + moduleSelector + '\\'';\n }\n if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {\n console.groupCollapsed(title);\n if(console.table) {\n console.table(performance);\n }\n else {\n $.each(performance, function(index, data) {\n console.log(data['Name'] + ': ' + data['Execution Time']+'ms');\n });\n }\n console.groupEnd();\n }\n performance = [];\n }\n },\n invoke: function(query, passedArguments, context) {\n var\n object = instance,\n maxDepth,\n found,\n response\n ;\n passedArguments = passedArguments || queryArguments;\n context = element || context;\n if(typeof query == 'string' && object !== undefined) {\n query = query.split(/[\\. ]/);\n maxDepth = query.length - 1;\n $.each(query, function(depth, value) {\n var camelCaseValue = (depth != maxDepth)\n ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)\n : query\n ;\n if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {\n object = object[camelCaseValue];\n }\n else if( object[camelCaseValue] !== undefined ) {\n found = object[camelCaseValue];\n return false;\n }\n else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {\n object = object[value];\n }\n else if( object[value] !== undefined ) {\n found = object[value];\n return false;\n }\n else {\n module.error(error.method, query);\n return false;\n }\n });\n }\n if ( $.isFunction( found ) ) {\n response = found.apply(context, passedArguments);\n }\n else if(found !== undefined) {\n response = found;\n }\n if($.isArray(returnedValue)) {\n returnedValue.push(response);\n }\n else if(returnedValue !== undefined) {\n returnedValue = [returnedValue, response];\n }\n else if(response !== undefined) {\n returnedValue = response;\n }\n return found;\n }\n };\n\n if(methodInvoked) {\n if(instance === undefined) {\n module.initialize();\n }\n module.invoke(query);\n }\n else {\n if(instance !== undefined) {\n instance.invoke('destroy');\n }\n module.initialize();\n }\n })\n ;\n return (returnedValue !== undefined)\n ? returnedValue\n : $allModules\n ;\n};\n\n$.fn.dropdown.settings = {\n\n silent : false,\n debug : false,\n verbose : false,\n performance : true,\n\n on : 'click', // what event should show menu action on item selection\n action : 'activate', // action on item selection (nothing, activate, select, combo, hide, function(){})\n\n\n apiSettings : false,\n selectOnKeydown : true, // Whether selection should occur automatically when keyboard shortcuts used\n minCharacters : 0, // Minimum characters required to trigger API call\n saveRemoteData : true, // Whether remote name/value pairs should be stored in sessionStorage to allow remote data to be restored on page refresh\n throttle : 200, // How long to wait after last user input to search remotely\n\n context : window, // Context to use when determining if on screen\n direction : 'auto', // Whether dropdown should always open in one direction\n keepOnScreen : true, // Whether dropdown should check whether it is on screen before showing\n\n match : 'both', // what to match against with search selection (both, text, or label)\n fullTextSearch : false, // search anywhere in value (set to 'exact' to require exact matches)\n\n placeholder : 'auto', // whether to convert blank <select> values to placeholder text\n preserveHTML : true, // preserve html when selecting value\n sortSelect : false, // sort selection on init\n\n forceSelection : true, // force a choice on blur with search selection\n\n allowAdditions : false, // whether multiple select should allow user added values\n hideAdditions : true, // whether or not to hide special message prompting a user they can enter a value\n\n maxSelections : false, // When set to a number limits the number of selections to this count\n useLabels : true, // whether multiple select should filter currently active selections from choices\n delimiter : ',', // when multiselect uses normal <input> the values will be delimited with this character\n\n showOnFocus : true, // show menu on focus\n allowReselection : false, // whether current value should trigger callbacks when reselected\n allowTab : true, // add tabindex to element\n allowCategorySelection : false, // allow elements with sub-menus to be selected\n\n fireOnInit : false, // Whether callbacks should fire when initializing dropdown values\n\n transition : 'auto', // auto transition will slide down or up based on direction\n duration : 200, // duration of transition\n\n glyphWidth : 1.037, // widest glyph width in em (W is 1.037 em) used to calculate multiselect input width\n\n // label settings on multi-select\n label: {\n transition : 'scale',\n duration : 200,\n variation : false\n },\n\n // delay before event\n delay : {\n hide : 300,\n show : 200,\n search : 20,\n touch : 50\n },\n\n /* Callbacks */\n onChange : function(value, text, $selected){},\n onAdd : function(value, text, $selected){},\n onRemove : function(value, text, $selected){},\n\n onLabelSelect : function($selectedLabels){},\n onLabelCreate : function(value, text) { return $(this); },\n onLabelRemove : function(value) { return true; },\n onNoResults : function(searchTerm) { return true; },\n onShow : function(){},\n onHide : function(){},\n\n /* Component */\n name : 'Dropdown',\n namespace : 'dropdown',\n\n message: {\n addResult : 'Add <b>{term}</b>',\n count : '{count} selected',\n maxSelections : 'Max {maxCount} selections',\n noResults : 'No results found.',\n serverError : 'There was an error contacting the server'\n },\n\n error : {\n action : 'You called a dropdown action that was not defined',\n alreadySetup : 'Once a select has been initialized behaviors must be called on the created ui dropdown',\n labels : 'Allowing user additions currently requires the use of labels.',\n missingMultiple : '<select> requires multiple property to be set to correctly preserve multiple values',\n method : 'The method you called is not defined.',\n noAPI : 'The API module is required to load resources remotely',\n noStorage : 'Saving remote data requires session storage',\n noTransition : 'This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>'\n },\n\n regExp : {\n escape : /[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\n quote : /\"/g\n },\n\n metadata : {\n defaultText : 'defaultText',\n defaultValue : 'defaultValue',\n placeholderText : 'placeholder',\n text : 'text',\n value : 'value'\n },\n\n // property names for remote query\n fields: {\n remoteValues : 'results', // grouping for api results\n values : 'values', // grouping for all dropdown values\n disabled : 'disabled', // whether value should be disabled\n name : 'name', // displayed dropdown text\n value : 'value', // actual dropdown value\n text : 'text' // displayed text when selected\n },\n\n keys : {\n backspace : 8,\n delimiter : 188, // comma\n deleteKey : 46,\n enter : 13,\n escape : 27,\n pageUp : 33,\n pageDown : 34,\n leftArrow : 37,\n upArrow : 38,\n rightArrow : 39,\n downArrow : 40\n },\n\n selector : {\n addition : '.addition',\n dropdown : '.ui.dropdown',\n hidden : '.hidden',\n icon : '> .dropdown.icon',\n input : '> input[type=\"hidden\"], > select',\n item : '.item',\n label : '> .label',\n remove : '> .label > .delete.icon',\n siblingLabel : '.label',\n menu : '.menu',\n message : '.message',\n menuIcon : '.dropdown.icon',\n search : 'input.search, .menu > .search > input, .menu input.search',\n sizer : '> input.sizer',\n text : '> .text:not(.icon)',\n unselectable : '.disabled, .filtered'\n },\n\n className : {\n active : 'active',\n addition : 'addition',\n animating : 'animating',\n disabled : 'disabled',\n empty : 'empty',\n dropdown : 'ui dropdown',\n filtered : 'filtered',\n hidden : 'hidden transition',\n item : 'item',\n label : 'ui label',\n loading : 'loading',\n menu : 'menu',\n message : 'message',\n multiple : 'multiple',\n placeholder : 'default',\n sizer : 'sizer',\n search : 'search',\n selected : 'selected',\n selection : 'selection',\n upward : 'upward',\n visible : 'visible'\n }\n\n};\n\n/* Templates */\n$.fn.dropdown.settings.templates = {\n\n // generates dropdown from select values\n dropdown: function(select) {\n var\n placeholder = select.placeholder || false,\n values = select.values || {},\n html = ''\n ;\n html += '<i class=\"dropdown icon\"></i>';\n if(select.placeholder) {\n html += '<div class=\"default text\">' + placeholder + '</div>';\n }\n else {\n html += '<div class=\"text\"></div>';\n }\n html += '<div class=\"menu\">';\n $.each(select.values, function(index, option) {\n html += (option.disabled)\n ? '<div class=\"disabled item\" data-value=\"' + option.value + '\">' + option.name + '</div>'\n : '<div class=\"item\" data-value=\"' + option.value + '\">' + option.name + '</div>'\n ;\n });\n html += '</div>';\n return html;\n },\n\n // generates just menu from select\n menu: function(response, fields) {\n var\n values = response[fields.values] || {},\n html = ''\n ;\n $.each(values, function(index, option) {\n var\n maybeText = (option[fields.text])\n ? 'data-text=\"' + option[fields.text] + '\"'\n : '',\n maybeDisabled = (option[fields.disabled])\n ? 'disabled '\n : ''\n ;\n html += '<div class=\"'+ maybeDisabled +'item\" data-value=\"' + option[fields.value] + '\"' + maybeText + '>'\n html += option[fields.name];\n html += '</div>';\n });\n return html;\n },\n\n // generates label for multiselect\n label: function(value, text) {\n return text + '<i class=\"delete icon\"></i>';\n },\n\n\n // generates messages like \"No results\"\n message: function(message) {\n return message;\n },\n\n // generates user addition to selection menu\n addition: function(choice) {\n return choice;\n }\n\n};\n\n})( jQuery, window, document );\n"]}