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:
23
app/assets/javascripts/init.coffee
Normal file
23
app/assets/javascripts/init.coffee
Normal 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]);
|
||||
Reference in New Issue
Block a user