Skip to content

Commit

Permalink
Merge pull request #2312 from TrimmingFool/master
Browse files Browse the repository at this point in the history
truncate overflow of label text
  • Loading branch information
Novik committed Feb 21, 2022
2 parents 50fb18a + b297977 commit ae898e1
Show file tree
Hide file tree
Showing 28 changed files with 43 additions and 8 deletions.
6 changes: 5 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ div#CatList .label-prefix div { margin-right: 0px; width: 12px; }
#-_-_-iac-_-_- .label-icon {background-position: 0px -32px;}
#-_-_-err-_-_- .label-icon {background-position: 0px -96px;}
.label-count,.label-size { background-color: #F0F0F0; padding: 0.1em 0.3em 0.1em 0.3em; border-radius: 0.8em; }
.label-size.rightalign {
#CatList.rightalign-labelsize .label-size {
margin-left: auto;
}
#CatList.hide-textoverflow .label-text {
overflow: hidden;
text-overflow: ellipsis;
}
div#CatList ul li.RSS .label-icon { background-position: 0px -208px}
div#CatList ul li.disRSS .label-icon { background-position: 0px -192px}
#flabel_cont li:not(.-_-_-all-_-_-) .label-icon { background-position: 0px -32px; }
Expand Down
1 change: 1 addition & 0 deletions js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ function makeContent()
['webui.labelsize_rightalign', theUILang.labelSizeRightAlign],
['webui.show_label_path_tree', theUILang.showCustomLabelTree],
['webui.show_empty_path_labels', theUILang.showEmptyPathLabel],
['webui.show_label_text_overflow', theUILang.showLabelTextOverflow],
['webui.show_open_status', theUILang.showOpenStatus],
].map(([id, label]) =>
$('<div>').append(
Expand Down
19 changes: 12 additions & 7 deletions js/webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ var theWebUI =
"webui.show_statelabelsize": 0,
"webui.show_label_path_tree": 1,
"webui.show_empty_path_labels": 0,
"webui.show_label_text_overflow": 0,
"webui.show_open_status": 1,
"webui.register_magnet": 0,
...(() => {
Expand Down Expand Up @@ -2314,15 +2315,10 @@ var theWebUI =
' ('+ count + ( showSize ? ' ; '+ lblSize : '') +')');
var sizeSpan = li.children('.label-size');
sizeSpan.text(lblSize);
if (size && showSize) {
if (theWebUI.settings['webui.labelsize_rightalign'])
sizeSpan.addClass('rightalign');
else
sizeSpan.removeClass('rightalign');
if (size && showSize)
sizeSpan.show();
} else {
else
sizeSpan.hide();
}
},

idToLbl: function(id) {
Expand All @@ -2331,6 +2327,15 @@ var theWebUI =

updateLabels: function(wasRemoved)
{
const catlist = $($$('CatList'));
if (theWebUI.settings['webui.labelsize_rightalign'])
catlist.addClass('rightalign-labelsize');
else
catlist.removeClass('rightalign-labelsize');
if (theWebUI.settings['webui.show_label_text_overflow'])
catlist.removeClass('hide-textoverflow');
else
catlist.addClass('hide-textoverflow');
this.updateAllFilterLabel('pstate_cont', this.settings["webui.show_statelabelsize"]);
this.updateAllFilterLabel('plabel_cont', this.settings["webui.show_labelsize"]);
this.updateAllFilterLabel('flabel_cont', this.settings["webui.show_searchlabelsize"]);
Expand Down
1 change: 1 addition & 0 deletions lang/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/da.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv er sat til OFF. Skift til ON, ellers vil nogle plugins ikke virke korrekt.",
addTorrentFailedURL : "Kunne ikke tilføje torrent. Kan ikke forbine til URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP Direktive register_argc_argv wurde auf OFF gesetzt. Ändere dies zu ON, andernfalls werden einige Plugins nicht richtig funktionieren.",
addTorrentFailedURL : "Fehler beim hinzufügen eines Torrent. URL kann nicht abgerufen werden.",
Expand Down
1 change: 1 addition & 0 deletions lang/el.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ var theUILang =
showCustomLabelTree : "Προβολή διαδρομής δένδρου ετικέτας",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Προβολή ετικετών χωρίς διαδρομή",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "Η οδηγία register_argc_argv της PHP είναι ορισμένη στο OFF. Αλλάξτε τη σε ON, αλλιώς κάποια πρόσθετα δεν θα λειτουργούν σωστά.",
addTorrentFailedURL : "Αποτυχία προσθήκης αρχείου torrent. Αδυναμία ανάκτησης URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "La directiva PHP register_argc_argv figura como OFF. Cámbiela a ON, de otra manera algunos plugins no funcionarán.",
addTorrentFailedURL : "Fallo al agregar torrent. No se encuentra la URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/fi.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "La directive PHP 'register_argc_argv' est désactivée. Veuillez l'activer sinon certains plugins ne fonctionneront pas correctement.",
addTorrentFailedURL : "Erreur: le torrent n'a pas pu être ajouté à rTorrent. Impossible de résoudre l'URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/hu.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "La direttiva PHP register_argc_argv è impostata su OFF. Cambia su ON, altrimenti alcuni plugin non funzioneranno correttamente.",
addTorrentFailedURL : "Aggiunta torrent fallita. Impossibile elaborare l'URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP의 register_argc_argv directive가 OFF로 설정되어 있습니다. ON으로 바꾸지 않으면, 일부 플러그인이 올바르게 동작할 수 없습니다.",
addTorrentFailedURL : "토렌트를 추가하지 못했습니다. URL에 접근하지 못했습니다.",
Expand Down
1 change: 1 addition & 0 deletions lang/lv.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP-instelling 'register_argc_argv' staat op OFF, waardoor sommige plugins niet kunnen functioneren. Wijzig de instelling naar ON.",
addTorrentFailedURL : "Fout bij toevoegen torrent: kan URL niet ophalen.",
Expand Down
1 change: 1 addition & 0 deletions lang/no.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP innstillingen register_argc_argv er satt til OFF. Sett denne til ON, ellers vil enkelte tilleggsmoduler ikke fungere som de skal.",
addTorrentFailedURL : "Fikk ikke til å legge til torrent. Kan ikke hente lenke.",
Expand Down
1 change: 1 addition & 0 deletions lang/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "Ustawienie PHP register_argc_argv jest wyłączone. Włącz je, inaczej niektóre wtyczki nie będą działać poprawnie.",
addTorrentFailedURL : "Torrent nie został dodany. Nie można pobrać adresu.",
Expand Down
1 change: 1 addition & 0 deletions lang/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "Diretiva PHP register_argc_argv está definida para OFF. Mude para ON, caso contrário, alguns plugins não irão funcionar corretamente.",
addTorrentFailedURL : "Falha ao adicionar torrent. Não foi possivel recuperar a URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "Директива php register_argc_argv выставлена в Off. Измените ее значение на On, иначе некоторые плагины будут работать некорректно.",
addTorrentFailedURL : "Ошибка добавления закачки. Невозможно получить файл по заданному URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/sk.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/sr.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP-direktivet register_argc_argv är inställt på OFF. Byt till ON, annars kommer några insticksprogram inte fungera korrekt.",
addTorrentFailedURL : "Det gick inte att lägga till torrent. Kan inte hämta webbadress.",
Expand Down
1 change: 1 addition & 0 deletions lang/tr.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP yönergesi register_argc_argv OFF olarak ayarlandı. ON olarak değiştirin, aksi halde bazı eklentiler düzgün çalışmayacaktır.",
addTorrentFailedURL : "Torrent eklenemedi. URL alınamıyor.",
Expand Down
1 change: 1 addition & 0 deletions lang/uk.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "Директиву інтерпретатора PHP register_argc_argv вимкнено (значення Off). Увімкніть її (значення On), інакше деякі плагіни не працюватимуть.",
addTorrentFailedURL : "Сталася помилка. Файл .torrent не передано до rTorrent. Не вдалося отримати URL-адресу.",
Expand Down
1 change: 1 addition & 0 deletions lang/vi.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Không thêm torrent được. Không thể tải được URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/zh-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP 参数 register_argc_argv 被设为 OFF. 把它切换到 ON, 否则某些插件会无法正常工作.",
addTorrentFailedURL : "添加 torrent 失败. 无法取回 URL.",
Expand Down
1 change: 1 addition & 0 deletions lang/zh-tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ var theUILang =
showCustomLabelTree : "Show label path tree",
labelSizeRightAlign : "Right align size in category list",
showEmptyPathLabel : "Show empty path labels",
showLabelTextOverflow : "Allow overflow of label text",
showOpenStatus : "Show open status in status bar",
phpParameterUnavailable : "PHP directive register_argc_argv is set to OFF. Change to ON, otherwise some plugins won't work correctly.",
addTorrentFailedURL : "Failed to add torrent. Can't retrieve URL.",
Expand Down

0 comments on commit ae898e1

Please sign in to comment.