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

force enable loop player for internal access

parent 88148030
Loading
Loading
Loading
Loading
+53 −12
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ var List;

var markers = [];

var selected;

var BLOCK_MOVEEND = false;

$(function(){
@@ -47,29 +49,62 @@ var Dragged = false;
function init_dragging(){

    var bigcounter = 0;

    $("#model_table img").on("load",function(){

      bigcounter++;

      if (bigcounter==markers.length){
        actual_dragging_init();
        if (SETTINGS.model!==undefined){

          find_preselected_index();
          $(".arow")[selected].click();
          place_selected_thumbnail();

        }else{
          // if not defined then do not click at '0' - this will allow to place view properly
        }

        //$(".arow")[0].click();
      }
    });

}

function find_preselected_index(){

  markers.forEach(function(c,i){
    if (c[0].name==SETTINGS.model){
      selected = i;
    }
  });

  if (selected === undefined){
    selected = 0;
  }

}

function place_selected_thumbnail(){

  var inviscounter = 0;

  markers.forEach(function(c,i){

    if (!$(".arow[index="+i+"]").is(":visible")) {
      inviscounter++;
    }

            if(c[0].name==SETTINGS.model){
              $(".arow")[i].click();
    //if(c[0].name==SETTINGS.model){
    if (i==selected){
      //$(".arow")[i].click();
      $("#model_table").css({
        top: -106*(i-inviscounter)+"px"
      });
    }
  });
        }
        //$(".arow")[0].click();
      }
    });


}

@@ -173,6 +208,7 @@ function parse_list(res){
              //console.log("clicked"+this.index);
              // find all markers under this marker
              $(".arow[index="+this.index+"]").click();
              //place_selected_thumbnail();
            });

            if (markers[index]==undefined) {
@@ -237,6 +273,9 @@ function register_row_events(elem){
          map.panTo(new L.LatLng(lat, lng));

          if (markers[index]!=undefined){

            selected = index;

            // find all markers under this marker
            var tmp = popup_message(markers[index]);
            markers[index][0]._popup.setContent(tmp);
@@ -365,6 +404,8 @@ function init_maps(){

    });

    //place_selected_thumbnail();

    var center = map.getCenter();
    var zoom = map.getZoom();

+2 −1
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ var SETTINGS = {
      'x3d':"",
      'kml':""
    },
    'forcehide':[]
    'forcehide':[],
    'forceshow':[]
//     'kml'    : "scene.kml"
}

+14 −5
Original line number Diff line number Diff line
@@ -193,12 +193,20 @@ function save_rating_init(){
    url: "store_rating.php?model="+SETTINGS.path,
    complete: function(response){
      var value = parseInt(response.responseText);

      // this check defines if the page is public or private
      if (isNaN(value)){
        value = 5;
        // add elements ids
        SETTINGS.forcehide.push("model_rating_tr");
        SETTINGS.forcehide.push("kml_tr");
        SETTINGS.forcehide.push("#model_rating_tr");
        SETTINGS.forcehide.push("#kml_tr");

      }else{

        SETTINGS.forceshow.push(".experimental");

      }

      $("#model_rating").val(value);
      // bind onchange
      $("#model_rating").on('change',function(){
@@ -240,17 +248,18 @@ function controls_showhide(){

    if (!SETTINGS.experimental){
      $(".experimental").hide();
      SETTINGS.forceshow.forEach(function(c,i){$(c).show();});
    }else{
      $(".experimental").show();
      SETTINGS.forcehide.forEach(function(c,i){$(c).hide();});
    }

    if (!SETTINGS.edit){
      $(".edit").hide();
      SETTINGS.forceshow.forEach(function(c,i){$(c).show();});
    }else{
      $(".edit").show();
      SETTINGS.forcehide.forEach(function(c,i){
        $("#"+c).hide();
      });
      SETTINGS.forcehide.forEach(function(c,i){$(c).hide();});
      align_position();
    }