[tor-commits] [tpo/master] Update to script in line

hiro at torproject.org hiro at torproject.org
Thu Apr 4 23:23:08 UTC 2019


commit 0afd5bf53cf8d2b1dc86a0b47283847a998b38ed
Author: hiro <hiro at torproject.org>
Date:   Fri Apr 5 01:23:04 2019 +0200

    Update to script in line
---
 assets/static/js/download.js   | 16 ++++++++++++++++
 templates/footer.html          |  2 +-
 templates/meta.html            |  1 -
 templates/script-download.html | 14 --------------
 4 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/assets/static/js/download.js b/assets/static/js/download.js
new file mode 100644
index 0000000..8ce7625
--- /dev/null
+++ b/assets/static/js/download.js
@@ -0,0 +1,16 @@
+$(".downloadLink").click(
+    function(e) {
+        e.preventDefault();
+
+        locale = window.location.href.split('/')[3];
+        //open download link in new page
+        window.open( $(this).attr("href") );
+        url = "/thank-you/"
+        //redirect current page to success page
+        if (locale != "download") {
+          url = "/" + locale + url
+        }
+        window.location=url;
+        window.focus();
+    }
+);
diff --git a/templates/footer.html b/templates/footer.html
index 63080db..5602948 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -89,5 +89,5 @@
     <script src="{{ '/static/js/scrollspy.min.js'|asseturl }}" ></script>
     <script src="{{ '/static/js/modernizr.js'|asseturl }}" ></script>
     <script src="{{ '/static/js/fallback.js'|asseturl }}" ></script>
-    {% include 'script-download.html' %}
+    <script src="{{ '/static/js/download.js'|asseturl }}" ></script>
   </div>
diff --git a/templates/meta.html b/templates/meta.html
index ff32484..a86eb82 100644
--- a/templates/meta.html
+++ b/templates/meta.html
@@ -1,7 +1,6 @@
 <!doctype html>
 <html xmlns="http://www.w3.org/1999/xhtml" {% if bag('alternatives', this.alt, 'direction') == 'text-right' %}dir="rtl"{% endif %}>
 <meta charset="utf-8">
-<meta http-equiv="Content-Security-Policy" content="base-uri 'self'">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <meta name="description" content="{{ _('Defend yourself against tracking and surveillance. Circumvent censorship.') }}">
 <meta name="twitter:card" content="summary" />
diff --git a/templates/script-download.html b/templates/script-download.html
deleted file mode 100644
index ce605ea..0000000
--- a/templates/script-download.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<script>
-  $(".downloadLink").click(
-      function(e) {
-          e.preventDefault();
-
-          //open download link in new page
-          window.open( $(this).attr("href") );
-
-          //redirect current page to success page
-          window.location="{{ '/thank-you'|url(alt=this.alt) }}";
-          window.focus();
-      }
-  );
-</script>



More information about the tor-commits mailing list