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

Function flashm

src/utils/general.ts:539–642  ·  view source on GitHub ↗
(
  text,
  options?: {
    error?: boolean;
    type?: string;
    permanent?: boolean;
    hoverInfo?: boolean;
    position?: 'top' | 'bottom';
    minimized?: boolean;
  },
)

Source from the content-addressed store, hash-verified

537
538// flashm
539export function flashm(
540 text,
541 options?: {
542 error?: boolean;
543 type?: string;
544 permanent?: boolean;
545 hoverInfo?: boolean;
546 position?: 'top' | 'bottom';
547 minimized?: boolean;
548 },
549) {
550 if (!j.$('#flash-div-top').length) {
551 initflashm();
552 }
553 con.log('[Flash] Message:', text);
554
555 let colorF = '#323232';
556 if (typeof options !== 'undefined' && typeof options.error !== 'undefined' && options.error) {
557 colorF = '#3e0808';
558 }
559
560 let flashdiv = '#flash-div-bottom';
561 if (
562 typeof options !== 'undefined' &&
563 typeof options.position !== 'undefined' &&
564 options.position
565 ) {
566 flashdiv = `#flash-div-${options.position}`;
567 }
568
569 let messClass = 'flash';
570 if (typeof options !== 'undefined' && typeof options.type !== 'undefined' && options.type) {
571 const tempClass = `type-${options.type}`;
572 j.$(`${flashdiv} .${tempClass}, #flashinfo-div .${tempClass}`)
573 .removeClass(tempClass)
574 .fadeOut({
575 duration: 1000,
576 queue: false,
577 complete() {
578 j.$(this).remove();
579 },
580 });
581
582 messClass += ` ${tempClass}`;
583 }
584
585 let mess = `<div class="${messClass}" style="display:none;">\
586 <div style="display:table; pointer-events: all; padding: 14px 24px 14px 24px; margin: 0 auto; margin-top: 5px; max-width: 60%; -webkit-border-radius: 20px;-moz-border-radius: 20px;border-radius: 2px;color: white;background:${colorF}; ">\
587 ${text}\
588 </div>\
589 </div>`;
590
591 let flashmEl: JQuery<HTMLElement>;
592
593 if (
594 typeof options !== 'undefined' &&
595 typeof options.hoverInfo !== 'undefined' &&
596 options.hoverInfo

Callers 2

testApiFunction · 0.90
flashConfirmFunction · 0.85

Calls 2

initflashmFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected