You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

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