聚热点 juredian

转帖工具(放到首页左栏随时调用)

本人制作的这个转帖工具的代码: ---------------------------------------------------------------------------------------------------------------------------------DLLC 1234自制转帖工具

/ig, " ").replace(/

]*?>([wW]*?)/ig, " ").replace(/]*?>([wW]*?)/ig, " ").replace(/]*?>([wW]*?)/ig, " ");if($("set").fontbash.checked){str = str.replace(/]*?displays*?:s*?none[^>]*?>([wW]*?)/ig, " ");str = str.replace(/]*?fonts*?-s*?sizes*?:s*(0px|0pt)[^>]*?>([wW]*?)/ig, " ");str = str.replace(/]+)(0px|0pt)+([^>]*)>([wW]*?)/ig, " ");}if($("set").filtrate.checked){tm=$("textfield").value;var arr = str.match(/]+src=[" ]?([^ "]+)[" ]?[^>]*>/ig); var i; if(tm.length< 1){ if(arr != null){ tm = arr[ 0].replace(/ ]+src=[ " ]?([^"]+)[ " ]?[^>]*>/ig," $1 ")+" ""; i = tm.search(//[^/]+ "/ig);tm = tm.substr(0, i) + "/ ";$("textfield").value=tm;}}if(tm){var n = arr.length, strtm, j, k;for(i=0; i)[^<]+(<|$)/ig," $1 $2 ");str = str.replace(/<(font|strong|b|u|i)(?=>)[^>]*>s*/ig, " ");if($("set").linka.checked) str = str.replace(/]+href=[" ]?([^ "]+)[" ]?[^>]*>([sS]*?) /ig, "
$2
"); if($("set").font_all.checked){ str = str.replace(/ ]>([sS]*?) /ig, "$1"); } else { if($("set").font_color.checked) str = str.replace(/ ]+)color=([^ >]+)([^>]*)>([sS]*?) /ig, "$4"); if($("set").font_size.checked) str = str.replace(/ ]+)size=([^ >]+)([^>]*)>([sS]*?) /ig, "$4"); if($("set").font_face.checked) str = str.replace(/ ]+face=([^ >]+)[^>]*>([sS]*?) /ig, "$2"); } if($("set").font_b.checked){ str = str.replace(/ ]*?>| /ig, ""); str = str.replace(/ ]*?>| /ig, ""); } if($("set").font_u.checked) str = str.replace(/ ]*?>| /ig, ""); if($("set").font_i.checked) str = str.replace(/ ]*?>| /ig, ""); if($("set").img.checked) str = str.replace(/ ]+src=[ " ]?([^"]+)[ " ]?[^>]*>/ig, " ");if($("set").objs.checked) str = str.replace(/<object[sS]*?/ig, " ");return str;}function html2ubb(str){str = str.replace(/r/g, " ");str = str.replace(/]+href=[" ]?mailto:([^ "]+)[" ]?[^>]*>([sS]*?) /ig, "[email=$1]$2[/email]"); str = str.replace(/ ]+href=[ " ]?([^"]+)[ " ]?[^>]*>([sS]*?)/ig,"[url= $1] $2[/url] ");str = str.replace(/]+)color=([^ >]+)([^>]*)>([sS]*?)/ig,"[color= $2] $4 [/color] ");str = str.replace(/]+)size=([^ >]+)([^>]*)>([sS]*?)/ig,"[size= $2] $4 [/size] ");str = str.replace(/]+face=([^ >]+)[^>]*>([sS]*?)/ig,"[font= $1] $2[/font] ");str = str.replace(/]*?>([sS]*?)/ig, "[b] $1[/b] ");str = str.replace(/)[^>]*?>([sS]*?)/ig, "[b] $1[/b] ");str = str.replace(/)[^>]*?>([sS]*?)/ig,"[u] $1[/u] ");str = str.replace(/)[^>]*?>([sS]*?)/ig,"[i] $1[/i] ");str = str.replace(/]*?align=[" ]?center[^>]*?>([sS]*?)

/ig, "[align=center] $1[/align]"); str = str.replace(/

]*?>([sS]*?)/ig, "[align=center] $1[/align]"); str = str.replace(/ ]+src=[ " ]?([^"]+)[ " ]?[^>]*>/ig,"[img] $1[/img] ");str = str.replace(/]+(?:D27CDB6E-AE6D-11cf-96B8-444553540000|application/x-shockwave-flash|macromedia.com.*?shockwave)[^>]*>([sS]*?)]+name=[" ]?movie[ " ]?[^>]+value=[" ]?([^ "]+)[" ]?[^>]*>/ig, "[flash]$2[/flash]"); str = str.replace(/]+classid=[ " ]?clsid:(?:6bf52a52-394a-11d3-b153-00c04f79faa6|22d6f312-b0f6-11d0-94ab-0080c74c7e95|CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA)[" ]?[^>]*>[sS]*]+name= "src"[^>]+value= "([^"]+) ">/ig,"[media] $1[/media] ");str = str.replace(/ /g," ").replace(/&/g,"& ").replace(/"/g," "").replace(/</g, "<").replace(>"); str = str.replace(/n/ig, ""); str = str.replace(/ ]*?>/ig, "n"); str = str.replace(/]*?>/ig, "nn"); str = str.replace(/ <(?:tr|th|div|table|center|hr|d[dlt]|form|ol|ul|li|caption|textarea|dir)(?=>)[^>]*?>/ig, "n") str = str.replace(/ )[^>]*?>/ig, "n") str = str.replace(/ <[^>]*?>/g, ""); //str = str.replace(/[url=([^]]+)]([img] 1[/img])[/url]/ig, "$2"); return str; } function ubb 2html(str){ str = str.replace(/[url]s*(www.|https?://|ftp://|gopher://|news://|telnet://|rtsp://|mms://|callto://|bctp://|ed 2k://){ 1}([^[ ""]+?)s*[/url]/ig, function($1, $2, $3) {return cuturl($2 + $3);});str = str.replace(/[url=[""]?www.([^[ ""]+?)[""]?](.*?)[/url]/ig, " $2 "); str = str.replace(/[url=[" "]?([^[""]+?)[" "]?]([sS]*?)[/url]/ig, "$2");str = str.replace(/[email](.*?)[/email]/ig, "$1");str = str.replace(/[email=[""]?([^[ ""]*)[""]?](.*?)[/email]/ig, " $2 "); str = str.replace(/[color=[" "]?([^[<""]+?)[" "]?]([sS]*?)[/color]/ig, "$2");str = str.replace(/[size=[""]?(d+?)[" "]?]([sS]*?)[/size]/ig, "$2");str = str.replace(/[size=[""]?(d+(?:.d+)?(?:px|pt|in|cm|mm|pc|em|ex|%)+?)[" "]?]([sS]*?)[/size]/ig, "$2");str = str.replace(/[font=[""]?([^[ <""]+?)[""]?]([sS]*?)[/font]/ig, " $2 "); str = str.replace(/[img]s*([^[<rn]+?)s*[/img]/ig, ""); str = str.replace(/[b]([sS]*?)[/b]/ig, "$1").replace(/[u]([sS]*?)[/u]/ig, "$1").replace(/[i]([sS]*?)[/i]/ig, "$1"); str = str.replace(/[align=center]([sS]*?)[/align]/ig, "
$1
"); str = str.replace(/n/ig, "n
"); return (str); } function cuturl(url){ var length = 65; var urllink = " ";if(url.length > length) {url = url.substr(0, parseInt(length * 0.5)) + " ... " + url.substr(url.length - parseInt(length * 0.3));}urllink += url + "";return urllink;}function switch_Edt(m){if(m == Editor_Mode) return;var ubb="", html="", obj;if(Editor_Mode == 0){ubb = $("UBB_Editor").value;$("UBB_Editor").style.display = "none";$("UBB_btn").className = "normal";}else if(Editor_Mode == 1){html = $("HTML_Editor").value;$("HTML_Editor").style.display = "none";$("HTML_btn").className = "normal";}else{html = $("Visual_Editor").contentWindow.document.body.innerHTML;$("Visual_Editor").style.display = "none";$("Visual_btn").className = "normal";}if(m == 0){if(ubb=="") ubb = html2ubb(html);$("UBB_Editor").style.display = "block";$("UBB_btn").className = "current";obj = $("UBB_Editor");obj.value = ubb;$("dupBtn").style.display = "inline";$("enB64").style.visibility = "visible";$("deB64").style.visibility = "visible";$("pic_filter").style.visibility = "hidden";}else if(m == 1){if(html=="") html = ubb2html(ubb);else html = html.replace(/]*?>/ig, "n
");$("HTML_Editor").style.display = "block";$("HTML_btn").className = "current";obj = $("HTML_Editor");obj.value = html;$("dupBtn").style.display = "none";$("enB64").style.visibility = "hidden";$("deB64").style.visibility = "hidden";$("pic_filter").style.visibility = "hidden";}else{if(html=="") html = ubb2html(ubb);$("Visual_Editor").style.display = "block";$("Visual_btn").className = "current";obj = $("Visual_Editor").contentWindow.document.body;obj.innerHTML = html;$("dupBtn").style.display = "none";$("enB64").style.visibility = "hidden";$("deB64").style.visibility = "hidden";$("pic_filter").style.visibility = "visible";}Editor_Mode = m;focusAtEnd(obj);sum_word();}function focusAtEnd(obj){obj.focus();if(Editor_Mode==2){var sel = obj.ownerDocument.selection.createRange();var str = obj.innerHTML;}else{var sel = obj.createTextRange();var str = obj.value;}var len = (str.indexOf("n") != -1) ? str.replace(/r?n/g, "_").length : str.length;sel.moveStart("character", len);sel.collapse();sel.select();}function copycode(){var obj;if(Editor_Mode==2){obj = $("Visual_Editor").contentWindow.document.body;}else{obj = (Editor_Mode==0) ? "UBB_Editor" : "HTML_Editor";obj = $(obj);obj.select();}obj.createTextRange().execCommand("Copy")}function transData(){var str = "";$("rtf").contentWindow.focus();$("rtf").contentWindow.document.body.innerHTML = "";$("rtf").contentWindow.document.execCommand("paste");str = $("rtf").contentWindow.document.body.innerHTML;if(str.length == 0) {alert("剪贴板不存在超文本数据!");return "";}str = (Editor_Mode==0) ? html2ubb(filter_html(str)) : filter_html(str);return str;}function trans(){if(Editor_Mode==0){$("UBB_Editor").value = transData();}else if(Editor_Mode==1){$("HTML_Editor").value = transData();}else{$("Visual_Editor").contentWindow.document.body.innerHTML = transData();}sum_word();}function trans2(){if(Editor_Mode==0){$("UBB_Editor").value += "rnrn" + transData();}else if(Editor_Mode==1){$("HTML_Editor").value += "rn
rn
" + transData();}else{$("Visual_Editor").contentWindow.document.body.innerHTML += "

" + transData();}sum_word();}function preview(){var html;if(Editor_Mode == 0){html = ubb2html($("UBB_Editor").value);}else if(Editor_Mode == 1){html = $("HTML_Editor").value;}else{html = $("Visual_Editor").contentWindow.document.body.innerHTML;}var nWin = window.open("", "_blank");nWin.document.write(html);nWin.document.close();}function clearEdt(){if(Editor_Mode == 0){$("UBB_Editor").value = "";}else if(Editor_Mode == 1){$("HTML_Editor").value = "";}else{$("Visual_Editor").contentWindow.document.body.innerHTML = "";}$("words").innerHTML = "0";}function zhen(str){strfound = str.replace(//ig,"");strfound = strfound.replace(/[/ig,"[");strfound = strfound.replace(/]/ig,"]");strfound = strfound.replace(/{/ig,"{");strfound = strfound.replace(/}/ig,"}");strfound = strfound.replace(/|/ig,"|");strfound = strfound.replace(///ig,"/");strfound = strfound.replace(/^/ig,"^");strfound = strfound.replace(/./ig,".");strfound = strfound.replace(/*/ig,"*");strfound = strfound.replace(/?/ig,"?");strfound = strfound.replace(/+/ig,"+");return strfound;}function replace_star(){var str;if(Editor_Mode == 0){str = $("UBB_Editor").value;}else if(Editor_Mode == 1){str = $("HTML_Editor").value;}else{str = $("Visual_Editor").contentWindow.document.body.innerHTML;}var strfound = (reg.checked) ? $("find_text").value : zhen($("find_text").value) ;var re = new RegExp(strfound, "ig");str = str.replace(re, $("replace_text").value);if(Editor_Mode == 0){$("UBB_Editor").value = str;}else if(Editor_Mode == 1){$("HTML_Editor").value = str;}else{$("Visual_Editor").contentWindow.document.body.innerHTML = str;}sum_word();}function font_checker(obj){var o = $("set").font_all;if(! obj.checked && o.checked)o.checked = false;}function pasteData(){if(!$("x_paste").checked) return true;if(Editor_Mode==2){var str = transData();$("rtf").contentWindow.document.body.innerHTML = str;$("rtf").contentWindow.focus();$("rtf").contentWindow.document.body.createTextRange().execCommand("Copy");}else{clipboardData.setData("text",transData());}return true;}function attPasteEvt(){$("Visual_Editor").contentWindow.document.body.onpaste = pasteData;$("Visual_Editor").onload = null;}function filter_Font(Obj){Obj = Obj.checked;$("font_color").checked = Obj;$("font_size").checked = Obj;$("font_face").checked = Obj;$("font_b").checked = Obj;$("font_i").checked = Obj;$("font_u").checked = Obj;}function fltBaseUrl(){if($("filtrate").checked)$("base_url").style.display = "block";else$("base_url").style.display = "none";}function clearBaseUrl(){$("textfield").value = "";}function reset(){$("set").reset();fltBaseUrl();$("find_text").value = "";$("replace_text").value = "";$("textfield").value = "";}function configTip(msg){var e;try{clearTimeout(Timer);}catch(e){}$("config_tip").innerHTML = msg;Timer = setTimeout("$("config_tip").innerHTML=""", 1000);}function Simplized(){var obj;if(Editor_Mode==0){obj = $("UBB_Editor");obj.value = convJT(obj.value);}else if(Editor_Mode==1){obj = $("HTML_Editor");obj.value = convJT(obj.value);}else{obj = $("Visual_Editor").contentWindow.document.body;StranBody(obj, 0);}}function Traditionalized(){var obj;if(Editor_Mode==0){obj = $("UBB_Editor");obj.value = convFT(obj.value);}else if(Editor_Mode==1){obj = $("HTML_Editor");obj.value = convFT(obj.value);}else{obj = $("Visual_Editor").contentWindow.document.body;StranBody(obj, 1);}}function QQ90sized(){var obj;if(Editor_Mode==0){obj = $("UBB_Editor");obj.value = convQQ(obj.value);}else if(Editor_Mode==1){obj = $("HTML_Editor");obj.value = convQQ(obj.value);}else{obj = $("Visual_Editor").contentWindow.document.body;StranBody(obj, 2);}}function noDuplicate(){var o = $("UBB_Editor");var ary = o.value.replace(/^s*|s*$/g, "").split("rn");var re = {};var str = "", s;for(var i = 0, len = ary.length, j = 0; i < len; i++){s = ary[i];if(s == ""){str += "rn";j++;}else{if(!re[s]){re[s] = true;str += s +"rn";j++;}}}str = str.substr(0, str.length-2);o.value = str;configTip(len + "->" + j);sum_word();}function decodeBase64(){var o = $("UBB_Editor");o.value = base64decode(o.value);sum_word();}function encodeBase64(){var o = $("UBB_Editor");o.value = base64encode(o.value);sum_word();}function moreTool(){$("advTool").style.display = ($("advTool").style.display=="block") ? "none" : "block";}function sum_word(){var s;if(Editor_Mode == 0){s = $("UBB_Editor").value.length;}else if(Editor_Mode == 1){s = $("HTML_Editor").value.length;}else{s = $("Visual_Editor").contentWindow.document.body.innerHTML.length;}$("words").innerHTML = ""+s;}function init(){$("rtf").contentWindow.document.designMode = "On";$("Visual_Editor").contentWindow.document.designMode = "On";$("set").reset();}if(window.addEventListener){window.addEventListener("load", init, false);}else{window.attachEvent("onload", init);}
DLLC1234转帖工具
字符数: 0
图片上方插入一空行" onclick="row_2_front()" value="图前插行" type="button"/>图片并列排在一起" onclick="array_pic()" value="图片并排" type="button"/>图片" type="button"/>图片" onclick="filter_pic()" value="过滤失效图" type="button"/>
图片下方插入一空行" onclick="row_2_after()" value="图后插行" type="button"/>图片(每行只有图片)" onclick="pic_center()" value="图片居中" type="button"/>图片可在新窗口中打开该图" onclick="pic_link()" value="图片加链接" type="button"/>图片转链接" type="button"/>
图片信息">图片过滤掉">屏蔽所有字体相关的属性">屏蔽干扰码">
JS 压缩
输入图片的基本地址:
如果未指定基本地址, 则将自动取第一张图片的位置做基本地址. 基本地址是指除文件名外的网络路径.
图片地址为: http://www.maxthon.com/images/logo.png , 则除去图片文件名 logo.png 后基本地址为: http://www.maxthon.com/images/


本站资源来自互联网,仅供学习,如有侵权,请通知删除,敬请谅解!
搜索建议:转帖工具  首页  首页词条  调用  调用词条  放到  放到词条  随时  随时词条  工具  工具词条  转帖工具词条