Commit e3625ec2 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

pass back index and rating value

parent 0c25b567
......@@ -38,7 +38,8 @@ var SETTINGS = {
'showall':false,
'lat': 40.7233861,
'lng': -111.9328843,
'zoom': 12
'zoom': 12,
'model': undefined
};
var Dragged = false;
......@@ -49,7 +50,23 @@ function init_dragging(){
$("#model_table img").on("load",function(){
bigcounter++;
if (bigcounter==markers.length){
actual_dragging_init()
actual_dragging_init();
if (SETTINGS.model!==undefined){
var inviscounter = 0;
markers.forEach(function(c,i){
if (!$(".arow[index="+i+"]").is(":visible")) {
inviscounter++;
}
if(c[0].name==SETTINGS.model){
$(".arow")[i].click();
$("#model_table").css({
top: -106*(i-inviscounter)+"px"
});
}
});
}
//$(".arow")[0].click();
}
});
......@@ -86,6 +103,7 @@ function parseURL(){
case "lat": SETTINGS.lat = parseFloat(parameters[i][1]); break;
case "lng": SETTINGS.lng = parseFloat(parameters[i][1]); break;
case "zoom": SETTINGS.zoom = parseFloat(parameters[i][1]); break;
case "model": SETTINGS.model = parameters[i][1]; break;
}
}
}
......@@ -94,7 +112,7 @@ function parse_list(res){
var index = 0;
$(res).find("model").each(function(){
$(res).find("model").each(function(m_index,m_item){
var row = $("<tr class='arow'>");
var name = $(this).attr("name");
......@@ -115,7 +133,7 @@ function parse_list(res){
var comments = $(this).find("comments").text();
var link_url = "viewer.html?path="+name+"&ver="+$(this).attr("name");
var link_url = "viewer.html?path="+name+"&ver="+$(this).attr("name")+"&rating="+SETTINGS.rating;
var link = "<a title='"+comments+"' href='"+link_url+"'>"+$(this).attr("name")+"</a>,&nbsp;";
vlist += link;
......
......@@ -44,6 +44,7 @@ var Scene;
var Map;
var SETTINGS = {
'rating': 5, // global rating setting
'pointer': false,
'highlight': false,
'global_coordinates': true,
......@@ -87,6 +88,9 @@ function parseURL(){
for (var i=0;i<parameters.length;i++) parameters[i]=parameters[i].split("=");
for (var i=1;i<parameters.length;i++) {
switch (parameters[i][0]) {
// used only to get back to the map
case "rating": SETTINGS.rating = parseInt(parameters[i][1]); break;
case "pointer": SETTINGS.pointer = true; break;
case "highlight": SETTINGS.highlight = true; break;
case "global_coordinates": SETTINGS.global_coordinates = true; break;
......
......@@ -64,7 +64,7 @@ function menu_init(){
var origin = window.location.origin;
var path = window.location.pathname;
path = path.substr(0,path.lastIndexOf("/"));
window.location.href = origin+path;
window.location.href = origin+path+"?model="+SETTINGS.path+"&rating="+SETTINGS.rating;
});
$("#download_button").on("click",function(){
......
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