Цитата rayven (
)
selectCode(a){ var e=a.parentNode.parentNode.getElementsByTagName('code' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> [0];
if(window.getSelection){
var s=window.getSelection();
if(s.setBaseAndExtent){
s.setBaseAndExtent(e,0,e,e.innerText.length-1);
}else{
var r=document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange®;}
}else if(document.getSelection){
var s=document.getSelection();
var r=document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange®;
}else if(document.selection){
var r=document.body.createTextRange();
r.moveToElementText(e);
r.select();}}
// Замена Code на Выделить всё...
codediv=document.getElementsByTagName('div' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> ;
for(i=0;i<codediv.length;i++){
if(codediv.className=="bbCodeBlock"){
s=codediv.innerHTML;
s=s.replace(/>Code</g,'><a href="#" style="color:#fff;" onclick="selectCode(this);return false;">Выделить всё<\/a> (Копировать Ctrl+C)<' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> .replace('<!--uzc-->','<!--uzc--><code>' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> .replace('<!--\/uzc-->','<\/code><!--\/uzc-->' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> ;
codediv.innerHTML=s;}}
</script>
<script type="text/javascript">
$('.codeMessage' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> .each(function(){$(this).html('<a class="Lnk" style="float:right" href="javascript://" onclick="var win=window.open(\'/\' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> ;win.document.body.innerHTML=\'<style>.Lnk {display: none}</style>\'+$(this).parent().html();win.window.stop();"><b>Открыть в новом окне</b></a>' + $(this).html())})
</script>