Sha256: 12b804cb0f25e715af1ee981f7a12146759c56ddd7b66b1f10d9b71311651fe5

Contents?: true

Size: 890 Bytes

Versions: 27

Compression:

Stored size: 890 Bytes

Contents

const UtilCopy = str => {
  const el = document.createElement('textarea');
        el.value = str;
        document.body.appendChild(el);
        el.select();
        document.execCommand('copy');
        document.body.removeChild(el);
}

const UtilShare = e => {
  let ting  = $(e.target).parents(Site.page.share),
      type  = $(ting)[0].classList[2],
      url   = $(ting).children(Site.page.url).text().replace('index',''),
      title = $(ting)[0].children[1],
      tl    = gsap.timeline(),
      reset = '';

      if (type == 'page') {
        reset = 'Copy page';
      }

      UtilCopy(url);

      tl
      .set(title,{text:'Copied!'})
      .to(title,{duration:0.3,opacity:0},'+=0.6')
      .set(title,{text:reset,clearProps:'all'},'+=0.3');
}

if (Config.install != "theme") {
  if (Config.share) {
    $(function(){
      $(Site.page.share).click(UtilShare);
    });
  }
}

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
futuro-0.7.4 assets/js/footer/custom/UtilShare.js
futuro-0.7.3 assets/js/footer/custom/UtilShare.js
futuro-0.7.2 assets/js/footer/custom/UtilShare.js
futuro-0.7.1 assets/js/footer/custom/UtilShare.js
futuro-0.7.0 assets/js/footer/custom/UtilShare.js
futuro-0.6.9 assets/js/footer/custom/UtilShare.js
futuro-0.6.8 assets/js/footer/custom/UtilShare.js
futuro-0.6.7 assets/js/footer/custom/UtilShare.js
futuro-0.6.6 assets/js/footer/custom/UtilShare.js
futuro-0.6.5 assets/js/footer/custom/UtilShare.js
futuro-0.6.4 assets/js/footer/custom/UtilShare.js
futuro-0.6.3 assets/js/footer/custom/UtilShare.js
futuro-0.6.2 assets/js/footer/custom/UtilShare.js
futuro-0.6.1 assets/js/footer/custom/UtilShare.js
futuro-0.6.0 assets/js/footer/custom/UtilShare.js
futuro-0.5.9 assets/js/footer/custom/UtilShare.js
futuro-0.5.8 assets/js/footer/custom/UtilShare.js
futuro-0.5.7 assets/js/footer/custom/UtilShare.js
futuro-0.5.6 assets/js/footer/custom/UtilShare.js
futuro-0.5.5 assets/js/footer/custom/UtilShare.js