mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
this fixes #1058
This commit is contained in:
parent
c13c34fc5e
commit
6724c991f5
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<div id="templates" style="display: none;">
|
<div id="templates" style="display: none;">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="groupEntry"><span></span>
|
<li class="groupEntry"><span class="geName"></span> <span class="geCount dim"></span>
|
||||||
<ul></ul>
|
<ul></ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="listEntry">
|
<li class="listEntry">
|
||||||
|
@ -19,15 +19,18 @@ body[dir=rtl] #lists {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
#lists > .groupEntry > span {
|
#lists > .groupEntry > .geName {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 15px;
|
font-size: 110%;
|
||||||
}
|
}
|
||||||
#lists > .groupEntry:not(:first-child) > span:before {
|
#lists > .groupEntry > .geCount {
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
#lists > .groupEntry:not(:first-child) > .geName:before {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
content: '\2212 ';
|
content: '\2212 ';
|
||||||
}
|
}
|
||||||
#lists > .groupEntry.collapsed > span:before {
|
#lists > .groupEntry.collapsed > .geName:before {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
content: '+ ';
|
content: '+ ';
|
||||||
}
|
}
|
||||||
|
@ -142,15 +142,33 @@ var renderFilterLists = function() {
|
|||||||
return li;
|
return li;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var listEntryCountFromGroup = function(listKeys) {
|
||||||
|
if ( Array.isArray(listKeys) === false ) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
var count = 0;
|
||||||
|
var i = listKeys.length;
|
||||||
|
while ( i-- ) {
|
||||||
|
if ( listDetails.available[listKeys[i]].off !== true ) {
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return count === 0 ? '' : '(' + count.toLocaleString() + ')';
|
||||||
|
};
|
||||||
|
|
||||||
var liFromListGroup = function(groupKey, listKeys) {
|
var liFromListGroup = function(groupKey, listKeys) {
|
||||||
var liGroup = listGroupTemplate.clone();
|
var liGroup = listGroupTemplate.clone();
|
||||||
liGroup.descendants('span').text(vAPI.i18n('3pGroup' + groupKey.charAt(0).toUpperCase() + groupKey.slice(1)));
|
var groupName = vAPI.i18n('3pGroup' + groupKey.charAt(0).toUpperCase() + groupKey.slice(1));
|
||||||
|
if ( groupName !== '' ) {
|
||||||
|
liGroup.descendants('span.geName').text(groupName);
|
||||||
|
liGroup.descendants('span.geCount').text(listEntryCountFromGroup(listKeys));
|
||||||
|
}
|
||||||
var ulGroup = liGroup.descendants('ul');
|
var ulGroup = liGroup.descendants('ul');
|
||||||
if ( !listKeys ) {
|
if ( !listKeys ) {
|
||||||
return liGroup;
|
return liGroup;
|
||||||
}
|
}
|
||||||
listKeys.sort(function(a, b) {
|
listKeys.sort(function(a, b) {
|
||||||
return (listDetails.available[a].title || "").localeCompare(listDetails.available[b].title || "");
|
return (listDetails.available[a].title || '').localeCompare(listDetails.available[b].title || '');
|
||||||
});
|
});
|
||||||
for ( var i = 0; i < listKeys.length; i++ ) {
|
for ( var i = 0; i < listKeys.length; i++ ) {
|
||||||
ulGroup.append(liFromListEntry(listKeys[i]));
|
ulGroup.append(liFromListEntry(listKeys[i]));
|
||||||
|
Loading…
Reference in New Issue
Block a user