Script-js is used by magic cloud studio, and share. js is strongly recommended.

Source: Internet
Author: User

Copy codeThe Code is as follows:
Function user_login (){
Var l
CreateDlg ("dlgLogin", "User Logon", 260,170)
L = "<form name = fmLogin action = 'handle _ user. asp? Cmd = login '>"
L + = "<span style = position: absolute; left: 30; top: 35> nickname: <input name = FUid checkRule = 'uid' style = width: 155> </span>"
L + = "<span style = position: absolute; left: 30; top: 65> password: <input name = FPwd checkRule = 'pwd' type = password style = width: 155> </span>"
L + = "<span style = position: absolute; left: 64; top: 90> <input hidefocus type = checkbox name = FAutoLogin id = txAutoLogin checked> <label for = txAutoLogin> Automatic Logon </label> </span>"
L + = "<span onclick = \" $ ('dlglogin '). clickOk () \ "type = button pos = '2014, 58, 22 'bg = 'images/panel/btYes.gif '> </span>"
L + = "<span onclick = \" oDel ('dlglogin') \ "type = button pos = '2014, 140,132, 58, 22 'bg = 'images/panel/btNo.gif '> </span>"
L + = "</form>"
InsHtm ("dlgLogin", l)
OFocu (document. fmLogin. FUid)
$ ('Dlglogin'). clickOk = function (){
Document. fmLogin. btSubmit. click ()
}
Document. fmLogin. onload = function (xml ){
Location. reload (true)
}
}
Function user_reg (){
Var l
CreateDlg ("dlgReg", "User Registration", 320,260)
L = "<form name = fmReg action = 'handle _ user. asp? Cmd = reg '>"
L + = "<span style = position: absolute; left: 30; top: 35> nickname: <input name = FUid checkRule = 'uid' style = width: 220> </span>"
L + = "<span style = position: absolute; left: 30; top: 60> password: <input name = FPwd checkRule = 'pwd' type = password style = width: 220> </span>"
L + = "<span style = position: absolute; left: 30; top: 85> OK: <input name = FPwd2 checkRule = 'pwd2 'type = password style = width: 220> </span>"
L + = "<span style = position: absolute; left: 30; top: 110> Email: <input name = FEmail checkRule = 'yml' style = width: 220> </span>"
L + = "<span style = position: absolute; left: 30; top: 160> Signature: </span>"
L + = "<textarea name = FSignature style = position: absolute; left: 66; top: 140; width: 220; height: 60> </textarea>"
L + = "<span onclick = \" $ ('dlgreg '). clickOk () \ "type = button pos = '2014, 58, 22 'bg = 'images/panel/btYes.gif '> </span>"
L + = "<span onclick = \" oDel ('dlgreg ') \ "type = button pos = '170,222, 58, 22 'bg = 'images/panel/btNo.gif '> </span>"
L + = "</form>"
InsHtm ("dlgReg", l)
OFocu (document. fmReg. FUid)
$ ('Dlgreg '). clickOk = function (){
Document. fmReg. btSubmit. click ()
}
Document. fmReg. onload = function (xml ){
ODel ('dlgreg ')
Location. reload (true)
}
}
Function user_logout (){
LoadXml ("handle_user.asp? Cmd = logout ", function (xml ){
Location. reload (true)
})
}
Function editor_setLink (win ){
Var v
Win. focus ()
If (document. all)
V = window. showModalDialog ("lib/input.htm", "Enter the hyperlink path | http: //", "dialogwidth: 354px; dialogheight: 152px; status: no; help: no ")
Else
V = prompt ("Enter the hyperlink path", "http ://")
If (v = null)
Return
If (v! = "" & V! = "Http ://")
Win.document.exe cCommand ("createlink", false, v)
Else
Win.document.exe cCommand ("unlink", false, null)
}
Function editor_insImg (win ){
Var v
Win. focus ()
If (document. all)
V = window. showModalDialog ("lib/input.htm", "Enter the image path | http: //", "dialogwidth: 354px; dialogheight: 152px; status: no; help: no ")
Else
V = prompt ("Enter the image path", "http ://")
If (v = null)
Return
If (! /\. (Gif | jpg)/I. test (v ))
Return
Win.document.exe cCommand ("insertimage", false, v)
}
Function editor_insJs (win ){
Win. focus ()
L = "<table border = 1 align = center cellpadding = 0 cellspacing = 0 bordercolordark = white bordercolorlight = # BABABA style = 'margin-top: 12; margin-bottom: 12; width: 90%; background: white '>"
L + = "<tr height = 22> <td style = 'padding-left: 6; background: # d4d0c8 '> ◇ Test Program-> <u style = cursor: pointer> run the following js </u> </td> </tr>"
L + = "<tr valign = top height = 90> <td name = '# jscode' style = padding: 6; word-break: break-all> <body> <br> </body> <br> <script> <br> </script> </td> </tr >"
L + = "</table>"
Editor_paste (win, l)
}
Function jsCode_run (ee ){
Var data, w
Data = ee. parentNode. parentNode. nextSibling. innerText
W = window. open ("", "_ blank ","")
Using Doc ument. write (data)
Using Doc ument. close ()
If (/<script (.) + src =/. test (data ))
W. location. reload (true)
}
Function thread_save (tid ){
Var dlgID = "dlgThread", dlg, fm, win, btImg, bxFile
If (myName = "")
Return alert ("You have not logged on. Please log on first! ")
CreateDlg (dlgID, tid = null? "Publish new posts": "Modify posts", 640,480)
L = "<form name =" + dlgID + "_ fm method = post action = 'handle _ thread. asp? Cmd = thread_save '>"
L + = "<input type = hidden name = tid value = '" + (tid | "") + "'>"
L + = "<input type = hidden name = FContent>"
L + = "<span style = position: absolute; left: 18; top: 35> title: <input name = FTitle caption = 'title' checkRule = 'notnull/max-50 'style = width: 540> </span>"
L + = "<span onclick = \" $ ('"+ dlgID + "'). clickOk () \ "type = button pos = '2014, 58, 22 'bg = 'images/panel/btYes.gif '> </span>"
L + = "<span onclick = \" oDel ('"+ dlgID +"') \ "type = button pos = '320,442, 58, 22 'bg = 'images/panel/btNo.gif '> </span>"
L + = "<div style = 'position: absolute; left: 67; top: 65; width: 540; height: 350; overflow: hidden; border: 2px inset '>"
L + = "<div style = 'height: 21; border-bottom: 1px solid #808080; background: # d4d0c8 '> </div>"
L + = "<span type = 'button 'onclick = \" $ ('"+ dlgID + "'). setBold () \ "pos = '13, 18 'bg = 'images/panel/btbold.gif'> </span>"
L + = "<span type = 'button 'onclick = \" $ ('"+ dlgID + "'). setLink () \ "pos = '38, 18 'bg = 'images/panel/btlink.gif'> </span>"
L + = "L + = "<span type = 'button 'onclick = \" $ ('"+ dlgID + "'). insImg () \ "pos = '80, 18 'bg = 'images/panel/btimg.gif'> </span>"
L + = "<span type = 'button 'onclick = \" $ ('"+ dlgID + "'). insJs () \ "pos = '2014, 1, 20, 18 'bg = 'images/panel/btjs.gif'> </span>"
L + = "<iframe id = '" + dlgID + "_ win 'src = 'lib/weditor.htm? Form = "+ dlgID +" _ fm 'frameborder = 0 style = 'width: 100%; height: 100'> </iframe>"
L + = "</div>"
L + = "</form>"
InsHtm (dlgID, l)
Dlg = $ (dlgID)
Fm = document [dlgID + "_ fm"]
Win = ow (dlgID + "_ win ")
OFocu (fm. FTitle)

Dlg. clickOk = function (){
Fm. btSubmit. click ()
}
Dlg. setBold = function (){
Win.document.exe cCommand ("bold", false)
}
Dlg. setLink = function (){
Editor_setLink (win)
}
Dlg. insImg = function (){
Editor_insImg (win)
}
Dlg. insJs = function (){
Editor_insJs (win)
}
Fm. onbeforeload = function (){
Fm. FContent. value = editor_getVal (win)
If (fm. FContent. value = ""){
Alert ("the post content cannot be blank! ")
Win. focus ()
Return false
}
}
Fm. onload = function (xml ){
Var url = location. href
Location. href = url. replace ("fclass = search", "fclass = all ")
}
}
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 thread_search (){
Var dlgID = "dlgThreadSearch", dlg, fm, tid
CreateDlg (dlgID, "Search for articles", 270,170)
L = "<form name =" + dlgID + "_ fm action = 'handle _ thread. asp? Cmd = thread_search '>"
L + = "<span style = position: absolute; left: 20; top: 65> keywords: <input name = FKey caption = keyword checkRule = 'notnull 'maxlength = 16 style = width: 170> </span>"
L + = "<span onclick = \" document. "+ dlgID +" _ fm. btSubmit. click () \ "type = button pos = '2014, 58, 22 'bg = 'images/panel/btYes.gif'> </span>"
L + = "<span onclick = \" oDel ('"+ dlgID +"') \ "type = button pos = '140,132, 58, 22 'bg = 'images/panel/btNo.gif '> </span>"
L + = "</form>"
InsHtm (dlgID, l)
Fm = document [dlgID + "_ fm"]
OFocu (fm. FKey)

Fm. onload = function (xml ){
Location. href = $ sys. path + "index. asp? Fclass = search"
}
}

Related Article

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.