Commit a74b095d authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

force enable loop player for internal access

parent 88148030
...@@ -3,6 +3,8 @@ var List; ...@@ -3,6 +3,8 @@ var List;
var markers = []; var markers = [];
var selected;
var BLOCK_MOVEEND = false; var BLOCK_MOVEEND = false;
$(function(){ $(function(){
...@@ -47,32 +49,65 @@ var Dragged = false; ...@@ -47,32 +49,65 @@ var Dragged = false;
function init_dragging(){ function init_dragging(){
var bigcounter = 0; var bigcounter = 0;
$("#model_table img").on("load",function(){ $("#model_table img").on("load",function(){
bigcounter++; bigcounter++;
if (bigcounter==markers.length){ if (bigcounter==markers.length){
actual_dragging_init(); actual_dragging_init();
if (SETTINGS.model!==undefined){ if (SETTINGS.model!==undefined){
var inviscounter = 0;
markers.forEach(function(c,i){
if (!$(".arow[index="+i+"]").is(":visible")) { find_preselected_index();
inviscounter++; $(".arow")[selected].click();
} place_selected_thumbnail();
if(c[0].name==SETTINGS.model){ }else{
$(".arow")[i].click(); // if not defined then do not click at '0' - this will allow to place view properly
$("#model_table").css({
top: -106*(i-inviscounter)+"px"
});
}
});
} }
//$(".arow")[0].click(); //$(".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){
if (i==selected){
//$(".arow")[i].click();
$("#model_table").css({
top: -106*(i-inviscounter)+"px"
});
}
});
}
function actual_dragging_init(){ function actual_dragging_init(){
var list = document.getElementById('model_table'); var list = document.getElementById('model_table');
...@@ -173,6 +208,7 @@ function parse_list(res){ ...@@ -173,6 +208,7 @@ function parse_list(res){
//console.log("clicked"+this.index); //console.log("clicked"+this.index);
// find all markers under this marker // find all markers under this marker
$(".arow[index="+this.index+"]").click(); $(".arow[index="+this.index+"]").click();
//place_selected_thumbnail();
}); });
if (markers[index]==undefined) { if (markers[index]==undefined) {
...@@ -237,6 +273,9 @@ function register_row_events(elem){ ...@@ -237,6 +273,9 @@ function register_row_events(elem){
map.panTo(new L.LatLng(lat, lng)); map.panTo(new L.LatLng(lat, lng));
if (markers[index]!=undefined){ if (markers[index]!=undefined){
selected = index;
// find all markers under this marker // find all markers under this marker
var tmp = popup_message(markers[index]); var tmp = popup_message(markers[index]);
markers[index][0]._popup.setContent(tmp); markers[index][0]._popup.setContent(tmp);
...@@ -365,6 +404,8 @@ function init_maps(){ ...@@ -365,6 +404,8 @@ function init_maps(){
}); });
//place_selected_thumbnail();
var center = map.getCenter(); var center = map.getCenter();
var zoom = map.getZoom(); var zoom = map.getZoom();
......
...@@ -65,7 +65,8 @@ var SETTINGS = { ...@@ -65,7 +65,8 @@ var SETTINGS = {
'x3d':"", 'x3d':"",
'kml':"" 'kml':""
}, },
'forcehide':[] 'forcehide':[],
'forceshow':[]
// 'kml' : "scene.kml" // 'kml' : "scene.kml"
} }
......
...@@ -193,12 +193,20 @@ function save_rating_init(){ ...@@ -193,12 +193,20 @@ function save_rating_init(){
url: "store_rating.php?model="+SETTINGS.path, url: "store_rating.php?model="+SETTINGS.path,
complete: function(response){ complete: function(response){
var value = parseInt(response.responseText); var value = parseInt(response.responseText);
// this check defines if the page is public or private
if (isNaN(value)){ if (isNaN(value)){
value = 5; value = 5;
// add elements ids // add elements ids
SETTINGS.forcehide.push("model_rating_tr"); SETTINGS.forcehide.push("#model_rating_tr");
SETTINGS.forcehide.push("kml_tr"); SETTINGS.forcehide.push("#kml_tr");
}else{
SETTINGS.forceshow.push(".experimental");
} }
$("#model_rating").val(value); $("#model_rating").val(value);
// bind onchange // bind onchange
$("#model_rating").on('change',function(){ $("#model_rating").on('change',function(){
...@@ -240,17 +248,18 @@ function controls_showhide(){ ...@@ -240,17 +248,18 @@ function controls_showhide(){
if (!SETTINGS.experimental){ if (!SETTINGS.experimental){
$(".experimental").hide(); $(".experimental").hide();
SETTINGS.forceshow.forEach(function(c,i){$(c).show();});
}else{ }else{
$(".experimental").show(); $(".experimental").show();
SETTINGS.forcehide.forEach(function(c,i){$(c).hide();});
} }
if (!SETTINGS.edit){ if (!SETTINGS.edit){
$(".edit").hide(); $(".edit").hide();
SETTINGS.forceshow.forEach(function(c,i){$(c).show();});
}else{ }else{
$(".edit").show(); $(".edit").show();
SETTINGS.forcehide.forEach(function(c,i){ SETTINGS.forcehide.forEach(function(c,i){$(c).hide();});
$("#"+c).hide();
});
align_position(); align_position();
} }
......
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