Avoid displaying the full URL
This commit is contained in:
parent
fda9372c50
commit
43731312ca
|
|
@ -32,7 +32,7 @@ mixin adviceInfo(name, id, perfectScore, node)
|
|||
each offender in advice.offending
|
||||
if offender.startsWith('http')
|
||||
li
|
||||
a(href=offender) #{offender}
|
||||
a(href=offender) #{h.shortAsset(offender, true)}
|
||||
else
|
||||
li #{offender}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ if thirdparty.assets && Object.keys(thirdparty.assets).length > 0
|
|||
td.url.offendingurl
|
||||
ul
|
||||
each asset in thirdparty.assets[category]
|
||||
li #{asset.url}
|
||||
li
|
||||
a(href=asset.url) #{h.shortAsset(asset.url, true)}
|
||||
b (#{asset.entity.name})
|
||||
|
||||
if thirdparty.possibileMissedThirdPartyDomains && thirdparty.possibileMissedThirdPartyDomains.length > 0
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = function(url) {
|
||||
if (url.length > 40) {
|
||||
let shortUrl = url.replace(/\?.*/, '');
|
||||
url = shortUrl.substr(0, 20) + '...' + shortUrl.substr(-17);
|
||||
module.exports = function(url, longVersion) {
|
||||
if (longVersion) {
|
||||
if (url.length > 100) {
|
||||
let shortUrl = url.replace(/\?.*/, '');
|
||||
url = shortUrl.substr(0, 80) + '...' + shortUrl.substr(-17);
|
||||
}
|
||||
} else {
|
||||
if (url.length > 40) {
|
||||
let shortUrl = url.replace(/\?.*/, '');
|
||||
url = shortUrl.substr(0, 20) + '...' + shortUrl.substr(-17);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue