Added warning if not using Chrome

gh-pages
Joost Nieuwenhuijse 2012-01-20 16:09:04 +01:00
parent 69593eb22c
commit c1daa42647
1 changed files with 13 additions and 1 deletions

View File

@ -49,15 +49,27 @@ var gViewer=null;
var gSolid=new CSG();
var gSolidSource="";
function isChrome()
{
return (navigator.userAgent.search("Chrome") >= 0);
}
function onload()
{
gViewer = new Viewer(new CSG(), 600, 600, 5);
document.getElementById("viewer").appendChild(gViewer.gl.canvas);
updateSolid();
if(isChrome())
{
updateSolid();
}
}
function updateSolid()
{
if(!isChrome())
{
alert("Please note that this currently only works reliably in Google Chrome. You may see a corrupted solid, or nothing at all.");
}
var code=document.getElementById('code').value;
if(code != gSolidSource)
{