mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 00:16:51 +00:00
Add toggle to disable brace editor
This commit is contained in:
@@ -9,6 +9,7 @@ export namespace Store {
|
||||
export const ID_VERSION = 'schema_version'
|
||||
export const ID_INDENT = 'indentation'
|
||||
export const ID_FORMAT = 'output_format'
|
||||
export const ID_HIGHLIGHTING = 'output_highlighting'
|
||||
export const ID_SOUNDS_VERSION = 'minecraft_sounds_version'
|
||||
export const ID_PROJECTS = 'misode_projects'
|
||||
|
||||
@@ -37,6 +38,10 @@ export namespace Store {
|
||||
return localStorage.getItem(ID_FORMAT) ?? 'json'
|
||||
}
|
||||
|
||||
export function getHighlighting() {
|
||||
return localStorage.getItem(ID_HIGHLIGHTING) !== 'false'
|
||||
}
|
||||
|
||||
export function getSoundsVersion() {
|
||||
return localStorage.getItem(ID_SOUNDS_VERSION) ?? 'latest'
|
||||
}
|
||||
@@ -69,6 +74,10 @@ export namespace Store {
|
||||
if (format) localStorage.setItem(ID_FORMAT, format)
|
||||
}
|
||||
|
||||
export function setHighlighting(highlighting: boolean | undefined) {
|
||||
if (highlighting !== undefined) localStorage.setItem(ID_HIGHLIGHTING, highlighting.toString())
|
||||
}
|
||||
|
||||
export function setSoundsVersion(version: string | undefined) {
|
||||
if (version) localStorage.setItem(ID_SOUNDS_VERSION, version)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user