Add debug functions to the options page and fix linter warnings
parent
ab6b0186ee
commit
335bc6ee2c
|
|
@ -12,8 +12,12 @@ export function refreshTagCategoryColorMap(tagCategories: TagCategoryColor[], st
|
|||
document.head.appendChild(styleElement);
|
||||
for (const category of tagCategories) {
|
||||
const ruleName = makeCssName("tag", category.name);
|
||||
styleElement.sheet!.insertRule(`.${ruleName} { color: ${category.color} }`, styleElement.sheet!.cssRules.length);
|
||||
console.log("adding " + category);
|
||||
|
||||
if (styleElement.sheet) {
|
||||
styleElement.sheet.insertRule(`.${ruleName} { color: ${category.color} }`, styleElement.sheet.cssRules.length);
|
||||
} else {
|
||||
console.error("styleElement.sheet is undefined. This should never happen!");
|
||||
}
|
||||
}
|
||||
return styleElement;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,11 @@ function resetTagCategories() {
|
|||
function addTagCategory() {
|
||||
cfg.value.tagCategories.push(new TagCategoryColor("category", "#abcdef"));
|
||||
}
|
||||
|
||||
// For debugging
|
||||
const wnd = window as any;
|
||||
wnd.szc_get_config = () => JSON.parse(JSON.stringify(cfg.value));
|
||||
wnd.szc_set_config_version = (v = 0) => (cfg.value.version = v);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue