Skip to content

Commit

Permalink
Display files hierarchically in Web UI content tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Piccirello committed Aug 4, 2019
1 parent e0037b8 commit 60a1835
Show file tree
Hide file tree
Showing 9 changed files with 979 additions and 118 deletions.
42 changes: 41 additions & 1 deletion src/webui/www/private/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ a.propButton img {
#torrentsFilterToolbar {
float: right;
margin-right: 30px;
margin-right: 30px;
}

#torrentsFilterInput {
Expand All @@ -364,6 +363,20 @@ a.propButton img {
background-position: left;
}

#torrentFilesFilterToolbar {
float: right;
margin-right: 30px;
}

#torrentFilesFilterInput {
width: 160px;
padding-left: 2em;
background-image: url("../images/qbt-theme/edit-find.svg");
background-repeat: no-repeat;
background-size: 1.5em;
background-position: left;
}

/* Tri-state checkbox */

label.tristate {
Expand Down Expand Up @@ -470,6 +483,19 @@ td.generalLabel {
line-height: 25px;
}

.filesTableCollapseIcon {
width: 15px;
height: 15px;
cursor: pointer;
margin-bottom: -3px;
padding-right: 5px;
}

.filesTableCollapseIcon.rotate {
transform: rotate(270deg);
margin-bottom: -1px;
}

.unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
Expand Down Expand Up @@ -596,3 +622,17 @@ td.statusBarSeparator {
.searchPluginsTableRow {
cursor: pointer;
}

#torrentFilesTableDiv .dynamicTable tr.nonAlt {
background-color: #fff;
}

#torrentFilesTableDiv .dynamicTable tr.nonAlt.selected {
background-color: #354158;
color: #fff;
}

#torrentFilesTableDiv .dynamicTable tr.nonAlt:hover {
background-color: #ee6600;
color: #fff;
}
4 changes: 3 additions & 1 deletion src/webui/www/private/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
<script src="scripts/lib/mocha-0.9.6-yc.js"></script>
<script src="scripts/mocha-init.js?locale=${LANG}&v=${CACHEID}"></script>
<script src="scripts/lib/clipboard-2.0.0.min.js"></script>
<script src="scripts/filesystem.js?v=${CACHEID}"></script>
<script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
<script src="scripts/progressbar.js?v=${CACHEID}"></script>
<script src="scripts/file-tree.js?v=${CACHEID}"></script>
<script src="scripts/dynamicTable.js?locale=${LANG}&v=${CACHEID}"></script>
<script src="scripts/client.js?locale=${LANG}&v=${CACHEID}"></script>
<script src="scripts/contextmenu.js?locale=${LANG}&v=${CACHEID}"></script>
Expand Down Expand Up @@ -189,7 +191,7 @@ <h1 class="applicationTitle">qBittorrent Web User Interface <span class="version
<li><a href="#CopyTrackerUrl" id="CopyTrackerUrl"><img src="images/qbt-theme/edit-copy.svg" alt="QBT_TR(Copy tracker URL)QBT_TR[CONTEXT=TrackerListWidget]"/> QBT_TR(Copy tracker URL)QBT_TR[CONTEXT=TrackerListWidget]</a></li>
</ul>
<ul id="torrentFilesMenu" class="contextMenu">
<li class="separator">
<li>
<a href="#FilePrio" class="arrow-right"><span style="display: inline-block; width: 16px;"></span> QBT_TR(Priority)QBT_TR[CONTEXT=PropertiesWidget]</a>
<ul>
<li><a href="#FilePrioIgnore"><span style="display: inline-block; width: 16px;"></span> QBT_TR(Do not download)QBT_TR[CONTEXT=PropListDelegate]</a></li>
Expand Down
3 changes: 3 additions & 0 deletions src/webui/www/private/properties.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div class="toolbarTabs">
<div id="torrentFilesFilterToolbar" class="invisible">
<input type="text" id="torrentFilesFilterInput" placeholder="QBT_TR(Filter files...)QBT_TR[CONTEXT=PropertiesWidget]" autocorrect="off" autocapitalize="none" />
</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>
Expand Down
13 changes: 13 additions & 0 deletions src/webui/www/private/scripts/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,34 +887,39 @@ window.addEvent('load', function() {
$('PropGeneralLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_general').removeClass("invisible");
hideFilesFilter();
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropTrackersLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_trackers').removeClass("invisible");
hideFilesFilter();
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropPeersLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_peers').removeClass("invisible");
hideFilesFilter();
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropWebSeedsLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_webseeds').removeClass("invisible");
hideFilesFilter();
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropFilesLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_files').removeClass("invisible");
showFilesFilter();
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});
Expand All @@ -927,6 +932,14 @@ window.addEvent('load', function() {
height: prop_h
});

const showFilesFilter = function() {
$('torrentFilesFilterToolbar').removeClass("invisible");
};

const hideFilesFilter = function() {
$('torrentFilesFilterToolbar').addClass("invisible");
};

let prevTorrentsFilterValue;
let torrentsFilterInputTimer = null;
// listen for changes to torrentsFilterInput
Expand Down
Loading

0 comments on commit 60a1835

Please sign in to comment.