22,29d21 < var tablemode=''; < var selem=''; < var goThrough=0; < var img1, img2, img5, div5; < < var elem=null; < var context; < var cf = "16px Verdana"; //Courier New"; 37,40d28 < var suff=''; < if (tablemode != '' && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { < suff=' Please note sometimes it is good to double click Email Table button for clipboard copy to register in email body section.'; < } 43c31 < if (eee == '') { eee=prompt('Email address (best converted later at email into its Fixed Width font)?' + suff, lastemail); } --- > if (eee == '') { eee=prompt('Email address (best converted later at email into its Fixed Width font)?', lastemail); } 46c34 < if (eee == '') { eee=prompt('Email address (and once in email paste content into its body section before clicking its Send button, as best seen with its Fixed Width font)?' + suff, lastemail); } --- > if (eee == '') { eee=prompt('Email address (and once in email paste content into its body section before clicking its Send button, as best seen with its Fixed Width font)?', lastemail); } 114,115d101 < document.getElementById('mycemail').style.display='inline-block'; < //document.getElementById('mycsms').style.display='inline-block'; 136,138d121 < if (tablemode != '') { < tabletocanvas(tablemode); < } else { 140d122 < } 145,293d126 < function SelectText(element) { // thanks to https://stackoverflow.com/questions/27863617/is-it-possible-to-copy-a-canvas-image-to-the-clipboard < var doc = document; < if (doc.body.createTextRange) { < var range = document.body.createTextRange(); < range.moveToElementText(element); < range.select(); < } else if (window.getSelection) { < var selection = window.getSelection(); < var range = document.createRange(); < range.selectNodeContents(element); < selection.removeAllRanges(); < selection.addRange(range); < } < } < < < function tabletocanvas(str) { // thanks to https://stackoverflow.com/questions/27863617/is-it-possible-to-copy-a-canvas-image-to-the-clipboard < document.getElementById('divaemail').innerHTML=str; < var acell; < var rect=document.getElementById('divaemail').getBoundingClientRect(); < document.getElementById('divaemail').innerHTML+=''; < elem=document.getElementById('mycanvas'); < context=elem.getContext("2d"); < //context.strokeRect(0, 0, rect.width, rect.height); < var iths, ths=document.getElementsByTagName('th'); < for (iths=0; iths= 0) { < //alert('Rect.top=' + Math.round(rect.top) + ' and eval(acell.top - rect.top)=' + Math.round(eval(acell.top - rect.top)) + ' for text=' + ths[iths].innerHTML); < context.strokeStyle='#ff0000'; < context.strokeRect(Math.round(eval(acell.left - rect.left)), Math.round(eval(acell.top - rect.top)), acell.width, acell.height); < context.strokeStyle='#000000'; < context.font = cf; < context.strokeText(ths[iths].innerHTML, Math.round(eval(acell.left - rect.left + 5)), Math.round(eval(acell.top - rect.top + acell.height / 1.5))); < } < } < } < var itds, tds=document.getElementsByTagName('td'); < for (itds=0; itds= 0) { < //alert('rect.top=' + Math.round(rect.top) + ' and eval(acell.top - rect.top)=' + Math.round(eval(acell.top - rect.top)) + ' for text=' + tds[itds].innerHTML); < context.strokeStyle='#0000ff'; < context.strokeRect(Math.round(eval(acell.left - rect.left)), Math.round(eval(acell.top - rect.top)), acell.width, acell.height); < context.strokeStyle='#000000'; < context.font = cf; < context.strokeText(tds[itds].innerHTML, Math.round(eval(acell.left - rect.left + 5)), Math.round(eval(acell.top - rect.top + + acell.height / 1.5))); < } < } < } < selem=elem.toDataURL(); < if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) || 1 == 1) { < tabletoclipboard(elem); < } else if (1 == 2) { < table_to_clipboard(); < } < //setTimeout(table_to_clipboard, 2000); < //document.getElementById('divaemail').innerHTML=''; < } < < < function preload() { < if (goThrough == 1) { < goThrough = 0; < img1 = document.createElement('img'); < img1.onload = function() { goThrough=2; }; < img1.src = selem; < } < if (goThrough == 2) { < goThrough = 0; < img2 = document.createElement('img'); < img2.onload = function() { goThrough=3; }; < img2.src = selem; < } < if (goThrough < 3) { < preload(); < } < } < < < function table_to_clipboard() { // thanks to https://stackoverflow.com/questions/27863617/is-it-possible-to-copy-a-canvas-image-to-the-clipboard < < //goThrough = 1; < //preload(); < < var img = document.createElement('img'); < < img.onload = function() { < var div = document.createElement('div'); < div.contentEditable = true; < div.appendChild(img); < document.body.appendChild(div); < < // do copy < SelectText(div); < document.execCommand('Copy'); < document.body.removeChild(div); < //alert(675); < setTimeout(athn, 1000); //top.location.href=ao.href; //document.getElementById('myaemail').click(); //top.location.href=ao.href; < }; < < img.src = selem; //canvas.toDataURL(); < < } < < function athn() { < if (tablemode != '') { < top.location.href=ao.href; //document.getElementById('myaemail').click(); //top.location.href=ao.href; < } else { < ao.click(); < } < document.getElementById('divaemail').innerHTML=''; < } < < function tabletoclipboard(canvas) { // thanks to https://stackoverflow.com/questions/27863617/is-it-possible-to-copy-a-canvas-image-to-the-clipboard < img5 = document.createElement('img'); < < if (1 == 2) { < img5.onload = function() { < div5 = document.createElement('div'); < div5.contentEditable = true; < div5.appendChild(img5); < document.body.appendChild(div5); < < // do copy < SelectText(div5); < document.execCommand('Copy'); < document.body.removeChild(div5); < setTimeout(athn, 1000); //top.location.href=ao.href; //document.getElementById('myaemail').click(); //top.location.href=ao.href; < }; < } < < img5.src = canvas.toDataURL(); < < if (2 == 2) { < div5 = document.createElement('div'); < div5.contentEditable = true; < div5.appendChild(img5); < document.body.appendChild(div5); < < // do copy < SelectText(div5); < document.execCommand('Copy'); < document.body.removeChild(div5); < } < } < 309,318d141 < if (tablemode.indexOf('') != -1) { < if (inleft.indexOf('----') == -1) { < if (tablemode.indexOf('','' + inleft + '' + inright + ''); < } else { < tablemode=tablemode.replace('','' + inleft + '' + inright + ''); < } < retrec=tablemode; < } < } else { 341d163 < } 455c277 < 654c476 <
 
 
--- >


663c485 < --- > \ No newline at end of file