{"version":3,"file":"social-sharing.js","mappings":";;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB;AACtB;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB,cAAc;AACd;AACA;AACA,aAAa;;AAEb,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;;AAEA,EAAE,EAAE;;AAEJ,CAAC","sources":["webpack://prophet_asia/./src/js/template-tags/social-sharing.js"],"sourcesContent":["(function ($) {\n\n $(function() {\n let bodyElem = document.querySelector('body');\n let socialLink = '';\n let windowUrl = '';\n let windowSize = 'toolbar=0,status=0,width=500,height=500';\n // Share buttons\n let weixinShareBtn = document.querySelector( '.weixin.sharer' );\n let weiboShareBtn = document.querySelector( '.weibo.sharer' );\n let linkedinShareBtn = document.querySelector( '.linkedin.sharer' );\n\n if ( weixinShareBtn ) {\n\n if ( !bodyElem.classList.contains('mobile') ) {\n const siteOrigin = window.location.origin;\n const sitePathname = window.location.pathname;\n const pageURL = siteOrigin + sitePathname;\n\n /**\n * QRCode.js\n * \n * @link https://github.com/davidshimjs/qrcodejs\n */\n let qrCode = new QRCode( weixinShareBtn.parentElement, {\n text: encodeURI( decodeURI( pageURL ) ),\n colorDark : \"#000000\",\n colorLight : \"#ffffff\",\n correctLevel : QRCode.CorrectLevel.H\n });\n\n let qrCodeImg = weixinShareBtn.parentElement.querySelector('img');\n // Hide QRCode on first page load\n qrCodeImg.classList.add('opacity-0');\n\n /**\n * Weixin Share Button Event\n */\n weixinShareBtn.addEventListener( 'click', (evt) => {\n evt.preventDefault();\n let _this = evt.currentTarget;\n\n // Show/Hide the QRCode\n if ( qrCodeImg.classList.contains('active') ) {\n qrCodeImg.classList.remove('active');\n _this.parentElement.classList.remove('active');\n\n } else {\n qrCodeImg.classList.add('active');\n _this.parentElement.classList.add('active');\n }// if - else\n });\n\n } else {\n // Hide Weixin share button on mobile\n weixinShareBtn.parentElement.classList.add('!hidden');\n }// if - else\n\n }// if\n\n if ( weiboShareBtn ) {\n /**\n * Weibo Share Button Event\n */\n weiboShareBtn.addEventListener( 'click', (evt) => {\n evt.preventDefault();\n\n // console.log(postProps);\n socialLink = 'http://service.weibo.com/share/share.php?url='+ postProps.url + '&title=' + postProps.title + '&pic=' + postProps.image + '&language=zh_cn';\n window.open(socialLink, '', windowSize);\n });\n }// if\n\n if ( linkedinShareBtn ) {\n /**\n * Linkedin Share Button Event\n */\n linkedinShareBtn.addEventListener( 'click', (evt) => {\n evt.preventDefault();\n\n // console.log(postProps);\n socialLink = 'https://www.linkedin.com/shareArticle?url='+postProps.url+'&mini=true&title='+postProps.title+'&summary='+postProps.excerpt;\n window.open(socialLink, '', windowSize);\n });\n }// if\n\n // if ( $(this).hasClass('email') ){\n // socialLink = 'mailto:user@example.com?subject='+ postProps.title +'&body=' + postProps.excerpt;\n // window.open(socialLink, '', windowSize)\n // }\n\n\t});// ready\n\n})(jQuery);\n"],"names":[],"sourceRoot":""}