<div v-else class="note flex-grow-1">
<editor
:initialValue="initialContent"
- initialEditType="markdown"
+ :initialEditType="loadDefaultEditorMode()"
previewStyle="tab"
ref="toastUiEditor"
:options="editorOptions"
}
},
+ saveDefaultEditorMode: function () {
+ let isWysiwygMode = this.$refs.toastUiEditor.invoke("isWysiwygMode");
+ localStorage.setItem(
+ "defaultEditorMode",
+ isWysiwygMode ? "wysiwyg" : "markdown"
+ );
+ },
+
+ loadDefaultEditorMode: function () {
+ let defaultWysiwygMode = localStorage.getItem("defaultEditorMode");
+ if (defaultWysiwygMode) {
+ return defaultWysiwygMode;
+ } else {
+ return "markdown";
+ }
+ },
+
clearDraftSaveTimeout: function () {
if (this.draftSaveTimeout != null) {
clearTimeout(this.draftSaveTimeout);
let parent = this;
let newContent = this.getEditorContent();
+ this.saveDefaultEditorMode();
+
// Title Validation
if (typeof this.titleInput == "string") {
this.titleInput = this.titleInput.trim();
const reservedCharacters = /[<>:"/\\|?*]/;
if (reservedCharacters.test(this.titleInput)) {
this.$bvToast.toast(
- "Due to filename restrictions, the following characters are not allowed in a note title: <>:\"/\\|?*",
+ 'Due to filename restrictions, the following characters are not allowed in a note title: <>:"/\\|?*',
{
variant: "danger",
noCloseButton: true,