webui (js): feature: Added complete support for labels (add/set/reset/display/filter) #648

Changes:
- added list of labels on the lower-left corner
- added support to add/set/reset labels on context menu
- added support to filter torrents by label
This commit is contained in:
Felipe Barriga Richards
2015-02-14 18:19:54 -03:00
committed by ngosang
parent 76d93c23b7
commit 4ae2f6c33b
9 changed files with 272 additions and 23 deletions

View File

@@ -60,6 +60,7 @@ var dynamicTable = new Class({
this.newColumn('upspeed', 'width: 100px; cursor: pointer', 'QBT_TR(Up Speed)QBT_TR');
this.newColumn('eta', 'width: 100px; cursor: pointer', 'QBT_TR(ETA)QBT_TR');
this.newColumn('ratio', 'width: 100px; cursor: pointer', 'QBT_TR(Ratio)QBT_TR');
this.newColumn('label', 'width: 100px; cursor: pointer', 'QBT_TR(Label)QBT_TR');
this.columns['state_icon'].onclick = '';
this.columns['state_icon'].dataProperties[0] = 'state';
@@ -279,10 +280,13 @@ var dynamicTable = new Class({
break;
}
if (labelName == null)
if (labelName == LABELS_ALL && row['full_data'].label.length > 0)
return true;
if (labelName != row['full_data'].label)
if (labelName == LABELS_UNLABELLED && row['full_data'].label.length === 0)
return true;
if (labelName != genHash( row['full_data'].label) )
return false;
return true;