UNPKG

endpoint-share-api-polyfill

Version:

This is a polyfill for the `Web Share API` that can be used in desktop too, so your users can share in their twitter, facebook, messenger, linkedin, sms, e-mail, print, telegram or whatsapp.

26 lines (23 loc) 671 B
/*global document */ (() => { const source = document.getElementsByClassName('prettyprint source linenums'); let i = 0; let lineNumber = 0; let lineId; let lines; let totalLines; let anchorHash; if (source && source[0]) { anchorHash = document.location.hash.substring(1); lines = source[0].getElementsByTagName('li'); totalLines = lines.length; for (; i < totalLines; i++) { lineNumber++; lineId = `line${lineNumber}`; lines[i].id = lineId; if (lineId === anchorHash) { lines[i].className += ' selected'; } } } })();