mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-26 18:18:51 +01:00
Improve security: HSTS, Force SSL, CSP
This commit is contained in:
@@ -20,5 +20,5 @@
|
||||
//= require codemirror/modes/css
|
||||
//= require codemirror/modes/javascript
|
||||
//= require codemirror/modes/htmlmixed
|
||||
//= require translations
|
||||
//= require_tree .
|
||||
//= require mathjax-config
|
||||
//= require init
|
||||
@@ -1,6 +1,4 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
window.App ||= {}
|
||||
|
||||
cm = null
|
||||
|
||||
@@ -13,8 +11,12 @@ loadCodeMirror = ->
|
||||
mode: "text/html"
|
||||
})
|
||||
|
||||
$(document).on "turbolinks:load", loadCodeMirror
|
||||
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())
|
||||
9
app/assets/javascripts/mathjax-config.js
Normal file
9
app/assets/javascripts/mathjax-config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
window.MathJax = {
|
||||
jax: ["input/TeX", "output/HTML-CSS"],
|
||||
tex2jax: {
|
||||
inlineMath: [ ["$","$"], ["\\(","\\)"] ],
|
||||
displayMath: [ ["$$","$$"], ["\\[","\\]"] ],
|
||||
processEscapes: true
|
||||
},
|
||||
"HTML-CSS": { availableFonts: ["TeX"] }
|
||||
};
|
||||
@@ -1,2 +0,0 @@
|
||||
$(document).on 'turbolinks:load', ->
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
|
||||
@@ -5,18 +5,7 @@
|
||||
<%= favicon_link_tag %>
|
||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
jax: ["input/TeX", "output/HTML-CSS"],
|
||||
tex2jax: {
|
||||
inlineMath: [ ["$","$"], ["\\(","\\)"] ],
|
||||
displayMath: [ ["$$","$$"], ["\\[","\\]"] ],
|
||||
processEscapes: true
|
||||
},
|
||||
"HTML-CSS": { availableFonts: ["TeX"] }
|
||||
});
|
||||
</script>
|
||||
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML' async></script>
|
||||
<%= javascript_include_tag 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML-full,Safe', 'data-turbolinks-track' => true %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user