diff --git a/frontend/package.json b/frontend/package.json
index 4025b0e0..84f83d85 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -24,7 +24,7 @@
"markdown-it-multimd-table": "^3.1.3",
"markdown-it-task-lists": "^2.1.1",
"mime-types": "^2.1.24",
- "monaco-editor": "^0.13.1",
+ "monaco-editor": "^0.17.1",
"normalize.css": "^8.0.1",
"socket.io-client": "^2.2.0",
"transliteration": "^2.1.3",
diff --git a/frontend/public/index.html b/frontend/public/index.html
index 752ef369..86dff2a2 100644
--- a/frontend/public/index.html
+++ b/frontend/public/index.html
@@ -4,6 +4,15 @@
Yank Note
+
diff --git a/frontend/src/components/MonacoEditor.vue b/frontend/src/components/MonacoEditor.vue
index ba2ad82d..d872db94 100644
--- a/frontend/src/components/MonacoEditor.vue
+++ b/frontend/src/components/MonacoEditor.vue
@@ -6,9 +6,6 @@
import dayjs from 'dayjs'
import TurndownService from 'turndown'
-const isElectron = !!(window && window.process && window.process.versions && window.process.versions['electron'])
-const appPath = isElectron && window.require('electron').remote.app.getAppPath().replace(/dist$/, '')
-const pathModule = isElectron && window.require('path')
const keys = {}
export default {
@@ -22,20 +19,14 @@ export default {
}
},
mounted () {
- if (isElectron && !window.amdRequire) {
- const amdLoader = window.require(pathModule.resolve(appPath, 'dist/static/vs/loader.js'))
- window.amdRequire = amdLoader.require
- this.onGotAmdLoader()
+ if (!window.require) {
+ const loaderScript = document.createElement('script')
+ loaderScript.type = 'text/javascript'
+ loaderScript.src = 'vs/loader.js'
+ loaderScript.addEventListener('load', this.onGotAmdLoader)
+ document.body.appendChild(loaderScript)
} else {
- if (!window.require) {
- const loaderScript = document.createElement('script')
- loaderScript.type = 'text/javascript'
- loaderScript.src = 'vs/loader.js'
- loaderScript.addEventListener('load', this.onGotAmdLoader)
- document.body.appendChild(loaderScript)
- } else {
- this.onGotAmdLoader()
- }
+ this.onGotAmdLoader()
}
window.addEventListener('keydown', this.recordKeys, true)
@@ -60,18 +51,7 @@ export default {
}
},
onGotAmdLoader () {
- const xrequire = isElectron ? window.amdRequire : window.require
- if (isElectron) {
- const uriFromPath = path => {
- let pathName = pathModule.resolve(path).replace(/\\/g, '/')
- if (pathName.length > 0 && pathName.charAt(0) !== '/') {
- pathName = '/' + pathName
- }
- return encodeURI('file://' + pathName)
- }
- xrequire.config({ baseUrl: uriFromPath(pathModule.join(appPath, 'dist/static')) })
- }
- xrequire(['vs/editor/editor.main'], () => {
+ window.require(['vs/editor/editor.main'], () => {
this.initMonaco()
})
},
diff --git a/frontend/src/components/TitleBar.vue b/frontend/src/components/TitleBar.vue
index 80001d88..8ea7bd80 100644
--- a/frontend/src/components/TitleBar.vue
+++ b/frontend/src/components/TitleBar.vue
@@ -6,8 +6,9 @@