Browse Source

Merge pull request #8622 from Chocobo1/formatter

Unify coding style for WebUI files
adaptive-webui-19844
Mike Tzou 7 years ago committed by GitHub
parent
commit
fa380c8b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      src/webui/www/.jsbeautifyrc
  2. 21
      src/webui/www/private/addtrackers.html
  3. 21
      src/webui/www/private/confirmdeletion.html
  4. 22
      src/webui/www/private/css/Core.css
  5. 401
      src/webui/www/private/css/Layout.css
  6. 68
      src/webui/www/private/css/Tabs.css
  7. 378
      src/webui/www/private/css/Window.css
  8. 11
      src/webui/www/private/css/dynamicTable.css
  9. 79
      src/webui/www/private/css/style.css
  10. 152
      src/webui/www/private/download.html
  11. 91
      src/webui/www/private/downloadlimit.html
  12. 26
      src/webui/www/private/filters.html
  13. 13
      src/webui/www/private/index.html
  14. 16
      src/webui/www/private/newcategory.html
  15. 73
      src/webui/www/private/preferences.html
  16. 2264
      src/webui/www/private/preferences_content.html
  17. 16
      src/webui/www/private/properties.html
  18. 116
      src/webui/www/private/properties_content.html
  19. 11
      src/webui/www/private/rename.html
  20. 215
      src/webui/www/private/scripts/client.js
  21. 49
      src/webui/www/private/scripts/contextmenu.js
  22. 2
      src/webui/www/private/scripts/download.js
  23. 2354
      src/webui/www/private/scripts/dynamicTable.js
  24. 18
      src/webui/www/private/scripts/misc.js
  25. 16
      src/webui/www/private/scripts/mocha-init.js
  26. 92
      src/webui/www/private/scripts/prop-files.js
  27. 42
      src/webui/www/private/scripts/prop-general.js
  28. 4
      src/webui/www/private/scripts/prop-trackers.js
  29. 4
      src/webui/www/private/scripts/prop-webseeds.js
  30. 11
      src/webui/www/private/setlocation.html
  31. 47
      src/webui/www/private/transferlist.html
  32. 138
      src/webui/www/private/upload.html
  33. 91
      src/webui/www/private/uploadlimit.html
  34. 2
      src/webui/www/public/css/style.css
  35. 77
      src/webui/www/public/login.html

29
src/webui/www/.jsbeautifyrc

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
{
"indent_size": 4,
"indent_char": " ",
"indent_with_tabs": false,
"eol": "\n",
"end_with_newline": true,
"indent_level": 0,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"space_in_paren": false,
"space_in_empty_paren": false,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "end-expand",
"unindent_chained_methods": false,
"break_chained_methods": false,
"keep_array_indentation": false,
"unescape_strings": false,
"wrap_line_length": 0,
"e4x": false,
"comma_first": false,
"operator_position": "after-newline",
"html": {
"js": {
"end_with_newline": false
}
}
}

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Trackers addition dialog)QBT_TR[CONTEXT=TrackersAdditionDlg]</title>
@ -7,9 +8,9 @@ @@ -7,9 +8,9 @@
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script>
window.addEvent('domready', function(){
window.addEvent('domready', function() {
$('trackersUrls').focus();
$('addTrackersButton').addEvent('click', function(e){
$('addTrackersButton').addEvent('click', function(e) {
new Event(e).stop();
var hash = new URI().getData('hash');
new Request({
@ -23,17 +24,19 @@ @@ -23,17 +24,19 @@
window.parent.closeWindows();
}
}).send();
});
});
});
</script>
</head>
<body>
<div style="text-align: center;">
<br/>
<div style="text-align: center;">
<br/>
<h2 class="vcenter">QBT_TR(List of trackers to add (one per line):)QBT_TR[CONTEXT=TrackersAdditionDlg]</h2>
<textarea name="list" id="trackersUrls" rows="10" cols="1"></textarea>
<br/>
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="addTrackersButton"/>
</div>
<textarea name="list" id="trackersUrls" rows="10" cols="1"></textarea>
<br/>
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="addTrackersButton" />
</div>
</body>
</html>

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Deletion confirmation - qBittorrent)QBT_TR[CONTEXT=confirmDeletionDlg]</title>
@ -8,13 +9,13 @@ @@ -8,13 +9,13 @@
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script>
var hashes = new URI().getData('hashes').split('|');
window.addEvent('domready', function(){
window.addEvent('domready', function() {
$('cancelBtn').focus();
$('cancelBtn').addEvent('click', function(e){
$('cancelBtn').addEvent('click', function(e) {
new Event(e).stop();
window.parent.closeWindows();
});
$('confirmBtn').addEvent('click', function(e){
$('confirmBtn').addEvent('click', function(e) {
parent.torrentsTable.deselectAll();
new Event(e).stop();
var cmd = 'api/v2/torrents/delete';
@ -34,13 +35,15 @@ @@ -34,13 +35,15 @@
});
</script>
</head>
<body>
<br/>
<br/>
<p>&nbsp;&nbsp;QBT_TR(Are you sure you want to delete the selected torrents from the transfer list?)QBT_TR[CONTEXT=HttpServer]</p>
&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id="deleteFromDiskCB"/> <label for="deleteFromDiskCB"><i>QBT_TR(Also delete the files on the hard disk)QBT_TR[CONTEXT=confirmDeletionDlg]</i></label><br/><br/>
<div style="text-align: right;">
<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>
<p>&nbsp;&nbsp;QBT_TR(Are you sure you want to delete the selected torrents from the transfer list?)QBT_TR[CONTEXT=HttpServer]</p>
&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id="deleteFromDiskCB" /> <label for="deleteFromDiskCB"><i>QBT_TR(Also delete the files on the hard disk)QBT_TR[CONTEXT=confirmDeletionDlg]</i></label><br/><br/>
<div style="text-align: right;">
<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>
</body>
</html>

22
src/webui/www/private/css/Core.css

@ -6,17 +6,17 @@ Theme: Default @@ -6,17 +6,17 @@ Theme: Default
Copyright:
Copyright (c) 2007-2009 Greg Houston, <http://greghoustondesign.com/>.
License:
MIT-style license.
Notes:
CSS rules in this file:
1. Rules required by all MochaUI components or are shared by more than one.
2. Theme specific adjustments to plugin styles.
3. Miscellaneous rules that have no better place to go.
*/
/* Required By All
@ -25,22 +25,22 @@ Notes: @@ -25,22 +25,22 @@ Notes:
/* Clears */
.clear {
clear: both;
height: 0;
clear: both;
height: 0;
}
* html .clear {
font-size: 1px;
line-height: 1px;
overflow: hidden;
visibility: hidden;
font-size: 1px;
line-height: 1px;
overflow: hidden;
visibility: hidden;
}
/* Miscellaneous
---------------------------------------------------------------- */
#themeControl {
margin-top: 2px;
margin-top: 2px;
}
@ -50,5 +50,5 @@ Notes: @@ -50,5 +50,5 @@ Notes:
/* Folder Tree */
.tree li a {
color: #3f3f3f !important;
color: #3f3f3f !important;
}

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

@ -19,184 +19,185 @@ Required by: @@ -19,184 +19,185 @@ Required by:
---------------------------------------------------------------- */
html, body {
background: #fff;
background: #fff;
}
body {
margin: 0; /* Required */
margin: 0; /* Required */
}
#desktop {
position: relative;
min-width: 400px; /* Helps keep header content from wrapping */
height: 100%;
min-height: 100%;
overflow: hidden;
cursor: default; /* Fix for issue in IE7. IE7 wants to use the I-bar text cursor */
position: relative;
min-width: 400px; /* Helps keep header content from wrapping */
height: 100%;
min-height: 100%;
overflow: hidden;
cursor: default; /* Fix for issue in IE7. IE7 wants to use the I-bar text cursor */
}
#desktopHeader {
background: #f2f2f2;
background: #f2f2f2;
}
#desktopTitlebarWrapper {
position: relative;
height: 45px;
overflow: hidden;
background: #718BA6 url(../images/skin/bg-header.gif) repeat-x;
position: relative;
height: 45px;
overflow: hidden;
background: #718BA6 url(../images/skin/bg-header.gif) repeat-x;
}
#desktopTitlebar {
padding: 7px 8px 6px 8px;
height: 32px;
background: url(../images/skin/logo.gif) no-repeat;
background-position: left 0;
padding: 7px 8px 6px 8px;
height: 32px;
background: url(../images/skin/logo.gif) no-repeat;
background-position: left 0;
}
#desktopTitlebar h1.applicationTitle {
display: none;
margin: 0;
padding: 0 5px 0 0;
font-size: 20px;
line-height: 25px;
font-weight: bold;
color: #fff;
display: none;
margin: 0;
padding: 0 5px 0 0;
font-size: 20px;
line-height: 25px;
font-weight: bold;
color: #fff;
}
#desktopTitlebar h2.tagline {
padding: 7px 0 0 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #d4dce4;
font-weight: bold;
text-align: center;
text-transform: uppercase;
padding: 7px 0 0 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #d4dce4;
font-weight: bold;
text-align: center;
text-transform: uppercase;
}
#desktopTitlebar h2.tagline .taglineEm {
color: #fff;
font-weight: bold;
color: #fff;
font-weight: bold;
}
#topNav {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
position: absolute;
right: 0;
top: 0;
color: #d4dce4;
text-align: right;
padding: 13px 10px 0 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
position: absolute;
right: 0;
top: 0;
color: #d4dce4;
text-align: right;
padding: 13px 10px 0 0;
}
#topNav a {
color: #fff;
font-weight: normal;
color: #fff;
font-weight: normal;
}
#topNav a:hover {
text-decoration: none;
text-decoration: none;
}
/* Navbar */
#desktopNavbar {
background: #f2f2f2;
/*height: 30px;*/
margin: 0 0px;
overflow: hidden; /* Remove this line if you want the menu to be backward compatible with Firefox 2 */
/* Fixes by Chris */
/*background-color: #ccc;*/
height: 20px;
border-bottom: 1px solid #3f3f3f;
background: #f2f2f2;
/*height: 30px;*/
margin: 0 0px;
overflow: hidden; /* Remove this line if you want the menu to be backward compatible with Firefox 2 */
/* Fixes by Chris */
/*background-color: #ccc;*/
height: 20px;
border-bottom: 1px solid #3f3f3f;
}
#desktopNavbar ul {
padding: 0;
margin: 0;
list-style: none;
font-size: 12px;
padding: 0;
margin: 0;
list-style: none;
font-size: 12px;
}
#desktopNavbar>ul>li {
float: left;
float: left;
}
#desktopNavbar a {
display: block;
display: block;
}
#desktopNavbar ul li a {
/*padding: 6px 10px 6px 10px;*/
color: #333;
font-weight: normal;
/* Fix by Chris */
padding: 2px 10px 6px 10px;
/*padding: 6px 10px 6px 10px;*/
color: #333;
font-weight: normal;
/* Fix by Chris */
padding: 2px 10px 6px 10px;
}
#desktopNavbar ul li a:hover {
color: #333;
/* Fix By Chris */
background-color: #fff;
color: #333;
/* Fix By Chris */
background-color: #fff;
}
#desktopNavbar ul li a.arrow-right, #desktopNavbar ul li a:hover.arrow-right {
background-image: url(../images/skin/arrow-right.gif);
background-repeat: no-repeat;
background-position: right 7px;
background-image: url(../images/skin/arrow-right.gif);
background-repeat: no-repeat;
background-position: right 7px;
}
#desktopNavbar li ul {
border: 1px solid #3f3f3f;
background: #fff url(../images/skin/bg-dropdown.gif) repeat-y;
position: absolute;
left: -999em;
z-index: 8000;
/* Fix by Chris */
margin-top: -6px;
border: 1px solid #3f3f3f;
background: #fff url(../images/skin/bg-dropdown.gif) repeat-y;
position: absolute;
left: -999em;
z-index: 8000;
/* Fix by Chris */
margin-top: -6px;
}
#desktopNavbar li:hover ul ul,
#desktopNavbar li.ieHover ul ul,
#desktopNavbar li:hover ul ul ul,
#desktopNavbar li.ieHover ul ul ul {
left: -999em;
left: -999em;
}
#desktopNavbar li ul ul { /* third-and-above-level lists */
margin: -22px 0 0 163px;
#desktopNavbar li ul ul { /* third-and-above-level lists */
margin: -22px 0 0 163px;
}
#desktopNavbar li ul li .check {
position: absolute;
top: 8px;
left: 6px;
width: 5px;
height: 5px;
background: #555;
overflow: hidden;
line-height: 1px;
font-size: 1px;
position: absolute;
top: 8px;
left: 6px;
width: 5px;
height: 5px;
background: #555;
overflow: hidden;
line-height: 1px;
font-size: 1px;
}
#desktopNavbar li ul li a {
position: relative;
/*padding: 1px 9px 1px 25px;*/
min-width: 120px;
color: #3f3f3f;
font-weight: normal;
/* Fix By Chris */
padding: 1px 10px 1px 20px; /* Reduce left padding */
position: relative;
/*padding: 1px 9px 1px 25px;*/
min-width: 120px;
color: #3f3f3f;
font-weight: normal;
/* Fix By Chris */
padding: 1px 10px 1px 20px;
/* Reduce left padding */
}
#desktopNavbar li ul li a:hover {
background: #6C98D9;
color: #fff;
-moz-border-radius: 2px;
background: #6C98D9;
color: #fff;
-moz-border-radius: 2px;
}
#desktopNavbar li ul li a:hover .check {
background: #fff;
background: #fff;
}
#desktopNavbar li:hover ul,
@ -204,45 +205,45 @@ body { @@ -204,45 +205,45 @@ body {
#desktopNavbar li li.ieHover ul,
#desktopNavbar li li li.ieHover ul,
#desktopNavbar li li:hover ul,
#desktopNavbar li li li:hover ul { /* lists nested under hovered list items */
left: auto;
#desktopNavbar li li li:hover ul { /* lists nested under hovered list items */
left: auto;
}
#desktopNavbar li:hover { /* For IE7 */
#desktopNavbar li:hover { /* For IE7 */
position: static;
}
li.divider {
margin-top: 2px;
padding-top: 3px;
border-top: 1px solid #ebebeb;
margin-top: 2px;
padding-top: 3px;
border-top: 1px solid #ebebeb;
}
#pageWrapper {
position: relative;
overflow: hidden; /* This can be set to hidden or auto */
border-top: 1px solid #909090;
border-bottom: 1px solid #909090;
/*height: 100%;*/
position: relative;
overflow: hidden; /* This can be set to hidden or auto */
border-top: 1px solid #909090;
border-bottom: 1px solid #909090;
/*height: 100%;*/
}
/* Footer */
#desktopFooterWrapper {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 30px;
overflow: hidden;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 30px;
overflow: hidden;
}
#desktopFooter {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
height: 24px;
padding: 6px 8px 0 8px;
background: #f2f2f2;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
height: 24px;
padding: 6px 8px 0 8px;
background: #f2f2f2;
}
@ -253,159 +254,159 @@ li.divider { @@ -253,159 +254,159 @@ li.divider {
/* Columns */
.column {
position: relative;
float: left;
overflow: hidden; /* Required by IE6 */
position: relative;
float: left;
overflow: hidden; /* Required by IE6 */
}
/* Panels */
.panel {
position: relative;
overflow: auto;
background: #f8f8f8;
border-bottom: 1px solid #b9b9b9;
position: relative;
overflow: auto;
background: #f8f8f8;
border-bottom: 1px solid #b9b9b9;
}
.panelWrapper.collapsed .panel-header {
border-bottom: 0;
border-bottom: 0;
}
.panelAlt {
background: #f2f2f2;
background: #f2f2f2;
}
.bottomPanel {
border-bottom: 0;
border-bottom: 0;
}
.pad {
padding: 8px;
padding: 8px;
}
#mainPanel {
background: #fff;
background: #fff;
}
.panel-header {
position: relative;
background: #f1f1f1 url(../images/skin/bg-panel-header.gif) repeat-x;
height: 30px;
overflow: hidden;
border-bottom: 1px solid #d3d3d3;
position: relative;
background: #f1f1f1 url(../images/skin/bg-panel-header.gif) repeat-x;
height: 30px;
overflow: hidden;
border-bottom: 1px solid #d3d3d3;
}
.panel-headerContent {
padding-top: 2px;
padding-top: 2px;
}
.panel-headerContent.tabs {
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left -68px;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left -68px;
}
.panel-header h2 {
display: inline-block;
font-size: 12px;
margin: 0;
padding: 3px 8px 0 8px;
height: 22px;
overflow: hidden;
color: #333;
display: inline-block;
font-size: 12px;
margin: 0;
padding: 3px 8px 0 8px;
height: 22px;
overflow: hidden;
color: #333;
}
.panel-collapse {
background: url(../images/skin/collapse-expand.gif) left top no-repeat;
background: url(../images/skin/collapse-expand.gif) left top no-repeat;
}
.panel-expand {
background: url(../images/skin/collapse-expand.gif) left -16px no-repeat;
background: url(../images/skin/collapse-expand.gif) left -16px no-repeat;
}
.icon16 {
margin: 4px 0 0 2px;
cursor: pointer;
margin: 4px 0 0 2px;
cursor: pointer;
}
/* Column and Panel Handles */
.horizontalHandle {
height: 4px;
line-height: 1px;
font-size: 1px;
overflow: hidden;
background: #eee url(../images/skin/bg-handle-horizontal.gif) repeat-x;
height: 4px;
line-height: 1px;
font-size: 1px;
overflow: hidden;
background: #eee url(../images/skin/bg-handle-horizontal.gif) repeat-x;
}
.horizontalHandle.detached .handleIcon {
background: transparent;
background: transparent;
}
.horizontalHandle .handleIcon {
margin: 0 auto;
height: 4px;
line-height: 1px;
font-size: 1px;
overflow: hidden;
background: url(../images/skin/handle-icon-horizontal.gif) center center no-repeat;
margin: 0 auto;
height: 4px;
line-height: 1px;
font-size: 1px;
overflow: hidden;
background: url(../images/skin/handle-icon-horizontal.gif) center center no-repeat;
}
.columnHandle {
min-height: 10px;
float: left;
width: 4px;
overflow: hidden;
background: #c3c3c3 url(../images/skin/handle-icon.gif) center center no-repeat;
border: 1px solid #909090;
border-top: 0;
border-bottom: 0;
min-height: 10px;
float: left;
width: 4px;
overflow: hidden;
background: #c3c3c3 url(../images/skin/handle-icon.gif) center center no-repeat;
border: 1px solid #909090;
border-top: 0;
border-bottom: 0;
}
/* Toolboxes */
.toolbox {
float: right;
margin-top: 3px;
padding: 0 5px;
height: 24px;
overflow: hidden;
text-align: right;
float: right;
margin-top: 3px;
padding: 0 5px;
height: 24px;
overflow: hidden;
text-align: right;
}
.panel-header-toolbox {
}
div.toolbox.divider { /* Have to specify div here for IE6's sake */
background: url(../images/skin/toolbox-divider.gif) repeat-y;
padding-left: 8px;
div.toolbox.divider { /* Have to specify div here for IE6's sake */
background: url(../images/skin/toolbox-divider.gif) repeat-y;
padding-left: 8px;
}
.toolbox img.disabled {
cursor: default;
cursor: default;
}
.iconWrapper {
display: inline-block;
height: 22px;
min-width: 22px;
overflow: hidden;
border: 1px solid transparent;
display: inline-block;
height: 22px;
min-width: 22px;
overflow: hidden;
border: 1px solid transparent;
}
* html .iconWrapper {
padding: 1px;
border: 0;
padding: 1px;
border: 0;
}
.iconWrapper img {
cursor: pointer;
margin: 0;
padding: 3px;
cursor: pointer;
margin: 0;
padding: 3px;
}
.iconWrapper:hover {
border: 1px solid #a0a0a0;
-moz-border-radius: 3px;
border: 1px solid #a0a0a0;
-moz-border-radius: 3px;
}
#spinnerWrapper {
@ -416,15 +417,15 @@ div.toolbox.divider { /* Have to specify div here for IE6's sake */ @@ -416,15 +417,15 @@ div.toolbox.divider { /* Have to specify div here for IE6's sake */
}
#spinner {
display: none;
background: url(../images/skin/spinner.gif) no-repeat;
width: 16px;
height: 16px;
display: none;
background: url(../images/skin/spinner.gif) no-repeat;
width: 16px;
height: 16px;
}
#desktopFooter td {
vertical-align: top;
text-align: left;
vertical-align: top;
text-align: left;
}
td.speedLabel {

68
src/webui/www/private/css/Tabs.css

@ -6,61 +6,61 @@ Theme: Default @@ -6,61 +6,61 @@ Theme: Default
Copyright:
Copyright (c) 2007-2009 Greg Houston, <http://greghoustondesign.com/>.
License:
MIT-style license.
Required by:
Tabs.js
*/
/* Toolbar Tabs */
.toolbarTabs {
padding: 0 5px 2px 2px;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left -70px;
overflow: visible;
.toolbarTabs {
padding: 0 5px 2px 2px;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left -70px;
overflow: visible;
}
.tab-menu {
padding-top: 1px;
list-style: none;
margin: 0;
padding: 0;
line-height: 16px;
font-size: 11px;
.tab-menu {
padding-top: 1px;
list-style: none;
margin: 0;
padding: 0;
line-height: 16px;
font-size: 11px;
}
.tab-menu li {
display: block;
float: left;
margin: 0 0 5px 0;
cursor: pointer;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left -35px;
display: block;
float: left;
margin: 0 0 5px 0;
cursor: pointer;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left -35px;
}
.tab-menu li.selected {
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left 0;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: left 0;
}
.tab-menu li a {
display: block;
margin-left: 8px;
padding: 6px 15px 5px 9px;
text-align: center;
font-weight: normal;
color: #181818;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: right -35px;
display: block;
margin-left: 8px;
padding: 6px 15px 5px 9px;
text-align: center;
font-weight: normal;
color: #181818;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: right -35px;
}
.tab-menu li.selected a {
color: #181818;
font-weight: bold;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: right 0;
color: #181818;
font-weight: bold;
background: url(../images/skin/tabs.gif) repeat-x;
background-position: right 0;
}

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

@ -6,12 +6,12 @@ Theme: Default @@ -6,12 +6,12 @@ Theme: Default
Copyright:
Copyright (c) 2007-2009 Greg Houston, <http://greghoustondesign.com/>.
License:
MIT-style license.
Required by:
Window.js and Modal.css
Window.js and Modal.css
*/
@ -19,160 +19,159 @@ Required by: @@ -19,160 +19,159 @@ Required by:
---------------------------------------------------------------- */
.mocha {
display: none;
overflow: hidden;
background-color: #e5e5e5;
display: none;
overflow: hidden;
background-color: #e5e5e5;
}
.mocha.isFocused {
}
.mocha.isFocused {}
.mochaOverlay {
position: absolute; /* This is also set in theme.js in order to make theme transitions smoother */
top: 0;
left: 0;
position: absolute; /* This is also set in theme.js in order to make theme transitions smoother */
top: 0;
left: 0;
}
/*
We get a little creative here in order to define a gradient in the CSS using a query
string appended to a background image.
"from" is the top color of the gradient. "to" is the bottom color of the gradient.
Both must be hex values without the leading # sign.
*/
*/
.mochaTitlebar {
width: 100%;
overflow: hidden;
background: url(../images/skin/spacer.gif?from=fafafa&to=e5e5e5);
width: 100%;
overflow: hidden;
background: url(../images/skin/spacer.gif?from=fafafa&to=e5e5e5);
}
.mochaTitlebar h3 {
font-size: 12px;
line-height: 15px;
font-weight: bold;
margin: 0;
padding: 5px 10px 4px 12px;
color: #888;
font-size: 12px;
line-height: 15px;
font-weight: bold;
margin: 0;
padding: 5px 10px 4px 12px;
color: #888;
}
.mocha.isFocused .mochaTitlebar h3 {
color: #181818;
color: #181818;
}
.mochaToolbarWrapper {
width: 100%; /* For IE */
position: relative;
height: 29px;
background: #f1f1f1;
overflow: hidden;
border-top: 1px solid #d9d9d9;
width: 100%; /* For IE */
position: relative;
height: 29px;
background: #f1f1f1;
overflow: hidden;
border-top: 1px solid #d9d9d9;
}
div.mochaToolbarWrapper.bottom {
border: 0;
border-bottom: 1px solid #d9d9d9;
border: 0;
border-bottom: 1px solid #d9d9d9;
}
.mochaToolbar {
width: 100%; /* For IE */
border-top: 1px solid #fff;
width: 100%; /* For IE */
border-top: 1px solid #fff;
}
.mochaContentBorder {
border-top: 1px solid #dadada;
border-bottom: 1px solid #dadada;
border-top: 1px solid #dadada;
border-bottom: 1px solid #dadada;
}
.mochaContentWrapper { /* Has a fixed height and scrollbars if required. */
font-size: 12px;
overflow: auto;
background: #fff;
.mochaContentWrapper { /* Has a fixed height and scrollbars if required. */
font-size: 12px;
overflow: auto;
background: #fff;
}
.mochaContent {
padding: 10px 12px;
padding: 10px 12px;
}
.mocha .handle {
position: absolute;
background: #0f0;
width: 3px;
height: 3px;
z-index: 2;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: .0;
-moz-opacity: .0;
overflow: hidden;
font-size: 1px; /* For IE6 */
position: absolute;
background: #0f0;
width: 3px;
height: 3px;
z-index: 2;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: .0;
-moz-opacity: .0;
overflow: hidden;
font-size: 1px; /* For IE6 */
}
.mocha .corner { /* Corner resize handles */
width: 10px;
height: 10px;
background: #f00;
.mocha .corner { /* Corner resize handles */
width: 10px;
height: 10px;
background: #f00;
}
.mocha .cornerSE { /* Bottom right resize handle */
width: 20px;
height: 20px;
background: #fefefe; /* This is the color of the visible resize handle */
.mocha .cornerSE { /* Bottom right resize handle */
width: 20px;
height: 20px;
background: #fefefe; /* This is the color of the visible resize handle */
}
.mochaCanvasHeader {
position: absolute;
top: 0;
left: 0;
background: transparent;
z-index: -1;
visibility: hidden;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
background: transparent;
z-index: -1;
visibility: hidden;
overflow: hidden;
}
.mochaControls {
position: absolute;
width: 52px;
top: 8px;
right: 8px;
height: 14px;
z-index: 4;
background: transparent;
position: absolute;
width: 52px;
top: 8px;
right: 8px;
height: 14px;
z-index: 4;
background: transparent;
}
.mochaCanvasControls {
position: absolute;
top: 8px;
right: 8px;
z-index: 3;
background: transparent;
position: absolute;
top: 8px;
right: 8px;
z-index: 3;
background: transparent;
}
/*
To use images for these buttons:
1. Set the useCanvasControls window option to false.
2. If you use a different button size you may need to reposition the controls.
Modify the controlsOffset window option.
Modify the controlsOffset window option.
2. Replcac the background-color with a background-image for each button.
*/
.mochaMinimizeButton, .mochaMaximizeButton, .mochaCloseButton {
float: right;
width: 14px;
height: 14px;
font-size: 1px;
cursor: pointer;
z-index: 4;
color: #666;
background-color: #fff;
margin-left: 5px;
float: right;
width: 14px;
height: 14px;
font-size: 1px;
cursor: pointer;
z-index: 4;
color: #666;
background-color: #fff;
margin-left: 5px;
}
.mochaMinimizeButton {
margin-left: 0;
margin-left: 0;
}
.mochaMaximizeButton {
@ -181,200 +180,203 @@ div.mochaToolbarWrapper.bottom { @@ -181,200 +180,203 @@ div.mochaToolbarWrapper.bottom {
.mochaCloseButton {
}
.mochaSpinner{
display: none;
position: absolute;
bottom: 7px;
left: 6px;
width: 16px;
height: 16px;
background: url(../images/skin/spinner.gif) no-repeat;
.mochaSpinner {
display: none;
position: absolute;
bottom: 7px;
left: 6px;
width: 16px;
height: 16px;
background: url(../images/skin/spinner.gif) no-repeat;
}
.mochaIframe {
width: 100%;
}
width: 100%;
}
/* Fix for IE6 select z-index issue */
.zIndexFix {
display: block;
position: absolute;
top: 0;
left: 0;
z-index: -1;
filter: mask();
width: 100px;
height: 100px;
border: 1px solid transparent;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: -1;
filter: mask();
width: 100px;
height: 100px;
border: 1px solid transparent;
}
/* Viewport overlays
---------------------------------------------------------------- */
#modalOverlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #000;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: 0;
-moz-opacity: 0;
z-index: 10000;
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #000;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: 0;
-moz-opacity: 0;
z-index: 10000;
}
/* Fix for IE6 select z-index issue */
#modalFix {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: 0;
-moz-opacity: 0;
z-index: 9999;
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: 0;
-moz-opacity: 0;
z-index: 9999;
}
/* Underlay */
#windowUnderlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #fff;
#windowUnderlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #fff;
}
* html #windowUnderlay {
position: absolute;
* html #windowUnderlay {
position: absolute;
}
/* 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 {
background-color: transparent !important;
.mocha.replaced, .mochaTitlebar.replaced, .mochaMinimizeButton.replaced,
.mochaMaximizeButton.replaced, .mochaCloseButton.replaced {
background-color: transparent !important;
}
.windowClosed {
visibility: hidden;
display: none;
position: absolute;
top: -20000px;
left: -20000px;
z-index: -1;
overflow: hidden;
visibility: hidden;
display: none;
position: absolute;
top: -20000px;
left: -20000px;
z-index: -1;
overflow: hidden;
}
.windowClosed .mochaContentBorder, .windowClosed .mochaToolbarWrapper, .windowClosed .mochaTitlebar, .windowClosed .mochaControls,
.windowClosed .mochaContentBorder, .windowClosed .mochaToolbarWrapper,
.windowClosed .mochaTitlebar, .windowClosed .mochaControls,
.windowClosed .mochaCanvasControls {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
display: none;
z-index: -1;
}
position: absolute;
top: 0;
left: 0;
visibility: hidden;
display: none;
z-index: -1;
}
/* Modals */
.modal2 {
border: 8px solid #fff;
border: 8px solid #fff;
}
.modal2 .mochaContentBorder {
border-width: 0px;
border-width: 0px;
}
/* Window Themes */
.mocha.no-canvas {
background: #e5e5e5;
border: 1px solid #555;
background: #e5e5e5;
border: 1px solid #555;
}
.mocha.no-canvas .mochaTitlebar {
background: #e5e5e5;
background: #e5e5e5;
}
.mocha.transparent .mochaTitlebar h3 {
color: #fff;
display: none;
color: #fff;
display: none;
}
.mocha.transparent .mochaContentWrapper {
background: transparent;
background: transparent;
}
.mocha.notification {
background: #cedff2;
background: #cedff2;
}
.mocha.notification .mochaTitlebar {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: .0;
-moz-opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); /* IE6 and 7*/
opacity: .0;
-moz-opacity: 0;
}
.mocha.notification .mochaContentBorder {
border-width: 0px;
border-width: 0px;
}
.mocha.notification .mochaContentWrapper {
text-align: center;
font-size: 12px;
font-weight: bold;
background: transparent;
text-align: center;
font-size: 12px;
font-weight: bold;
background: transparent;
}
/* Example Window Themes */
#about_contentWrapper {
background: #e5e5e5 url(../images/skin/logo2.gif) 3px 3px no-repeat;
background: #e5e5e5 url(../images/skin/logo2.gif) 3px 3px no-repeat;
}
#builder_contentWrapper {
background: #f5f5f7;
background: #f5f5f7;
}
#json01 .mochaTitlebar {
background: #6dd2db;
background: #6dd2db;
}
#json02 .mochaTitlebar {
background: #6db6db;
background: #6db6db;
}
#json03 .mochaTitlebar {
background: #6d92db;
background: #6d92db;
}
.jsonExample .mochaTitlebar h3 {
color: #ddd;
}
color: #ddd;
}
/* This does not work in IE6. */
.isFocused.jsonExample .mochaTitlebar h3 {
color: #fff;
color: #fff;
}
#fxmorpherExample .mochaContentWrapper {
background: #577a9e;
background: #577a9e;
}
#clock {
background: #fff;
background: #fff;
}
/* Workaround to make invisible buttons clickable */
.mochaMinimizeButton.replaced,
.mochaMaximizeButton.replaced,
.mochaCloseButton.replaced {
background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) !important;
background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) !important;
}
/* iOS iframe scrolling */

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

@ -1,11 +1,10 @@ @@ -1,11 +1,10 @@
/**************************************************************
Dynamic Table
v 0.4
**************************************************************/
.dynamicTable tbody tr {
background-color: #fff;
}
@ -34,8 +33,8 @@ @@ -34,8 +33,8 @@
}
#transferList img.stateIcon {
height: 1.3em;
vertical-align: middle;
height: 1.3em;
vertical-align: middle;
margin-bottom: -1px;
}
@ -45,7 +44,7 @@ tr.dynamicTableHeader { @@ -45,7 +44,7 @@ tr.dynamicTableHeader {
.dynamicTable {
table-layout: fixed;
width :1%;
width: 1%;
padding: 0;
border-spacing: 0;
}
@ -63,7 +62,7 @@ tr.dynamicTableHeader { @@ -63,7 +62,7 @@ tr.dynamicTableHeader {
}
.dynamicTable td {
padding:0px 4px;
padding: 0px 4px;
white-space: nowrap;
}

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

@ -1,9 +1,16 @@ @@ -1,9 +1,16 @@
/* 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; }*/
a img,:link img,:visited img { border: none; }
a img, :link img, :visited img {
border: none;
}
/*table { border-collapse: collapse; border-spacing: 0; }*/
:focus { outline: none; }
:focus {
outline: none;
}
/* Structure */
@ -100,7 +107,7 @@ pre { @@ -100,7 +107,7 @@ pre {
margin: 0 0 10px 0;
padding: 10px;
border: 1px solid #d1d7dc;
}
}
/* Dividers */
@ -116,13 +123,13 @@ hr { @@ -116,13 +123,13 @@ hr {
}
#urls {
width:90%;
height:100%;
width: 90%;
height: 100%;
}
#trackersUrls {
width:90%;
height:100%;
width: 90%;
height: 100%;
}
#Filters ul {
@ -172,45 +179,75 @@ a.propButton img { @@ -172,45 +179,75 @@ a.propButton img {
/* context menu specific */
.contextMenu { border:1px solid #999; padding:0; background:#eee; list-style-type:none; display:none;}
.contextMenu .separator { border-top:1px solid #999; }
.contextMenu li { margin:0; padding:0;}
.contextMenu {
border: 1px solid #999;
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 {
display: block;
padding: 5px 20px 5px 5px;
font-size: 12px;
text-decoration: none;
font-family: tahoma,arial,sans-serif;
font-family: tahoma, arial, sans-serif;
color: #000;
white-space: nowrap;
}
.contextMenu li a:hover { background-color:#ddd; }
.contextMenu li a.disabled { color:#ccc; font-style:italic; }
.contextMenu li a.disabled:hover { background-color:#eee; }
.contextMenu li a:hover {
background-color: #ddd;
}
.contextMenu li a.disabled {
color: #ccc;
font-style: italic;
}
.contextMenu li a.disabled:hover {
background-color: #eee;
}
.contextMenu li ul {
padding: 0;
border:1px solid #999; padding:0; background:#eee;
list-style-type:none;
border: 1px solid #999;
padding: 0;
background: #eee;
list-style-type: none;
position: absolute;
left: -999em;
z-index: 8000;
margin: -29px 0 0 100%;
width: 164px;
}
.contextMenu li ul li a {
position: relative;
}
.contextMenu li a.arrow-right, .contextMenu li a:hover.arrow-right {
background-image: url(../images/skin/arrow-right.gif);
background-repeat: no-repeat;
background-position: right center;
}
.contextMenu li:hover ul,
.contextMenu li.ieHover ul,
.contextMenu li li.ieHover ul,
.contextMenu li li li.ieHover ul,
.contextMenu li li:hover ul,
.contextMenu li li li:hover ul { /* lists nested under hovered list items */
.contextMenu li li li:hover ul { /* lists nested under hovered list items */
left: auto;
}
@ -218,7 +255,7 @@ a.propButton img { @@ -218,7 +255,7 @@ a.propButton img {
width: 16px;
height: 16px;
margin-bottom: -4px;
-ms-interpolation-mode : bicubic;
-ms-interpolation-mode: bicubic;
}
/* Sliders */
@ -280,6 +317,7 @@ a.propButton img { @@ -280,6 +317,7 @@ a.propButton img {
}
/* Mocha Customization */
#mochaToolbar {
margin-top: 5px;
}
@ -392,7 +430,8 @@ td.generalLabel { @@ -392,7 +430,8 @@ td.generalLabel {
line-height: 20px;
}
#trackersTable, #webseedsTable {
#trackersTable,
#webseedsTable {
line-height: 25px;
}
@ -425,7 +464,7 @@ td.generalLabel { @@ -425,7 +464,7 @@ td.generalLabel {
}
.select-watched-folder-editable {
position:relative;
position: relative;
background-color: white;
border: solid grey 1px;
width: 160px;

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Add Torrent Links)QBT_TR[CONTEXT=downloadFromURL]</title>
@ -8,84 +9,85 @@ @@ -8,84 +9,85 @@
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/download.js"></script>
</head>
<body>
<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">
<div style="text-align: center;">
<br/>
<h2 class="vcenter">QBT_TR(Download Torrents from their URLs or Magnet links)QBT_TR[CONTEXT=HttpServer]</h2>
<textarea id="urls" rows="10" name="urls"></textarea>
<p>QBT_TR(Only one link per line)QBT_TR[CONTEXT=HttpServer]</p>
<fieldset class="settings" style="border: 0; text-align: left;">
<div class="formRow" style="margin-top: 6px;">
<label for="savepath" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="savepath" name="savepath" style="width: 16em;"/>
</div>
<div class="formRow">
<label for="cookie" class="leftLabelLarge">QBT_TR(Cookie:)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="cookie" name="cookie" style="width: 16em;"/>
</div>
<div class="formRow">
<label for="rename" class="leftLabelLarge">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="rename" name="rename" style="width: 16em;"/>
</div>
<div class="formRow">
<label for="category" class="leftLabelLarge">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="text" id="category" name="category" style="width: 16em;"/>
</div>
<div class="formRow">
<label for="start_torrent" class="leftLabelLarge">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="start_torrent" checked="checked"/>
<input type="hidden" id="add_paused" name="paused" value="true" disabled="disabled"/>
</div>
<div class="formRow">
<label for="skip_checking" class="leftLabelLarge">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="skip_checking" name="skip_checking" value="true"/>
</div>
<div class="formRow">
<label for="root_folder" class="leftLabelLarge">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="root_folder" name="root_folder" value="true" checked="checked"/>
</div>
<div class="formRow">
<label for="sequentialDownload" class="leftLabelLarge">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true"/>
</div>
<div class="formRow">
<label for="firstLastPiecePrio" class="leftLabelLarge">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true"/>
</div>
<div class="formRow">
<label for="dlLimit" class="leftLabelLarge">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="dlLimit" name="dlLimit" style="width: 16em;" placeholder="Bytes/s"/>
</div>
<div class="formRow">
<label for="upLimit" class="leftLabelLarge">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="upLimit" name="upLimit" style="width: 16em;" placeholder="Bytes/s"/>
</div>
<div id="submitbutton" style="margin-top: 12px; text-align: center;">
<button type="submit" id="submitButton">QBT_TR(Download)QBT_TR[CONTEXT=downloadFromURL]</button>
</div>
</fieldset>
</div>
</form>
<script>
var submitted = false;
<body>
<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">
<div style="text-align: center;">
<br/>
<h2 class="vcenter">QBT_TR(Download Torrents from their URLs or Magnet links)QBT_TR[CONTEXT=HttpServer]</h2>
<textarea id="urls" rows="10" name="urls"></textarea>
<p>QBT_TR(Only one link per line)QBT_TR[CONTEXT=HttpServer]</p>
<fieldset class="settings" style="border: 0; text-align: left;">
<div class="formRow" style="margin-top: 6px;">
<label for="savepath" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="savepath" name="savepath" style="width: 16em;" />
</div>
<div class="formRow">
<label for="cookie" class="leftLabelLarge">QBT_TR(Cookie:)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="cookie" name="cookie" style="width: 16em;" />
</div>
<div class="formRow">
<label for="rename" class="leftLabelLarge">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="rename" name="rename" style="width: 16em;" />
</div>
<div class="formRow">
<label for="category" class="leftLabelLarge">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="text" id="category" name="category" style="width: 16em;" />
</div>
<div class="formRow">
<label for="start_torrent" class="leftLabelLarge">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="start_torrent" checked="checked" />
<input type="hidden" id="add_paused" name="paused" value="true" disabled="disabled" />
</div>
<div class="formRow">
<label for="skip_checking" class="leftLabelLarge">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="skip_checking" name="skip_checking" value="true" />
</div>
<div class="formRow">
<label for="root_folder" class="leftLabelLarge">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="root_folder" name="root_folder" value="true" checked="checked" />
</div>
<div class="formRow">
<label for="sequentialDownload" class="leftLabelLarge">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true" />
</div>
<div class="formRow">
<label for="firstLastPiecePrio" class="leftLabelLarge">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true" />
</div>
<div class="formRow">
<label for="dlLimit" class="leftLabelLarge">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="dlLimit" name="dlLimit" style="width: 16em;" placeholder="Bytes/s" />
</div>
<div class="formRow">
<label for="upLimit" class="leftLabelLarge">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="upLimit" name="upLimit" style="width: 16em;" placeholder="Bytes/s" />
</div>
<div id="submitbutton" style="margin-top: 12px; text-align: center;">
<button type="submit" id="submitButton">QBT_TR(Download)QBT_TR[CONTEXT=downloadFromURL]</button>
</div>
</fieldset>
</div>
</form>
<script>
var submitted = false;
$('downloadForm').addEventListener("submit", function() {
$('download_spinner').style.display = "block";
submitted = true;
});
$('downloadForm').addEventListener("submit", function() {
$('download_spinner').style.display = "block";
submitted = true;
});
$('download_frame').addEventListener("load", function() {
if (submitted)
window.parent.closeWindows();
});
$('download_frame').addEventListener("load", function() {
if (submitted)
window.parent.closeWindows();
});
$('start_torrent').addEventListener('change', function() {
$('add_paused').disabled = $('start_torrent').checked;
});
</script>
<div id="download_spinner" class="mochaSpinner"></div>
$('start_torrent').addEventListener('change', function() {
$('add_paused').disabled = $('start_torrent').checked;
});
</script>
<div id="download_spinner" class="mochaSpinner"></div>
</body>
</html>

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Torrent Download Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -9,54 +10,56 @@ @@ -9,54 +10,56 @@
<script src="scripts/lib/mocha-yc.js"></script>
<script src="scripts/lib/parametrics.js"></script>
</head>
<body>
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
<div id="dllimitSlider" class="slider">
<div id="dllimitUpdate" class="update">QBT_TR(Download limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="dllimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="dlLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]</span></div>
<div class="sliderWrapper">
<div id="dllimitSliderknob" class="sliderknob"></div>
<div id="dllimitSliderarea" class="sliderarea"></div>
</div>
<div class="clear"></div>
</div>
<script>
var hashes = new URI().getData('hashes').split('|');
setDlLimit = function() {
var limit = $("dllimitUpdatevalue").value.toInt() * 1024;
if (hashes[0] == "global") {
new Request({
url: 'api/v2/transfer/setDownloadLimit',
method: 'post',
data: {
'limit': limit
},
onComplete: function() {
window.parent.updateMainData();
window.parent.closeWindows();
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
<div id="dllimitSlider" class="slider">
<div id="dllimitUpdate" class="update">QBT_TR(Download limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="dllimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="dlLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]</span></div>
<div class="sliderWrapper">
<div id="dllimitSliderknob" class="sliderknob"></div>
<div id="dllimitSliderarea" class="sliderarea"></div>
</div>
<div class="clear"></div>
</div>
<script>
var hashes = new URI().getData('hashes').split('|');
setDlLimit = function() {
var limit = $("dllimitUpdatevalue").value.toInt() * 1024;
if (hashes[0] == "global") {
new Request({
url: 'api/v2/transfer/setDownloadLimit',
method: 'post',
data: {
'limit': limit
},
onComplete: function() {
window.parent.updateMainData();
window.parent.closeWindows();
}
}).send();
}
}).send();
}
else {
new Request({
url: 'api/v2/torrents/setDownloadLimit',
method: 'post',
data: {
'hashes': hashes.join('|'),
'limit': limit
},
onComplete: function() {
window.parent.closeWindows();
else {
new Request({
url: 'api/v2/torrents/setDownloadLimit',
method: 'post',
data: {
'hashes': hashes.join('|'),
'limit': limit
},
onComplete: function() {
window.parent.closeWindows();
}
}).send();
}
}).send();
}
}
</script>
<input type="button" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setDlLimit()"/>
</div>
}
</script>
<input type="button" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setDlLimit()" />
</div>
<script>
MochaUI.addDlLimitSlider(hashes);
</script>
<script>
MochaUI.addDlLimitSlider(hashes);
</script>
</body>
</html>

26
src/webui/www/private/filters.html

@ -17,33 +17,33 @@ @@ -17,33 +17,33 @@
<script>
var categoriesFilterContextMenu = new CategoriesFilterContextMenu({
targets : '.categoriesFilterContextMenuTarget',
menu : 'categoriesFilterMenu',
actions : {
CreateCategory : function (element, ref) {
targets: '.categoriesFilterContextMenuTarget',
menu: 'categoriesFilterMenu',
actions: {
CreateCategory: function(element, ref) {
createCategoryFN();
},
DeleteCategory : function (element, ref) {
DeleteCategory: function(element, ref) {
removeCategoryFN(element.id);
},
DeleteUnusedCategories : function (element, ref) {
DeleteUnusedCategories: function(element, ref) {
deleteUnusedCategoriesFN();
},
StartTorrentsByCategory : function (element, ref) {
StartTorrentsByCategory: function(element, ref) {
startTorrentsByCategoryFN(element.id);
},
PauseTorrentsByCategory : function (element, ref) {
PauseTorrentsByCategory: function(element, ref) {
pauseTorrentsByCategoryFN(element.id);
},
DeleteTorrentsByCategory : function (element, ref) {
DeleteTorrentsByCategory: function(element, ref) {
deleteTorrentsByCategoryFN(element.id);
}
},
offsets : {
x : -15,
y : 2
offsets: {
x: -15,
y: 2
},
onShow: function () {
onShow: function() {
this.options.element.firstChild.click();
}
});

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=10" />
@ -26,6 +27,7 @@ @@ -26,6 +27,7 @@
<script src="scripts/client.js"></script>
<script src="scripts/contextmenu.js"></script>
</head>
<body>
<div id="desktop">
<div id="desktopHeader">
@ -61,10 +63,10 @@ @@ -61,10 +63,10 @@
<li>
<a class="returnFalse">QBT_TR(&View)QBT_TR[CONTEXT=MainWindow]</a>
<ul>
<li><a id="showTopToolbarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="showStatusBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Status Bar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Status Bar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="speedInBrowserTitleBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li class="divider"><a id=StatisticsLink ><img class="MyMenuIcon" src="theme/view-statistics" alt="QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="showTopToolbarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="showStatusBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Status Bar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Status Bar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="speedInBrowserTitleBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li class="divider"><a id=StatisticsLink><img class="MyMenuIcon" src="theme/view-statistics" alt="QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]</a></li>
</ul>
</li>
<li>
@ -152,7 +154,7 @@ @@ -152,7 +154,7 @@
<tr>
<td id="DHTNodes"></td>
<td class="statusBarSeparator"></td>
<td><img id="connectionStatus" alt="Connection Status" src="images/skin/firewalled.png" style="height: 1.5em;"/></td>
<td><img id="connectionStatus" alt="Connection Status" src="images/skin/firewalled.png" style="height: 1.5em;" /></td>
<td class="statusBarSeparator"></td>
<td style="cursor:pointer;"><img id="alternativeSpeedLimits" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]" src="images/slow_off.png" /></td>
<td class="statusBarSeparator"></td>
@ -164,4 +166,5 @@ @@ -164,4 +166,5 @@
</div>
</div>
</body>
</html>

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(New Category)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -10,7 +11,7 @@ @@ -10,7 +11,7 @@
var newCategoryKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',
events: {
'enter': function (event) {
'enter': function(event) {
$('newCategoryButton').click();
event.preventDefault();
}
@ -38,13 +39,12 @@ @@ -38,13 +39,12 @@
data: {
category: categoryName
},
onComplete: function () {
onComplete: function() {
window.parent.closeWindows();
}
}).send();
}
else
{
else {
new Request({
url: 'api/v2/torrents/setCategory',
method: 'post',
@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
hashes: hashesList,
category: categoryName
},
onComplete: function () {
onComplete: function() {
window.parent.closeWindows();
}
}).send();
@ -61,13 +61,15 @@ @@ -61,13 +61,15 @@
});
</script>
</head>
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Category)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="newCategory" value="" maxlength="100" style="width: 220px;"/>
<input type="text" id="newCategory" value="" maxlength="100" style="width: 220px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="newCategoryButton"/>
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="newCategoryButton" />
</div>
</div>
</body>
</html>

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Download from URLs)QBT_TR[CONTEXT=downloadFromURL]</title>
@ -9,43 +10,45 @@ @@ -9,43 +10,45 @@
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/lib/mocha-yc.js"></script>
</head>
<body style="padding: 5px;">
<!-- preferences -->
<div class="toolbarTabs">
<ul id="preferencesTabs" class="tab-menu">
<li id="PrefDownloadsLink" class="selected"><a>QBT_TR(Downloads)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefConnectionLink"><a>QBT_TR(Connection)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefSpeedLink"><a>QBT_TR(Speed)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefBittorrentLink"><a>QBT_TR(BitTorrent)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefWebUILink"><a>QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</a></li>
</ul>
<div class="clear"></div>
</div>
<!-- preferences -->
<div class="toolbarTabs">
<ul id="preferencesTabs" class="tab-menu">
<li id="PrefDownloadsLink" class="selected"><a>QBT_TR(Downloads)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefConnectionLink"><a>QBT_TR(Connection)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefSpeedLink"><a>QBT_TR(Speed)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefBittorrentLink"><a>QBT_TR(BitTorrent)QBT_TR[CONTEXT=OptionsDialog]</a></li>
<li id="PrefWebUILink"><a>QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</a></li>
</ul>
<div class="clear"></div>
</div>
<script>
// Tabs
MochaUI.initializeTabs('preferencesTabs');
<script>
// Tabs
MochaUI.initializeTabs('preferencesTabs');
$('PrefDownloadsLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('DownloadsTab').removeClass('invisible');
});
$('PrefConnectionLink').addEvent('click', function(e){
$$('.PrefTab').addClass('invisible');
$('ConnectionTab').removeClass('invisible');
});
$('PrefSpeedLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('SpeedTab').removeClass('invisible');
});
$('PrefBittorrentLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('BittorrentTab').removeClass('invisible');
});
$('PrefWebUILink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('WebUITab').removeClass('invisible');
});
</script>
$('PrefDownloadsLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('DownloadsTab').removeClass('invisible');
});
$('PrefConnectionLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('ConnectionTab').removeClass('invisible');
});
$('PrefSpeedLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('SpeedTab').removeClass('invisible');
});
$('PrefBittorrentLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('BittorrentTab').removeClass('invisible');
});
$('PrefWebUILink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('WebUITab').removeClass('invisible');
});
</script>
</body>
</html>

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

File diff suppressed because it is too large Load Diff

16
src/webui/www/private/properties.html

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
<div class="toolbarTabs">
<ul id="propertiesTabs" class="tab-menu">
<li id="PropGeneralLink" class="selected"><a>QBT_TR(General)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropTrackersLink"><a>QBT_TR(Trackers)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropPeersLink"><a>QBT_TR(Peers)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropWebSeedsLink"><a>QBT_TR(HTTP Sources)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropFilesLink"><a>QBT_TR(Content)QBT_TR[CONTEXT=PropTabBar]</a></li>
</ul>
<div class="clear"></div>
<ul id="propertiesTabs" class="tab-menu">
<li id="PropGeneralLink" class="selected"><a>QBT_TR(General)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropTrackersLink"><a>QBT_TR(Trackers)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropPeersLink"><a>QBT_TR(Peers)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropWebSeedsLink"><a>QBT_TR(HTTP Sources)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropFilesLink"><a>QBT_TR(Content)QBT_TR[CONTEXT=PropTabBar]</a></li>
</ul>
<div class="clear"></div>
</div>

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

@ -1,49 +1,81 @@ @@ -1,49 +1,81 @@
<div id="prop_general">
<fieldset>
<legend><b>QBT_TR(Transfer)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%">
<tr>
<td class="generalLabel">QBT_TR(Time Active:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="time_elapsed"></td>
<td class="generalLabel">QBT_TR(ETA:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="eta"></td>
<td class="generalLabel">QBT_TR(Connections:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="nb_connections"></td>
</tr><tr>
<td class="generalLabel">QBT_TR(Downloaded:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="total_downloaded"></td>
<td class="generalLabel">QBT_TR(Uploaded:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="total_uploaded"></td>
<td class="generalLabel">QBT_TR(Seeds:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="seeds"></td>
</tr><tr>
<td class="generalLabel">QBT_TR(Download Speed:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="dl_speed"></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>
</table>
<legend><b>QBT_TR(Transfer)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%">
<tr>
<td class="generalLabel">QBT_TR(Time Active:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="time_elapsed"></td>
<td class="generalLabel">QBT_TR(ETA:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="eta"></td>
<td class="generalLabel">QBT_TR(Connections:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="nb_connections"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Downloaded:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="total_downloaded"></td>
<td class="generalLabel">QBT_TR(Uploaded:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="total_uploaded"></td>
<td class="generalLabel">QBT_TR(Seeds:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="seeds"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Download Speed:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="dl_speed"></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>
</table>
</fieldset>
<fieldset>
<legend><b>QBT_TR(Information)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%">
<tr>
<td class="generalLabel">QBT_TR(Total Size:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="total_size"></td>
<td class="generalLabel">QBT_TR(Pieces:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="pieces"></td>
<td class="generalLabel">QBT_TR(Created By:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="created_by"></td>
</tr><tr>
<td class="generalLabel">QBT_TR(Added On:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="addition_date"></td>
<td class="generalLabel">QBT_TR(Completed On:)QBT_TR[CONTEXT=PropertiesWidget]</td><td id="completion_date"></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>
</table>
<legend><b>QBT_TR(Information)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%">
<tr>
<td class="generalLabel">QBT_TR(Total Size:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="total_size"></td>
<td class="generalLabel">QBT_TR(Pieces:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="pieces"></td>
<td class="generalLabel">QBT_TR(Created By:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="created_by"></td>
</tr>
<tr>
<td class="generalLabel">QBT_TR(Added On:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="addition_date"></td>
<td class="generalLabel">QBT_TR(Completed On:)QBT_TR[CONTEXT=PropertiesWidget]</td>
<td id="completion_date"></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>
</table>
</fieldset>
</div>

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Rename)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -11,7 +12,7 @@ @@ -11,7 +12,7 @@
var renameKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',
events: {
'enter': function (event) {
'enter': function(event) {
$('renameButton').click();
event.preventDefault();
}
@ -42,7 +43,7 @@ @@ -42,7 +43,7 @@
hash: hash,
name: name
},
onComplete: function () {
onComplete: function() {
window.parent.closeWindows();
}
}).send();
@ -51,13 +52,15 @@ @@ -51,13 +52,15 @@
});
</script>
</head>
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="rename" value="" maxlength="100" style="width: 220px;"/>
<input type="text" id="rename" value="" maxlength="100" style="width: 220px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton"/>
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton" />
</div>
</div>
</body>
</html>

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

@ -25,15 +25,15 @@ @@ -25,15 +25,15 @@
torrentsTable = new TorrentsTable();
torrentPeersTable = new TorrentPeersTable();
var updatePropertiesPanel = function () {};
var updatePropertiesPanel = function() {};
var updateTorrentData = function () {};
var updateTrackersData = function () {};
var updateTorrentPeersData = function () {};
var updateWebSeedsData = function () {};
var updateTorrentFilesData = function () {};
var updateTorrentData = function() {};
var updateTrackersData = function() {};
var updateTorrentPeersData = function() {};
var updateWebSeedsData = function() {};
var updateTorrentFilesData = function() {};
var updateMainData = function () {};
var updateMainData = function() {};
var alternativeSpeedLimits = false;
var queueing_enabled = true;
var syncMainDataTimerPeriod = 1500;
@ -46,12 +46,12 @@ var CATEGORIES_UNCATEGORIZED = 2; @@ -46,12 +46,12 @@ var CATEGORIES_UNCATEGORIZED = 2;
var category_list = {};
var selected_category = CATEGORIES_ALL;
var setCategoryFilter = function(){};
var setCategoryFilter = function() {};
var selected_filter = getLocalStorageItem('selected_filter', 'all');
var setFilter = function(){};
var setFilter = function() {};
var loadSelectedCategory = function () {
var loadSelectedCategory = function() {
selected_category = getLocalStorageItem('selected_category', CATEGORIES_ALL);
};
loadSelectedCategory();
@ -65,9 +65,9 @@ function genHash(string) { @@ -65,9 +65,9 @@ function genHash(string) {
return hash;
}
window.addEvent('load', function () {
window.addEvent('load', function() {
var saveColumnSizes = function () {
var saveColumnSizes = function() {
var filters_width = $('Filters').getSize().x;
var properties_height_rel = $('propertiesPanel').getSize().y / Window.getSize().y;
localStorage.setItem('filters_width', filters_width);
@ -92,17 +92,17 @@ window.addEvent('load', function () { @@ -92,17 +92,17 @@ window.addEvent('load', function () {
else
filt_w = 120;
new MochaUI.Column({
id : 'filtersColumn',
placement : 'left',
onResize : saveColumnSizes,
width : filt_w,
resizeLimit : [100, 300]
id: 'filtersColumn',
placement: 'left',
onResize: saveColumnSizes,
width: filt_w,
resizeLimit: [100, 300]
});
new MochaUI.Column({
id : 'mainColumn',
placement : 'main',
width : null,
resizeLimit : [100, 300]
id: 'mainColumn',
placement: 'main',
width: null,
resizeLimit: [100, 300]
});
setCategoryFilter = function(hash) {
@ -113,7 +113,7 @@ window.addEvent('load', function () { @@ -113,7 +113,7 @@ window.addEvent('load', function () {
updateMainData();
};
setFilter = function (f) {
setFilter = function(f) {
// Visually Select the right filter
$("all_filter").removeClass("selectedFilter");
$("downloading_filter").removeClass("selectedFilter");
@ -133,22 +133,22 @@ window.addEvent('load', function () { @@ -133,22 +133,22 @@ window.addEvent('load', function () {
};
new MochaUI.Panel({
id : 'Filters',
title : 'Panel',
header : false,
padding : {
top : 0,
right : 0,
bottom : 0,
left : 0
id: 'Filters',
title: 'Panel',
header: false,
padding: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
loadMethod : 'xhr',
contentURL : 'filters.html',
onContentLoaded : function () {
loadMethod: 'xhr',
contentURL: 'filters.html',
onContentLoaded: function() {
setFilter(selected_filter);
},
column : 'filtersColumn',
height : 300
column: 'filtersColumn',
height: 300
});
initializeWindows();
@ -203,7 +203,10 @@ window.addEvent('load', function () { @@ -203,7 +203,10 @@ window.addEvent('load', function () {
}
var categoryHash = genHash(category);
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'])) {
removeTorrentFromCategoryList(torrent['hash']);
category_list[categoryHash].torrents = category_list[categoryHash].torrents.combine([torrent['hash']]);
@ -235,10 +238,13 @@ window.addEvent('load', function () { @@ -235,10 +238,13 @@ window.addEvent('load', function () {
categoryList.empty();
var create_link = function(hash, text, count) {
var html = '<a href="#" onclick="setCategoryFilter(' + hash + ');return false;">' +
'<img src="theme/inode-directory"/>' +
escapeHtml(text) + ' (' + count + ')' + '</a>';
var el = new Element('li', {id: hash, html: html});
var html = '<a href="#" onclick="setCategoryFilter(' + hash + ');return false;">'
+ '<img src="theme/inode-directory"/>'
+ escapeHtml(text) + ' (' + count + ')' + '</a>';
var el = new Element('li', {
id: hash,
html: html
});
categoriesFilterContextMenu.addTarget(el);
return el;
};
@ -281,21 +287,21 @@ window.addEvent('load', function () { @@ -281,21 +287,21 @@ window.addEvent('load', function () {
};
var syncMainDataTimer;
var syncMainData = function () {
var syncMainData = function() {
var url = new URI('api/v2/sync/maindata');
url.setData('rid', syncMainDataLastResponseId);
var request = new Request.JSON({
url : url,
noCache : true,
method : 'get',
onFailure : function () {
url: url,
noCache: true,
method: 'get',
onFailure: function() {
var errorDiv = $('error_div');
if (errorDiv)
errorDiv.set('html', 'QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]');
clearTimeout(syncMainDataTimer);
syncMainDataTimer = syncMainData.delay(2000);
},
onSuccess : function (response) {
onSuccess: function(response) {
$('error_div').set('html', '');
if (response) {
var torrentsTableSelectedRows;
@ -312,7 +318,10 @@ window.addEvent('load', function () { @@ -312,7 +318,10 @@ window.addEvent('load', function () {
if (response['categories']) {
response['categories'].each(function(category) {
var categoryHash = genHash(category);
category_list[categoryHash] = {name: category, torrents: []};
category_list[categoryHash] = {
name: category,
torrents: []
};
});
update_categories = true;
}
@ -341,7 +350,7 @@ window.addEvent('load', function () { @@ -341,7 +350,7 @@ window.addEvent('load', function () {
setupCopyEventHandler();
}
if (response['torrents_removed'])
response['torrents_removed'].each(function (hash) {
response['torrents_removed'].each(function(hash) {
torrentsTable.removeRow(hash);
removeTorrentFromCategoryList(hash);
update_categories = true; // Always to update All category
@ -350,7 +359,7 @@ window.addEvent('load', function () { @@ -350,7 +359,7 @@ window.addEvent('load', function () {
torrentsTable.altRow();
if (response['server_state']) {
var tmp = response['server_state'];
for(var k in tmp)
for (var k in tmp)
serverState[k] = tmp[k];
processServerState();
}
@ -376,7 +385,7 @@ window.addEvent('load', function () { @@ -376,7 +385,7 @@ window.addEvent('load', function () {
syncMainDataTimer = syncMainData.delay(100);
};
var processServerState = function () {
var processServerState = function() {
var transfer_info = friendlyUnit(serverState.dl_info_speed, true);
if (serverState.dl_rate_limit > 0)
transfer_info += " [" + friendlyUnit(serverState.dl_rate_limit, true) + "]";
@ -390,7 +399,8 @@ window.addEvent('load', function () { @@ -390,7 +399,8 @@ window.addEvent('load', function () {
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(Web UI)QBT_TR[CONTEXT=OptionsDialog]";
}else
}
else
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));
@ -460,16 +470,17 @@ window.addEvent('load', function () { @@ -460,16 +470,17 @@ window.addEvent('load', function () {
// Change icon immediately to give some feedback
updateAltSpeedIcon(!alternativeSpeedLimits);
new Request({url: 'api/v2/transfer/toggleSpeedLimitsMode',
method: 'post',
onComplete: function() {
alternativeSpeedLimits = !alternativeSpeedLimits;
updateMainData();
},
onFailure: function() {
// Restore icon in case of failure
updateAltSpeedIcon(alternativeSpeedLimits);
}
new Request({
url: 'api/v2/transfer/toggleSpeedLimitsMode',
method: 'post',
onComplete: function() {
alternativeSpeedLimits = !alternativeSpeedLimits;
updateMainData();
},
onFailure: function() {
// Restore icon in case of failure
updateAltSpeedIcon(alternativeSpeedLimits);
}
}).send();
});
@ -517,23 +528,23 @@ window.addEvent('load', function () { @@ -517,23 +528,23 @@ window.addEvent('load', function () {
$('StatisticsLink').addEvent('click', StatisticsLinkFN);
new MochaUI.Panel({
id : 'transferList',
title : 'Panel',
header : false,
padding : {
top : 0,
right : 0,
bottom : 0,
left : 0
id: 'transferList',
title: 'Panel',
header: false,
padding: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
loadMethod : 'xhr',
contentURL : 'transferlist.html',
onContentLoaded : function () {
loadMethod: 'xhr',
contentURL: 'transferlist.html',
onContentLoaded: function() {
updateMainData();
},
column : 'mainColumn',
onResize : saveColumnSizes,
height : null
column: 'mainColumn',
onResize: saveColumnSizes,
height: null
});
var prop_h = localStorage.getItem('properties_height_rel');
if ($defined(prop_h))
@ -541,22 +552,22 @@ window.addEvent('load', function () { @@ -541,22 +552,22 @@ window.addEvent('load', function () {
else
prop_h = Window.getSize().y / 2.0;
new MochaUI.Panel({
id : 'propertiesPanel',
title : 'Panel',
header : true,
padding : {
top : 0,
right : 0,
bottom : 0,
left : 0
id: 'propertiesPanel',
title: 'Panel',
header: true,
padding: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
contentURL : 'properties_content.html',
require : {
css : ['css/Tabs.css', 'css/dynamicTable.css'],
js : ['scripts/prop-general.js', 'scripts/prop-trackers.js', 'scripts/prop-webseeds.js', 'scripts/prop-files.js'],
contentURL: 'properties_content.html',
require: {
css: ['css/Tabs.css', 'css/dynamicTable.css'],
js: ['scripts/prop-general.js', 'scripts/prop-trackers.js', 'scripts/prop-webseeds.js', 'scripts/prop-files.js'],
},
tabsURL : 'properties.html',
tabsOnload : function() {
tabsURL: 'properties.html',
tabsOnload: function() {
MochaUI.initializeTabs('propertiesTabs');
updatePropertiesPanel = function() {
@ -572,7 +583,7 @@ window.addEvent('load', function () { @@ -572,7 +583,7 @@ window.addEvent('load', function () {
updateTorrentFilesData();
};
$('PropGeneralLink').addEvent('click', function(e){
$('PropGeneralLink').addEvent('click', function(e) {
$('prop_general').removeClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_webseeds').addClass("invisible");
@ -582,7 +593,7 @@ window.addEvent('load', function () { @@ -582,7 +593,7 @@ window.addEvent('load', function () {
localStorage.setItem('selected_tab', this.id);
});
$('PropTrackersLink').addEvent('click', function(e){
$('PropTrackersLink').addEvent('click', function(e) {
$('prop_trackers').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_webseeds').addClass("invisible");
@ -592,7 +603,7 @@ window.addEvent('load', function () { @@ -592,7 +603,7 @@ window.addEvent('load', function () {
localStorage.setItem('selected_tab', this.id);
});
$('PropPeersLink').addEvent('click', function(e){
$('PropPeersLink').addEvent('click', function(e) {
$('prop_peers').removeClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_general').addClass("invisible");
@ -602,7 +613,7 @@ window.addEvent('load', function () { @@ -602,7 +613,7 @@ window.addEvent('load', function () {
localStorage.setItem('selected_tab', this.id);
});
$('PropWebSeedsLink').addEvent('click', function(e){
$('PropWebSeedsLink').addEvent('click', function(e) {
$('prop_webseeds').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_trackers').addClass("invisible");
@ -612,7 +623,7 @@ window.addEvent('load', function () { @@ -612,7 +623,7 @@ window.addEvent('load', function () {
localStorage.setItem('selected_tab', this.id);
});
$('PropFilesLink').addEvent('click', function(e){
$('PropFilesLink').addEvent('click', function(e) {
$('prop_files').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_trackers').addClass("invisible");
@ -622,12 +633,12 @@ window.addEvent('load', function () { @@ -622,12 +633,12 @@ window.addEvent('load', function () {
localStorage.setItem('selected_tab', this.id);
});
$('propertiesPanel_collapseToggle').addEvent('click', function(e){
$('propertiesPanel_collapseToggle').addEvent('click', function(e) {
updatePropertiesPanel();
});
},
column : 'mainColumn',
height : prop_h
column: 'mainColumn',
height: prop_h
});
});
@ -679,9 +690,9 @@ keyboardEvents.activate(); @@ -679,9 +690,9 @@ keyboardEvents.activate();
var loadTorrentPeersTimer;
var syncTorrentPeersLastResponseId = 0;
var show_flags = true;
var loadTorrentPeersData = function(){
if ($('prop_peers').hasClass('invisible') ||
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
var loadTorrentPeersData = function() {
if ($('prop_peers').hasClass('invisible')
|| $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
syncTorrentPeersLastResponseId = 0;
torrentPeersTable.clear();
return;
@ -727,7 +738,7 @@ var loadTorrentPeersData = function(){ @@ -727,7 +738,7 @@ var loadTorrentPeersData = function(){
}
}
if (response['peers_removed'])
response['peers_removed'].each(function (hash) {
response['peers_removed'].each(function(hash) {
torrentPeersTable.removeRow(hash);
});
torrentPeersTable.updateTable(full_update);
@ -750,7 +761,7 @@ var loadTorrentPeersData = function(){ @@ -750,7 +761,7 @@ var loadTorrentPeersData = function(){
}).send();
};
updateTorrentPeersData = function(){
updateTorrentPeersData = function() {
clearTimeout(loadTorrentPeersTimer);
loadTorrentPeersData();
};

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

@ -174,10 +174,10 @@ var ContextMenu = new Class({ @@ -174,10 +174,10 @@ var ContextMenu = new Class({
}.bind(this));
},
updateMenuItems: function () {},
updateMenuItems: function() {},
//show menu
show: function (trigger) {
show: function(trigger) {
if (lastShownContexMenu && lastShownContexMenu != this)
lastShownContexMenu.hide();
this.fx.start(1);
@ -188,7 +188,7 @@ var ContextMenu = new Class({ @@ -188,7 +188,7 @@ var ContextMenu = new Class({
},
//hide the menu
hide: function (trigger) {
hide: function(trigger) {
if (this.shown) {
this.fx.start(0);
//this.menu.fade('out');
@ -198,42 +198,42 @@ var ContextMenu = new Class({ @@ -198,42 +198,42 @@ var ContextMenu = new Class({
return this;
},
setItemChecked: function (item, checked) {
setItemChecked: function(item, checked) {
this.menu.getElement('a[href$=' + item + ']').firstChild.style.opacity =
checked ? '1' : '0';
checked ? '1' : '0';
return this;
},
getItemChecked: function (item) {
getItemChecked: function(item) {
return '0' != this.menu.getElement('a[href$=' + item + ']').firstChild.style.opacity;
},
//hide an item
hideItem: function (item) {
hideItem: function(item) {
this.menu.getElement('a[href$=' + item + ']').parentNode.addClass('invisible');
return this;
},
//show an item
showItem: function (item) {
showItem: function(item) {
this.menu.getElement('a[href$=' + item + ']').parentNode.removeClass('invisible');
return this;
},
//disable the entire menu
disable: function () {
disable: function() {
this.options.disabled = true;
return this;
},
//enable the entire menu
enable: function () {
enable: function() {
this.options.disabled = false;
return this;
},
//execute an action
execute: function (action, element) {
execute: function(action, element) {
if (this.options.actions[action]) {
this.options.actions[action](element, this, action);
}
@ -244,7 +244,7 @@ var ContextMenu = new Class({ @@ -244,7 +244,7 @@ var ContextMenu = new Class({
var TorrentsTableContextMenu = new Class({
Extends: ContextMenu,
updateMenuItems: function () {
updateMenuItems: function() {
all_are_seq_dl = true;
there_are_seq_dl = false;
all_are_f_l_piece_prio = true;
@ -259,7 +259,7 @@ var TorrentsTableContextMenu = new Class({ @@ -259,7 +259,7 @@ var TorrentsTableContextMenu = new Class({
there_are_auto_tmm = false;
var h = torrentsTable.selectedRowsIds();
h.each(function(item, index){
h.each(function(item, index) {
var data = torrentsTable.rows.get(item).full_data;
if (data['seq_dl'] !== true)
@ -310,7 +310,8 @@ var TorrentsTableContextMenu = new Class({ @@ -310,7 +310,8 @@ var TorrentsTableContextMenu = new Class({
this.hideItem('FirstLastPiecePrio');
this.showItem('SuperSeeding');
this.setItemChecked('SuperSeeding', all_are_super_seeding);
} else {
}
else {
if (!show_seq_dl && show_f_l_piece_prio)
this.menu.getElement('a[href$=FirstLastPiecePrio]').parentNode.addClass('separator');
else
@ -351,22 +352,28 @@ var TorrentsTableContextMenu = new Class({ @@ -351,22 +352,28 @@ var TorrentsTableContextMenu = new Class({
},
updateCategoriesSubMenu : function (category_list) {
updateCategoriesSubMenu: function(category_list) {
var categoryList = $('contextCategoryList');
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', {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>'}));
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', {
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 = [];
Object.each(category_list, function (category) {
Object.each(category_list, function(category) {
sortedCategories.push(category.name);
});
sortedCategories.sort();
var first = true;
Object.each(sortedCategories, function (categoryName) {
Object.each(sortedCategories, function(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) {
el.addClass('separator');
first = false;
@ -378,7 +385,7 @@ var TorrentsTableContextMenu = new Class({ @@ -378,7 +385,7 @@ var TorrentsTableContextMenu = new Class({
var CategoriesFilterContextMenu = new Class({
Extends: ContextMenu,
updateMenuItems: function () {
updateMenuItems: function() {
var id = this.options.element.id;
if (id != CATEGORIES_ALL && id != CATEGORIES_UNCATEGORIZED)
this.showItem('DeleteCategory');

2
src/webui/www/private/scripts/download.js

@ -38,5 +38,5 @@ getSavePath = function() { @@ -38,5 +38,5 @@ getSavePath = function() {
};
$(window).addEventListener("load", function() {
getSavePath();
getSavePath();
});

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

File diff suppressed because it is too large Load Diff

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

@ -90,14 +90,14 @@ if (!Date.prototype.toISOString) { @@ -90,14 +90,14 @@ if (!Date.prototype.toISOString) {
}
Date.prototype.toISOString = function() {
return this.getUTCFullYear() +
'-' + pad(this.getUTCMonth() + 1) +
'-' + pad(this.getUTCDate()) +
'T' + pad(this.getUTCHours()) +
':' + pad(this.getUTCMinutes()) +
':' + pad(this.getUTCSeconds()) +
'.' + (this.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) +
'Z';
return this.getUTCFullYear()
+ '-' + pad(this.getUTCMonth() + 1)
+ '-' + pad(this.getUTCDate())
+ 'T' + pad(this.getUTCHours())
+ ':' + pad(this.getUTCMinutes())
+ ':' + pad(this.getUTCSeconds())
+ '.' + (this.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5)
+ 'Z';
};
}());
@ -108,7 +108,7 @@ if (!Date.prototype.toISOString) { @@ -108,7 +108,7 @@ if (!Date.prototype.toISOString) {
*/
function parseHtmlLinks(text) {
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp,"<a target='_blank' href='$1'>$1</a>");
return text.replace(exp, "<a target='_blank' href='$1'>$1</a>");
}
function escapeHtml(str) {

16
src/webui/www/private/scripts/mocha-init.js

@ -406,7 +406,7 @@ initializeWindows = function() { @@ -406,7 +406,7 @@ initializeWindows = function() {
}
};
torrentNewCategoryFN = function () {
torrentNewCategoryFN = function() {
var hashes = torrentsTable.selectedRowsIds();
if (hashes.length) {
new MochaUI.Window({
@ -425,7 +425,7 @@ initializeWindows = function() { @@ -425,7 +425,7 @@ initializeWindows = function() {
}
};
torrentSetCategoryFN = function (categoryHash) {
torrentSetCategoryFN = function(categoryHash) {
var categoryName = '';
if (categoryHash != 0)
categoryName = category_list[categoryHash].name;
@ -442,7 +442,7 @@ initializeWindows = function() { @@ -442,7 +442,7 @@ initializeWindows = function() {
}
};
createCategoryFN = function () {
createCategoryFN = function() {
new MochaUI.Window({
id: 'newCategoryPage',
title: "QBT_TR(New Category)QBT_TR[CONTEXT=CategoryFilterWidget]",
@ -459,7 +459,7 @@ initializeWindows = function() { @@ -459,7 +459,7 @@ initializeWindows = function() {
updateMainData();
};
removeCategoryFN = function (categoryHash) {
removeCategoryFN = function(categoryHash) {
var categoryName = category_list[categoryHash].name;
new Request({
url: 'api/v2/torrents/removeCategories',
@ -471,7 +471,7 @@ initializeWindows = function() { @@ -471,7 +471,7 @@ initializeWindows = function() {
setCategoryFilter(CATEGORIES_ALL);
};
deleteUnusedCategoriesFN = function () {
deleteUnusedCategoriesFN = function() {
var categories = [];
for (var hash in category_list) {
if (torrentsTable.getFilteredTorrentsNumber('all', hash) === 0)
@ -487,7 +487,7 @@ initializeWindows = function() { @@ -487,7 +487,7 @@ initializeWindows = function() {
setCategoryFilter(CATEGORIES_ALL);
};
startTorrentsByCategoryFN = function (categoryHash) {
startTorrentsByCategoryFN = function(categoryHash) {
var hashes = torrentsTable.getFilteredTorrentsHashes('all', categoryHash);
if (hashes.length) {
new Request({
@ -501,7 +501,7 @@ initializeWindows = function() { @@ -501,7 +501,7 @@ initializeWindows = function() {
}
};
pauseTorrentsByCategoryFN = function (categoryHash) {
pauseTorrentsByCategoryFN = function(categoryHash) {
var hashes = torrentsTable.getFilteredTorrentsHashes('all', categoryHash);
if (hashes.length) {
new Request({
@ -515,7 +515,7 @@ initializeWindows = function() { @@ -515,7 +515,7 @@ initializeWindows = function() {
}
};
deleteTorrentsByCategoryFN = function (categoryHash) {
deleteTorrentsByCategoryFN = function(categoryHash) {
var hashes = torrentsTable.getFilteredTorrentsHashes('all', categoryHash);
if (hashes.length) {
new MochaUI.Window({

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

@ -203,27 +203,27 @@ var filesDynTable = new Class({ @@ -203,27 +203,27 @@ var filesDynTable = new Class({
var tds = tr.getElements('td');
for (var i = 0; i < row.length; i++) {
switch (i) {
case 0:
if (row[i] > 0)
tds[i].getChildren('input')[0].set('checked', 'checked');
else
tds[i].getChildren('input')[0].removeProperty('checked');
break;
case 3:
$('pbf_' + id).setValue(row[i].toFloat());
break;
case 4:
if (!is_seed && row[i] > 0) {
tds[i].getChildren('select').set('value', row[i]);
$('comboPrio' + id).removeClass("invisible");
}
else {
if (!$('comboPrio' + id).hasClass("invisible"))
$('comboPrio' + id).addClass("invisible");
}
break;
default:
tds[i].set('html', row[i]);
case 0:
if (row[i] > 0)
tds[i].getChildren('input')[0].set('checked', 'checked');
else
tds[i].getChildren('input')[0].removeProperty('checked');
break;
case 3:
$('pbf_' + id).setValue(row[i].toFloat());
break;
case 4:
if (!is_seed && row[i] > 0) {
tds[i].getChildren('select').set('value', row[i]);
$('comboPrio' + id).removeClass("invisible");
}
else {
if (!$('comboPrio' + id).hasClass("invisible"))
$('comboPrio' + id).addClass("invisible");
}
break;
default:
tds[i].set('html', row[i]);
}
}
return true;
@ -241,29 +241,29 @@ var filesDynTable = new Class({ @@ -241,29 +241,29 @@ var filesDynTable = new Class({
for (var i = 0; i < row.length; i++) {
var td = new Element('td');
switch (i) {
case 0:
var tree_img = new Element('img', {
src: 'images/L.gif',
style: 'margin-bottom: -2px'
});
td.adopt(tree_img, createDownloadedCB(id, row[i]));
break;
case 1:
td.set('html', row[i]);
td.set('title', row[i]);
break;
case 3:
td.adopt(new ProgressBar(row[i].toFloat(), {
'id': 'pbf_' + id,
'width': 80
}));
break;
case 4:
td.adopt(createPriorityCombo(id, row[i]));
break;
default:
td.set('html', row[i]);
break;
case 0:
var tree_img = new Element('img', {
src: 'images/L.gif',
style: 'margin-bottom: -2px'
});
td.adopt(tree_img, createDownloadedCB(id, row[i]));
break;
case 1:
td.set('html', row[i]);
td.set('title', row[i]);
break;
case 3:
td.adopt(new ProgressBar(row[i].toFloat(), {
'id': 'pbf_' + id,
'width': 80
}));
break;
case 4:
td.adopt(createPriorityCombo(id, row[i]));
break;
default:
td.set('html', row[i]);
break;
}
td.injectInside(tr);
}
@ -273,8 +273,8 @@ var filesDynTable = new Class({ @@ -273,8 +273,8 @@ var filesDynTable = new Class({
var loadTorrentFilesDataTimer;
var loadTorrentFilesData = function() {
if ($('prop_files').hasClass('invisible') ||
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
if ($('prop_files').hasClass('invisible')
|| $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
// Tab changed, don't do anything
return;
}

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

@ -27,8 +27,8 @@ var clearData = function() { @@ -27,8 +27,8 @@ var clearData = function() {
var loadTorrentDataTimer;
var loadTorrentData = function() {
if ($('prop_general').hasClass('invisible') ||
$('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
if ($('prop_general').hasClass('invisible')
|| $('propertiesPanel_collapseToggle').hasClass('panel-expand')) {
// Tab changed, don't do anything
return;
}
@ -58,8 +58,8 @@ var loadTorrentData = function() { @@ -58,8 +58,8 @@ var loadTorrentData = function() {
// Update Torrent data
if (data.seeding_time > 0)
temp = "QBT_TR(%1 (%2 this session))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", friendlyDuration(data.time_elapsed))
.replace("%2", friendlyDuration(data.seeding_time));
.replace("%1", friendlyDuration(data.time_elapsed))
.replace("%2", friendlyDuration(data.seeding_time));
else
temp = friendlyDuration(data.time_elapsed);
$('time_elapsed').set('html', temp);
@ -67,28 +67,28 @@ var loadTorrentData = function() { @@ -67,28 +67,28 @@ var loadTorrentData = function() {
$('eta').set('html', friendlyDuration(data.eta));
temp = "QBT_TR(%1 (%2 max))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", data.nb_connections)
.replace("%2", data.nb_connections_limit < 0 ? "∞" : data.nb_connections_limit);
.replace("%1", data.nb_connections)
.replace("%2", data.nb_connections_limit < 0 ? "∞" : data.nb_connections_limit);
$('nb_connections').set('html', temp);
temp = "QBT_TR(%1 (%2 this session))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", friendlyUnit(data.total_downloaded))
.replace("%2", friendlyUnit(data.total_downloaded_session));
.replace("%1", friendlyUnit(data.total_downloaded))
.replace("%2", friendlyUnit(data.total_downloaded_session));
$('total_downloaded').set('html', temp);
temp = "QBT_TR(%1 (%2 this session))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", friendlyUnit(data.total_uploaded))
.replace("%2", friendlyUnit(data.total_uploaded_session));
.replace("%1", friendlyUnit(data.total_uploaded))
.replace("%2", friendlyUnit(data.total_uploaded_session));
$('total_uploaded').set('html', temp);
temp = "QBT_TR(%1 (%2 avg.))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", friendlyUnit(data.dl_speed, true))
.replace("%2", friendlyUnit(data.dl_speed_avg, true));
.replace("%1", friendlyUnit(data.dl_speed, true))
.replace("%2", friendlyUnit(data.dl_speed_avg, true));
$('dl_speed').set('html', temp);
temp = "QBT_TR(%1 (%2 avg.))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", friendlyUnit(data.up_speed, true))
.replace("%2", friendlyUnit(data.up_speed_avg, true));
.replace("%1", friendlyUnit(data.up_speed, true))
.replace("%2", friendlyUnit(data.up_speed_avg, true));
$('up_speed').set('html', temp);
temp = (data.dl_limit == -1 ? "∞" : friendlyUnit(data.dl_limit, true));
@ -100,13 +100,13 @@ var loadTorrentData = function() { @@ -100,13 +100,13 @@ var loadTorrentData = function() {
$('total_wasted').set('html', friendlyUnit(data.total_wasted));
temp = "QBT_TR(%1 (%2 total))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", data.seeds)
.replace("%2", data.seeds_total);
.replace("%1", data.seeds)
.replace("%2", data.seeds_total);
$('seeds').set('html', temp);
temp = "QBT_TR(%1 (%2 total))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", data.peers)
.replace("%2", data.peers_total);
.replace("%1", data.peers)
.replace("%2", data.peers_total);
$('peers').set('html', temp);
$('share_ratio').set('html', data.share_ratio.toFixed(2));
@ -123,9 +123,9 @@ var loadTorrentData = function() { @@ -123,9 +123,9 @@ var loadTorrentData = function() {
if (data.pieces_num != -1)
temp = "QBT_TR(%1 x %2 (have %3))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", data.pieces_num)
.replace("%2", friendlyUnit(data.piece_size))
.replace("%3", data.pieces_have);
.replace("%1", data.pieces_num)
.replace("%2", friendlyUnit(data.piece_size))
.replace("%3", data.pieces_have);
else
temp = "QBT_TR(Unknown)QBT_TR[CONTEXT=HttpServer]";
$('pieces').set('html', temp);

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

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

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

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

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Set location)QBT_TR[CONTEXT=HttpServer]</title>
@ -10,7 +11,7 @@ @@ -10,7 +11,7 @@
var setLocationKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',
events: {
'enter': function (event) {
'enter': function(event) {
$('setLocationButton').click();
event.preventDefault();
}
@ -35,7 +36,7 @@ @@ -35,7 +36,7 @@
hashes: hashesList,
location: location
},
onComplete: function () {
onComplete: function() {
window.parent.closeWindows();
}
}).send();
@ -43,13 +44,15 @@ @@ -43,13 +44,15 @@
});
</script>
</head>
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Location)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="setLocation" value="" maxlength="100" style="width: 220px;"/>
<input type="text" id="setLocation" value="" maxlength="100" style="width: 220px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="setLocationButton"/>
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="setLocationButton" />
</div>
</div>
</body>
</html>

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

@ -16,74 +16,73 @@ @@ -16,74 +16,73 @@
</div>
<script>
//create a context menu
var torrentsTableContextMenu = new TorrentsTableContextMenu({
targets : '.torrentsTableContextMenuTarget',
menu : 'torrentsTableMenu',
actions : {
Start : function (element, ref) {
targets: '.torrentsTableContextMenuTarget',
menu: 'torrentsTableMenu',
actions: {
Start: function(element, ref) {
startFN();
},
Pause : function (element, ref) {
Pause: function(element, ref) {
pauseFN();
},
ForceStart : function (element, ref) {
ForceStart: function(element, ref) {
setForceStartFN();
},
Delete : function (element, ref) {
Delete: function(element, ref) {
deleteFN();
},
SetLocation : function (element, ref) {
SetLocation: function(element, ref) {
setLocationFN();
},
Rename : function(element, ref) {
Rename: function(element, ref) {
renameFN();
},
prioTop : function (element, ref) {
prioTop: function(element, ref) {
setPriorityFN('top_prio');
},
prioUp : function (element, ref) {
prioUp: function(element, ref) {
setPriorityFN('increase_prio');
},
prioDown : function (element, ref) {
prioDown: function(element, ref) {
setPriorityFN('decrease_prio');
},
prioBottom : function (element, ref) {
prioBottom: function(element, ref) {
setPriorityFN('bottom_prio');
},
DownloadLimit : function (element, ref) {
DownloadLimit: function(element, ref) {
downloadLimitFN();
},
UploadLimit : function (element, ref) {
UploadLimit: function(element, ref) {
uploadLimitFN();
},
SequentialDownload : function (element, ref) {
SequentialDownload: function(element, ref) {
toggleSequentialDownloadFN();
},
FirstLastPiecePrio : function (element, ref) {
FirstLastPiecePrio: function(element, ref) {
toggleFirstLastPiecePrioFN();
},
AutoTorrentManagement : function (element, ref) {
AutoTorrentManagement: function(element, ref) {
autoTorrentManagementFN();
},
ForceRecheck : function (element, ref) {
ForceRecheck: function(element, ref) {
recheckFN();
},
SuperSeeding : function (element, ref) {
SuperSeeding: function(element, ref) {
setSuperSeedingFN(!ref.getItemChecked('SuperSeeding'));
}
},
offsets : {
x : -15,
y : 2
offsets: {
x: -15,
y: 2
}
});

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]</title>
@ -8,77 +9,78 @@ @@ -8,77 +9,78 @@
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/download.js"></script>
</head>
<body>
<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">
<div style="margin-top: 25px; display: inline-block; border: 1px solid lightgrey; border-radius: 4px;">
<input type="file" id="fileselect" name="fileselect[]" multiple="multiple"/>
</div>
<fieldset class="settings" style="border: 0; text-align: left;">
<div class="formRow" style="margin-top: 12px;">
<label for="savepath" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="savepath" name="savepath" style="width: 16em;"/>
</div>
<div class="formRow">
<label for="rename" class="leftLabelLarge">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="rename" name="rename" style="width: 16em;"/>
</div>
<div class="formRow">
<label for="category" class="leftLabelLarge">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="text" id="category" name="category" style="width: 16em;"/>
</div>
<div class="formRow">
<label for="start_torrent" class="leftLabelLarge">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="start_torrent" checked="checked"/>
<input type="hidden" id="add_paused" name="paused" value="true" disabled="disabled"/>
</div>
<div class="formRow">
<label for="skip_checking" class="leftLabelLarge">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="skip_checking" name="skip_checking" value="true"/>
</div>
<div class="formRow">
<label for="root_folder" class="leftLabelLarge">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="root_folder" name="root_folder" value="true" checked="checked"/>
</div>
<div class="formRow">
<label for="sequentialDownload" class="leftLabelLarge">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true"/>
</div>
<div class="formRow">
<label for="firstLastPiecePrio" class="leftLabelLarge">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true"/>
</div>
<div class="formRow">
<label for="dlLimit" class="leftLabelLarge">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="dlLimit" name="dlLimit" style="width: 16em;" placeholder="Bytes/s"/>
</div>
<div class="formRow">
<label for="upLimit" class="leftLabelLarge">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="upLimit" name="upLimit" style="width: 16em;" placeholder="Bytes/s"/>
</div>
<div id="submitbutton" style="margin-top: 30px; text-align: center;">
<button type="submit" style="font-size: 1em;">QBT_TR(Upload Torrents)QBT_TR[CONTEXT=HttpServer]</button>
</div>
</fieldset>
</form>
<script>
var submitted = false;
<body>
<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">
<div style="margin-top: 25px; display: inline-block; border: 1px solid lightgrey; border-radius: 4px;">
<input type="file" id="fileselect" name="fileselect[]" multiple="multiple" />
</div>
<fieldset class="settings" style="border: 0; text-align: left;">
<div class="formRow" style="margin-top: 12px;">
<label for="savepath" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="savepath" name="savepath" style="width: 16em;" />
</div>
<div class="formRow">
<label for="rename" class="leftLabelLarge">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="rename" name="rename" style="width: 16em;" />
</div>
<div class="formRow">
<label for="category" class="leftLabelLarge">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="text" id="category" name="category" style="width: 16em;" />
</div>
<div class="formRow">
<label for="start_torrent" class="leftLabelLarge">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="start_torrent" checked="checked" />
<input type="hidden" id="add_paused" name="paused" value="true" disabled="disabled" />
</div>
<div class="formRow">
<label for="skip_checking" class="leftLabelLarge">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="skip_checking" name="skip_checking" value="true" />
</div>
<div class="formRow">
<label for="root_folder" class="leftLabelLarge">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
<input type="checkbox" id="root_folder" name="root_folder" value="true" checked="checked" />
</div>
<div class="formRow">
<label for="sequentialDownload" class="leftLabelLarge">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true" />
</div>
<div class="formRow">
<label for="firstLastPiecePrio" class="leftLabelLarge">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
<input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true" />
</div>
<div class="formRow">
<label for="dlLimit" class="leftLabelLarge">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="dlLimit" name="dlLimit" style="width: 16em;" placeholder="Bytes/s" />
</div>
<div class="formRow">
<label for="upLimit" class="leftLabelLarge">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
<input type="text" id="upLimit" name="upLimit" style="width: 16em;" placeholder="Bytes/s" />
</div>
<div id="submitbutton" style="margin-top: 30px; text-align: center;">
<button type="submit" style="font-size: 1em;">QBT_TR(Upload Torrents)QBT_TR[CONTEXT=HttpServer]</button>
</div>
</fieldset>
</form>
<script>
var submitted = false;
$('uploadForm').addEventListener("submit", function() {
$('upload_spinner').style.display = "block";
submitted = true;
});
$('uploadForm').addEventListener("submit", function() {
$('upload_spinner').style.display = "block";
submitted = true;
});
$('upload_frame').addEventListener("load", function() {
if (submitted)
window.parent.closeWindows();
});
$('upload_frame').addEventListener("load", function() {
if (submitted)
window.parent.closeWindows();
});
$('start_torrent').addEventListener('change', function() {
$('add_paused').disabled = $('start_torrent').checked;
});
</script>
<div id="upload_spinner" class="mochaSpinner"></div>
$('start_torrent').addEventListener('change', function() {
$('add_paused').disabled = $('start_torrent').checked;
});
</script>
<div id="upload_spinner" class="mochaSpinner"></div>
</body>
</html>

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Torrent Upload Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]</title>
@ -9,54 +10,56 @@ @@ -9,54 +10,56 @@
<script src="scripts/lib/mocha-yc.js"></script>
<script src="scripts/lib/parametrics.js"></script>
</head>
<body>
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
<div id="uplimitSlider" class="slider">
<div id="uplimitUpdate" class="update">QBT_TR(Upload limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="uplimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="upLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]</span></div>
<div class="sliderWrapper">
<div id="uplimitSliderknob" class="sliderknob"></div>
<div id="uplimitSliderarea" class="sliderarea"></div>
</div>
<div class="clear"></div>
</div>
<script>
var hashes = new URI().getData('hashes').split('|');
setUpLimit = function() {
var limit = $("uplimitUpdatevalue").value.toInt() * 1024;
if (hashes[0] == "global") {
new Request({
url: 'api/v2/transfer/setUploadLimit',
method: 'post',
data: {
'limit': limit
},
onComplete: function() {
window.parent.updateMainData();
window.parent.closeWindows();
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
<div id="uplimitSlider" class="slider">
<div id="uplimitUpdate" class="update">QBT_TR(Upload limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="uplimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="upLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]</span></div>
<div class="sliderWrapper">
<div id="uplimitSliderknob" class="sliderknob"></div>
<div id="uplimitSliderarea" class="sliderarea"></div>
</div>
<div class="clear"></div>
</div>
<script>
var hashes = new URI().getData('hashes').split('|');
setUpLimit = function() {
var limit = $("uplimitUpdatevalue").value.toInt() * 1024;
if (hashes[0] == "global") {
new Request({
url: 'api/v2/transfer/setUploadLimit',
method: 'post',
data: {
'limit': limit
},
onComplete: function() {
window.parent.updateMainData();
window.parent.closeWindows();
}
}).send();
}
}).send();
}
else {
new Request({
url: 'api/v2/torrents/setUploadLimit',
method: 'post',
data: {
'hashes': hashes.join('|'),
'limit': limit
},
onComplete: function() {
window.parent.closeWindows();
else {
new Request({
url: 'api/v2/torrents/setUploadLimit',
method: 'post',
data: {
'hashes': hashes.join('|'),
'limit': limit
},
onComplete: function() {
window.parent.closeWindows();
}
}).send();
}
}).send();
}
}
</script>
<input type="button" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setUpLimit()"/>
</div>
}
</script>
<input type="button" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setUpLimit()" />
</div>
<script>
MochaUI.addUpLimitSlider(hashes);
</script>
<script>
MochaUI.addUpLimitSlider(hashes);
</script>
</body>
</html>

2
src/webui/www/public/css/style.css

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

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

@ -1,5 +1,6 @@ @@ -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 @@ @@ -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 @@ @@ -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>

Loading…
Cancel
Save