// emoji_background_text.js // RJM Programming // October, 2018 // Help out emoji_background_text.htm var nexti=2, resti=0, ddsplit; var into='rest '; into = location.search.split('rest=')[1] ? (location.search.split('rest=')[1].split('&')[0] + ' ') : into; var dddsplit=document.head.innerHTML.split("rest="); if (dddsplit.length > 1) { rest=dddsplit[1].split("&")[0].split("'")[0].split('"')[0].split('>')[0] + ' '; } var intoo=null; var incap='dc'; incap = location.search.split('dc=')[1] ? (location.search.split('dc=')[1].split('&')[0] + '') : incap; dddsplit=document.head.innerHTML.split("dc="); if (dddsplit.length > 1) { dc=dddsplit[1].split("&")[0].split("'")[0].split('"')[0].split('>')[0] + ''; } var incapo=null; var intosuffix=''; var cps=['11088','128301','127756','127968','127765','9728.65039', '9986', '128240', '129304']; var lastl=0; if (!String.fromCodePoint) { // thanks to http://xahlee.info/js/js_unicode_code_point.html // ES6 Unicode Shims 0.1 , © 2012 Steven Levithan , MIT License String.fromCodePoint = function fromCodePoint () { var chars = [], point, offset, units, i; for (i = 0; i < arguments.length; ++i) { point = arguments[i]; offset = point - 0x10000; units = point > 0xFFFF ? [0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF)] : [point]; chars.push(String.fromCharCode.apply(null, units)); } return chars.join(""); } } function fixwhatisthere() { var rect, choice, nih='', cid='', fs='', top='', left='', m=0, recttop='', rectleft='', divsuffix='', cmd=''; var fsstop=[], fssleft=[], fssw=[], fssh=[]; var ets=['div','h1','h2','h3','h4','p','span']; var aos, iaos, naos, j, k; for (naos=0; naos 0) { fs=('' + eval(('' + window.getComputedStyle(aos[iaos]).getPropertyValue('font-size')).split('px')[0] / 2 + 0.5)).split('.')[0] + 'px'; rect=aos[iaos].getBoundingClientRect(); fsstop.push(('' + rect.top).replace('px','') + 'px'); fssleft.push(('' + rect.left).replace('px','') + 'px'); fssw.push(('' + rect.width).replace('px','') + 'px'); fssh.push(('' + rect.height).replace('px','') + 'px'); //aos[iaos].style.position='absolute'; //aos[iaos].style.top=('' + rect.top).replace('px','') + 'px'; //aos[iaos].style.left=('' + rect.left).replace('px','') + 'px'; } else if (('' + aos[iaos].id) == incap || (incapo == null && aos[iaos].outerHTML.toLowerCase().replace(/\"/g,'').replace(/\'/g,'').indexOf('contenteditable=true') != -1)) { if (('' + aos[iaos].id) == incap) { incap=incap; } else { incapo=aos[iaos]; if (aos[iaos].outerHTML.toLowerCase().indexOf(' onkeydown=') == -1) { aos[iaos].onkeydown=preaddto; } if (aos[iaos].outerHTML.toLowerCase().indexOf(' onkeypress=') == -1) { aos[iaos].onkeypress=preaddto; } if (('' + aos[iaos].id) != '') { incap=('' + aos[iaos].id) + ' '; } else { incap=' '; } } fs=('' + eval(('' + window.getComputedStyle(aos[iaos]).getPropertyValue('font-size')).split('px')[0] / 2)).split('.')[0] + 'px'; resti=fsstop.length; rect=aos[iaos].getBoundingClientRect(); //alert(rect.top + ' ... ' + rect.height); m++; fsstop.push(('' + rect.top).replace('px','') + 'px'); fssleft.push(('' + rect.left).replace('px','') + 'px'); fssw.push(('' + rect.width).replace('px','') + 'px'); fssh.push(('' + rect.height).replace('px','') + 'px'); var xx=('' + window.getComputedStyle(aos[iaos]).getPropertyValue('font-size')).split('px')[0]; var ix=eval(13 + eval(('' + eval(xx / 2)).split('.')[0])); var iix=0, jjx=0; var thistop=eval(('' + rect.top).replace('px','').split('.')[0]); while (iix < eval('' + eval(('' + rect.height).replace('px','')))) { divsuffix+='
'; //alert(divsuffix); jjx++; iix+=eval('' + ix); thistop+=eval('' + ix); } } else if (('' + aos[iaos].id) == into.trim()) { into=into.trim(); intoo=null; } else if (ets[naos] == 'div' && into.trim() != into) { intoo=aos[iaos]; } } } if (intoo != null && into.trim() != into) { if (intoo.outerHTML.indexOf("opacity:") == -1) { intoo.style.opacity='0.5'; } } for (naos=0; naos 0) { fs=('' + eval(('' + window.getComputedStyle(aos[iaos]).getPropertyValue('font-size')).split('px')[0] / 2 + 0.5)).split('.')[0] + 'px'; //rect=aos[iaos].getClientRects(); //BoundingClientRect(); recttop=fsstop[m]; rectleft=fssleft[m]; //alert(recttop + ' height=' + fssh[m]); m++; nih=''; for (j=0; j' + nih + '
'; } else { document.getElementById(into.trim() + intosuffix).style.fontSize=fs; document.getElementById(into.trim() + intosuffix).innerHTML='' + nih + '
'; } aos[iaos].style.opacity="1.0"; intosuffix='' + nexti; nexti++; } } } //alert(into + intosuffix + ':' + divsuffix); if (intosuffix == '' && intoo != null) { //alert(divsuffix); intoo.innerHTML=divsuffix; } else { document.getElementById(into.trim() + intosuffix).innerHTML=divsuffix; } if (incap.trim() != '' && incap == incap.trim()) { document.getElementById(incap).focus(); } else { incapo.focus(); } } function preaddto() { addto(1); } function addto(mode) { var nih='', choice=0, ix=0, sus='', cmd=''; var dcih; if (incap.trim() != '' && incap == incap.trim()) { dcih=document.getElementById(incap).innerHTML; } else { dcih=incapo.innerHTML; } //document.title=dcih; //if (dcih.indexOf('X') != -1) { alert(dcih); } //
ghjfjhgfjhgf hfgdhgfdhgf
gfdhgfdhgfd hgfdghfdhgfd
gX
dcih=dcih.replace(/\\\<\/div\>/g,'

'); //String.fromCharCode(10)); // huh var dcihs=dcih.split('
1) { //alert('hERE'); for (var ii=eval(-2 + dcihs.length); ii>=0; ii--) { sus=dcihs[ii].split('
')[eval(-1 + dcihs[ii].split('
').length)]; //alert('sus=' + sus); if (1 == 7 && sus != '' && dcih.indexOf('

' + sus + '
') != -1) { dcih=dcih.replace('

' + sus + '
', String.fromCharCode(10) + sus); ii--; } else { dcih=dcih.replace('
' + sus + '
', String.fromCharCode(10) + sus); } } } dcih=dcih.replace(/\<\/div\>\/g,String.fromCharCode(10)).replace(/\/g, ''); // huh if (dcih.replace(/\\\<\/div\>/g,String.fromCharCode(10)).replace(/\/g,'').replace(/\<\/div\>\/g,'').replace(/\<\/div\>/g,'').replace(/ \/g,String.fromCharCode(32)).length == lastl) { lastl=lastl; } else { lastl=dcih.replace(/\\\<\/div\>/g,String.fromCharCode(10)).replace(/\/g,'').replace(/\<\/div\>\/g,'').replace(/\<\/div\>/g,'').replace(/ \/g,String.fromCharCode(32)).length; //if (dcih.indexOf(String.fromCharCode(13)) != -1) { alert(13); } //if (dcih.indexOf(String.fromCharCode(10)) != -1) { alert(10); } //if (dcih.indexOf('
') != -1) { alert('' + mode + ':' + dcih); } for (var j=0; j\\<\/div\>/g,String.fromCharCode(10)).replace(/\/g,'').replace(/\<\/div\>\/g,'').replace(/\<\/div\>/g,'').replace(/ \/g,String.fromCharCode(32)).length; j++) { choice=Math.floor(Math.random() * cps.length); cmd=''; for (k=0; k\\<\/div\>/g,String.fromCharCode(10)).replace(/\/g,'').replace(/\<\/div\>\/g,'').replace(/\<\/div\>/g,'').replace(/ \/g,String.fromCharCode(32)).substring(j, eval(1+j)) == ' ') { if (eval(1 + k) == cps[choice].split('.').length) { nih+=' '; } } else if (dcih.replace(/\\\<\/div\>/g,String.fromCharCode(10)).replace(/\/g,'').replace(/\<\/div\>\/g,'').replace(/\<\/div\>/g,'').replace(/\/g,String.fromCharCode(10)).substring(j, eval(1+j)) == String.fromCharCode(10)) { if (eval(1 + k) == cps[choice].split('.').length) { document.getElementById('eb_' + incap.trim() + ix).innerHTML=nih; //alert('' + mode + ':' + dcih); //alert('here ' + nih); //nih+=String.fromCharCode(10); //'
'; nih=''; ix++; } } else if (dcih.replace(/\\\<\/div\>/g,String.fromCharCode(10)).replace(/\/g,'').replace(/\<\/div\>\/g,'').replace(/\<\/div\>/g,'').replace(/ \/g,String.fromCharCode(32)).substring(j, eval(1+j)) == String.fromCharCode(13)) { if (eval(1 + k) == cps[choice].split('.').length) { document.getElementById('eb_' + incap.trim() + ix).innerHTML=nih; //alert('Here ' + nih); //nih+=String.fromCharCode(10); //'
'; nih=''; ix++; } } else if (cmd == '' && eval(1 + k) == cps[choice].split('.').length) { nih+=String.fromCodePoint(eval('' + cps[choice].split('.')[k])); } else if (eval(1 + k) != cps[choice].split('.').length) { if (cmd == '') { cmd="nih+=String.fromCodePoint(" + eval('' + cps[choice].split('.')[k]) + ")"; } else { cmd=cmd.replace(')', ',' + eval('' + cps[choice].split('.')[k]) + ')'); } } else if (eval(1 + k) == cps[choice].split('.').length) { if (cmd == '') { nih+=String.fromCodePoint(eval('' + cps[choice].split('.')[k])); } else { cmd=cmd.replace(')', ',' + eval('' + cps[choice].split('.')[k]) + ')'); //alert(cmd); eval(cmd); } } } } //if (ix != 0) { document.title=('' + ix + ':' + nih); } document.getElementById('eb_' + incap.trim() + ix).innerHTML=nih; } } setTimeout(fixwhatisthere, 3000);