-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (56 loc) · 1.67 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<body>
<p>
Use the Zoom Broom to sweep away the lard from your Zoom invites. Zoom Broom is <a href="https://github.com/bmamlin/zoombroom/">open source</a>.
</p>
<ul>
<li>New: Zoom Broom automatically copies to your clipboard! No need to manually copy the swept invite after pasting.
</ul>
<textarea id="zoomblob" cols=80 rows=5 placeholder="Paste zoom invitation here">
</textarea>
<div id="msg"></div>
<script type="text/javascript">
function sweep(value) {
msg('');
var re = /.*?(https\:\/\/[^\.]+\.zoom\.us\/j\/(\d+[\?=A-Za-z0-9]*)).*?Dial\:\s+([0-9\+\s]+?)\s\(.*|.*?(https\:\/\/[^\.]+\.zoom\.us\/j\/(\d+[\?=A-Za-z0-9]*)).*?One tap mobile\s+([0-9\+,#\s]+).*/s;
if (value == null) {
return '';
}
var match = value.match(re);
if (match) {
msg('Zoom invite swept and already in your clipboard! Paste where needed.');
var response;
if (match[1]) {
response = value.replace(re, "$1\n\n$3,$2#");
} else {
response = value.replace(re, "$4\n\n$6");
}
return response;
}
msg('Pasted text does not appear to be a Zoom inivation. Please try again.');
return value;
}
function msg(msg) {
$('#msg').html(msg);
}
$(document).ready(function() {
msg('Paste your zoom invite above.')
$('#zoomblob').bind('paste', function(e) {
var value = e.originalEvent.clipboardData.getData('text');
value = sweep(value);
setTimeout(
function() {
$('#zoomblob').val(value);
$('#zoomblob').select();
document.execCommand("copy"); // copy to clipboard
}, 1
);
});
$('#zoomblob').focus();
});
</script>
</body>
</html>