Расширение «Моё время в Битрикс24»
Часы по задачам за месяц и остаток до нормы, через REST от сессии браузера. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const portal = document.getElementById('portal');
|
||||
const norm = document.getElementById('norm');
|
||||
const status = document.getElementById('status');
|
||||
|
||||
chrome.storage.sync.get({ portal: '', norm: 0 }, cfg => {
|
||||
portal.value = cfg.portal;
|
||||
norm.value = cfg.norm || '';
|
||||
});
|
||||
|
||||
document.getElementById('save').onclick = async () => {
|
||||
let p = portal.value.trim();
|
||||
if (p) {
|
||||
try {
|
||||
p = new URL(p.includes('://') ? p : 'https://' + p).origin + '/';
|
||||
} catch {
|
||||
status.textContent = 'Адрес портала не похож на адрес';
|
||||
return;
|
||||
}
|
||||
}
|
||||
await chrome.storage.sync.set({ portal: p, norm: Math.max(0, Number(norm.value) || 0) });
|
||||
portal.value = p;
|
||||
status.textContent = 'Сохранено';
|
||||
};
|
||||
Reference in New Issue
Block a user