-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ca616c
commit 5d8bb6f
Showing
7 changed files
with
108 additions
and
34 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
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
// const { resolve } = require('path') | ||
const { resolve } = require('path') | ||
|
||
module.exports = async function module (moduleOptions) { | ||
// const options = Object.assign({}, moduleOptions) | ||
const options = Object.assign({}, moduleOptions) | ||
|
||
// this.addPlugin({ | ||
// src: resolve(__dirname, 'templates/plugin.js'), | ||
// fileName: 'ace-editor-module.js', | ||
// options | ||
// }) | ||
// Options should allow specifying default theme/mode and a CDN | ||
|
||
this.addPlugin({ | ||
src: resolve(__dirname, 'templates/plugin.js'), | ||
fileName: 'ace-editor-module.js', | ||
options, | ||
ssr: false, | ||
}) | ||
} | ||
|
||
module.exports.meta = require('../package.json') |
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 |
---|---|---|
@@ -1,4 +1,20 @@ | ||
export default async function ({ router, store }) { | ||
|
||
// Automatically adds 'ace' to globals | ||
import ace from 'ace-builds/src-min-noconflict/ace' | ||
import 'ace-builds/src-min-noconflict/ext-searchbox' | ||
import 'ace-builds/src-min-noconflict/ext-settings_menu' | ||
// import 'ace-builds/src-min-noconflict/ext-language_tools' | ||
|
||
import 'ace-builds/src-min-noconflict/mode-javascript' // Import GCode Syntax Highlighting mode | ||
import 'ace-builds/src-min-noconflict/theme-chrome' // Import Ace Themes | ||
|
||
|
||
export default async function ({ router, store }) { | ||
const useCDN = true; | ||
const CDN = 'https://cdn.jsdelivr.net/npm/ace-builds@1.4.1/src-min-noconflict'; | ||
if (useCDN) { | ||
ace.config.set('basePath', CDN); | ||
ace.config.set('modePath', CDN); | ||
ace.config.set('themePath', CDN); | ||
ace.config.set('workerPath', CDN); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,39 @@ | ||
<template> | ||
<div> | ||
Works! | ||
<div style=" width: 80%; margin: auto;"> | ||
<div>Plugin Module Works!</div> | ||
<div id="ace" style="height: 200px; width: 100%; border: solid 1px rgba(0,0,0,.3);"></div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
export default { | ||
mounted() { | ||
const editor = ace.edit('ace'); | ||
} | ||
</script> | ||
editor.setOptions({ | ||
theme: 'ace/theme/chrome', | ||
mode: 'ace/mode/javascript', | ||
printMargin: false, | ||
vScrollBarAlwaysVisible: true, | ||
scrollPastEnd: 1, | ||
fontSize: 12, | ||
}); | ||
editor.setValue( | ||
` export default { | ||
mounted() { | ||
const editor = ace.edit('ace'); | ||
editor.setOptions({ | ||
theme: 'ace/theme/chrome', | ||
mode: 'ace/mode/javascript', | ||
printMargin: false, | ||
vScrollBarAlwaysVisible: true, | ||
scrollPastEnd: 1, | ||
fontSize: 12, | ||
}); | ||
editor.setValue(\`\`, -1); | ||
} | ||
}`, -1); | ||
} | ||
} | ||
</script> |