Вход Регистрация
Файл: tankon.mobi/js/bbcode.js
Строк: 42
<?php
// JavaScript Document

function savesel(doc)
        {
                if(
document.selection) {                
                        
doc.sel document.selection.createRange().duplicate();
                }               
        }
        function 
click_bb(aid,Open,Close) {
                var 
doc document.getElementById(aid);
                
doc.focus();
                if (
window.attachEvent && navigator.userAgent.indexOf('Opera') === -1) {                                        
                        var 
doc.sel;
                        if(
s){                                  
                                var 
s.text.length;
                                
s.text Open s.text Close;
                                
s.moveEnd("character", -Close.length);
                                
s.moveStart("character", -l);                                           
                                
s.select();                
                        }
                }   else {                                              
                        var 
ss doc.scrollTop;
                        
sel1 doc.value.substr(0doc.selectionStart);
                        
sel2 doc.value.substr(doc.selectionEnd);
                        
sel doc.value.substr(doc.selectionStartdoc.selectionEnd doc.selectionStart);                                              
                        
doc.value sel1 Open sel Close sel2;
                        
doc.selectionStart sel1.length Open.length;
                        
doc.selectionEnd doc.selectionStart sel.length;
                        
doc.scrollTop ss;                                             
                }
                return 
false;
        }



function 
bb_sa(id)
{
// подчеркивание
click_bb(id,'[sa]','[/sa]');
}
?>
Онлайн: 1
Реклама