diff --git a/BUGS.md b/BUGS.md index 8843348..1d4521b 100644 --- a/BUGS.md +++ b/BUGS.md @@ -59,6 +59,7 @@ ou usar push (websockets?) # FIXED +- textarea com codemirror - decorador para user 0, evita o "if uid==0" em muitas funcoes. - numeric interval deve converter respostas que usam virgulas para pontos decimais - self.testapp.get_json_filename_of_test(test_id) retorna None quando test_id nao existe. diff --git a/static/codemirror b/static/codemirror new file mode 120000 index 0000000..cd50a8c --- /dev/null +++ b/static/codemirror @@ -0,0 +1 @@ +libs/codemirror-5.40.2/ \ No newline at end of file diff --git a/static/css/test.css b/static/css/test.css index 7ff17ef..ad56d4f 100644 --- a/static/css/test.css +++ b/static/css/test.css @@ -24,4 +24,9 @@ textarea { } .noleftmargin { margin-left: 0px; -} \ No newline at end of file +} + +.CodeMirror { + border: 1px solid #eee; + height: auto; +} diff --git a/static/js/tabkey_in_textarea.js b/static/js/tabkey_in_textarea.js deleted file mode 100644 index 6b984ec..0000000 --- a/static/js/tabkey_in_textarea.js +++ /dev/null @@ -1,18 +0,0 @@ -$(document).ready(function() { - - $("textarea").keydown(function(e) { - if(e.keyCode === 9) { // tab was pressed - // get caret position/selection - var start = this.selectionStart; - var end = this.selectionEnd; - var value = $(this).val(); - - // set textarea value to: text before caret + tab + text after caret - $(this).val(value.substring(0, start) + " " + value.substring(end)); - - // put caret at right position again (add one for the tab) - this.selectionStart = this.selectionEnd = start + 4; - e.preventDefault(); // prevent the focus lose - } - }); -}); diff --git a/templates/question-textarea.html b/templates/question-textarea.html index dfde40c..6e26e91 100644 --- a/templates/question-textarea.html +++ b/templates/question-textarea.html @@ -1,5 +1,7 @@ {% extends "question.html" %} {% block answer %} +
+ {% end %} diff --git a/templates/test.html b/templates/test.html index 1dc0c37..61661e5 100644 --- a/templates/test.html +++ b/templates/test.html @@ -16,22 +16,26 @@ - - - - - - + + + + + + + + + + + - @@ -126,5 +130,18 @@ + + + -- libgit2 0.21.2