mirror of https://github.com/onweru/compose.git

weru
29.24.2020 bb5138484aa1ee7f95e254726e5a8460fa385cbc
temporarily disable marking external urls & log baseurl #10
1 files modified
25 ■■■■ changed files
assets/js/index.js 25 ●●●● patch | view | raw | blame | history
assets/js/index.js
@@ -257,24 +257,25 @@
    
  })();
  (function makeExternalLinks(){
  (function markExternalLinks(){
    let links = elems('a');
    if(links) {
      Array.from(links).forEach(function(link){
      Array.from(links).forEach(function(link, index){
        let target, rel, blank, noopener, attr1, attr2, url, isExternal;
        url = elemAttribute(link, 'href');
        isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !url.startsWith(parentURL) ? true : false;
        if(isExternal) {
          target = 'target';
          rel = 'rel';
          blank = '_blank';
          noopener = 'noopener';
          attr1 = elemAttribute(link, target);
          attr2 = elemAttribute(link, noopener);
        index === 1 ?console.log(parentURL) : false;
        // if(isExternal) {
        //   target = 'target';
        //   rel = 'rel';
        //   blank = '_blank';
        //   noopener = 'noopener';
        //   attr1 = elemAttribute(link, target);
        //   attr2 = elemAttribute(link, noopener);
          attr1 ? false : elemAttribute(link, target, blank);
          attr2 ? false : elemAttribute(link, rel, noopener);
        }
        //   attr1 ? false : elemAttribute(link, target, blank);
        //   attr2 ? false : elemAttribute(link, rel, noopener);
        // }
      });
    }
  })();