|
1 | 1 | {# This Source Code Form is subject to the terms of the Mozilla Public |
2 | | - # License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | | - # file, You can obtain one at http://mozilla.org/MPL/2.0/. -#} |
4 | | - |
5 | | -<!DOCTYPE html> |
6 | | -<html lang="{{ LANG|replace('en-US', 'en') }}" dir="{{ DIR }}"> |
7 | | - <head> |
8 | | - <meta charset="utf-8"> |
9 | | - <meta name="robots" content="noindex"> |
10 | | - <title>{% block title %}{{ _('Your Thunderbird is Not Up-to-Date!') }}{% endblock %}</title> |
11 | | - {{ l10n_css() }} |
12 | | - <!-- Fontawesome added below --> |
13 | | - <link href="/media/css/fontawesome-all.css" rel="stylesheet"> |
14 | | - <!--<script defer src="/media/js/fontawesome-all.js"></script>--> |
15 | | - <style> |
16 | | - body { |
17 | | - background-color: #D46A6A; |
18 | | - text-align: center; |
19 | | - } |
20 | | - </style> |
21 | | - </head> |
22 | | - <body> |
23 | | - <main> |
24 | | - <h1><b><i class="fas fa-exclamation-triangle fa-3x" style="color:#0060df"></i> {{ self.title() }}</b></h1> |
| 2 | +# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | +# file, You can obtain one at http://mozilla.org/MPL/2.0/. -#} |
| 4 | + |
| 5 | +{% extends "_base-resp.html" %} |
| 6 | + |
| 7 | +{% block channel %}release{% endblock %} |
| 8 | +{% block title %}{{ _('Your Thunderbird is Not Up-to-Date!') }}{% endblock %} |
| 9 | + |
| 10 | +{% block additional_head %} |
| 11 | +<style> |
| 12 | + body { |
| 13 | + background-image: none; |
| 14 | + background-color: #991b1b; |
| 15 | + color: #f1f3fa; |
| 16 | + text-shadow: 1px 1px 0 black;; |
| 17 | + text-align: center; |
| 18 | + } |
| 19 | + |
| 20 | + .main-content { |
| 21 | + display: block; |
| 22 | + } |
| 23 | + |
| 24 | + .outdated-warning-icon { |
| 25 | + display: inline-block; |
| 26 | + position: relative; |
| 27 | + top: 8px; |
| 28 | + width: 32px; |
| 29 | + height: 32px; |
| 30 | + color: #88ccfc; |
| 31 | + } |
| 32 | + a { |
| 33 | + text-decoration: underline !important; |
| 34 | + color: #88ccfc; |
| 35 | + } |
| 36 | + a:visited { |
| 37 | + color: #88ccfc; |
| 38 | + text-decoration: underline !important; |
| 39 | + |
| 40 | + } |
| 41 | +</style> |
| 42 | +{% endblock %} |
| 43 | + |
| 44 | +{% block main %} |
| 45 | +<div class="main-content"> |
| 46 | + <section id="outdated-message"> |
| 47 | + <h1><b><span class="outdated-warning-icon">{{ svg('warning') }}</span> {{ self.title() }}</b></h1> |
25 | 48 | <h2 id="duration">{{ _('Your version, $vers, is no longer a supported Thunderbird release and hasn’t received updates in at least $mon months.') }}</h2> |
26 | | - <p class="fa-lg">{{ _('We <b>strongly recommend</b> downloading the <a href="%(download_url)s">latest stable version of Thunderbird</a>.')|format(download_url='https://thunderbird.net') }}</p> |
27 | | - <p class="fa-lg">{{ _('For more information, please check this <a href="%(support_url)s">support article</a> on upgrading old versions.')|format(support_url='https://support.mozilla.org/en-US/products/thunderbird') }}</p> |
28 | | - </main> |
29 | | - </body> |
| 49 | + <p>{{ _('We <b>strongly recommend</b> downloading the |
| 50 | + <a href="%(download_url)s">latest stable version of Thunderbird</a>.')|format(download_url='https://thunderbird.net') }} |
| 51 | + </p> |
| 52 | + <p>{{ _('For more information, please check this |
| 53 | + <a href="%(support_url)s">support article</a> on upgrading old versions.')|format(support_url=url('support.old-version-upgrade')) }} |
| 54 | + </p> |
| 55 | + </section> |
| 56 | +</div> |
30 | 57 | <script> |
| 58 | + // Date of last security release for each major version. |
| 59 | + version_dates = {{ get_outdated_versions() }} |
| 60 | + |
| 61 | + function getVersionDate(version) { |
| 62 | + return new Date(version_dates[version]); |
| 63 | + } |
31 | 64 |
|
32 | | -// Date of last security release for each major version. |
33 | | -version_dates = { |
34 | | - 24: new Date(2014, 8, 2), |
35 | | - 31: new Date(2015, 6, 17), |
36 | | - 38: new Date(2016, 4, 4), |
37 | | - 45: new Date(2017, 2, 7), |
38 | | - 52: new Date(2018, 6, 10), |
39 | | - 60: new Date(2019, 10, 5) |
40 | | -} |
41 | | - |
42 | | -function monthDiff(dateFrom, dateTo) { |
43 | | - return dateTo.getMonth() - dateFrom.getMonth() + |
44 | | - (12 * (dateTo.getFullYear() - dateFrom.getFullYear())) |
45 | | -} |
46 | | - |
47 | | -function get_browser() { |
48 | | - var ua=navigator.userAgent,tem,M=ua.match(/(firefox|thunderbird(?=\/))\/?\s*(\d+)/i) || []; |
49 | | - M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; |
50 | | - if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);} |
| 65 | + function monthDiff(dateFrom, dateTo) { |
| 66 | + return dateTo.getMonth() - dateFrom.getMonth() + |
| 67 | + (12 * (dateTo.getFullYear() - dateFrom.getFullYear())) |
| 68 | + } |
| 69 | + |
| 70 | + function get_browser() { |
| 71 | + var ua = navigator.userAgent, tem, M = ua.match(/(firefox|thunderbird(?=\/))\/?\s*(\d+)/i) || []; |
| 72 | + M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?']; |
| 73 | + if ((tem = ua.match(/version\/(\d+)/i)) != null) { |
| 74 | + M.splice(1, 1, tem[1]); |
| 75 | + } |
51 | 76 | return { |
52 | 77 | name: M[0], |
53 | 78 | version: M[1] |
54 | 79 | }; |
55 | | - } |
56 | | - |
57 | | -// Clamp the version number to the closest among version_dates. |
58 | | -function get_version(vers) { |
59 | | - // This instead of Object.keys() for compatibility with old versions. |
60 | | - var versions = [], i = 0; |
61 | | - for (versions[i++] in version_dates) {} |
| 80 | + } |
62 | 81 |
|
63 | | - var closest = versions.reduce(function(prev, curr) { |
64 | | - return (Math.abs(curr - vers) < Math.abs(prev - vers) ? curr : prev); |
65 | | - }); |
| 82 | + // Clamp the version number to the closest among version_dates. |
| 83 | + function get_version(vers) { |
| 84 | + // This instead of Object.keys() for compatibility with old versions. |
| 85 | + var versions = [], i = 0; |
| 86 | + for (versions[i++] in version_dates) { |
| 87 | + } |
66 | 88 |
|
67 | | - return closest; |
68 | | -} |
| 89 | + var closest = versions.reduce(function (prev, curr) { |
| 90 | + return (Math.abs(curr - vers) < Math.abs(prev - vers) ? curr : prev); |
| 91 | + }); |
69 | 92 |
|
70 | | -// browser.name = 'Thunderbird', browser.version = '60' |
71 | | -var browser=get_browser(); |
72 | | -clamped_version = get_version(browser.version); |
| 93 | + return closest; |
| 94 | + } |
73 | 95 |
|
74 | | -var rel_date = version_dates[clamped_version] || new Date(); |
75 | | -var num_months = monthDiff(rel_date, new Date()) || 12; |
| 96 | + // browser.name = 'Thunderbird', browser.version = '60' |
| 97 | + var browser = get_browser(); |
| 98 | + clamped_version = get_version(browser.version); |
76 | 99 |
|
77 | | -duration = document.getElementById('duration').innerHTML; |
78 | | -document.getElementById('duration').innerHTML = duration.replace('$mon', num_months).replace('$vers', browser.version); |
| 100 | + var rel_date = getVersionDate(clamped_version) || new Date(); |
| 101 | + var num_months = monthDiff(rel_date, new Date()) || 12; |
79 | 102 |
|
| 103 | + duration = document.getElementById('duration').innerHTML; |
| 104 | + document.getElementById('duration').innerHTML = duration.replace('$mon', num_months).replace('$vers', browser.version); |
80 | 105 | </script> |
81 | | -</html> |
| 106 | +{% endblock %} |
0 commit comments