From: Tara L Andrews <tla@mit.edu>
Date: Tue, 18 Sep 2012 14:51:19 +0000 (+0200)
Subject: add browser compatibility check
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50778a5d5940cd9a4acfd7a0ed32398f2c714f7e;p=scpubgit%2Fstemmaweb.git

add browser compatibility check
---

diff --git a/root/js/componentload.js b/root/js/componentload.js
index 983ac33..1cbc2ac 100644
--- a/root/js/componentload.js
+++ b/root/js/componentload.js
@@ -243,6 +243,12 @@ function _get_url( els ) {
 
 
 $(document).ready( function() {
+	// See if we have the browser functionality we need
+	// TODO Also think of a test for SVG readiness
+	if( typeof window.FileReader && typeof window.File ) {
+		$('#compatibility_check').empty();
+	}
+	
     // call out to load the directory div
     $('#textinfo_container').hide();
     $('#textinfo_waitbox').hide();
diff --git a/root/src/index.tt b/root/src/index.tt
index bf5cdf0..cdac15f 100644
--- a/root/src/index.tt
+++ b/root/src/index.tt
@@ -13,6 +13,10 @@ var textOnLoad = "[% withtradition %]";
     <div id="topbanner">
       <h1>Stemmaweb - a collection of tools for analysis of collated texts</h1>
       <span class="mainnav">[% IF c.user_exists %]Hello! [% c.user.get_object.email %] <a class="navlink" href="[% c.uri_for( '/logout' ) %]">Sign out</a> | [% ELSE %]<a class="navlink" onclick="window.open('[% c.uri_for( '/login' ) %]', 'loginwindow', 'height=385,width=445')">Login</a> | [% END %]<a class="navlink" href="[% c.uri_for( '/about' ) %]">About</a> </span>
+      <p id="compatibility_check"><span class="error">This browser does not support 
+      the functions necessary for Stemmaweb to work properly. We recommend use of 
+      <a href="http://mozilla.org/firefox">Mozilla Firefox</a> or 
+      <a href="http://www.google.com/chrome">Google Chrome</a>.</span></p>
     </div>
     <div id="directory_container">
       <h2>Text directory</h2>