Copy codeThe 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 = "<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) +, 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 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 <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 ($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 <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.doc ument. body. innerHTML
SContent = sContent. replace (/<script [^>] *> [^>] *>/gi ,"")
}
Catch (e ){
SContent = ""
}
SContent = sContent. trim ()
Return sContent
}