Started work on emote panel in admin page.
This commit is contained in:
parent
255e6e0d7f
commit
90d67024b7
8 changed files with 107 additions and 22 deletions
|
|
@ -517,8 +517,57 @@ class adminTokeCommandList{
|
|||
}
|
||||
}
|
||||
|
||||
class adminEmoteList{
|
||||
constructor(){
|
||||
this.linkPrompt = document.querySelector('new-emote-link-input');
|
||||
this.namePrompt = document.querySelector('new-emote-link-input');
|
||||
this.emoteList = document.querySelector('#emote-list');
|
||||
|
||||
this.updateList();
|
||||
}
|
||||
|
||||
async updateList(){
|
||||
const list = await adminUtil.getEmotes();
|
||||
this.renderEmoteList(list);
|
||||
}
|
||||
|
||||
renderEmoteList(list){
|
||||
//Clear the current list
|
||||
this.emoteList.innerHTML = "";
|
||||
|
||||
//For each emote in the list
|
||||
list.forEach((emote) => {
|
||||
const emoteSpan = document.createElement('span');
|
||||
emoteSpan.classList.add('emote-list-emote');
|
||||
|
||||
//If the emote is an image
|
||||
if(emote.type == 'image'){
|
||||
//Create image node
|
||||
var emoteMedia = document.createElement('img');
|
||||
//add link as source
|
||||
emoteMedia.src = emote.link;
|
||||
//if emote is a video
|
||||
}else if(emote.type == 'video'){
|
||||
//create video node
|
||||
var emoteMedia = document.createElement('video');
|
||||
//Add video link
|
||||
emoteMeida.src = emote.link;
|
||||
//Set video properties
|
||||
emoteMedia.autoplay = true;
|
||||
emoteMedia.muted = true;
|
||||
emoteMedia.controls = false;
|
||||
}
|
||||
|
||||
emoteSpan.appendChild(emoteMedia);
|
||||
|
||||
this.emoteList.appendChild(emoteSpan);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const adminUtil = new canopyAdminUtils();
|
||||
const userList = new adminUserList();
|
||||
const permissionList = new adminPermissionList();
|
||||
const userBanList = new adminUserBanList();
|
||||
const tokeCommandList = new adminTokeCommandList();
|
||||
const tokeCommandList = new adminTokeCommandList();
|
||||
const emoteList = new adminEmoteList();
|
||||
Loading…
Add table
Add a link
Reference in a new issue