|
Send friend request to ?
|
Do you want to follow ?
|
||||
Favorite video" );
}
else
{
update( "favoriteVideo",
"Add to favorites"
);
}
}
function addFav( id )
{
performCommand( "addFav", "id=" + videos[id].playlistVideoId );
videos[id].favorite = true;
updateFavorite();
}
/*
function onYouTubePlayerReady(playerId)
{
// var index = playerId.substr( playerId.indexOf("_")+1 );
ytplayer = document.getElementById("myytplayer" );
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}
function onytplayerStateChange( state )
{
ytplayer = document.getElementById("myytplayer" );
if (state==0)
{
// ended - play next video
playVideo( "/video-Q6-BakOOm-Playlist-Soviero-vs.-guardalinee" );
}
else if (state==1)
{
// loaded
if (videoPaused)
ytplayer.pauseVideo();
}
else if (state==5)
{
// cued
if (!videoPaused)
ytplayer.playVideo();
}
}
*/
function showShareSuccess()
{
document.getElementById( 'share_input' ).style.display = "none";
document.getElementById( 'share_progress' ).style.display = "none";
document.getElementById( 'share_success' ).style.display = "block";
document.getElementById( 'share_failed' ).style.display = "none";
}
function showShareFailed( message )
{
if (typeof message == "undefined")
message= "The email could not be sent";
update( "errorMessage", message );
document.getElementById( 'share_input' ).style.display = "none";
document.getElementById( 'share_progress' ).style.display = "none";
document.getElementById( 'share_success' ).style.display = "none";
document.getElementById( 'share_failed' ).style.display = "block";
}
function showSendFailed( message )
{
if (typeof message == "undefined")
message= "The email could not be sent";
update( "errorMessage", message );
document.getElementById( 'send_contents_loading' ).className = "tabContents";
document.getElementById( 'sendContacts' ).className = "tabContents";
document.getElementById( 'send_contents_error' ).className = "tabContentsSelected";
document.getElementById( 'sendNextButton' ).style.display = "none";
document.getElementById( 'sendBackButton' ).style.display = "inline";
}
function showSendSuccess()
{
document.getElementById( 'send_contents_loading' ).className = "tabContents";
document.getElementById( 'send_contents_error' ).className = "tabContents";
document.getElementById( 'sendContacts' ).className = "tabContents";
document.getElementById( 'send_contents_success' ).className = "tabContentsSelected";
document.getElementById( 'sendBackButton' ).style.display = "none";
document.getElementById( 'sendNextButton' ).style.display = "none";
document.getElementById( 'sendCancelButton' ).style.display = "none";
document.getElementById( 'sendFinishedButton' ).style.display = "inline";
}
/*
function showAddToPlaylist()
{
document.addToPlaylist.addToPlaylistButton.disabled = false;
pendingAction = null;
addToPlaylistDialog.show();
}
function addToPlaylist( videoId )
{
AddToPlaylist.videoId = videoId;
if (userId<0)
{
pendingAction = showAddToPlaylist;
signupDialog.show();
}
else
{
showAddToPlaylist();
}
}
*/
function doShowShareDialog()
{
sendTab = 0;
sendReset();
shareDialog.show();
}
function showShareDialog()
{
if (userId<0)
{
pendingAction = doShowShareDialog;
signupDialog.show();
}
else
{
doShowShareDialog();
}
}
function sharePlaylist()
{
document.getElementById( 'share_input' ).style.display = "none";
document.getElementById( 'share_progress' ).style.display = "block";
document.getElementById( 'share_success' ).style.display = "none";
document.getElementById( 'share_failed' ).style.display = "none";
var emails = Url.encode( document.shareForm.emails.value );
var message = Url.encode( document.shareForm.message.value );
performCommand( "sharePlaylist", "id=579,emails=" + emails + ",message=" + message );
}
function closeShareDialog()
{
/* document.getElementById( 'share_input' ).style.display = "none";
document.getElementById( 'share_progress' ).style.display = "none";
document.getElementById( 'share_success' ).style.display = "none";
document.getElementById( 'share_failed' ).style.display = "none";
*/
// TODO replace
shareDialog.hide();
}
function showEmbedDialog()
{
embedDialog.show();
}
function showBookmarkDialog()
{
bookmarkDialog.show();
}
function showTwitterDialog()
{
twitterDialog.show();
}
function closeTwitterDialog()
{
twitterDialog.hide();
}
function closeBookmarkDialog()
{
bookmarkDialog.hide();
}
function addCurrentVideoToPlaylist()
{
addToPlaylist( videos[currentVideo].videoId );
// verifyLoggedIn( loggedInCallback );
}
function toggleCustomize()
{
var elem = document.getElementById( "embedCustomize" );
if( elem.style.display == "block")
elem.style.display="none";
else
elem.style.display="block";
}
/*
function addToPlaylist()
{
addPlaylistVideo = currentVideo;
verifyLoggedIn( loggedInCallback );
}
function loggedInCallback( alreadyLoggedIn )
{
if (!alreadyLoggedIn)
{
// fill in the playlists ...
performCommand( "fillPlaylists", "" );
}
showDialog( 'addDialog' );
}
function doAddToPlaylist()
{
var v = getCheckedValue( document.addToPlaylist.addToPlaylistId );
if (v=="-")
{
performCommand( "addToPlaylist", "name=" + Url.encode( document.addToPlaylist.newPlaylist.value ) + "," +
"playlistVideoId=" + videos[addPlaylistVideo].videoId );
}
else
{
performCommand( "addToPlaylist", "id=" + v + "," +
"playlistVideoId=" + videos[addPlaylistVideo].videoId );
}
closeAddDialog();
}
*/
function emailsEntered()
{
if (document.shareForm.email_emails.value=="Enter emails on separate lines")
{
document.shareForm.email_emails.select();
}
}
function messageEntered()
{
/* if (document.shareForm.message.value=="I think you'll like this video playlist!")
{
document.shareForm.message.select();
}
if (document.shareForm.email_message.value=="I think you'll like this video playlist!")
{
document.shareForm.email_message.select();
}
*/
}
/*
function launchPlayer()
{
videoStopped();
// pause the current video
videoPaused = true;
ytplayer = document.getElementById("myytplayer" );
if (ytplayer != null)
{
if (typeof ytplayer.seekTo != "undefined")
{
ytplayer.pauseVideo();
}
}
window.name = "veewow_main";
cw = window.open( "player.php?pl=579&vid=2702",
"veewow_player",
"scrollbars=yes, width=450,height=610,menubar=no,resizable=yes,location=no,directories=no,status=0" );
}
*/
// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
if(!radioObj)
return "";
var radioLength = radioObj.length;
if(radioLength == undefined)
if(radioObj.checked)
return radioObj.value;
else
return "";
for(var i = 0; i < radioLength; i++) {
if(radioObj[i].checked) {
return radioObj[i].value;
}
}
return "";
}
// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(radioObj, newValue) {
if(!radioObj)
return;
var radioLength = radioObj.length;
if(radioLength == undefined) {
radioObj.checked = (radioObj.value == newValue.toString());
return;
}
for(var i = 0; i < radioLength; i++) {
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toString()) {
radioObj[i].checked = true;
}
}
}
function focusNewPlaylist()
{
if (document.addToPlaylist.newPlaylist.value=="New playlist")
document.addToPlaylist.newPlaylist.select();
setCheckedValue( document.addToPlaylist.addToPlaylistId, "-" );
}
var embedAutoplay = "1";
var embedMode = "video";
function getEmbedCode()
{
var ip = document.getElementById( "embedText" );
var embedAutoplay = ( document.embedCustomizeForm.cbEmbedAutoplay.checked)?"1":"0";
var obj = document.embedCustomizeForm.rbEmbedMode ;
var embedMode = Util.getCheckedValue( obj );
document.embedCustomizeForm.embedPreview.src = "/lang/EN/images/embed_" + embedMode + ".gif";
var swfUrl = "http://www.veewow.com/vl.swf?autoplay="+embedAutoplay+"&pid=jm&mode="+embedMode;
var t = "";
return t;
}
function updateEmbedCode()
{
var ip = document.getElementById( "embedText" );
var embedAutoplay = ( document.embedCustomizeForm.cbEmbedAutoplay.checked)?"1":"0";
var obj = document.embedCustomizeForm.rbEmbedMode ;
var embedMode = Util.getCheckedValue( obj );
document.embedCustomizeForm.embedPreview.src = "/lang/EN/images/embed_" + embedMode + ".gif";
var swfUrl = "http://www.veewow.com/vl.swf?autoplay="+embedAutoplay+"&pid=jm&mode="+embedMode;
var t = "";
ip.value = t;
selectText( "embedText" );
// var elem0 = document.getElementById( "embedType0" );
// var elem1 = document.getElementById( "embedType1" );
// elem0.checked = (embedButtonType==0);
// elem1.checked = (embedButtonType==1);
/*
var elem0 = document.getElementById( "embedAction0" );
var elem1 = document.getElementById( "embedAction1" );
elem0.checked = (embedAction==0);
elem1.checked = (embedAction==1);
*/
}
function selectText( name )
{
var ip = document.getElementById( name );
if (typeof ip != "undefined" && ip.focus)
ip.focus();
if (typeof ip != "undefined" && ip.select)
ip.select();
}
function closeEmbedDialog()
{
embedDialog.hide();
}
//***************************************
// send
var sendTab = 0;
var sendStage = 0;
function loading( message )
{
if (typeof message != "undefined" );
update( "loadingMessage", message );
document.getElementById("send_contents_loading").className = "tabContentsSelected";
}
function sendReset()
{
showSendTab( sendTab );
document.shareForm.message.value ="I think you'll like this video playlist!";
document.shareForm.email_message.value ="I think you'll like this video playlist!";
}
function sendBack()
{
switch (sendTab)
{
case 0: // webmail
if (sendStage == 0)
{
// back to start
sendReset();
}
else if (sendStage == 1)
{
// back to start
sendReset();
}
else if (sendStage == 2)
{
// back to start
document.getElementById("send_contents_error").className = "tabContents";
document.getElementById("sendContacts").className = "tabContentsSelected";
document.getElementById("sendBackButton").style.display="inline";
document.getElementById("sendNextButton").style.display="inline";
sendStage = 1;
}
break;
case 1: // social
if (sendStage == 0)
{
// back to start
sendReset();
}
else if (sendStage == 1)
{
// back to start
sendReset();
}
else if (sendStage == 2)
{
// back to start
document.getElementById("send_contents_error").className = "tabContents";
document.getElementById("sendContacts").className = "tabContentsSelected";
document.getElementById("sendBackButton").style.display="inline";
document.getElementById("sendNextButton").style.display="inline";
sendStage = 1;
}
break;
case 2: // csv
if (sendStage == 0)
{
// back to start
sendReset();
}
else if (sendStage == 1)
{
// back to start
sendReset();
}
else if (sendStage == 2)
{
// back to previous stage
document.getElementById("send_contents_error").className = "tabContents";
document.getElementById("sendContacts").className = "tabContentsSelected";
document.getElementById("sendBackButton").style.display="inline";
document.getElementById("sendNextButton").style.display="inline";
sendStage = 1;
}
break;
case 3: // emails
// back to start
sendReset();
break;
}
}
function sendNext()
{
switch (sendTab)
{
case 0: // webmail
if (sendStage == 0)
{
var email = document.shareForm.webmail_email.value;
var password = document.shareForm.webmail_password.value;
var isLinkedIn = document.shareForm.webmail_linkedin.checked;
performCommand( "webmailGetContacts", "email=" + encodeURIComponent(email) + ",password=" + encodeURIComponent(password) + ",linkedIn=" + ((isLinkedIn)?"1":"0"), "oldCommand", "command/playlistCommand.php" );
document.getElementById("send_contents_0").className = "tabContents";
loading( "Logging into account..." );
}
else if (sendStage == 1)
{
sendStage =2;
sendNext();// verifyLoggedIn( sendNext );
}
else if (sendStage == 2)
{
var c = 0;
var params = "";
for( var i=0; i
BakOOm Playlist
|
Video divertenti e sfiziosi
|
|
|
| |