More button stuff (#744)

* Preparing a pull

Preparing for https://github.com/collinbarrett/FilterLists/issues/743.

* Attempting for international date support

* Let's see how well this goes

* Removing mentions of momentjs

* Update SubscribeButton.tsx

* Take 2

* Update ViewButton.tsx

* Update ViewButton.tsx

* Update ViewButton.tsx

* Update ViewButton.tsx

* Create FilterListsVendor.css

* Update _Layout.cshtml

* Delete FilterListsVendor.css

* Update _Layout.cshtml

* What could possibly go wrong with this

* Update site.css

* Desperately looking for a place to insert the polyfill script

* I can just as well try with additional compressed formats

* Update UpdatedDate.tsx

* Update UpdatedDate.tsx

* Update UpdatedDate.tsx

* Update UpdatedDate.tsx
This commit is contained in:
Imre Kristoffer Eilertsen 2019-04-06 01:36:28 +02:00 committed by Collin M. Barrett
parent c1eb75e4bc
commit 1708826e4d
5 changed files with 28 additions and 12 deletions

View file

@ -1,5 +1,4 @@
import * as React from "react";
import * as moment from "moment";
interface IProps {
updatedDate: string;
@ -8,8 +7,8 @@ interface IProps {
export const UpdatedDate = (props: IProps) =>
props.updatedDate
? <li className="list-group-item">
<p>Updated: {moment(props.updatedDate).isValid()
? moment(props.updatedDate).format("l")
<p>Updated: (props.updatedDate).isValid()
? (props.updatedDate)Intl.DateTimeFormat().format(date)
: "N/A"}</p>
</li>
: null;
: null;

View file

@ -26,14 +26,20 @@ export const SubscribeButton = (props: IProps) => {
let href;
if (props.url.indexOf(".tpl") > 0)
{
href = `https://raw.githubusercontent.com/collinbarrett/FilterLists/master/data/TPLSubscriptionAssistant.html`;
href = `javascript:window.external.msAddTrackingProtectionList('${encodeURIComponent(props.url)}', '${hrefTitle}')`;
} else if (props.url.indexOf(".lsrules") > 0)
{
href = `x-littlesnitch:subscribe-rules?url=${encodeURIComponent(props.url)}`;
} else {
href = `abp:subscribe?location=${encodeURIComponent(props.url)}${hrefTitle}`;
};
let title;
if (props.url.indexOf(".tpl") > 0)
{
title = `${titlePrefix}Visit a TPL archive from which ${props.name} can be subscribed to with Internet Explorer.`;
title = `${titlePrefix}Subscribe to ${props.name} with Internet Explorer's Tracking Protection List feature.`;
} else if (props.url.indexOf(".lsrules") > 0)
{
title = `${titlePrefix}Subscribe to ${props.name} with Little Snitch's rule group subscription feature.`;
} else {
title = `${titlePrefix}Subscribe to ${props.name} with a browser extension supporting the \"abp:\" protocol (e.g. uBlock Origin, Adblock Plus).`;
};

View file

@ -7,9 +7,18 @@ interface IProps {
text?: string;
};
export const ViewButton = (props: IProps) =>
props.url
export const ViewButton = (props: IProps) => {
let title;
if (props.url.indexOf(".onion/") > 0) { title = `Tor address - View ${props.name} in its raw format.`; }
else if (props.url.indexOf(".zip") > 0) { title = `Download ${props.name} as a ZIP compressed archive.`; }
else if (props.url.indexOf(".7z") > 0) { title = `Download ${props.name} as a 7Z compressed archive.`; }
else if (props.url.indexOf(".tar.gz") > 0) { title = `Download ${props.name} as a compressed tarball archive.`; }
else { title = `View ${props.name} in its raw format`; };
return props.url
? <LinkButton href={props.url}
title={`View ${props.name} in its raw format.`}
title={title}
text={props.text || "View"}/>
: null;
: null;
}

View file

@ -1 +1,2 @@
body, h2, h3, h4, h5, blockquote { font-size: 16px; }
body, h2, h3, h4, h5, blockquote { font-size: 16px; }
.container{ max-width:98vw!important;padding-left:7px!important }

View file

@ -16,9 +16,10 @@
<body>
@RenderBody()
<script src="~/dist/vendor.js" asp-append-version="true"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js" asp-append-version="true"></script>
@RenderSection("scripts", false)
<noscript>
<p>FilterLists is built with ReactJS and therefore requires first-party JavaScript to be enabled. We do not use any third-party JavaScript, and your privacy is very important to us. If you prefer not to enable JavaScript or your browser does not support it, the data is largely available on <a href="https://github.com/collinbarrett/FilterLists">our GitHub repo</a>.</p>
</noscript>
</body>
</html>
</html>