TODO add more init settings/variables here */
/* post xml parsing vars i.e. get(startscene);*/
var vars = {};
vars.idletime = 2;
vars.currScene = "neutral";
vars.projectId = "60b11bbb2bdae10cbb9db27f";
vars.fancamId = "60b11bbb2bdae10cbb9db27f"; // backwards compatable
vars.APIPATH = "https://osnatart.in3sixty.com/api";
vars.THEMEPATH = "https://s3.amazonaws.com/in3sixty-themes/in3sixty/virtual-tour";
vars.PUBLICPATH = "https://s3.amazonaws.com/in3sixty-project-media/in3sixty/public";
vars.PROJECTPATH = "https://s3.amazonaws.com/in3sixty-project-media/in3sixty/60b11bbb2bdae10cbb9db27f";
vars.STARTSCENE = "neutral";
vars.NOCACHE = "1909";
vars.RAND = "6085";
vars.visibility = "live";
vars.event = {"keywords":"","featuring":"","country":"","city":"","venue":"","category":"Other","date":"2011-12-16T00:00:00.000Z","shortname":"","name":"Osnat Exhibition","dateSearchable":"16/12/2011 12/16/2011 12-16-2011 2011-12-16 Friday 16th December 2011"};
vars.query = {};
vars.query.s = "neutral";
/* ---> TODO add more startup settings/variables here */
/* stored options */
vars.options = {};
vars.options.depthmap_navigation = false; // type=boolean
vars.options.banner_enabled = false; // type=boolean
vars.options.share_view_enabled = true; // type=boolean
vars.options.video_booth_enabled = false; // type=boolean
vars.options.enter_email_on_entry = false; // type=boolean
vars.options.banner_image = "%$THEMEPATH%/assets/img/logo.png?v=%$NOCACHE%"; // type=image unescaped
vars.options.banner_website_link = decodeSingleQuoteSafeString('');// type=string
vars.options.favicon_image = decodeSingleQuoteSafeString('https://s3.amazonaws.com/in3sixty-project-media/in3sixty/60b11bbb2bdae10cbb9db27f/osnat-favicon-20210528164130.png');// type=favicon
vars.options.favicon_html = decodeSingleQuoteSafeString('
');// type=string
vars.options.email_header_image = "https://s3.amazonaws.com/in3sixty-project-media/in3sixty/60b11bbb2bdae10cbb9db27f/share-image-20210602095030.jpg?v=%$NOCACHE%"; // type=image unescaped
vars.options.main_font_family = decodeSingleQuoteSafeString('Roboto');// type=string
vars.options.main_font_url = decodeSingleQuoteSafeString('https://fonts.googleapis.com/css?family=Roboto:400,700');// type=string
vars.options.second_font_family = decodeSingleQuoteSafeString('Open Sans');// type=string
vars.options.second_font_url = decodeSingleQuoteSafeString('https://fonts.googleapis.com/css?family=Open+Sans:400,700');// type=string
vars.options.loader_bg_color = "0xffffff" ;// type=color
vars.options.header_txt_color = "0xaaaaaa" ;// type=color
vars.options.title_txt_color = "0xaaaaaa" ;// type=color
vars.options.subtitle_txt_color = "0xaaaaaa" ;// type=color
vars.options.header_icon_color = "0xffffff" ;// type=color
vars.options.footer_icon_color = "0xaaaaaa" ;// type=color
vars.options.btn_close_color = "0xa9a9a9" ;// type=color
vars.options.btn_close_color_hover = "0x808080" ;// type=color
vars.options.btn_txt_color = "0xffffff" ;// type=color
vars.options.btn_color = "0x808080" ;// type=color
vars.options.btn_color_hover = "0x808080" ;// type=color
vars.options.menu_txt_color = "0x808080" ;// type=color
vars.options.menu_main_btn_color = "0xffffff" ;// type=color
vars.options.menu_btn_color = "0xffffff" ;// type=color
vars.options.menu_bg_color = "0xffffff" ;// type=color
vars.options.header_bg_color = "0xffffff" ;// type=color
vars.options.popup_bg_color = "0xffffff" ;// type=color
vars.options.backdrop_color = "0x000000" ;// type=color
vars.options.scene_switcher_enabled = false; // type=boolean
vars.options.seperate_tags_per_scene = false; // type=boolean
vars.options.scene_slideshow_enabled = false; // type=boolean
vars.options.scenes_slideshow_speed = decodeSingleQuoteSafeString('3');// type=string
vars.options.scenes_slideshow_blend_time = decodeSingleQuoteSafeString('1.5');// type=string
vars.options.interface_image = "%$THEMEPATH%/assets/img/interface.png?v=%$NOCACHE%"; // type=image unescaped
vars.options.tutorial_zoom_image = "%$THEMEPATH%/assets/img/tutorial_zoom.png?v=%$NOCACHE%"; // type=image unescaped
vars.options.tutorial_move_image = "%$THEMEPATH%/assets/img/tutorial_move.png?v=%$NOCACHE%"; // type=image unescaped
vars.options.tutorial_mobi_image = "%$THEMEPATH%/assets/img/tutorial_mobile.png?v=%$NOCACHE%"; // type=image unescaped
vars.options.video1_enabled = false; // type=boolean
vars.options.video_url_1 = decodeSingleQuoteSafeString('42oLZhRq3nA');// type=string
vars.options.video_image_1 = "%$THEMEPATH%/assets/img/videoThumbnail_1.jpg?v=%$NOCACHE%"; // type=image unescaped
vars.options.video2_enabled = false; // type=boolean
vars.options.video_url_2 = decodeSingleQuoteSafeString('42oLZhRq3nA');// type=string
vars.options.video_image_2 = "%$THEMEPATH%/assets/img/videoThumbnail_2.jpg?v=%$NOCACHE%"; // type=image unescaped
vars.options.video3_enabled = false; // type=boolean
vars.options.video_url_3 = decodeSingleQuoteSafeString('42oLZhRq3nA');// type=string
vars.options.video_image_3 = "%$THEMEPATH%/assets/img/videoThumbnail_3.jpg?v=%$NOCACHE%"; // type=image unescaped
vars.options.video4_enabled = false; // type=boolean
vars.options.video_url_4 = decodeSingleQuoteSafeString('42oLZhRq3nA');// type=string
vars.options.video_image_4 = "%$THEMEPATH%/assets/img/videoThumbnail_4.jpg?v=%$NOCACHE%"; // type=image unescaped
vars.options.video5_enabled = false; // type=boolean
vars.options.video_url_5 = decodeSingleQuoteSafeString('42oLZhRq3nA');// type=string
vars.options.video_image_5 = "%$THEMEPATH%/assets/img/videoThumbnail_5.jpg?v=%$NOCACHE%"; // type=image unescaped
vars.options.custom_actions_xml = decodeSingleQuoteSafeString('
**u000d****u000a** removeplugin(ui_userguide_text);**u000d****u000a** removeplugin(ui_userguide_icon);**u000d****u000a** removeplugin(header_container);**u000d****u000a** removeplugin(fancam_title_text);**u000d****u000a** removeplugin(fullScreenBtn);**u000d****u000a** removeplugin(fancam_logo);**u000d****u000a** removeplugin(terms_and_conditions);**u000d****u000a** removeplugin(menuBtn);**u000d****u000a** set(plugin[shareBtn].align,topleft);**u000d****u000a**');// type=string
vars.options.on_scene_loaded_custom_xml = decodeSingleQuoteSafeString('');// type=string
vars.options.on_scene_loaded_end_custom_xml = decodeSingleQuoteSafeString('');// type=string
vars.options.on_startup_custom_xml = decodeSingleQuoteSafeString('');// type=string
vars.options.on_startup_end_custom_xml = decodeSingleQuoteSafeString('');// type=string
vars.options.on_interface_loaded_xml = decodeSingleQuoteSafeString('removeUI();');// type=string
vars.options.on_window_resized_xml = decodeSingleQuoteSafeString('');// type=string
vars.options.navigator_xml = decodeSingleQuoteSafeString('');// type=string
vars.options.head_html = decodeSingleQuoteSafeString('');// type=string
vars.options.body_html = decodeSingleQuoteSafeString('');// type=string
vars.options.footer_html = decodeSingleQuoteSafeString('');// type=string
/* in an application browser (Facebook/Twitter) */
/*
* i18n (international) strings for krpano.
*/
vars.i18n = {};
vars.i18n.en = {};
vars.i18n.en.site_title = decodeSingleQuoteSafeString('Osnat Art');// type=string
vars.i18n.en.site_description = decodeSingleQuoteSafeString('Osnat Art Virtual Reality');// type=string
vars.i18n.en.share_image = "https://s3.amazonaws.com/in3sixty-project-media/in3sixty/60b11bbb2bdae10cbb9db27f/Screenshot+2021-05-28+at+18.37.08-20210528163734.jpg"; // type=image unescaped
vars.i18n.en.site_title_fb = decodeSingleQuoteSafeString('Osnat Art');// type=string
vars.i18n.en.site_description_fb = decodeSingleQuoteSafeString('Osnat Art Virtual Reality');// type=string
vars.i18n.en.site_title_twtr = decodeSingleQuoteSafeString('Osnat Art');// type=string
vars.i18n.en.site_description_twtr = decodeSingleQuoteSafeString('Osnat Art Virtual Reality');// type=string
vars.i18n.en.twtr_handle = decodeSingleQuoteSafeString('#osnatart');// type=string
vars.i18n.en.share_title_email = decodeSingleQuoteSafeString('Osnat Art');// type=string
vars.i18n.en.share_description_email = decodeSingleQuoteSafeString('Osnat Art Virtual Reality');// type=string
vars.i18n.en.siteloader_image = "https://s3.amazonaws.com/in3sixty-project-media/in3sixty/60b11bbb2bdae10cbb9db27f/board-circle-annimation-2-20210602092432.gif?v=%$NOCACHE%"; // type=image unescaped
vars.i18n.en.overlay_default_image = "https://s3.amazonaws.com/in3sixty-project-media/in3sixty/60b11bbb2bdae10cbb9db27f/blank-overlay-20210602082304.png?v=%$NOCACHE%"; // type=image unescaped
vars.i18n.en.overlay_sview_image = "https://s3.amazonaws.com/in3sixty-project-media/in3sixty/60b11bbb2bdae10cbb9db27f/blank-overlay-20210602082308.png?v=%$NOCACHE%"; // type=image unescaped
vars.i18n.en.string_termsandconditions = decodeSingleQuoteSafeString('TERMS AND CONDITIONS');// type=string
vars.i18n.en.string_tutorial = decodeSingleQuoteSafeString('TUTORIAL');// type=string
vars.i18n.en.string_viewthetutorial = decodeSingleQuoteSafeString('VIEW THE TUTORIAL');// type=string
vars.i18n.en.string_tutorial_subtitle = decodeSingleQuoteSafeString('Let us show you around with our beginners guide.');// type=string
vars.i18n.en.string_ok = decodeSingleQuoteSafeString('OK');// type=string
vars.i18n.en.string_nothanks = decodeSingleQuoteSafeString('No, thanks!');// type=string
vars.i18n.en.string_zoomusing = decodeSingleQuoteSafeString('Zoom using');// type=string
vars.i18n.en.string_moveusing = decodeSingleQuoteSafeString('Move using');// type=string
vars.i18n.en.string_zoomandexplore = decodeSingleQuoteSafeString('Zoom & Explore');// type=string
vars.i18n.en.string_trackpadscroll = decodeSingleQuoteSafeString('Trackpad scroll');// type=string
vars.i18n.en.string_mousetoscroll = decodeSingleQuoteSafeString('Mouse scroll');// type=string
vars.i18n.en.string_keyboardkeys = decodeSingleQuoteSafeString('Keyboard keys');// type=string
vars.i18n.en.string_spread = decodeSingleQuoteSafeString('Spread');// type=string
vars.i18n.en.string_tapanddrag = decodeSingleQuoteSafeString('Tap + Drag');// type=string
vars.i18n.en.string_pinch = decodeSingleQuoteSafeString('Pinch');// type=string
vars.i18n.en.string_orthesecontrols = decodeSingleQuoteSafeString('or these controls');// type=string
vars.i18n.en.string_trackpressdrag = decodeSingleQuoteSafeString('Trackpad: Press + Drag');// type=string
vars.i18n.en.string_mousepressdrag = decodeSingleQuoteSafeString('Mouse: Press + Drag');// type=string
vars.i18n.en.string_keyboardarrowkeys = decodeSingleQuoteSafeString('Keyboard Arrow Keys');// type=string
vars.i18n.en.string_moreoptionshere = decodeSingleQuoteSafeString('More[br]Options[br]Here');// type=string
vars.i18n.en.string_sharewhatyoufind = decodeSingleQuoteSafeString('Share What[br]You Find[br]Using This');// type=string
vars.i18n.en.string_skip_tutorial = decodeSingleQuoteSafeString('Skip Tutorial');// type=string
vars.i18n.en.string_enjoythefancam = decodeSingleQuoteSafeString('Enjoy the[br]Fancam');// type=string
vars.i18n.en.string_sharethisview = decodeSingleQuoteSafeString('SHARE THIS VIEW');// type=string
vars.i18n.en.string_enteryouremail = decodeSingleQuoteSafeString('Enter your Email');// type=string
vars.i18n.en.string_privacypolicy = decodeSingleQuoteSafeString('Privacy Policy');// type=string
vars.i18n.en.string_termsofservice = decodeSingleQuoteSafeString('Terms of Service');// type=string
vars.i18n.en.string_videobooth = decodeSingleQuoteSafeString('Video Booth');// type=string
vars.i18n.en.title_video1 = decodeSingleQuoteSafeString('Title of Video 1');// type=string
vars.i18n.en.subtitle_video1 = decodeSingleQuoteSafeString('Subtitle of Video 1');// type=string
vars.i18n.en.title_video2 = decodeSingleQuoteSafeString('Title of Video 2');// type=string
vars.i18n.en.subtitle_video2 = decodeSingleQuoteSafeString('Subtitle of Video 2');// type=string
vars.i18n.en.title_video3 = decodeSingleQuoteSafeString('Title of Video 3');// type=string
vars.i18n.en.subtitle_video3 = decodeSingleQuoteSafeString('Subtitle of Video 3');// type=string
vars.i18n.en.title_video4 = decodeSingleQuoteSafeString('Title of Video 4');// type=string
vars.i18n.en.subtitle_video4 = decodeSingleQuoteSafeString('Subtitle of Video 4');// type=string
vars.i18n.en.title_video5 = decodeSingleQuoteSafeString('Title of Video 5');// type=string
vars.i18n.en.subtitle_video5 = decodeSingleQuoteSafeString('Subtitle of Video 5');// type=string
vars.languages = [];
vars.languages[0] = { code:"en", name:"en" };
vars.lang = 'en';
/* LANGUAGE SWITCHER */
i18next
.init({
resources: {'en' : { 'translation' : vars.i18n['en'] }},
lng: 'en',
fallbackLng: 'en'
}, function(err, t) {
console.log('localising');
localize = locI18next.init(i18next);
localize('[data-i18n]');
});
/* language switching */
function fc_changelang(lang, oncompleteaction){
console.log('changing language to ', lang);
if ((lang === undefined )){
console.log('fc_changelang: undefined language "'+ lang + '"');
return;
}
function _updateCurrentOptions(opts){
}
function _replaceQueryParam (param, newval, search) {
var regex = new RegExp( '([?;&])' + param + '=[^&;]*([;&]?)');
var query = search.replace(regex, '$1' + param + '=' + newval + '$2');
if (!regex.test(query)){
query = (query.length > 2 ? (query + '&') : '?') + (newval ? param + '=' + newval : '');
}
return query;
}
function _fetchOptionsForLang(lng, callback){
try {
var x = new (XMLHttpRequest || ActiveXObject)('MSXML2.XMLHTTP.3.0');
x.open('GET', '/virtual-reality/options.json' + '?lang=' + lng, 1);
x.withCredentials = true;
x.onreadystatechange = function () {
if(this.readyState > 3){
if (this.status == 200 && this.responseText){
// console.log('resources loaded for "%s"', lng );
callback(JSON.parse(this.responseText));
}
else{
console.log('error loading options for lang');
callback({});
}
}
};
x.send();
}
catch (e) {
console.log(e);
}
}
function _applyOptions(lang, opts){
//console.log('_applyOptions for lang', lang, opts );
i18next.changeLanguage(lang);
localize('[data-i18n]');
for(var key in opts){ // just override/store on top.
if (opts.hasOwnProperty(key)) {
//console.log(key, opts[key]);
// convert any colors from hash to hex format 0x000
vars.options[key] = (typeof opts[key] === 'string') ? opts[key].replace(/^#([0-9a-f]{6}|[0-9a-f]{3})$/i, '0x\$1') : opts[key];
}
}
if (pano()){ // and update krpano
pano().set('options', vars.options);
pano().set('lang', lang);
if (oncompleteaction !== undefined){
pano().call(oncompleteaction);
}
}
if (vars.languages && vars.languages.length > 1){
window.history.replaceState({}, // update the main url
/* don't change site title */null ,
window.location.pathname + _replaceQueryParam('lng',lang, window.location.search));
}
}
if (vars.i18n[lang] !== undefined){
//console.log('already have resources cached for', lang);
_applyOptions(lang, vars.i18n[lang]);
}
else{
// console.log('caching new resources for', lang);
_fetchOptionsForLang(lang, function(opts){
vars.i18n[lang] = opts; // cache
i18next.addResources(lang, 'translation'/* TODO set the ns somewhere else*/, opts); //add to i18next
_applyOptions(lang, opts);
});
}
}
fc_changelang('en');
/* END LANGUAGE SWTICHER */
/* viewer */
embedpano({
html5:"prefer+webgl",
id:"panoSWFObject",
target:"panoDIV",
xml: "/virtual-reality/pano.xml",
mobilescale:0.5,
initVars:initVars,
vars:vars,
onready:_onPanoReady,
onerror:_onPanoError
});
// for backwards compatibility
function fc_updateUrlQuery(atv, ath, fov, scene){
fc.updateUrlQuery(atv, ath, fov, scene);
}
/* TODO workaround, snapshot server not always receiving the events before 5 seconds,
send many */
var loaded_evt_count = 0;
var loaded_evt_max = 20;
var loaded_timer_interval = 1500;//ms
function _sendPanoLoadedEvt(){ // for the snapshot server..
var evt = document.createEvent("Event");
evt.initEvent("pano-loaded",true,true);
document.dispatchEvent(evt);
//console.log('sent pano loaded event');
loaded_evt_count++;
if (loaded_evt_count < loaded_evt_max){
setTimeout(_sendPanoLoadedEvt,loaded_timer_interval);
}
}
function fc_hideLoadingScreen(){
document.getElementById("panoDIV").style.visibility = 'visible';
document.body.style.background = 'none';
setTimeout(_sendPanoLoadedEvt,loaded_timer_interval);
}
function _onPanoError(message){
console.log('pano error');
_sendPanoLoadedEvt(); // nothing more to do..
}
function _onPanoReady(krpano){
console.log('pano ready');
}
/*
TODO move these functions out to the js library. - END
*/