diff --git a/src/App.vue b/src/App.vue index 4df7c3d..b97e975 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,7 +10,7 @@ :height="510" :width="425" :start-x="50" - :start-y="150" + :start-y="150" :actions="['close']" content-class="bg-gunmetal-light text-accent advSearchWindow" > @@ -205,11 +205,28 @@ export default class App extends BaseClass { * Open wysiwyg links in default browser window */ openWysiwygLink (event: MouseEvent) { + event.preventDefault() // @ts-ignore // eslint-disable-next-line @typescript-eslint/no-unsafe-call if (event.target && event.target.tagName.toLowerCase() === "a" && event.target.closest(".fieldWysiwyg")) { + const isValidHttpUrl = (string:string) => { + let url + + try { + url = new URL(string) + } + catch (_) { + return false + } + + return url.protocol === "http:" || url.protocol === "https:" + } + // @ts-ignore - shell.openExternal(event.target.href).catch(e => console.log(e)) + if (isValidHttpUrl(event.target.href)) { + // @ts-ignore + shell.openExternal(event.target.href).catch(e => console.log(e)) + } } } diff --git a/src/components/DocumentControl.vue b/src/components/DocumentControl.vue index d738273..3df41ba 100644 --- a/src/components/DocumentControl.vue +++ b/src/components/DocumentControl.vue @@ -368,12 +368,16 @@ export default class DocumentControl extends BaseClass { // Save document - CTRL + S if (this.determineKeyBind("saveDocument") && !this.currentyEditable && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState && this.$route.path !== "/project") { - this.saveCurrentDocument(false).catch(e => console.log(e)) + setTimeout(() => { + this.saveCurrentDocument(false).catch(e => console.log(e)) + }, 500) } // Save document without exiting edit mode - CTRL + ALT + S if (this.determineKeyBind("saveDocumentNoExit") && !this.currentyEditable && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState && this.$route.path !== "/project") { - this.saveCurrentDocument(true).catch(e => console.log(e)) + setTimeout(() => { + this.saveCurrentDocument(true).catch(e => console.log(e)) + }, 500) } // Add new under parent - CTRL + SHIFT + N diff --git a/src/components/fields/Field_MultiRelationship.vue b/src/components/fields/Field_MultiRelationship.vue index c01ed5d..01c158a 100644 --- a/src/components/fields/Field_MultiRelationship.vue +++ b/src/components/fields/Field_MultiRelationship.vue @@ -153,7 +153,7 @@ input-debounce="500" v-model="localInput" @filter="filterSelect" - @input="processInput()" + @input="processInput" >