2017-04-01 21:07:01 +00:00
|
|
|
'use strict'
|
2016-08-30 02:19:47 +00:00
|
|
|
|
2017-04-01 21:07:01 +00:00
|
|
|
import * as ace from 'brace'
|
|
|
|
import 'brace/theme/tomorrow_night'
|
|
|
|
import 'brace/mode/markdown'
|
2017-04-03 03:27:07 +00:00
|
|
|
import pageLoader from '../components/page-loader'
|
2016-08-30 02:19:47 +00:00
|
|
|
|
2017-05-22 01:30:34 +00:00
|
|
|
export default {
|
|
|
|
name: 'source-view',
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
let scEditor = ace.edit('source-display')
|
2017-04-01 21:07:01 +00:00
|
|
|
scEditor.setTheme('ace/theme/tomorrow_night')
|
|
|
|
scEditor.getSession().setMode('ace/mode/markdown')
|
|
|
|
scEditor.setOption('fontSize', '14px')
|
|
|
|
scEditor.setOption('hScrollBarAlwaysVisible', false)
|
|
|
|
scEditor.setOption('wrap', true)
|
|
|
|
scEditor.setReadOnly(true)
|
|
|
|
scEditor.renderer.updateFull()
|
2017-04-03 03:27:07 +00:00
|
|
|
scEditor.renderer.on('afterRender', () => {
|
|
|
|
pageLoader.complete()
|
|
|
|
})
|
2017-04-01 21:07:01 +00:00
|
|
|
}
|
2017-02-09 01:52:37 +00:00
|
|
|
}
|