From 4fd0a4e8126cc9ab7596d95c1adcdb91d9586b39 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Mon, 20 Oct 2014 07:51:46 +0200 Subject: [PATCH] Modify no support handling. --- README.md | 6 +++--- website/include/importerapp.js | 27 ++++++++++++--------------- website/index.html | 7 +++---- website/robots.txt | 3 +++ 4 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 website/robots.txt diff --git a/README.md b/README.md index e272f0f..3c4f1c6 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/website/include/importerapp.js b/website/include/importerapp.js index 0467946..3803b55 100644 --- a/website/include/importerapp.js +++ b/website/include/importerapp.js @@ -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 = [ + '
', + '
Unfortunately your browser does not support this site.
', + 'You need a browser which supports the following technologies: WebGL, WebGLRenderingContext, File, FileReader, FileList, Blob, URL.', + '
' + ].join (''); + document.body.appendChild (div); return; } @@ -65,7 +62,7 @@ ImporterApp.prototype.WelcomeDialog = function () var dialogText = [ '
', '
Welcome to Online 3D Viewer!
', - '
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.
', + '
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.
', '
Supported formats: 3ds, obj, stl.
', '
Powered by Three.js and JSModeler.
', '
', diff --git a/website/index.html b/website/index.html index d9fd677..9835992 100644 --- a/website/index.html +++ b/website/index.html @@ -33,6 +33,9 @@ +
+ 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. +
@@ -40,10 +43,6 @@
- diff --git a/website/robots.txt b/website/robots.txt new file mode 100644 index 0000000..297e070 --- /dev/null +++ b/website/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +