好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > 簡單的Html轉(zhuǎn)換UBB的程序

簡單的Html轉(zhuǎn)換UBB的程序

熱門標(biāo)簽:提高電話機器人接通率 平?jīng)龈叩碌貓D標(biāo)注商戶要收費嗎 大學(xué)校門地圖標(biāo)注 福建微碼電話機器人 外呼系統(tǒng)api對接 荊州智能電銷機器人 廣西智能外呼系統(tǒng)多少錢 銷售電銷機器人詐騙 地圖標(biāo)注與公司業(yè)務(wù)關(guān)系
這個功能主要是讓 UBB 轉(zhuǎn)貼的時候方便點. 

1.自動識別圖片,超鏈接,字體顏色,和字體加粗,傾斜,下劃線的HTML代碼,并且轉(zhuǎn)換為UBB代碼.
2.兼容 IE 和 Mozilla多種瀏覽器
html>
head>
title>Html轉(zhuǎn)換程序/title>
SCRIPT language="JavaScript1.2">
function HtmlToUBB(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(/([\/]?)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 = "";
str = document.getElementById('edit').contentWindow.document.body.innerHTML;
if (str.length == 0) {
alert("無轉(zhuǎn)換內(nèi)容!請使用 Ctrl+V 把內(nèi)容復(fù)制到下面的編輯框內(nèi)");
}
document.getElementById('ReCode').value=HtmlToUBB(str);
}

function clearCode(){
document.getElementById('ReCode').value="";
}

function Start() {
  document.getElementById('edit').contentWindow.document.designMode = "on";
  try {
    document.getElementById('edit').contentWindow.document.execCommand("undo", false, null);
  }  catch (e) {
    alert("你的Mozilla瀏覽器不支持在線RichEditor");
  }
}

function ViewSource(Source){
  var Html;
  if (Source){
document.getElementById('sCode').value = document.getElementById('edit').contentWindow.document.body.innerHTML;
document.getElementById('edit').style.display="none";
document.getElementById('sCode').style.display="";
document.getElementById('tip').innerText="修改粘貼后的網(wǎng)頁源代碼 >>";
document.getElementById('tranButton').disabled="disabled"
  }
  else{
document.getElementById('edit').contentWindow.document.body.innerHTML = document.getElementById('sCode').value;
   document.getElementById('edit').style.display="";
document.getElementById('sCode').style.display="none";
    document.getElementById('edit').contentWindow.document.designMode = "on";
  document.getElementById('tip').innerText="請使用 Ctrl+V 把內(nèi)容復(fù)制到這里 >>";
document.getElementById('tranButton').disabled=""
}
}
/SCRIPT>
style>
body{background:#688ABD;margin:2px;}
label{color:#fff;}
th{font-size:14px;font-family:verdana,宋體;font-weight:bold;color:fc6;text-align:left}
#sCode{width:400;height:150px;border:1px solid #1F2F47;margin-top:0px !important;margin-top:-1px;margin-bottom:0px !important;margin-bottom:-1px;}
#ReCode{width:400;height:150px;border:1px solid #1F2F47;font-size:12px;}
#edit{width:398;height:148px;border:1px solid #1F2F47;background:#fff;font-size:12px}
.input{
 border-top:1px solid #fff;
 border-right:1px solid #003;
 border-bottom:1px solid #003;
 border-left:1px solid #fff;
 background:#F4F7FB;
}
.tip{
 color:#ffc;
 font-weight:bold;
 font-size:12px;
 font-family:宋體;
}
/style>
/head>
body onload="Start()" style="">
table border="0" align="center">
tr>
th style="">Html轉(zhuǎn)換UBB程序/th>
/tr>
tr>
td style="font-size:12px;">
 label for="Source">input type="checkbox" id="Source" onclick="ViewSource(this.checked)">查看源代碼 /label>
         input id="tranButton" type="button" value="轉(zhuǎn) 換" onclick="trans()" class="input">
         input type="button" value="清 除" onclick="clearCode()" class="input">/td>
/tr>
tr>
td class="tip">
         span id="tip">請使用 Ctrl+V 把內(nèi)容復(fù)制到這里 >>/span>/td>
/tr>
tr>
td>
         textarea id="sCode" style="display:none">/textarea>
         iframe id="edit"src="about:blank" border="0" frameborder="0">/iframe>
/td>
/tr>
tr>
td class="tip">
         轉(zhuǎn)換輸出代碼 >>/td>
/tr>
tr>
td>
         textarea id="ReCode" readonly="readonly">/textarea>
        /td>
/tr>
/table>
/body>
/html>

標(biāo)簽:海南 邯鄲 婁底 德陽 樂山 衡陽 內(nèi)江 黔東

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《簡單的Html轉(zhuǎn)換UBB的程序》,本文關(guān)鍵詞  簡單,的,Html,轉(zhuǎn)換,UBB,程序,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《簡單的Html轉(zhuǎn)換UBB的程序》相關(guān)的同類信息!
  • 本頁收集關(guān)于簡單的Html轉(zhuǎn)換UBB的程序的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 国产91极品身材白皙女友| 一天能看三次的含羞草传媒| 中国一级毛片卡| 乱色欧美videos黑人69| 美女视频免费黄的| 欧美丝袜videohd| 美女脱精光让男人桶到爽在线观看| 日本艳母| 麻花豆精品秘?国产AV视频| 亚洲欧美日韩国产专区一区| 精品无码久久久久久动漫软件 | 艳母1~6| 女上男下视频| 国产三级大片| 全黄h全肉灌尿| 国产AV无码秘?在线网站| 黄视频网站| 猎户粗又长h一女多男| 高h肉文在线阅读| 成人午夜视频在线观看| 黄色网日本| 亚洲人成网站色7777| 夜色7737直播app| 涩涩涩视频| 一本色道久久88综合日韩| 亚洲午夜国产片在线观看| 小东西乱喷水调教你h| 一本一道波多野结衣a?v| 老子的大ji巴cao死你| 欧美gay18巨大| 美女脱内衣给男生玩奶| 欧美日韩Av无码精品一区二区| 美女视频很黄很暴黄是免费的 | 短篇色情亂伦小说合集苏老师| 男人把女人捅爽30分钟| 欧美亚洲日本另类人人澡gogo| 天天操天天碰| 久久九九久精品国产免费直播小说| 农村乡下毛片一级的看| 男男腐肉| 欧美综合|