JS Code used by the script home texture conversion + pasting tool is highly recommended.

Source: Internet
Author: User

<Script language = JavaScript>
<! --
Function symerror ()
{
Return true;
}
Window. onerror = symerror;
// -->
</SCRIPT>

<Script language = javascript1.2>
Function delnull ()
{
VaR STR = Document. getelementbyid ('text'). value;
STR = Str. Replace (/([\ s] * \ r \ n [\ s] *) {2,}/GM, "\ r \ n ");
Document. getelementbyid ('text'). value = STR;
}
Function refix ()
{
VaR STR = Document. getelementbyid ('text'). value;
STR = Str. replace (/([\ s] * \ r \ n [\ s] *) {2,}/GM, "\ r \ n ");
Document. getelementbyid ('text'). value = STR;
}
Function URL ()
{
VaR STR = Document. getelementbyid ('text'). value;
STR = Str. replace (/^ [] * (http: \/| ^ MMS :\/ \/| RTSP :\/ \/| PNM :\/ \/| ftp: \/| mmst: \/| mmsu: \/) ([^ \ r \ n] *) $/IgM, "[url] $1 $2 [/url]");
Document. getelementbyid ('text'). value = STR;
}

Function addbr ()
{
VaR STR = Document. getelementbyid ('text'). value;
STR = Str. Replace (/\ r \ n/GM, "\ r \ n ");
Document. getelementbyid ('text'). value = STR;
}

function html_trans (STR) {
STR = Str. replace (/\ r/g, "");
STR = Str. replace (/on (load | click | dbclick | Mouseover | mousedown | mouseup) = "[^"] + "/ig," ");
STR = Str. replace (/

If (set. Filtrate. Checked)
{< br> STR = Str. Replace (/[^ <] * <([^>] *?)> [^ <] */Ig, "<$1>");
TM = Window. textfield. value;
If (TM. length <1) {
var arr;
arr = Str. match (/] + src = ["]? ([^ "] +) ["]? [^>] *>/Ig);
TM = arr [0]. Replace (/] + src = ["]? ([^ "] +) ["]? [^>] *>/Ig, "$1") + "\" ";
I = TM. search (// [^ \/] + "/ig);
TM = TM. substr (0, I);
window. textfield. value = TM + "/";
}< br> If (TM. substr (TM. length-1, 1 )! = "/") TM + = "/";
var strtm = "] + src = [\"]? ("+ TM +" [^ \ "] +) [\"]? [^>] *> ";
var Re = new Regexp (strtm," ig ");
STR = Str. replace (Re, "\ n [img] $1 [/img] \ n");
}< br> else
{< br> If (set. stext. checked) STR = Str. replace (/[^ <] * <([^>] *?)> [^ <] */Ig, "<$1>");

If (! Set. linka. Checked) STR = Str. Replace (/] + href = ["]? ([^ "] +) ["]? [^>] *> (.*?) <\/A>/ig, "[url = $1] $2 [/url]");
If (! Set. font_color.checked &&! Set. stext. checked)
STR = Str. replace (/] +) color = ([^>] +) ([^>] *)> (. *?) <\/Font>/ig, "[color = $2] $4 [/color]");
If (! Set. font_size.checked &&! Set. stext. checked)
STR = Str. replace (/] +) size = ([^>] +) ([^>] *)> (. *?) <\/Font>/ig, "[size = $2] $4 [/size]");
If (! Set. font_face.checked &&! Set. stext. checked)
STR = Str. replace (/] + face = ([^>] +) [^>] *> (. *?) <\/Font>/ig, "[font = $1] $2 [/font]");
If (! Set. IMG. Checked) STR = Str. Replace (/] + src = ["]? ([^ "] +) ["]? [^>] *>/Ig, "\ n [img] $1 [/img] \ n");

If (! Set. odj. Checked ){
// Return STR;
STR = Str. Replace (/<object [^>] *? 6bf52a52 \-394a \-11d3 \-b153 \-00c04f79faa6 [^>] *?>. * <Param [^>] + name \ s * = \ s * ["] (URL | SRC) ["] [^>] + value = ["]? ([^ "] +) ["] [^>] *>. * <\/Object>/ig, "\ n play a video fileOnline playback

\ N ");
STR = Str. Replace (/<object [^>] *? D27cdb6e \-ae6d \-11cf \-96b8 \-444553540000 [^>] *?>. * <Param [^>] + name \ s * = \ s * ["] (URL | SRC) ["] [^>] + value = ["]? ([^ "] +) ["] [^>] *>. * <\/Object>/ig, "\ nflash AnimationOnline playback

\ N ");
STR = Str. Replace (/<embed [^>] * type = ["]? Application \/x \-Shockwave \-flash ["]? [^>] * Src = ["]? ([^ "| ^] +) ["]? [^>] *>/Ig, "\ nflash AnimationOnline playback

\ N ");
STR = Str. Replace (/<embed [^>] * src = ["]? ([^ "| ^] +) ["]? [^>] * Type = ["]? Application \/x \-Shockwave \-flash ["]? [^>] *>/Ig, "\ nflash AnimationOnline playback

\ N ");
STR = Str. Replace (/<object [^>] *? Cfcdaa03 \-8be4 \-11cf \-b84b \-0020 afbbccfa [^>] *?>. * <Param [^>] + name \ s * = \ s * ["] (URL | SRC) ["] [^>] + value = ["]? ([^ "] +) ["] [^>] *>. * <\/Object>/ig, "\ n play the real video stream FileOnline playback

\ N ");
}
If (! Set. font_ B .checked &&! Set. stext. Checked ){
STR = Str. Replace (/<([\/]?) B>/ig, "[$ 1b]");
STR = Str. Replace (/<([\/]?) Strong>/ig, "[$ 1b]");}
If (! Set. font_u.checked &&! Set. stext. Checked)
STR = Str. Replace (/<([\/]?) U>/ig, "[$ 1u]");
If (! Set. font_ I .checked &&! Set. stext. Checked)
STR = Str. Replace (/<([\/]?) I>/ig, "[$ 1i]");

STR = Str. Replace (// G ,"");
STR = Str. Replace (/&/g ,"&");
STR = Str. Replace (/"/g ,"\"");
STR = Str. Replace (/</g, "<");
STR = Str. Replace (/>/g, "> ");
}
STR = Str. Replace (/<br>/ig, "\ n ");
STR = Str. Replace (/<p [^>] *?> /Ig, "\ n ");
STR = Str. Replace (/<[^>] *?> /G ,"");
STR = Str. replace (/\ [url = ([^ \] +) \] \ n (\ [img \] \ 1 \ [\/IMG \]) \ n \ [\/URL \]/g, "$2 ");
STR = Str. Replace (/\ n +/g, "\ n ");

Return STR;
}
Function copycode (OBJ ){
OBJ. Select ();
Objcopy = obj. createTextRange ();
Objcopy.exe ccommand ("copy ");
}
Function trans (){
VaR STR = "";
RTF. Focus ();
Rtf.doc ument. Body. innerhtml = "";
Rtf.document.exe ccommand ("Paste ");
STR = rtf.doc ument. Body. innerhtml;
If (Str. Length = 0 ){
Alert ("No hypertext data exists in the clipboard! ");
Return "";
}
Return html_trans (STR );
}
Function Preview (){
VaR prewin = Window. Open ("","","");
Prewin.document.write(rtf.doc ument. Body. innerhtml );
}
Function Zhen (STR)
{
Strfound = Str. Replace (// \/ig ,"\\\\");
Strfound = strfound. Replace (// [/ig ,"\\[");
Strfound = strfound. Replace (/\]/ig, "\]");
Strfound = strfound. Replace (// {/ig ,"\\{");
Strfound = strfound. Replace (// \}/ig ,"\\}");
Strfound = strfound. Replace (// |/ig, "\\| ");
Strfound = strfound. Replace (// ig ,"\\/");
Strfound = strfound. Replace (/\ ^/ig, "\ ^ ");
Strfound = strfound. Replace (/\./ig ,"\\.");
Strfound = strfound. Replace (/\ */ig ,"\\*");
Strfound = strfound. Replace (/\? /Ig ,"\\? ");
Strfound = strfound. Replace (// +/ig, "\\+ ");
Return strfound;
}
Function replace_star ()
{
VaR STR = Document. getelementbyid ('text'). value;
If (! Reg. Checked)
Strfound = Zhen (find_text.value );
Else
Strfound = find_text.value;
VaR Re = new Regexp (strfound, "ig ");
STR = Str. Replace (Re, replace_text.value );
Document. getelementbyid ('text'). value = STR;
}
</SCRIPT>

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.