Commit e3625ec2 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

pass back index and rating value

parent 0c25b567
...@@ -38,7 +38,8 @@ var SETTINGS = { ...@@ -38,7 +38,8 @@ var SETTINGS = {
'showall':false, 'showall':false,
'lat': 40.7233861, 'lat': 40.7233861,
'lng': -111.9328843, 'lng': -111.9328843,
'zoom': 12 'zoom': 12,
'model': undefined
}; };
var Dragged = false; var Dragged = false;
...@@ -49,7 +50,23 @@ function init_dragging(){ ...@@ -49,7 +50,23 @@ function init_dragging(){
$("#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){
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(); //$(".arow")[0].click();
} }
}); });
...@@ -86,6 +103,7 @@ function parseURL(){ ...@@ -86,6 +103,7 @@ function parseURL(){
case "lat": SETTINGS.lat = parseFloat(parameters[i][1]); break; case "lat": SETTINGS.lat = parseFloat(parameters[i][1]); break;
case "lng": SETTINGS.lng = parseFloat(parameters[i][1]); break; case "lng": SETTINGS.lng = parseFloat(parameters[i][1]); break;
case "zoom": SETTINGS.zoom = 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){ ...@@ -94,7 +112,7 @@ function parse_list(res){
var index = 0; var index = 0;
$(res).find("model").each(function(){ $(res).find("model").each(function(m_index,m_item){
var row = $("<tr class='arow'>"); var row = $("<tr class='arow'>");
var name = $(this).attr("name"); var name = $(this).attr("name");
...@@ -115,7 +133,7 @@ function parse_list(res){ ...@@ -115,7 +133,7 @@ function parse_list(res){
var comments = $(this).find("comments").text(); 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;"; var link = "<a title='"+comments+"' href='"+link_url+"'>"+$(this).attr("name")+"</a>,&nbsp;";
vlist += link; vlist += link;
......
...@@ -44,6 +44,7 @@ var Scene; ...@@ -44,6 +44,7 @@ var Scene;
var Map; var Map;
var SETTINGS = { var SETTINGS = {
'rating': 5, // global rating setting
'pointer': false, 'pointer': false,
'highlight': false, 'highlight': false,
'global_coordinates': true, 'global_coordinates': true,
...@@ -87,6 +88,9 @@ function parseURL(){ ...@@ -87,6 +88,9 @@ function parseURL(){
for (var i=0;i<parameters.length;i++) parameters[i]=parameters[i].split("="); for (var i=0;i<parameters.length;i++) parameters[i]=parameters[i].split("=");
for (var i=1;i<parameters.length;i++) { for (var i=1;i<parameters.length;i++) {
switch (parameters[i][0]) { 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 "pointer": SETTINGS.pointer = true; break;
case "highlight": SETTINGS.highlight = true; break; case "highlight": SETTINGS.highlight = true; break;
case "global_coordinates": SETTINGS.global_coordinates = true; break; case "global_coordinates": SETTINGS.global_coordinates = true; break;
......
...@@ -64,7 +64,7 @@ function menu_init(){ ...@@ -64,7 +64,7 @@ function menu_init(){
var origin = window.location.origin; var origin = window.location.origin;
var path = window.location.pathname; var path = window.location.pathname;
path = path.substr(0,path.lastIndexOf("/")); 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(){ $("#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