1
0
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:
2019-03-17 10:55:09 +01:00
parent 51f985830a
commit a5dc6c2532
8 changed files with 34 additions and 31 deletions

View File

@@ -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

View File

@@ -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())

View File

@@ -0,0 +1,9 @@
window.MathJax = {
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ["$","$"], ["\\(","\\)"] ],
displayMath: [ ["$$","$$"], ["\\[","\\]"] ],
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
};

View File

@@ -1,2 +0,0 @@
$(document).on 'turbolinks:load', ->
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

View File

@@ -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>