mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
update
This commit is contained in:
parent
8819a287fa
commit
7ddce01f98
1 changed files with 230 additions and 225 deletions
|
@ -44,7 +44,7 @@ try {
|
|||
if (!height) {
|
||||
height = $('body').height();
|
||||
}
|
||||
parent.postMessage({height: height}, '*');
|
||||
parent.postMessage({ height: height }, '*');
|
||||
} else if (e.data.play) {
|
||||
var currentTime = e.data.play.currentTime;
|
||||
var muted = !empty(e.data.play.muted);
|
||||
|
@ -477,7 +477,7 @@ async function mouseEffect() {
|
|||
var gif = $(this).find(".thumbsGIF");
|
||||
var jpg = $(this).find(".thumbsJPG");
|
||||
try {
|
||||
gif.lazy({effect: 'fadeIn'});
|
||||
gif.lazy({ effect: 'fadeIn' });
|
||||
setTimeout(function () {
|
||||
gif.height(jpg.height());
|
||||
gif.width(jpg.width());
|
||||
|
@ -644,7 +644,7 @@ function getPlayerButtonIndex(name) {
|
|||
|
||||
async function copyToClipboard(text) {
|
||||
$('body').append('<textarea id="elementToCopyAvideo" style="filter: alpha(opacity=0);-moz-opacity: 0;-khtml-opacity: 0; opacity: 0;position: absolute;z-index: -9999;top: 0;left: 0;pointer-events: none;"></textarea>');
|
||||
$('#elementToCopyAvideo').css({'top': mouseY, 'left': 0}).fadeIn('slow');
|
||||
$('#elementToCopyAvideo').css({ 'top': mouseY, 'left': 0 }).fadeIn('slow');
|
||||
$('#elementToCopyAvideo').val(text);
|
||||
$('#elementToCopyAvideo').focus();
|
||||
$('#elementToCopyAvideo').select();
|
||||
|
@ -893,7 +893,7 @@ async function showMuteTooltip() {
|
|||
$("#mainVideo .vjs-volume-panel").attr("data-toggle", "tooltip");
|
||||
$("#mainVideo .vjs-volume-panel").attr("data-placement", "top");
|
||||
$("#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").click(function () {
|
||||
//console.log("remove unmute tooltip");
|
||||
|
@ -1346,7 +1346,7 @@ function avideoAlertOnceForceConfirm(title, msg, type) {
|
|||
}
|
||||
|
||||
function _avideoToast(msg, icon) {
|
||||
var options = {text: msg, hideAfter: 7000};
|
||||
var options = { text: msg, hideAfter: 7000 };
|
||||
if (icon) {
|
||||
options.icon = icon;
|
||||
}
|
||||
|
@ -1540,7 +1540,7 @@ function avideoWindowIframe(url) {
|
|||
html += '</div>';
|
||||
html += '</div>';
|
||||
$('body').append(html);
|
||||
$("#draggable").draggable({handle: ".panel-heading", containment: "parent"});
|
||||
$("#draggable").draggable({ handle: ".panel-heading", containment: "parent" });
|
||||
//$( "div, p" ).disableSelection();
|
||||
$("#draggable").resizable();
|
||||
}
|
||||
|
@ -1720,7 +1720,7 @@ function avideoModalIframeRemove() {
|
|||
}
|
||||
}
|
||||
|
||||
function json_decode(jsonString){
|
||||
function json_decode(jsonString) {
|
||||
if (typeof jsonString === 'string') {
|
||||
try {
|
||||
return JSON.parse(jsonString);
|
||||
|
@ -1780,7 +1780,7 @@ function avideoTooltip(selector, text) {
|
|||
$(selector).attr('title', text);
|
||||
$(selector).attr('data-toggle', 'tooltip');
|
||||
$(selector).attr('data-original-title', text);
|
||||
$(selector).tooltip({html: true});
|
||||
$(selector).tooltip({ html: true });
|
||||
}
|
||||
|
||||
function fixAdSize() {
|
||||
|
@ -1788,8 +1788,8 @@ function fixAdSize() {
|
|||
if (ad_container.length) {
|
||||
height = ad_container.css('height');
|
||||
width = ad_container.css('width');
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({'height': height});
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({'width': width});
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({ 'height': height });
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({ 'width': width });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2248,7 +2248,7 @@ function readFileCroppie(input, crop) {
|
|||
|
||||
function getCroppie(uploadCropObject, callback, width, height) {
|
||||
//console.log('getCroppie 1', uploadCropObject);
|
||||
var ret = uploadCropObject.croppie('result', {type: 'base64', size: {width: width, height: height}, format: 'png'}).then(function (resp) {
|
||||
var ret = uploadCropObject.croppie('result', { type: 'base64', size: { width: width, height: height }, format: 'png' }).then(function (resp) {
|
||||
////console.log('getCroppie 2 ' + callback, resp);
|
||||
eval(callback + "(resp);");
|
||||
}).catch(function (err) {
|
||||
|
@ -2258,22 +2258,27 @@ function getCroppie(uploadCropObject, callback, width, height) {
|
|||
//console.log('getCroppie 3', ret);
|
||||
}
|
||||
|
||||
let tooltipTimeout = null;
|
||||
|
||||
async function setToolTips() {
|
||||
var selector = '[data-toggle="tooltip"]';
|
||||
if (tooltipTimeout) {
|
||||
clearTimeout(tooltipTimeout);
|
||||
tooltipTimeout = null;
|
||||
}
|
||||
|
||||
tooltipTimeout = setTimeout(function () {
|
||||
const selector = '[data-toggle="tooltip"]';
|
||||
if (!$(selector).not('.alreadyTooltip').length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$(selector).not('.alreadyTooltip').tooltip({container: 'body', html: true});
|
||||
$(selector).not('.alreadyTooltip').tooltip({ container: 'body', html: true });
|
||||
$(selector).not('.alreadyTooltip').on('click', function () {
|
||||
var t = this;
|
||||
setTimeout(function () {
|
||||
const t = this;
|
||||
try {
|
||||
$(t).tooltip('hide');
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}, 2000);
|
||||
} catch (e) { }
|
||||
});
|
||||
$(selector).addClass('alreadyTooltip');
|
||||
} catch (e) {
|
||||
|
@ -2282,7 +2287,7 @@ async function setToolTips() {
|
|||
setToolTips();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function avideoSocketIsActive() {
|
||||
|
@ -2324,7 +2329,7 @@ function changeVideoStatus(videos_id, status) {
|
|||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'objects/videoStatus.json.php',
|
||||
data: {"id": [videos_id], "status": status},
|
||||
data: { "id": [videos_id], "status": status },
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
modal.hidePleaseWait();
|
||||
|
@ -2732,7 +2737,7 @@ function getCursorPos(input) {
|
|||
len++;
|
||||
}
|
||||
rng.setEndPoint("StartToStart", input.createTextRange());
|
||||
for (var pos = {start: 0, end: len}; rng.compareEndPoints("EndToStart", rng) > 0; rng.moveEnd("character", -1)) {
|
||||
for (var pos = { start: 0, end: len }; rng.compareEndPoints("EndToStart", rng) > 0; rng.moveEnd("character", -1)) {
|
||||
pos.start++;
|
||||
pos.end++;
|
||||
}
|
||||
|
@ -2856,7 +2861,7 @@ function addAtMention(selector) {
|
|||
return $('<li>' + item.label + '</li>').appendTo(ul); // customize your HTML
|
||||
};
|
||||
},
|
||||
position: {collision: "flip"}
|
||||
position: { collision: "flip" }
|
||||
});
|
||||
}
|
||||
/*
|
||||
|
@ -3085,7 +3090,7 @@ function cleanHTML(str, nodes) {
|
|||
// Loop through each attribute
|
||||
// If it's dangerous, remove it
|
||||
let atts = elem.attributes;
|
||||
for (let {name, value} of atts) {
|
||||
for (let { name, value } of atts) {
|
||||
if (!isPossiblyDangerous(name, value))
|
||||
continue;
|
||||
elem.removeAttribute(name);
|
||||
|
@ -3206,8 +3211,8 @@ function fixAdSize() {
|
|||
if (ad_container.length) {
|
||||
height = ad_container.css('height');
|
||||
width = ad_container.css('width');
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({'height': height});
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({'width': width});
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({ 'height': height });
|
||||
$($('#mainVideo_ima-ad-container div:first-child')[0]).css({ 'width': width });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3492,7 +3497,7 @@ function passStrengthCheck(selector) {
|
|||
} else {
|
||||
strengthMsg.push('Special chars');
|
||||
}
|
||||
return {strength: strength, strengthMsg: strengthMsg};
|
||||
return { strength: strength, strengthMsg: strengthMsg };
|
||||
}
|
||||
|
||||
function passStrengthCheckInput(selector) {
|
||||
|
@ -3637,7 +3642,7 @@ async function setVideoSuggested(videos_id, isSuggested) {
|
|||
return new Promise((resolve, reject) => {
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'objects/videoSuggest.php',
|
||||
data: {"id": videos_id, "isSuggested": isSuggested},
|
||||
data: { "id": videos_id, "isSuggested": isSuggested },
|
||||
type: 'post',
|
||||
success: function (data) {
|
||||
modal.hidePleaseWait();
|
||||
|
@ -3869,11 +3874,11 @@ async function sendAVideoMobileMessage(type, value) {
|
|||
if (typeof window.flutter_inappwebview !== 'undefined') {
|
||||
//console.log('sendAVideoMobileMessage flutter_inappwebview', typeof window.flutter_inappwebview, window.flutter_inappwebview);
|
||||
if (typeof window.flutter_inappwebview.callHandler == 'function') {
|
||||
response = await window.flutter_inappwebview.callHandler('AVideoMobileLiveStreamer3', {type: type, value: value, instanceIndex: 3});
|
||||
response = await window.flutter_inappwebview.callHandler('AVideoMobileLiveStreamer3', { type: type, value: value, instanceIndex: 3 });
|
||||
console.log('sendAVideoMobileMessage test', response);
|
||||
for (var i = 0; i < 10; i++) {
|
||||
var name = 'AVideoMobileLiveStreamer' + i;
|
||||
response = await window.flutter_inappwebview.callHandler(name, {type: type, value: value, instanceIndex: i});
|
||||
response = await window.flutter_inappwebview.callHandler(name, { type: type, value: value, instanceIndex: i });
|
||||
if (response !== null) {
|
||||
console.log('sendAVideoMobileMessage executed', name, response, type, value);
|
||||
break;
|
||||
|
@ -3889,7 +3894,7 @@ async function sendAVideoMobileMessage(type, value) {
|
|||
}
|
||||
} else {
|
||||
//window.parent.postMessage({type: type, value: value}, '*');
|
||||
window.top.postMessage({type: type, value: value}, '*');
|
||||
window.top.postMessage({ type: type, value: value }, '*');
|
||||
}
|
||||
}
|
||||
window.addEventListener("flutterInAppWebViewPlatformReady", function (event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue