var showTopper = true;
/************************************************************************************************************************************************************************************************************
*
* ONLOAD FUNCTION CALLS
*
***********************************************************************************************************************************************************************************************************/
$(function() {
// MANAGE BACK TO TOP in read-along context showTopper=false (partFODocumentDrawer.jsp)
if(showTopper) {
var top = $('
').attr('id', 'topper').css({ bottom: '50px', display: 'none', position: 'fixed', right: 0});
var href = $('
');
href.append('');
top.append(href);
$('body').append(top);
var firstBodyEl = document.body.firstChild;
var gtm = document.createElement('a');
gtm.name = "ww4_top";
firstBodyEl.parentNode.insertBefore(gtm, firstBodyEl);
document.addEventListener("scroll", function() {
var topper = $('#topper');
var isVisible = topper.is(':visible');
//console.debug($(window).scrollTop() + ' / ' + screen.height + ' / ' + $(window).height() );
if(!isVisible && $(window).scrollTop()> $(window).height())
topper.fadeIn('slow');
else if (isVisible && $(window).scrollTop()< $(window).height())
topper.fadeOut('slow');
}, true);
}
});
/************************************************************************************************************************************************************************************************************
*
* VIDEOALONG
* queste funzioni intervenendo sul css non possono che essere site specific
*
************************************************************************************************************************************************************************************************************/
function enterFullScreen(videoId, subTitlesTarget, feedbackDivId) {
// NB il metodo fullScreenSupported pare non servire a nulla ed inoltre
// - firefox: nasconde la barra dei comandi di jplayer
// - chrome: inibisce il fullscreen!
// if(fullScreenSupported(videoId, feedbackDivId) && subTitlesTarget) {
if(subTitlesTarget) {
// var offset = $('#'+subTitlesTarget).offset().left;
var top = isExplorer ? '50px' : (isChrome ? '240px' : '540px');
var screenWidth = screen.width;
var width = (screenWidth-200) + 'px';
var fontSize = '34px';
var left = '-400px';
if(screenWidth>=1600) {
left = '-400px';
} else if(screenWidth<1600 && screenWidth>=1280) {
left = '-300px';
top = '330px';
} else if(screenWidth<1280 && screenWidth>=1152) {
left = '-190px';
top = '300px';
} else if(screenWidth<1152 && screenWidth>=1024) {
left = '-150px';
top = '260px';
width = (screen.width-150) + 'px';
} else if(screenWidth<1024&& screenWidth>=800) {
left = '-170px';
top = '350px';
width = (screenWidth-100) + 'px';
fontSize = '24px';
} else {
left = '-100px';
}
$('#'+subTitlesTarget)
// .css('width', (screen.width-offset) + 'px')
.css('width', width)
.css('left', left)
.css('top', top) /* in caso di presenza barra comandi */
.css('background-color', 'transparent')
.css('fontSize', fontSize)
.css('color', '#FFF')
.css('font-weight', 'bold')
.css('z-index', 2147483647);
}
}
function enterFullScreenTranslator(videoId, subTitlesTarget, feedbackDivId) {
if(subTitlesTarget) {
var screenWidth = screen.width;
var top = '100px';
var fontSize = '54px';
var width = (screenWidth-300) + 'px';
var left = '-400px';
if(screenWidth>=1600) {
left = '-400px';
} else if(screenWidth<1600 && screenWidth>=1280) {
left = '-300px';
} else if(screenWidth<1280 && screenWidth>=1152) {
left = '-190px';
top = '160px';
} else if(screenWidth<1152 && screenWidth>=1024) {
left = '-100px';
top = '130px';
} else if(screenWidth<1024&& screenWidth>=800) {
left = '-170px';
top = '250px';
width = (screenWidth-200) + 'px';
fontSize = '34px';
} else {
left = '-50px';
}
$('#'+subTitlesTarget)
.css('left', left)
.css('top', top)
.css('width', width)
.css('background-color', '#FFF')
.css('fontSize', fontSize)
.css('color', '#000')
.css('font-weight', 'normal')
.css('padding', '40px')
.css('minHeight', '300px')
.css('z-index', 2147483647);
}
}
function exitFullScreen(isFullScreen, subTitlesTarget) {
if(!isFullScreen) {
$('#'+subTitlesTarget)
.css('top', '-180px')
.css('text-shadow', '2px 2px 6px #000000')
.css('min-height', '60px')
.css('position', 'relative')
.css('width', '620px')
.css('background-color', 'transparent')
.css('padding', '10px')
.css('fontSize', '16px')
.css('font-weight', 'bold')
.css('color', '#FFF')
// per annullare formattazione full-screen
.css('left', '0px')
.css('z-index', 1);
}
}