{% load staticfiles %}
<link rel="stylesheet" media="screen, projection" href="{% static 'codemirror2/addon/display/fullscreen.css' %}" />
<link rel="stylesheet" media="screen, projection" href="{% static 'codemirror2/theme/blackboard.css' %}" />
<script src="{% static 'codemirror2/addon/display/fullscreen.js' %}"></script>
<!-- script src="{% static 'codemirror2/addon/search/match-highlighter.js' %}"></script -->
<script src="{% static 'codemirror2/addon/search/searchcursor.js' %}"></script>
<script src="{% static 'codemirror2/addon/selection/active-line.js' %}"></script>
<script src="{% static 'codemirror2/keymap/vim.js' %}"></script>
<script src="{% static 'codemirror2/addon/edit/closetag.js' %}"></script>
<script src="{% static 'codemirror2/addon/fold/xml-fold.js' %}"></script>
<script type="text/javascript">
    (function() {
        var elem = document.getElementById("id_{{ name }}");
        elmirror = CodeMirror.fromTextArea(elem, {{ options|safe }});
    })();
	elmirror.setSize(1130, 510);
	var path = window.location.href;
	hist = path.split('/');
	cfs = true;
	for (i=0;i<hist.length;i++) {
		if (hist[i] === "history") {
			cfs = false;
			break
		}
	}
	if (cfs === true) {
		elmirror.setOption("fullScreen", true);
	}
	var codemode = true;
</script>
