Apply formatting to Web UI files

This commit is contained in:
Chocobo1
2018-04-05 11:59:31 +08:00
parent 208d21ff73
commit cf2c0bd47e
34 changed files with 3534 additions and 3379 deletions

View File

@@ -33,5 +33,5 @@ body {
}
#logo img {
height: 11em;
height: 11em;
}

View File

@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</title>
@@ -7,50 +8,53 @@
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script>
window.onload = function() {
$('username').focus();
$('username').select();
};
window.onload = function() {
$('username').focus();
$('username').select();
};
window.addEvent('domready', function() {
$('loginform').addEvent('submit', function(e) {
new Event(e).stop();
submitLoginForm();
window.addEvent('domready', function() {
$('loginform').addEvent('submit', function(e) {
new Event(e).stop();
submitLoginForm();
});
});
});
function submitLoginForm() {
new Request({
url: 'api/v2/auth/login',
method: 'post',
data: $('loginform').toQueryString(),
onComplete: function() {
$('password').set('value', '');
},
onFailure: function(xhr) {
if (xhr.responseText !== "") {
$('error_msg').set('html', xhr.responseText);
} else {
$('error_msg').set('html', 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]');
}
},
onSuccess: function(text) {
if (text == "Ok.") {
// Session started. Simply reload page.
window.location.reload();
} else {
$('error_msg').set('html', 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]');
}
}
}).send();
}
function submitLoginForm() {
new Request({
url: 'api/v2/auth/login',
method: 'post',
data: $('loginform').toQueryString(),
onComplete: function() {
$('password').set('value', '');
},
onFailure: function(xhr) {
if (xhr.responseText !== "") {
$('error_msg').set('html', xhr.responseText);
}
else {
$('error_msg').set('html', 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]');
}
},
onSuccess: function(text) {
if (text == "Ok.") {
// Session started. Simply reload page.
window.location.reload();
}
else {
$('error_msg').set('html', 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]');
}
}
}).send();
}
</script>
</head>
<body>
<div id="main">
<h1>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</h1>
<div id="logo" class="col">
<img src="images/skin/qbittorrent-tray.svg" alt="qBittorrent logo"/>
<img src="images/skin/qbittorrent-tray.svg" alt="qBittorrent logo" />
</div>
<div id="formplace" class="col">
<form id="loginform">
@@ -61,11 +65,12 @@
<label for="password">QBT_TR(Password)QBT_TR[CONTEXT=HttpServer]</label><br />
<input type="password" id="password" name="password" /></div>
<div class="row">
<input type="submit" id="login" value="QBT_TR(Login)QBT_TR[CONTEXT=HttpServer]" />
<input type="submit" id="login" value="QBT_TR(Login)QBT_TR[CONTEXT=HttpServer]" />
</div>
</form>
</div>
<div id="error_msg"></div>
</div>
</body>
</html>