Modify no support handling.

This commit is contained in:
kovacsv 2014-10-20 07:51:46 +02:00
parent 845b836ecd
commit 4fd0a4e812
4 changed files with 21 additions and 22 deletions

View File

@ -5,9 +5,9 @@ Online demo: http://3dviewer.net
With this online viewer you can view 3D models in your browser: With this online viewer you can view 3D models in your browser:
- Supported file formats: - Supported file formats:
- 3ds, with textures - 3ds (with textures)
- obj, mtl, with textures - obj, mtl (with textures)
- stl - stl (ascii and binary)
- You can drag&drop files to your browser, or use the open button. - You can drag&drop files to your browser, or use the open button.
- You should open the main file, and all of its requested files. - You should open the main file, and all of its requested files.
- For example open the requested mtl file with an obj file. - For example open the requested mtl file with an obj file.

View File

@ -9,22 +9,19 @@ ImporterApp = function ()
ImporterApp.prototype.Init = function () ImporterApp.prototype.Init = function ()
{ {
if (!JSM.IsWebGLEnabled () || !JSM.IsFileApiEnabled ()) { if (!JSM.IsWebGLEnabled () || !JSM.IsFileApiEnabled ()) {
var i, child; while (document.body.lastChild) {
document.body.removeChild (document.body.lastChild);
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++) { var div = document.createElement ('div');
child = children[i]; div.className = 'nosupport';
if (child.id == 'nosupport') { div.innerHTML = [
child.style.display = ''; '<div id="nosupport">',
} else { '<div class="title">Unfortunately your browser does not support this site.</div>',
document.body.removeChild (child); 'You need a browser which supports the following technologies: WebGL, WebGLRenderingContext, File, FileReader, FileList, Blob, URL.',
} '</div>'
} ].join ('');
document.body.appendChild (div);
return; return;
} }
@ -65,7 +62,7 @@ ImporterApp.prototype.WelcomeDialog = function ()
var dialogText = [ var dialogText = [
'<div class="importerdialog">', '<div class="importerdialog">',
'<div class="welcometitle">Welcome to Online 3D Viewer!</div>', '<div class="welcometitle">Welcome to Online 3D Viewer!</div>',
'<div class="welcometext">Here you can view 3D models online. Just simply drag and drop 3D files and textures to this browser window or use the open button above.</div>', '<div class="welcometext">Here you can view your local 3D models online. Just simply drag and drop 3D files and textures to this browser window or use the open button above.</div>',
'<div class="welcometextformats">Supported formats: 3ds, obj, stl.</div>', '<div class="welcometextformats">Supported formats: 3ds, obj, stl.</div>',
'<div class="welcometext">Powered by <a target="_blank" href="https://github.com/mrdoob/three.js/">Three.js</a> and <a target="_blank" href="https://github.com/kovacsv/JSModeler">JSModeler</a>.</div>', '<div class="welcometext">Powered by <a target="_blank" href="https://github.com/mrdoob/three.js/">Three.js</a> and <a target="_blank" href="https://github.com/kovacsv/JSModeler">JSModeler</a>.</div>',
'<div class="welcometext"><a target="_blank" href="https://github.com/kovacsv/Online3DViewer"><img src="images/githublogo.png"/></a></div>', '<div class="welcometext"><a target="_blank" href="https://github.com/kovacsv/Online3DViewer"><img src="images/githublogo.png"/></a></div>',

View File

@ -33,6 +33,9 @@
</head> </head>
<body> <body>
<div style="display:none">
Here you can view your local 3D models online. Just simply drag and drop 3D files and textures to this browser window or use the open button above.
</div>
<div id="top"> <div id="top">
</div> </div>
<div id="left"> <div id="left">
@ -40,10 +43,6 @@
</div> </div>
<canvas id="example" width="0" height="0"></canvas> <canvas id="example" width="0" height="0"></canvas>
<input type="file" id="file" style="display:none" multiple></input> <input type="file" id="file" style="display:none" multiple></input>
<div id="nosupport" style="display:none">
<div class="title">Unfortunately your browser does not support this site.</div>
You need a browser which supports the following technologies: WebGL, WebGLRenderingContext, File, FileReader, FileList, Blob, URL.
</div>
</body> </body>
</html> </html>

3
website/robots.txt Normal file
View File

@ -0,0 +1,3 @@
User-agent: *
Allow: /