-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 🔨 editor HTML, citation page and links, fonts
- Loading branch information
1 parent
a62f889
commit eb262a0
Showing
16 changed files
with
427 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,10 @@ useHead({ | |
rel: "stylesheet", | ||
href: "https://fonts.googleapis.com/css2?family=Quicksand:[email protected]&display=swap", | ||
}, | ||
{ | ||
rel: "stylesheet", | ||
href: "https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap", | ||
}, | ||
{ | ||
src: "https://code.jquery.com/jquery-3.3.1.slim.min.js", | ||
integrity: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div id="CM-WP" class="text-left"></div> | ||
</template> | ||
|
||
<script> | ||
import { basicSetup, EditorView } from "codemirror"; | ||
import { EditorState } from "@codemirror/state"; | ||
import { html } from "@codemirror/lang-html"; | ||
import { keymap } from "@codemirror/view"; | ||
import { defaultKeymap } from "@codemirror/commands"; | ||
export default { | ||
name: "CodeEditorHTML", | ||
props: ["item"], | ||
data: function () { | ||
return { | ||
editor: null, | ||
}; | ||
}, | ||
methods: { | ||
openEditor() { | ||
let self = this; | ||
let state = EditorState.create({ | ||
doc: self.item, | ||
extensions: [basicSetup, html(), keymap.of(defaultKeymap)], | ||
}); | ||
this.editor = new EditorView({ | ||
state, | ||
parent: document.body.querySelector("#CM-WP"), | ||
}); | ||
this.$store.commit("setLoading", { value: false }); | ||
}, | ||
}, | ||
watch: { | ||
item: function (v) { | ||
if (this.editor) { | ||
this.editor.dispatch({ | ||
changes: { | ||
from: 0, | ||
to: this.editor.state.doc.length, | ||
insert: JSON.stringify(v, null, 2), | ||
}, | ||
}); | ||
} | ||
}, | ||
}, | ||
mounted: function () { | ||
this.$store.commit("setLoading", { value: true }); | ||
setTimeout(() => { | ||
this.openEditor(); | ||
}, 1000); | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
#CM-WP > .cm-editor { | ||
height: 100vh; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.