Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve how labels are displayed #2299

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ div#CatList ul li.sel {background-color: #CFDEEF; border-color: #CFDEEF }
#-_-_-act-_-_- {background-position: 4px -158px;}
#-_-_-iac-_-_- {background-position: 4px -30px;}
#-_-_-err-_-_- {background-position: 4px -94px;}
span.label-count,span.label-size { background-color: #F0F0F0; padding: 0.1em 0.3em 0.1em 0.3em; margin-left: 0.3em; border-radius: 0.8em; }
div#CatList ul li.RSS {background-image: url(../images/tstatus.png); background-position: 4px -206px}
div#CatList ul li.disRSS {background-image: url(../images/tstatus.png); background-position: 4px -190px}

Expand Down
29 changes: 19 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,34 +96,43 @@
<div class="catpanel" id="pstate" onclick="theWebUI.togglePanel(this); return(false);"><script type="text/javascript"> document.write(theUILang.pnlState); </script></div>
<ul id="pstate_cont" class="catpanel_cont">
<li class="-_-_-all-_-_- sel cat">
<script type="text/javascript"> document.write(theUILang.All); </script> (<span class="-_-_-all-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.All); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
<li id="-_-_-dls-_-_-" class="cat">
<script type="text/javascript"> document.write(theUILang.Downloading); </script> (<span id="-_-_-dls-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.Downloading); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
<li id="-_-_-com-_-_-" class="cat">
<script type="text/javascript"> document.write(theUILang.Finished); </script> (<span id="-_-_-com-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.Finished); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
<li id="-_-_-act-_-_-" class="cat">
<script type="text/javascript"> document.write(theUILang.Active); </script> (<span id="-_-_-act-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.Active); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
<li id="-_-_-iac-_-_-" class="cat">
<script type="text/javascript"> document.write(theUILang.Inactive); </script> (<span id="-_-_-iac-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.Inactive); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
<li id="-_-_-err-_-_-" class="cat">
<script type="text/javascript"> document.write(theUILang.Error); </script> (<span id="-_-_-err-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.Error); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
</ul>
<div class="catpanel" id="plabel" onclick="theWebUI.togglePanel(this); return(false);"><script type="text/javascript"> document.write(theUILang.Labels); </script></div>
<div class="catpanel_cont" id="plabel_cont">
<ul id="clabel_cont">
<li class="-_-_-all-_-_- sel cat">
<script type="text/javascript"> document.write(theUILang.All); </script> (<span class="-_-_-all-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.All); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
<li id="-_-_-nlb-_-_-" class="cat">
<script type="text/javascript"> document.write(theUILang.No_label); </script> (<span id="-_-_-nlb-_-_-c">0</span>)</li>
</ul>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.No_label); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
</ul>
<ul id="lbll">
</ul>
</div>
<div class="catpanel" id="flabel" onclick="theWebUI.togglePanel(this); return(false);"><script type="text/javascript"> document.write(theUILang.mnu_search); </script></div>
<div class="catpanel_cont" id="flabel_cont">
<ul id="lblf">
<li class="-_-_-all-_-_- sel cat">
<script type="text/javascript"> document.write(theUILang.All); </script> (<span class="-_-_-all-_-_-c">0</span>)</li>
<span class="label-text"><script type="text/javascript"> document.write(theUILang.All); </script></span><span class="label-count">0</span><span class="label-size" style="display: none"></span>
</li>
</ul>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,15 @@ function makeContent()
"<div class=\"op100l\"><input type=\"checkbox\" id=\"webui.log_autoswitch\"/>"+
"<label for=\"webui.log_autoswitch\" id=\"lbl_webui.log_autoswitch\" >"+theUILang.logAutoSwitch+"</label>"+
"</div>"+
"<div class=\"op100l\"><input type=\"checkbox\" id=\"webui.show_statelabelsize\"/>"+
"<label for=\"webui.show_statelabelsize\" id=\"lbl_webui.show_statelabelsize\" >"+theUILang.showStateLabelSize+"</label>"+
"</div>"+
"<div class=\"op100l\"><input type=\"checkbox\" id=\"webui.show_labelsize\"/>"+
"<label for=\"webui.show_labelsize\" id=\"lbl_webui.show_labelsize\" >"+theUILang.showLabelSize+"</label>"+
"</div>"+
"<div class=\"op100l\"><input type=\"checkbox\" id=\"webui.show_searchlabelsize\"/>"+
"<label for=\"webui.show_searchlabelsize\" id=\"lbl_webui.show_searchlabelsize\" >"+theUILang.showSearchLabelSize+"</label>"+
"</div>"+
"<div class=\"op100l\"><input type=\"checkbox\" id=\"webui.register_magnet\"/>"+
"<label for=\"webui.register_magnet\" id=\"lbl_webui.register_magnet\" >"+theUILang.registerMagnet+"</label>"+
"</div>"+
Expand Down
16 changes: 2 additions & 14 deletions js/rtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ rTorrentStub.prototype.listResponse = function(xml)
state|=dStatus.error;
torrent.state = state;
torrent.name = this.getValue(values,5);
torrent.size = this.getValue(values,6);
torrent.size = iv(this.getValue(values,6));
var get_completed_chunks = parseInt(this.getValue(values,7));
var get_hashed_chunks = parseInt(this.getValue(values,25));
var get_size_chunks = parseInt(this.getValue(values,8));
Expand All @@ -1110,19 +1110,7 @@ rTorrentStub.prototype.listResponse = function(xml)
try {
torrent.label = decodeURIComponent(this.getValue(values,15)).trim();
} catch(e) { torrent.label = ''; }
if(torrent.label.length>0)
{
if(!$type(ret.labels[torrent.label]))
{
ret.labels[torrent.label] = 1;
ret.labels_size[torrent.label] = parseInt(torrent.size);
}
else
{
ret.labels[torrent.label]++;
ret.labels_size[torrent.label] = parseInt(ret.labels_size[torrent.label]) + parseInt(torrent.size);
}
}

var get_peers_not_connected = parseInt(this.getValue(values,17));
var get_peers_connected = parseInt(this.getValue(values,18));
var get_peers_all = get_peers_not_connected+get_peers_connected;
Expand Down
Loading