Delete index.html

This commit is contained in:
OLIMINATOR 2021-12-21 14:11:04 +01:00 committed by GitHub
parent f9e6269f99
commit fd76dbf571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,65 +0,0 @@
<!DOCTYPE html>
<html>
<body>
Message
<input name="message" id="message"/>
<br/><br/>
Channel Id
<input name="channel" id="channel"/>
<br/><br/>
<button id='addRole'>Add Role</button>
<p id='json'></p>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js'></script>
<script>
let json = {
roles: []
}
$('input').change((e) => {
json[e.currentTarget.id] = e.currentTarget.value;
document.getElementById('json').innerText = JSON.stringify(json);
})
$('button[id=addRole]').click((e) => {
Swal.fire({
title: 'Add Role',
html:
'<input id="swal-input1" class="swal2-input" placeholder="Button Label*" required>' +
'<input id="swal-input2" class="swal2-input" placeholder="Role Id*" required>' +
'<input id="swal-input3" class="swal2-input" placeholder="Emoji">',
preConfirm: function () {
return new Promise(function (resolve) {
resolve([
$('#swal-input1').val(),
$('#swal-input2').val(),
$('#swal-input3').val()
])
})
},
}).then(function (result) {
if (result.value?.[0] && result.value?.[1]) {
json.roles.push({
id: result.value[1],
label: result.value[0],
emoji: result.value[2] || null
})
document.getElementById('json').innerText = JSON.stringify(json);
} else Swal.fire('Missing parameters')
}).catch(swal.noop)
})
$(window).on('load', () => {
$('input').toArray().forEach((i) => i.value = '');
document.getElementById('json').innerText = JSON.stringify(json);
})
</script>
</body>
</html>