function copyLink(page) {
            /**
             * Change the button text to provide the copied feedback.
             */
            const changeButtonText = function create() {
              const span = x$.sel('span', true, x$.sel(`.${pageClass}`));
              /**
               * Set the classes of the button's div elements.
               *
               * @param   {number}  first   A specific array items.
               * @param   {number}  second  A specific array items.
               */
              function setClasses(first, second) {
                x$.cls.a(span[first], spanClass);
                x$.cls.r(span[second], spanClass);
              }

              clearTimeout(buttonDelay);
              setClasses(0, 1);
              buttonDelay = setTimeout(() => {
                setClasses(1, 0);
              }, 700);
            };

            switch (page) {
              case true:
                link = `https://${window.location.href}/`.replace(/notion:\/\//, '');
                changeButtonText();
                x$.clp(false, link);
                break;
              case false:
                const events = ['mousedown', 'mouseup', 'click'];
                x$.sim(events, x$.sel(`.${blockClass}`).nextSibling);
                x$.clp().then((text) => {
                  x$.clp(false, `${text.replace(/(?<=so[\/]).*#/, '')}/`);
                });
                break;
            }
          }
/**
           * Copy the link to the clipboard.
           *
           * @param   {boolean}  page  If the link is the link of the page.
           */
Copy the link to the clipboard.
@param   {boolean}  page  If the link is the link of the page.
Copy the link to the clipboard . @param { boolean } page If the link is the link of the page .
function copyLink(page) {
            const changeButtonText = function create() {
              const span = x$.sel('span', true, x$.sel(`.${pageClass}`));
              function setClasses(first, second) {
                x$.cls.a(span[first], spanClass);
                x$.cls.r(span[second], spanClass);
              }
              clearTimeout(buttonDelay);
              setClasses(0, 1);
              buttonDelay = setTimeout(() => {
                setClasses(1, 0);
              }, 700);
            };
            switch (page) {
              case true:
                link = `https://${window.location.href}/`.replace(/notion:\/\//, '');
                changeButtonText();
                x$.clp(false, link);
                break;
              case false:
                const events = ['mousedown', 'mouseup', 'click'];
                x$.sim(events, x$.sel(`.${blockClass}`).nextSibling);
                x$.clp().then((text) => {
                  x$.clp(false, `${text.replace(/(?<=so[\/]).*#/, '')}/`);
                });
                break;
            }
          }
function copyLink ( page ) { const changeButtonText = function create ( ) { const span = x$ . sel ( 'span' , true , x$ . sel ( ` ${ pageClass } ` ) ) ; function setClasses ( first , second ) { x$ . cls . a ( span [ first ] , spanClass ) ; x$ . cls . r ( span [ second ] , spanClass ) ; } clearTimeout ( buttonDelay ) ; setClasses ( 0 , 1 ) ; buttonDelay = setTimeout ( ( ) => { setClasses ( 1 , 0 ) ; } , 700 ) ; } ; switch ( page ) { case true : link = ` ${ window . location . href } ` . replace ( / notion:\/\/ / , '' ) ; changeButtonText ( ) ; x$ . clp ( false , link ) ; break ; case false : const events = [ 'mousedown' , 'mouseup' , 'click' ] ; x$ . sim ( events , x$ . sel ( ` ${ blockClass } ` ) . nextSibling ) ; x$ . clp ( ) . then ( ( text ) => { x$ . clp ( false , ` ${ text . replace ( / (?<=so[\/]).*# / , '' ) } ` ) ; } ) ; break ; } }
Copy the link to the clipboard.
Copy the link to the clipboard .
/**
             * Change the button text to provide the copied feedback.
             */ /**
               * Set the classes of the button's div elements.
               *
               * @param   {number}  first   A specific array items.
               * @param   {number}  second  A specific array items.
               */