BBSプロジェクトを行っているときは、UBBエディターを使用する必要があります。バックエンドマネージャーは通常、CKEDITORエディターを使用し、ネチズンは通常UBBエディターを使用します。多くの人はUBBエディターについてあまり知りません。以下は、新しいエディターです。編集者は、UBBエディターを簡単に分析します。
<
<html>
<head>
<title> ubb editor </title>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<link href = "style.css" rel = "styleSheet" type = "text/css">
<スクリプト言語= "javascript">
<! -
if(navigator.appname == "Microsoft Internet Explorer")
{
isie = true;
}
それ以外
{
isie = false;
}
関数addText(newcode)
{
if(document.all){
IntersatatCaret(document.ubbform.content、newcode);
document.ubform.content.focus();
}
それ以外
{
document.ubbform.content.value += newcode;
document.ubform.content.focus();
}
}
関数intersatatcaret(textel、text){
if(textel.createTextrange && textel.caretpos)
{
var caretpos = textel.caretpos;
CARETPOS.TEXT += CARETPOS.TEXT.CHARAT(CARETPOS.TEXT.LENGTH -2)== ''?テキスト + '':テキスト;
}
else if(textel)
{
textel.value += text;
}
それ以外
{
textel.value = text;
}
}
関数ubbformat(何)
{
if(document.selection && document.selection.type == "text"))
{
var range = document.selection.createrange();
range.text = "["+what+"]"+range.text+"[/"+what+"]";
}
それ以外
{
txt = window.prompt( "コンテンツを入力してください"、 "");
if(txt!= null){
addtxt = "["+what+"]"+txt;
addtext(addtxt);
addText( "[/"+what+"]");
}
}
}
関数ubbinsert(何)
{
if(document.selection && document.selection.type == "text"))
{
var range = document.selection.createrange();
range.text = "["+what+"]"+range.text+"[/"+what+"]";
}
それ以外
{
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]";
}
それ以外
{
txt = window.prompt( "コンテンツを入力してください"、 "");
if(txt!= null)
{
addtxt = "[size ="+size+"]"+txt;
addtext(addtxt);
addText( "[/size]");
}
}
}
function chfont(font){
if(document.selection && document.selection.type == "text"){
var range = document.selection.createrange();
range.text = "" + range.text + "";
}
それ以外
{
txt = window.prompt( "コンテンツを入力してください"、 "");
if(txt!= null)
{
addtxt = ""+txt;
addtext(addtxt);
addText( "");
}
}
}
関数chcolor(color){
if(document.selection && document.selection.type == "text"){
var range = document.selection.createrange();
range.text = "" + range.text + "";
}
それ以外
{
txt = window.prompt( "コンテンツを入力してください"、 "");
if(txt!= null){
addtxt = ""+txt;
addtext(addtxt);
addText( "");
}
}
}
//->
</script>
</head>
<body>
<form method = post name = "ubbform" action = "">
<table align = "center" border = "0">
<tr>
<td>
<select name = "font" onfocus = "this.selectedIndex = 0" onchange = "chfont(this.options [this.selectedIndex] .value)" size = "1">
<オプション値= "" selected> select font </option>
<オプション値= "宋体"> </option>
<オプション値= "bold"> bold </option>
<オプション値= "arial"> arial </option>
<オプション値= "book antiqua"> book antiqua </option>
<オプション値= "Century Gothic"> Century Gothic </option>
<オプション値= "Courier New"> Courier New </option>
<オプション値= "Georgia"> Georgia </option>
<オプション値= "Impact"> Impact </option>
<オプション値= "tahoma"> tahoma </option>
<オプション値= "Times New Roman"> Times New Roman </option>
<オプション値= "verdana"> verdana </option>
</select>
<select name = "size" onfocus = "this.selectedindex = 0" onchange = "chsize(this.options [this.selectedIndex] .value)" size = "1">
<オプション値= "" selected> font size </option>
<オプション値= "-2"> - 2 </option>
<オプション値= "-1"> - 1 </option>
<オプション値= "1"> 1 </option>
<オプション値= "2"> 2 </option>
<オプション値= "3"> 3 </option>
<オプション値= "4"> 4 </option>
<オプション値= "5"> 5 </option>
<オプション値= "6"> 6 </option>
<オプション値= "7"> 7 </option>
</select>
<select name = "color" onfocus = "this.selectedindex = 0" onchange = "chcolor(this.options [this.selectedindex] .value)" size = "1">
<オプション値= "" selected> font color </option>
<option値= "black" style = "background-color:black; color:black;"> black </option>
<オプション値= "white" style = "background-color:white; color:white;"> white </option>
<オプション値= "red" style = "background-color:red; color:red;"> red </option>
<オプション値= "yellow" style = "background-color:Yellow; color:Yellow;"> Yellow </option>
<オプション値= "pink" style = "background-color:pink; color:pink;"> pink </option>
<オプション値= "green" style = "background-color:green; color:green;"> green </option>
<option値= "orange" style = "background-color:orange; color:orange;"> orange </option>
<オプション値= "purple" style = "background-color:purple; color:purple;"> purple </option>
<オプション値= "blue" style = "background-color:blue; color:blue;"> blue </option>
<オプション値= "Beige" style = "background-color:beige; color:beige;"> beige </option>
<option値= "brown" style = "background-color:brown; color:brown;"> brown </option>
<オプション値= "ティール" style = "background-color:teal; color:teal;"> teal </option>
<option値= "Navy" style = "background-color:navy; color:Navy;"> Navy </option>
<オプション値= "maroon" style = "background-color:maroon; color:maroon;"> maroon </option>
<オプション値= "limegreen" style = "background-color:limegreen; color:limegreen;"> limegreen </option>
</select>
</td>
</tr>
<tr>
<td>
<img src = "ubb/bold.gif" border = "0" alt = "bold" onclick = "ubbformat( 'b')"> <img src = "ubb/italicize.gif" border = "0" alt = "italic" onclick = "ubformat( 'i') alt = "underline" onclick = "ubbformat( 'u')"> <img src = "ubb/center.gif" border "0" "" "" "" "" "" "" "" "onclick =" ubbformat( 'center') "> <img src =" ubb/email.gif "border =" 0 " onclick = "ubbformat( 'email')"> <img src = "ubb/url.gif" border = "alt =" url "onclick =" ubbformat( 'url') "> <img src =" ubb/quote.gif "border =" 0 " src = "ubb/wmv.gif" border = "0" alt = "insert bideo" onclick = "ubbformat( 'media')"> <img src = "ubb/image.gif" border = "0" "" "" "" "" ubbinsert( 'flash')写真 "onclick =" ubbinsert( 'img') ">
</td>
</tr>
<tr>
<td> <textarea name = "content" rows = "10" cols = "80"> </textarea> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
上記は、UBBエディターの内容の簡単な分析です。私はそれがすべての人の学習に役立つことを願っています、そして、私は誰もが間違った新しいテクノロジーチャネルをサポートすることを願っています。