wikijs-fork/client/js/pages/content-view.component.js

42 lines
907 B
JavaScript
Raw Normal View History

'use strict'
2017-06-11 21:55:06 +00:00
/* global $ */
2017-04-14 18:15:11 +00:00
import MathJax from 'mathjax'
export default {
name: 'content-view',
data() {
return {}
},
mounted() {
let self = this
$('a.toc-anchor').each((i, elm) => {
let hashText = $(elm).attr('href').slice(1)
$(elm).on('click', (ev) => {
ev.stopImmediatePropagation()
self.$store.dispatch('anchor/open', hashText)
return false
})
})
2017-04-14 18:15:11 +00:00
MathJax.Hub.Config({
jax: ['input/TeX', 'input/MathML', 'output/SVG'],
extensions: ['tex2jax.js', 'mml2jax.js'],
TeX: {
extensions: ['AMSmath.js', 'AMSsymbols.js', 'noErrors.js', 'noUndefined.js']
},
SVG: {
scale: 120,
font: 'STIX-Web'
},
2017-04-15 17:15:23 +00:00
tex2jax: {
preview: 'none'
},
showMathMenu: false,
showProcessingMessages: false,
messageStyle: 'none'
2017-04-14 18:15:11 +00:00
})
2017-04-15 17:15:23 +00:00
MathJax.Hub.Configured()
}
2017-02-09 01:52:37 +00:00
}