-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from kuafuai/feat/user
chore(pro)
- Loading branch information
Showing
19 changed files
with
494 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
$(document).ready(function () { | ||
// show dropdown on hover | ||
$('.main.menu .ui.dropdown').dropdown({ | ||
on: 'hover' | ||
}); | ||
}); | ||
|
||
function login() { | ||
var requestData = JSON.stringify({ 'username': $("#login-username").val(), 'password': $("#login-password").val() }) | ||
|
||
successCallback = function(data) { | ||
window.location.href = "index.html"; | ||
} | ||
|
||
errorCallback = function(error) { | ||
$("#login-message").html(error) | ||
$("#login-message").fadeOut().fadeIn() | ||
} | ||
|
||
sendAjaxRequest('/user/login', "POST", requestData, successCallback, errorCallback, true, false) | ||
} | ||
|
||
function register() { | ||
var requestData = JSON.stringify({ | ||
'username': $("#login-username").val(), | ||
'password': $("#login-password").val(), | ||
'email': $("#login-email").val(), | ||
'phone': $("#login-phone").val(), | ||
}) | ||
|
||
successCallback = function(data) { | ||
window.location.href = "user_login.html"; | ||
} | ||
|
||
errorCallback = function(error) { | ||
$("#login-message").html(error) | ||
$("#login-message").fadeOut().fadeIn() | ||
} | ||
|
||
sendAjaxRequest('/user/register', "POST", requestData, successCallback, errorCallback, true, false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="robots" content="noarchive"> | ||
<title class="f_title"></title> | ||
<link rel="stylesheet" href="./static/css/style.css?v=6"> | ||
<link rel="stylesheet" href="./static/css/semantic.min.css"> | ||
<link rel="stylesheet" href="./static/css/codemirror.min.css" /> | ||
<link rel="stylesheet" href="./static/css/darcula.min.css" /> | ||
<script src="./static/js/codemirror.min.js"></script> | ||
<script src="./static/js/haxe.min.js"></script> | ||
<script src="./static/js/jquery.min.js"></script> | ||
<script src="./static/js/semantic.min.js"></script> | ||
<script src="./static/js/marked.min.js"></script> | ||
<script src="./static/js/diff.min.js"></script> | ||
<script src="./static/js/coder.js?v=75"></script> | ||
<script src="./static/js/user.js?v=75"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="ui borderless main menu margin-top-0"> | ||
<div class="ui text container ai-textcontainer"> | ||
<div class="header item" style="padding-left: 0px;"> | ||
<img class="logo" src="./static/image/logo.png" style="margin-right: 5px;"> | ||
<span class="f_title"></span> | ||
</div> | ||
<a class="item" href="index.html"><span class="f_start_task"></span></a> | ||
<a class="item" href="requirement.html"><span class="f_requirement_list"></span></a> | ||
<a class="item" href="app.html"><span class="f_app_list"></span></a> | ||
<a class="item" href="setting.html"><span class="f_setting"></span></a> | ||
<a href="#" class="ui right floated dropdown item"> | ||
<span class="f_more_operations"></span> <i class="dropdown icon"></i> | ||
<div class="menu"> | ||
<div class="item"><span class="f_hello"></span> <span id="current-username"></span></div> | ||
<div class="item" onClick="changeLanguage()"><span class="f_change_language"></span></div> | ||
<div class="item" onClick="logout()"><span class="f_logout"></span></div> | ||
</div> | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div class="ui container"> | ||
<div class="ui form"> | ||
<div class="field"> | ||
<label><span class="f_username"></span></label> | ||
<input type="text" id="login-username" placeholder=""> | ||
</div> | ||
<div class="field"> | ||
<label><span class="f_password"></span></label> | ||
<input type="password" id="login-password" placeholder=""> | ||
</div> | ||
<div class="field"> | ||
<label id="login-message" style="color: red;"></label> | ||
</div> | ||
<div class="field"> | ||
<a class="ui right floated button blue" href="user_register.html"><i class="id card outline icon"></i><span class="f_register"></span></a> | ||
<button class="ui right floated button green" onClick="login()" type="submit"><i class="user icon"></i><span class="f_submit"></span></div></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="ui modal" id="my-alert"> | ||
<div class="header" id="my-alert-title"></div> | ||
<div class="content" id="my-alert-content"> | ||
</div> | ||
</div> | ||
|
||
<div class="ui watermark"> | ||
<span id="watermark-username"></span> @ <span class="f_title"></span></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="robots" content="noarchive"> | ||
<title class="f_title"></title> | ||
<link rel="stylesheet" href="./static/css/style.css?v=6"> | ||
<link rel="stylesheet" href="./static/css/semantic.min.css"> | ||
<link rel="stylesheet" href="./static/css/codemirror.min.css" /> | ||
<link rel="stylesheet" href="./static/css/darcula.min.css" /> | ||
<script src="./static/js/codemirror.min.js"></script> | ||
<script src="./static/js/haxe.min.js"></script> | ||
<script src="./static/js/jquery.min.js"></script> | ||
<script src="./static/js/semantic.min.js"></script> | ||
<script src="./static/js/marked.min.js"></script> | ||
<script src="./static/js/diff.min.js"></script> | ||
<script src="./static/js/coder.js?v=75"></script> | ||
<script src="./static/js/user.js?v=75"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="ui borderless main menu margin-top-0"> | ||
<div class="ui text container ai-textcontainer"> | ||
<div class="header item" style="padding-left: 0px;"> | ||
<img class="logo" src="./static/image/logo.png" style="margin-right: 5px;"> | ||
<span class="f_title"></span> | ||
</div> | ||
<a class="item" href="index.html"><span class="f_start_task"></span></a> | ||
<a class="item" href="requirement.html"><span class="f_requirement_list"></span></a> | ||
<a class="item" href="app.html"><span class="f_app_list"></span></a> | ||
<a class="item" href="setting.html"><span class="f_setting"></span></a> | ||
<a href="#" class="ui right floated dropdown item"> | ||
<span class="f_more_operations"></span> <i class="dropdown icon"></i> | ||
<div class="menu"> | ||
<div class="item"><span class="f_hello"></span> <span id="current-username"></span></div> | ||
<div class="item" onClick="changeLanguage()"><span class="f_change_language"></span></div> | ||
<div class="item" onClick="logout()"><span class="f_logout"></span></div> | ||
</div> | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div class="ui container"> | ||
<div class="ui form"> | ||
<div class="field"> | ||
<label><span class="f_username"></span></label> | ||
<input type="text" id="login-username" placeholder=""> | ||
</div> | ||
<div class="field"> | ||
<label><span class="f_password"></span></label> | ||
<input type="password" id="login-password" placeholder=""> | ||
</div> | ||
<div class="field"> | ||
<label><span class="f_email"></span></label> | ||
<input type="text" id="login-email" placeholder=""> | ||
</div> | ||
<div class="field"> | ||
<label><span class="f_phone"></span></label> | ||
<input type="text" id="login-phone" placeholder=""> | ||
</div> | ||
<div class="field"> | ||
<label id="login-message" style="color: red;"></label> | ||
</div> | ||
<div class="field"> | ||
<a class="ui right floated button blue" href="user_register.html"><i class="user icon"></i><span class="f_login"></span></a> | ||
<button class="ui right floated button green" onClick="register()" type="submit"><i class="id card outline icon"></i><span class="f_submit"></span></div></button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="ui modal" id="my-alert"> | ||
<div class="header" id="my-alert-title"></div> | ||
<div class="content" id="my-alert-content"> | ||
</div> | ||
</div> | ||
|
||
<div class="ui watermark"> | ||
<span id="watermark-username"></span> @ <span class="f_title"></span></div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.