window.console.log("JS: ... started"); var winopener = null; var archwin = null; var scrollerw = 0; var hotspotstate = false; var cpv = null; var cpn = null; var csc = null; // others var shift = 230; var speed = 500; if(window.opener != null){ winopener = window.opener; var pp = winopener.document.getElementById("wmspano"); } else { winopener = null; } function jstrace(msg){ if (winopener.console && winopener.console.log) { winopener.console.log(msg); } } function pad(number, digits) { var num = number+""; while(num.length < digits){ num = '0'+num; } return num; } function pano(){ var whatpano = document.getElementById("wmspano"); return whatpano; } function archwinopen(w,h,lang,cdt,hs,conf,cam){ // msie? var isIE = eval("/*@cc_on!@*/!1"); if(!isIE){ xpos = window.screenX; ypos = window.screenY; } else { xpos = window.screenLeft; ypos = window.screenTop - 50; } if(lang==null){ lang = 'de'; } var conf_cam = ""; if(conf != null || conf != 0){ conf_cam += "&conf="+conf; } if(cam != null || cam != 0){ conf_cam += "&cam="+cam; } window.console.log("JS: archive opened / x: "+xpos+" / ypos: "+ypos+" / w: "+w+" / H: "+h+" / lang: "+lang+" / HS: "+hs+" / CONF: "+conf+" / CAM: "+cam); windowsize = getWinSize(); l = windowsize[0]/2 - w/2 + xpos; t = windowsize[1]/2 - h/2 + ypos; winopts = "left="+l+",top="+t+",width="+w+",height="+h+",toolbar=0,resizable=0"; winopts += "location=0,status=0,directories=0,menubar=0,scrollbars=0,"; winopts += "titlebar=0,linkbar=0,personalbar=0"; openurl = "/engine/plugs/archive.php?lang="+lang+"&cdt="+cdt+"&hs="+hs+conf_cam; archwin = window.open(openurl,"_blank",winopts); archwin.focus(); } function archstarted(cdt,lang,hs,conf,cam){ cpv = $('#calendar-month-prev a'); cpn = $('#calendar-month-next a'); csc = $('#calendar-scroller'); pp.set("archive_open",true); pp.call("trace('JS: archiv wurde geöffnet! archiv_open = ',get(archive_open),' / datetime: ',get(cdt));"); if(cdt != null && lang != null){ var cdtsplit = cdt.split("_"); var change_day = cdtsplit[0]+'-'+cdtsplit[1]+'-'+cdtsplit[2]; slm('#m-'+cdtsplit[1]+'-'+cdtsplit[0]); load_gallery(change_day,lang,hs,conf,cam); } else { var jetzt = new Date(); var yyyy = jetzt.getFullYear(); var mm = jetzt.getMonth() + 1; if(mm < 10){mm = '0' + mm;}; slm('#m-'+mm+'-'+yyyy); } } function archwinclose(){ archwin.close(); } function onarchwinclose(){ pp.set("archive_open",false); pp.call("trace('JS: archiv wurde geschlossen! archiv_open = ',get(archive_open),' / datetime: ',get(cdt));"); } function getWinSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } winsize = new Array(myWidth,myHeight); return(winsize); } function switch_arrow(pos){ if(pos == scrollerw){ cpn.css('display','none'); cpv.css('display','block'); } if(pos < scrollerw && pos > 0){ cpn.css('display','block'); cpv.css('display','block'); } if(pos == 0){ cpv.css('display','none'); cpn.css('display','block'); } if(pos == 999999){ cpv.css('display','none'); cpn.css('display','none'); } } function slm(myhash,ende){ var gohash = "div"+myhash; var movescroller = parseInt($(gohash).css("left")); csc.animate({"margin-left":"-"+movescroller+"px"},speed); switch_arrow(movescroller); } function move_month(direc){ currpos = parseInt(csc.css("margin-left")); if(direc=="prev"){ var move = currpos + shift; csc.animate({"margin-left":move+"px"},speed); switch_arrow(-1 * move); } if(direc=="next"){ var move = currpos - shift; csc.animate({"margin-left":move+"px"},speed); switch_arrow(-1 * move); } } function load_gallery(datum,lang,hs,conf,cam){ var loadpath = "/engine/plugs/calendar-gallery.php"; loadpath += "?arch_date=" + datum + "\u0026lang=" + lang + "\u0026hs=" + hs; loadpath += "\u0026conf=" + conf + "\u0026cam=" + cam; // alert("load_gallery: " + loadpath); $('#gallery-body').load(loadpath); var datumsplit = datum.split("-"); $("#gallery-header").text(datumsplit[2]+"."+datumsplit[1]+"."+datumsplit[0]); $(".msie10 #archive-gallery").css('margin-top','10px'); $(".msie10 #gallery-container").css('margin-top','0px'); } function callarchpano(panodatetime,lang,hs,conf,cam){ //pp.set("weatheropen","true"); pp.call("closeweather"); pp.set("weatheropen","true"); var loadstr = "loadpano('engine/plugs/panoxf.php?arch=" + panodatetime; loadstr += "\u0026lang=" + lang + "\u0026hs=" + hs + "\u0026conf=" + conf; loadstr += "\u0026cam=" + cam + "',null,KEEPALL,BLEND(1));"; pp.call(loadstr); // alert("callarchpano: " + loadstr); // pp.call("showdatefield"); pp.call("trace('JS: hotspotstate = "+hs+"');"); pp.set("hson",hs); var dtsplit = panodatetime.split("-"); var timetext = dtsplit[3].substr(0,2)+":"+ dtsplit[3].substr(2,2); var datetext = dtsplit[2]+"."+dtsplit[1]+"."+dtsplit[0]; //pp.set("plugin[datetime].html",datetext); var datetimetext = "[span]Latsch Martelltal - Ebenes Jöchl - 2786m "+datetext; datetimetext += " - "+timetext+" [/span]"; pp.set("plugin[datetime].html",datetimetext); pp.set("cdt",dtsplit[0]+"_"+dtsplit[1]+"_"+dtsplit[2]+"_"+dtsplit[3]); $("#gallery-header").text(dtsplit[2]+"."+dtsplit[1]+"."+dtsplit[0]); pp.call("trace('JS: pano changed! archiv_open = ',get(archive_open),' / datetime = ',get(cdt),' / hson = ',get(hson));"); window.close(); } function reload_archive(todaydate,lang,hs,conf,cam){ var todaysplit = todaydate.split("-"); load_gallery(todaydate,lang,hs,conf,cam); var loadstr = "loadpano('engine/plugs/panoxf.php?lang=" + lang; loadstr += "\u0026hs=" + hs + "\u0026conf=" + conf; loadstr += "\u0026cam=" + cam + "',null,KEEPALL,BLEND(1));"; pp.call(loadstr); //pp.call("hidedatefield"); var tdsplit = todaydate.split("_"); jstrace("reload recent => cdt: " + tdsplit[0]+"_"+tdsplit[1]+"_"+tdsplit[2]+"_0000"); pp.set("cdt",tdsplit[0]+"_"+tdsplit[1]+"_"+tdsplit[2]+"_0000"); // nowdate // obsolet ... // var nd = new Date(); // var datetimetext2 = "[span]< ? php #echo($dtpref); ? >"+pad(nd.getDate(),2); // datetimetext2 += "."+pad((nd.getMonth()+1),2)+"."+nd.getFullYear(); // datetimetext2 += " - "+pad(nd.getHours(),2)+":"+pad(nd.getMinutes(),2); // datetimetext2 += "< ? php #echo($dtsuff); ? >[/span]"; var datetimetext2 = "[span]Latsch Martelltal - Ebenes Jöchl - 2786m "; datetimetext2 += "14.12.2017 - 13:50"; datetimetext2 += " [/span]"; pp.set("plugin[datetime].html",datetimetext2); window.close(); } function load_history(datum,lang){ loadpath = "engine/plugs/history.php?arch="+datum+"\u0026lang="+lang; $('#history-box').load(loadpath); } var history_open = "zu"; function history_show() { var pp = document.getElementById("wmspano"); pp.call("closeweather"); $("#history-box").fadeIn(1000); $("#history-wrapper").fadeIn(1000); history_open = "offen"; } function history_hide() { $("#history-box").fadeOut(1000); $("#history-wrapper").fadeOut(1000); var pp = document.getElementById("wmspano"); pp.set("history_open",false); history_open = "zu"; } function move_thumbs(){ if(history_open == "offen"){ pp = document.getElementById("wmspano"); curr_ang = pp.get("view.hlookat"); min_ang = pp.get("view.hlookatmin"); max_ang = pp.get("view.hlookatmax"); img_fov = pp.get("image.hfov"); range = max_ang - min_ang; curr_abs_ang = (range/2 + curr_ang)/range*100; perc_ang = curr_abs_ang.toPrecision(3); format_str = "'background-position','" + perc_ang + "%'"; $(".history-img").animate({"background-position": perc_ang+"%"}, 0); } } function movepano(panoname) { var pp = document.getElementById(panoname); var schwenk = Number(pp.get("view.hlookat")); schwenk += 30.0; pp.set("view.hlookat", schwenk); } function h5mapclose(direction){ if(direction=="right"){ $("#h5map").animate({"margin-right":"-1000px"},500); } if(direction=="left"){ $("#h5map").animate({"margin-left":"-1000px"},500); } pano().call("trace('map h5 closed by js');"); pano().set("mapopen",false); } function h5mapopen(direction){ if(direction=="right"){ $("#h5map").animate({"margin-right":"0px"},500); } if(direction=="left"){ $("#h5map").animate({"margin-left":"0px"},500); } } function mapmarkerclick(){ //alert("JS: marker clicked!"); } function makemap(lat,lon,mapzoom){ var map = L.map('karte').setView( [lat,lon],mapzoom); L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map); var mapmarker = L.icon({ iconUrl: './engine/plugs/h5map/leaf/images/map_marker_h5.png', iconSize: [16,16], iconAnchor: [8,8], popupAnchor: [0,0] }); L.marker([lat,lon],{icon: mapmarker} ).addTo(map); function onMapClick(e) { mapmarkerclick(); } map.on('click', onMapClick); $("#h5map").css('display','block'); } function videowinopen(w,h,lang,url){ var isIE = eval("/*@cc_on!@*/!1"); if(!isIE){ xpos = window.screenX; ypos = window.screenY; } else { xpos = window.screenLeft; ypos = window.screenTop - 50; } if(lang==null){ lang = 'de'; } windowsize = getWinSize(); l = windowsize[0]/2 - w/2 + xpos; t = windowsize[1]/2 - h/2 + ypos; winopts = "left="+l+",top="+t+",width="+w+",height="+h+",toolbar=0,resizable=0"; winopts += "location=0,status=0,directories=0,menubar=0,scrollbars=0,"; winopts += "titlebar=0,linkbar=0,personalbar=0"; openurl = url; videowin = window.open(openurl,"_blank",winopts); videowin.focus(); pano().call("trace('JS: video win opened by pano');"); } function popwinopen(url,w,h){ // msie? var isIE = eval("/*@cc_on!@*/!1"); if(!isIE){ xpos = window.screenX; ypos = window.screenY; } else { xpos = window.screenLeft; ypos = window.screenTop - 50; } windowsize = getWinSize(); l = windowsize[0]/2 - w/2 + xpos; t = windowsize[1]/2 - h/2 + ypos; winopts = "left="+l+",top="+t+",width="+w+",height="+h+",toolbar=0,resizable=0"; winopts += "location=0,status=0,directories=0,menubar=0,scrollbars=0,"; winopts += "titlebar=0,linkbar=0,personalbar=0"; openurl = url; popwin = window.open(openurl,"_blank",winopts); popwin.focus(); } (function($){ $(document).ready(function() { $('#h5ticker_scroll').newsticker({ 'style' : 'scroll', 'tickerTitle' : '', 'scrollSpeed' : 20, 'autoStart' : true, 'slideSpeed' : 1000, 'slideEasing' : 'swing', 'showControls' : false }); }) })(jQuery); function h5initticker(){ console.log("JS: ticker init called!"); // wird im h5-part von wmspanoviewer gesetzt //if(window.noticker !== undefined && noticker == 1){ // besser: checken, ob ticker-div existiert if($("#h5ticker").length == 0){ console.log("JS: #h5ticker not existing!"); //pano().call("trace('JS: area muss runter!');"); //pano().set("area.bottom",32); } else { console.log("JS: #h5ticker okay!"); $("#h5ticker").show(); $("#h5ticker").animate({"bottom":"0px"},1000); } } function h5tickerhide(){ $("#h5ticker").hide(); $("#h5ticker").animate({"bottom":"-100px"},1000); } function killh5parts() { //alert("kill h5 parts!"); $("#h5map").remove(); $("#h5ticker").remove(); $("#fb-hider").remove(); console.log("flash version: h5 parts of wmspanoviewer.php killed!"); } function fbwinopen(w,h,share){ // standard 300 x 460 px für ausführliche likebox und share button darunter // msie? var isIE = eval("/*@cc_on!@*/!1"); if(!isIE){ xpos = window.screenX; ypos = window.screenY; } else { xpos = window.screenLeft; ypos = window.screenTop - 50; } if(share=="noshare"){ fbopenurl = "https://www.facebook.com/sharer.php"; fbopenurl += "?app_id=263157070499462&sdk=joey&display=popup"; fbopenurl += "&u=http%3A%2F%2F"; // standardgröße f. fb share login: 410 x 340 w = 540; h = 350; } else { fbopenurl = "/engine/plugs/fb_popup.php"; } window.console.log("JS: facebook popup opened / x: "+xpos+" / ypos: "+ypos+" / w: "+w+" / H: "+h); windowsize = getWinSize(); l = windowsize[0]/2 - w/2 + xpos; t = windowsize[1]/2 - h/2 + ypos; fbwinopts = "left="+l+",top="+t+",width="+w+",height="+h+",toolbar=0,resizable=0"; fbwinopts += "location=0,status=0,directories=0,menubar=0,scrollbars=0,"; fbwinopts += "titlebar=0,linkbar=0,personalbar=0"; fbwin = window.open(fbopenurl,"_blank",fbwinopts); fbwin.focus(); } function fbcolorboxopen(fbw,fbh,share){ // call: fbcolorboxopen(300,470); //alert("JS: fbcolorboxopen called: w="+w+" h="+h); if(share=="likeshare"){ setTimeout(function() { $.colorbox({ inline: true, href: '#fbwrapper', width: fbw, height: fbh, padding: 0, scrolling: false, opacity: 0.4 }); }, 0); } else { fbwinopen(fbw,fbh,"noshare"); } }