show secondary button with alternate text for Archive.org urls

This commit is contained in:
Collin Barrett 2018-08-25 16:13:51 -05:00
parent 84de43a403
commit 4a1f694244
3 changed files with 27 additions and 10 deletions

View file

@ -4158,7 +4158,7 @@
"publishedDate": null,
"submissionUrl": null,
"syntaxId": null,
"viewUrl": "https://web.archive.org/web/20160411115130/http://adblock-korea.googlecode.com:80/git/adblock-korea.txt"
"viewUrl": "https://web.archive.org/web/20160411115130if_/http://adblock-korea.googlecode.com:80/git/adblock-korea.txt"
},
{
"id": 221,
@ -5260,7 +5260,7 @@
"publishedDate": null,
"submissionUrl": null,
"syntaxId": null,
"viewUrl": "https://web.archive.org/web/20110212174029/http://abp-corset.googlecode.com:80/hg/corset.txt"
"viewUrl": "https://web.archive.org/web/20110212174029if_/http://abp-corset.googlecode.com:80/hg/corset.txt"
},
{
"id": 279,

View file

@ -199,9 +199,15 @@ interface IListTagDto {
}
function SubscribeUrl(props: any) {
return <a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&amp;title=${encodeURIComponent(props.name)}`}
return props.url.indexOf("web.archive.org") !== -1
? (<a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&amp;title=${encodeURIComponent(props.name)}`}
className="btn btn-secondary btn-block"
title={"Archive.org Mirror (Original Offline) - Subscribe to list with browser extension supporting \"abp:\" protocol (e.g. uBlock Origin, AdBlock Plus)."}>
Subscribe
</a>)
: (<a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&amp;title=${encodeURIComponent(props.name)}`}
className="btn btn-primary btn-block"
title={"Subscribe to list with browser extension supporting \"abp:\" protocol (e.g. uBlock Origin, AdBlock Plus)."}>
Subscribe
</a>;
</a>);
}

View file

@ -168,18 +168,29 @@ function License(props: any) {
}
function SubscribeUrl(props: any) {
return <a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&amp;title=${encodeURIComponent(props.name)}`}
className="d-block d-sm-none btn btn-primary fl-btn-details-action"
title={ `Subscribe to ${props.name} with browser extension supporting \"abp:\" protocol (e.g. uBlock Origin, AdBlock Plus).` }>
return props.url.indexOf("web.archive.org") !== -1
? (<a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&amp;title=${encodeURIComponent(props.name)}`}
className="d-block d-sm-none btn btn-secondary fl-btn-details-action"
title={"Archive.org Mirror (Original Offline) - Subscribe to list with browser extension supporting \"abp:\" protocol (e.g. uBlock Origin, AdBlock Plus)."}>
Subscribe
</a >;
</a>)
: (<a href={`abp:subscribe?location=${encodeURIComponent(props.url)}&amp;title=${encodeURIComponent(props.name)}`}
className="d-block d-sm-none btn btn-primary fl-btn-details-action"
title={"Subscribe to list with browser extension supporting \"abp:\" protocol (e.g. uBlock Origin, AdBlock Plus)."}>
Subscribe
</a>);
}
function ViewUrl(props: any) {
return <a href={props.url} className="btn btn-primary fl-btn-details-action"
return props.url.indexOf("web.archive.org") !== -1
? (<a href={props.url} className="btn btn-secondary fl-btn-details-action"
title={`Archive.org Mirror (Original Offline) - View ${props.name} in its raw format.`}>
View
</a>)
: (<a href={props.url} className="btn btn-primary fl-btn-details-action"
title={`View ${props.name} in its raw format.`}>
View
</a>;
</a>);
}
function HomeUrl(props: any) {