view.js 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use strict'
  2. /* eslint-disable no-new */
  3. import $ from 'jquery'
  4. import MathJax from 'mathjax'
  5. module.exports = (alerts) => {
  6. if ($('#page-type-view').length) {
  7. let currentBasePath = ($('#page-type-view').data('entrypath') !== 'home') ? $('#page-type-view').data('entrypath') : ''
  8. // Copy Path
  9. // new Vue({
  10. // el: '.modal-copypath',
  11. // render: h => h(CopyPath)
  12. // })
  13. // MathJax Render
  14. MathJax.Hub.Config({
  15. jax: ['input/TeX', 'input/MathML', 'output/SVG'],
  16. extensions: ['tex2jax.js', 'mml2jax.js'],
  17. TeX: {
  18. extensions: ['AMSmath.js', 'AMSsymbols.js', 'noErrors.js', 'noUndefined.js']
  19. },
  20. SVG: {
  21. scale: 120,
  22. font: 'STIX-Web'
  23. },
  24. tex2jax: {
  25. preview: 'none'
  26. },
  27. showMathMenu: false,
  28. showProcessingMessages: false,
  29. messageStyle: 'none'
  30. })
  31. MathJax.Hub.Configured()
  32. require('../modals/create.js')(currentBasePath)
  33. require('../modals/move.js')(currentBasePath, alerts)
  34. }
  35. }