mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
This commit is contained in:
parent
c159f99451
commit
5e7b9aaa99
1 changed files with 45 additions and 35 deletions
|
@ -133,7 +133,7 @@ function clean_name(str) {
|
||||||
|
|
||||||
var processing_lazyImage = false;
|
var processing_lazyImage = false;
|
||||||
function lazyImage() {
|
function lazyImage() {
|
||||||
if(processing_lazyImage){
|
if (processing_lazyImage) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
processing_lazyImage = true;
|
processing_lazyImage = true;
|
||||||
|
@ -178,7 +178,7 @@ function lazyImage() {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
processing_lazyImage=false;
|
processing_lazyImage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
lazyImage();
|
lazyImage();
|
||||||
|
@ -261,7 +261,7 @@ function changeVideoSrc(vid_obj, source) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (autoLoad) {
|
if (autoLoad) {
|
||||||
changeVideoSrcLoad();
|
changeVideoSrcLoad();
|
||||||
}else{
|
} else {
|
||||||
player.play();
|
player.play();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
@ -536,7 +536,7 @@ function addViewFromCookie() {
|
||||||
if (typeof webSiteRootURL == 'undefined') {
|
if (typeof webSiteRootURL == 'undefined') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(_addViewFromCookie_addingtime){
|
if (_addViewFromCookie_addingtime) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_addViewFromCookie_addingtime = true;
|
_addViewFromCookie_addingtime = true;
|
||||||
|
@ -628,7 +628,7 @@ function nl2br(str, is_xhtml) {
|
||||||
function inIframe() {
|
function inIframe() {
|
||||||
var url = new URL(location.href);
|
var url = new URL(location.href);
|
||||||
var avideoIframe = url.searchParams.get("avideoIframe");
|
var avideoIframe = url.searchParams.get("avideoIframe");
|
||||||
if(avideoIframe && avideoIframe !== 0){
|
if (avideoIframe && avideoIframe !== 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -840,7 +840,7 @@ function showMuteTooltip() {
|
||||||
$("#mainVideo .vjs-volume-panel").attr("data-toggle", "tooltip");
|
$("#mainVideo .vjs-volume-panel").attr("data-toggle", "tooltip");
|
||||||
$("#mainVideo .vjs-volume-panel").attr("data-placement", "top");
|
$("#mainVideo .vjs-volume-panel").attr("data-placement", "top");
|
||||||
$("#mainVideo .vjs-volume-panel").attr("title", "Click to activate the sound");
|
$("#mainVideo .vjs-volume-panel").attr("title", "Click to activate the sound");
|
||||||
$('#mainVideo .vjs-volume-panel[data-toggle="tooltip"]').tooltip({container: '.vjs-control-bar', html:true});
|
$('#mainVideo .vjs-volume-panel[data-toggle="tooltip"]').tooltip({container: '.vjs-control-bar', html: true});
|
||||||
$('#mainVideo .vjs-volume-panel[data-toggle="tooltip"]').tooltip('show');
|
$('#mainVideo .vjs-volume-panel[data-toggle="tooltip"]').tooltip('show');
|
||||||
$("#mainVideo .vjs-volume-panel").click(function () {
|
$("#mainVideo .vjs-volume-panel").click(function () {
|
||||||
console.log("remove unmute tooltip");
|
console.log("remove unmute tooltip");
|
||||||
|
@ -1267,7 +1267,7 @@ function avideoModalIframeClose() {
|
||||||
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if(inIframe()){
|
if (inIframe()) {
|
||||||
window.parent.swal.close();
|
window.parent.swal.close();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -1295,7 +1295,7 @@ function avideoModalIframeLarge(url) {
|
||||||
|
|
||||||
var avideoModalIframeFullScreenOriginalURL = false;
|
var avideoModalIframeFullScreenOriginalURL = false;
|
||||||
function avideoModalIframeFullScreen(url) {
|
function avideoModalIframeFullScreen(url) {
|
||||||
if(!avideoModalIframeFullScreenOriginalURL){
|
if (!avideoModalIframeFullScreenOriginalURL) {
|
||||||
avideoModalIframeFullScreenOriginalURL = document.location.href;
|
avideoModalIframeFullScreenOriginalURL = document.location.href;
|
||||||
}
|
}
|
||||||
window.history.pushState("", "", url);
|
window.history.pushState("", "", url);
|
||||||
|
@ -1309,17 +1309,27 @@ function avideoModalIframeFullScreenClose() {
|
||||||
avideoModalIframeFullScreenOriginalURL = false;
|
avideoModalIframeFullScreenOriginalURL = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
if (typeof history.pushState === "function") {
|
||||||
|
console.log('history.pushState loaded');
|
||||||
|
window.onpopstate = function () {
|
||||||
|
console.log('onpopstate');
|
||||||
|
avideoModalIframeFullScreenClose();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function avideoModalIframeFull(url) {
|
function avideoModalIframeFull(url) {
|
||||||
avideoModalIframeFullScreen(url);
|
avideoModalIframeFullScreen(url);
|
||||||
}
|
}
|
||||||
""
|
|
||||||
function avideoModalIframeWithClassName(url, className) {
|
function avideoModalIframeWithClassName(url, className) {
|
||||||
url = addGetParam(url, 'avideoIframe', 1);
|
url = addGetParam(url, 'avideoIframe', 1);
|
||||||
var html = '';
|
var html = '';
|
||||||
html = '<div id="avideoModalIframeDiv" class="clearfix popover-title">';
|
html = '<div id="avideoModalIframeDiv" class="clearfix popover-title">';
|
||||||
html += '<button class="btn btn-default pull-left" onclick="avideoModalIframeFullScreenClose();">';
|
html += '<button class="btn btn-default pull-left" onclick="avideoModalIframeFullScreenClose();">';
|
||||||
html += '<i class="fas fa-chevron-left"></i>';
|
html += '<i class="fas fa-chevron-left"></i>';
|
||||||
html += '</button><img src="'+webSiteRootURL +'videos/userPhoto/logo.png" class="img img-responsive " style="max-height:34px;"></div>';
|
html += '</button><img src="' + webSiteRootURL + 'videos/userPhoto/logo.png" class="img img-responsive " style="max-height:34px;"></div>';
|
||||||
html += '<iframe frameBorder="0" class="animate__animated animate__bounceInDown" src="' + url + '" allow="camera *;microphone *" ></iframe>';
|
html += '<iframe frameBorder="0" class="animate__animated animate__bounceInDown" src="' + url + '" allow="camera *;microphone *" ></iframe>';
|
||||||
var span = document.createElement("span");
|
var span = document.createElement("span");
|
||||||
span.innerHTML = html;
|
span.innerHTML = html;
|
||||||
|
@ -1367,7 +1377,7 @@ function avideoModalIframeRemove() {
|
||||||
|
|
||||||
function avideoResponse(response) {
|
function avideoResponse(response) {
|
||||||
console.log('avideoResponse', response);
|
console.log('avideoResponse', response);
|
||||||
if(typeof response == 'string'){
|
if (typeof response == 'string') {
|
||||||
response = JSON.parse(response);
|
response = JSON.parse(response);
|
||||||
}
|
}
|
||||||
console.log('avideoResponse', response);
|
console.log('avideoResponse', response);
|
||||||
|
@ -1403,7 +1413,7 @@ function avideoTooltip(selector, text) {
|
||||||
$(selector).attr('title', text);
|
$(selector).attr('title', text);
|
||||||
$(selector).attr('data-toggle', 'tooltip');
|
$(selector).attr('data-toggle', 'tooltip');
|
||||||
$(selector).attr('data-original-title', text);
|
$(selector).attr('data-original-title', text);
|
||||||
$(selector).tooltip({html:true});
|
$(selector).tooltip({html: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
function fixAdSize() {
|
function fixAdSize() {
|
||||||
|
@ -1543,7 +1553,7 @@ $(document).ready(function () {
|
||||||
},
|
},
|
||||||
setProgress: function (valeur) {
|
setProgress: function (valeur) {
|
||||||
var element = $('#pleaseWaitDialog').find('.progress');
|
var element = $('#pleaseWaitDialog').find('.progress');
|
||||||
console.log('showPleaseWait setProgress',element);
|
console.log('showPleaseWait setProgress', element);
|
||||||
element.slideDown();
|
element.slideDown();
|
||||||
$('#pleaseWaitDialog').find('.progress-bar').css('width', valeur + '%').attr('aria-valuenow', valeur);
|
$('#pleaseWaitDialog').find('.progress-bar').css('width', valeur + '%').attr('aria-valuenow', valeur);
|
||||||
},
|
},
|
||||||
|
@ -1890,14 +1900,14 @@ function addGetParam(_url, _key, _value) {
|
||||||
return _url;
|
return _url;
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeDuplicatedGetParam(_url){
|
function removeDuplicatedGetParam(_url) {
|
||||||
var queryParam = _url.replace(/^[^?]+\?/, '');
|
var queryParam = _url.replace(/^[^?]+\?/, '');
|
||||||
if(queryParam==''){
|
if (queryParam == '') {
|
||||||
return _url;
|
return _url;
|
||||||
}
|
}
|
||||||
var params = queryParam.split('&'),
|
var params = queryParam.split('&'),
|
||||||
results = {};
|
results = {};
|
||||||
for(var i = 0; i < params.length; i++){
|
for (var i = 0; i < params.length; i++) {
|
||||||
var temp = params[i].split('='),
|
var temp = params[i].split('='),
|
||||||
key = temp[0],
|
key = temp[0],
|
||||||
val = temp[1];
|
val = temp[1];
|
||||||
|
@ -1907,7 +1917,7 @@ function removeDuplicatedGetParam(_url){
|
||||||
|
|
||||||
var newQueryParam = [];
|
var newQueryParam = [];
|
||||||
for (var key in results) {
|
for (var key in results) {
|
||||||
newQueryParam.push(key+'='+results[key]);
|
newQueryParam.push(key + '=' + results[key]);
|
||||||
}
|
}
|
||||||
var newQueryParamString = newQueryParam.join('&');
|
var newQueryParamString = newQueryParam.join('&');
|
||||||
return _url.replace(queryParam, newQueryParamString);
|
return _url.replace(queryParam, newQueryParamString);
|
||||||
|
@ -1949,7 +1959,7 @@ async function setToolTips() {
|
||||||
if (!$('[data-toggle="tooltip"]').not('.alreadyTooltip').length) {
|
if (!$('[data-toggle="tooltip"]').not('.alreadyTooltip').length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$('[data-toggle="tooltip"]').not('.alreadyTooltip').tooltip({container: 'body', html:true});
|
$('[data-toggle="tooltip"]').not('.alreadyTooltip').tooltip({container: 'body', html: true});
|
||||||
$('[data-toggle="tooltip"]').not('.alreadyTooltip').on('click', function () {
|
$('[data-toggle="tooltip"]').not('.alreadyTooltip').on('click', function () {
|
||||||
var t = this;
|
var t = this;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
@ -2058,14 +2068,14 @@ function socketClearSessionCache(json) {
|
||||||
clearCache(false, 0, 1);
|
clearCache(false, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function animateChilds(selector, type, delay){
|
function animateChilds(selector, type, delay) {
|
||||||
var step = delay;
|
var step = delay;
|
||||||
$(selector).children().each(function () {
|
$(selector).children().each(function () {
|
||||||
var $currentElement = $(this);
|
var $currentElement = $(this);
|
||||||
$currentElement.addClass('animate__animated');
|
$currentElement.addClass('animate__animated');
|
||||||
$currentElement.addClass(type);
|
$currentElement.addClass(type);
|
||||||
$currentElement.css('-webkit-animation-delay', step+"s");
|
$currentElement.css('-webkit-animation-delay', step + "s");
|
||||||
$currentElement.css('animation-delay', step+"s");
|
$currentElement.css('animation-delay', step + "s");
|
||||||
step+=delay;
|
step += delay;
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue