remove size column, tweak css
This commit is contained in:
parent
ffeef695fa
commit
f25fc96b97
|
@ -77,7 +77,6 @@
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p class="style-info" data-type="age"></p>
|
<p class="style-info" data-type="age"></p>
|
||||||
<p class="style-info" data-type="size"></p>
|
|
||||||
<div class="applies-to">
|
<div class="applies-to">
|
||||||
<div class="targets"></div>
|
<div class="targets"></div>
|
||||||
<a href="#" class="expander" tabindex="0">...</a>
|
<a href="#" class="expander" tabindex="0">...</a>
|
||||||
|
|
|
@ -191,12 +191,6 @@ a:hover {
|
||||||
.newUI .style-info[data-type=version][data-value="1.0.0"] {
|
.newUI .style-info[data-type=version][data-value="1.0.0"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.newUI .style-info[data-type=size][title^=" "] {
|
|
||||||
opacity: .25;
|
|
||||||
}
|
|
||||||
.newUI .style-info[data-type=size][title^=" "]:hover {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.applies-to {
|
.applies-to {
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
|
@ -383,7 +377,7 @@ a:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.newUI .entry > .style-info {
|
.newUI .entry > .style-info {
|
||||||
padding-right: .5em;
|
padding-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newUI .entry .actions {
|
.newUI .entry .actions {
|
||||||
|
|
|
@ -204,7 +204,6 @@ function createStyleElement({style, name: nameLC}) {
|
||||||
homepageIcon: t.template[`homepageIcon${newUI.enabled ? 'Small' : 'Big'}`],
|
homepageIcon: t.template[`homepageIcon${newUI.enabled ? 'Small' : 'Big'}`],
|
||||||
infoAge: $('[data-type=age]', entry),
|
infoAge: $('[data-type=age]', entry),
|
||||||
infoVer: $('[data-type=version]', entry),
|
infoVer: $('[data-type=version]', entry),
|
||||||
infoSize: $('[data-type=size]', entry),
|
|
||||||
appliesTo: $('.applies-to', entry),
|
appliesTo: $('.applies-to', entry),
|
||||||
targets: $('.targets', entry),
|
targets: $('.targets', entry),
|
||||||
expander: $('.expander', entry),
|
expander: $('.expander', entry),
|
||||||
|
@ -229,7 +228,6 @@ function createStyleElement({style, name: nameLC}) {
|
||||||
parts.infoVer.textContent = ud ? ud.version : '';
|
parts.infoVer.textContent = ud ? ud.version : '';
|
||||||
parts.infoVer.dataset.value = ud ? ud.version : '';
|
parts.infoVer.dataset.value = ud ? ud.version : '';
|
||||||
if (newUI.enabled) {
|
if (newUI.enabled) {
|
||||||
createSizeText(parts.infoSize, style);
|
|
||||||
createAgeText(parts.infoAge, style);
|
createAgeText(parts.infoAge, style);
|
||||||
} else {
|
} else {
|
||||||
parts.oldConfigure.classList.toggle('hidden', !configurable);
|
parts.oldConfigure.classList.toggle('hidden', !configurable);
|
||||||
|
@ -331,17 +329,8 @@ function createStyleTargetsElement({entry, expanded, style = entry.styleMeta}) {
|
||||||
entry._numTargets = numTargets;
|
entry._numTargets = numTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSizeText(el, style) {
|
|
||||||
const size = (style.sourceCode || '').length ||
|
|
||||||
style.sections.reduce((sum, sec) => sum + (sec.code || '').length, 0);
|
|
||||||
if (size) {
|
|
||||||
el.textContent = size < 1000 ? '<1k' : `${size / 1000 | 0}k`;
|
|
||||||
el.title = padLeft(size, 8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createAgeText(el, style) {
|
function createAgeText(el, style) {
|
||||||
let val = style.updateDate;
|
let val = style.updateDate || style.installDate;
|
||||||
if (val) {
|
if (val) {
|
||||||
val = (Date.now() - val) / 3600e3; // age in hours
|
val = (Date.now() - val) / 3600e3; // age in hours
|
||||||
for (const [max, unit, text] of AGES) {
|
for (const [max, unit, text] of AGES) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user