Add ability to filter the container list

https://github.com/mozilla/multi-account-containers/pull/2390
This commit is contained in:
BPower0036 2022-07-30 09:06:07 +00:00 committed by GitHub
parent 3d02d64589
commit 0c683fbc22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 122 additions and 27 deletions

View file

@ -226,6 +226,15 @@
"enableSyncDescription": { "enableSyncDescription": {
"message": "Mit dieser Einstellung können Sie Ihre Umgebungen und Website-Zuweisungen geräteübergreifend synchronisieren." "message": "Mit dieser Einstellung können Sie Ihre Umgebungen und Website-Zuweisungen geräteübergreifend synchronisieren."
}, },
"syncExclude": {
"message": "Umgebung ausschließen"
},
"syncExcludePlaceholder": {
"message": "Einen regulären Ausdruck einfügen"
},
"syncExcludeDescription": {
"message": "Schließen Sie Umgebungen von der Synchronisierung aus, wenn ihr Name mit dem angegebenen regulären Ausdruck ohne Berücksichtigung der Groß-/Kleinschreibung übereinstimmt."
},
"replaceTab": { "replaceTab": {
"message": "Tab ersetzen, anstatt einen neuen zu erstellen" "message": "Tab ersetzen, anstatt einen neuen zu erstellen"
}, },

View file

@ -73,7 +73,7 @@
"message": "Syncing Containers is now Available!" "message": "Syncing Containers is now Available!"
}, },
"onboarding-6-description": { "onboarding-6-description": {
"message": "Turn on sync to share Container and site assignments with any computer connected to your Firefox account." "message": "Turn on Sync to share Container and site assignments with any computer connected to your Firefox account."
}, },
"onboarding-7-header": { "onboarding-7-header": {
"message": "Firefox account is required to sync." "message": "Firefox account is required to sync."
@ -226,6 +226,15 @@
"enableSyncDescription": { "enableSyncDescription": {
"message": "This setting allows you to sync your Containers and site assignments across devices." "message": "This setting allows you to sync your Containers and site assignments across devices."
}, },
"syncExclude": {
"message": "Container exclusion"
},
"syncExcludePlaceholder": {
"message": "Insert a regular expression"
},
"syncExcludeDescription": {
"message": "Exclude containers from sync when their name matches the specified case insensitive regular expression."
},
"replaceTab": { "replaceTab": {
"message": "Replace tab instead of creating a new one" "message": "Replace tab instead of creating a new one"
}, },

View file

@ -1,7 +1,7 @@
{ {
"extensionDescription": { "extensionDescription": {
"message": "Multi-Account Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and colour-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate. This addon comes with wildcard(*) support.", "message": "Multi-Account Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and color-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate. This addon comes with wildcard(*) support.",
"description": "Description of the extension. DO NOT TRANSLATE \"Multi-Account Containers\"." "description": "Description of the extension. DO NOT TRANSLATE \"Multi-Account Containers\"."
}, },
"openInNewTabTitle": { "openInNewTabTitle": {
"message": "Open New Tab in…", "message": "Open New Tab in…",
@ -27,10 +27,10 @@
"message": "Always Open Site in Container" "message": "Always Open Site in Container"
}, },
"openANewTabIn": { "openANewTabIn": {
"message": "Open a New Tab in…" "message" : "Open a New Tab in…"
}, },
"openNewTabInThisContainer": { "openNewTabInThisContainer": {
"message": "Open New Tab in this Container" "message" : "Open New Tab in this Container"
}, },
"openTabs": { "openTabs": {
"message": "Open Tabs", "message": "Open Tabs",
@ -49,7 +49,7 @@
"message": "Put Containers to work for you." "message": "Put Containers to work for you."
}, },
"onboarding-2-description": { "onboarding-2-description": {
"message": "Features like colour-coding and separate Container tabs help you find things easily, focus your attention, and minimize distractions." "message": "Features like color-coding and separate Container tabs help you find things easily, focus your attention, and minimize distractions."
}, },
"onboarding-3-header": { "onboarding-3-header": {
"message": "A place for everything, and everything in its place." "message": "A place for everything, and everything in its place."
@ -73,7 +73,7 @@
"message": "Syncing Containers is now Available!" "message": "Syncing Containers is now Available!"
}, },
"onboarding-6-description": { "onboarding-6-description": {
"message": "Turn on sync to share Container and site assignments with any computer connected to your Firefox account." "message": "Turn on Sync to share Container and site assignments with any computer connected to your Firefox account."
}, },
"onboarding-7-header": { "onboarding-7-header": {
"message": "Firefox account is required to sync." "message": "Firefox account is required to sync."
@ -139,7 +139,7 @@
"message": "Name" "message": "Name"
}, },
"color": { "color": {
"message": "Colour" "message": "Color"
}, },
"icon": { "icon": {
"message": "Icon" "message": "Icon"
@ -209,7 +209,7 @@
"message": "Toggle this to see the onboarding panels again." "message": "Toggle this to see the onboarding panels again."
}, },
"tabBehavior": { "tabBehavior": {
"message": "Tab behaviour:" "message": "Tab behavior:"
}, },
"enableBookMarkMenus": { "enableBookMarkMenus": {
"message": "Enable Bookmark Menus" "message": "Enable Bookmark Menus"
@ -226,6 +226,15 @@
"enableSyncDescription": { "enableSyncDescription": {
"message": "This setting allows you to sync your Containers and site assignments across devices." "message": "This setting allows you to sync your Containers and site assignments across devices."
}, },
"syncExclude": {
"message": "Container exclusion"
},
"syncExcludePlaceholder": {
"message": "Insert a regular expression"
},
"syncExcludeDescription": {
"message": "Exclude containers from sync when their name matches the specified case insensitive regular expression."
},
"replaceTab": { "replaceTab": {
"message": "Replace tab instead of creating a new one" "message": "Replace tab instead of creating a new one"
}, },
@ -239,7 +248,7 @@
"message": "Container to open with Keyboard Shortcut $keyId$", "message": "Container to open with Keyboard Shortcut $keyId$",
"placeholders": { "placeholders": {
"keyId": { "keyId": {
"content": "$1" "content": "$1"
} }
} }
}, },

View file

@ -1,7 +1,7 @@
{ {
"extensionDescription": { "extensionDescription": {
"message": "Multi-Account Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and colour-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate. This addon comes with wildcard(*) support.", "message": "Multi-Account Containers helps you keep all the parts of your online life contained in different tabs. Custom labels and color-coded tabs help keep different activities — like online shopping, travel planning, or checking work email — separate. This addon comes with wildcard(*) support.",
"description": "Description of the extension. DO NOT TRANSLATE \"Multi-Account Containers\"." "description": "Description of the extension. DO NOT TRANSLATE \"Multi-Account Containers\"."
}, },
"openInNewTabTitle": { "openInNewTabTitle": {
"message": "Open New Tab in…", "message": "Open New Tab in…",
@ -27,10 +27,10 @@
"message": "Always Open Site in Container" "message": "Always Open Site in Container"
}, },
"openANewTabIn": { "openANewTabIn": {
"message": "Open a New Tab in…" "message" : "Open a New Tab in…"
}, },
"openNewTabInThisContainer": { "openNewTabInThisContainer": {
"message": "Open New Tab in this Container" "message" : "Open New Tab in this Container"
}, },
"openTabs": { "openTabs": {
"message": "Open Tabs", "message": "Open Tabs",
@ -43,13 +43,13 @@
"message": "A better way to manage all the things you do online" "message": "A better way to manage all the things you do online"
}, },
"onboarding-1-description": { "onboarding-1-description": {
"message": "Use Containers to organise tasks, manage accounts, and keep your focus where you want it." "message": "Use Containers to organize tasks, manage accounts, and keep your focus where you want it."
}, },
"onboarding-2-header": { "onboarding-2-header": {
"message": "Put Containers to work for you." "message": "Put Containers to work for you."
}, },
"onboarding-2-description": { "onboarding-2-description": {
"message": "Features like colour-coding and separate Container tabs help you find things easily, focus your attention, and minimise distractions." "message": "Features like color-coding and separate Container tabs help you find things easily, focus your attention, and minimize distractions."
}, },
"onboarding-3-header": { "onboarding-3-header": {
"message": "A place for everything, and everything in its place." "message": "A place for everything, and everything in its place."
@ -70,13 +70,13 @@
"message": "Long-press the New Tab button to create a new Container tab." "message": "Long-press the New Tab button to create a new Container tab."
}, },
"onboarding-6-header": { "onboarding-6-header": {
"message": "Synchronising Containers is now Available!" "message": "Syncing Containers is now Available!"
}, },
"onboarding-6-description": { "onboarding-6-description": {
"message": "Turn on synchronisation to share Container and site assignments with any computer connected to your Firefox account." "message": "Turn on Sync to share Container and site assignments with any computer connected to your Firefox account."
}, },
"onboarding-7-header": { "onboarding-7-header": {
"message": "Firefox account is required to synchronise." "message": "Firefox account is required to sync."
}, },
"onboarding-7-description": { "onboarding-7-description": {
"message": "Click Sign In to confirm that your Firefox account is active." "message": "Click Sign In to confirm that your Firefox account is active."
@ -139,7 +139,7 @@
"message": "Name" "message": "Name"
}, },
"color": { "color": {
"message": "Colour" "message": "Color"
}, },
"icon": { "icon": {
"message": "Icon" "message": "Icon"
@ -172,7 +172,7 @@
"message": "Not Now" "message": "Not Now"
}, },
"startSyncing": { "startSyncing": {
"message": "Start Synchronising" "message": "Start Syncing"
}, },
"info": { "info": {
"message": "info", "message": "info",
@ -209,22 +209,31 @@
"message": "Toggle this to see the onboarding panels again." "message": "Toggle this to see the onboarding panels again."
}, },
"tabBehavior": { "tabBehavior": {
"message": "Tab behaviour:" "message": "Tab behavior:"
}, },
"enableBookMarkMenus": { "enableBookMarkMenus": {
"message": "Enable Bookmark Menus" "message": "Enable Bookmark Menus"
}, },
"firefoxAccountsSync": { "firefoxAccountsSync": {
"message": "Firefox accounts synchronisation:" "message": "Firefox accounts sync:"
}, },
"enableSync": { "enableSync": {
"message": "Enable synchronisation" "message": "Enable sync"
}, },
"enableBookMarkMenusDescription": { "enableBookMarkMenusDescription": {
"message": "This setting allows you to open a bookmark or folder of bookmarks in a Container." "message": "This setting allows you to open a bookmark or folder of bookmarks in a Container."
}, },
"enableSyncDescription": { "enableSyncDescription": {
"message": "This setting allows you to synchronise your Containers and site assignments across devices." "message": "This setting allows you to sync your Containers and site assignments across devices."
},
"syncExclude": {
"message": "Container exclusion"
},
"syncExcludePlaceholder": {
"message": "Insert a regular expression"
},
"syncExcludeDescription": {
"message": "Exclude containers from sync when their name matches the specified case insensitive regular expression."
}, },
"replaceTab": { "replaceTab": {
"message": "Replace tab instead of creating a new one" "message": "Replace tab instead of creating a new one"
@ -239,7 +248,7 @@
"message": "Container to open with Keyboard Shortcut $keyId$", "message": "Container to open with Keyboard Shortcut $keyId$",
"placeholders": { "placeholders": {
"keyId": { "keyId": {
"content": "$1" "content": "$1"
} }
} }
}, },

View file

@ -226,6 +226,15 @@
"enableSyncDescription": { "enableSyncDescription": {
"message": "Ce paramètre vous permet de synchroniser vos conteneurs et affectations de sites entre vos appareils." "message": "Ce paramètre vous permet de synchroniser vos conteneurs et affectations de sites entre vos appareils."
}, },
"syncExclude": {
"message": "Exclusion de conteneurs"
},
"syncExcludePlaceholder": {
"message": "Insérer une expression régulière"
},
"syncExcludeDescription": {
"message": "Exclure des conteneurs de la synchronisation lorsque leur nom correspond à lexpression régulière insensible à la casse spécifiée."
},
"replaceTab": { "replaceTab": {
"message": "Remplacer longlet plutôt quen créer un nouveau" "message": "Remplacer longlet plutôt quen créer un nouveau"
}, },

View file

@ -226,6 +226,15 @@
"enableSyncDescription": { "enableSyncDescription": {
"message": "Met deze instelling kunt u uw containers en websitetoewijzingen met andere apparaten synchroniseren." "message": "Met deze instelling kunt u uw containers en websitetoewijzingen met andere apparaten synchroniseren."
}, },
"syncExclude": {
"message": "Uitsluiting van containers"
},
"syncExcludePlaceholder": {
"message": "Een reguliere expressie invoegen"
},
"syncExcludeDescription": {
"message": "Containers uitsluiten van synchronisatie wanneer hun naam overeenkomt met de opgegeven hoofdletterongevoelige reguliere expressie."
},
"replaceTab": { "replaceTab": {
"message": "Tabblad vervangen in plaats van een nieuw maken" "message": "Tabblad vervangen in plaats van een nieuw maken"
}, },
@ -426,7 +435,8 @@
}, },
"saveLegend": { "saveLegend": {
"message": "Opslaan", "message": "Opslaan",
"description": "(Options menu) Save containers to a file group header"}, "description": "(Options menu) Save containers to a file group header"
},
"saveButton": { "saveButton": {
"message": "Opslaan", "message": "Opslaan",
"description": "(Options menu) Validate saving containers to a file" "description": "(Options menu) Validate saving containers to a file"

View file

@ -2395,3 +2395,13 @@ tr:hover > td > .trash-button {
.overflow .panel.onboarding { .overflow .panel.onboarding {
margin-block: auto; margin-block: auto;
} }
/* Searchbar */
.searchbar {
margin-block: 4px -4px;
padding-inline: 16px;
}
.searchbar input {
inline-size: 100%;
}

View file

@ -464,6 +464,23 @@ const Logic = {
default: default:
break; break;
} }
},
filterContainerList() {
const pattern = /^\s+|\s+$/g;
const list = Array.from(document.querySelectorAll("#identities-list tr"));
const search = document.querySelector("#search-terms").value.replace(pattern, "").toLowerCase();
for (const i in list) {
const text = list[i].querySelector("td div span");
if (text.innerText.replace(pattern, "").toLowerCase().includes(search) ||
!search) {
list[i].style.display = "block";
} else {
list[i].style.display = "none";
}
}
} }
}; };
@ -846,6 +863,7 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
document.addEventListener("keydown", Logic.keyboardNavListener); document.addEventListener("keydown", Logic.keyboardNavListener);
document.addEventListener("keydown", Logic.shortcutListener); document.addEventListener("keydown", Logic.shortcutListener);
document.addEventListener("input", Logic.filterContainerList);
MozillaVPN.handleContainerList(identities); MozillaVPN.handleContainerList(identities);

View file

@ -158,6 +158,18 @@
</h4> </h4>
</div> </div>
<div class="scrollable identities-list"> <div class="scrollable identities-list">
<div class="searchbar">
<label for="search-terms"
class="hide-label"
data-i18n-message-id="filterInputLabel">
</label>
<input type="text"
id="search-terms"
name="search-terms"
placeholder="Search container name"
data-i18n-attribute="placeholder"
data-i18n-attribute-message-id="filterInputPlaceholder">
</div>
<table class="menu" id="identities-list"> <table class="menu" id="identities-list">
<tr class="menu-item hover-highlight"> <tr class="menu-item hover-highlight">
<td> <td>