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

Method malToKiss

src/kitsu/kitsuClass.ts:253–306  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

251 }
252
253 malToKiss() {
254 $(document).ready(() => {
255 con.log('malToKiss');
256 $('.mal_links').remove();
257 const title = this.getTitle();
258
259 activeLinks(this.page!.type, this.page!.apiCacheKey, title).then(links => {
260 let html = '';
261 links.forEach(page => {
262 let tempHtml = '';
263 page.links.forEach(stream => {
264 tempHtml += `
265 <div class="mal_links" style="margin-top: 5px;">
266 <a target="_blank" href="${stream.url}">
267 ${stream.name}
268 </a>
269 </div>`;
270 });
271 html += `
272 <div id="${page.name}Links" class="mal_links library-state with-header" style="
273 background: white;
274 margin-bottom: 15px;
275 border-radius: 3px;
276 display: block;
277 padding: 8px 12px;
278 width: 100%;
279 font-size: 12px;
280 word-break: break-all;
281 ">
282 <img src="${utils.favicon(page.domain)}">
283 <span style="font-weight: 500; line-height: 16px; vertical-align: middle;">${
284 page.name
285 }</span>
286 <span title="${
287 page.name
288 }" class="remove-mal-sync" style="float: right; cursor: pointer;">x</span>
289 ${tempHtml}
290 </div>`;
291 });
292
293 if ($('#mal-sync-search-links').length) {
294 $('#mal-sync-search-links').first().after(j.html(html));
295 } else {
296 $('.media-summary').first().after(j.html(html));
297 }
298
299 $('.remove-mal-sync').click(function () {
300 const key = $(this).attr('title');
301 removeFromOptions(String(key));
302 window.location.reload();
303 });
304 });
305 });
306 }
307
308 async pageRelation() {
309 $('.malsync-rel-link').remove();

Callers 1

initMethod · 0.95

Calls 4

getTitleMethod · 0.95
activeLinksFunction · 0.90
removeFromOptionsFunction · 0.90
removeMethod · 0.80

Tested by

no test coverage detected