Commit f1374268 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

loading tests

parent e42e05c6
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="x3dom-1.7.0/x3dom.css"> <link rel="stylesheet" href="x3dom-1.7.0/x3dom.css">
<link rel="stylesheet" href="viewmodel.css"> <link rel="stylesheet" href="viewmodel.css">
<script src="jquery-2.1.4.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script type='text/javascript' src='x3dom-1.7.0/x3dom.js'> </script> <script type='text/javascript' src='x3dom-1.7.0/x3dom.js'> </script>
<script src="viewmodel.js"></script> <script src="viewmodel.js"></script>
</head> </head>
...@@ -34,5 +32,11 @@ ...@@ -34,5 +32,11 @@
</div> </div>
</div> </div>
<div id="test:5" secretvalue='-4'></div> <div id="test:5" secretvalue='-4'></div>
<script src="jquery-2.1.4.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script>
prerun();
resize();
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -39,8 +39,14 @@ var moveTimeStamp; ...@@ -39,8 +39,14 @@ var moveTimeStamp;
var showdefault = 0; var showdefault = 0;
var load_counter = 0;
var load_limit = 1;
/*
$(function(){ $(function(){
prerun();
});
*/
function prerun(){
$(window).resize(function(){ $(window).resize(function(){
clearTimeout(resizeTimer); clearTimeout(resizeTimer);
resizeTimer = window.setTimeout(resize(),250); resizeTimer = window.setTimeout(resize(),250);
...@@ -110,12 +116,11 @@ $(function(){ ...@@ -110,12 +116,11 @@ $(function(){
$("#main").prepend(x3d_cnv); $("#main").prepend(x3d_cnv);
resize();
var element = document.getElementById('x3d_canvas'); var element = document.getElementById('x3d_canvas');
//on load: showAll()?! //on load: showAll()?!
var showall = 2; var showall = 8;
$(document).load(function(){ $(document).load(function(){
element.runtime.enterFrame = function() { element.runtime.enterFrame = function() {
if (showall==1) { if (showall==1) {
...@@ -288,32 +293,13 @@ $(function(){ ...@@ -288,32 +293,13 @@ $(function(){
$("#v7").css({cursor:"pointer"}).click(function(){element.runtime.resetView();}); $("#v7").css({cursor:"pointer"}).click(function(){element.runtime.resetView();});
}); }
var load_counter = 0;
var load_limit = 1;
function run(){ function run(){
console.log("run2"); console.log("run3");
var top = $("#topinline");
var parts_unique = top.find("Inline");
console.log(parts_unique.length);
load_limit = parts_unique.length;
parts_unique.load(function(){
console.log("showBOM");
load_counter++;
if(load_counter==load_limit-1){
showBOM();
resize(); resize();
bindCanvas();
}
});
if (load_limit==0){
showBOM(); showBOM();
resize();
bindCanvas(); bindCanvas();
}
} }
function showBOM(){ function showBOM(){
...@@ -325,6 +311,8 @@ function showBOM(){ ...@@ -325,6 +311,8 @@ function showBOM(){
left:"705px" left:"705px"
}); });
resize();
if (nobuttons){ if (nobuttons){
bom.css({ bom.css({
display:"none" display:"none"
...@@ -383,11 +371,6 @@ function showBOM(){ ...@@ -383,11 +371,6 @@ function showBOM(){
parts_unique.find("Material").attr("transparency",0.1); parts_unique.find("Material").attr("transparency",0.1);
parts_unique.find("Material").prop("transparency",0.1); parts_unique.find("Material").prop("transparency",0.1);
parts_unique.load(function(){
$(this).find("Material").attr("transparency",0.1);
$(this).find("Material").prop("transparency",0.1);
});
parts_unique.each(function(i){ parts_unique.each(function(i){
var part = $(this); var part = $(this);
var tmp_nsn = this.getAttribute("nameSpaceName"); var tmp_nsn = this.getAttribute("nameSpaceName");
...@@ -483,7 +466,7 @@ function showBOM(){ ...@@ -483,7 +466,7 @@ function showBOM(){
}); });
$("body").append(bom); $("body").append(bom);
resize();
} }
var blockclick = false; var blockclick = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment