| 783 | 783 | .append(htmlExternal) |
| 784 | 784 | .append(getModuleInformation()); |
| 785 | 785 | |
| 786 | | - /** @type {import('./popup.js').CustomPopupButton} */ |
| 786 | + { |
| 787 | | - const updateAllButton = { |
| 787 | + const updateAction = async (force) => { |
| 788 | | - text: t`Update all`, |
| 789 | | - action: async () => { |
| 790 | 788 | requiresReload = true; |
| 791 | 789 | await autoUpdateExtensions(trueforce); |
| 792 | 790 | await popup.complete(POPUP_RESULT.AFFIRMATIVE); |
| 793 | | - }, |
| 794 | 791 | }; |
| 795 | 792 | |
| 796 | | - /** @type {import('./popup.js').CustomPopupButton} */ |
| 793 | + const toolbar = document.createElement('div'); |
| 797 | | - const updateEnabledOnlyButton = { |
| 794 | + toolbar.classList.add('extensions_toolbar'); |
| 798 | | - text: t`Update enabled only`, |
| 799 | | - action: async () => { |
| 800 | | - requiresReload = true; |
| 801 | | - await autoUpdateExtensions(false); |
| 802 | | - await popup.complete(POPUP_RESULT.AFFIRMATIVE); |
| 803 | | - }, |
| 804 | | - }; |
| 805 | 795 | |
| 806 | | - /** @type {import('./popup.js').CustomPopupButton} */ |
| 796 | + const updateAllButton = document.createElement('button'); |
| 807 | | - const sortOrderButton = { |
| 797 | + updateAllButton.classList.add('menu_button', 'menu_button_icon'); |
| 808 | | - text: sortByName ? t`Sort: Display Name` : t`Sort: Loading Order`, |
| 798 | + updateAllButton.textContent = t`Update all`; |
| 809 | | - action: async () => { |
| 799 | + updateAllButton.addEventListener('click', () => updateAction(true)); |
| 800 | + |
| 801 | + const updateEnabledOnlyButton = document.createElement('button'); |
| 802 | + updateEnabledOnlyButton.classList.add('menu_button', 'menu_button_icon'); |
| 803 | + updateEnabledOnlyButton.textContent = t`Update enabled`; |
| 804 | + updateEnabledOnlyButton.addEventListener('click', () => updateAction(false)); |
| 805 | + |
| 806 | + const flexExpander = document.createElement('div'); |
| 807 | + flexExpander.classList.add('expander'); |
| 808 | + |
| 809 | + const sortOrderButton = document.createElement('button'); |
| 810 | + sortOrderButton.classList.add('menu_button', 'menu_button_icon'); |
| 811 | + sortOrderButton.textContent = sortByName ? t`Sort: Display Name` : t`Sort: Loading Order`; |
| 812 | + sortOrderButton.addEventListener('click', async () => { |
| 810 | 813 | abortController.abort(); |
| 811 | 814 | accountStorage.setItem(sortOrderKey, sortByName ? 'false' : 'true'); |
| 812 | 815 | await showExtensionsDetails(); |
| 813 | 816 | },); |
| 814 | | - }; |
| 817 | + |
| 818 | + toolbar.append(updateAllButton, updateEnabledOnlyButton, flexExpander, sortOrderButton); |
| 819 | + html.prepend(toolbar); |
| 820 | + } |
| 815 | 821 | |
| 816 | 822 | let waitingForSave = false; |
| 817 | 823 | |