MCPcopy Index your code
hub / github.com/MALSync/MALSync / fillUI

Method fillUI

src/pages-sync/syncPage.ts:719–822  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

717 }
718
719 fillUI() {
720 j.$('.MalLogin').css('display', '');
721 j.$('#AddMalDiv, .malp-group-mal-add, #LoginMalDiv').remove();
722
723 j.$('#malRating').attr('href', this.singleObj.getDisplayUrl());
724
725 if (this.singleObj.getLastError()) {
726 j.$('.MalLogin').css('display', 'none');
727 j.$('#MalData').css('display', 'flex');
728 j.$('#MalInfo').text('');
729 j.$('#malRating').after(
730 j.html(
731 `&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id='LoginMalDiv'>${this.singleObj.getLastErrorMessage()}</span>`,
732 ),
733 );
734 return;
735 }
736
737 let scoreCheckbox = '';
738 this.singleObj.getScoreCheckbox().forEach(el => {
739 scoreCheckbox += `<option value="${el.value}" >${el.label}</option>`;
740 });
741 j.$('#malUserRating').html(j.html(scoreCheckbox));
742
743 let statusCheckbox = '';
744 this.singleObj.getStatusCheckbox().forEach(el => {
745 statusCheckbox += `<option value="${el.value}" >${el.label}</option>`;
746 });
747 j.$('#malStatus').html(j.html(statusCheckbox));
748
749 this.singleObj.getRating().then(rating => {
750 j.$('#malRating').text(rating);
751 });
752
753 if (!this.singleObj.isOnList()) {
754 j.$('.MalLogin').css('display', 'none');
755 j.$('#malRating').after(
756 j.html(
757 `<span id='AddMalDiv'><a href='#' id='AddMal' class="malp-mal-add" onclick='return false;'>${api.storage.lang(
758 'syncPage_malObj_addAnime',
759 [this.singleObj.shortName],
760 )}</a></span>`,
761 ),
762 );
763 j.$('.malp-group-rating').after(
764 j.html(
765 `<span class="malp-group malp-group-mal-add" style="display: none;"><span class="add malp-group-label">_</span><a href='#' id='AddMal' class="malp-group-field malp-mal-add" onclick='return false;'>${api.storage.lang(
766 'syncPage_malObj_addAnime',
767 [this.singleObj.shortName],
768 )}</a></span>`,
769 ),
770 );
771 const This = this;
772 j.$('.malp-mal-add').click(async function (event) {
773 event.preventDefault();
774 if (!This.page.isSyncPage(This.url)) {
775 This.singleObj.setStreamingUrl(This.url);
776 }

Callers 4

constructorMethod · 0.95
handlePageMethod · 0.95
syncHandlingMethod · 0.95
buttonclickMethod · 0.95

Calls 9

calcSelectWidthMethod · 0.95
handleListMethod · 0.95
removeMethod · 0.80
langMethod · 0.80
openCorrectionCheckMethod · 0.80
handlePageMethod · 0.80
syncHandlingMethod · 0.80
errorMethod · 0.80
setStreamingUrlMethod · 0.45

Tested by

no test coverage detected