Script-Fantasy Studio to use JS, super strong recommended Expand.js_javascript skills

Source: Internet
Author: User
Tags eval tagname
Copy Code code as follows:

function Createdlg (dlgid,title,w,h,issetpos) {
var L,i,p,dlg
if ($ (dlgid)!=null)
$ (dlgid). outerhtml= ""
$sys. Dlgdepth= ($sys. dlgdepth| | 9000)
L= "<div id= '" +dlgid+ "' Style=position:absolute;z-index:" + $sys. dlgdepth+ "; Left:" + (document.body.clientwidth/2- W/2) + "; Top:" + (Document.body.clientheight/2-h/2+document.body.scrolltop) + "; width:" +w+ "; Height:" +h+ ">"
l+= "<table Onmousedown=focudlg (this.parentnode) cellpadding=0 cellspacing=0 width=100% height=100% style=position :absolute> "
for (i=0;i<3;i++) {
P=i==0? " T ":(i==1?" M ":" B ")
l+= "<tr" + (i!=1?) Height=1 ":" ") +" ><td><table cellpadding=0 cellspacing=0 width=100% "+ (i==1?) height=100% ":" ") +" ><tr> "
l+= "<td width=1 style= '" +GETPNGBG ("Images/panel/dlg_" +p+ "_l.png") + "' ></td> '
l+= "<td style= '" +GETPNGBG ("Images/panel/dlg_" +p+ "_c.png") + "></td> "
l+= "<td width=1 style= '" +GETPNGBG ("Images/panel/dlg_" +p+ "_r.png") + "' ></td> '
l+= "</tr></table></td></tr>"
}
l+= "</table>"
l+= "<div align=center style=position:absolute;top:5;width:100%;color:white>" + (title| | "") + "</div>"
l+= "<input onmousedown=\" StartDrag (' +dlgid+ ', event) \ readOnly style=cursor:default;position:absolute;width : 100%;height:22;border:0;background:url (images/blank.gif) > "
l+= "<span onclick=\" Odel (' +dlgid+ "') \ type= ' button ' pos= '" + (w-27) + ", 5,14,14 ' bg= ' images/panel/btdlgclose.gif ' ></span> "
l+= "</div>"
Inshtm (document.body,l)
dlg=$ (Dlgid)
Focudlg (DLG)
Dlg.onselectstart=dlg.onmousedown=dlg.ondragstart=dlg.oncontextmenu=function (e) {
var ee
e=e| | Event
Ee=e.srcelement
if (issetpos&&e.type== "MouseDown" &&isie)
Window.clipboardData.setData ("Text", ($x (ee,this) +e.offsetx) + "," + ($y (ee,this) +e.offsety))
if (ee.tagname!= "INPUT" &&ee.tagname!= "TEXTAREA")
return False
if (ee.readonly==true)
return False
}
}
function Focudlg (DLG) {
dlg=$ (DLG)
if ($sys. Currentdlg==dlg)
Return
$sys. dlgdepth++
dlg.style.zindex= $sys. dlgdepth
$sys. Currentdlg=dlg
}
function fmcheck (FM) {
var ar=[], $caption, $checkRule, $value, Stip,i,j, $n
Ar.push (["Notnull", "$value = =" "," $caption cannot be empty! "])
Ar.push (["UID", "!/^[_a-za-z0-9\\u4e00-\\u9fa5\\uf900-\\ufa2d]{2,16}$/.test ($value)", "nickname can only be composed of 2 to 16 characters, English, numerals or underscores!" "])
Ar.push (["pwd", "!/^[_a-za-z0-9]{6,12}$/.test ($value)", "Password can only be composed of 6 to 12 English, numbers or underscores!" "])
Ar.push (["Cpwd", "Fm[i].value!=fm[i-1].value", "Password confirmation inconsistent!") "])
Ar.push (["EML", "!/^") ([\\w-\\.] +) @ (\\[[0-9]{1,3}\\. [0-9] {1,3}\\. [0-9] {1,3}\\.) | (([\\w-]+\\.) +)) ([a-za-z]{2,4}| [0-9] {1,3}) (\\]?) $/.test ($value) "," Mailbox format is not correct! "])
Ar.push (["max-", "$n =/max\\-(\\d+)/.exec ($checkRule) [1]*1; $value .length> $n", "$caption can enter only $n characters!" "])
Ar.push (["min-", "$n =/min\\-(\\d+)/.exec ($checkRule) [1]*1; $value .length< $n", "$caption must enter $n characters at least!" "])

for (i=0;i<fm.length;i++) {
$caption =fm[i].getattribute ("caption")
$checkRule =fm[i].getattribute ("Checkrule")
if ($checkRule ==null)
Continue
$value =fm[i].value=fm[i].value.trim ()
for (j=0;j<ar.length;j++) {
if (New RegExp ("\\b" +ar[j][0]+ "\\b"). Test ($checkRule) &&eval (ar[j][1)) {
Stip=fm[i].getattribute ("Tip_" +ar[j][0])
if (stip==null)
Stip=ar[j][2].replace (/\$\w+/g,function ($) {return eval ($)})
Alert (STIP)
OFOCU (Fm[i])
return False
}
}
}
return True
}
function Editor_paste (w,html) {
if (document.all)
W.document.selection.createrange (). pastehtml (HTML)
else{
var ol,i,r=w.document.createrange ()
W.document.execcommand ("Insertimage", False, "http://temp_obj/")
Ol=w.document.getelementsbytagname ("img")
for (i=0;i<ol.length;i++) {
if (ol[i].src== "http://temp_obj/") {
R.setstartbefore (Ol[i])
Ol[i].parentnode.insertbefore (r.createcontextualfragment (HTML), Ol[i])
Ol[i].parentnode.removechild (Ol[i])
}
}
}
}
function Editor_getval (Win) {
var scontent
try{
Scontent=win.document.body.innerhtml
Scontent=scontent.replace (/<script[^>]*>[^>]*>/gi, "")
}
catch (e) {
Scontent= ""
}
Scontent=scontent.trim ()
Return scontent
}

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.