": null; const thumbsUpIcon = document.createElement("span"); const thumbsDownIcon = document.createElement("span"); if(hasVoted){ helpful.innerHTML = 'You have already voted for this post.' }else{ thumbsUpIcon.innerHTML = getVotingIcon('thumbs-up') thumbsDownIcon.innerHTML = getVotingIcon('thumbs-down') } thumbsUp.innerHTML = ''; thumbsUp.append(thumbsUpIcon) thumbsDown.innerHTML = ''; thumbsDown.append(thumbsDownIcon) const footer = document.getElementsByClassName("footer")[0] if(footer && helpful){ footerContainer = footer.getElementsByClassName("container")[0] footer.style.backgroundColor = 'white'; footer.style.padding = 0; footerContainer.innerHTML = ''; footerContainer.append(helpful); appendSocialIcons(footerContainer); } } } function appendSocialIcons(footerContainer){ const icon_fb = document.createElement("span"); const icon_ln = document.createElement("span"); const icon_tw = document.createElement("span"); const icon_ws = document.createElement("span"); icon_fb.innerHTML = getVotingIcon('icon-facebook'); icon_fb.setAttribute('onClick', "window.open('https://www.facebook.com/omnilytics')"); icon_ln.innerHTML = getVotingIcon('icon-linkedin'); icon_ln.setAttribute('onClick', "window.open('https://www.linkedin.com/company/omnilyticsco')"); icon_tw.innerHTML = getVotingIcon('icon-twitter') icon_tw.setAttribute('onClick', "window.open('https://twitter.com/omnilyticsco')"); // icon_ws.innerHTML = getVotingIcon('icon-whatsapp') // icon_ws.setAttribute('onClick', "window.open('https://www.linkedin.com/company/omnilyticsco')"); const socialWrapper = document.createElement("div"); socialWrapper.className += " " + 'social-icons'; socialWrapper.append(icon_fb,icon_ln,icon_tw,icon_ws); footerContainer.className += " " + 'helpful-wrapper'; footerContainer.append(socialWrapper); } function getVotingIcon(type,status=''){ return ` ` } function sendToSlack(){ const slack_url = "https://hooks.slack.com/services/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"; const hasUserInfo = false; const userEmail = 'None'; const userRole = 'None'; const userPersona = 'None'; const message = document.getElementById("message").value; if(hasUserInfo || message){ const text = ` Email: ${userEmail} \n Persona: ${userPersona} \n Role: ${userRole} \n Message: ${message || 'None'} \n URL: ${window.location || 'Not available'}`; const attachments = [ { 'title': 'New Feedback \n', 'text': text, 'color': 'warning', } ] const contents = {'channel': '#support-center-feedback', 'attachments': attachments} jQuery.ajax({ type: "POST", url: slack_url, data: JSON.stringify(contents), success: ()=>console.log('done'), dataType: 'application/json' }); } } 