Add error page for no support.
This commit is contained in:
parent
5ad2bcb17e
commit
63e3f4822d
@ -10,6 +10,17 @@ html, body
|
||||
height : 100%;
|
||||
}
|
||||
|
||||
#nosupport
|
||||
{
|
||||
padding : 10px;
|
||||
}
|
||||
|
||||
#nosupport div.title
|
||||
{
|
||||
font-size : 17px;
|
||||
margin-bottom : 10px;
|
||||
}
|
||||
|
||||
#top
|
||||
{
|
||||
color : #dddddd;
|
||||
|
||||
@ -8,6 +8,49 @@ ImporterApp = function ()
|
||||
|
||||
ImporterApp.prototype.Init = function ()
|
||||
{
|
||||
function CheckSupport ()
|
||||
{
|
||||
if (!window.WebGLRenderingContext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
var canvas = document.createElement ('canvas');
|
||||
if (!canvas.getContext ('experimental-webgl') && !canvas.getContext ('webgl')) {
|
||||
return false;
|
||||
}
|
||||
} catch (exception) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!CheckSupport ()) {
|
||||
var i, child;
|
||||
|
||||
var children = [];
|
||||
for (i = 0; i < document.body.children.length; i++) {
|
||||
child = document.body.children[i];
|
||||
children.push (child);
|
||||
}
|
||||
|
||||
for (i = 0; i < children.length; i++) {
|
||||
child = children[i];
|
||||
if (child.id == 'nosupport') {
|
||||
child.style.display = '';
|
||||
} else {
|
||||
document.body.removeChild (child);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var myThis = this;
|
||||
var top = document.getElementById ('top');
|
||||
var importerButtons = new ImporterButtons (top);
|
||||
|
||||
@ -29,6 +29,10 @@
|
||||
</div>
|
||||
<canvas id="example" width="0" height="0"></canvas>
|
||||
<input type="file" id="file" style="display:none" multiple></input>
|
||||
<div id="nosupport" style="display:none">
|
||||
<div class="title">Unfortunately your browser not supports this site.</div>
|
||||
You need a browser which supports the following: WebGL, WebGLRenderingContext, File, FileReader, FileList, Blob.
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user