Script-why is expand. js strongly recommended? 1.1.23
The Code is 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 ="
"
L + ="
"For (I = 0; I <3; I ++ ){P = I = 0? "T" :( I = 1? "M": "B ")L + ="
"L + ="
| "L + ="
| "L + ="
| "L + ="
|
"}L + ="
"
L + ="
"+ (Title |" ") +"
"
L + =" "
L + = ""
L + ="
"
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 blank! "])
Ar. push (["uid ","! /^ [_ A-zA-Z0-9 \ u4E00-\ u9FA5 \ uF900-\ uFA2D] {} $ /. test ($ value) "," nickname can only contain 2 to 16 Chinese characters, English letters, numbers, or underscores! "])
Ar. push (["pwd ","! /^ [_ A-zA-Z0-9] {6, 12} $/. test ($ value) "," the password can only consist of 6 to 12 English letters, digits, 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) "," Incorrect email format! "])
Ar. push (["max-", "$ n =/max \-(\ d + )/. exec ($ checkRule) [1] * 1; $ value. length> $ n "," $ caption cannot exceed $ n characters! "])
Ar. push (["min-", "$ n =/min \-(\ d + )/. exec ($ checkRule) [1] * 1; $ value. length <$ n "," $ caption must contain at least $ n characters! "])
For (I = 0; 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 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 ($0) {return eval ($0 )})
Alert (sTip)
OFocu (fm [I])
Return false
}
}
}
Return true
}
Function editor_paste (w, html ){
If (document. all)
Invalid Doc ument. selection. createRange (). pasteHTML (html)
Else {
Var ol, I ,r00000000doc ument. createRange ()
Optional document.exe cCommand ("insertimage", false, "http: // temp_obj /")
Ol=w.doc ument. getElementsByTagName ("img ")
For (I = 0; 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.doc ument. body. innerHTML
SContent = sContent. replace (/ ] *> [^>] *>/Gi ,"")
}
Catch (e ){
SContent = ""
}
SContent = sContent. trim ()
Return sContent
}