欢迎来到福编程网,本站提供各种互联网专业知识!

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

发布时间:2006-12-23 作者: 来源:转载
复制代码代码如下:functionuser_login(){varlcreateDlg("dlgLogin","用户登录",260,170)l=""l+="昵称:"l+="密码:"l+="自动登录"l+=""l+=""l+=""insHtm("dlgLogin",l)oFocu(document.fmLogin.FUid)$('dlgLogin').clickOk=function
复制代码 代码如下:
functionuser_login(){
varl
createDlg("dlgLogin","用户登录",260,170)
l=""
l+="昵称:"
l+="密码:"
l+="自动登录"
l+=""
l+=""
l+=""
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=""
l+="昵称:"
l+="密码:"
l+="确认:"
l+="邮箱:"
l+="签名:"
l+=""
l+=""
l+=""
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)
}
}
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","请输入超链接路径|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)
}
functioneditor_insImg(win){
varv
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)
}
functioneditor_insJs(win){
win.focus()
l=""
l+="◇测试程序->>运行下面的js"
l+="

"
l+=""
editor_paste(win,l)
}
functionjsCode_run(ee){
vardata,w
data=ee.parentNode.parentNode.nextSibling.innerText
w=window.open("","_blank","")
w.document.write(data)
w.document.close()
if(/w.location.reload(true)
}
functionthread_save(tid){
vardlgID="dlgThread",dlg,fm,win,btImg,bxFile
if(myName=="")
returnalert("您还没有登录,请先登录!")
createDlg(dlgID,tid==null?"发布新贴":"修改贴子",640,480)
l=""
l+=""
l+=""
l+="标题:"
l+=""
l+=""
l+=""
l+="

"
l+=""
l+=""
l+=""
l+=""
l+=""
l+=""
l+="
"
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()
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,"http://temp_obj/")
ol=w.document.getElementsByTagName("img")
for(i=0;iif(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])
}
}
}
}
functionthread_search(){
vardlgID="dlgThreadSearch",dlg,fm,tid
createDlg(dlgID,"查找文章",270,170)
l=""
l+="关键字:"
l+=""
l+=""
l+=""
insHtm(dlgID,l)
fm=document[dlgID+"_fm"]
oFocu(fm.FKey)

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

相关推荐