diff --git a/template/problem/problem_submit.php b/template/problem/problem_submit.php index 4947b0c..894b18a 100644 --- a/template/problem/problem_submit.php +++ b/template/problem/problem_submit.php @@ -26,6 +26,22 @@ location.href="=$SkyOJ->uri('chal','result')?>/"+res.data; }); }); + function init() + { + var j_submit = $('#codesubmit'); + $('#s_file').on('change',function(e) + { + var reader = new FileReader(); + reader.onload = function(e) + { + var editor = ace.edit("editor"); + editor.getSession().setValue(reader.result); + }; + reader.readAsText(this.files[0]); + }); + }; + init(); + })