diff --git a/web/js/admin/problem.js b/web/js/admin/problem.js new file mode 100644 index 0000000..2adbfb1 --- /dev/null +++ b/web/js/admin/problem.js @@ -0,0 +1,11 @@ +function add_problem(name, category, description, hint, flag, value) { + $.post("/api/problem/add", { + name: name, + category: category, + hint: hint, + flag: flag, + value: value + }, function(data) { + + }) +} diff --git a/web/js/easyctf.js b/web/js/easyctf.js index 3f42a83..1237680 100644 --- a/web/js/easyctf.js +++ b/web/js/easyctf.js @@ -1,51 +1,60 @@ var app = angular.module("easyctf", [ "ngRoute" ]); app.config(function($routeProvider, $locationProvider) { - $routeProvider.when("/", { - templateUrl: "pages/home.html", - controller: "mainController" - }) - .when("/about", { - templateUrl: "pages/about.html", - controller: "mainController" - }) - .when("/register", { - templateUrl: "pages/register.html", - controller: "mainController" - }) - .when("/login", { - templateUrl: "pages/login.html", - controller: "mainController" - }) - .when("/chat", { - templateUrl: "pages/chat.html", - controller: "mainController" - }) - .when("/updates", { - templateUrl: "pages/updates.html", - controller: "mainController" - }) - .when("/problems", { - templateUrl: "pages/problems.html", - controller: "mainController" - }) - .when("/programming", { - templateUrl: "pages/programming.html", - controller: "mainController" - }) - .when("/shell", { - templateUrl: "pages/shell.html", - controller: "mainController" - }) - .when("/rules", { - templateUrl: "pages/rules.html", - controller: "mainController" - }) - .when("/scoreboard", { - templateUrl: "pages/scoreboard.html", - controller: "mainController" - }); - $locationProvider.html5Mode(true); + $routeProvider.when("/", { + templateUrl: "pages/home.html", + controller: "mainController" + }) + .when("/about", { + templateUrl: "pages/about.html", + controller: "mainController" + }) + .when("/register", { + templateUrl: "pages/register.html", + controller: "mainController" + }) + .when("/login", { + templateUrl: "pages/login.html", + controller: "mainController" + }) + .when("/chat", { + templateUrl: "pages/chat.html", + controller: "mainController" + }) + .when("/updates", { + templateUrl: "pages/updates.html", + controller: "mainController" + }) + .when("/problems", { + templateUrl: "pages/problems.html", + controller: "mainController" + }) + .when("/programming", { + templateUrl: "pages/programming.html", + controller: "mainController" + }) + .when("/shell", { + templateUrl: "pages/shell.html", + controller: "mainController" + }) + .when("/rules", { + templateUrl: "pages/rules.html", + controller: "mainController" + }) + .when("/scoreboard", { + templateUrl: "pages/scoreboard.html", + controller: "mainController" + }); + $locationProvider.html5Mode(true); }); app.controller("mainController", function($scope) { }); + +function display_message(containerId, alertType, message, callback) { + $("#" + containerId).html('