mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-22 00:11:06 +01:00
Delete index.html
This commit is contained in:
parent
f9e6269f99
commit
fd76dbf571
1 changed files with 0 additions and 65 deletions
|
@ -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>
|
Loading…
Reference in a new issue