Update:
Select All works in Chrome Version 57.0.2987.133 (64-bit)
Stopped working after update to Chrome Version 58.0.3029.96 (64-bit)
Problem: the last parameter to the "setBaseAndExtent" shouldn't be the text length, it should be the child node count.
https://developer.mozilla.org/en-US/...tBaseAndExtent
I'm not versed enough in Javascript enough to fix this properly. What does make this work is by removing the following:
PHP Code:
if (s.setBaseAndExtent)
{
s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
}
else
{
and the } after the else
So the new Javascript in the headinclude is
PHP Code:
<script type="text/javascript">
function selectAll(a)
{
var e = a.parentNode.parentNode.getElementsByTagName('code')[0];
if (window.getSelection)
{
var s = window.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
else if (document.getSelection)
{
var s = document.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
else if (document.selection)
{
var r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
}
</script>
Hope this helps someone.
If there's anyone who can post the correct java solution without removing any code that would be great.
My vB is 4.2.4 btw