diff --git a/static/js/bin.js b/static/js/bin.js old mode 100755 new mode 100644 index 4d26afc..b610083 --- a/static/js/bin.js +++ b/static/js/bin.js @@ -14,6 +14,11 @@ function init() { navlist.insertBefore(editA, navlist.firstChild); navlist.insertBefore(separator, navlist.children[1]); + var lang = document.getElementById('editor').getAttribute('data-lang'); + var editor = ace.edit("editor"); + editor.getSession().setMode("ace/mode/" + lang); + editor.setTheme("ace/theme/tomorrow"); + } @@ -25,7 +30,7 @@ function edit() { var normalcontent = document.getElementById("normal-content"); normalcontent.removeChild(document.getElementById("normal-code")); - + var editordiv = document.getElementById("editor"); editordiv.style.display = "block"; diff --git a/static/js/bin_hljs.js b/static/js/bin_hljs.js new file mode 100644 index 0000000..ff8ef6e --- /dev/null +++ b/static/js/bin_hljs.js @@ -0,0 +1,2 @@ +hljs.tabReplace = ' '; +hljs.initHighlightingOnLoad(); diff --git a/templates/display/bin.html b/templates/display/bin.html index 433cbb2..9c77584 100644 --- a/templates/display/bin.html +++ b/templates/display/bin.html @@ -46,25 +46,16 @@ {% block main %}
{{ extra.contents }}
-
+ {{ extra.contents }}
+