()
| 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 | ` <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 | } |
no test coverage detected