Browse Source

Apply formatting to Web UI files

adaptive-webui-19844
Chocobo1 7 years ago
parent
commit
cf2c0bd47e
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 3
      src/webui/www/private/addtrackers.html
  2. 3
      src/webui/www/private/confirmdeletion.html
  3. 3
      src/webui/www/private/css/Layout.css
  4. 10
      src/webui/www/private/css/Window.css
  5. 3
      src/webui/www/private/css/dynamicTable.css
  6. 59
      src/webui/www/private/css/style.css
  7. 4
      src/webui/www/private/download.html
  8. 3
      src/webui/www/private/downloadlimit.html
  9. 3
      src/webui/www/private/index.html
  10. 6
      src/webui/www/private/newcategory.html
  11. 3
      src/webui/www/private/preferences.html
  12. 92
      src/webui/www/private/preferences_content.html
  13. 96
      src/webui/www/private/properties_content.html
  14. 3
      src/webui/www/private/rename.html
  15. 31
      src/webui/www/private/scripts/client.js
  16. 15
      src/webui/www/private/scripts/contextmenu.js
  17. 32
      src/webui/www/private/scripts/dynamicTable.js
  18. 16
      src/webui/www/private/scripts/misc.js
  19. 4
      src/webui/www/private/scripts/prop-files.js
  20. 4
      src/webui/www/private/scripts/prop-general.js
  21. 4
      src/webui/www/private/scripts/prop-trackers.js
  22. 4
      src/webui/www/private/scripts/prop-webseeds.js
  23. 3
      src/webui/www/private/setlocation.html
  24. 1
      src/webui/www/private/transferlist.html
  25. 4
      src/webui/www/private/upload.html
  26. 3
      src/webui/www/private/uploadlimit.html
  27. 9
      src/webui/www/public/login.html

3
src/webui/www/private/addtrackers.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Trackers addition dialog)QBT_TR[CONTEXT=TrackersAdditionDlg]</title> <title>QBT_TR(Trackers addition dialog)QBT_TR[CONTEXT=TrackersAdditionDlg]</title>
@ -27,6 +28,7 @@
}); });
</script> </script>
</head> </head>
<body> <body>
<div style="text-align: center;"> <div style="text-align: center;">
<br/> <br/>
@ -36,4 +38,5 @@
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="addTrackersButton" /> <input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="addTrackersButton" />
</div> </div>
</body> </body>
</html> </html>

3
src/webui/www/private/confirmdeletion.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Deletion confirmation - qBittorrent)QBT_TR[CONTEXT=confirmDeletionDlg]</title> <title>QBT_TR(Deletion confirmation - qBittorrent)QBT_TR[CONTEXT=confirmDeletionDlg]</title>
@ -34,6 +35,7 @@
}); });
</script> </script>
</head> </head>
<body> <body>
<br/> <br/>
@ -43,4 +45,5 @@
<input type="button" id="cancelBtn" value="QBT_TR(No)QBT_TR[CONTEXT=MainWindow]" />&nbsp;&nbsp;<input type="button" id="confirmBtn" value="QBT_TR(Yes)QBT_TR[CONTEXT=MainWindow]" />&nbsp;&nbsp; <input type="button" id="cancelBtn" value="QBT_TR(No)QBT_TR[CONTEXT=MainWindow]" />&nbsp;&nbsp;<input type="button" id="confirmBtn" value="QBT_TR(Yes)QBT_TR[CONTEXT=MainWindow]" />&nbsp;&nbsp;
</div> </div>
</body> </body>
</html> </html>

3
src/webui/www/private/css/Layout.css

@ -186,7 +186,8 @@ body {
color: #3f3f3f; color: #3f3f3f;
font-weight: normal; font-weight: normal;
/* Fix By Chris */ /* Fix By Chris */
padding: 1px 10px 1px 20px; /* Reduce left padding */ padding: 1px 10px 1px 20px;
/* Reduce left padding */
} }
#desktopNavbar li ul li a:hover { #desktopNavbar li ul li a:hover {

10
src/webui/www/private/css/Window.css

@ -24,8 +24,7 @@ Required by:
background-color: #e5e5e5; background-color: #e5e5e5;
} }
.mocha.isFocused { .mocha.isFocused {}
}
.mochaOverlay { .mochaOverlay {
position: absolute; /* This is also set in theme.js in order to make theme transitions smoother */ position: absolute; /* This is also set in theme.js in order to make theme transitions smoother */
@ -255,7 +254,8 @@ div.mochaToolbarWrapper.bottom {
/* The replaced class is used internally when converting CSS values to Canvas. These classes should not be removed. */ /* The replaced class is used internally when converting CSS values to Canvas. These classes should not be removed. */
.mocha.replaced, .mochaTitlebar.replaced, .mochaMinimizeButton.replaced, .mochaMaximizeButton.replaced, .mochaCloseButton.replaced { .mocha.replaced, .mochaTitlebar.replaced, .mochaMinimizeButton.replaced,
.mochaMaximizeButton.replaced, .mochaCloseButton.replaced {
background-color: transparent !important; background-color: transparent !important;
} }
@ -269,7 +269,8 @@ div.mochaToolbarWrapper.bottom {
overflow: hidden; overflow: hidden;
} }
.windowClosed .mochaContentBorder, .windowClosed .mochaToolbarWrapper, .windowClosed .mochaTitlebar, .windowClosed .mochaControls, .windowClosed .mochaContentBorder, .windowClosed .mochaToolbarWrapper,
.windowClosed .mochaTitlebar, .windowClosed .mochaControls,
.windowClosed .mochaCanvasControls { .windowClosed .mochaCanvasControls {
position: absolute; position: absolute;
top: 0; top: 0;
@ -371,6 +372,7 @@ div.mochaToolbarWrapper.bottom {
} }
/* Workaround to make invisible buttons clickable */ /* Workaround to make invisible buttons clickable */
.mochaMinimizeButton.replaced, .mochaMinimizeButton.replaced,
.mochaMaximizeButton.replaced, .mochaMaximizeButton.replaced,
.mochaCloseButton.replaced { .mochaCloseButton.replaced {

3
src/webui/www/private/css/dynamicTable.css

@ -1,11 +1,10 @@
/************************************************************** /**************************************************************
Dynamic Table Dynamic Table
v 0.4 v 0.4
**************************************************************/ **************************************************************/
.dynamicTable tbody tr { .dynamicTable tbody tr {
background-color: #fff; background-color: #fff;
} }

59
src/webui/www/private/css/style.css

@ -1,9 +1,16 @@
/* Reset */ /* Reset */
/*ul,ol,dl,li,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input,object,iframe { margin: 0; padding: 0; }*/ /*ul,ol,dl,li,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input,object,iframe { margin: 0; padding: 0; }*/
a img,:link img,:visited img { border: none; }
a img, :link img, :visited img {
border: none;
}
/*table { border-collapse: collapse; border-spacing: 0; }*/ /*table { border-collapse: collapse; border-spacing: 0; }*/
:focus { outline: none; }
:focus {
outline: none;
}
/* Structure */ /* Structure */
@ -172,9 +179,23 @@ a.propButton img {
/* context menu specific */ /* context menu specific */
.contextMenu { border:1px solid #999; padding:0; background:#eee; list-style-type:none; display:none;} .contextMenu {
.contextMenu .separator { border-top:1px solid #999; } border: 1px solid #999;
.contextMenu li { margin:0; padding:0;} padding: 0;
background: #eee;
list-style-type: none;
display: none;
}
.contextMenu .separator {
border-top: 1px solid #999;
}
.contextMenu li {
margin: 0;
padding: 0;
}
.contextMenu li a { .contextMenu li a {
display: block; display: block;
padding: 5px 20px 5px 5px; padding: 5px 20px 5px 5px;
@ -184,12 +205,25 @@ a.propButton img {
color: #000; color: #000;
white-space: nowrap; white-space: nowrap;
} }
.contextMenu li a:hover { background-color:#ddd; }
.contextMenu li a.disabled { color:#ccc; font-style:italic; } .contextMenu li a:hover {
.contextMenu li a.disabled:hover { background-color:#eee; } background-color: #ddd;
}
.contextMenu li a.disabled {
color: #ccc;
font-style: italic;
}
.contextMenu li a.disabled:hover {
background-color: #eee;
}
.contextMenu li ul { .contextMenu li ul {
padding: 0; padding: 0;
border:1px solid #999; padding:0; background:#eee; border: 1px solid #999;
padding: 0;
background: #eee;
list-style-type: none; list-style-type: none;
position: absolute; position: absolute;
left: -999em; left: -999em;
@ -197,14 +231,17 @@ a.propButton img {
margin: -29px 0 0 100%; margin: -29px 0 0 100%;
width: 164px; width: 164px;
} }
.contextMenu li ul li a { .contextMenu li ul li a {
position: relative; position: relative;
} }
.contextMenu li a.arrow-right, .contextMenu li a:hover.arrow-right { .contextMenu li a.arrow-right, .contextMenu li a:hover.arrow-right {
background-image: url(../images/skin/arrow-right.gif); background-image: url(../images/skin/arrow-right.gif);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: right center; background-position: right center;
} }
.contextMenu li:hover ul, .contextMenu li:hover ul,
.contextMenu li.ieHover ul, .contextMenu li.ieHover ul,
.contextMenu li li.ieHover ul, .contextMenu li li.ieHover ul,
@ -280,6 +317,7 @@ a.propButton img {
} }
/* Mocha Customization */ /* Mocha Customization */
#mochaToolbar { #mochaToolbar {
margin-top: 5px; margin-top: 5px;
} }
@ -392,7 +430,8 @@ td.generalLabel {
line-height: 20px; line-height: 20px;
} }
#trackersTable, #webseedsTable { #trackersTable,
#webseedsTable {
line-height: 25px; line-height: 25px;
} }

4
src/webui/www/private/download.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Add Torrent Links)QBT_TR[CONTEXT=downloadFromURL]</title> <title>QBT_TR(Add Torrent Links)QBT_TR[CONTEXT=downloadFromURL]</title>
@ -8,6 +9,7 @@
<script src="scripts/lib/mootools-1.2-core-yc.js"></script> <script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/download.js"></script> <script src="scripts/download.js"></script>
</head> </head>
<body> <body>
<iframe id="download_frame" name="download_frame" class="invisible" src="javascript:false;"></iframe> <iframe id="download_frame" name="download_frame" class="invisible" src="javascript:false;"></iframe>
<form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="downloadForm" style="text-align: center;" target="download_frame"> <form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="downloadForm" style="text-align: center;" target="download_frame">
@ -69,7 +71,6 @@
</div> </div>
</form> </form>
<script> <script>
var submitted = false; var submitted = false;
$('downloadForm').addEventListener("submit", function() { $('downloadForm').addEventListener("submit", function() {
@ -88,4 +89,5 @@ $('start_torrent').addEventListener('change', function() {
</script> </script>
<div id="download_spinner" class="mochaSpinner"></div> <div id="download_spinner" class="mochaSpinner"></div>
</body> </body>
</html> </html>

3
src/webui/www/private/downloadlimit.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Torrent Download Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]</title> <title>QBT_TR(Torrent Download Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -9,6 +10,7 @@
<script src="scripts/lib/mocha-yc.js"></script> <script src="scripts/lib/mocha-yc.js"></script>
<script src="scripts/lib/parametrics.js"></script> <script src="scripts/lib/parametrics.js"></script>
</head> </head>
<body> <body>
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden"> <div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
<div id="dllimitSlider" class="slider"> <div id="dllimitSlider" class="slider">
@ -59,4 +61,5 @@
</script> </script>
</body> </body>
</html> </html>

3
src/webui/www/private/index.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=10" /> <meta http-equiv="X-UA-Compatible" content="IE=10" />
@ -26,6 +27,7 @@
<script src="scripts/client.js"></script> <script src="scripts/client.js"></script>
<script src="scripts/contextmenu.js"></script> <script src="scripts/contextmenu.js"></script>
</head> </head>
<body> <body>
<div id="desktop"> <div id="desktop">
<div id="desktopHeader"> <div id="desktopHeader">
@ -164,4 +166,5 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>

6
src/webui/www/private/newcategory.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(New Category)QBT_TR[CONTEXT=TransferListWidget]</title> <title>QBT_TR(New Category)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -43,8 +44,7 @@
} }
}).send(); }).send();
} }
else else {
{
new Request({ new Request({
url: 'api/v2/torrents/setCategory', url: 'api/v2/torrents/setCategory',
method: 'post', method: 'post',
@ -61,6 +61,7 @@
}); });
</script> </script>
</head> </head>
<body> <body>
<div style="padding: 10px 10px 0px 10px;"> <div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Category)QBT_TR[CONTEXT=TransferListWidget]:</p> <p style="font-weight: bold;">QBT_TR(Category)QBT_TR[CONTEXT=TransferListWidget]:</p>
@ -70,4 +71,5 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>

3
src/webui/www/private/preferences.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Download from URLs)QBT_TR[CONTEXT=downloadFromURL]</title> <title>QBT_TR(Download from URLs)QBT_TR[CONTEXT=downloadFromURL]</title>
@ -9,6 +10,7 @@
<script src="scripts/lib/mootools-1.2-more.js"></script> <script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/lib/mocha-yc.js"></script> <script src="scripts/lib/mocha-yc.js"></script>
</head> </head>
<body style="padding: 5px;"> <body style="padding: 5px;">
<!-- preferences --> <!-- preferences -->
<div class="toolbarTabs"> <div class="toolbarTabs">
@ -48,4 +50,5 @@ $('PrefWebUILink').addEvent('click', function(e) {
}); });
</script> </script>
</body> </body>
</html> </html>

92
src/webui/www/private/preferences_content.html

@ -15,12 +15,17 @@
<span id="appendexttr"> <span id="appendexttr">
<input type="checkbox" id="appendext_checkbox"/> <input type="checkbox" id="appendext_checkbox"/>
<label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]</label> <label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]</label>
</span><br/><br/> </span><br/><br/> QBT_TR(Automatically add torrents from:)QBT_TR[CONTEXT=OptionsDialog]<br/>
QBT_TR(Automatically add torrents from:)QBT_TR[CONTEXT=OptionsDialog]<br/>
<table id="watched_folders_tab" style="border: 1px solid black;"> <table id="watched_folders_tab" style="border: 1px solid black;">
<thead><tr><th>QBT_TR(Monitored Folder)QBT_TR[CONTEXT=ScanFoldersModel]</th><th>QBT_TR(Override Save Location)QBT_TR[CONTEXT=ScanFoldersModel]</th></tr></thead> <thead>
<tr>
<th>QBT_TR(Monitored Folder)QBT_TR[CONTEXT=ScanFoldersModel]</th>
<th>QBT_TR(Override Save Location)QBT_TR[CONTEXT=ScanFoldersModel]</th>
</tr>
</thead>
<tbody></tbody> <tbody></tbody>
<tfoot><tr> <tfoot>
<tr>
<td style="padding-top:4px;"><input type="text" id="new_watch_folder_txt" /></td> <td style="padding-top:4px;"><input type="text" id="new_watch_folder_txt" /></td>
<td style="padding-top:4px;"> <td style="padding-top:4px;">
<div class="select-watched-folder-editable"> <div class="select-watched-folder-editable">
@ -33,7 +38,8 @@
<img src="theme/list-add" alt="Add" style="padding-left:170px;width:16px;cursor:pointer;" onclick="addWatchFolder();" /> <img src="theme/list-add" alt="Add" style="padding-left:170px;width:16px;cursor:pointer;" onclick="addWatchFolder();" />
</div> </div>
</td> </td>
</tr></tfoot> </tr>
</tfoot>
</table><br/> </table><br/>
<input type="checkbox" id="exportdir_checkbox" onclick="updateExportDirEnabled();" /> <input type="checkbox" id="exportdir_checkbox" onclick="updateExportDirEnabled();" />
<label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]</label>&nbsp;&nbsp; <label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]</label>&nbsp;&nbsp;
@ -244,11 +250,9 @@
<legend><input type="checkbox" id="limit_sheduling_checkbox" onclick="updateSchedulingEnabled();" /> <legend><input type="checkbox" id="limit_sheduling_checkbox" onclick="updateSchedulingEnabled();" />
<label for="limit_sheduling_checkbox">QBT_TR(Schedule the use of alternative rate limits)QBT_TR[CONTEXT=OptionsDialog]</label></legend> <label for="limit_sheduling_checkbox">QBT_TR(Schedule the use of alternative rate limits)QBT_TR[CONTEXT=OptionsDialog]</label></legend>
QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog] QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]
<input type="text" id="schedule_from_hour" style="width: 1.5em;"/>:<input type="text" id="schedule_from_min" style="width: 1.5em;"/> <input type="text" id="schedule_from_hour" style="width: 1.5em;" />:<input type="text" id="schedule_from_min" style="width: 1.5em;" /> QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
<input type="text" id="schedule_to_hour" style="width: 1.5em;" />:<input type="text" id="schedule_to_min" style="width: 1.5em;" /> <input type="text" id="schedule_to_hour" style="width: 1.5em;" />:<input type="text" id="schedule_to_min" style="width: 1.5em;" />
<br/> <br/> QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
<select id="schedule_freq_select"> <select id="schedule_freq_select">
<option value="0">QBT_TR(Every day)QBT_TR[CONTEXT=OptionsDialog]</option> <option value="0">QBT_TR(Every day)QBT_TR[CONTEXT=OptionsDialog]</option>
<option value="1">QBT_TR(Weekdays)QBT_TR[CONTEXT=OptionsDialog]</option> <option value="1">QBT_TR(Weekdays)QBT_TR[CONTEXT=OptionsDialog]</option>
@ -512,7 +516,8 @@ changeWatchFolderSelect = function(item) {
if (item.value == "other") { if (item.value == "other") {
item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=HttpServer]'; item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=HttpServer]';
item.nextElementSibling.select(); item.nextElementSibling.select();
} else { }
else {
var text = item.options[item.selectedIndex].innerHTML; var text = item.options[item.selectedIndex].innerHTML;
item.nextElementSibling.value = text; item.nextElementSibling.value = text;
} }
@ -524,14 +529,14 @@ changeWatchFolderText = function(item) {
pushWatchFolder = function(pos, folder, sel, other) { pushWatchFolder = function(pos, folder, sel, other) {
var myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>"; var myinput = "<input id='text_watch_" + pos + "' type='text' value='" + folder + "'>";
var mycb = "<div class='select-watched-folder-editable'>" + var mycb = "<div class='select-watched-folder-editable'>"
"<select id ='cb_watch_" + pos + "' onchange='changeWatchFolderSelect(this)'>" + + "<select id ='cb_watch_" + pos + "' onchange='changeWatchFolderSelect(this)'>"
"<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>" + + "<option value='watch_folder'>QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
"<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>" + + "<option value='default_folder'>QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]</option>"
"<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=HttpServer]</option>" + + "<option value='other'>QBT_TR(Other...)QBT_TR[CONTEXT=HttpServer]</option>"
"</select>" + + "</select>"
"<input id='cb_watch_txt_" + pos + "' type='text' " + + "<input id='cb_watch_txt_" + pos + "' type='text' "
"onchange='changeWatchFolderText(this)' /></div>"; + "onchange='changeWatchFolderText(this)' /></div>";
WatchedFoldersTable.push([myinput, mycb]); WatchedFoldersTable.push([myinput, mycb]);
$('cb_watch_' + pos).setProperty('value', sel); $('cb_watch_' + pos).setProperty('value', sel);
@ -552,7 +557,8 @@ getWatchedFolders = function() {
var sel = $('cb_watch_' + i).getProperty('value').trim(); var sel = $('cb_watch_' + i).getProperty('value').trim();
if (sel == "other") { if (sel == "other") {
other = $('cb_watch_txt_' + i).getProperty('value').trim(); other = $('cb_watch_txt_' + i).getProperty('value').trim();
} else { }
else {
other = (sel == "watch_folder") ? 0 : 1; other = (sel == "watch_folder") ? 0 : 1;
} }
folders.set(fpath, other); folders.set(fpath, other);
@ -632,7 +638,8 @@ updatePeerProxySettings = function() {
$('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSocks5); $('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSocks5);
updatePeerProxyAuthSettings(); updatePeerProxyAuthSettings();
} }
} else { }
else {
$('peer_proxy_auth_checkbox').setProperty('disabled', !isPeerProxyTypeSelected); $('peer_proxy_auth_checkbox').setProperty('disabled', !isPeerProxyTypeSelected);
$('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSelected); $('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSelected);
updatePeerProxyAuthSettings(); updatePeerProxyAuthSettings();
@ -738,7 +745,8 @@ updateDynDnsSettings = function() {
registerDynDns = function() { registerDynDns = function() {
if ($('dyndns_select').getProperty('value').toInt() == 1) { if ($('dyndns_select').getProperty('value').toInt() == 1) {
window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration"); window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
} else { }
else {
window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration"); window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration");
} }
}; };
@ -776,7 +784,8 @@ loadPreferences = function() {
if (typeof pref.scan_dirs[folder] == "string") { if (typeof pref.scan_dirs[folder] == "string") {
other = pref.scan_dirs[folder]; other = pref.scan_dirs[folder];
sel = "other"; sel = "other";
} else { }
else {
sel = (pref.scan_dirs[folder] == 0) ? "watch_folder" : "default_folder"; sel = (pref.scan_dirs[folder] == 0) ? "watch_folder" : "default_folder";
} }
pushWatchFolder(i++, folder, sel, other); pushWatchFolder(i++, folder, sel, other);
@ -827,7 +836,8 @@ loadPreferences = function() {
if (max_connec <= 0) { if (max_connec <= 0) {
$('max_connec_checkbox').setProperty('checked', false); $('max_connec_checkbox').setProperty('checked', false);
$('max_connec_value').setProperty('value', 500); $('max_connec_value').setProperty('value', 500);
} else { }
else {
$('max_connec_checkbox').setProperty('checked', true); $('max_connec_checkbox').setProperty('checked', true);
$('max_connec_value').setProperty('value', max_connec); $('max_connec_value').setProperty('value', max_connec);
} }
@ -836,7 +846,8 @@ loadPreferences = function() {
if (max_connec_per_torrent <= 0) { if (max_connec_per_torrent <= 0) {
$('max_connec_per_torrent_checkbox').setProperty('checked', false); $('max_connec_per_torrent_checkbox').setProperty('checked', false);
$('max_connec_per_torrent_value').setProperty('value', 100); $('max_connec_per_torrent_value').setProperty('value', 100);
} else { }
else {
$('max_connec_per_torrent_checkbox').setProperty('checked', true); $('max_connec_per_torrent_checkbox').setProperty('checked', true);
$('max_connec_per_torrent_value').setProperty('value', max_connec_per_torrent); $('max_connec_per_torrent_value').setProperty('value', max_connec_per_torrent);
} }
@ -845,7 +856,8 @@ loadPreferences = function() {
if (max_uploads <= 0) { if (max_uploads <= 0) {
$('max_uploads_checkbox').setProperty('checked', false); $('max_uploads_checkbox').setProperty('checked', false);
$('max_uploads_value').setProperty('value', 8); $('max_uploads_value').setProperty('value', 8);
} else { }
else {
$('max_uploads_checkbox').setProperty('checked', true); $('max_uploads_checkbox').setProperty('checked', true);
$('max_uploads_value').setProperty('value', max_uploads); $('max_uploads_value').setProperty('value', max_uploads);
} }
@ -854,7 +866,8 @@ loadPreferences = function() {
if (max_uploads_per_torrent <= 0) { if (max_uploads_per_torrent <= 0) {
$('max_uploads_per_torrent_checkbox').setProperty('checked', false); $('max_uploads_per_torrent_checkbox').setProperty('checked', false);
$('max_uploads_per_torrent_value').setProperty('value', 4); $('max_uploads_per_torrent_value').setProperty('value', 4);
} else { }
else {
$('max_uploads_per_torrent_checkbox').setProperty('checked', true); $('max_uploads_per_torrent_checkbox').setProperty('checked', true);
$('max_uploads_per_torrent_value').setProperty('value', max_uploads_per_torrent); $('max_uploads_per_torrent_value').setProperty('value', max_uploads_per_torrent);
} }
@ -900,7 +913,8 @@ loadPreferences = function() {
var up_limit = pref.up_limit.toInt() / 1024; var up_limit = pref.up_limit.toInt() / 1024;
if (up_limit <= 0) { if (up_limit <= 0) {
$('up_limit_checkbox').setProperty('checked', false); $('up_limit_checkbox').setProperty('checked', false);
} else { }
else {
$('up_limit_checkbox').setProperty('checked', true); $('up_limit_checkbox').setProperty('checked', true);
$('up_limit_value').setProperty('value', up_limit); $('up_limit_value').setProperty('value', up_limit);
} }
@ -908,7 +922,8 @@ loadPreferences = function() {
var dl_limit = pref.dl_limit.toInt() / 1024; var dl_limit = pref.dl_limit.toInt() / 1024;
if (dl_limit <= 0) { if (dl_limit <= 0) {
$('dl_limit_checkbox').setProperty('checked', false); $('dl_limit_checkbox').setProperty('checked', false);
} else { }
else {
$('dl_limit_checkbox').setProperty('checked', true); $('dl_limit_checkbox').setProperty('checked', true);
$('dl_limit_value').setProperty('value', dl_limit); $('dl_limit_value').setProperty('value', dl_limit);
} }
@ -921,7 +936,8 @@ loadPreferences = function() {
var alt_up_limit = pref.alt_up_limit.toInt() / 1024; var alt_up_limit = pref.alt_up_limit.toInt() / 1024;
if (alt_up_limit <= 0) { if (alt_up_limit <= 0) {
$('alt_up_limit_checkbox').setProperty('checked', false); $('alt_up_limit_checkbox').setProperty('checked', false);
} else { }
else {
$('alt_up_limit_checkbox').setProperty('checked', true); $('alt_up_limit_checkbox').setProperty('checked', true);
$('alt_up_limit_value').setProperty('value', alt_up_limit); $('alt_up_limit_value').setProperty('value', alt_up_limit);
} }
@ -929,7 +945,8 @@ loadPreferences = function() {
var alt_dl_limit = pref.alt_dl_limit.toInt() / 1024; var alt_dl_limit = pref.alt_dl_limit.toInt() / 1024;
if (alt_dl_limit <= 0) { if (alt_dl_limit <= 0) {
$('alt_dl_limit_checkbox').setProperty('checked', false); $('alt_dl_limit_checkbox').setProperty('checked', false);
} else { }
else {
$('alt_dl_limit_checkbox').setProperty('checked', true); $('alt_dl_limit_checkbox').setProperty('checked', true);
$('alt_dl_limit_value').setProperty('value', alt_dl_limit); $('alt_dl_limit_value').setProperty('value', alt_dl_limit);
} }
@ -1107,18 +1124,22 @@ applyPreferences = function() {
if ($('peer_proxy_auth_checkbox').getProperty('checked')) { if ($('peer_proxy_auth_checkbox').getProperty('checked')) {
proxy_type = 4; proxy_type = 4;
proxy_auth_enabled = true; proxy_auth_enabled = true;
} else { }
else {
proxy_type = 2; proxy_type = 2;
} }
} else { }
else {
if (proxy_type_str == "socks4") { if (proxy_type_str == "socks4") {
proxy_type = 5; proxy_type = 5;
} else { }
else {
if (proxy_type_str == "http") { if (proxy_type_str == "http") {
if ($('peer_proxy_auth_checkbox').getProperty('checked')) { if ($('peer_proxy_auth_checkbox').getProperty('checked')) {
proxy_type = 3; proxy_type = 3;
proxy_auth_enabled = true; proxy_auth_enabled = true;
} else { }
else {
proxy_type = 1; proxy_type = 1;
} }
} }
@ -1302,7 +1323,8 @@ applyPreferences = function() {
// Send it to qBT // Send it to qBT
var json_str = JSON.encode(settings); var json_str = JSON.encode(settings);
new Request({url: 'api/v2/app/setPreferences', new Request({
url: 'api/v2/app/setPreferences',
method: 'post', method: 'post',
data: { data: {
'json': json_str, 'json': json_str,

96
src/webui/www/private/properties_content.html

@ -3,25 +3,44 @@
<legend><b>QBT_TR(Transfer)QBT_TR[CONTEXT=PropertiesWidget]</b></legend> <legend><b>QBT_TR(Transfer)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td class="generalLabel">QBT_TR(Time Active:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="time_elapsed"></td> <td class="generalLabel">QBT_TR(Time Active:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td class="generalLabel">QBT_TR(ETA:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="eta"></td> <td id="time_elapsed"></td>
<td class="generalLabel">QBT_TR(Connections:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="nb_connections"></td> <td class="generalLabel">QBT_TR(ETA:)QBT_TR[CONTEXT=PropertiesWidget]</td>
</tr><tr> <td id="eta"></td>
<td class="generalLabel">QBT_TR(Downloaded:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="total_downloaded"></td> <td class="generalLabel">QBT_TR(Connections:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td class="generalLabel">QBT_TR(Uploaded:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="total_uploaded"></td> <td id="nb_connections"></td>
<td class="generalLabel">QBT_TR(Seeds:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="seeds"></td> </tr>
</tr><tr> <tr>
<td class="generalLabel">QBT_TR(Download Speed:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="dl_speed"></td> <td class="generalLabel">QBT_TR(Downloaded:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td class="generalLabel">QBT_TR(Upload Speed:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="up_speed"></td> <td id="total_downloaded"></td>
<td class="generalLabel">QBT_TR(Peers:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="peers"></td> <td class="generalLabel">QBT_TR(Uploaded:)QBT_TR[CONTEXT=PropertiesWidget]</td>
</tr><tr> <td id="total_uploaded"></td>
<td class="generalLabel">QBT_TR(Download Limit:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="dl_limit"></td> <td class="generalLabel">QBT_TR(Seeds:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td class="generalLabel">QBT_TR(Upload Limit:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="up_limit"></td> <td id="seeds"></td>
<td class="generalLabel">QBT_TR(Wasted:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="total_wasted"></td> </tr>
</tr><tr> <tr>
<td class="generalLabel">QBT_TR(Share Ratio:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="share_ratio"></td> <td class="generalLabel">QBT_TR(Download Speed:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td class="generalLabel">QBT_TR(Reannounce In:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="reannounce"></td> <td id="dl_speed"></td>
<td class="generalLabel">QBT_TR(Last Seen Complete:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="last_seen"></td> <td class="generalLabel">QBT_TR(Upload Speed:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="up_speed"></td>
<td class="generalLabel">QBT_TR(Peers:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="peers"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Download Limit:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="dl_limit"></td>
<td class="generalLabel">QBT_TR(Upload Limit:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="up_limit"></td>
<td class="generalLabel">QBT_TR(Wasted:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="total_wasted"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Share Ratio:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="share_ratio"></td>
<td class="generalLabel">QBT_TR(Reannounce In:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="reannounce"></td>
<td class="generalLabel">QBT_TR(Last Seen Complete:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="last_seen"></td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>
@ -29,19 +48,32 @@
<legend><b>QBT_TR(Information)QBT_TR[CONTEXT=PropertiesWidget]</b></legend> <legend><b>QBT_TR(Information)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td class="generalLabel">QBT_TR(Total Size:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="total_size"></td> <td class="generalLabel">QBT_TR(Total Size:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td class="generalLabel">QBT_TR(Pieces:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="pieces"></td> <td id="total_size"></td>
<td class="generalLabel">QBT_TR(Created By:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="created_by"></td> <td class="generalLabel">QBT_TR(Pieces:)QBT_TR[CONTEXT=PropertiesWidget]</td>
</tr><tr> <td id="pieces"></td>
<td class="generalLabel">QBT_TR(Added On:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="addition_date"></td> <td class="generalLabel">QBT_TR(Created By:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td class="generalLabel">QBT_TR(Completed On:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="completion_date"></td> <td id="created_by"></td>
<td class="generalLabel">QBT_TR(Created On:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="creation_date"></td> </tr>
</tr><tr> <tr>
<td class="generalLabel">QBT_TR(Torrent Hash:)QBT_TR[CONTEXT=PropertiesWidget]</td><td colspan="5" id="torrent_hash"></td> <td class="generalLabel">QBT_TR(Added On:)QBT_TR[CONTEXT=PropertiesWidget]</td>
</tr><tr> <td id="addition_date"></td>
<td class="generalLabel">QBT_TR(Save Path:)QBT_TR[CONTEXT=PropertiesWidget]</td><td colspan="5" id="save_path"></td> <td class="generalLabel">QBT_TR(Completed On:)QBT_TR[CONTEXT=PropertiesWidget]</td>
</tr><tr> <td id="completion_date"></td>
<td class="generalLabel">QBT_TR(Comment:)QBT_TR[CONTEXT=PropertiesWidget]</td><td colspan="5" style="white-space: pre-wrap;" id="comment"></td> <td class="generalLabel">QBT_TR(Created On:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="creation_date"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Torrent Hash:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td colspan="5" id="torrent_hash"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Save Path:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td colspan="5" id="save_path"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Comment:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td colspan="5" style="white-space: pre-wrap;" id="comment"></td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>

3
src/webui/www/private/rename.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Rename)QBT_TR[CONTEXT=TransferListWidget]</title> <title>QBT_TR(Rename)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -51,6 +52,7 @@
}); });
</script> </script>
</head> </head>
<body> <body>
<div style="padding: 10px 10px 0px 10px;"> <div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:</p> <p style="font-weight: bold;">QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:</p>
@ -60,4 +62,5 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>

31
src/webui/www/private/scripts/client.js

@ -203,7 +203,10 @@ window.addEvent('load', function () {
} }
var categoryHash = genHash(category); var categoryHash = genHash(category);
if (category_list[categoryHash] === null) // This should not happen if (category_list[categoryHash] === null) // This should not happen
category_list[categoryHash] = {name: category, torrents: []}; category_list[categoryHash] = {
name: category,
torrents: []
};
if (!Object.contains(category_list[categoryHash].torrents, torrent['hash'])) { if (!Object.contains(category_list[categoryHash].torrents, torrent['hash'])) {
removeTorrentFromCategoryList(torrent['hash']); removeTorrentFromCategoryList(torrent['hash']);
category_list[categoryHash].torrents = category_list[categoryHash].torrents.combine([torrent['hash']]); category_list[categoryHash].torrents = category_list[categoryHash].torrents.combine([torrent['hash']]);
@ -235,10 +238,13 @@ window.addEvent('load', function () {
categoryList.empty(); categoryList.empty();
var create_link = function(hash, text, count) { var create_link = function(hash, text, count) {
var html = '<a href="#" onclick="setCategoryFilter(' + hash + ');return false;">' + var html = '<a href="#" onclick="setCategoryFilter(' + hash + ');return false;">'
'<img src="theme/inode-directory"/>' + + '<img src="theme/inode-directory"/>'
escapeHtml(text) + ' (' + count + ')' + '</a>'; + escapeHtml(text) + ' (' + count + ')' + '</a>';
var el = new Element('li', {id: hash, html: html}); var el = new Element('li', {
id: hash,
html: html
});
categoriesFilterContextMenu.addTarget(el); categoriesFilterContextMenu.addTarget(el);
return el; return el;
}; };
@ -312,7 +318,10 @@ window.addEvent('load', function () {
if (response['categories']) { if (response['categories']) {
response['categories'].each(function(category) { response['categories'].each(function(category) {
var categoryHash = genHash(category); var categoryHash = genHash(category);
category_list[categoryHash] = {name: category, torrents: []}; category_list[categoryHash] = {
name: category,
torrents: []
};
}); });
update_categories = true; update_categories = true;
} }
@ -390,7 +399,8 @@ window.addEvent('load', function () {
if (speedInTitle) { if (speedInTitle) {
document.title = "QBT_TR([D: %1, U: %2] qBittorrent %3)QBT_TR[CONTEXT=MainWindow]".replace("%1", friendlyUnit(serverState.dl_info_speed, true)).replace("%2", friendlyUnit(serverState.up_info_speed, true)).replace("%3", "${VERSION}"); document.title = "QBT_TR([D: %1, U: %2] qBittorrent %3)QBT_TR[CONTEXT=MainWindow]".replace("%1", friendlyUnit(serverState.dl_info_speed, true)).replace("%2", friendlyUnit(serverState.up_info_speed, true)).replace("%3", "${VERSION}");
document.title += " QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]"; document.title += " QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]";
}else }
else
document.title = "qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]"; document.title = "qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]";
$('DHTNodes').set('html', 'QBT_TR(DHT: %1 nodes)QBT_TR[CONTEXT=StatusBar]'.replace("%1", serverState.dht_nodes)); $('DHTNodes').set('html', 'QBT_TR(DHT: %1 nodes)QBT_TR[CONTEXT=StatusBar]'.replace("%1", serverState.dht_nodes));
@ -460,7 +470,8 @@ window.addEvent('load', function () {
// Change icon immediately to give some feedback // Change icon immediately to give some feedback
updateAltSpeedIcon(!alternativeSpeedLimits); updateAltSpeedIcon(!alternativeSpeedLimits);
new Request({url: 'api/v2/transfer/toggleSpeedLimitsMode', new Request({
url: 'api/v2/transfer/toggleSpeedLimitsMode',
method: 'post', method: 'post',
onComplete: function() { onComplete: function() {
alternativeSpeedLimits = !alternativeSpeedLimits; alternativeSpeedLimits = !alternativeSpeedLimits;
@ -680,8 +691,8 @@ var loadTorrentPeersTimer;
var syncTorrentPeersLastResponseId = 0; var syncTorrentPeersLastResponseId = 0;
var show_flags = true; var show_flags = true;
var loadTorrentPeersData = function() { var loadTorrentPeersData = function() {
if ($('prop_peers').hasClass('invisible') || if ($('prop_peers').hasClass('invisible')
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) { || $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
syncTorrentPeersLastResponseId = 0; syncTorrentPeersLastResponseId = 0;
torrentPeersTable.clear(); torrentPeersTable.clear();
return; return;

15
src/webui/www/private/scripts/contextmenu.js

@ -310,7 +310,8 @@ var TorrentsTableContextMenu = new Class({
this.hideItem('FirstLastPiecePrio'); this.hideItem('FirstLastPiecePrio');
this.showItem('SuperSeeding'); this.showItem('SuperSeeding');
this.setItemChecked('SuperSeeding', all_are_super_seeding); this.setItemChecked('SuperSeeding', all_are_super_seeding);
} else { }
else {
if (!show_seq_dl && show_f_l_piece_prio) if (!show_seq_dl && show_f_l_piece_prio)
this.menu.getElement('a[href$=FirstLastPiecePrio]').parentNode.addClass('separator'); this.menu.getElement('a[href$=FirstLastPiecePrio]').parentNode.addClass('separator');
else else
@ -354,8 +355,12 @@ var TorrentsTableContextMenu = new Class({
updateCategoriesSubMenu: function(category_list) { updateCategoriesSubMenu: function(category_list) {
var categoryList = $('contextCategoryList'); var categoryList = $('contextCategoryList');
categoryList.empty(); categoryList.empty();
categoryList.appendChild(new Element('li', {html: '<a href="javascript:torrentNewCategoryFN();"><img src="theme/list-add" alt="QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]</a>'})); categoryList.appendChild(new Element('li', {
categoryList.appendChild(new Element('li', {html: '<a href="javascript:torrentSetCategoryFN(0);"><img src="theme/edit-clear" alt="QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]</a>'})); html: '<a href="javascript:torrentNewCategoryFN();"><img src="theme/list-add" alt="QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]</a>'
}));
categoryList.appendChild(new Element('li', {
html: '<a href="javascript:torrentSetCategoryFN(0);"><img src="theme/edit-clear" alt="QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]</a>'
}));
var sortedCategories = []; var sortedCategories = [];
Object.each(category_list, function(category) { Object.each(category_list, function(category) {
@ -366,7 +371,9 @@ var TorrentsTableContextMenu = new Class({
var first = true; var first = true;
Object.each(sortedCategories, function(categoryName) { Object.each(sortedCategories, function(categoryName) {
var categoryHash = genHash(categoryName); var categoryHash = genHash(categoryName);
var el = new Element('li', {html: '<a href="javascript:torrentSetCategoryFN(\'' + categoryHash + '\');"><img src="theme/inode-directory"/> ' + escapeHtml(categoryName) + '</a>'}); var el = new Element('li', {
html: '<a href="javascript:torrentSetCategoryFN(\'' + categoryHash + '\');"><img src="theme/inode-directory"/> ' + escapeHtml(categoryName) + '</a>'
});
if (first) { if (first) {
el.addClass('separator'); el.addClass('separator');
first = false; first = false;

32
src/webui/www/private/scripts/dynamicTable.js

@ -60,8 +60,7 @@ var DynamicTable = new Class({
setupCommonEvents: function() { setupCommonEvents: function() {
var scrollFn = function() { var scrollFn = function() {
$(this.dynamicTableFixedHeaderDivId).getElements('table')[0].style.left = $(this.dynamicTableFixedHeaderDivId).getElements('table')[0].style.left = -$(this.dynamicTableDivId).scrollLeft + 'px';
-$(this.dynamicTableDivId).scrollLeft + 'px';
}.bind(this); }.bind(this);
$(this.dynamicTableDivId).addEvent('scroll', scrollFn); $(this.dynamicTableDivId).addEvent('scroll', scrollFn);
@ -131,7 +130,8 @@ var DynamicTable = new Class({
this.resizeTh = e.target.getPrevious('[class=""]'); this.resizeTh = e.target.getPrevious('[class=""]');
this.canResize = true; this.canResize = true;
e.target.getParent("tr").style.cursor = 'col-resize'; e.target.getParent("tr").style.cursor = 'col-resize';
} else { }
else {
this.canResize = false; this.canResize = false;
e.target.getParent("tr").style.cursor = ''; e.target.getParent("tr").style.cursor = '';
} }
@ -244,7 +244,10 @@ var DynamicTable = new Class({
th.addEvent('mousemove', mouseMoveFn); th.addEvent('mousemove', mouseMoveFn);
th.addEvent('mouseout', mouseOutFn); th.addEvent('mouseout', mouseOutFn);
th.makeResizable({ th.makeResizable({
modifiers : {x: '', y: ''}, modifiers: {
x: '',
y: ''
},
onBeforeStart: onBeforeStart, onBeforeStart: onBeforeStart,
onStart: onStart, onStart: onStart,
onDrag: onDrag, onDrag: onDrag,
@ -283,11 +286,16 @@ var DynamicTable = new Class({
var menuId = this.dynamicTableDivId + '_headerMenu'; var menuId = this.dynamicTableDivId + '_headerMenu';
var ul = new Element('ul', {id: menuId, class: 'contextMenu scrollableMenu'}); var ul = new Element('ul', {
id: menuId,
class: 'contextMenu scrollableMenu'
});
var createLi = function(columnName, text) { var createLi = function(columnName, text) {
var html = '<a href="#' + columnName + '" ><img src="theme/checked"/>' + escapeHtml(text) + '</a>'; var html = '<a href="#' + columnName + '" ><img src="theme/checked"/>' + escapeHtml(text) + '</a>';
return new Element('li', {html: html}); return new Element('li', {
html: html
});
}; };
var actions = {}; var actions = {};
@ -432,8 +440,7 @@ var DynamicTable = new Class({
for (var j = 0; j < trs.length; j++) for (var j = 0; j < trs.length; j++)
trs[j].getElements('td')[pos].addClass('invisible'); trs[j].getElements('td')[pos].addClass('invisible');
} }
if (this.columns[pos].onResize !== null) if (this.columns[pos].onResize !== null) {
{
this.columns[pos].onResize(columnName); this.columns[pos].onResize(columnName);
} }
}, },
@ -466,7 +473,8 @@ var DynamicTable = new Class({
trs.each(function(el, i) { trs.each(function(el, i) {
if (i % 2) { if (i % 2) {
el.addClass('alt'); el.addClass('alt');
} else { }
else {
el.removeClass('alt'); el.removeClass('alt');
} }
}.bind(this)); }.bind(this));
@ -535,8 +543,7 @@ var DynamicTable = new Class({
var rows = this.rows.getValues(); var rows = this.rows.getValues();
for (i = 0; i < rows.length; i++) for (i = 0; i < rows.length; i++) {
{
filteredRows.push(rows[i]); filteredRows.push(rows[i]);
filteredRows[rows[i].rowId] = rows[i]; filteredRows[rows[i].rowId] = rows[i];
} }
@ -642,7 +649,8 @@ var DynamicTable = new Class({
tr.removeClass('selected'); tr.removeClass('selected');
} }
} }
} else { }
else {
// Simple selection // Simple selection
this._this.selectRow(this.rowId); this._this.selectRow(this.rowId);
} }

16
src/webui/www/private/scripts/misc.js

@ -90,14 +90,14 @@ if (!Date.prototype.toISOString) {
} }
Date.prototype.toISOString = function() { Date.prototype.toISOString = function() {
return this.getUTCFullYear() + return this.getUTCFullYear()
'-' + pad(this.getUTCMonth() + 1) + + '-' + pad(this.getUTCMonth() + 1)
'-' + pad(this.getUTCDate()) + + '-' + pad(this.getUTCDate())
'T' + pad(this.getUTCHours()) + + 'T' + pad(this.getUTCHours())
':' + pad(this.getUTCMinutes()) + + ':' + pad(this.getUTCMinutes())
':' + pad(this.getUTCSeconds()) + + ':' + pad(this.getUTCSeconds())
'.' + (this.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) + + '.' + (this.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5)
'Z'; + 'Z';
}; };
}()); }());

4
src/webui/www/private/scripts/prop-files.js

@ -273,8 +273,8 @@ var filesDynTable = new Class({
var loadTorrentFilesDataTimer; var loadTorrentFilesDataTimer;
var loadTorrentFilesData = function() { var loadTorrentFilesData = function() {
if ($('prop_files').hasClass('invisible') || if ($('prop_files').hasClass('invisible')
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) { || $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
// Tab changed, don't do anything // Tab changed, don't do anything
return; return;
} }

4
src/webui/www/private/scripts/prop-general.js

@ -27,8 +27,8 @@ var clearData = function() {
var loadTorrentDataTimer; var loadTorrentDataTimer;
var loadTorrentData = function() { var loadTorrentData = function() {
if ($('prop_general').hasClass('invisible') || if ($('prop_general').hasClass('invisible')
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) { || $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
// Tab changed, don't do anything // Tab changed, don't do anything
return; return;
} }

4
src/webui/www/private/scripts/prop-trackers.js

@ -54,8 +54,8 @@ var current_hash = "";
var loadTrackersDataTimer; var loadTrackersDataTimer;
var loadTrackersData = function() { var loadTrackersData = function() {
if ($('prop_trackers').hasClass('invisible') || if ($('prop_trackers').hasClass('invisible')
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) { || $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
// Tab changed, don't do anything // Tab changed, don't do anything
return; return;
} }

4
src/webui/www/private/scripts/prop-webseeds.js

@ -54,8 +54,8 @@ var current_hash = "";
var loadWebSeedsDataTimer; var loadWebSeedsDataTimer;
var loadWebSeedsData = function() { var loadWebSeedsData = function() {
if ($('prop_webseeds').hasClass('invisible') || if ($('prop_webseeds').hasClass('invisible')
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) { || $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
// Tab changed, don't do anything // Tab changed, don't do anything
return; return;
} }

3
src/webui/www/private/setlocation.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Set location)QBT_TR[CONTEXT=HttpServer]</title> <title>QBT_TR(Set location)QBT_TR[CONTEXT=HttpServer]</title>
@ -43,6 +44,7 @@
}); });
</script> </script>
</head> </head>
<body> <body>
<div style="padding: 10px 10px 0px 10px;"> <div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Location)QBT_TR[CONTEXT=TransferListWidget]:</p> <p style="font-weight: bold;">QBT_TR(Location)QBT_TR[CONTEXT=TransferListWidget]:</p>
@ -52,4 +54,5 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>

1
src/webui/www/private/transferlist.html

@ -16,7 +16,6 @@
</div> </div>
<script> <script>
//create a context menu //create a context menu
var torrentsTableContextMenu = new TorrentsTableContextMenu({ var torrentsTableContextMenu = new TorrentsTableContextMenu({
targets: '.torrentsTableContextMenuTarget', targets: '.torrentsTableContextMenuTarget',

4
src/webui/www/private/upload.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]</title> <title>QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]</title>
@ -8,6 +9,7 @@
<script src="scripts/lib/mootools-1.2-core-yc.js"></script> <script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/download.js"></script> <script src="scripts/download.js"></script>
</head> </head>
<body> <body>
<iframe id="upload_frame" name="upload_frame" class="invisible" src="javascript:false;"></iframe> <iframe id="upload_frame" name="upload_frame" class="invisible" src="javascript:false;"></iframe>
<form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="uploadForm" style="text-align: center;" target="upload_frame"> <form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="uploadForm" style="text-align: center;" target="upload_frame">
@ -62,7 +64,6 @@
</fieldset> </fieldset>
</form> </form>
<script> <script>
var submitted = false; var submitted = false;
$('uploadForm').addEventListener("submit", function() { $('uploadForm').addEventListener("submit", function() {
@ -81,4 +82,5 @@ $('start_torrent').addEventListener('change', function() {
</script> </script>
<div id="upload_spinner" class="mochaSpinner"></div> <div id="upload_spinner" class="mochaSpinner"></div>
</body> </body>
</html> </html>

3
src/webui/www/private/uploadlimit.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>QBT_TR(Torrent Upload Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]</title> <title>QBT_TR(Torrent Upload Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -9,6 +10,7 @@
<script src="scripts/lib/mocha-yc.js"></script> <script src="scripts/lib/mocha-yc.js"></script>
<script src="scripts/lib/parametrics.js"></script> <script src="scripts/lib/parametrics.js"></script>
</head> </head>
<body> <body>
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden"> <div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
<div id="uplimitSlider" class="slider"> <div id="uplimitSlider" class="slider">
@ -59,4 +61,5 @@
</script> </script>
</body> </body>
</html> </html>

9
src/webui/www/public/login.html

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${LANG}"> <html lang="${LANG}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</title> <title>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</title>
@ -30,7 +31,8 @@
onFailure: function(xhr) { onFailure: function(xhr) {
if (xhr.responseText !== "") { if (xhr.responseText !== "") {
$('error_msg').set('html', xhr.responseText); $('error_msg').set('html', xhr.responseText);
} else { }
else {
$('error_msg').set('html', 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]'); $('error_msg').set('html', 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]');
} }
}, },
@ -38,7 +40,8 @@
if (text == "Ok.") { if (text == "Ok.") {
// Session started. Simply reload page. // Session started. Simply reload page.
window.location.reload(); window.location.reload();
} else { }
else {
$('error_msg').set('html', 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]'); $('error_msg').set('html', 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]');
} }
} }
@ -46,6 +49,7 @@
} }
</script> </script>
</head> </head>
<body> <body>
<div id="main"> <div id="main">
<h1>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</h1> <h1>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</h1>
@ -68,4 +72,5 @@
<div id="error_msg"></div> <div id="error_msg"></div>
</div> </div>
</body> </body>
</html> </html>

Loading…
Cancel
Save