//document.documentElement.requestFullscreen(); //window.screen.mozLockOrientation('portrait'); var BASEGUIPATH=''; var sectar=window.location.pathname.replace(BASEGUIPATH, "").split("/"); var GUISECTION="index"; if(sectar.length>1 && sectar[1].length>0 && sectar[1]!='actuations') GUISECTION=sectar[1]; var GUISUBSECTION=""; if(sectar.length>2) GUISUBSECTION=sectar[2]; console.debug(sectar); console.debug(GUISECTION); var windowWidth = window.screen.width < window.outerWidth ? window.screen.width : window.outerWidth; var mobile = windowWidth < 500; var ttsEnabled=; var slideEnabled=; var speechEnabled=''; var notifyColor='#fff'; if(''=='dmblack') notifyColor='#000'; var stringColors = { 'red': '#ff0000', 'green': '#5cb85c', 'gray': '#999999', 'orange': '#f0ad4e', 'blue': '#428bca', 'azure': '#5bc0de', 'black': '#000000', 'white': '#ffffff' }; //var scroller = new AppScroll({ // toolbar: $('#topbar')[0], // scroller: $('#content')[0] //}) if (!Date.now) { Date.now = function() { return new Date().getTime(); }; } var audioTagSupport = !!(document.createElement('audio').canPlayType); /* function DoFullScreen() { if (!document.fullscreenElement && // alternative standard method !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods if (document.documentElement.requestFullscreen) { document.documentElement.requestFullscreen(); } else if (document.documentElement.msRequestFullscreen) { document.documentElement.msRequestFullscreen(); } else if (document.documentElement.mozRequestFullScreen) { document.documentElement.mozRequestFullScreen(); } else if (document.documentElement.webkitRequestFullscreen) { document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); } } } */ function jQueryEscapesel(expression) { return expression.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\$&'); } (function () { var previousScroll = 0; $(window).scroll(function(event){ $(this).scrollLeft()!=0; $(window).scrollLeft(0); event.preventDefault(); }); }()); // to disable right scroll on panels open $(window).scroll(function(event){ console.debug(event); }); if(window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { $(document).ready(function(){ if (("standalone" in window.navigator) && window.navigator.standalone) { // For iOS Apps $('a').on('click', function(e){ e.preventDefault(); var new_location = $(this).attr('href'); if (new_location != undefined && new_location.substr(0, 1) != '#' && $(this).attr('data-method') == undefined){ window.location = new_location; } }); } }); } if(window.navigator.userAgent.match(/firefox/i) && window.navigator.userAgent.match(/mobile/i)) { var installbutton = $("#installbutton"); var port=""; if(document.location.port) var port=":"+document.location.port; var manifest_url = document.location.protocol+"//"+document.location.host+port+"/manifest.webapp"; function installFFApp(ev) { ev.preventDefault(); var myapp = navigator.mozApps.install(manifest_url); myapp.onsuccess = function(data) { $("#install_ff").hide() console.log(this); popupFader('success', 'SUCCESS:','Web app installata correttamente'); var a = playTTS('Web app installata correttamente'); }; myapp.onerror = function() { console.log('Install failed, error: ' + this.error.name); popupFader('danger', 'ERROR:', 'App not installed: '+this.error.name); playTTS('Errore, applicazione non installata'); }; }; var installCheck = navigator.mozApps.checkInstalled(manifest_url); installCheck.onsuccess = function() { if(installCheck.result) { $("#install_ff").hide(); } else { $("#install_ff").show(); installbutton.on('click', installFFApp); }; }; } if(mobile) { if(jQuery.isFunction(window.screen.lockOrientation)) window.screen.lockOrientation('portrait'); else if(jQuery.isFunction(window.screen.mozLockOrientation)) window.screen.mozLockOrientation('portrait'); else if(jQuery.isFunction(window.screen.msLockOrientation)) window.screen.msLockOrientation('portrait'); else if(jQuery.isFunction(window.screen.webkitLockOrientation)) window.screen.webkitLockOrientation('portrait'); } function tmpPopover(el, cont, placement, timeout) { console.debug(cont); //el.popover("destroy"); el.popover({ placement: placement, content: cont, delay: {show: 100, hide: timeout}, container: el, trigger: "manual"}); console.debug(el.popover); el.addClass('text-on-white-theme-'); el.popover("show"); el.find(".popover-content").html(cont); setTimeout(function(){el.popover("destroy")}, timeout); } function playTTS(text, lang, force) { if(typeof(force)==='undefined') force=false; if(typeof(lang)==='undefined') lang = "it"; if (!audioTagSupport) return false; if (text=='') return false; if (ttsEnabled!=1 && force===false) return false; if($("playTTS_audio").length) { var audio = $("playTTS_audio"); } else { var audio = document.createElement('audio'); audio.setAttribute('id' , 'playTTS_audio'); } // XXX BUG: webkit based browsers seems to not work with https:// in