SoFunction
Updated on 2025-03-03

Script Bar - Huanyu Studio uses js, super recommended


function user_login(){
    var l
createDlg("dlgLogin","User Login",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>AutoLogin>AutoLogin</label></span>"
    l+="<span onclick=\"$('dlgLogin').clickOk()\" type=button pos='65,132,58,22' bg='images/panel/'></span>"
    l+="<span onclick=\"oDel('dlgLogin')\" type=button pos='140,132,58,22' bg='images/panel/'></span>"
    l+="</form>"
    insHtm("dlgLogin",l)
    oFocu()
    $('dlgLogin').clickOk=function(){
        ()
    }
    =function(xml){
        (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>Confirm: <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='eml' 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='95,222,58,22' bg='images/panel/'></span>"
    l+="<span onclick=\"oDel('dlgReg')\" type=button pos='170,222,58,22' bg='images/panel/'></span>"
    l+="</form>"
    insHtm("dlgReg",l)
    oFocu()
    $('dlgReg').clickOk=function(){
        ()
    }
    =function(xml){
        oDel('dlgReg')
        (true)
    }
}
function user_logout(){
    loadXml("handle_user.asp?cmd=logout",function(xml){
        (true)
    })
}
function editor_setLink(win){
    var v
    ()
    if()
v=("lib/","Please enter the hyperlink path|http://","dialogwidth:354px;dialogheight:152px;status:no;help:no")
    else
v=prompt("Please enter the hyperlink path","http://")
    if(v==null)
        return
    if(v!=""&&v!="http://")
        ("createlink",false,v)
    else
        ("unlink",false,null)
}
function editor_insImg(win){
    var v
    ()
    if()
v=("lib/","Please enter the image path|http://","dialogwidth:354px;dialogheight:152px;status:no;help:no")
    else
v=prompt("Please enter the image path","http://")
    if(v==null)
        return
    if(!/\.(gif|jpg)/(v))
        return
    ("insertimage",false,v)
}
function editor_insJs(win){
    ()
    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 js</u></td></tr>"
    l+="<tr valign=top height=90><td name='#jscode' style=padding:6;word-break:break-all>&lt;body&gt;<br><br>&lt;/body&gt;<br>&lt;script&gt;<br><br>&lt;/script&gt;</td></tr>"
    l+="</table>"
    editor_paste(win,l)
}
function jsCode_run(ee){
    var data,w
    data=
    w=("", "_blank","")
    (data)
    ()
    if(/<script(.)+src=/.test(data))
        (true)
}
function thread_save(tid){
    var dlgID="dlgThread",dlg,fm,win,btImg,bxFile
    if(myName=="")
return alert("You are not logged in yet, please log in first!")
createDlg(dlgID,tid==null?"Publish new post": "Modify post", 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='230,442,58,22' bg='images/panel/'></span>"
    l+="<span onclick=\"oDel('"+dlgID+"')\" type=button pos='320,442,58,22' bg='images/panel/'></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,1,20,18' bg='images/panel/'></span>"
    l+="<span type='button' onclick=\"$('"+dlgID+"').setLink()\" pos='38,1,20,18' bg='images/panel/'></span>"
    l+="<img src=images/panel/ style='position:absolute;left:65;top:1'>"
    l+="<span type='button' onclick=\"$('"+dlgID+"').insImg()\" pos='80,1,20,18' bg='images/panel/'></span>"
    l+="<span type='button' onclick=\"$('"+dlgID+"').insJs()\" pos='107,1,20,18' bg='images/panel/'></span>"
    l+="<iframe id='"+dlgID+"_win' src='lib/?form="+dlgID+"_fm' frameborder=0 style='width:100%;height:324'></iframe>"
    l+="</div>"
    l+="</form>"
    insHtm(dlgID,l)
    dlg=$(dlgID)
    fm=document[dlgID+"_fm"]
    win=ow(dlgID+"_win")
    oFocu()

    =function(){
        ()
    }
    =function(){
        ("bold",false)
    }
    =function(){
        editor_setLink(win)
    }
    =function(){
        editor_insImg(win)
    }
    =function(){
        editor_insJs(win)
    }
    =function(){
        =editor_getVal(win)
        if(==""){
alert("The content of the post cannot be empty!")
            ()
            return false
        }
    }
    =function(xml){
        var url=
        =("fclass=search","fclass=all")
    }
}
function editor_paste(w,html){
    if()
        ().pasteHTML(html)
    else{
        var ol,i,r=()
        ("insertimage",false,"http://temp_obj/")
        ol=("img")
        for(i=0;i<;i++){
            if(ol[i].src=="http://temp_obj/"){
                (ol[i])
                ol[i].((html),ol[i])
                ol[i].(ol[i])
            }
        }
    }
}
function thread_search(){
    var dlgID="dlgThreadSearch",dlg,fm,tid
createDlg(dlgID,"Find Article",270,170)
    l="<form name="+dlgID+"_fm action='handle_thread.asp?cmd=thread_search'>"
l+="<span style=position:absolute;left:20;top:65>Keyword: <input name=FKey caption=Key checkRule='notnull' maxlength=16 style=width:170></span>"
    l+="<span onclick=\"document."+dlgID+"_fm.()\" type=button pos='65,132,58,22' bg='images/panel/'></span>"
    l+="<span onclick=\"oDel('"+dlgID+"')\" type=button pos='140,132,58,22' bg='images/panel/'></span>"
    l+="</form>"
    insHtm(dlgID,l)
    fm=document[dlgID+"_fm"]
    oFocu()

    =function(xml){
        =$+"?fclass=search"
    }
}