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

[tor-commits] [tpo/master] Move the new hero-download script tag to a special block



commit 41330935384a6ce8ed394e1bbd6d298748229116
Author: kez <kez@xxxxxxxxxxxxxx>
Date:   Thu Jul 1 12:34:30 2021 -0400

    Move the new hero-download script tag to a special block
    
    This solves the issue of a lone script tag dropped in the middle of the content,
    and organizes the template a tiny bit better.
---
 templates/hero-download.html | 10 +++++++++-
 templates/meta.html          | 39 +++++++++++++++++++++------------------
 2 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/templates/hero-download.html b/templates/hero-download.html
index 3a054065..9efe7d3b 100644
--- a/templates/hero-download.html
+++ b/templates/hero-download.html
@@ -1,3 +1,11 @@
+{% block head_extra %}
+<script>
+  // we can't use jquery for the event listener because jquery isn't loaded yet
+  document.addEventListener("DOMContentLoaded", function() {
+    $('[data-toggle="tooltip"]').tooltip();
+  });
+</script>
+{% endblock %}
 <div class="row">
   <h1 class="mx-auto display-2 text-white text-center">{{ _('Defend yourself.') }}</h1>
 </div>
@@ -41,7 +49,7 @@
         </script>
         <a class="btn btn-primary mt-4 downloadLink" href="{{ download_link }}">{{ _('Download for') }} {{ item.label }}</a>
         <a class="link" href="{{ sig_link }}" download><span class="nick text-white" style="text-decoration: underline;">{{ _('Signature') }}</span></a>
-        <a class="link" href="{{ 'https://support.torproject.org/' + this.alt + '/tbb/how-to-verify-signature/' }}" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{ _('Learn how to verify a signature') }}"><i style="font-size:10px;" class="text-light fas fa-question-circle"></i></a>
+        <a class="link" href="{{ 'https://support.torproject.org/' + this.alt + '/tbb/how-to-verify-signature/' }}" target="_blank" data-toggle="tooltip" data-placement="top" title="{{ _('Learn how to verify a signature') }}"><i style="font-size:10px;" class="text-light fas fa-question-circle"></i></a>
       </div>
     </div>
     {% endfor %}
diff --git a/templates/meta.html b/templates/meta.html
index 9e9c26b0..c446a9eb 100644
--- a/templates/meta.html
+++ b/templates/meta.html
@@ -1,23 +1,26 @@
 <!doctype html>
 <html xmlns="http://www.w3.org/1999/xhtml"; lang="{{  this.alt }}" {% if bag('alternatives', this.alt, 'direction') == 'text-right' %}dir="rtl" {% endif %}>
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1">
-<meta name="description" content="{{ _('Defend yourself against tracking and surveillance. Circumvent censorship.') }} | {{ this.title }}">
-<meta name="twitter:card" content="summary" />
-<meta name="twitter:site" content="@torproject" />
-<meta name="twitter:creator" content="@torproject" />
-<meta name="twitter:image" content="https://www.torproject.org/static/images/tor-project-logo-onions.png"/>
-<meta property="og:url" content="https://torproject.org"; />
-<meta property="og:title" content="{{ _('The Tor Project | Privacy & Freedom Online') }}" />
-<meta property="og:description" content="{{ _('Defend yourself against tracking and surveillance. Circumvent censorship.') }}" />
-<meta property="og:image" content="https://www.torproject.org/static/images/tor-project-logo-onions.png"; />
-<link rel="stylesheet" href="{{ '/static/css/bootstrap.css'|asseturl }}">
-<link rel="stylesheet" href="{{ '/static/fonts/fontawesome/css/all.min.css'|asseturl }}" rel="stylesheet">
-<!-- Standard favicon -->
-<link rel="icon" type="image/x-icon" href="https://www.torproject.org/static/images/favicon/favicon.ico";>
-<!-- Recommended favicon format -->
-<link rel="icon" type="image/png" href="https://www.torproject.org/static/images/favicon/favicon.png";>
-<title>{{ _("Tor Project") }} | {% block title %}{{ this.title }}{% endblock %}</title>
+<head>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <meta name="description" content="{{ _('Defend yourself against tracking and surveillance. Circumvent censorship.') }} | {{ this.title }}">
+  <meta name="twitter:card" content="summary" />
+  <meta name="twitter:site" content="@torproject" />
+  <meta name="twitter:creator" content="@torproject" />
+  <meta name="twitter:image" content="https://www.torproject.org/static/images/tor-project-logo-onions.png"/>
+  <meta property="og:url" content="https://torproject.org"; />
+  <meta property="og:title" content="{{ _('The Tor Project | Privacy & Freedom Online') }}" />
+  <meta property="og:description" content="{{ _('Defend yourself against tracking and surveillance. Circumvent censorship.') }}" />
+  <meta property="og:image" content="https://www.torproject.org/static/images/tor-project-logo-onions.png"; />
+  <link rel="stylesheet" href="{{ '/static/css/bootstrap.css'|asseturl }}">
+  <link rel="stylesheet" href="{{ '/static/fonts/fontawesome/css/all.min.css'|asseturl }}" rel="stylesheet">
+  <!-- Standard favicon -->
+  <link rel="icon" type="image/x-icon" href="https://www.torproject.org/static/images/favicon/favicon.ico";>
+  <!-- Recommended favicon format -->
+  <link rel="icon" type="image/png" href="https://www.torproject.org/static/images/favicon/favicon.png";>
+  <title>{{ _("Tor Project") }} | {% block title %}{{ this.title }}{% endblock %}</title>
+  {% block head_extra %}{% endblock %}
+</head>
 <body class="no-gutters">
   <header>
     {% if this.path == '/download' %}



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