We use a plain .js file in /public instead of the asset pipeline, and
don't rely on any JS libraries. This gives the error alert a much
better chance of working in a browser that can't even parse our
compiled/minified application.js.
--- /dev/null
+<!-- googleoff: all -->
+<div id="browser-unsupported" class="hidden">
+ <div class="alert alert-danger">
+ <p>
+ <b>Hey!</b> Your web browser is missing some of the features we
+ rely on. Usually this means you're running an old version.
+ Updating your system, or switching to a current version
+ of <a class="alert-link"
+ href="//google.com/search?q=download+Mozilla+Firefox">Firefox</a>
+ or <a class="alert-link"
+ href="//google.com/search?q=download+Google+Chrome">Chrome</a>,
+ should fix this.
+ </p>
+ </div>
+</div>
+<!-- googleon: all -->
</nav>
<% end %>
+ <%= render partial: 'browser_unsupported' %><%# requires JS support below %>
+
<div id="page-wrapper">
<%= yield %>
</div>
<div class="modal-container"></div>
<div id="report-issue-modal-window"></div>
+<script src="/browser_unsupported.js"></script>
--- /dev/null
+(function() {
+ var ok = false;
+ try {
+ if (window.Blob &&
+ window.File &&
+ window.FileReader) {
+ ok = true;
+ }
+ } catch(err) {}
+ if (!ok) {
+ document.getElementById('browser-unsupported').className='';
+ }
+})();