refactor: clean up code structure in multiple files
This commit is contained in:
parent
3e85a88bd3
commit
99027e6315
4 changed files with 18 additions and 22 deletions
|
|
@ -218,13 +218,12 @@ function saveOptions(e) {
|
||||||
case 'password':
|
case 'password':
|
||||||
options[element.id] = element.value.trim();
|
options[element.id] = element.value.trim();
|
||||||
break;
|
break;
|
||||||
default:
|
case 'select-one':
|
||||||
if (element.tagName === 'SELECT') {
|
|
||||||
options[element.id] = element.value;
|
options[element.id] = element.value;
|
||||||
}else{
|
break;
|
||||||
|
default:
|
||||||
console.error("[ThunderAI] Unhandled input type:", element.type);
|
console.error("[ThunderAI] Unhandled input type:", element.type);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
browser.storage.sync.set(options);
|
browser.storage.sync.set(options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,13 +97,12 @@ function saveOptions(e) {
|
||||||
case 'password':
|
case 'password':
|
||||||
options[element.id] = element.value.trim();
|
options[element.id] = element.value.trim();
|
||||||
break;
|
break;
|
||||||
default:
|
case 'select-one':
|
||||||
if (element.tagName === 'SELECT') {
|
|
||||||
options[element.id] = element.value;
|
options[element.id] = element.value;
|
||||||
}else{
|
break;
|
||||||
|
default:
|
||||||
console.error("[ThunderAI] Unhandled input type:", element.type);
|
console.error("[ThunderAI] Unhandled input type:", element.type);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
browser.storage.sync.set(options);
|
browser.storage.sync.set(options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,13 +97,12 @@ function saveOptions(e) {
|
||||||
case 'password':
|
case 'password':
|
||||||
options[element.id] = element.value.trim();
|
options[element.id] = element.value.trim();
|
||||||
break;
|
break;
|
||||||
default:
|
case 'select-one':
|
||||||
if (element.tagName === 'SELECT') {
|
|
||||||
options[element.id] = element.value;
|
options[element.id] = element.value;
|
||||||
}else{
|
break;
|
||||||
|
default:
|
||||||
console.error("[ThunderAI] Unhandled input type:", element.type);
|
console.error("[ThunderAI] Unhandled input type:", element.type);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
browser.storage.sync.set(options);
|
browser.storage.sync.set(options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,13 +210,12 @@ function saveOptions(e) {
|
||||||
case 'password':
|
case 'password':
|
||||||
options[element.id] = element.value.trim();
|
options[element.id] = element.value.trim();
|
||||||
break;
|
break;
|
||||||
default:
|
case 'select-one':
|
||||||
if (element.tagName === 'SELECT') {
|
|
||||||
options[element.id] = element.value;
|
options[element.id] = element.value;
|
||||||
}else{
|
break;
|
||||||
|
default:
|
||||||
console.error("[ThunderAI] Unhandled input type:", element.type);
|
console.error("[ThunderAI] Unhandled input type:", element.type);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
browser.storage.sync.set(options);
|
browser.storage.sync.set(options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue