Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Commit

Permalink
Disabling access from older browsers or without javascript support, f…
Browse files Browse the repository at this point in the history
…or now
  • Loading branch information
dmfrancisco committed Jul 12, 2011
1 parent b1aecea commit 3dd909e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 9 deletions.
28 changes: 19 additions & 9 deletions editor/document.html.mu
Expand Up @@ -78,21 +78,31 @@
</div>
</div>

<noscript>
<div class="blocking-warning">You should enable javascript to access this website.</div>
</noscript>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="/js/libs/jquery-1.4.2.min.js"%3E%3C/script%3E'))</script>

<script src="/js/libs/ace/ace.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script src="/share/share.js"></script>
<script src="/share/share-ace.js"></script>

<script src="/js/plugins.js"></script>

<script type="text/javascript">
var docName = '{{{docName}}}';
var port = {{{port}}};
</script>

<script src="/js/script.js"></script>
if ($("html").is('.ie6, .ie7, .ie8')) {
$("body").html("<div class='blocking-warning'>We are sorry but this application does not work in your browser" +
" for now. <br/>If possible, try to access this website using a different browser, such as <a" +
" href='http://google.com/chrome/'>Google Chrome</a>, <a " +
" href='http://mozilla.com/firefox/'>Mozilla Firefox 4+</a> or <a " +
" href='http://beautyoftheweb.com/'>Internet Explorer 9+</a>.<br/></div>");
} else {
document.write("<script src='/js/libs/ace/ace.js'><\/script>");
document.write("<script src='/socket.io/socket.io.js'><\/script>");
document.write("<script src='/share/share.js'><\/script>");
document.write("<script src='/share/share-ace.js'><\/script>");
document.write("<script src='/js/plugins.js'><\/script>");
document.write("<script src='/js/script.js'><\/script>");
}
</script>
</body>
</html>
22 changes: 22 additions & 0 deletions public/css/style.css
Expand Up @@ -355,6 +355,28 @@ mark {
}


/* No javascript & other kind of blocking problems */

.blocking-warning {
font-size: 20px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 10000;
padding: 30px;
background: #FBFBE3;
line-height: 28px;
}
.blocking-warning a,
.blocking-warning a:hover,
.blocking-warning a:focus,
.blocking-warning a:visited {
color: #000;
}



/* Scrollbars */

Expand Down

0 comments on commit 3dd909e

Please sign in to comment.