Created convention file for frontend and adjusted current project files (#277)

Reviewed-on: #277
Reviewed-by: Mikolaj Widla <widlam@noreply.example.com>
Co-authored-by: Adam Bem <adam.bem@zoho.eu>
Co-committed-by: Adam Bem <adam.bem@zoho.eu>
This commit is contained in:
2024-01-04 08:17:44 +01:00
committed by Adam Bem
parent 307e732608
commit ea83e95a00
16 changed files with 97 additions and 85 deletions

View File

@@ -7,12 +7,6 @@ import {xml} from '@codemirror/lang-xml'
import {json} from '@codemirror/lang-json'
import {html} from '@codemirror/lang-html'
function isDarkModeSet(){
return localStorage.theme == "dark";
}
const theme : string = inject('theme')! ;
const props= defineProps({
code : {
type: String,
@@ -30,21 +24,25 @@ const emit = defineEmits(
]
)
const theme : string = inject('theme')!;
let extensions = parseExtensions();
onBeforeUpdate( () => { extensions = parseExtensions(); } )
function dataUpdated(newData:String){
emit('update:updatedCode',newData)
}
function selectTheme() {
if (isDarkModeSet()) {
if (isDarkModeSet())
return oneDark;
}
else {
else
return espresso;
}
}
let extensions = parseExtensions();
function isDarkModeSet(){
return localStorage.theme == "dark";
}
function parseExtensions(){
return [
@@ -68,7 +66,7 @@ function parseLanguage(name: String){
}
onBeforeUpdate( () => { extensions = parseExtensions(); } )
</script>