\n {title}\n <\/strong>\n {msg}<\/p>\n {html}\n {created}<\/small>\n <\/div>\n <\/div>\n <\/a>\n {icon}<\/div>\n
\n <\/i>\n <\/button>\n<\/div>"
var requiredUserNotificationTemplateFields = ["href","onclick","status","element_class","element_id","type","image","icon","title","msg","html","id","created"]
var autoPlayAjax=false;
var _adWasPlayed = 0;
$(document).ready(function () {
YPTHidenavbar();
});
$(document).ready(function() {
searchInList('#search_656b92af29af2-search', '.search_656b92af29af2 .form-check');
$('#search_656b92af29af2-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLsearchFieldsNames input[type="checkbox"], .searchHTMLsearchFieldsNames input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_656b92af29af2-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656b92af29af2-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('searchFieldsNames[]', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('searchFieldsNames[]');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_656b92af29af2-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656b92af2a89d-search', '.search_656b92af2a89d .form-check');
$('#search_656b92af2a89d-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLcatName input[type="checkbox"], .searchHTMLcatName input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_656b92af2a89d-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656b92af2a89d-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('catName', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('catName');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_656b92af2a89d-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656b92af2a8a7-search', '.search_656b92af2a8a7 .form-check');
$('#search_656b92af2a8a7-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLtags_id input[type="checkbox"], .searchHTMLtags_id input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_656b92af2a8a7-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656b92af2a8a7-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('tags_id', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('tags_id');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_656b92af2a8a7-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656b92af2a8c8-search', '.search_656b92af2a8c8 .form-check');
$('#search_656b92af2a8c8-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLcreated input[type="checkbox"], .searchHTMLcreated input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_656b92af2a8c8-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656b92af2a8c8-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('created', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('created');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_656b92af2a8c8-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656b92af2acf0-search', '.search_656b92af2acf0 .form-check');
$('#search_656b92af2acf0-panel .form-check-input').on('change', function() {
var checked = $(this).prop('checked');
var value = $(this).val();
$('.searchHTMLminViews input[type="checkbox"], .searchHTMLminViews input[type="radio"]').each(function() {
if ($(this).val() === value) {
$(this).prop('checked', checked);
}
});
const checkedValues = $('#search_656b92af2acf0-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656b92af2acf0-panel .form-check-input', checkedValues, JSON.stringify(checkedValues));
Cookies.set('minViews', JSON.stringify(checkedValues), {
expires: 365,
path: '/'
});
setSearchFilterIcon();
});
var savedCookies = Cookies.get('minViews');
if (savedCookies) {
var checkedValues = JSON.parse(savedCookies);
$('#search_656b92af2acf0-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
var searchTotalSelectedSearchIn = 0;
var searchSelectedCategoryVal = '';
var searchSelectedTagVal = '';
var searchSelectedCategory = '';
var searchSelectedTag = '';
function updateSearchSelectedValues() {
searchTotalSelectedSearchIn = $('#search-tab .form-check-input:checked').length;
searchSelectedCategoryVal = $('#filter-tab .form-check-input:checked').val();
searchSelectedTagVal = $('#filter-tags-tab .form-check-input:checked').val();
searchSelectedCategory = $('#filter-tab .form-check-input:checked').parent().find('.form-check-label').html();
searchSelectedTag = $('#filter-tags-tab .form-check-input:checked').parent().find('.form-check-label').html();
}
$(document).ready(function () {
$('#filterButton').click(function () {
$('#filterDropdown').toggleClass('show');
});
setSearchFilterIcon();
});
function setSearchFilterIcon() {
updateSearchSelectedValues();
$('#searchFieldsNamesBelowNavbar-dropdown .badge').text(searchTotalSelectedSearchIn);
$('#catNameBelowNavbar-dropdown').html(searchSelectedCategory);
$('#tagNameBelowNavbar-dropdown').html(searchSelectedTag);
// check if no filter checkboxes are checked and search_category0 is checked and search_tag0 is checked
if (searchTotalSelectedSearchIn === 0 && empty(searchSelectedCategoryVal) && empty(searchSelectedTagVal)) {
// add the text-muted icon to the filterButton
$('#filterButton').removeClass('active');
} else {
// remove the text-muted icon from the filterButton
$('#filterButton').addClass('active');
}
}
$(function () {
$("#navBarFlag").change(function () {
var selfURI = "https://soaptube.tv/view/";
window.location.href = addGetParam(selfURI, 'lang', $(this).val());
});
});
$(document).ready(function () {
loadPL('2126','656b95159c5f1');
});
$(document).ready(function () {
loadPL('4033','656b9515af921');
});
$(document).ready(function () {
loadPL('4630','656b9515c168a');
});
$(document).ready(function () {
loadPL('4629','656b9515c4421');
});
$(document).ready(function () {
loadPL('4620','656b9515d1be0');
});
$(document).ready(function () {
loadPL('4618','656b9515d4f63');
});
$(document).ready(function () {
loadPL('4617','656b9515d8ac3');
});
$(document).ready(function () {
loadPL('4838','656b9515e6f3a');
});
$(document).ready(function () {
loadPL('4837','656b9515ea1b4');
});
$(document).ready(function () {
loadPL('4836','656b9515ee422');
});
$(document).ready(function () {
loadPL('4835','656b9515f21df');
});
$(document).ready(function () {
loadPL('4834','656b951601344');
});
$(document).ready(function () {
loadPL('4833','656b95160707f');
});
$(document).ready(function () {
loadPL('4838','656b95161b16a');
});
$(document).ready(function () {
loadPL('4837','656b95161b4bd');
});
$(document).ready(function () {
loadPL('4836','656b95161b832');
});
$(document).ready(function () {
loadPL('4835','656b95161bc20');
});
$(document).ready(function () {
loadPL('4834','656b95161bfc2');
});
$(document).ready(function () {
loadPL('4833','656b95161c397');
});
$(document).ready(function () {
loadPL('4832','656b95161eefc');
});
$(document).ready(function () {
loadPL('4831','656b951622749');
});
$(document).ready(function () {
loadPL('4830','656b951625cc6');
});
$(document).ready(function () {
loadPL('4829','656b95162f44d');
});
$(document).ready(function () {
loadPL('4828','656b951632fca');
});
$(document).ready(function () {
loadPL('4827','656b95163670e');
});
$(document).ready(function () {
loadPL('1933','656b951649fe6');
});
$(document).ready(function () {
loadPL('1955','656b95165826a');
});
$(document).ready(function () {
loadPL('2078','656b95165df73');
});
$(document).ready(function () {
loadPL('2269','656b9516720f5');
});
$(document).ready(function () {
loadPL('3','656b951674e6e');
});
$(document).ready(function () {
loadPL('366','656b951677a9f');
});
$(document).ready(function () {
loadPL('4838','656b9516bc3b0');
});
$(document).ready(function () {
loadPL('4837','656b9516bc859');
});
$(document).ready(function () {
loadPL('4836','656b9516bcca7');
});
$(document).ready(function () {
loadPL('4835','656b9516bd0d5');
});
$(document).ready(function () {
loadPL('4834','656b9516bd51a');
});
$(document).ready(function () {
loadPL('4833','656b9516bd93e');
});
$(document).ready(function () {
loadPL('4587','656b9516d3356');
});
var $containerfae19d02a97ff88e54566edc01359966;
$(function() {
loadInfiniteScroolfae19d02a97ff88e54566edc01359966();
});
var append_infiniteScroll_timout;
function loadInfiniteScroolfae19d02a97ff88e54566edc01359966() {
if (typeof $('.categoriesContainerItem').infiniteScroll == 'function') {
$containerfae19d02a97ff88e54566edc01359966 = $('.categoriesContainerItem').infiniteScroll({
path: '.pagination__nextfae19d02a97ff88e54566edc01359966',
append: '.categoriesContainerItem',
status: '.scroller-statusfae19d02a97ff88e54566edc01359966',
hideNav: '.infiniteScrollPaginationfae19d02a97ff88e54566edc01359966',
debug: false,
prefill: true,
history: false,
checkLastPage: false,
button: '#loadInfiniteScrollButtonfae19d02a97ff88e54566edc01359966'
});
$containerfae19d02a97ff88e54566edc01359966.on('scrollThreshold.infiniteScroll', function(event) {
//console.log('infiniteScroll Scroll at bottom');
});
$containerfae19d02a97ff88e54566edc01359966.on('request.infiniteScroll', function(event, path, fetchPromise) {
//console.log(`infiniteScroll Loading page: ${path}`);
});
let infScroll = $containerfae19d02a97ff88e54566edc01359966.data('infiniteScroll');
$containerfae19d02a97ff88e54566edc01359966.on('load.infiniteScroll', function(event, body, path, response) {
//console.log(`infiniteScroll Loaded: ${path}`, `Status: ${response.status}`, `Current page: ${infScroll.pageIndex}`, `${infScroll.loadCount} pages loaded`);
});
$containerfae19d02a97ff88e54566edc01359966.on('append.infiniteScroll', function(event, body, path, items, response) {
//console.log(`infiniteScroll Appended ${items.length} items on ${path}`, body);
clearTimeout(append_infiniteScroll_timout);
append_infiniteScroll_timout = setTimeout(function() {
lazyImage();
avideoSocket();
}, 1000);
});
$containerfae19d02a97ff88e54566edc01359966.on('error.infiniteScroll', function(event, error, path, response) {
console.error(`infiniteScroll Could not load: ${path}. ${error}`);
});
$containerfae19d02a97ff88e54566edc01359966.on('last.infiniteScroll', function(event, body, path) {
//console.log(`infiniteScroll Last page hit on ${path}`, body, event);
});
$containerfae19d02a97ff88e54566edc01359966.on('history.infiniteScroll', function(event, title, path) {
//console.log(`infiniteScroll History changed to: ${path}`);
});
}
}
$(function () {
/** showAlertMessage **/
/** showAlertMessage **/
/** showAlertMessage END **/ });
var webSocketSelfURI = 'https://soaptube.tv/view/';
var webSocketVideos_id = '0';
var webSocketLiveKey = 'false';
var webSocketServerVersion = '4.2';
var webSocketToken = '';
var webSocketURL = '';
var webSocketTypes = {"OPEN_CONNECTION":"OPEN_CONNECTION","NEW_CONNECTION":"NEW_CONNECTION","NEW_DISCONNECTION":"NEW_DISCONNECTION","DEFAULT_MESSAGE":"DEFAULT_MESSAGE","ON_VIDEO_MSG":"ON_VIDEO_MSG","ON_LIVE_MSG":"ON_LIVE_MSG","TESTING":"TESTING"};
function onUserSocketConnect(response) {
try {
socketNewConnection(response);for (const key in response.users_id_online) {
if (Object.hasOwnProperty.call(response.users_id_online, key)) {
const element = response.users_id_online[key];
$('#caller'+element.users_id).show();
$('.users_id_'+element.users_id).addClass('online');
}
}
} catch (e) {
console.log('onUserSocketConnect:error', e.message);
}
}
function onUserSocketDisconnect(response) {
try {
socketDisconnection(response);$('#caller'+response.msg.users_id).hide();
$('.users_id_'+response.msg.users_id).removeClass('online'); } catch (e) {
console.log('onUserSocketConnect:error', e.message);
}
}
$(document).ready(function () {
});
$(document).ready(function () {
});
var playListsAdding = false;
var playList = [];
async function reloadPlayLists() {
if (!isOnline()) {
return false;
}
//console.log('reloadPlayLists');
$.ajax({
url: webSiteRootURL + 'objects/playlists.json.php',
success: function (response) {
playList = response;
reloadPlayListButtons();
}
});
}
function reloadPlayListButtons() {
//console.log('reloadPlayListButtons');
$('.watchLaterBtnAdded').hide();
$('.favoriteBtnAdded').hide();
$('.watchLaterBtn').show();
$('.favoriteBtn').show();
for (var i in playList) {
if (!playList[i].id || (playList[i].status !== 'watch_later' && playList[i].status !== 'favorite')) {
continue;
}
for (var x in playList[i].videos) {
if (typeof (playList[i].videos[x]) === 'object') {
if (playList[i].status === 'watch_later') {
$('.watchLaterBtn' + playList[i].videos[x].videos_id).hide();
$('.watchLaterBtnAdded' + playList[i].videos[x].videos_id).show();
} else if (playList[i].status === 'favorite') {
$('.favoriteBtn' + playList[i].videos[x].videos_id).hide();
$('.favoriteBtnAdded' + playList[i].videos[x].videos_id).show();
}
}
}
}
}
loadPlayListsResponseObject = {timestamp: 0, response: false};
async function loadPlayLists(videos_id, crc) {
//console.log('loadPlayLists');
if (loadPlayListsResponseObject.timestamp + 5000 < Date.now()) {
loadPlayListsResponseObject.timestamp = Date.now();
loadPlayListsResponseObject.response = [];
setTimeout(function () {
$.ajax({
url: webSiteRootURL+'objects/playlists.json.php',
cache: true,
success: function (response) {
loadPlayListsResponseObject.response = response;
loadPlayListsResponse(loadPlayListsResponseObject.response, videos_id, crc);
}
});
;
}, 500);
} else {
if (loadPlayListsResponseObject.response) {
loadPlayListsResponse(loadPlayListsResponseObject.response, videos_id, crc);
} else {
setTimeout(function () {
loadPlayLists(videos_id, crc);
}, 1500);
}
}
}
var listGroupItemTemplate = "\n \n <\/i> \n <\/button>\n \n <\/i> \n <\/button>\n \n <\/i> \n {name_translated}<\/span>\n <\/span>\n \n \n <\/label>\n <\/div>\n<\/a>";
async function loadPlayListsResponse(response, videos_id, crc) {
//console.log('loadPlayListsResponse');
//console.log(response, videos_id, crc);
$('.searchlist' + videos_id + crc).html('');
for (var i in response) {
if (!response[i].id) {
continue;
}
var icon = "fa fa-lock"
if (response[i].status == "public") {
icon = "fa fa-globe"
} else if (response[i].status == "watch_later") {
icon = "fas fa-clock"
} else if (response[i].status == "favorite") {
icon = "fas fa-heart"
}
var checked = "";
for (var x in response[i].videos) {
if (typeof (response[i].videos[x]) === 'object' && response[i].videos[x].videos_id == videos_id) {
checked = "checked";
}
}
var randId = (("_" + response[i].id) + videos_id) + Math.random();
var itemsArray = {};
itemsArray.icon = icon;
itemsArray.id = response[i].id;
itemsArray.name_translated = response[i].name_translated;
itemsArray.response_id = response[i].id + '' + videos_id;
itemsArray.checked = checked;
itemsArray.videos_id = videos_id;
itemsArray.randId = randId;
$(".searchlist" + videos_id + crc).append(arrayToTemplate(itemsArray, listGroupItemTemplate));
}
$('.searchlist' + videos_id + crc).btsListFilter('#searchinput' + videos_id + crc, {itemChild: '.nameSearch', initial:false});
$('.playListsVideosIds' + videos_id).change(function () {
if (playListsAdding) {
return false;
}
playListsAdding = true;
addVideoToPlayList(videos_id, $(this).is(":checked"), $(this).val());
return false;
});
}
function addVideoToPlayList(videos_id, isChecked, playlists_id) {
//console.log('addVideoToPlayList');
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'objects/playListAddVideo.json.php',
method: 'POST',
data: {
'videos_id': videos_id,
'add': isChecked,
'playlists_id': playlists_id
},
success: function (response) {
reloadPlayLists();
//console.log(".playListsIds_" + playlists_id + '_videos_id_' + videos_id);
$(".playListsIds_" + playlists_id + '_videos_id_' + videos_id).prop("checked", isChecked);
modal.hidePleaseWait();
setTimeout(function () {
playListsAdding = false
}, 500);
}
});
}
$(document).ready(function () {
reloadPlayLists();
});
$(function () {setTimeout(function(){if(typeof $("#mainNavBar").autoHidingNavbar == "function"){$("#mainNavBar").autoHidingNavbar();}},5000);});
$(function () {
$("#mainNavBar").on("show.autoHidingNavbar", function () {
if ($(window).scrollTop() < 10) {
$("body").removeClass("nopadding");
}
});
$("#mainNavBar").on("hide.autoHidingNavbar", function () {
if ($(window).scrollTop() < 10) {
$("body").addClass("nopadding");
}
});
});
iframeAllowAttributes = 'allow="fullscreen;autoplay;camera *;microphone *;" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen" webkitallowfullscreen="webkitallowfullscreen"';
var checkFooterTimout;
$(function () {
checkFooter();
$(window).scroll(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
$(window).resize(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
$(window).mouseup(function () {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 100);
});
});
function checkFooter() {
$("#mainFooter").fadeIn();
var height = $("#mainFooter").height();
if (height < 150 && getPageHeight() <= $(window).height()) {
clearTimeout(checkFooterTimout);
checkFooterTimout = setTimeout(function () {
checkFooter();
}, 1000);
$("#mainFooter").css("position", "fixed");
$('body').css('padding-bottom', height+'px');
} else {
$("#mainFooter").css("position", "relative");
$('body').css('padding-bottom', '');
}
}
function getPageHeight() {
var mainNavBarH = 0;
if ($('#mainNavBar').length) {
mainNavBarH = $('#mainNavBar').height();
}
var mainFooterH = 0;
if ($('#mainFooter').length) {
mainFooterH = $('#mainFooter').height();
}
var containerH = getLargerContainerHeight();
return mainNavBarH + mainFooterH + containerH;
}
function getLargerContainerHeight() {
var conteiners = $('body > .container,body > .container-fluid');
var height = 0;
for (var item in conteiners) {
if (isNaN(item)) {
continue;
}
var h = $(conteiners[item]).height();
if (h > height) {
height = h;
}
}
return height;
}
$(document).ready(function () {
$('#TrailerModal').on('hidden.bs.modal', function () {
$('#TrailerModal iframe').attr('src', '');
});
$('#bigVideoCarousel').bind('slide.bs.carousel', function (e) {
setTimeout(function(){
lazyImage();
},500);
});
});