Skip to content

Commit

Permalink
Merge pull request #30 from belivipro9x99/indev
Browse files Browse the repository at this point in the history
merge branch indev into master
  • Loading branch information
Belikhun authored Nov 3, 2019
2 parents b9d284f + af7912a commit 1eae968
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 33 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Logs

- [Thay đổi trong v0.5.1](#thay-đổi-trong-v051)
- [Thay đổi trong v0.5.2](#thay-đổi-trong-v051)
- [Thay đổi trong v0.5.1](#thay-đổi-trong-v051)
- [Thay đổi trong v0.5.0](#thay-đổi-trong-v050)
- [Thay đổi trong v0.4.6](#thay-đổi-trong-v046)
- [Thay đổi trong v0.4.5](#thay-đổi-trong-v045)
Expand All @@ -25,7 +26,13 @@

---

## Thay đổi trong v0.5.1
## Thay đổi trong v0.5.2

* **Chỉnh sửa:** Đính dòng đầu tiên của bảng xếp hạng ở phía trên để dễ dàng đọc hơn
* **Chỉnh sửa:** Thêm ratelimit cho trang `public`
* Sửa một số lỗi khác và thêm một số chức năng nhỏ

### Thay đổi trong v0.5.1

* **Bug:** Sửa icon hiển thị trong Avatar tại cài đặt người dùng hiển thị lệch (#26)
* **Bug:** Sửa không thể tiến hành nhập mật khẩu khi nhập sai tên người dùng (#27)
Expand All @@ -36,7 +43,6 @@
* **Thêm:** Hiển thị xem trước cho tệp pdf trong `Cửa sổ xem đề bài` (7444b89178ca4ed2913e63aa8a5191867af99337)
* **Thay đổi:** Thay đổi `favicon.ico` (9158e031f89731373d2e489179b63c021dfef27c)


### Thay đổi trong v0.5.0

* **Bug:** Rò rỉ một số thông tin từ api "test/logs" khi tắt công bố kết quả (#19)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An **beautiful** and **easy-to-use** Web Interface for **[Themis](https://dsapbl

<img src="https://lh3.googleusercontent.com/SYT2hlU7_rxmCgHz0kt6089Md1V-j-ePWUUQBFtUVF5DTlcSjmGhr14J7Qsgx262KBZuhGKZ4eZD3ChYzdBaFMytEw0aBD3dRLi0bZskyK3-6MQ7rMkDMfcED18JgPyfeZEee50h8g=w2400" width="500px">

[![version](https://img.shields.io/badge/release-v0.5.1-brightgreen.svg?longCache=true&style=for-the-badge)](https://github.com/belivipro9x99/themis-webinterface/releases/)
[![version](https://img.shields.io/badge/release-v0.5.2-brightgreen.svg?longCache=true&style=for-the-badge)](https://github.com/belivipro9x99/themis-webinterface/releases/)
[![license](https://img.shields.io/badge/license-MIT-orange.svg?longCache=true&style=for-the-badge)](https://github.com/belivipro9x99/themis-web-interface/blob/master/LICENSE)
[![status](https://img.shields.io/badge/status-May_contain_bugs-blue.svg?longCache=true&style=for-the-badge)]()
[![Travis CI Build Status](https://img.shields.io/travis/belivipro9x99/themis-web-interface.svg?style=for-the-badge)](https://travis-ci.org/belivipro9x99/themis-web-interface)
Expand Down
13 changes: 5 additions & 8 deletions assets/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,7 @@ body.guest #timep:not(.show) ~ #problemp.hide ~ #rankp {
position: relative;
display: inline-block;
font-size: 14px;
letter-spacing: .2px;
}

#rankp div.ranking-container table tr td.number:nth-child(4) {
Expand Down Expand Up @@ -1539,8 +1540,12 @@ body.guest #timep:not(.show) ~ #problemp.hide ~ #rankp {
}

#rankp div.ranking-container table tr th {
position: sticky;
top: 0;
background-color: #fafafa;
border-bottom: 1px solid #9b9b9b;
color: rgb(82, 82, 82);
z-index: 1;
}

#rankp div.ranking-container table tr th,
Expand Down Expand Up @@ -2396,14 +2401,6 @@ footer .header .button button {
margin: 0 5px;
}

footer .header .button button.sq-btn:nth-child(1)::before {
animation-delay: 0.4s;
}

footer .header .button button.sq-btn:nth-child(1)::after {
animation-delay: 1.2s;
}

footer .header t {
position: relative;
display: block;
Expand Down
1 change: 1 addition & 0 deletions assets/css/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ body.dark #rankp div.ranking-container table tbody tr[data-rank="3"] td:nth-chil
}

body.dark #rankp div.ranking-container table tr th {
background-color: #303030;
color: rgb(202, 202, 202);
border-bottom-color: rgb(88, 88, 88);
}
Expand Down
1 change: 1 addition & 0 deletions assets/css/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
font-weight: 700;
text-transform: uppercase;
color: #5a5b5f;
cursor: text;
user-select: none;
}

Expand Down
20 changes: 14 additions & 6 deletions assets/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ const core = {
});

this.state.innerText = `Tải lên thành công! ${(i + 1)}/${files.length}`;
sounds.notification();
this.onUploadSuccess();

setTimeout(() => {
Expand All @@ -788,6 +789,7 @@ const core = {
this.state.innerText = e.data.description;
this.panel.title = "Nộp bài - Đã dừng.";
this.bar.dataset.color = "red";
sounds.warning();

switch(e.data.code) {
case 44:
Expand Down Expand Up @@ -1646,7 +1648,7 @@ const core = {
},

async changeName(name) {
sounds.confirm();
sounds.confirm(1);

await myajax({
url: "/api/edit",
Expand All @@ -1667,7 +1669,7 @@ const core = {
},

async changePassword(pass, newPass, reTypePass) {
sounds.confirm();
sounds.confirm(2);

await myajax({
url: "/api/edit",
Expand All @@ -1681,7 +1683,10 @@ const core = {
}, () => {
clog("okay", "Thay đổi mật khẩu thành công!");
this.reset();
}, () => this.reset());
}, () => {
sounds.warning();
this.reset();
});
},

fileSelect(e, type = "drop") {
Expand All @@ -1694,12 +1699,11 @@ const core = {
var file = (type === "drop") ? e.dataTransfer.files[0] : e.target.files[0];

this.avtWrapper.classList.add("load");
sounds.confirm();
setTimeout(() => this.avtUpload(file), 1000);
},

async avtUpload(file) {
sounds.confirm();

await myajax({
url: "/api/avatar",
method: "POST",
Expand All @@ -1710,9 +1714,13 @@ const core = {
}, response => {
this.reset();
this.reload(response.data, "avatar");
sounds.notification();

clog("okay", "Avatar changed.");
}, () => this.reset());
}, () => {
sounds.warning();
this.reset();
})
},

dragEnter(e) {
Expand Down
2 changes: 1 addition & 1 deletion data/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contest": {
"name": "B\u00e0i t\u1eadp tin h\u1ecdc",
"name": "\u00d4n T\u1eadp",
"description": "B\u00e0i l\u00e0m n\u1ed9p l\u00ean \u0111\u01b0\u1ee3c ch\u1ea5m b\u1eb1ng ph\u1ea7n m\u1ec1m <a href='http:\/\/dsapblog.wordpress.com\/' target=\"_blank\" rel=\"noopener\">Themis (L\u00ea Minh Ho\u00e0ng & \u0110\u1ed7 \u0110\u1ee9c \u0110\u00f4ng)<\/a>"
},
"uploadDir": "D:\\Themis\\data\\uploadDir",
Expand Down
2 changes: 1 addition & 1 deletion data/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// dont claim it for your own. thats not nice
define("APPNAME", "Themis Web Interface");
define("AUTHOR", "Belikhun");
define("VERSION", "0.5.1");
define("VERSION", "0.5.2");
define("VERSION_TAG", "release");
define("REPO_ADDRESS", "https://github.com/belivipro9x99/themis-web-interface");
define("REPORT_ERROR", REPO_ADDRESS . "/issues");
Expand Down
15 changes: 8 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,18 @@
<t class="title small">Đổi mật khẩu</t>

<div class="item form sound" data-soundhoversoft>
<form id="usett_edit_pass_form" autocomplete="off" action="javascript:void(0);">
<form id="usett_edit_pass_form" action="javascript:void(0);">
<input type="text" autocomplete="username" value="<?php print $username; ?>" style="display: none">
<div class="formGroup blue sound" data-soundselectsoft>
<input id="usett_edit_pass" type="password" class="formField" placeholder="Mật khẩu" required>
<input id="usett_edit_pass" type="password" autocomplete="current-password" class="formField" placeholder="Mật khẩu" required>
<label for="usett_edit_pass">Mật khẩu</label>
</div>
<div class="formGroup blue sound" data-soundselectsoft>
<input id="usett_edit_npass" type="password" class="formField" placeholder="Mật khẩu mới" required>
<input id="usett_edit_npass" type="password" autocomplete="new-password" class="formField" placeholder="Mật khẩu mới" required>
<label for="usett_edit_npass">Mật khẩu mới</label>
</div>
<div class="formGroup blue sound" data-soundselectsoft>
<input id="usett_edit_renpass" type="password" class="formField" placeholder="Nhập lại mật khẩu mới" required>
<input id="usett_edit_renpass" type="password" autocomplete="new-password" class="formField" placeholder="Nhập lại mật khẩu mới" required>
<label for="usett_edit_renpass">Nhập lại mật khẩu mới</label>
</div>
<button type="submit" class="sq-btn sound" data-soundhover data-soundselect>Thay đổi</button>
Expand Down Expand Up @@ -632,7 +633,7 @@
<t class="subtitle">Made from scratch, crafted with <font color="red">❤</font> by Belikhun</t>

<div class="button">
<button class="sq-btn green sound" data-soundhover data-soundselect onclick="this.innerText = randBetween(1, 1000)">Click Me!</button>
<button class="sq-btn rainbow sound" data-soundhover data-soundselect onclick="this.innerText = randBetween(1, 1000)">Click Me!</button>
<button class="sq-btn pink sound" data-soundhover data-soundselect>(╯°□°)╯︵ ┻━┻</button>
</div>
</div>
Expand All @@ -653,8 +654,8 @@
<div class="badge">
<a href="<?php print REPO_ADDRESS; ?>/releases/" target="_blank" rel="noopener"><img src="/tool/badge?su=<?php print VERSION_TAG; ?>&st=v<?php print VERSION; ?>&c=brightgreen"></a>
<img src="/tool/badge?su=license&st=MIT&c=orange">
<img src="/tool/badge?su=status&st=may contain bugs&c=blue">
<img src="/tool/badge?su=author&st=Đỗ Mạnh Hà&c=red">
<img src="/tool/badge?su=status&st=near stable&c=blue">
<img src="/tool/badge?su=author&st=Belikhun&c=red">
<a href="http://thptlaclongquan.hoabinh.edu.vn" target="_blank" rel="noopener"><img src="/tool/badge?su=school&st=Lac Long Quan High School, Hoa Binh&c=yellow"></a>
</div>

Expand Down
6 changes: 3 additions & 3 deletions lib/badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function createBadge(array $data = Array(
style => "flat-square",
color => "green",
subject => "sample",
status => "text",
status => "text"
)) {
$clist = Array(
"green" => "#97CA00",
Expand Down Expand Up @@ -43,7 +43,7 @@ function createBadge(array $data = Array(
<path fill="#555" d="M0 0h<?php print $box1; ?>v20H0z"/>
<path fill="<?php print $ccode; ?>" d="M<?php print $box1; ?> 0h<?php print $box2; ?>v20H<?php print $box1; ?>z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
<g fill="#fff" text-anchor="middle" font-family="Calibri" font-size="130">
<text x="<?php print $suanchor; ?>" y="140" transform="scale(.1)"><?php print $data["subject"]; ?></text>
<text x="<?php print $stanchor; ?>" y="140" transform="scale(.1)"><?php print $data["status"]; ?></text>
</g>
Expand All @@ -58,7 +58,7 @@ function createBadge(array $data = Array(
<path fill="#555" d="M0 0h<?php print $box1; ?>v28H0z" />
<path fill="<?php print $ccode; ?>" d="M<?php print $box1; ?> 0h<?php print $box2; ?>v28H<?php print $box1; ?>z" />
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
<g fill="#fff" text-anchor="middle" font-family="Calibri" font-size="130">
<text x="<?php print $suanchor; ?>" y="175" transform="scale(.1)"><?php print $data["subject"]; ?></text>
<text x="<?php print $stanchor; ?>" y="175" font-weight="bold" transform="scale(.1)" ><?php print $data["status"]; ?></text>
</g>
Expand Down
4 changes: 2 additions & 2 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<form id="form_container" action="javascript:void(0);">
<div id="form_username">
<div class="formGroup blue sound" data-soundselectsoft>
<input id="form_username_input" type="text" class="formField" autocomplete="off" placeholder="Tên tài khoản" required disabled>
<input id="form_username_input" type="text" autocomplete="username" class="formField" autocomplete="off" placeholder="Tên tài khoản" required disabled>
<label for="form_username_input">Tên tài khoản</label>
</div>

Expand All @@ -87,7 +87,7 @@
</div>

<div class="formGroup blue sound" data-soundselectsoft>
<input id="form_password_input" type="password" class="formField" autocomplete="off" placeholder="Mật khẩu" required disabled>
<input id="form_password_input" type="password" autocomplete="current-password" class="formField" autocomplete="off" placeholder="Mật khẩu" required disabled>
<label for="form_password_input">Mật khẩu</label>
</div>

Expand Down
3 changes: 2 additions & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

// SET PAGE TYPE
define("PAGE_TYPE", "NORMAL");


require_once $_SERVER["DOCUMENT_ROOT"] ."/lib/ratelimit.php";
require_once $_SERVER["DOCUMENT_ROOT"] ."/lib/belibrary.php";
require_once $_SERVER["DOCUMENT_ROOT"] ."/data/config.php";
require_once $_SERVER["DOCUMENT_ROOT"] ."/data/problems/problem.php";
Expand Down

0 comments on commit 1eae968

Please sign in to comment.