Added warning if not using Chrome

This commit is contained in:
Joost Nieuwenhuijse 2012-01-20 16:09:04 +01:00
parent 69593eb22c
commit c1daa42647

View file

@ -49,15 +49,27 @@ var gViewer=null;
var gSolid=new CSG(); var gSolid=new CSG();
var gSolidSource=""; var gSolidSource="";
function isChrome()
{
return (navigator.userAgent.search("Chrome") >= 0);
}
function onload() function onload()
{ {
gViewer = new Viewer(new CSG(), 600, 600, 5); gViewer = new Viewer(new CSG(), 600, 600, 5);
document.getElementById("viewer").appendChild(gViewer.gl.canvas); document.getElementById("viewer").appendChild(gViewer.gl.canvas);
updateSolid(); if(isChrome())
{
updateSolid();
}
} }
function 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; var code=document.getElementById('code').value;
if(code != gSolidSource) if(code != gSolidSource)
{ {