Seperated the name and discrim in the embed footer

This commit is contained in:
Jeremy Zhang 2017-05-24 04:42:01 +00:00
parent 566a4d4be1
commit 029bcff59d
2 changed files with 9 additions and 4 deletions

View File

@ -16,6 +16,7 @@
var times_fetched = 0; // kept track of how many times that it has fetched
var fetch_error_count = 0; // Number of errors fetch has encountered
var priority_query_guild = false; // So you have selected a channel? Let's populate it.
var current_username_discrim; // Current username/discrim pair, eg EndenDraogn#4151
function element_in_view(element, fullyInView) {
var pageTop = $(window).scrollTop();
@ -371,7 +372,7 @@
function handle_last_message_mention() {
var lastmsg = $("#chatcontent p:last-child");
var content = lastmsg.text().toLowerCase();
var username_discrim = $("#currentusername").text().toLowerCase();
var username_discrim = current_username_discrim.toLowerCase();
if (content.includes("@everyone") || content.includes("@" + username_discrim)) {
lastmsg.css( "color", "#ff5252" );
lastmsg.css( "font-weight", "bold" );
@ -497,10 +498,14 @@
if (authenticated) {
$("#currentuserimage").show();
$("#currentuserimage").attr("src", avatar);
$("#currentusername").text(username + "#" + discrim);
$("#curuser_name").text(username);
$("#curuser_discrim").text("#" + discrim);
current_username_discrim = username + "#" + discrim;
} else {
$("#currentuserimage").hide();
$("#currentusername").text(username + "#" + userid);
$("#curuser_name").text(username);
$("#curuser_discrim").text("#" + userid);
current_username_discrim = username + "#" + userid;
}
}

View File

@ -118,7 +118,7 @@
<div id="footercontainer" class="footercontainer">
<div class="currentuserchip left" id="nameplate">
<div class="left"><img id="currentuserimage" src="" class="circle left currentuserimage" style="display: none;"></div>
<div id="currentusername" class="currentusername left">Titan#0001</div>
<div id="currentusername" class="currentusername left"><span id="curuser_name">Titan</span><span id="curuser_discrim">#0001</span></div>
</div>
<div id="messageboxouter" class="input-field inline"><textarea placeholder="Enter message" id="messagebox" type="text" class="materialize-textarea" rows="1"></textarea></div>
</div>