function g(){return((1+Math.random())*65536|0).toString(16).substring(1)} function generateUUID(){return g()+g()+"-"+g()+"-"+g()+"-"+g()+"-"+g()+g()+g()} function createTweetIframe(node, url) { // {{{ var existing = node.querySelectorAll("iframe"); if (existing.length === 0) { var iframe = document.createElement('iframe'); iframe.setAttribute('border', '0'); iframe.setAttribute('frameborder', '0'); iframe.setAttribute('height', '250'); iframe.setAttribute('width', '300'); iframe.setAttribute('id', "tweet_" + generateUUID()); iframe.setAttribute('src', 'https://twitframe.com/show?url=' + encodeURIComponent(url) + '&theme=dark') iframe.addEventListener('load', function() { this.contentWindow.postMessage({ element: this.id, query: "height" }, "https://twitframe.com"); }); node.appendChild(iframe); } } // }}} function describeTimeElementDate(element) { // {{{ if (!(element instanceof HTMLTimeElement)) { return "unknown"; } const startYear = element.getAttribute('startyear'); const startMonth = element.getAttribute('startmonth'); const startDay = element.getAttribute('startday'); if (!startYear || !startMonth || !startDay || isNaN(startYear) || isNaN(startMonth) || isNaN(startDay)) { return 'Invalid date attributes on the