MCPcopy Create free account
hub / github.com/MathMan05/Fermi / createWidget

Method createWidget

src/webpage/user.ts:808–835  ·  view source on GitHub ↗
(guild?: Guild)

Source from the content-addressed store, hash-verified

806 guild = this.localuser.guilds.get("@me") as Guild;
807 const div = document.createElement("div");
808 div.classList.add("mutFriends", "flexltr");
809 //TODO make sure this is something I can actually do here
810 const name = document.createElement("b");
811 name.textContent = this.name;
812
813 const nameBox = document.createElement("div");
814 nameBox.classList.add("flexttb");
815 nameBox.append(name);
816 const pfp = this.buildpfp(undefined, div);
817 div.append(pfp, nameBox);
818 Member.resolveMember(this, guild).then((_) => {
819 if (_) {
820 _.subName(name);
821 name.textContent = _.name;
822 (pfp.children[0] as HTMLImageElement).src = _.getpfpsrc();
823 } else if (guild.id !== "@me") {
824 this.subName(name);
825 const notFound = document.createElement("span");
826 notFound.textContent = I18n.webhooks.notFound();
827 nameBox.append(notFound);
828 }
829 });
830 this.bind(div, guild, undefined);
831 return div;
832 }
833 updateStatusSet = new Set<WeakRef<HTMLDivElement>>();
834 contextMap = new WeakMap<HTMLDivElement, Guild | Channel>();
835 localstatusUpdate = () => {};
836 registerStatus(status: HTMLDivElement, thing: Guild | void | Member | null | Channel) {
837 if (thing) {
838 if (thing instanceof Member) {

Callers 6

makeHookFunction · 0.95
createInviteHTMLFunction · 0.95
fullProfileMethod · 0.80
viewReactionsMethod · 0.80
generateTemplateAreaMethod · 0.80
makeHTMLMethod · 0.80

Calls 6

buildpfpMethod · 0.95
subNameMethod · 0.95
bindMethod · 0.95
addMethod · 0.80
resolveMemberMethod · 0.45
getpfpsrcMethod · 0.45

Tested by

no test coverage detected