MaxRom | Scripturi uCoz Romania

Bannerul tau aici
[ Mesaje noi · Membrii · Regulamentul forumului · RSS ]
  • Pagina 1 din 1
  • 1
Selecteaza cod
Devil Date: Luni, 2011-04-25, 11:42 | Message # 1
Mesaje: 425
Awards: 15
« 29 »

In general appareance of forum pages , dupa $BODY$ puneti codu:

Code
<script type="text/javascript">   
// Select Code from phpBB3 to uCoz  
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();}}   
// Selecteaza cod...   
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,'>Cod: <a href="#" onclick="selectCode(this);return false;">Selecteaza cod<\/a><').replace('<!--uzc-->','<!--uzc--><code>').replace('<!--\/uzc-->','<\/code><!--\/uzc-->');   
codediv[i].innerHTML=s;}}   
</script>

Rezultat:


 
Stapanul Date: Joi, 2012-06-14, 12:56 | Message # 2
Mesaje: 17
Awards: 21
« -1 »

Simplu şi folositor. Mulţumesc. 1

 
  • Pagina 1 din 1
  • 1
Căutare: