var img_src=''; var ToAdd=''; function show_image(){ var num1=document.reply_form.first_num.value; var num2=document.reply_form.second_num.value; var num3=document.reply_form.third_num.value; var num=num1+num2+num3; if('000'==num){ document.getElementById('face_to_insert').innerHTML=''; img_src=''; }else{ img_src='http://icon.zol.com.cn/bbs/index2/faces/'+num+'.gif'; document.getElementById('face_to_insert').innerHTML="<img id='face_to_show' src='' alt="表单提交(插入效果)javascript_javascript技巧" >"; document.getElementById('face_to_show').src=img_src; } document.reply_form.content.focus(); } function use_mine(itemid){ if(!itemid){ return; } var dir=Math.ceil(itemid/1000); img_src='http://img.zol.com.cn/bbs/little/l_'+dir+'/'+itemid+'.gif'; document.getElementById('face_to_insert').innerHTML=""; document.getElementById('face_to_show').src=img_src; } function message(userid,messageid){ var tr; tr = 'http://v1.bbs.zol.com.cn/user/send_msg.php?userid=' + userid+'&messageid='+messageid; window.open(tr,'message','width=470,height=382'); } function CopyRssUrl(url){ if(!url){ return; } window.clipboardData.setData('Text',url); alert('Rss地址已复制到剪贴版'); } function add_hexun(){ t=document.title; u=location.href; e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():''); void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes')); document.getElementById('hexun_bookmark').src='http://v1.bbs.zol.com.cn/tips/hexun_bookmark.php'; } function ckform(obj){ if(0==obj.content.value.length){ alert('内容不能空啊!'); obj.content.focus(); return false; } if(img_src){ ToAdd = " [IMG]"+img_src+"[/IMG]"; obj.content.value += ToAdd; } obj.submit_data.value='正在提交..'; obj.submit_data.disabled=true; return true; } function reply_this(nickname,userid,level,headpic){ document.location = '#top_reply'; var info_str='对 '; if(level){ info_str+='第'+level+'楼'; }else{ info_str+='楼主'; } info_str+=' '+nickname+' 说:'; document.reply_form.reply_info.value=info_str; document.reply_form.reply_to_userid.value=userid; document.reply_form.content.focus(); } //对于匿名发贴网友 回复定位到回复框 function sysauto_reply(){ document.location = '#top_reply'; document.reply_form.content.focus(); } function ctlent(eventobject){ if(event.ctrlKey && window.event.keyCode==13){ if(img_src){ ToAdd = " [IMG]"+img_src+"[/IMG]"; document.reply_form.content.value += ToAdd; } if(ckform(document.reply_form)){ document.reply_form.submit(); document.reply_form.submit_data.disabled=true; } } } function setsuper(tr){ str = '['+ tr +']' + document.reply_form.content.value + '[/'+ tr +']'; document.reply_form.content.value = str; } function onsize(){ ToAdd = '[size='+document.reply_form.fbsize.value+']' + document.reply_form.content.value + '[/size]'; document.reply_form.content.value = ToAdd; } function readCookie(name){ var cookieValue = ''; var search = name + '='; if(document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(';', offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; } function writeCookie(name, value, hours){ var expire = ''; if(hours != null) { expire = new Date((new Date()).getTime() + hours * 3600000); expire = '; expires=' + expire.toGMTString(); } document.cookie = name + '=' + escape(value) + expire; } function Cimage(){ var enterURL = prompt("请输入图片网址", "http://"); if (enterURL){ ToAdd = " [URL=http://v1.bbs.zol.com.cn/tips/show_linkpic.php?piclink="+enterURL+"][IMG]"+enterURL+"[/IMG][/URL]"; } if(ToAdd){ document.reply_form.content.value += ToAdd; } } function Cswf(){ var enterSIZE = prompt("输入Flash尺寸(宽,高)!", "WIDTH=300 HEIGHT=250"); var enterURL = prompt("请输入Flash网址", "http://"); if (enterURL) { ToAdd = "[FLASH]"+enterURL+" "+enterSIZE+"[/FLASH]"; } if(ToAdd){ document.reply_form.content.value += ToAdd; }else{ return; } } function Curl(){ var FoundErrors = ''; var enterURL = prompt("输入链接网址!", "http://"); var enterTxT = prompt("输入链接说明!", "说明"); if (!enterURL) { FoundErrors += "\n" + "链接网址不能为空"; } if (!enterTxT) { FoundErrors += "\n" + "链接说明不能为空"; } if (FoundErrors) { alert("错误!"+FoundErrors); return; } str = "[URL="+enterURL+"]"+enterTxT; document.reply_form.content.value += str; document.reply_form.content.value += "[/URL]"; } 操作 字体大小 1 2 3 4 5 6 7 内容 图片及更多功能 图片 卡通图标 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 [完成后可按 Ctrl+Enter 发布] [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]