mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
update
This commit is contained in:
parent
60f5cf73b0
commit
9453952faa
2 changed files with 28 additions and 5 deletions
|
@ -1269,6 +1269,16 @@ function avideoAlertAJAX(url) {
|
|||
|
||||
function avideoAlertHTMLText(title, msg, type) {
|
||||
var isErrorOrWarning = (type == 'error' || type == 'warning');
|
||||
var className = "btn btn-primary btn-block";
|
||||
if(type == 'error'){
|
||||
var className = "btn btn-danger btn-block";
|
||||
}else if(type == 'warning'){
|
||||
var className = "btn btn-warning btn-block";
|
||||
}else if(type == 'info'){
|
||||
var className = "btn btn-info btn-block";
|
||||
}else if(type == 'success'){
|
||||
var className = "btn btn-success btn-block";
|
||||
}
|
||||
var span = document.createElement("span");
|
||||
span.innerHTML = msg;
|
||||
swal({
|
||||
|
@ -1279,14 +1289,15 @@ function avideoAlertHTMLText(title, msg, type) {
|
|||
closeOnClickOutside: !isErrorOrWarning,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: "OK", // or whatever text you want
|
||||
text: "OK",
|
||||
value: true,
|
||||
visible: isErrorOrWarning ? false : (empty(type) ? false : true),
|
||||
className: "btn btn-success" // Add your class name here
|
||||
visible: isErrorOrWarning,
|
||||
className: className
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".swal-button--confirm").removeClass("swal-button");
|
||||
$(".swal-button-container").removeClass("swal-button-container");
|
||||
|
||||
}
|
||||
|
||||
|
@ -3906,6 +3917,8 @@ function closeFullscreenVideo() {
|
|||
if (originalURL) {
|
||||
history.pushState({}, null, originalURL);
|
||||
}
|
||||
}else{
|
||||
swal.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3938,7 +3951,13 @@ function addCloseButton(elementToAppend) {
|
|||
closeButton.html('<i class="fas fa-times"></i>');
|
||||
// Add event listener
|
||||
closeButton.on('click', function() {
|
||||
window.parent.closeFullscreenVideo();
|
||||
if (window.self !== window.top) {
|
||||
console.log('close parent iframe');
|
||||
window.parent.closeFullscreenVideo();
|
||||
}else{
|
||||
console.log('close history.back');
|
||||
window.history.back();
|
||||
}
|
||||
});
|
||||
// Append the close button to the Video.js player
|
||||
elementToAppend.append(closeButton);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue