将 admin 模块化拆分

This commit is contained in:
virusdefender
2015-08-02 09:54:37 +08:00
parent 8b058a3785
commit 9a8c15ab80
6 changed files with 186 additions and 186 deletions

View File

@@ -0,0 +1,31 @@
require(["jquery", "code_mirror"], function ($, code_mirror) {
var code_editor = code_mirror($("#code-editor")[0], "text/x-csrc");
$("#language-selector").change(function () {
var language = $("#language-selector").val();
var language_types = {c: "text/x-csrc", cpp: "text/x-c++src", java: "text/x-java"};
code_editor.setOption("mode", language_types[language]);
});
function show_loading() {
$("#submit-code-button").attr("disabled", "disabled");
$("#loading-gif").show();
}
function hide_loading() {
$("#submit-code-button").removeAttr("disabled");
$("#loading-gif").hide();
}
$("#submit-code-button").click(function () {
show_loading();
setTimeout(
function () {
$("#a").animate({opacity: '1'})
}
,
3);
})
});