// textarea_talent.js // RJM Programming // September, 2016 // Help out textarea_talent.html function copyTextareaStyling() { var output = document.getElementById("tarea"), divelem = document.getElementById("tareadiv"); if (divelem) { // thanks to ideas off http://stackoverflow.com/questions/12266320/copy-div-content-to-textarea-or-text-with-the-same-font-family-style 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'); } } function todowithmap() { var showanalert=location.search.split('showalert=')[1] ? decodeURIComponent(location.search.split('showalert=')[1]).split('&')[0] : 'off'; var redcolour=location.search.split('colour=')[1] ? decodeURIComponent(location.search.split('colour=')[1]).split('&')[0] : document.getElementById('colour').value; var redbits, redtolookfor=location.search.split('red=')[1] ? decodeURIComponent(location.search.split('red=')[1]).split('&')[0] : document.getElementById('red').value; var yellowbits, yellowtolookfor=location.search.split('yellow=')[1] ? decodeURIComponent(location.search.split('yellow=')[1]).split('&')[0] : document.getElementById('yellow').value; var greenbits, greentolookfor=location.search.split('green=')[1] ? decodeURIComponent(location.search.split('green=')[1]).split('&')[0] : document.getElementById('green').value; var tih='',imi, jmi, mapp=-1, mi=1, sparer='', i, j, k, bits, maphtml='', postbits, hrefbits, onclickbits, minw, maxw, minh, maxh,mybits='',delim=''; if (showanalert == 'off') { if (document.getElementById('showalert').checked) showanalert = 'on'; } if (rawhtml != '' && mapimg == '') { while (rawhtml.indexOf('+') != -1) { rawhtml=rawhtml.replace('+',' '); } if (redtolookfor != '' || yellowtolookfor != '' || greentolookfor != '') { var ourraw=rawhtml.replace(//g, '>'); while (ourraw.indexOf(String.fromCharCode(10)) != -1) { ourraw=ourraw.replace(String.fromCharCode(10),'
'); } tih='
' + ourraw + '
'; } else { tih=''; } if (redtolookfor != '') { redbits=tih.split(redtolookfor.replace(//g, '>')); tih=redbits[0]; for (var ired=1; ired/g,String.fromCharCode(10)) + ' ... '); tih+='' + redtolookfor.replace(//g, '>') + ''; tih+=redbits[ired]; } } if (yellowtolookfor != '') { yellowbits=tih.split(yellowtolookfor.replace(//g, '>')); tih=yellowbits[0]; for (var iyellow=1; iyellow/g,String.fromCharCode(10)) + ' ... '); tih+='' + yellowtolookfor.replace(//g, '>') + ''; tih+=yellowbits[iyellow]; } } if (greentolookfor != '') { greenbits=tih.split(greentolookfor.replace(//g, '>')); tih=greenbits[0]; for (var igreen=1; igreen/g,String.fromCharCode(10)) + ' ... '); tih+='' + greentolookfor.replace(//g, '>') + ''; tih+=greenbits[igreen]; } } document.getElementById('table_content').innerHTML=tih; copyTextareaStyling(); } }