summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMarko Pušnik <marko.pusnik@guru.si>2015-09-29 13:12:20 +0200
committerMarko Pušnik <marko.pusnik@guru.si>2015-09-29 13:12:20 +0200
commit99961c6b5d72f516061e4f8b3dc31e3fccc827ee (patch)
treeaa91e050ba1e4e05f7d43258ac958293c4929933 /js
parent68847b98e7b7804656e2abe09190a1b3553dbfc7 (diff)
parenta2c468392673e55425fda9a5a331b86935b07781 (diff)
Merge branch 'master' of odie.guru.si:codeq-web
Diffstat (limited to 'js')
-rw-r--r--js/codeq/prolog.js2
-rw-r--r--js/codeq/python.js17
2 files changed, 16 insertions, 3 deletions
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js
index d827139..640aa99 100644
--- a/js/codeq/prolog.js
+++ b/js/codeq/prolog.js
@@ -272,7 +272,7 @@
if (currentSolution) editor.setValue(currentSolution);
// $('#screen_prolog .title').text(problem.slug);
// jqDescriptionContent.html(problem.description);
- jqBtnPlan.prop('disabled', ((problemDef.plan && problemDef.plan.en) || []).length == 0);
+ jqBtnPlan.prop('disabled', ((problemDef.plan && problemDef.plan.sl) || []).length == 0);
editor.on('change', function (instance, changeObj) {
var doc = editor.getDoc(),
diff --git a/js/codeq/python.js b/js/codeq/python.js
index cf2199a..4724982 100644
--- a/js/codeq/python.js
+++ b/js/codeq/python.js
@@ -217,7 +217,20 @@
jqEditor = jqCode.find('.code_editor'),
jqTerminal = jqConsole.find('.console'),
jqHints = jqInfo.find('.hints'),
- editor = CodeMirror(jqEditor[0], { cursorHeight: 0.85, lineNumbers: true, matchBrackets: true, mode: 'python' }),
+ editor = CodeMirror(jqEditor[0], {
+ cursorHeight: 0.85,
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: 'python',
+ indentUnit: 4,
+ extraKeys: {
+ // replace tabs with spaces
+ Tab: function (cm) {
+ var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
+ cm.replaceSelection(spaces);
+ }
+ }
+ }),
activityHandler = makeActivityHandler(editor, problemDef.id),
terminal = makePythonTerminalHandler(jqTerminal, editor, problemDef.id, activityHandler),
hinter = codeq.makeHinter(jqHints, jqEditor, editor, 'python_hints', problemDef.hint, commonHints, problemDef.plan),
@@ -230,7 +243,7 @@
if (currentSolution) editor.setValue(currentSolution);
// $('#screen_python .title').text(problem.slug);
// jqDescriptionContent.html(problem.description);
- jqBtnPlan.prop('disabled', ((problemDef.plan && problemDef.plan.en) || []).length == 0);
+ jqBtnPlan.prop('disabled', ((problemDef.plan && problemDef.plan.sl) || []).length == 0);
editor.on('change', function (instance, changeObj) {
var doc = editor.getDoc(),