From 99fbb6dfaabadd7d1d6ae8724044208c6300a58e Mon Sep 17 00:00:00 2001 From: esp Date: Mon, 10 Aug 2015 14:47:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=89=8D=E7=AB=AF]=E6=B7=BB=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=AD=97=E6=AE=B5=EF=BC=8C=E9=9A=BE=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E6=A0=87=E7=AD=BE=EF=BC=8C=E6=98=AF=E5=90=A6=E5=8F=AF?= =?UTF-8?q?=E8=A7=81=20=20[CI=20SKIP]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/js/app/admin/problem/add_problem.js | 23 ++++++++++- template/admin/problem/add_problem.html | 39 +++++++++++++------ 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/static/src/js/app/admin/problem/add_problem.js b/static/src/js/app/admin/problem/add_problem.js index c60fd23..015af05 100644 --- a/static/src/js/app/admin/problem/add_problem.js +++ b/static/src/js/app/admin/problem/add_problem.js @@ -1,4 +1,4 @@ -require(["jquery", "avalon", "editor", "uploader", "validation"], +require(["jquery", "avalon", "editor", "uploader", "tagEditor", "validation"], function ($, avalon, editor, uploader) { avalon.vmodels.add_problem = null; $("#add-problem-form") @@ -69,7 +69,7 @@ require(["jquery", "avalon", "editor", "uploader", "validation"], }); var problemDiscription = editor("#problemDescription"); var testCaseUploader = uploader("#testCaseFile", "/admin/api/testCase");//{ - + var hinteditor = editor("#hint"); /*auto: true, swf: '/static/js/lib/webuploader/Uploader.swf', server: 'http://webuploader.duapp.com/server/fileupload.php', @@ -80,6 +80,7 @@ require(["jquery", "avalon", "editor", "uploader", "validation"], mimeTypes: 'zip/*' }*/ // }); + $("#tags").tagEditor(); var vm = avalon.define({ $id: "add_problem", title: "", @@ -87,6 +88,19 @@ require(["jquery", "avalon", "editor", "uploader", "validation"], cpu: 0, memory: 0, samples: [], + hint: "", + visible: false, + difficulty: 0, + tags: [], + tag: "", + checkTag: function () { + alert("11"); + if (event.keyCode == 13) + { + alert("You press the enter key!"); + return false; + } + }, add_sample: function () { vm.samples.push({input: "", output: "", "visible": true}); }, @@ -104,5 +118,10 @@ require(["jquery", "avalon", "editor", "uploader", "validation"], return "展开"; } }); + function checkTags(e) + { + e.preventDefault(); + } + //$("#tag").bind("keydown", checkTags(evevt)); avalon.scan(); }); \ No newline at end of file diff --git a/template/admin/problem/add_problem.html b/template/admin/problem/add_problem.html index 1da56a9..029fae8 100644 --- a/template/admin/problem/add_problem.html +++ b/template/admin/problem/add_problem.html @@ -10,22 +10,36 @@ 请填写题目描述 -
- +
+ +
-
- -
-
-
- + +
+
+
-
-
- +
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
添加 @@ -75,4 +89,5 @@
- \ No newline at end of file + + \ No newline at end of file