UBB编辑器(2)


                AddText(AddTxt);
                AddText("[/"+what+"]");
        }       
    } 
}

function ubbInsert(what) 
{
    if (document.selection && document.selection.type == "Text")
    {
        var range = document.selection.createRange();
        range.text = "["+what+"]" + range.text + "[/"+what+"]";
    }
    else
    {
        txt=window.prompt("请输入内容","");     
        if (txt!=null) {           
                AddTxt="["+what+"]"+txt;
                AddText(AddTxt);
                AddText("[/"+what+"]");
        }       
    } 
}

function chsize(size) {
    if (document.selection && document.selection.type == "Text")
    {
        var range = document.selection.createRange();
        range.text = "[size=" + size + "]" + range.text + "[/size]";
    }
    else
    {                       
        txt=window.prompt("请输入内容",""); 
        if (txt!=null)
        {             
            AddTxt="[size="+size+"]"+txt;
            AddText(AddTxt);
            AddText("[/size]");
        }        
    }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3647.html