Commit f1374268 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

loading tests

parent e42e05c6
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="x3dom-1.7.0/x3dom.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 src="viewmodel.js"></script>
</head>
@@ -34,5 +32,11 @@
        </div>
    </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>
</html>
 No newline at end of file
+20 −37
Original line number Diff line number Diff line
@@ -39,8 +39,14 @@ var moveTimeStamp;

var showdefault = 0;

var load_counter = 0;
var load_limit = 1;
/*
$(function(){
    
   prerun();
});
*/
function prerun(){
    $(window).resize(function(){
        clearTimeout(resizeTimer);
        resizeTimer = window.setTimeout(resize(),250);
@@ -110,12 +116,11 @@ $(function(){
    
    $("#main").prepend(x3d_cnv);
    
    resize();
    
    var element = document.getElementById('x3d_canvas');

    //on load: showAll()?!
    var showall = 2;
    var showall = 8;
    
    $(document).load(function(){
        element.runtime.enterFrame = function() {
            if (showall==1) {
@@ -288,33 +293,14 @@ $(function(){
    
    $("#v7").css({cursor:"pointer"}).click(function(){element.runtime.resetView();});
        
});

var load_counter = 0;
var load_limit = 1;
}

function run(){
    console.log("run2");
    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();
    console.log("run3");
    resize();
            bindCanvas();
        }
    });
    
    if (load_limit==0){
    showBOM();
        resize();
    bindCanvas();        
}
}

function showBOM(){
        
@@ -325,6 +311,8 @@ function showBOM(){
        left:"705px"
    });
    
    resize();
    
    if (nobuttons){
        bom.css({
            display:"none"
@@ -383,11 +371,6 @@ function showBOM(){
    parts_unique.find("Material").attr("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){
        var part = $(this);
        var tmp_nsn = this.getAttribute("nameSpaceName");
@@ -483,7 +466,7 @@ function showBOM(){
    });
    
    $("body").append(bom);
    
    resize();
}

var blockclick = false;