Chrome frame implementation for deprecated browsers #1350

Closed
wants to merge 5 commits into
from
@@ -2,7 +2,8 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
-
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
+
<title><%= [@page_title, active_admin_application.site_title].compact.join(" | ") %></title>
<% ActiveAdmin.application.stylesheets.each do |style| %>
@@ -15,6 +16,25 @@
<%= csrf_meta_tag %>
</head>
<body class="logged_out <%= controller.action_name %>">
+<!--[if IE]>
+ <script type="text/javascript"
+ src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
+
+ <div id="prompt">
+ </div>
+
+ <script>
+ // The conditional ensures that this code will only execute in IE,
+ // Therefore we can use the IE-specific attachEvent without worry
+ window.attachEvent("onload", function() {
+ CFInstall.check({
+ mode: "inline", // the default
+ node: "prompt"
+ });
+ });
+ </script>
+<![endif]-->
+
<div id="wrapper">
<div id="content_wrapper">
@@ -237,6 +237,7 @@ def register_default_assets
end
register_javascript 'active_admin.js'
+ register_javascript 'http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js'
end
def extract_namespace_name(options)
@@ -30,6 +30,7 @@ def to_s
def build_head
@head = head do
meta :"http-equiv" => "Content-type", :content => "text/html; charset=utf-8"
+ meta :"http-equiv" => "X-UA-Compatible", :content => "IE=Edge,chrome=1"
end
end