Admin Admin
Number of posts : 262 Join date : 08.03.12 Age : 62 Dzīvesvieta : Talsi
| Tēma: Iezīmēt visu kodu kopēšanai Trešdiena Novembris 14, 2012 7:34 am | |
| Ejam uz Customize design » Forum » General Appearance of forum pages un pēc $BODY$ ieliekam šo kodu: - Kods:
-
<script type="text/javascript"> // Select Code from phpBB3 to uCoz ~ http://allcity.net.ru/ function selectCode(a){ var e=a.parentNode.parentNode.getElementsByTagName('code')[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(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();}} // Aizstāt Codeuz iezīmēt visu... codediv=document.getElementsByTagName('div'); for(i=0;i<codediv.length;i++){ if(codediv[i].className=="bbCodeBlock"){ s=codediv[i].innerHTML; s=s.replace(/>Code</g,'>Kods: <a href="#" onclick="selectCode(this);return false;">Iezīmēt visu<\/a><').replace('<!--uzc-->','<!--uzc--><code>').replace('<!--\/uzc-->','<\/code><!--\/uzc-->'); codediv[i].innerHTML=s;}} </script> | |
|