[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tpo/master] Move inline js



commit 2a715048b7feefdf9a65dc6556b827afca4cfbe8
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date:   Thu Apr 4 18:21:31 2019 +0200

    Move inline js
---
 assets/static/js/download.js   | 12 ++++++++++++
 templates/script-download.html | 15 +--------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/assets/static/js/download.js b/assets/static/js/download.js
new file mode 100644
index 0000000..17a5d88
--- /dev/null
+++ b/assets/static/js/download.js
@@ -0,0 +1,12 @@
+$(".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();
+    }
+);
diff --git a/templates/script-download.html b/templates/script-download.html
index cb341ec..1583d28 100644
--- a/templates/script-download.html
+++ b/templates/script-download.html
@@ -1,14 +1 @@
-<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>
+<script src="{{ '/static/js/download.js'|asseturl }}" ></script>

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits