(beginDetails)
| 6715 | return html; |
| 6716 | } |
| 6717 | function toolbarModuleFilter(beginDetails) { |
| 6718 | var initialSelected = null; |
| 6719 | dropdownData = { |
| 6720 | options: beginDetails.modules.slice(), |
| 6721 | selectedMap: new StringMap(), |
| 6722 | isDirty: function isDirty() { |
| 6723 | return _toConsumableArray(dropdownData.selectedMap.keys()).sort().join(',') !== _toConsumableArray(initialSelected.keys()).sort().join(','); |
| 6724 | } |
| 6725 | }; |
| 6726 | if (config.moduleId.length) { |
| 6727 | // The module dropdown is seeded with the runtime configuration of the last run. |
| 6728 | // |
| 6729 | // We don't reference `config.moduleId` directly after this and keep our own |
| 6730 | // copy because: |
| 6731 | // 1. This naturally filters out unknown moduleIds. |
| 6732 | // 2. Gives us a place to manage and remember unsubmitted checkbox changes. |
| 6733 | // 3. Gives us an efficient way to map a selected moduleId to module name |
| 6734 | // during rendering. |
| 6735 | for (var i = 0; i < beginDetails.modules.length; i++) { |
| 6736 | var mod = beginDetails.modules[i]; |
| 6737 | if (config.moduleId.indexOf(mod.moduleId) !== -1) { |
| 6738 | dropdownData.selectedMap.set(mod.moduleId, mod.name); |
| 6739 | } |
| 6740 | } |
| 6741 | } |
| 6742 | initialSelected = new StringMap(dropdownData.selectedMap); |
| 6743 | var moduleSearch = document.createElement('input'); |
| 6744 | moduleSearch.id = 'qunit-modulefilter-search'; |
| 6745 | moduleSearch.autocomplete = 'off'; |
| 6746 | addEvent(moduleSearch, 'input', searchInput); |
| 6747 | addEvent(moduleSearch, 'input', searchFocus); |
| 6748 | addEvent(moduleSearch, 'focus', searchFocus); |
| 6749 | addEvent(moduleSearch, 'click', searchFocus); |
| 6750 | var label = document.createElement('label'); |
| 6751 | label.htmlFor = 'qunit-modulefilter-search'; |
| 6752 | label.textContent = 'Module:'; |
| 6753 | var searchContainer = document.createElement('span'); |
| 6754 | searchContainer.id = 'qunit-modulefilter-search-container'; |
| 6755 | searchContainer.appendChild(moduleSearch); |
| 6756 | var applyButton = document.createElement('button'); |
| 6757 | applyButton.textContent = 'Apply'; |
| 6758 | applyButton.title = 'Re-run the selected test modules'; |
| 6759 | addEvent(applyButton, 'click', applyUrlParams); |
| 6760 | var resetButton = document.createElement('button'); |
| 6761 | resetButton.textContent = 'Reset'; |
| 6762 | resetButton.type = 'reset'; |
| 6763 | resetButton.title = 'Restore the previous module selection'; |
| 6764 | var clearButton = document.createElement('button'); |
| 6765 | clearButton.textContent = 'Select none'; |
| 6766 | clearButton.type = 'button'; |
| 6767 | clearButton.title = 'Clear the current module selection'; |
| 6768 | addEvent(clearButton, 'click', function () { |
| 6769 | dropdownData.selectedMap.clear(); |
| 6770 | selectionChange(); |
| 6771 | searchInput(); |
| 6772 | }); |
| 6773 | var actions = document.createElement('span'); |
| 6774 | actions.id = 'qunit-modulefilter-actions'; |
no test coverage detected