[mirotalk] - add share room button and improve input validation to login page
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
# ====================================================
|
# ====================================================
|
||||||
# MiroTalk P2P v.1.7.54 - Environment Configuration
|
# MiroTalk P2P v.1.7.55 - Environment Configuration
|
||||||
# ====================================================
|
# ====================================================
|
||||||
|
|
||||||
# App environment
|
# App environment
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ==============================================
|
* ==============================================
|
||||||
* MiroTalk P2P v.1.7.54 - Configuration File
|
* MiroTalk P2P v.1.7.55 - Configuration File
|
||||||
* ==============================================
|
* ==============================================
|
||||||
*
|
*
|
||||||
* This file is the central configuration source.
|
* This file is the central configuration source.
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ dependencies: {
|
|||||||
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.7.54
|
* @version 1.7.55
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalk",
|
"name": "mirotalk",
|
||||||
"version": "1.7.54",
|
"version": "1.7.55",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mirotalk",
|
"name": "mirotalk",
|
||||||
"version": "1.7.54",
|
"version": "1.7.55",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mattermost/client": "11.4.0",
|
"@mattermost/client": "11.4.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalk",
|
"name": "mirotalk",
|
||||||
"version": "1.7.54",
|
"version": "1.7.55",
|
||||||
"description": "A free WebRTC browser-based video call",
|
"description": "A free WebRTC browser-based video call",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -213,6 +213,24 @@
|
|||||||
background-color: rgba(255, 255, 255, 0.1);
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login-card .share-room-btn {
|
||||||
|
padding: 0 14px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #f9faff;
|
||||||
|
background: rgba(255, 255, 255, 0.06);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
flex-shrink: 0;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s ease,
|
||||||
|
background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
.login-card .share-room-btn:hover {
|
||||||
|
border-color: rgba(70, 120, 249, 0.4);
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
.login-card .join-room-btn {
|
.login-card .join-room-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
|
|||||||
+1
-1
@@ -107,7 +107,7 @@ let brand = {
|
|||||||
},
|
},
|
||||||
about: {
|
about: {
|
||||||
imageUrl: '../images/mirotalk-logo.gif',
|
imageUrl: '../images/mirotalk-logo.gif',
|
||||||
title: 'WebRTC P2P v1.7.54',
|
title: 'WebRTC P2P v1.7.55',
|
||||||
html: `
|
html: `
|
||||||
<button
|
<button
|
||||||
id="support-button"
|
id="support-button"
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@
|
|||||||
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
||||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||||
* @version 1.7.54
|
* @version 1.7.55
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -13738,7 +13738,7 @@ function showAbout() {
|
|||||||
Swal.fire({
|
Swal.fire({
|
||||||
background: swBg,
|
background: swBg,
|
||||||
position: 'center',
|
position: 'center',
|
||||||
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.7.54',
|
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.7.55',
|
||||||
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
|
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
|
||||||
customClass: { image: 'img-about' },
|
customClass: { image: 'img-about' },
|
||||||
html: `
|
html: `
|
||||||
|
|||||||
+34
-1
@@ -10,6 +10,7 @@ const joinRoomForm = document.getElementById('joinRoomForm');
|
|||||||
const roomNameInput = document.getElementById('roomName');
|
const roomNameInput = document.getElementById('roomName');
|
||||||
const joinSelectRoomButton = document.getElementById('joinSelectRoomButton');
|
const joinSelectRoomButton = document.getElementById('joinSelectRoomButton');
|
||||||
const randomRoomButton = document.getElementById('randomRoomButton');
|
const randomRoomButton = document.getElementById('randomRoomButton');
|
||||||
|
const shareRoomButton = document.getElementById('shareRoomButton');
|
||||||
|
|
||||||
usernameInput.onkeyup = (e) => {
|
usernameInput.onkeyup = (e) => {
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
@@ -120,6 +121,15 @@ function highlightEmpty(input) {
|
|||||||
},
|
},
|
||||||
{ once: true }
|
{ once: true }
|
||||||
);
|
);
|
||||||
|
document.addEventListener(
|
||||||
|
'mousedown',
|
||||||
|
function (e) {
|
||||||
|
if (e.target !== input) {
|
||||||
|
input.classList.remove('input-error');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ once: true }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoginError(msg) {
|
function showLoginError(msg) {
|
||||||
@@ -149,7 +159,7 @@ function showJoinRoomForm() {
|
|||||||
const room = roomNameInput ? filterXSS(roomNameInput.value.trim()) : '';
|
const room = roomNameInput ? filterXSS(roomNameInput.value.trim()) : '';
|
||||||
const name = filterXSS(document.getElementById('username').value).trim();
|
const name = filterXSS(document.getElementById('username').value).trim();
|
||||||
if (!room) {
|
if (!room) {
|
||||||
popup('warning', 'Room Name required');
|
highlightEmpty(roomNameInput);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.location.href =
|
window.location.href =
|
||||||
@@ -176,6 +186,29 @@ function showJoinRoomForm() {
|
|||||||
if (roomNameInput) roomNameInput.value = getUUID4();
|
if (roomNameInput) roomNameInput.value = getUUID4();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (shareRoomButton) {
|
||||||
|
shareRoomButton.onclick = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
const room = roomNameInput ? filterXSS(roomNameInput.value.trim()) : '';
|
||||||
|
if (!room) {
|
||||||
|
highlightEmpty(roomNameInput);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const shareUrl = window.location.origin + '/join/' + encodeURIComponent(room);
|
||||||
|
if (navigator.share) {
|
||||||
|
navigator.share({ title: 'MiroTalk Room', url: shareUrl }).catch(() => {});
|
||||||
|
} else {
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(shareUrl)
|
||||||
|
.then(() => {
|
||||||
|
popup('success', 'Room link copied to clipboard');
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
popup('error', 'Failed to copy link');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
if (joinSelectRoomButton) {
|
if (joinSelectRoomButton) {
|
||||||
joinSelectRoomButton.onclick = (e) => {
|
joinSelectRoomButton.onclick = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -147,6 +147,13 @@
|
|||||||
>
|
>
|
||||||
<i class="fa-solid fa-arrows-rotate" aria-hidden="true"></i>
|
<i class="fa-solid fa-arrows-rotate" aria-hidden="true"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
id="shareRoomButton"
|
||||||
|
class="share-room-btn"
|
||||||
|
title="Share room link"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-share-nodes" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button id="joinSelectRoomButton" class="join-room-btn">
|
<button id="joinSelectRoomButton" class="join-room-btn">
|
||||||
<i class="fa-solid fa-right-to-bracket"></i>
|
<i class="fa-solid fa-right-to-bracket"></i>
|
||||||
|
|||||||
Reference in New Issue
Block a user