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:
- Supported file formats:
- 3ds, with textures
- obj, mtl, with textures
- stl
- 3ds (with textures)
- obj, mtl (with textures)
- stl (ascii and binary)
- 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.
- For example open the requested mtl file with an obj file.

View File

@ -9,22 +9,19 @@ ImporterApp = function ()
ImporterApp.prototype.Init = function ()
{
if (!JSM.IsWebGLEnabled () || !JSM.IsFileApiEnabled ()) {
var i, child;
var children = [];
for (i = 0; i < document.body.children.length; i++) {
child = document.body.children[i];
children.push (child);
while (document.body.lastChild) {
document.body.removeChild (document.body.lastChild);
}
for (i = 0; i < children.length; i++) {
child = children[i];
if (child.id == 'nosupport') {
child.style.display = '';
} else {
document.body.removeChild (child);
}
}
var div = document.createElement ('div');
div.className = 'nosupport';
div.innerHTML = [
'<div id="nosupport">',
'<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>'
].join ('');
document.body.appendChild (div);
return;
}
@ -65,7 +62,7 @@ ImporterApp.prototype.WelcomeDialog = function ()
var dialogText = [
'<div class="importerdialog">',
'<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="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>',

View File

@ -33,6 +33,9 @@
</head>
<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>
<div id="left">
@ -40,10 +43,6 @@
</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 does not support this site.</div>
You need a browser which supports the following technologies: WebGL, WebGLRenderingContext, File, FileReader, FileList, Blob, URL.
</div>
</body>
</html>

3
website/robots.txt Normal file
View File

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