脚本吧 - 幻宇工作室用到js,超强推荐share.js

2018-10-15 18:02

阅读:654

复制代码 代码如下:
functionuser_login(){
varl
createDlg(dlgLogin,用户登录,260,170)
l=<formname=fmLoginaction=handle_user.asp?cmd=login>
l+=<spanstyle=position:absolute;left:30;top:35>昵称:<inputname=FUidcheckRule=uidstyle=width:155></span>
l+=<spanstyle=position:absolute;left:30;top:65>密码:<inputname=FPwdcheckRule=pwdtype=passwordstyle=width:155></span>
l+=<spanstyle=position:absolute;left:64;top:90><inputhidefocustype=checkboxname=FAutoLoginid=txAutoLoginchecked><labelfor=txAutoLogin>自动登录</label></span>
l+=<spanonclick=\$(dlgLogin).clickOk()\type=buttonpos=65,132,58,22bg=images/panel/btYes.gif></span>
l+=<spanonclick=\oDel(dlgLogin)\type=buttonpos=140,132,58,22bg=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)
}
}
functionuser_reg(){
varl
createDlg(dlgReg,用户注册,320,260)
l=<formname=fmRegaction=handle_user.asp?cmd=reg>
l+=<spanstyle=position:absolute;left:30;top:35>昵称:<inputname=FUidcheckRule=uidstyle=width:220></span>
l+=<spanstyle=position:absolute;left:30;top:60>密码:<inputname=FPwdcheckRule=pwdtype=passwordstyle=width:220></span>
l+=<spanstyle=position:absolute;left:30;top:85>确认:<inputname=FPwd2checkRule=pwd2type=passwordstyle=width:220></span>
l+=<spanstyle=position:absolute;left:30;top:110>邮箱:<inputname=FEmailcheckRule=emlstyle=width:220></span>
l+=<spanstyle=position:absolute;left:30;top:160>签名:</span>
l+=<textareaname=FSignaturestyle=position:absolute;left:66;top:140;width:220;height:60></textarea>
l+=<spanonclick=\$(dlgReg).clickOk()\type=buttonpos=95,222,58,22bg=images/panel/btYes.gif></span>
l+=<spanonclick=\oDel(dlgReg)\type=buttonpos=170,222,58,22bg=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)
}
}
functionuser_logout(){
loadXml(handle_user.asp?cmd=logout,function(xml){
location.reload(true)
})
}
functioneditor_setLink(win){
varv
win.focus()
if(document.all)
v=window.showModalDialog(lib/input.htm,请输入超链接路径
else
v=prompt(请输入超链接路径,
if(v==null)
return
if(v!=&&v!=
win.document.execCommand(createlink,false,v)
else
win.document.execCommand(unlink,false,null)
}
functioneditor_insImg(win){
varv
win.focus()
if(document.all)
v=window.showModalDialog(lib/input.htm,请输入图片路径
else
v=prompt(请输入图片路径,
if(v==null)
return
if(!/\.(gifjpg)/i.test(v))
return
win.document.execCommand(insertimage,false,v)
}
functioneditor_insJs(win){
win.focus()
l=<tableborder=1align=centercellpadding=0cellspacing=0bordercolordark=whitebordercolorlight=#BABABAstyle=margin-top:12;margin-bottom:12;width:90%;background:white>
l+=<trheight=22><tdstyle=padding-left:6;background:#d4d0c8>◇测试程序->><ustyle=cursor:pointer>运行下面的js</u></td></tr>
l+=<trvalign=topheight=90><tdname=#jscodestyle=padding:6;word-break:break-all><body><br><br></body><br><script><br><br></script></td></tr>
l+=</table>
editor_paste(win,l)
}
functionjsCode_run(ee){
vardata,w
w=window.open(,_blank,)
w.document.write(data)
w.document.close()
if(/<script(.)+src=/.test(data))
w.location.reload(true)
}
functionthread_save(tid){
vardlgID=dlgThread,dlg,fm,win,btImg,bxFile
if(myName==)
returnalert(您还没有登录,请先登录!)
createDlg(dlgID,tid==null?发布新贴:修改贴子,640,480)
l=<formname=+dlgID+_fmmethod=postaction=handle_thread.asp?cmd=thread_save>
l+=<inputtype=hiddenname=tidvalue=+(tid)+>
l+=<inputtype=hiddenname=FContent>
l+=<spanstyle=position:absolute;left:18;top:35> 标题:<inputname=FTitlecaption=标题checkRule=notnull/max-50style=width:540></span>
l+=<spanonclick=\$(+dlgID+).clickOk()\type=buttonpos=230,442,58,22bg=images/panel/btYes.gif></span>
l+=<spanonclick=\oDel(+dlgID+)\type=buttonpos=320,442,58,22bg=images/panel/btNo.gif></span>
l+=<divstyle=position:absolute;left:67;top:65;width:540;height:350;overflow:hidden;border:2pxinset>
l+=<divstyle=height:21;border-bottom:1pxsolid#808080;background:#d4d0c8></div>
l+=<spantype=buttononclick=\$(+dlgID+).setBold()\pos=13,1,20,18bg=images/panel/btbold.gif></span>
l+=<spantype=buttononclick=\$(+dlgID+).setLink()\pos=38,1,20,18bg=images/panel/btlink.gif></span>
l+=<imgsrc=images/panel/split1.gifstyle=position:absolute;left:65;top:1>
l+=<spantype=buttononclick=\$(+dlgID+).insImg()\pos=80,1,20,18bg=images/panel/btimg.gif></span>
l+=<spantype=buttononclick=\$(+dlgID+).insJs()\pos=107,1,20,18bg=images/panel/btjs.gif></span>
l+=<iframeid=+dlgID+_winsrc=lib/weditor.htm?form=+dlgID+_fmframeborder=0style=width:100%;height:324></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.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()
returnfalse
}
}
fm.onload=function(xml){
varurl=location.href
location.href=url.replace(fclass=search,fclass=all)
}
}
functioneditor_paste(w,html){
if(document.all)
w.document.selection.createRange().pasteHTML(html)
else{
varol,i,r=w.document.createRange()
w.document.execCommand(insertimage,false,
ol=w.document.getElementsByTagName(img)
for(i=0;i<ol.length;i++){
if(ol[i].src==
r.setStartBefore(ol[i])
ol[i].parentNode.insertBefore(r.createContextualFragment(html),ol[i])
ol[i].parentNode.removeChild(ol[i])
}
}
}
}
functionthread_search(){
vardlgID=dlgThreadSearch,dlg,fm,tid
createDlg(dlgID,查找文章,270,170)
l=<formname=+dlgID+_fmaction=handle_thread.asp?cmd=thread_search>
l+=<spanstyle=position:absolute;left:20;top:65>关键字:<inputname=FKeycaption=关键字checkRule=notnullmaxlength=16style=width:170></span>
l+=<spanonclick=\document.+dlgID+_fm.btSubmit.click()\type=buttonpos=65,132,58,22bg=images/panel/btYes.gif></span>
l+=<spanonclick=\oDel(+dlgID+)\type=buttonpos=140,132,58,22bg=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
}
}


评论


亲,登录后才可以留言!