From a85a9e152ac9063ed85ba8c1b852d407e5aaed50 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Sat, 11 Oct 2014 22:52:18 -0500 Subject: [PATCH] Implement code window resizing --- TODO | 2 -- course/templates/course/flow-page.html | 15 +++++++++++++++ courseflow/settings.py | 1 + courseflow/templates/base.html | 4 +++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 00137135..cd2c8ac4 100644 --- a/TODO +++ b/TODO @@ -13,8 +13,6 @@ - flow overview -- code window resize - - escape student answers in analytics Ideas diff --git a/course/templates/course/flow-page.html b/course/templates/course/flow-page.html index 0507d730..dec94354 100644 --- a/course/templates/course/flow-page.html +++ b/course/templates/course/flow-page.html @@ -231,6 +231,21 @@ {# }}} #} + <script type="text/javascript"> + $("div.CodeMirror") + .resizable({ + resize: function (event, ui) + { + $("div.CodeMirror").each( + function () + { + var cm = this.CodeMirror; + cm.refresh(); + }); + } + }); + </script> + {% endblock %} {# vim: set foldmethod=marker: #} diff --git a/courseflow/settings.py b/courseflow/settings.py index 8c70bf78..17e0ecd7 100644 --- a/courseflow/settings.py +++ b/courseflow/settings.py @@ -89,6 +89,7 @@ BOWER_INSTALLED_APPS = ( "MathJax", "codemirror", "fullcalendar", + "jqueryui", ) CODEMIRROR_PATH = "codemirror" diff --git a/courseflow/templates/base.html b/courseflow/templates/base.html index 4d2a76e8..72878de8 100644 --- a/courseflow/templates/base.html +++ b/courseflow/templates/base.html @@ -14,13 +14,15 @@ <title>{%block title %}CourseFlow{% endblock %}</title> <link href="{% static "bootstrap/dist/css/bootstrap.css" %}" rel="stylesheet"> + <link href="{% static "jqueryui/themes/smoothness/jquery-ui.css" %}" rel="stylesheet"> - <link rel="stylesheet" href="/static/css/style.css" > <link rel="stylesheet" href="{% static "fontawesome/css/font-awesome.css" %}"> + <link rel="stylesheet" href="/static/css/style.css" > {# Don't be tempted to move all this JS stuff down to the end. #} {# The datepicker generates inline JS that relies on this being loaded. #} <script src="{% static "jquery/dist/jquery.js" %}"></script> + <script src="{% static "jqueryui/jquery-ui.js" %}"></script> <script src="{% static "bootstrap/dist/js/bootstrap.js" %}"></script> {%block header_extra %}{% endblock %} -- GitLab