Insert UBB code in Editor

Source: Internet
Author: User

Helpstat = false;
Stprompt = true;
Basic = false;
function Thelp (swtch) {
if (Swtch = = 1) {
Basic = false;
Stprompt = false;
Helpstat = true;
else if (Swtch = 0) {
Helpstat = false;
Stprompt = false;
Basic = true;
else if (Swtch = 2) {
Helpstat = false;
Basic = false;
Stprompt = true;
}
}

function AddText (newcode) {
Document.forms[0].content.value+=newcode;
}

function emails () {


if (Helpstat) {


Alert ("email tag \ n Insert email hyperlink \ usage 1: [email]nobody@domain.com[/email]\n usage 2: [email=nobody@domain.com] anon [/email]");


else if (Basic) {


Addtxt= "[Email][/email]";


AddText (Addtxt);


} else {


Txt2=prompt ("link display text. \ n If empty, then only your Email address," ") will be displayed;


if (txt2!=null) {


Txt=prompt ("Email address.", "name@domain.com");


if (txt!=null) {


if (txt2== "") {


addtxt= "[email]" +txt+ "[/email]";


} else {


addtxt= "[email=" +txt+ "]" +TXT2;


AddText (Addtxt);


Addtxt= "[/email]";


}


AddText (Addtxt);


}


}


}


}

Function Flash () {
  if (helpstat) {
  alert (Flash animation \ n Insert Flash animation. \ n Usage: [Flash]flash The address of the file [/flash] ");
 } else if (Basic) {
  addtxt= "[Flash][/flash]";
  addtext (addtxt);
 } else {                 
  txt=prompt ("Address of the Flash file", "http://");
  if (txt!=null) {            
   addtxt= "[Flash]" +txt;
   addtext (addtxt);
   addtxt= "[/flash]";
   addtext (addtxt);
  }       
 } 
}

Function Cdir () {
  if (helpstat) {
  alert (Shockwave animation \ n Insert Shockwave animation. \ n Usage: [dir= Address of the 500,350]shockwave file [/dir] ");
 } else if (Basic) {
  addtxt= "[Dir][/dir]";
  addtext (addtxt);
 } else {                  
  txt=prompt ("Address of the Shockwave file", "");
  if (txt!=null) {            
   addtxt= "[dir=500,350]" +txt;
   addtext (addtxt);
   addtxt= "[/dir]";
   addtext (addtxt);
  }       
 } 
}

The

Function Crm () {
  if (helpstat) {
  alert ("Real Player file" is inserted into the real Player file. \ n usage: [rm=500 , 350]real player file address [/rm] ");
 } else if (Basic) {
  addtxt= "[Rm][/rm]";
  addtext (addtxt);
 } else {& nbsp;                
  txt=prompt ("The address of the real player file", "");
  if (txt!=null) {            
   addtxt= "[rm=500,350]" +txt;
   addtext (addtxt);
   addtxt= "[/rm]";
   addtext (addtxt);
  }       
 } 
}

Function cwmv () {
  if (helpstat) {
  alert (the Media Player file is inserted into the WMV file. \ n usage: [mp=500,350] Address of Media Player file [/MP] ");
 } else if (Basic) {
  addtxt= "[MP][/MP]";
  addtext (addtxt);
 } else {& nbsp;                
  txt=prompt ("Address of Media Player file", "");
  if (txt!=null) {            
   addtxt= "[mp=500,350]" +txt;
   addtext (addtxt);
   addtxt= "[/MP]";
   addtext (addtxt);
  }       
 } 
}

The

Function Cmov () {
  if (helpstat) {
  alert ("Quick Time file" is inserted into the quick time file. \ n Usage: [qt=500, 350]quick time file's address [/qt] ");
 } else if (Basic) {
  addtxt= "[qt][/qt]";
  addtext (addtxt);
 } else {& nbsp;                
  txt=prompt ("The address of the quick time file", "");
  if (txt!=null) {            
   addtxt= "[qt=500,350]" +txt;
   addtext (addtxt);
   addtxt= "[/qt]";
   addtext (addtxt);
  }       
 } 
}


Function showsize (size) {
 if (helpstat) {
  alert ("Text size mark \ n) sets the text size. \ n Variable range 1-6.\n 1 to minimum 6 to the maximum. \ n usage: [size= "+size+"] This is "+size+" text [/size] ");
 } else if (Basic) {
  addtxt= "[size=" +size+ "][/size]";
  addtext (Addtxt);
& nbsp;} else {                       
  txt=prompt ("Size" +size, "text");
  if (txt!=null) {            
   addtxt= "[size=" +size+ "]" +txt;
   addtext (addtxt);
   addtxt= "[/size]";
   addtext (addtxt);
  }       
 }
}

The

Function Bold () {
 if (helpstat) {
  alert () bold mark \ n makes the text bold. \ n Usage: [b] This is bold text [/b] ");
  else if (Basic) {
  addtxt=] [b][/b];
  addtext (addtxt);
 } else { 
  txt=prompt ("text will be thicker.", "text");    
  if (txt!=null) {           
   addtxt= "[b]" +txt;
    AddText (Addtxt);
   addtxt= "[/b]";
   addtext (addtxt);
  }      
 }
}

Function italicize () {
 if (helpstat) {
  alert (italic tag \ n makes text font italic. \ n Usage: [i] This is italic [i] ");
& nbsp;} else if (Basic) {
  addtxt=] [i][/i];
  addtext (addtxt);
 } else {  
  txt=prompt ("text will be Italic", "text");    
  if (txt!=null) {           
   addtxt= "[i]" +txt;
    AddText (Addtxt);
   addtxt= "[/i]";
   addtext (addtxt);
  }        
 }
}

Function quote () {
 if (helpstat) {
  alert (reference mark \ n references some text. \ n usage: [quote] reference content [/quote]);
& nbsp;} else if (Basic) {
  addtxt=] [quote][/quote];
  addtext (addtxt);
 } else { & nbsp
  txt=prompt ("Quoted text", "text");    
  if (txt!=null) {          
   addtxt= "[quote]" +txt;
    AddText (Addtxt);
   addtxt= "[/quote]";
   addtext (addtxt);
  }        
 }
}

function Showcolor (color) {
if (Helpstat) {
alert (color mark \ n Sets the text color.) Any color name can be used. \ n usage: [color= "+color+"] color to be changed to "+color+" of the text [/color] ");
else if (Basic) {
addtxt= "[color=" +color+ "][/color]";
AddText (Addtxt);
} else {
Txt=prompt ("Selected colors are:" +color, "text");
if (txt!=null) {
addtxt= "[color=" +color+ "]" +txt;
AddText (Addtxt);
Addtxt= "[/color]";
AddText (Addtxt);
}
}
}

Function Center () {


if (Helpstat) {


Alert (using this tag with the alignment tag, you can make the text left-aligned, centered, right-aligned. \ n usage: [align=center|left|right] The text [/align] to align);


else if (Basic) {


Addtxt= "[Align=center|left|right][/align]";


AddText (Addtxt);


} else {


Txt2=prompt ("align style \ n Enter ' center" for center, ' left ' means ' right ', ' right-hand ' means right-aligned. ");


while ((txt2!= "") && (txt2!= "center") && (txt2!= ' left ') && (txt2!= "right") && (txt2!= NULL)) {


Txt2=prompt ("Error!\n type can only be entered ' center ', ' left ' or ' right '." ");


}


Txt=prompt ("Text to align", "text");


if (txt!=null) {


addtxt= "\r[align=" +txt2+ "]" +txt;


AddText (Addtxt);


Addtxt= "[/align]";


AddText (Addtxt);


}


}


}

function hyperlink () {


if (Helpstat) {


Alert ("hyperlink tag \ n Insert a hyperlink tag \ n Use method: [Url]http://www.aspsky.net[/url]\nuse: [url=http://www.aspsky.net] link text [/url]");


else if (Basic) {


Addtxt= "[Url][/url]";


AddText (Addtxt);


} else {


Txt2=prompt ("link text display. \ n If you do not want to use, you can be blank, only the hyperlink address will be displayed." ");


if (txt2!=null) {


Txt=prompt ("hyperlink.", "http://");


if (txt!=null) {


if (txt2== "") {


addtxt= "[url]" +txt;


AddText (Addtxt);


addtxt= "[/url]";


AddText (Addtxt);


} else {


addtxt= "[url=" +txt+ "]" +TXT2;


AddText (Addtxt);


addtxt= "[/url]";


AddText (Addtxt);


}


}


}


}


}

Function image () {
 if (helpstat) {
  alert (picture tag \ n Insert picture \ n usage: [img]yun_qi_img/logo.gif[/img] ");
 } else if (Basic) {
  addtxt= "[img][/img]";
  addtext (addtxt);
 } else {  
  txt=prompt ("URL of Picture", "http://");   
  if (txt!=null) {            
   addtxt= "\r[img]" +txt;
   addtext (Addtxt);
   addtxt= "[/img]";
   addtext (addtxt);
  } 
 }
}

function ShowCode () {
if (Helpstat) {
Alert ("Code tags \ nto use code tags, you can make HTML and other flags in your program code will not be corrupted. \ n Use method: \ n [code] here is the text [/code]");
else if (Basic) {
addtxt= "\r[code]\r[/code]";
AddText (Addtxt);
} else {
Txt=prompt ("Input Code", "");
if (txt!=null) {
addtxt= "\r[code]" +txt;
AddText (Addtxt);
Addtxt= "[/code]";
AddText (Addtxt);
}
}
}

Function List () {


if (Helpstat) {


Alert ("list Mark \ n" Builds a list of text or numbers.) \n\nuse: [List] [*] Project one [/*] [*] Project two [/*] [*] Project three [/*] [/list]];


else if (Basic) {


Addtxt= "[list][*] [/*][*] [/*][*] [/*][/list]";


AddText (Addtxt);


} else {


Txt=prompt ("list type \ n Input ' A ' indicates a sequence table, ' 1 ' indicates an unordered list, leave blank to indicate an unordered list.");


while ((txt!= "") && (txt!= "a") && (txt!= "a") && (txt!= "1") && (Txt!=null)) {


Txt=prompt ("Error!\n type can only be entered ' A ', ' 1 ', or left blank." ");


}


if (txt!=null) {


if (txt== "") {


addtxt= "[List]";


} else {


addtxt= "[list=" +txt+ "]";


}


txt= "1";


while ((txt!= ") && (Txt!=null)) {


Txt=prompt ("list item \ n Blank indicates end list", "");


if (txt!= "") {


addtxt+= "[*]" +txt+ "[/*]";


}


}


addtxt+= "[/list]";


AddText (Addtxt);


}


}


}

function Showfont (font) {


if (Helpstat) {


Alert ("Font mark \ nthe font for text. \ n usage: [face=" +font+ "] Change text font to" +font+ "[/face]);


else if (Basic) {


addtxt= "[face=" +font+ "][/face]";


AddText (Addtxt);


} else {


Txt=prompt ("To set the text of the font" +font, "text");


if (txt!=null) {


addtxt= "[face=" +font+ "]" +txt;


AddText (Addtxt);


Addtxt= "[/face]";


AddText (Addtxt);


}


}


}


function underline () {


if (Helpstat) {


alert (underline \ n) underlines the text. \ n Usage: [u] to underline text [/u] ");


else if (Basic) {


Addtxt= "[u][/u]";


AddText (Addtxt);


} else {


Txt=prompt ("underlined text.", "text");


if (txt!=null) {


Addtxt= "[u]" +txt;


AddText (Addtxt);


Addtxt= "[/u]";


AddText (Addtxt);


}


}


}


function Setfly () {


if (Helpstat) {


Alert ("flight mark \ \ \ \ \ \ \ \ r \ n usage: [fly] text for such a text [/fly]");


else if (Basic) {


Addtxt= "[Fly][/fly]";


AddText (Addtxt);


} else {


Txt=prompt ("Flying words", "words");


if (txt!=null) {


Addtxt= "[Fly]" +txt;


AddText (Addtxt);


Addtxt= "[/fly]";


AddText (Addtxt);


}


}


}

function Move () {
if (Helpstat) {
Alert ("Move the tag \ nthe text produces a move effect. \ n Usage: [move] The text [/move] to which the effect is to be produced");
else if (Basic) {
Addtxt= "[Move][/move]";
AddText (Addtxt);
} else {
Txt=prompt ("text" to produce a moving effect, "text");
if (txt!=null) {
Addtxt= "[Move]" +txt;
AddText (Addtxt);
Addtxt= "[/move]";
AddText (Addtxt);
}
}
}

Function Shadow () {


if (Helpstat) {


Alert ("shadow marks \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ r \ n use: [shadow= width, color, boundary] text [/shadow] to produce a shadow effect");


else if (Basic) {


Addtxt= "[Shadow=255,blue,1][/shadow]";


AddText (Addtxt);


} else {


Txt2=prompt ("Length, color and boundary size of text", "255,blue,1");


if (txt2!=null) {


Txt=prompt ("Text to produce shadow effect", "text");


if (txt!=null) {


if (txt2== "") {


Addtxt= "[shadow=255, Blue, 1]" +txt;


AddText (Addtxt);


Addtxt= "[/shadow]";


AddText (Addtxt);


} else {


addtxt= "[shadow=" +txt2+ "]" +txt;


AddText (Addtxt);


Addtxt= "[/shadow]";


AddText (Addtxt);


}


}


}


}


}

function Glow () {


if (Helpstat) {


Alert ("Halo mark \ nthe text produces a halo effect. \ n Usage: [glow= width, color, boundary] text [/glow] to produce a halo effect");


else if (Basic) {


Addtxt= "[Glow=255,red,2][/glow]";


AddText (Addtxt);


} else {


Txt2=prompt ("Length, color and boundary size of text", "255,red,2");


if (txt2!=null) {


Txt=prompt ("text to produce a halo effect", "text");


if (txt!=null) {


if (txt2== "") {


Addtxt= "[glow=255,red,2]" +txt;


AddText (Addtxt);


Addtxt= "[/glow]";


AddText (Addtxt);


} else {


addtxt= "[glow=" +txt2+ "]" +txt;


AddText (Addtxt);


Addtxt= "[/glow]";


AddText (Addtxt);


}


}


}


}


}

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.