栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

脚本吧

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

脚本吧

复制代码 代码如下:
function user_login(){
    var l
    createDlg("dlgLogin","用户登录",260,170)
    l=""
    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","用户注册",320,260)
    l=""
    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","请输入超链接路径|http://","dialogwidth:354px;dialogheight:152px;status:no;help:no")
    else
        v=prompt("请输入超链接路径","http://")
    if(v==null)
        return
    if(v!=""&&v!="http://")
        win.document.execCommand("createlink",false,v)
    else
        win.document.execCommand("unlink",false,null)
}
function editor_insImg(win){
    var v
    win.focus()
    if(document.all)
        v=window.showModalDialog("lib/input.htm","请输入图片路径|http://","dialogwidth:354px;dialogheight:152px;status:no;help:no")
    else
        v=prompt("请输入图片路径","http://")
    if(v==null)
        return
    if(!/.(gif|jpg)/i.test(v))
        return
    win.document.execCommand("insertimage",false,v)
}
function editor_insJs(win){
    win.focus()
    l=""
    l+="◇ 测试程序 - >> 运行下面的js"
    l+="<body>

</body>
<script>

</script>"
    l+=""
    editor_paste(win,l)
}
function jsCode_run(ee){
    var data,w
    data=ee.parentNode.parentNode.nextSibling.innerText
    w=window.open("", "_blank","")
    w.document.write(data)
    w.document.close()
    if(/        w.location.reload(true)
}
function thread_save(tid){
    var dlgID="dlgThread",dlg,fm,win,btImg,bxFile
    if(myName=="")
        return alert("您还没有登录,请先登录!")
    createDlg(dlgID,tid==null?"发布新贴":"修改贴子",640,480)
    l=""
    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.execCommand("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("贴子内容不能为空!")
            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)
        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            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,"查找文章",270,170)
    l=""
    insHtm(dlgID,l)
    fm=document[dlgID+"_fm"]
    oFocu(fm.FKey)

    fm.onload=function(xml){
        location.href=$sys.path+"index.asp?fclass=search"
    }
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/120854.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号