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
|
@ -905,6 +905,8 @@ img.blur {
|
|||
|
||||
#CloseButtonInVideo {
|
||||
display: none;
|
||||
justify-content: center; /* Horizontally centers the content (i.e., the <i> element) */
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
|
@ -912,6 +914,8 @@ img.blur {
|
|||
background-color: rgba(255, 255, 255, 0.5);
|
||||
color: #333;
|
||||
border-radius: 50%;
|
||||
height: 25px;
|
||||
width: 25px;
|
||||
}
|
||||
#CloseButtonInVideo:hover {
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
|
@ -920,7 +924,7 @@ img.blur {
|
|||
.vjs-user-active #CloseButtonInVideo,
|
||||
.vjs-paused #CloseButtonInVideo,
|
||||
body>#CloseButtonInVideo {
|
||||
display: inline-block;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.rightProfile li a {
|
||||
|
|
|
@ -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() {
|
||||
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