\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_656781cd165ad-search', '.search_656781cd165ad .form-check');
$('#search_656781cd165ad-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_656781cd165ad-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656781cd165ad-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_656781cd165ad-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656781cd17765-search', '.search_656781cd17765 .form-check');
$('#search_656781cd17765-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_656781cd17765-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656781cd17765-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_656781cd17765-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656781cd1777a-search', '.search_656781cd1777a .form-check');
$('#search_656781cd1777a-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_656781cd1777a-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656781cd1777a-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_656781cd1777a-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656781cd177af-search', '.search_656781cd177af .form-check');
$('#search_656781cd177af-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_656781cd177af-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656781cd177af-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_656781cd177af-panel .form-check-input').each(function() {
this.checked = checkedValues.includes(this.value);
});
}
setSearchFilterIcon();
});
$(document).ready(function() {
searchInList('#search_656781cd17bdb-search', '.search_656781cd17bdb .form-check');
$('#search_656781cd17bdb-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_656781cd17bdb-panel .form-check-input').filter(':checked').map(function() {
return this.value;
}).get();
console.log('#search_656781cd17bdb-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_656781cd17bdb-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/about.php";
window.location.href = addGetParam(selfURI, 'lang', $(this).val());
});
});
$(function () {
/** showAlertMessage **/
/** showAlertMessage !requestComesFromSafePlace [] **/ });
var webSocketSelfURI = 'https://soaptube.tv/view/about.php';
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 () {
});