Merge pull request #5152 from consuldemocracy/remove_ie8_warning
Remove alert for Internet Explorer 8 and below
This commit is contained in:
@@ -52,7 +52,6 @@
|
||||
//= require check_all_none
|
||||
//= require comments
|
||||
//= require foundation_extras
|
||||
//= require ie_alert
|
||||
//= require location_changer
|
||||
//= require moderator_comment
|
||||
//= require moderator_debates
|
||||
@@ -129,7 +128,6 @@ var initialize_modules = function() {
|
||||
App.FoundationExtras.initialize();
|
||||
App.LocationChanger.initialize();
|
||||
App.CheckAllNone.initialize();
|
||||
App.IeAlert.initialize();
|
||||
App.AdvancedSearch.initialize();
|
||||
App.RegistrationForm.initialize();
|
||||
App.Suggest.initialize();
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
App.IeAlert = {
|
||||
set_cookie_and_hide: function(event) {
|
||||
event.preventDefault();
|
||||
$.cookie("ie_alert_closed", "true", {
|
||||
path: "/",
|
||||
expires: 365
|
||||
});
|
||||
$(".ie-callout").remove();
|
||||
},
|
||||
initialize: function() {
|
||||
$(".ie-callout-close-js").on("click", function(event) {
|
||||
App.IeAlert.set_cookie_and_hide(event);
|
||||
});
|
||||
}
|
||||
};
|
||||
}).call(this);
|
||||
@@ -223,17 +223,6 @@ button,
|
||||
color: $check;
|
||||
}
|
||||
|
||||
.ie-callout {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
|
||||
.close {
|
||||
font-size: rem-calc(34);
|
||||
top: 20%;
|
||||
}
|
||||
}
|
||||
|
||||
.menu.simple {
|
||||
border-bottom: 1px solid $border;
|
||||
clear: both;
|
||||
|
||||
@@ -17,34 +17,11 @@
|
||||
|
||||
<div class="wrapper <%= yield(:wrapper_class) %>">
|
||||
<%= render "layouts/header", with_subnavigation: true %>
|
||||
|
||||
<% if request.headers["User-Agent"] =~ /MSIE/ && cookies["ie_alert_closed"] != "true" %>
|
||||
<!--[if lt IE 9]>
|
||||
<div data-alert class="callout primary ie-callout" data-closable>
|
||||
<button class="close-button ie-callout-close-js"
|
||||
aria-label="<%= t("application.close") %>" type="button" data-close>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h2><%= t("layouts.application.ie_title") %></h2>
|
||||
<p>
|
||||
<%= sanitize(t("layouts.application.ie",
|
||||
chrome: link_to(t("layouts.application.chrome"),
|
||||
"https://www.google.com/chrome/browser/desktop/",
|
||||
title: t("shared.target_blank"),
|
||||
target: "_blank"),
|
||||
firefox: link_to(t("layouts.application.firefox"),
|
||||
"https://www.mozilla.org/firefox",
|
||||
title: t("shared.target_blank"),
|
||||
target: "_blank"))) %>
|
||||
</p>
|
||||
</div>
|
||||
<![endif]-->
|
||||
<% end %>
|
||||
|
||||
<%= render "layouts/flash" %>
|
||||
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<%= render Layout::FooterComponent.new %>
|
||||
</div>
|
||||
|
||||
@@ -177,11 +177,6 @@ en:
|
||||
geozones:
|
||||
none: All city
|
||||
layouts:
|
||||
application:
|
||||
chrome: Google Chrome
|
||||
firefox: Firefox
|
||||
ie: We have detected that you are browsing with Internet Explorer. For an enhanced experience, we recommend using %{firefox} or %{chrome}.
|
||||
ie_title: This website is not optimised for your browser
|
||||
dashboard:
|
||||
proposal_header:
|
||||
published: Published
|
||||
|
||||
@@ -177,11 +177,6 @@ es:
|
||||
geozones:
|
||||
none: Toda la ciudad
|
||||
layouts:
|
||||
application:
|
||||
chrome: Google Chrome
|
||||
firefox: Firefox
|
||||
ie: Hemos detectado que estás navegando desde Internet Explorer. Para una mejor experiencia te recomendamos utilizar %{firefox} o %{chrome}.
|
||||
ie_title: Esta web no está optimizada para tu navegador
|
||||
dashboard:
|
||||
proposal_header:
|
||||
published: Publicada
|
||||
|
||||
@@ -58,10 +58,6 @@ RSpec.configure do |config|
|
||||
Capybara::Webmock.stop
|
||||
end
|
||||
|
||||
config.after(:each, :page_driver) do
|
||||
page.driver.reset!
|
||||
end
|
||||
|
||||
config.before(:each, type: :system) do |example|
|
||||
driven_by :headless_chrome
|
||||
Capybara.default_set_options = { clear: :backspace }
|
||||
|
||||
@@ -105,39 +105,6 @@ describe "Home" do
|
||||
end
|
||||
end
|
||||
|
||||
describe "IE alert", :no_js do
|
||||
scenario "IE visitors are presented with an alert until they close it", :page_driver do
|
||||
# Selenium API does not include page request/response inspection methods
|
||||
# so we must use Capybara::RackTest driver to set the browser's headers
|
||||
Capybara.current_session.driver.header(
|
||||
"User-Agent",
|
||||
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"
|
||||
)
|
||||
|
||||
visit root_path
|
||||
expect(page).to have_xpath(ie_alert_box_xpath)
|
||||
expect(page.driver.request.cookies["ie_alert_closed"]).to be nil
|
||||
|
||||
# faking close button, since a normal find and click
|
||||
# will not work as the element is inside a HTML conditional comment
|
||||
page.driver.browser.set_cookie("ie_alert_closed=true")
|
||||
|
||||
visit root_path
|
||||
expect(page).not_to have_xpath(ie_alert_box_xpath)
|
||||
expect(page.driver.request.cookies["ie_alert_closed"]).to eq("true")
|
||||
end
|
||||
|
||||
scenario "non-IE visitors are not bothered with IE alerts", :page_driver do
|
||||
visit root_path
|
||||
expect(page).not_to have_xpath(ie_alert_box_xpath)
|
||||
expect(page.driver.request.cookies["ie_alert_closed"]).to be nil
|
||||
end
|
||||
|
||||
def ie_alert_box_xpath
|
||||
"/html/body/div[@class='wrapper ']/comment()[contains(.,'ie-callout')]"
|
||||
end
|
||||
end
|
||||
|
||||
describe "Menu button" do
|
||||
scenario "is not present on large screens" do
|
||||
visit root_path
|
||||
|
||||
Reference in New Issue
Block a user