[mirotlaksfu] - swal refactoring

هذا الالتزام موجود في:
Miroslav Pejic
2023-05-26 19:14:44 +02:00
الأصل aac5762b31
التزام 33a2b49bcf
2 ملفات معدلة مع 45 إضافات و133 حذوفات

عرض الملف

@@ -1546,12 +1546,8 @@ function leaveFeedback() {
text: 'Do you want to rate your MiroTalk experience?', text: 'Do you want to rate your MiroTalk experience?',
confirmButtonText: `Yes`, confirmButtonText: `Yes`,
denyButtonText: `No`, denyButtonText: `No`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
openURL(survey.url); openURL(survey.url);
@@ -1812,12 +1808,8 @@ function whiteboardAddObj(type) {
input: 'text', input: 'text',
showCancelButton: true, showCancelButton: true,
confirmButtonText: 'OK', confirmButtonText: 'OK',
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
let wbCanvasImgURL = result.value; let wbCanvasImgURL = result.value;
@@ -1845,12 +1837,8 @@ function whiteboardAddObj(type) {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `OK`, confirmButtonText: `OK`,
denyButtonText: `Cancel`, denyButtonText: `Cancel`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
let wbCanvasImg = result.value; let wbCanvasImg = result.value;
@@ -2047,12 +2035,8 @@ function confirmClearBoard() {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Yes`, confirmButtonText: `Yes`,
denyButtonText: `No`, denyButtonText: `No`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
whiteboardAction(getWhiteboardAction('clear')); whiteboardAction(getWhiteboardAction('clear'));
@@ -2400,11 +2384,7 @@ function showAbout() {
Author: <a id="linkedin-button" data-umami-event="Linkedin button" href="https://www.linkedin.com/in/miroslav-pejic-976a07101/" target="_blank"> Miroslav Pejic</a> Author: <a id="linkedin-button" data-umami-event="Linkedin button" href="https://www.linkedin.com/in/miroslav-pejic-976a07101/" target="_blank"> Miroslav Pejic</a>
</div> </div>
`, `,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}); });
} }

عرض الملف

@@ -717,12 +717,8 @@ class RoomClient {
html: `The Username is already in use. <br/> Please try with another one`, html: `The Username is already in use. <br/> Please try with another one`,
showDenyButton: false, showDenyButton: false,
confirmButtonText: `OK`, confirmButtonText: `OK`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
openURL((window.location.href = '/join/' + this.room_id)); openURL((window.location.href = '/join/' + this.room_id));
@@ -1977,12 +1973,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Yes`, confirmButtonText: `Yes`,
denyButtonText: `No`, denyButtonText: `No`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
startScreenButton.click(); startScreenButton.click();
@@ -2018,9 +2010,9 @@ class RoomClient {
.finally( .finally(
function () { function () {
clean(); clean();
this.event(_EVENTS.exitRoom);
}.bind(this), }.bind(this),
); );
this.event(_EVENTS.exitRoom);
} else { } else {
clean(); clean();
} }
@@ -2289,12 +2281,8 @@ class RoomClient {
icon: type, icon: type,
title: type, title: type,
text: message, text: message,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}); });
break; break;
case 'toast': case 'toast':
@@ -2826,12 +2814,8 @@ class RoomClient {
inputPlaceholder: '💬 Enter your message...', inputPlaceholder: '💬 Enter your message...',
showCancelButton: true, showCancelButton: true,
confirmButtonText: `Send`, confirmButtonText: `Send`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.value) { if (result.value) {
result.value = filterXSS(result.value.trim()); result.value = filterXSS(result.value.trim());
@@ -2955,12 +2939,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Yes`, confirmButtonText: `Yes`,
denyButtonText: `No`, denyButtonText: `No`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
this.getId(id).remove(); this.getId(id).remove();
@@ -3133,12 +3113,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Yes`, confirmButtonText: `Yes`,
denyButtonText: `No`, denyButtonText: `No`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
let msgs = chatMsger.firstChild; let msgs = chatMsger.firstChild;
@@ -3367,12 +3343,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Send`, confirmButtonText: `Send`,
denyButtonText: `Cancel`, denyButtonText: `Cancel`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
this.sendFileInformations(result.value, peer_id, broadcast); this.sendFileInformations(result.value, peer_id, broadcast);
@@ -3590,12 +3562,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Save`, confirmButtonText: `Save`,
denyButtonText: `Cancel`, denyButtonText: `Cancel`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) this.saveBlobToFile(blob, file); if (result.isConfirmed) this.saveBlobToFile(blob, file);
}); });
@@ -3613,12 +3581,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Save`, confirmButtonText: `Save`,
denyButtonText: `Cancel`, denyButtonText: `Cancel`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) this.saveBlobToFile(blob, file); if (result.isConfirmed) this.saveBlobToFile(blob, file);
}); });
@@ -3682,12 +3646,8 @@ class RoomClient {
input: 'text', input: 'text',
showCancelButton: true, showCancelButton: true,
confirmButtonText: `Share`, confirmButtonText: `Share`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.value) { if (result.value) {
result.value = filterXSS(result.value); result.value = filterXSS(result.value);
@@ -3893,12 +3853,8 @@ class RoomClient {
inputPlaceholder: 'Set Room password', inputPlaceholder: 'Set Room password',
confirmButtonText: `OK`, confirmButtonText: `OK`,
denyButtonText: `Cancel`, denyButtonText: `Cancel`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
inputValidator: (pwd) => { inputValidator: (pwd) => {
if (!pwd) return 'Please enter the Room password'; if (!pwd) return 'Please enter the Room password';
this.RoomPassword = pwd; this.RoomPassword = pwd;
@@ -4036,12 +3992,8 @@ class RoomClient {
title: 'Rejected', title: 'Rejected',
text: 'Your join meeting was be rejected by moderator', text: 'Your join meeting was be rejected by moderator',
confirmButtonText: `Ok`, confirmButtonText: `Ok`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
this.exit(); this.exit();
@@ -4181,12 +4133,8 @@ class RoomClient {
input: 'text', input: 'text',
inputPlaceholder: 'Enter the Room password', inputPlaceholder: 'Enter the Room password',
confirmButtonText: `OK`, confirmButtonText: `OK`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
inputValidator: (pwd) => { inputValidator: (pwd) => {
if (!pwd) return 'Please enter the Room password'; if (!pwd) return 'Please enter the Room password';
this.RoomPassword = pwd; this.RoomPassword = pwd;
@@ -4214,12 +4162,8 @@ class RoomClient {
text: 'The room is locked, try with another one.', text: 'The room is locked, try with another one.',
showDenyButton: false, showDenyButton: false,
confirmButtonText: `Ok`, confirmButtonText: `Ok`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) this.exit(); if (result.isConfirmed) this.exit();
}); });
@@ -4238,12 +4182,8 @@ class RoomClient {
text: 'Asking to join meeting...', text: 'Asking to join meeting...',
confirmButtonText: `Ok`, confirmButtonText: `Ok`,
denyButtonText: `Leave room`, denyButtonText: `Leave room`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
control.style.display = 'none'; control.style.display = 'none';
@@ -4467,12 +4407,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Yes`, confirmButtonText: `Yes`,
denyButtonText: `No`, denyButtonText: `No`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}) })
.then((result) => { .then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
@@ -4514,12 +4450,8 @@ class RoomClient {
showDenyButton: true, showDenyButton: true,
confirmButtonText: `Yes`, confirmButtonText: `Yes`,
denyButtonText: `No`, denyButtonText: `No`,
showClass: { showClass: { popup: 'animate__animated animate__fadeInDown' },
popup: 'animate__animated animate__fadeInDown', hideClass: { popup: 'animate__animated animate__fadeOutUp' },
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp',
},
}) })
.then((result) => { .then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {