[mirotalksfu] - add genRoom UUID4
هذا الالتزام موجود في:
@@ -45,15 +45,13 @@
|
|||||||
<!-- StyleSheet -->
|
<!-- StyleSheet -->
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,600" />
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,600" />
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />
|
||||||
<link rel="stylesheet" href="../css/landing.css" />
|
<link rel="stylesheet" href="../css/landing.css" />
|
||||||
|
|
||||||
<!-- Js scripts -->
|
<!-- Js scripts -->
|
||||||
|
|
||||||
<script src="https://unpkg.com/animejs@3.0.1/lib/anime.min.js"></script>
|
<script src="https://unpkg.com/animejs@3.0.1/lib/anime.min.js"></script>
|
||||||
<script src="https://unpkg.com/scrollreveal@4.0.0/dist/scrollreveal.min.js"></script>
|
<script src="https://unpkg.com/scrollreveal@4.0.0/dist/scrollreveal.min.js"></script>
|
||||||
|
|
||||||
<!-- xss -->
|
|
||||||
|
|
||||||
<script src="https://rawgit.com/leizongmin/js-xss/master/dist/xss.js"></script>
|
<script src="https://rawgit.com/leizongmin/js-xss/master/dist/xss.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="is-boxed has-animations">
|
<body class="is-boxed has-animations">
|
||||||
@@ -127,6 +125,11 @@
|
|||||||
value=""
|
value=""
|
||||||
style="border-radius: 6px"
|
style="border-radius: 6px"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
id="genRoomButton"
|
||||||
|
class="button button-primary br-6 mr-8 mb-8 fas fa-arrows-rotate"
|
||||||
|
onclick="genRoom()"
|
||||||
|
></button>
|
||||||
<button
|
<button
|
||||||
id="joinRoomButton"
|
id="joinRoomButton"
|
||||||
class="button button-primary pulse"
|
class="button button-primary pulse"
|
||||||
@@ -141,9 +144,24 @@
|
|||||||
joinRoom();
|
joinRoom();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
function genRoom() {
|
||||||
|
document.getElementById('roomName').value = getUUID4();
|
||||||
|
}
|
||||||
|
function getUUID4() {
|
||||||
|
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>
|
||||||
|
(
|
||||||
|
c ^
|
||||||
|
(crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))
|
||||||
|
).toString(16),
|
||||||
|
);
|
||||||
|
}
|
||||||
function joinRoom() {
|
function joinRoom() {
|
||||||
let roomName = filterXSS(document.getElementById('roomName').value);
|
const roomName = filterXSS(document.getElementById('roomName').value);
|
||||||
window.location.href = '/join/' + roomName;
|
if (roomName) {
|
||||||
|
window.location.href = '/join/' + roomName;
|
||||||
|
} else {
|
||||||
|
alert('Room name empty!\nPlease pick a room name.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -45,15 +45,13 @@
|
|||||||
<!-- StyleSheet -->
|
<!-- StyleSheet -->
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,600" />
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,600" />
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />
|
||||||
<link rel="stylesheet" href="../css/landing.css" />
|
<link rel="stylesheet" href="../css/landing.css" />
|
||||||
|
|
||||||
<!-- Js scripts -->
|
<!-- Js scripts -->
|
||||||
|
|
||||||
<script src="https://unpkg.com/animejs@3.0.1/lib/anime.min.js"></script>
|
<script src="https://unpkg.com/animejs@3.0.1/lib/anime.min.js"></script>
|
||||||
<script src="https://unpkg.com/scrollreveal@4.0.0/dist/scrollreveal.min.js"></script>
|
<script src="https://unpkg.com/scrollreveal@4.0.0/dist/scrollreveal.min.js"></script>
|
||||||
|
|
||||||
<!-- xss -->
|
|
||||||
|
|
||||||
<script src="https://rawgit.com/leizongmin/js-xss/master/dist/xss.js"></script>
|
<script src="https://rawgit.com/leizongmin/js-xss/master/dist/xss.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="is-boxed has-animations">
|
<body class="is-boxed has-animations">
|
||||||
@@ -126,6 +124,11 @@
|
|||||||
value=""
|
value=""
|
||||||
style="border-radius: 6px"
|
style="border-radius: 6px"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
id="genRoomButton"
|
||||||
|
class="button button-primary br-6 mr-8 mb-8 fas fa-arrows-rotate"
|
||||||
|
onclick="genRoom()"
|
||||||
|
></button>
|
||||||
<button
|
<button
|
||||||
id="joinRoomButton"
|
id="joinRoomButton"
|
||||||
class="button button-primary pulse"
|
class="button button-primary pulse"
|
||||||
@@ -140,9 +143,24 @@
|
|||||||
joinRoom();
|
joinRoom();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
function genRoom() {
|
||||||
|
document.getElementById('roomName').value = getUUID4();
|
||||||
|
}
|
||||||
|
function getUUID4() {
|
||||||
|
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>
|
||||||
|
(
|
||||||
|
c ^
|
||||||
|
(crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))
|
||||||
|
).toString(16),
|
||||||
|
);
|
||||||
|
}
|
||||||
function joinRoom() {
|
function joinRoom() {
|
||||||
let roomName = filterXSS(document.getElementById('roomName').value);
|
const roomName = filterXSS(document.getElementById('roomName').value);
|
||||||
window.location.href = '/join/' + roomName;
|
if (roomName) {
|
||||||
|
window.location.href = '/join/' + roomName;
|
||||||
|
} else {
|
||||||
|
alert('Room name empty!\nPlease pick a room name.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم