论坛贴图代码转换工具
<style type="text/css">
body,p,tr,td,div,input,textarea {font-size:10.5pt}
</style>
使用方法: 看到好图了,怎么把他们以最快的速度转移到论坛里? 跟我来: 1.用鼠标把你要的东西(不管是图片还是文字)全部选种,也就是让它们变成高亮啦 2.鼠标右键选复制(或者使用热键盘ctrl+c) 3.点下面的开始转换按纽 4.修改修改看有什么需要删掉的(防止把不需要的信息复制过来哦) 5.全部选中转换后的代码复制后放到论坛的帖子里!
code: |
<html>
<head>
<title>论坛贴图代码转换工具</title>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<script language=javascript>
<!--
function symerror()
{
return true;
}
window.onerror = symerror;
//-->
</script>
<script language='JavaScript1.2'>
function html_trans(str) {
str = str.replace(/\r/g,"");
str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)="[^"]+"/ig,"");
str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");
str = str.replace(/<a[^>]+href="([^"]+)"[^>]*>(.*?)<\/a>/ig,"\n[url=$1]$2[/url]\n");
str = str.replace(/<font[^>]+color=([^ >]+)[^>]*>(.*?)<\/font>/ig,"\n[color=$1]$2[/color]\n");
str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/ig,"\n[img]$1[/img]\n");
str = str.replace(/<input[^>]+src="([^"]+)"[^>]*>/ig,"\n[img]$1[/img]\n");
str = str.replace(/<([\/]?)b>/ig,"[$1b]");
str = str.replace(/<([\/]?)strong>/ig,"[$1b]");
str = str.replace(/<([\/]?)u>/ig,"[$1u]");
str = str.replace(/<([\/]?)i>/ig,"[$1i]");
str = str.replace(/ /g," ");
str = str.replace(/&/g,"&");
str = str.replace(/"/g,"\"");
str = str.replace(/</g,"<");
str = str.replace(/>/g,">");
str = str.replace(/<br>/ig,"\n");
str = str.replace(/<[^>]*?>/g,"");
str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");
str = str.replace(/\n+/g,"\n");
return str;
}
function trans(){
var str = "";
rtf.focus();
rtf.document.body.innerHTML = "";
rtf.document.execCommand("paste");
str = rtf.document.body.innerHTML;
if(str.length == 0) {
alert("老大,剪贴板没有超文本数据,请到网页上去复制一下!");
return "";
}
return html_trans(str);
}
</script>
</head>
<body >
<table cellspacing=0 cellpadding=0 width=778 align=center bgcolor=#ffebbe border=0>
<tr>
<td width=755 align="center">
<div align=center><p><b ><font color=#009900><br>论坛贴图代码转换工具</font></b></p>
<table width="80%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
使用方法:<br>
看到好图了,怎么把他们以最快的速度转移到论坛里? 跟我来: <br><font color=#ff0000>
1.用鼠标把你要的东西(不管是图片还是文字)全部选种,也就是让它们变成高亮啦<br>
2.鼠标右键选复制(或者使用热键盘ctrl+c)<br>
3.点下面的开始转换按纽<br>
4.修改修改看有什么需要删掉的(防止把不需要的信息复制过来哦)<br>
5.全部选中转换后的代码复制后放到论坛的帖子里!</font><br>
</td>
</tr>
</table>
<textarea name=text id=text rows=20 cols=100></textarea><br>
</div>
<iframe id=rtf style="width: 0px; height: 0px;" marginwidth=0 marginheight=0 src="about:blank" scrolling=no ></iframe>
<script>rtf.document.designMode="On";</script>
<div align=center>
<input οnclick="document.getElementById('text').value += trans()" type=button value='点击这里开始转换' >
</div></td>
</tr>
</table>
</body>
</html> |