Skip to content
This repository has been archived by the owner on Dec 19, 2020. It is now read-only.

Commit

Permalink
add "set username" button and seperator for both buttons to avoid con…
Browse files Browse the repository at this point in the history
…fusion
  • Loading branch information
TaiAurori committed Jul 25, 2018
1 parent f91979c commit 2b01df1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
8 changes: 8 additions & 0 deletions css/master.css
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,11 @@
#inviteBtn:hover {
background-color: #393939;
}

#usernameBtn {
cursor: pointer;
}

#usernameBtn:hover {
background-color: #393939;
}
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ <h5 id='guildName'>discord-livebot</h5>

<div id='options'>
<input type='text' name='name' value='' placeholder='Username' id='usernameBox' class='optionBox'/>
<input type='button' name='invite' value='Set Username' id='usernameBtn' class='optionBox' onclick="changeUname()"/>
<br>
<hr style="border-color: #676767;">
<br><!--
<input type='number' name='name' value='0' placeholder='Max Uses' id='maxuses-inviteBox' class='optionBox'/>
<input type='number' name='name' value='0' placeholder='Max Age' id='maxage-inviteBox' class='optionBox'/>
<p id="temporaryText" style="margin-left: calc(50% - 40px); margin-bottom: 5px; margin-top: 5px; font-family: Tahoma, Geneva, sans-serif; color: white; font-size: 0.9em">Temporary?: </p>
<input type='checkbox' name='name' value=False placeholder='Username' id='temporary-inviteBox' style=" " class='optionBox'/>-->
<input type='button' name='invite' value='Generate Invite' id='inviteBtn' class='optionBox' onclick="options('invite','')"/>
</div>
</div>
Expand Down
12 changes: 8 additions & 4 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ function create() {
document.getElementById("usernameBox")
.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
options('username', document.getElementById('usernameBox').value);
document.getElementById("usernameBox").value = '';
changeUname()
}
});

Expand Down Expand Up @@ -619,6 +618,11 @@ function typing() {

}

function changeUname() {
options('username', document.getElementById('usernameBox').value);
document.getElementById("usernameBox").value = '';
}

function options(type, content) {
switch(type) {
case 'username':
Expand All @@ -627,8 +631,8 @@ function options(type, content) {
break;

case 'invite':
selectedChan.createInvite().then(invite => {command('Created invite for '+invite.guild.name+' \nhttps://discord.gg/'+invite.code);})

selectedChan.createInvite().then(invite => {command('Created invite for '+invite.guild.name+' \nhttps://discord.gg/'+invite.code);})//options.unique = true, options.temporary = document.getElementById('temporary-inviteBox').value, options.maxUses = document.getElementById('maxuses-inviteBox').value, options.maxAge = document.getElementById('maxage-inviteBox').value).then(invite => {command('Created invite for '+invite.guild.name+' \nhttps://discord.gg/'+invite.code);})
document.getElementById('usernameBox').value
break;
}
}

0 comments on commit 2b01df1

Please sign in to comment.