From 4cd0f2e7355186bf49d5a864f091d982258852b2 Mon Sep 17 00:00:00 2001 From: Dawid Potocki Date: Sun, 25 Aug 2019 04:01:50 +0000 Subject: [PATCH] Make JavaScript work with LibreJS (#1213) --- _includes/footer.html | 17 ++++++++++++++--- _includes/scripts.html | 13 ------------- about/javascript/index.html | 27 +++++++++++++++++++++++++++ assets/js/main.js | 28 +++++++++++++++++++++------- 4 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 about/javascript/index.html diff --git a/_includes/footer.html b/_includes/footer.html index 7472a098..1ca12dfc 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -71,8 +71,19 @@ + + + JavaScript Licenses + +

+ No Ads, No Google Analytics, No Affiliates, No Cross-Site Requests. + privacytools.io is a socially motivated website that provides information for protecting your data security and privacy. Never trust any company with your privacy, always encrypt. + View our privacy policy. +

+

+ Tor v3: privacy2zbidut4m4jyj3ksdqidzkw3uoip2vhvhbvwxbqux5xy5obyd.onion + (Learn More) +

+ diff --git a/_includes/scripts.html b/_includes/scripts.html index 08fffe2a..d55f2c76 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -11,17 +11,4 @@ - User privacy protection --> - diff --git a/about/javascript/index.html b/about/javascript/index.html new file mode 100644 index 00000000..1b77e49a --- /dev/null +++ b/about/javascript/index.html @@ -0,0 +1,27 @@ +

JavaScript Licenses

+ + + + + + + + + + + + + + + + + + + + + + + + + +
main.jsCC0-1.0-only
redirects.jsCC0-1.0-only
bootstrap.min.jsExpat
jquery-3.3.1.min.jsExpat
popper.min.jsExpat
sortable.min.jsExpat
diff --git a/assets/js/main.js b/assets/js/main.js index 6d68c8bc..f2925aad 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,13 +1,8 @@ -// Tooltips -$(function () { - $("[data-toggle='tooltip']").tooltip(); +$(function() { + $("[data-toggle='tooltip']").tooltip(); }); - -// // Navbar dropdowns -// - const navSections = document.querySelectorAll(".nav-details"); navSections.forEach(navSection => { @@ -31,3 +26,22 @@ function navSectionsClose(event) { navSection.open = !open; }); } + +// Matomo +var _paq = window._paq || []; +/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ +_paq.push(["trackPageView"]); +_paq.push(["enableLinkTracking"]); +(function() { + var u = "https://stats.privacytools.io/"; + _paq.push(["setTrackerUrl", u + "matomo.php"]); + _paq.push(["setSiteId", "1"]); + var d = document, + g = d.createElement("script"), + s = d.getElementsByTagName("script")[0]; + g.type = "text/javascript"; + g.async = true; + g.defer = true; + g.src = u + "matomo.js"; + s.parentNode.insertBefore(g, s); +})();