Skip to content

Commit

Permalink
Edge est (vraiment) préférable à IE
Browse files Browse the repository at this point in the history
**Ceci ne veut pas dire qu’on retire le support d’Internet Explorer.**

Mais bon, en pratique, personne n’a le temps de tester le site sur IE,
et pire, personne non plus n’a le temps de reporter les bugs sur
IE. Le site marche terriblement mal sur ces navigateurs.

Désormais, une *dickbar*¹ est affiché en haut du site indiquant “Le
bon fonctionnement du site avec Internet Explorer n'est pas garanti”,
avec un lien “En savoir plus” pointant vers https://browsehappy.com.

1. https://daringfireball.net/linked/2011/03/06/dickbar
  • Loading branch information
motet-a authored and artragis committed Jan 3, 2018
1 parent 8aebf47 commit 4b76f82
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
9 changes: 7 additions & 2 deletions assets/scss/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ textarea {
resize: vertical;
}

.chromeframe {
.old-browser-warning {
margin: 0;
background: #ccc;
background: #ddd;
color: #000;
padding: 0.2em 0;
text-align: center;
Expand All @@ -105,6 +105,11 @@ textarea {
width: 100%;
}

body.old-browser-warning-shown .page-container {
position: relative;
top: 3rem;
}

.a11y {
display: block;
width: 0;
Expand Down
5 changes: 2 additions & 3 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@
data-show-markdown-help="false"
{% endif %}
>
<!--[if lt IE 9]>
<p class="chromeframe">Vous utilisez un navigateur <strong>dépassé</strong>. Merci de <a href="http://browsehappy.com/">mettre à jour celui-ci</a> pour améliorer votre expérience.</p>
<![endif]-->

{% include "old_browser_warning.html" %}

<div class="mobile-menu" id="mobile-menu"></div>

Expand Down
27 changes: 27 additions & 0 deletions templates/old_browser_warning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

<div id="old-browser-warning-container"></div>

{# The main JavaScript files may cause parse errors on old browsers in the #}
{# future (ES6, ES7, …). It is probably better to keep this script separated. #}

<script>

(function () {
var container = document.getElementById("old-browser-warning-container");

if (window.ActiveXObject || 'ActiveXObject' in window) {
var more = document.createElement('A');
more.innerText = 'En savoir plus';
more.setAttribute('href', 'https://browsehappy.com/?locale=fr');

var div = document.createElement('DIV');
div.className = 'old-browser-warning';
div.innerText = 'Le bon fonctionnement du site avec Internet Explorer n’est pas garanti  •  ';
div.appendChild(more);
container.appendChild(div);

document.body.classList.add('old-browser-warning-shown');
}
})();

</script>

0 comments on commit 4b76f82

Please sign in to comment.