mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #708 from sharelatex/jel-mathjax
MathJax - library path, directive, and use `Safe` extension
This commit is contained in:
commit
64a257dae2
4 changed files with 9 additions and 3 deletions
|
@ -167,6 +167,11 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
|
||||||
path = Path.join("/img/", imgFile)
|
path = Path.join("/img/", imgFile)
|
||||||
return Url.resolve(staticFilesBase, path)
|
return Url.resolve(staticFilesBase, path)
|
||||||
|
|
||||||
|
res.locals.mathJaxPath = res.locals.buildJsPath(
|
||||||
|
'libs/mathjax/MathJax.js',
|
||||||
|
{cdn:false, qs:{config:'TeX-AMS_HTML'}}
|
||||||
|
)
|
||||||
|
|
||||||
next()
|
next()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,8 @@ block content
|
||||||
h3 {{ title }}
|
h3 {{ title }}
|
||||||
.modal-body(ng-bind-html="message")
|
.modal-body(ng-bind-html="message")
|
||||||
|
|
||||||
|
script(src=mathJaxPath)
|
||||||
|
|
||||||
block requirejs
|
block requirejs
|
||||||
script(type="text/javascript" src='/socket.io/socket.io.js')
|
script(type="text/javascript" src='/socket.io/socket.io.js')
|
||||||
|
|
||||||
|
@ -133,7 +135,6 @@ block requirejs
|
||||||
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
|
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
|
||||||
window.requirejs = {
|
window.requirejs = {
|
||||||
"paths" : {
|
"paths" : {
|
||||||
"mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {cdn:false, qs:{config:'TeX-AMS_HTML'}})}",
|
|
||||||
"moment": "libs/#{lib('moment')}",
|
"moment": "libs/#{lib('moment')}",
|
||||||
"pdfjs-dist/build/pdf": "libs/#{lib('pdfjs')}/pdf",
|
"pdfjs-dist/build/pdf": "libs/#{lib('pdfjs')}/pdf",
|
||||||
"pdfjs-dist/build/pdf.worker": "#{pdfWorkerPath}",
|
"pdfjs-dist/build/pdf.worker": "#{pdfWorkerPath}",
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
define [
|
define [
|
||||||
"base"
|
"base"
|
||||||
"mathjax"
|
|
||||||
], (App) ->
|
], (App) ->
|
||||||
mathjaxConfig =
|
mathjaxConfig =
|
||||||
|
extensions: ["Safe.js"]
|
||||||
messageStyle: "none"
|
messageStyle: "none"
|
||||||
imageFont:null
|
imageFont:null
|
||||||
"HTML-CSS": { availableFonts: ["TeX"] },
|
"HTML-CSS": { availableFonts: ["TeX"] },
|
|
@ -2,6 +2,6 @@ define [
|
||||||
"ide/chat/controllers/ChatButtonController"
|
"ide/chat/controllers/ChatButtonController"
|
||||||
"ide/chat/controllers/ChatController"
|
"ide/chat/controllers/ChatController"
|
||||||
"ide/chat/controllers/ChatMessageController"
|
"ide/chat/controllers/ChatMessageController"
|
||||||
"ide/chat/directives/mathjax"
|
"directives/mathjax"
|
||||||
"filters/wrapLongWords"
|
"filters/wrapLongWords"
|
||||||
], () ->
|
], () ->
|
Loading…
Reference in a new issue