Browse Source

Merge pull request #3240 from ngosang/webui_interface

[Web UI] Changes in menus, new features and reordered Options.
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
a22137e06e
  1. 16
      src/webui/www/private/index.html
  2. 7
      src/webui/www/public/about.html
  3. 1
      src/webui/www/public/css/Layout.css
  4. 424
      src/webui/www/public/css/style.css
  5. 27
      src/webui/www/public/preferences.html
  6. 233
      src/webui/www/public/preferences_content.html
  7. 30
      src/webui/www/public/scripts/client.js
  8. 18
      src/webui/www/public/scripts/dynamicTable.js
  9. 20
      src/webui/www/public/scripts/mocha-init.js

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

@ -48,14 +48,21 @@ @@ -48,14 +48,21 @@
<li><a id="pauseAllLink"><img class="MyMenuIcon" alt="QBT_TR(P&ause All)QBT_TR" src="theme/media-playback-pause" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(P&ause All)QBT_TR</a></li>
<li class="divider"><a id="resumeLink"><img class="MyMenuIcon" alt="QBT_TR(&Resume)QBT_TR" src="theme/media-playback-start" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Resume)QBT_TR</a></li>
<li><a id="pauseLink"><img class="MyMenuIcon" src="theme/media-playback-pause" alt="QBT_TR(&Pause)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Pause)QBT_TR</a></li>
<li><a id="recheckLink"><img class="MyMenuIcon" src="theme/document-edit-verify" alt="QBT_TR(Force recheck)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Force recheck)QBT_TR</a></li>
<li class="divider"><a id="deleteLink"><img class="MyMenuIcon" src="theme/list-remove" alt="QBT_TR(&Delete)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Delete)QBT_TR</a></li>
<span id="queueingLinks">
<li class="divider"><a id="topPrioLink"><img class="MyMenuIcon" src="theme/go-top" alt="QBT_TR(Top Priority)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Top Priority)QBT_TR</a></li>
<li><a id="increasePrioLink"><img class="MyMenuIcon" src="theme/go-up" alt="QBT_TR(Increase Priority)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Increase Priority)QBT_TR</a></li>
<li><a id="decreasePrioLink"><img class="MyMenuIcon" src="theme/go-down" alt="QBT_TR(Decrease Priority)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Decrease Priority)QBT_TR</a></li>
<li><a id="bottomPrioLink"><img class="MyMenuIcon" src="theme/go-bottom" alt="QBT_TR(Minimum Priority)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Minimum Priority)QBT_TR</a></li>
</span>
<li class="divider"><a id="recheckLink"><img class="MyMenuIcon" src="theme/document-edit-verify" alt="QBT_TR(Force Recheck)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Force Recheck)QBT_TR</a></li>
</ul>
</li>
<li>
<a class="returnFalse">QBT_TR(&View)QBT_TR</a>
<ul>
<li><a id="speedInBrowserTitleBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Speed in title bar)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Speed in title bar)QBT_TR</a></li>
<li><a id="showTopToolbarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Top Toolbar)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Top Toolbar)QBT_TR</a></li>
<li><a id="speedInBrowserTitleBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(S&peed in Title Bar)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(S&peed in Title Bar)QBT_TR</a></li>
</ul>
</li>
<li>
@ -67,9 +74,8 @@ @@ -67,9 +74,8 @@
<li>
<a class="returnFalse">QBT_TR(&Help)QBT_TR</a>
<ul>
<li><a id="bugLink" target="_blank" href="http://bugs.qbittorrent.org/"><img class="MyMenuIcon" src="theme/tools-report-bug" alt="QBT_TR(Report a &bug)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Report a &bug)QBT_TR</a></li>
<li><a id="siteLink" target="_blank" href="http://www.qbittorrent.org/"><img class="MyMenuIcon" src="images/skin/qbittorrent16.png" alt="QBT_TR(Visit &Website)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Visit &Website)QBT_TR</a></li>
<li><a id="docsLink" target="_blank" href="http://wiki.qbittorrent.org/"><img class="MyMenuIcon" src="theme/help-contents" alt="QBT_TR(&Documentation)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Documentation)QBT_TR</a></li>
<li class="divider"><a id="bugLink" target="_blank" href="http://sourceforge.net/donate/index.php?group_id=163414"><img class="MyMenuIcon" src="theme/wallet-open" alt="QBT_TR(Do&nate!)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(Do&nate!)QBT_TR</a></li>
<li><a id="aboutLink"><img class="MyMenuIcon" src="theme/help-about" alt="QBT_TR(&About)QBT_TR" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&About)QBT_TR</a></li>
</ul>
</li>
@ -77,8 +83,8 @@ @@ -77,8 +83,8 @@
</div>
<div id="mochaToolbar">
&nbsp;&nbsp;
<a id="uploadButton"><img class="mochaToolButton" title="QBT_TR(&Add Torrent File...)QBT_TR" src="theme/list-add" alt="QBT_TR(&Add Torrent File...)QBT_TR" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="downloadButton"><img class="mochaToolButton" title="QBT_TR(Add Torrent &Link...)QBT_TR" src="theme/insert-link" alt="QBT_TR(Add Torrent &Link...)QBT_TR" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="uploadButton"><img class="mochaToolButton" title="QBT_TR(&Add Torrent File...)QBT_TR" src="theme/list-add" alt="QBT_TR(&Add Torrent File...)QBT_TR" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="deleteButton" class="divider"><img class="mochaToolButton" title="QBT_TR(Delete)QBT_TR" src="theme/list-remove" alt="QBT_TR(Delete)QBT_TR" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="resumeButton" class="divider"><img class="mochaToolButton" title="QBT_TR(Resume)QBT_TR" src="theme/media-playback-start" alt="QBT_TR(Resume)QBT_TR" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="pauseButton"><img class="mochaToolButton" title="QBT_TR(Pause)QBT_TR" src="theme/media-playback-pause" alt="QBT_TR(Pause)QBT_TR" width="24" height="24" onload="fixPNG(this)"/></a>

7
src/webui/www/public/about.html

@ -1,7 +1,10 @@ @@ -1,7 +1,10 @@
<img src="images/skin/mascot.png" align="right"></img>
<p>qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR</p>
<h3>qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR</h3>
<p>QBT_TR(An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar.)QBT_TR</p>
<p>Copyright (c) 2011-2015 The qBittorrent project</p>
<p>QBT_TR(Home Page: )QBT_TR <a href="http://www.qbittorrent.org">http://www.qbittorrent.org</a></p>
<p>QBT_TR(Bug Tracker: )QBT_TR <a href="http://bugs.qbittorrent.org">http://bugs.qbittorrent.org</a></p>
<p>QBT_TR(Forum: )QBT_TR <a href="http://forum.qbittorrent.org">http://forum.qbittorrent.org</a></p>
<p>QBT_TR(IRC: #qbittorrent on Freenode)QBT_TR</p>
<h3>QBT_TR(Original authors)QBT_TR</h3>
<a href="mailto:ishanarora@gmail.com">Ishan Arora</a>, <a href="mailto:ank.iitd@gmail.com">Ankit Gupta</a>, <a href="mailto:shikhar.ap@gmail.com">Chandan Shikhar Dua</a> and <a href="mailto:swapnil.iitd@gmail.com">Swapnil Kumar</a>.

1
src/webui/www/public/css/Layout.css

@ -108,7 +108,6 @@ body { @@ -108,7 +108,6 @@ body {
/* Fixes by Chris */
/*background-color: #ccc;*/
height: 20px;
margin-bottom: 5px;
border-bottom: 1px solid #3f3f3f;
}

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

@ -8,396 +8,408 @@ a img,:link img,:visited img { border: none; } @@ -8,396 +8,408 @@ a img,:link img,:visited img { border: none; }
/* Structure */
body {
margin: 0;
text-align: left;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 18px;
color: #555;
margin: 0;
text-align: left;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 18px;
color: #555;
}
.aside {
width: 300px;
width: 300px;
}
.invisible {
display: none;
display: none;
}
/* Typography */
h2, h3, h4 {
margin: 0;
padding: 0 0 5px 0;
font-size: 12px;
font-weight: bold;
color: #333;
margin: 0;
padding: 0 0 5px 0;
font-size: 12px;
font-weight: bold;
color: #333;
}
h2 {
font-size: 14px;
color: #555;
font-weight: bold;
font-size: 14px;
color: #555;
font-weight: bold;
}
#mochaPage h3 {
display: block;
font-size: 12px;
padding: 6px 0 6px 0;
margin: 0 0 8px 0;
border-bottom: 1px solid #bbb;
display: block;
font-size: 12px;
padding: 6px 0 6px 0;
margin: 0 0 8px 0;
border-bottom: 1px solid #bbb;
}
#error_div {
color: #f00;
font-weight: bold;
color: #f00;
font-weight: bold;
}
h4 {
font-size: 11px;
font-size: 11px;
}
a {
color: #e60;
text-decoration: none;
cursor: pointer;
color: #e60;
text-decoration: none;
cursor: pointer;
}
a:hover {
text-decoration: none;
text-decoration: none;
}
p {
margin: 0;
padding: 0 0 9px 0;
margin: 0;
padding: 0 0 9px 0;
}
/* List Elements */
ul {
list-style: outside;
margin: 0 0 9px 16px;
list-style: outside;
margin: 0 0 9px 16px;
}
dt {
font-weight: bold;
}
font-weight: bold;
}
dd {
padding: 0 0 9px 0;
}
padding: 0 0 9px 0;
}
/* Code */
pre {
background-color: #f6f6f6;
color: #006600;
display: block;
font-family: 'Courier New', Courier, monospace;
font-size: 11px;
max-height: 250px;
overflow: auto;
margin: 0 0 10px 0;
padding: 10px;
border: 1px solid #d1d7dc;
}
background-color: #f6f6f6;
color: #006600;
display: block;
font-family: 'Courier New', Courier, monospace;
font-size: 11px;
max-height: 250px;
overflow: auto;
margin: 0 0 10px 0;
padding: 10px;
border: 1px solid #d1d7dc;
}
/* Dividers */
hr {
background-color: #ddd;
color: #ccc;
height: 1px;
border: 0px;
background-color: #ddd;
color: #ccc;
height: 1px;
border: 0px;
}
.vcenter {
vertical-align: middle;
vertical-align: middle;
}
#urls {
width:90%;
height:100%;
width:90%;
height:100%;
}
#trackersUrls {
width:90%;
height:100%;
width:90%;
height:100%;
}
#Filters ul {
list-style-type: none;
list-style-type: none;
}
#Filters ul li {
margin-left: -16px;
margin-left: -16px;
}
#Filters ul img {
padding: 2px 4px;
vertical-align: middle;
width: 16px;
height: 16px;
padding: 2px 4px;
vertical-align: middle;
width: 16px;
height: 16px;
}
.selectedFilter {
background-color: #354158;
color: #000;
background-color: #354158;
color: #000;
}
#properties {
background-color: #e5e5e5;
background-color: #e5e5e5;
}
a.propButton {
border: 1px solid rgb(85, 81, 91);
/*border-radius: 3px;*/
padding: 2px;
margin-left: 3px;
margin-right: 3px;
border: 1px solid rgb(85, 81, 91);
/*border-radius: 3px;*/
padding: 2px;
margin-left: 3px;
margin-right: 3px;
}
a.propButton img {
margin-bottom: -4px;
margin-bottom: -4px;
}
/* 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 10px 5px 5px; font-size:12px; text-decoration:none; font-family:tahoma,arial,sans-serif; color:#000; }
#contextmenu li a:hover { background-color:#ddd; }
#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;
position: absolute;
left: -999em;
z-index: 8000;
margin: -29px 0 0 100%;
width: 164px;
padding: 0;
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;
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;
}
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 */
left: auto;
left: auto;
}
#contextmenu li img {
width: 16px;
height: 16px;
margin-bottom: -4px;
-ms-interpolation-mode : bicubic;
width: 16px;
height: 16px;
margin-bottom: -4px;
-ms-interpolation-mode : bicubic;
}
/* Sliders */
.slider {
clear: both;
position: relative;
font-size: 12px;
font-weight: bold;
width: 400px;
margin-bottom: 15px;
clear: both;
position: relative;
font-size: 12px;
font-weight: bold;
width: 400px;
margin-bottom: 15px;
}
.sliderWrapper {
position: relative;
font-size: 1px;
line-height: 1px;
height: 9px;
width: 422px;
position: relative;
font-size: 1px;
line-height: 1px;
height: 9px;
width: 422px;
}
.sliderarea {
position: absolute;
top: 0;
left: 0;
height: 7px;
width: 420px;
font-size: 1px;
line-height: 1px;
background: #f2f2f2 url(../images/skin/slider-area.gif) repeat-x;
border: 1px solid #a3a3a3;
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
margin: 0;
padding: 0;
overflow: hidden;
}
position: absolute;
top: 0;
left: 0;
height: 7px;
width: 420px;
font-size: 1px;
line-height: 1px;
background: #f2f2f2 url(../images/skin/slider-area.gif) repeat-x;
border: 1px solid #a3a3a3;
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
margin: 0;
padding: 0;
overflow: hidden;
}
.sliderknob {
position: absolute;
top: 0;
left: 0;
height: 9px;
width: 19px;
font-size: 1px;
line-height: 1px;
background: url(../images/skin/knob.gif) no-repeat;
cursor: pointer;
overflow: hidden;
z-index: 2;
}
position: absolute;
top: 0;
left: 0;
height: 9px;
width: 19px;
font-size: 1px;
line-height: 1px;
background: url(../images/skin/knob.gif) no-repeat;
cursor: pointer;
overflow: hidden;
z-index: 2;
}
.update {
padding-bottom: 5px;
padding-bottom: 5px;
}
.mochaToolButton {
margin-right: 10px;
margin-right: 10px;
}
/* Mocha Customization */
#mochaToolbar {
margin-top: 5px;
}
#mochaToolbar .divider {
background-image: url(../images/skin/toolbox-divider.gif);
background-repeat: no-repeat;
background-position: left center;
padding-left: 14px;
padding-top: 15px;
background-image: url(../images/skin/toolbox-divider.gif);
background-repeat: no-repeat;
background-position: left center;
padding-left: 14px;
padding-top: 15px;
}
.MyMenuIcon {
margin-left: -18px;
margin-bottom: -3px;
padding-right: 5px;
margin-left: -18px;
margin-bottom: -3px;
padding-right: 5px;
}
/* Tri-state checkbox */
label.tristate {
background: url(../images/3-state-checkbox.gif) 0 0 no-repeat;
display: block;
float: left;
height: 13px;
margin: .15em 8px 5px 0px;
overflow: hidden;
text-indent: -999em;
width: 13px;
}
label.checked { background-position: 0 -13px; }
label.partial { background-position: 0 -26px; }
background: url(../images/3-state-checkbox.gif) 0 0 no-repeat;
display: block;
float: left;
height: 13px;
margin: .15em 8px 5px 0px;
overflow: hidden;
text-indent: -999em;
width: 13px;
}
label.checked {
background-position: 0 -13px;
}
label.partial {
background-position: 0 -26px;
}
fieldset.settings {
border: solid 1px black;
border-radius: 8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding: 4px 4px 4px 10px;
border: solid 1px black;
border-radius: 8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding: 4px 4px 4px 10px;
}
fieldset.settings legend {
margin-left: 8px;
padding: 4px;
font-weight: bold;
margin-left: 8px;
padding: 4px;
font-weight: bold;
}
fieldset.settings label {
padding: 2px;
padding: 2px;
}
fieldset.settings .leftLabelSmall {
width: 5em;
float: left;
text-align: right;
margin-right: 0.5em;
display: block;
width: 5em;
float: left;
text-align: right;
margin-right: 0.5em;
display: block;
}
fieldset.settings .leftLabelLarge {
width: 14em;
float: left;
text-align: right;
margin-right: 0.5em;
display: block;
width: 14em;
float: left;
text-align: right;
margin-right: 0.5em;
display: block;
}
div.formRow {
clear: left;
display: block;
clear: left;
display: block;
}
ul.filterList {
margin: 0 0 0 16px;
padding-left: 0;
margin: 0 0 0 16px;
padding-left: 0;
}
ul.filterList a {
display: block;
display: block;
}
ul.filterList li:hover {
background-color: #e60;
background-color: #e60;
}
ul.filterList li:hover a {
color: white;
color: white;
}
#filesTable {
line-height: 20px;
line-height: 20px;
}
#trackersTable {
line-height: 25px;
line-height: 25px;
}
#addTrackersPlus {
width: 16px;
cursor: pointer;
margin-bottom: -3px;
width: 16px;
cursor: pointer;
margin-bottom: -3px;
}
.torrentTable th {
padding: 5px 10px;
padding: 5px 10px;
}
.torrentTable td {
padding: 0px 3px;
padding: 0px 3px;
}
.torrentTable thead tr {
background-color: #eee;
background-color: #eee;
}
#prop_general {
padding: 2px;
padding: 2px;
}
#watched_folders_tab {
border-collapse: collapse;
border-collapse: collapse;
}
#watched_folders_tab td, #watched_folders_tab th {
padding: 2px 4px;
border: 1px solid black;
padding: 2px 4px;
border: 1px solid black;
}
/*
* Workaround to prevent the transfer list from
* disappearing when zooming in the browser.
* disappearing when zooming in the browser.
*/
#filtersColumn_handle {
margin-left: -1px;
margin-left: -1px;
}
#error_div {
float: left;
font-size: 14px;
float: left;
font-size: 14px;
}
.combo_priority {
font-size: 1em;
font-size: 1em;
}

27
src/webui/www/public/preferences.html

@ -13,11 +13,10 @@ @@ -13,11 +13,10 @@
<!-- preferences -->
<div class="toolbarTabs">
<ul id="preferencesTabs" class="tab-menu">
<li id="PrefConnectionLink" class="selected"><a>QBT_TR(Connection)QBT_TR</a></li>
<li id="PrefDownloadsLink" class="selected"><a>QBT_TR(Downloads)QBT_TR</a></li>
<li id="PrefConnectionLink"><a>QBT_TR(Connection)QBT_TR</a></li>
<li id="PrefSpeedLink"><a>QBT_TR(Speed)QBT_TR</a></li>
<li id="PrefBittorrentLink"><a>QBT_TR(BitTorrent)QBT_TR</a></li>
<li id="PrefDownloadsLink"><a>QBT_TR(Downloads)QBT_TR</a></li>
<li id="PrefProxyLink"><a>QBT_TR(Proxy Server)QBT_TR</a></li>
<li id="PrefFilterLink"><a>QBT_TR(IP Filtering)QBT_TR</a></li>
<li id="PrefWebUILink"><a>QBT_TR(Web UI)QBT_TR</a></li>
</ul>
<div class="clear"></div>
@ -27,25 +26,21 @@ @@ -27,25 +26,21 @@
// Tabs
MochaUI.initializeTabs('preferencesTabs');
$('PrefConnectionLink').addEvent('click', function(e){
$$('.PrefTab').addClass('invisible');
$('ConnectionTab').removeClass('invisible');
});
$('PrefBittorrentLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('BittorrentTab').removeClass('invisible');
});
$('PrefDownloadsLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('DownloadsTab').removeClass('invisible');
});
$('PrefProxyLink').addEvent('click', function(e) {
$('PrefConnectionLink').addEvent('click', function(e){
$$('.PrefTab').addClass('invisible');
$('ProxyTab').removeClass('invisible');
$('ConnectionTab').removeClass('invisible');
});
$('PrefFilterLink').addEvent('click', function(e) {
$('PrefSpeedLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('FilterTab').removeClass('invisible');
$('SpeedTab').removeClass('invisible');
});
$('PrefBittorrentLink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');
$('BittorrentTab').removeClass('invisible');
});
$('PrefWebUILink').addEvent('click', function(e) {
$$('.PrefTab').addClass('invisible');

233
src/webui/www/public/preferences_content.html

@ -1,4 +1,71 @@ @@ -1,4 +1,71 @@
<div id="ConnectionTab" class="PrefTab">
<div id="DownloadsTab" class="PrefTab">
<fieldset class="settings">
<legend>QBT_TR(Hard Disk)QBT_TR</legend>
<div class="formRow">
<label for="savepath_text" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR</label>
<input type="text" id="savepath_text"/>
</div>
<div class="formRow">
<input type="checkbox" id="temppath_checkbox" onclick="updateTempDirEnabled();"/>
<label for="temppath_checkbox">QBT_TR(Keep incomplete torrents in:)QBT_TR</label>
<input type="text" id="temppath_text"/>
</div>
<br/>
QBT_TR(Automatically add torrents from:)QBT_TR<br/>
<table border="1" id="watched_folders_tab">
<thead><tr><th>QBT_TR(Watched Folder)QBT_TR</th><th>QBT_TR(Download here)QBT_TR</th></tr></thead>
<tbody></tbody>
<tfoot><tr><td style="padding-top:4px;"><input type="text" id="new_watch_folder_txt"/></td><td style="padding-top:4px;"><input type="checkbox" id="new_watch_folder_dl" style="padding-left:18px;"/><img src="theme/list-add" alt="Add" style="padding-left:2px;width:16px;cursor:pointer;margin-right:-18px;" onclick="javascript:addWatchFolder();"/></td></tr></tfoot>
</table><br/>
<input type="checkbox" id="exportdir_checkbox" onclick="updateExportDirEnabled();"/>
<label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR</label>&nbsp;&nbsp;
<input type="text" id="exportdir_text"/><br/>
<span id="appendexttr">
<input type="checkbox" id="appendext_checkbox"/>
<label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR</label><br/>
</span>
<input type="checkbox" id="preallocateall_checkbox"/>
<label for="preallocateall_checkbox">QBT_TR(Pre-allocate disk space for all files)QBT_TR</label><br/>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Email notification upon download completion)QBT_TR</legend>
<input type="checkbox" id="mail_notification_checkbox" onclick="updateMailNotification();"/>
<label for="mail_notification_checkbox">QBT_TR(Email notification upon download completion)QBT_TR</label><br/>
<div class="formRow">
<label for="dest_email_txt" class="leftLabelLarge">QBT_TR(Destination email:)QBT_TR</label><input type="text" id="dest_email_txt"/>
</div>
<div class="formRow">
<label for="smtp_server_txt" class="leftLabelLarge">QBT_TR(SMTP server:)QBT_TR</label><input type="text" id="smtp_server_txt"/>
</div>
<div class="formRow">
<input type="checkbox" id="mail_ssl_checkbox"/><label for="mail_ssl_checkbox">QBT_TR(This server requires a secure connection (SSL))QBT_TR</label>
</div>
<input type="checkbox" id="mail_auth_checkbox" onclick="updateMailAuthSettings();"/><label for="mail_auth_checkbox">QBT_TR(Authentication)QBT_TR</label><br/>
<div class="formRow">
<label for="mail_username_text" class="leftLabelLarge">QBT_TR(Username:)QBT_TR</label><input type="text" id="mail_username_text"/>
</div>
<div class="formRow">
<label for="mail_password_text" class="leftLabelLarge">QBT_TR(Password:)QBT_TR</label><input type="password" id="mail_password_text"/>
</div>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Run an external program on torrent completion)QBT_TR</legend>
<input type="checkbox" id="autorun_checkbox" onclick="updateAutoRun();"/>
<label for="autorun_checkbox">QBT_TR(Run an external program on torrent completion)QBT_TR</label><br/>
<input type="text" id="autorunProg_txt" style="width: 400px;"/><br/>
<i>QBT_TR(The following parameters are supported:)QBT_TR
<ul>
<li>%f: QBT_TR(Torrent path)QBT_TR</li>
<li>%n: QBT_TR(Torrent name)QBT_TR</li>
</ul></i>
</fieldset>
</div>
<div id="ConnectionTab" class="PrefTab invisible">
<fieldset class="settings">
<legend>QBT_TR(Listening Port)QBT_TR</legend>
<label for="port_value">QBT_TR(Port used for incoming connections:)QBT_TR</label>
@ -6,6 +73,7 @@ @@ -6,6 +73,7 @@
<input type="checkbox" id="upnp_checkbox"/>
<label for="upnp_checkbox">QBT_TR(Use UPnP / NAT-PMP port forwarding from my router)QBT_TR</label>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Connections Limits)QBT_TR</legend>
<table>
@ -39,6 +107,52 @@ @@ -39,6 +107,52 @@
</tr>
</table>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Proxy Server)QBT_TR</legend>
<div class="formRow">
<label for="peer_proxy_type_select" class="leftLabelSmall">QBT_TR(Type:)QBT_TR</label>
<select id ="peer_proxy_type_select" onchange="updatePeerProxySettings();">
<option value="none">QBT_TR((None))QBT_TR</option>
<option value="socks4">QBT_TR(SOCKS4)QBT_TR</option>
<option value="socks5">QBT_TR(SOCKS5)QBT_TR</option>
<option value="http">QBT_TR(HTTP)QBT_TR</option>
</select>
</div>
<div class="formRow">
<label for="peer_proxy_host_text" class="leftLabelSmall">QBT_TR(Host:)QBT_TR</label>
<input type="text" id="peer_proxy_host_text" />
</div>
<div class="formRow">
<label for="peer_proxy_port_value" class="leftLabelSmall">QBT_TR(Port:)QBT_TR</label>
<input type="text" id="peer_proxy_port_value" style="width: 4em;"/>
</div>
<div class="formRow">
<input type="checkbox" id="use_peer_proxy_checkbox"/>
<label for="use_peer_proxy_checkbox">QBT_TR(Use proxy for peer connections)QBT_TR</label>
</div>
<input type="checkbox" id="peer_proxy_auth_checkbox" onclick="updatePeerProxyAuthSettings();"/>
<label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR</label><br/>
<div class="formRow">
<label for="peer_proxy_username_text" class="leftLabelLarge">QBT_TR(Username:)QBT_TR</label>
<input type="text" id="peer_proxy_username_text" />
</div>
<div class="formRow">
<label for="peer_proxy_password_text" class="leftLabelLarge">QBT_TR(Password:)QBT_TR</label>
<input type="password" id="peer_proxy_password_text" />
</div>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(IP Filtering)QBT_TR</legend>
<input type="checkbox" id="ipfilter_enabled_checkbox" onclick="updateFilterSettings();"/>
<label for="ipfilter_enabled_checkbox">QBT_TR(IP Filtering)QBT_TR</label><br/>
<label for="ipfilter_text" style="margin-left: 20px;">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR</label>
<input type="text" id="ipfilter_text"/>
</fieldset>
</div>
<div id="SpeedTab" class="PrefTab invisible">
<fieldset class="settings">
<legend>QBT_TR(Global Rate Limits)QBT_TR</legend>
<table>
@ -67,6 +181,7 @@ @@ -67,6 +181,7 @@
<label for="limit_tcp_overhead_checkbox">QBT_TR(Apply rate limit to transport overhead)QBT_TR</label><br/>
</fieldset>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Alternative Global Rate Limits)QBT_TR</legend>
<table>
@ -119,7 +234,6 @@ @@ -119,7 +234,6 @@
<label for="pex_checkbox">QBT_TR(Enable Peer Exchange (PeX) to find more peers)QBT_TR</label><br/>
<input type="checkbox" id="lsd_checkbox"/>
<label for="lsd_checkbox">QBT_TR(Enable Local Peer Discovery to find more peers)QBT_TR</label><br/>
<label for="encryption_select">QBT_TR(Encryption mode:)QBT_TR</label>
<select id="encryption_select">
<option value="0">QBT_TR(Prefer encryption)QBT_TR</option>
@ -129,73 +243,6 @@ @@ -129,73 +243,6 @@
<input type="checkbox" id="anonymous_mode_checkbox" onClick="toggleAnonymousMode()"/>
<label for="anonymous_mode_checkbox">QBT_TR(Enable anonymous mode)QBT_TR (<a href="https://github.com/qbittorrent/qBittorrent/wiki/Anonymous-Mode">More information</a>)</label><br/>
</fieldset>
</div>
<div id="DownloadsTab" class="PrefTab invisible">
<fieldset class="settings">
<legend>QBT_TR(Hard Disk)QBT_TR</legend>
<div class="formRow">
<label for="savepath_text" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR</label>
<input type="text" id="savepath_text"/>
</div>
<div class="formRow">
<input type="checkbox" id="temppath_checkbox" onclick="updateTempDirEnabled();"/>
<label for="temppath_checkbox">QBT_TR(Keep incomplete torrents in:)QBT_TR</label>
<input type="text" id="temppath_text"/>
</div>
<br/>
QBT_TR(Automatically add torrents from:)QBT_TR<br/>
<table border="1" id="watched_folders_tab">
<thead><tr><th>QBT_TR(Watched Folder)QBT_TR</th><th>QBT_TR(Download here)QBT_TR</th></tr></thead>
<tbody></tbody>
<tfoot><tr><td style="padding-top:4px;"><input type="text" id="new_watch_folder_txt"/></td><td style="padding-top:4px;"><input type="checkbox" id="new_watch_folder_dl" style="padding-left:18px;"/><img src="theme/list-add" alt="Add" style="padding-left:2px;width:16px;cursor:pointer;margin-right:-18px;" onclick="javascript:addWatchFolder();"/></td></tr></tfoot>
</table><br/>
<input type="checkbox" id="exportdir_checkbox" onclick="updateExportDirEnabled();"/>
<label for="exportdir_checkbox">QBT_TR(Copy .torrent files to:)QBT_TR</label>&nbsp;&nbsp;
<input type="text" id="exportdir_text"/><br/>
<span id="appendexttr">
<input type="checkbox" id="appendext_checkbox"/>
<label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR</label><br/>
</span>
<input type="checkbox" id="preallocateall_checkbox"/>
<label for="preallocateall_checkbox">QBT_TR(Pre-allocate disk space for all files)QBT_TR</label><br/>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Email notification upon download completion)QBT_TR</legend>
<input type="checkbox" id="mail_notification_checkbox" onclick="updateMailNotification();"/>
<label for="mail_notification_checkbox">QBT_TR(Email notification upon download completion)QBT_TR</label><br/>
<div class="formRow">
<label for="dest_email_txt" class="leftLabelLarge">QBT_TR(Destination email:)QBT_TR</label><input type="text" id="dest_email_txt"/>
</div>
<div class="formRow">
<label for="smtp_server_txt" class="leftLabelLarge">QBT_TR(SMTP server:)QBT_TR</label><input type="text" id="smtp_server_txt"/>
</div>
<div class="formRow">
<input type="checkbox" id="mail_ssl_checkbox"/><label for="mail_ssl_checkbox">QBT_TR(This server requires a secure connection (SSL))QBT_TR</label>
</div>
<input type="checkbox" id="mail_auth_checkbox" onclick="updateMailAuthSettings();"/><label for="mail_auth_checkbox">QBT_TR(Authentication)QBT_TR</label><br/>
<div class="formRow">
<label for="mail_username_text" class="leftLabelLarge">QBT_TR(Username:)QBT_TR</label><input type="text" id="mail_username_text"/>
</div>
<div class="formRow">
<label for="mail_password_text" class="leftLabelLarge">QBT_TR(Password:)QBT_TR</label><input type="password" id="mail_password_text"/>
</div>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Run an external program on torrent completion)QBT_TR</legend>
<input type="checkbox" id="autorun_checkbox" onclick="updateAutoRun();"/>
<label for="autorun_checkbox">QBT_TR(Run an external program on torrent completion)QBT_TR</label><br/>
<input type="text" id="autorunProg_txt" style="width: 400px;"/><br/>
<i>QBT_TR(The following parameters are supported:)QBT_TR
<ul>
<li>%f: QBT_TR(Torrent path)QBT_TR</li>
<li>%n: QBT_TR(Torrent name)QBT_TR</li>
</ul></i>
</fieldset>
<fieldset class="settings">
<legend>QBT_TR(Torrent Queueing)QBT_TR</legend>
@ -220,54 +267,6 @@ @@ -220,54 +267,6 @@
</fieldset>
</div>
<div id="FilterTab" class="PrefTab invisible">
<fieldset class="settings">
<legend>QBT_TR(IP Filtering)QBT_TR</legend>
<input type="checkbox" id="ipfilter_enabled_checkbox" onclick="updateFilterSettings();"/>
<label for="ipfilter_enabled_checkbox">QBT_TR(IP Filtering)QBT_TR</label><br/>
<label for="ipfilter_text" style="margin-left: 20px;">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR</label>
<input type="text" id="ipfilter_text"/>
</fieldset>
</div>
<div id="ProxyTab" class="PrefTab invisible">
<fieldset class="settings">
<legend>QBT_TR(Proxy Server)QBT_TR</legend>
<div class="formRow">
<label for="peer_proxy_type_select" class="leftLabelSmall">QBT_TR(Type:)QBT_TR</label>
<select id ="peer_proxy_type_select" onchange="updatePeerProxySettings();">
<option value="none">QBT_TR((None))QBT_TR</option>
<option value="socks4">QBT_TR(SOCKS4)QBT_TR</option>
<option value="socks5">QBT_TR(SOCKS5)QBT_TR</option>
<option value="http">QBT_TR(HTTP)QBT_TR</option>
</select>
</div>
<div class="formRow">
<label for="peer_proxy_host_text" class="leftLabelSmall">QBT_TR(Host:)QBT_TR</label>
<input type="text" id="peer_proxy_host_text" />
</div>
<div class="formRow">
<label for="peer_proxy_port_value" class="leftLabelSmall">QBT_TR(Port:)QBT_TR</label>
<input type="text" id="peer_proxy_port_value" style="width: 4em;"/>
</div>
<div class="formRow">
<input type="checkbox" id="use_peer_proxy_checkbox"/>
<label for="use_peer_proxy_checkbox">QBT_TR(Use proxy for peer connections)QBT_TR</label>
</div>
<input type="checkbox" id="peer_proxy_auth_checkbox" onclick="updatePeerProxyAuthSettings();"/>
<label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR</label><br/>
<div class="formRow">
<label for="peer_proxy_username_text" class="leftLabelLarge">QBT_TR(Username:)QBT_TR</label>
<input type="text" id="peer_proxy_username_text" />
</div>
<div class="formRow">
<label for="peer_proxy_password_text" class="leftLabelLarge">QBT_TR(Password:)QBT_TR</label>
<input type="password" id="peer_proxy_password_text" />
</div>
</fieldset>
</div>
<div id="WebUITab" class="PrefTab invisible">
<fieldset class="settings">
<legend>QBT_TR(Language)QBT_TR</legend>

30
src/webui/www/public/scripts/client.js

@ -89,7 +89,6 @@ window.addEvent('load', function () { @@ -89,7 +89,6 @@ window.addEvent('load', function () {
width : null,
resizeLimit : [100, 300]
});
MochaUI.Desktop.setDesktopSize();
setFilter = function (f) {
// Visually Select the right filter
@ -129,10 +128,23 @@ window.addEvent('load', function () { @@ -129,10 +128,23 @@ window.addEvent('load', function () {
});
initializeWindows();
// Show Top Toolbar is enabled by default
if (localStorage.getItem('show_top_toolbar') == null)
var showTopToolbar = true;
else
var showTopToolbar = localStorage.getItem('show_top_toolbar') == "true";
if (!showTopToolbar) {
$('showTopToolbarLink').firstChild.style.opacity = '0';
$('mochaToolbar').addClass('invisible');
}
var speedInTitle = localStorage.getItem('speed_in_browser_title_bar') == "true";
if (!speedInTitle)
$('speedInBrowserTitleBarLink').firstChild.style.opacity = '0';
// After Show Top Toolbar
MochaUI.Desktop.setDesktopSize();
var syncMainDataLastResponseId = 0;
var serverState = {};
@ -218,10 +230,12 @@ window.addEvent('load', function () { @@ -218,10 +230,12 @@ window.addEvent('load', function () {
myTable.columns['priority'].force_hide = !queueing_enabled;
myTable.updateColumn('priority');
if (queueing_enabled) {
$('queueingLinks').removeClass('invisible');
$('queueingButtons').removeClass('invisible');
$('queueingMenuItems').removeClass('invisible');
}
else {
$('queueingLinks').addClass('invisible');
$('queueingButtons').addClass('invisible');
$('queueingMenuItems').addClass('invisible');
}
@ -269,6 +283,20 @@ window.addEvent('load', function () { @@ -269,6 +283,20 @@ window.addEvent('load', function () {
updateMainData();
};
$('showTopToolbarLink').addEvent('click', function(e) {
showTopToolbar = !showTopToolbar;
localStorage.setItem('show_top_toolbar', showTopToolbar.toString());
if (showTopToolbar) {
$('showTopToolbarLink').firstChild.style.opacity = '1';
$('mochaToolbar').removeClass('invisible');
}
else {
$('showTopToolbarLink').firstChild.style.opacity = '0';
$('mochaToolbar').addClass('invisible');
}
MochaUI.Desktop.setDesktopSize();
});
$('speedInBrowserTitleBarLink').addEvent('click', function(e) {
speedInTitle = !speedInTitle;
localStorage.setItem('speed_in_browser_title_bar', speedInTitle.toString());

18
src/webui/www/public/scripts/dynamicTable.js

@ -49,9 +49,9 @@ var dynamicTable = new Class({ @@ -49,9 +49,9 @@ var dynamicTable = new Class({
},
initColumns : function () {
this.newColumn('priority', 'width: 30px; cursor: pointer', '#');
this.newColumn('state_icon', 'width: 16px', '');
this.newColumn('name', 'min-width: 200px; cursor: pointer', 'QBT_TR(Name)QBT_TR');
this.newColumn('priority', 'width: 90px; cursor: pointer', '#');
this.newColumn('size', 'width: 100px; cursor: pointer', 'QBT_TR(Size)QBT_TR');
this.newColumn('progress', 'width: 80px; cursor: pointer', 'QBT_TR(Done)QBT_TR');
this.newColumn('num_seeds', 'width: 100px; cursor: pointer', 'QBT_TR(Seeds)QBT_TR');
@ -507,6 +507,10 @@ var dynamicTable = new Class({ @@ -507,6 +507,10 @@ var dynamicTable = new Class({
state = "queued";
else if (state == "checkingUP" || state == "checkingDL")
state = "checking";
else if (state == "forcedDL" || state == "metaDL")
state = "downloading";
else if (state == "forcedUP")
state = "uploading";
var img_path = 'images/skin/' + state + '.png';
@ -522,12 +526,6 @@ var dynamicTable = new Class({ @@ -522,12 +526,6 @@ var dynamicTable = new Class({
}));
};
// name
this.columns['name'].updateTd = function (td, row) {
td.set('html', escapeHtml(this.getRowValue(row)));
};
// priority
this.columns['priority'].updateTd = function (td, row) {
@ -548,6 +546,12 @@ var dynamicTable = new Class({ @@ -548,6 +546,12 @@ var dynamicTable = new Class({
else return 0;
};
// name
this.columns['name'].updateTd = function (td, row) {
td.set('html', escapeHtml(this.getRowValue(row)));
};
// size
this.columns['size'].updateTd = function (td, row) {

20
src/webui/www/public/scripts/mocha-init.js

@ -366,8 +366,8 @@ initializeWindows = function() { @@ -366,8 +366,8 @@ initializeWindows = function() {
title: 'QBT_TR(About)QBT_TR',
loadMethod: 'xhr',
contentURL: 'about.html',
width: 650,
height: 200,
width: 550,
height: 290,
padding: 10
});
});
@ -385,13 +385,15 @@ initializeWindows = function() { @@ -385,13 +385,15 @@ initializeWindows = function() {
addClickEvent('shutdown', function(e) {
new Event(e).stop();
new Request({
url: 'command/shutdown',
onSuccess: function() {
document.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>QBT_TR(qBittorrent has been shutdown.)QBT_TR</title><style type=\"text/css\">body { text-align: center; }</style></head><body><h1>QBT_TR(qBittorrent has been shutdown.)QBT_TR</h1></body></html>");
stop();
}
}).send();
if (confirm('QBT_TR(Are you sure you want to quit qBittorrent?)QBT_TR')) {
new Request({
url: 'command/shutdown',
onSuccess: function() {
document.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>QBT_TR(qBittorrent has been shutdown.)QBT_TR</title><style type=\"text/css\">body { text-align: center; }</style></head><body><h1>QBT_TR(qBittorrent has been shutdown.)QBT_TR</h1></body></html>");
stop();
}
}).send();
}
});
// Deactivate menu header links

Loading…
Cancel
Save