Lorsque nous réalisons des projets BBS, nous devons utiliser l'éditeur UBB. Les gestionnaires backend utilisent généralement l'éditeur CKEditor et les internautes utilisent généralement l'éditeur UBB. Beaucoup de gens ne savent pas grand-chose sur l'éditeur UBB. Ce qui suit est l'erreur nouvelle éditeur. L'éditeur analyse brièvement l'éditeur UBB pour vous.
<! Doctype html public "- // w3c // dtd html 4.01 transitional // en" "'cible = _blank rel = nofollow> http://www.w3.org/tr/html4/loose.dtd">
<html>
<adal>
<Title> UBB Editor </Title>
<meta http-equiv = "content-type" content = "text / html; charset = gb2312">
<link href = "style.css" rel = "Stylesheet" type = "text / css">
<script linguisse = "javascript">
<! -
if (Navigator.appname == "Microsoft Internet Explorer")
{
Isie = true;
}
autre
{
Isie = false;
}
fonction addText (newCode)
{
if (document.all) {
insertAtCaret (document.ubbForm.Content, newCode);
document.ubbform.content.focus ();
}
autre
{
document.ubbform.content.value + = newCode;
document.ubbform.content.focus ();
}
}
fonction insertatcaret (textel, texte) {
if (textel.createTextrange && textel.caretpos)
{
var caretpos = textel.caretpos;
CaretPos.Text + = CaretPos.Text.Charat (Caretpos.Text.length - 2) == ''? Texte + '': texte;
}
else if (textel)
{
textel.value + = texte;
}
autre
{
textel.value = text;
}
}
fonction ubbFormat (quoi)
{
if (document.selection && document.selection.type == "text")
{
var range = document.selection.creareange ();
range.text = "[" + quoi + "]" + range.text + "[/" + quoi + "]";
}
autre
{
txt = window.prompt ("Veuillez entrer le contenu", "");
if (txt! = null) {
Addtxt = "[" + quoi + "]" + txt;
AddText (addtxt);
AddText ("[/" + quoi + "]");
}
}
}
fonction ubbinsert (quoi)
{
if (document.selection && document.selection.type == "text")
{
var range = document.selection.creareange ();
range.text = "[" + quoi + "]" + range.text + "[/" + quoi + "]";
}
autre
{
txt = window.prompt ("Veuillez entrer le contenu", "");
if (txt! = null) {
Addtxt = "[" + quoi + "]" + txt;
AddText (addtxt);
AddText ("[/" + quoi + "]");
}
}
}
fonction chsize (taille) {
if (document.selection && document.selection.type == "text")
{
var range = document.selection.creareange ();
range.text = "[size =" + size + "]" + range.text + "[/ size]";
}
autre
{
txt = window.prompt ("Veuillez entrer le contenu", "");
if (txt! = null)
{
Addtxt = "[size =" + size + "]" + txt;
AddText (addtxt);
AddText ("[/ size]");
}
}
}
fonction chfont (font) {
if (document.selection && document.selection.type == "text") {
var range = document.selection.creareange ();
range.text = "" + range.Text + "";
}
autre
{
txt = window.prompt ("Veuillez entrer le contenu", "");
if (txt! = null)
{
Addtxt = "" + txt;
AddText (addtxt);
AddText ("");
}
}
}
fonction chcolor (couleur) {
if (document.selection && document.selection.type == "text") {
var range = document.selection.creareange ();
range.text = "" + range.Text + "";
}
autre
{
txt = window.prompt ("Veuillez entrer le contenu", "");
if (txt! = null) {
Addtxt = "" + txt;
AddText (addtxt);
AddText ("");
}
}
}
// ->
</cript>
</ head>
<body>
<form metheth = 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">
<Option Value = "" Sélectionné> Sélectionnez Font </ Option>
<Option Value = "宋体"> 宋体 </ Option>
<option value = "bold"> bold </ option>
<option valeur = "Arial"> Arial </opoption>
<Option Value = "Book Antiqua"> Book Antiqua </opoption>
<Option Value = "Century Gothic"> Century Gothic </ Option>
<Option Value = "Courier New"> Courier New </ Option>
<Option Value = "Georgia"> Géorgie </ Option>
<Option Value = "Impact"> Impact </ Option>
<Option Value = "Tahoma"> Tahoma </ Option>
<Option Value = "Times New Roman"> Times New Roman </ Option>
<Option Value = "Verdana"> Verdana </ Option>
</lect>
<select name = "size" onfocus = "this.selectedindex = 0" onchange = "chsize (this.options [this.selectedIndex] .Value)" size = "1">
<Option Value = "" Selected> Taille de police </opoption>
<Option Value = "- 2"> - 2 </ Option>
<Option Value = "- 1"> - 1 </ Option>
<Option Value = "1"> 1 </ Option>
<Option Value = "2"> 2 </ Option>
<Option Value = "3"> 3 </ Option>
<Option Value = "4"> 4 </ Option>
<Option Value = "5"> 5 </ Option>
<Option Value = "6"> 6 </ Option>
<Option Value = "7"> 7 </ Option>
</lect>
<select name = "colore" onfocus = "this.selectedindex = 0" onchange = "chcolor (this.options [this.selectedIndex] .Value)" size = "1">
<Option Value = "" Selected> Couleur de police </opoption>
<Option Value = "Black" Style = "Background-Color: Black; Color: Black;"> Black </ Option>
<Option Value = "White" Style = "Background-Color: White; Couleur: White;"> White </ Option>
<Option Value = "Red" style = "Background-Color: Red; Color: Red;"> Red </ Option>
<Option Value = "Yellow" Style = "Background-Color: Yellow; Color: Yellow;"> Jaune </ Option>
<Option Value = "Pink" style = "Background-Color: Pink; Color: Pink;"> rose </opoption>
<Option Value = "Green" Style = "Background-Color: Green; Couleur: Green;"> Green </ Option>
<Option Value = "Orange" Style = "Background-Color: Orange; Couleur: Orange;"> Orange </opoption>
<Option Value = "Purple" Style = "Background-Color: Purple; Color: Purple;"> Purple </opoption>
<Option Value = "Blue" Style = "Background-Color: Bleu; Couleur: Blue;"> Blue </POTION>
<option value = "beige" style = "background-color: beige; couleur: beige;"> beige </opoption>
<Option Value = "Brown" Style = "Background-Color: Brown; Couleur: Brown;"> Brown </ Option>
<Option Value = "Teal" style = "Background-Color: Teal; Couleur: Teal;"> Teal </ Option>
<option value = "Navy" style = "background-Color: Navy; Color: Navy;"> Navy </ Option>
<Option Value = "Maroon" style = "Background-Color: Maroon; Color: Maroon;"> Maroon </opoption>
<option value = "limegreen" style = "background-color: limegreen; couleur: limegreen;"> limegreen </opoption>
</lect>
</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 = "ubbFormat ('i')"> <img src = "ubb / sous la bord alt = "Underline" onClick = "ubbFormat ('u')"> <img src = "ubb / centr onclick = "ubbFormat ('e-mail')"> <img src = "ubb / url.gif" border = "0" alt = "insérer url" onclick = "ubbformat ('url')"> <img src = "ubb / quote.gif" border = "0" alt = "quote" onclick = "ubbFormat (" '0 "alt =" quote "OnClick =" ubbFormat ("' 0" alt = "Quote" OnClick = "ubbFormat (" '0 "alt =" Quote "OnClick =" UbbFormat ("' 0" Alt = "Quote" OnClick = "UbbFormat (" '0 "Alt =" Quote "OnClick =" UbbFormat ("' 0" Alt = "Quote" OnClick = "UbbFormat ('') src = "ubb / wmv.gif" border = "0" alt = "insert video" onclick = "ubbformat ('media')"> <img src = "ubb / image.gif" border = "0" alt = "insert flash animation" onclick = "ubbinsert ('flash')"> <img src = "ubb / image.gif" border = "0" alt = "insérer l'image" onclick = "ubbinsert ('img')">
</td>
</tr>
<tr>
<Td> <TextArea name = "Content" Rows = "10" Cols = "80"> </ TextArea> </td>
</tr>
<tr>
<td> </td>
</tr>
</ table>
</ form>
</docy>
</html>
Ce qui précède est une brève analyse du contenu de l'éditeur UBB. J'espère que cela sera utile à l'apprentissage de tous, et j'espère que tout le monde soutiendra le mauvais canal de la nouvelle technologie.