// meld_styles.js // Allow for style mimicing // RJM Programming // October, 2016 var from_o=[]; var from_id=[]; var from_class=[]; var from_type=[]; var from_ih=[]; function ms_docgetclass(inc, intag) { if (document.getElementsByClassName) { return document.getElementsByClassName(inc); } else { var ijl; var anarris=[]; var huhs=document.getElementsByTagName(intag); for (ijl=0; ijl= 1) divelem=divs[0]; //alert('class to found'); } if (!divelem && totype != '') { divs=document.getElementsByTagName(totype); onecnt=divs.length; if (onecnt >= 1) divelem=divs[0]; //alert('type to found'); } if (divelem && output) { // thanks to ideas off http://stackoverflow.com/questions/12266320/copy-div-content-to-textarea-or-text-with-the-same-font-family-style //alert('found'); divelem.style.fontFamily = window.getComputedStyle(output,null).fontFamily || output.style.fontFamily || output.currentStyle.getCurrentProperty('font-family'); divelem.style.fontSize = window.getComputedStyle(output,null).fontSize || output.style.fontSize || output.currentStyle.getCurrentProperty('font-size'); divelem.style.border = window.getComputedStyle(output,null).border || output.style.border || output.currentStyle.getCurrentProperty('border'); divelem.style.padding = window.getComputedStyle(output,null).padding || output.style.padding || output.currentStyle.getCurrentProperty('padding'); divelem.style.margin = window.getComputedStyle(output,null).margin || output.style.margin || output.currentStyle.getCurrentProperty('margin'); divelem.style.overflow = window.getComputedStyle(output,null).overflow || output.style.overflow || output.currentStyle.getCurrentProperty('overflow'); //alert('found code done'); } if (onecnt > 1) { for (ione=1; ione',' ').split(' ')[0]; var afterstype=inih.split(''); if (afterstype.length > 1) { pf=afterstype[1].split('<')[0].replace(String.fromCharCode(10),'').replace(String.fromCharCode(13),''); if (pf != "") { return pf + '<'; } } } return inih; } function lookforvariety() { var htmluptop='
'; var ourih, m_cnt=0, c_i, c_list=[], types_list=";", this_type=""; document.body.innerHTML+=htmluptop; var the_elems=document.getElementsByTagName('*'); for (var jone=0; jone', ' ').split(' ')[0].toLowerCase(); if (the_elems[jone].innerHTML != '' && ourih != '') { if (types_list.indexOf(';' + this_type + ';') == -1) { types_list+=this_type + ';'; //alert(types_list); from_o.push(the_elems[jone]); from_type.push(this_type); from_ih.push(ourih); document.getElementById('s_wyl').innerHTML+=''; m_cnt++; document.getElementById('s_wywt').innerHTML+=''; if (the_elems[jone].id) { if (the_elems[jone].id != "") { document.getElementById('s_wywi').innerHTML+=''; from_id.push(the_elems[jone].id); from_o[eval(-1 + from_o.length)]=the_elems[jone].id; } else { from_id.push(''); } } else { from_id.push(''); } if (the_elems[jone].className) { if (the_elems[jone].className != "") { from_class.push(the_elems[jone].className); c_list=the_elems[jone].className.split(' '); for (c_i=0; c_i' + c_list[c_i] + ''; } } else { from_class.push(''); } } else { from_class.push(''); } } } else if (types_list.indexOf(';' + this_type + ';') == -1) { document.getElementById('s_wywt').innerHTML+=''; types_list+=this_type + ';'; if (the_elems[jone].id) { if (the_elems[jone].id != "") { document.getElementById('s_wywi').innerHTML+=''; from_id.push(the_elems[jone].id); from_o[eval(-1 + from_o.length)]=the_elems[jone].id; } } if (the_elems[jone].className) { if (the_elems[jone].className != "") { from_class.push(the_elems[jone].className); c_list=the_elems[jone].className.split(' '); for (c_i=0; c_i' + c_list[c_i] + ''; } } } } } } } setTimeout(lookforvariety, 1000);