feat(fillbar): onglet Fill bar dans les reglages, icones ou texte, boutons Add et Search
- boutons choisis (Full, Password, 2FA, Add current window, Search, Open), style icones (Segoe MDL2 Assets) ou texte, opacite au repos, allumee ou non - clic droit sur la barrette : Show icons / Show text en plus de l'opacite - info-bulles sur chaque bouton - Add et Search reprennent les corps extraits de Ctrl+Shift+A et Ctrl+Shift+Q Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -6696,7 +6696,33 @@ function revealSyncSettings() {
|
||||
}, 0);
|
||||
}
|
||||
|
||||
// BARRETTE (Fill bar). Ses reglages vivent en prefs DPAPI cote Delphi, pas dans
|
||||
// settings_json : elle s'allume coffre ferme, sans session. La page ne fait que
|
||||
// les lire (fillbar/get) et les renvoyer tous ensemble a chaque changement.
|
||||
function fillBarRequest() {
|
||||
if (Bridge.active) window.location.href = 'cmd://fillbar/get';
|
||||
}
|
||||
Bridge.onFillBar = function (st) {
|
||||
const keys = (st.buttons || 'full,pwd,totp,add,search,open').split(',');
|
||||
$('#fbOn').checked = !!st.on;
|
||||
$$('.fb-btn').forEach(c => { c.checked = keys.includes(c.dataset.key); });
|
||||
$('#fbStyle').value = st.icons ? 'icons' : 'text';
|
||||
$('#fbAlpha').value = String(parseInt(st.alpha, 10) || 60);
|
||||
};
|
||||
function fillBarPush() {
|
||||
const keys = Array.from($$('.fb-btn')).filter(c => c.checked).map(c => c.dataset.key);
|
||||
window.location.href = 'cmd://fillbar/set'
|
||||
+ '?on=' + ($('#fbOn').checked ? '1' : '0')
|
||||
+ '&buttons=' + encodeURIComponent(keys.join(',') || 'none')
|
||||
+ '&icons=' + ($('#fbStyle').value === 'icons' ? '1' : '0')
|
||||
+ '&alpha=' + encodeURIComponent($('#fbAlpha').value);
|
||||
}
|
||||
|
||||
function openSettings() {
|
||||
// Hors de l'exe (navigateur de dev) il n'y a pas de barrette.
|
||||
$('#fillbarSection').style.display = Bridge.active ? '' : 'none';
|
||||
$('#settingsTabFillbar').style.display = Bridge.active ? '' : 'none';
|
||||
fillBarRequest();
|
||||
$('#settingTheme').value = state.theme;
|
||||
$('#settingSort').value = state.sortBy + ':' + state.sortDir;
|
||||
$('#settingAutoLock').value = String(state.autoLock);
|
||||
@@ -6819,6 +6845,7 @@ const SETTINGS_TAB_OF = {
|
||||
'Appearance': 'general',
|
||||
'Security': 'security', 'Clipboard privacy': 'security',
|
||||
'Autofill': 'autofill',
|
||||
'Fill bar': 'fillbar',
|
||||
'Account': 'account',
|
||||
'PIN unlock': 'account', 'Quick unlock': 'account', 'Recovery key': 'account',
|
||||
'Export': 'sync', 'Sync (WebDAV or Gitea)': 'sync',
|
||||
@@ -8193,6 +8220,11 @@ async function init() {
|
||||
if (syncTest) syncTest.addEventListener('click', syncTestConnection);
|
||||
const syncQr = document.getElementById('syncQrBtn');
|
||||
if (syncQr) syncQr.addEventListener('click', syncQrToggle);
|
||||
['#fbOn', '#fbStyle', '#fbAlpha'].forEach(sel => {
|
||||
const el = $(sel);
|
||||
if (el) el.addEventListener('change', fillBarPush);
|
||||
});
|
||||
$$('.fb-btn').forEach(c => c.addEventListener('change', fillBarPush));
|
||||
// Guard the user entry point: ignore clicks while a sync is running (no
|
||||
// concurrent syncs) and call runSyncNow() with NO arg — the click event
|
||||
// must not land in its `_attempt` retry counter. Internal retries call
|
||||
|
||||
Reference in New Issue
Block a user