1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2026-01-27 02:28:50 +01:00

Improve security: HSTS, Force SSL, CSP

This commit is contained in:
2019-03-17 10:55:09 +01:00
parent 51f985830a
commit a5dc6c2532
8 changed files with 34 additions and 31 deletions

View File

@@ -0,0 +1,23 @@
window.App ||= {}
cm = null
loadCodeMirror = ->
$('#translationNav li:first').addClass('active')
$("textarea").each ->
cm = CodeMirror.fromTextArea($(this).get(0), {
lineNumbers: false,
lineWrapping: true,
mode: "text/html"
})
App.init = ->
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
loadCodeMirror();
$(document).on "turbolinks:load", ->
App.init()
$(document).on "click", '#translationNav a[href="#preview"]', ->
$('#preview .problem-content').html(cm.getValue())
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);