The UBB editor was so simple.

Source: Internet
Author: User
UBB <script>
/*
* Function: UBB Edit control function
* Parameters: Tag for tag name Val for label parameters
* Return: [Label name = parameter] decorated text [/tag name]
* [Label name] decorated text [/tag name]
* [Label name = parameter][/label name]
*/
function ubbaction (tag, Val) {
var tag = Tag.touppercase ();
if (typeof (val) = = "undefined") {
val = "";
}
if (val) {
val = "=" + val;
}

var r = Document.selection.createRange (). text;
if (tag = = "URL") {
val = Prompt ("Enter the connection address: (Leave blank for selected address)", "http://");
if (Val!= "http://" && val!= "") {
val = "=" + val;
}else{
val = "";
}
}
if (tag = = "MAIL") {
val = Prompt ("Enter the email address: (leave blank for selected address)", "");
if (Val!= "") {
val = "=" + val;
}
}
rr = "[+ + tag + val +]" + R + "[/" + tag + "]";
if (r) {
Document.selection.createRange (). Text = RR;
}else{
Document.all.content.value + = RR;
}
}
</script>
<form name= "Form1" method= "Post" action= "" >
<input type= "button" Name= "Submit" value= "B" >
<input type= "button" Name= "Submit" value= "I" >
<input type= "button" Name= "Submit" value= "U" >
<select name= ' Ffont ' >
<option value= ' 0 ' >FONT</option>
<option value= ' Arial ' style= ' font-family:arial ' >Arial</option>
<option value= ' Times ' style= ' Font-family:times ' >Times</option>
<option value= ' Courier ' style= ' font-family:courier ' >Courier</option>
<option value= ' Impact ' style= ' font-family:impact ' >Impact</option>
<option value= ' Geneva ' style= ' Font-family:geneva ' >Geneva</option>
<option value= ' Optima ' style= ' Font-family:optima ' >Optima</option>
</select>
<select name= ' fsize ' >
<option value= ' 0 ' >SIZE</option>
<option value= ' 1 ' >Small</option>
<option value= ' 7 ' >Large</option>
<option value= ' >Largest</option>
</select>
<select name= ' Fcolor ' >
<option value= ' 0 ' >COLOR</option>
<option value=black style= "Background-color:black;color:black" >Black</option>
<option value=red style= "background-color:red;color:red" >Red</option>
<option value=yellow style= "Background-color:yellow;color:yellow" >Yellow</option>
<option value=pink style= "Background-color:pink;color:pink" >Pink</option>
<option value=green style= "Background-color:green;color:green" >Green</option>
<option value=orange style= "Background-color:orange;color:orange" >Orange</option>
<option value=purple style= "Background-color:purple;color:purple" >Purple</option>
<option value=blue style= "Background-color:blue;color:blue" >Blue</option>
<option value=beige style= "Background-color:beige;color:beige" >Beige</option>
<option value=brown style= "Background-color:brown;color:brown" >Brown</option>
<option value=teal style= "Background-color:teal;color:teal" >Teal</option>
<option value=navy style= "Background-color:navy;color:navy" >Navy</option>
<option value=maroon style= "Background-color:maroon;color:maroon" >Maroon</option>
<option value=limegreen style= "Background-color:limegreen;color:limegreen" >LimeGreen</option>
</select>
<br>
<input type= "button" Name= "Submit" value= "URL" >
<input type= "button" Name= "Submit" value= "IMG" >
<input type= "button" Name= "Submit" value= "CODE" >
<input type= "button" Name= "Submit" value= "MAIL" >
<input type= "button" Name= "Submit" value= "QUOTE" >
<input type= "button" Name= "Submit" value= "LIST" >
<br>
<textarea name= "Content" cols= "rows=" "8" id= "Content" ></textarea>
<input type= "Submit" name= "Submission" value= "submitted" >
</form>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.