国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > ASP > 正文

淺析UBB編輯器

2024-05-04 11:05:16
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

我們?cè)谧鯾bs項(xiàng)目的時(shí)候就需要用到ubb編輯器,后臺(tái)管理人員一般使用的是CKEditor編輯器,網(wǎng)友們用的一般是ubb編輯器,很多人對(duì)ubb編輯器都不是非常的了解,下面就是錯(cuò)新小編為大家淺析UBB編輯器。

<!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"?"' target=_blank rel=nofollow>http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>UBB編輯器</title>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312">
<link?href="style.css"?rel="stylesheet"?type="text/css">
<script?language="JavaScript">
<!--
if(navigator.appName?==?"Microsoft?Internet?Explorer")
{
????isIE=true;
}
else
{
????isIE=false;
}


function?AddText(NewCode)?
{
????if(document.all){
????????insertAtCaret(document.ubbform.Content,?NewCode);
????????document.ubbform.Content.focus();
????}
????else
????{
????????document.ubbform.Content.value?+=?NewCode;
????????document.ubbform.Content.focus();
????}
}

function?insertAtCaret?(textEl,?text){
????if?(textEl.createTextRange?&&?textEl.caretPos)
????{
????????var?caretPos?=?textEl.caretPos;
????????caretPos.text?+=?caretPos.text.charAt(caretPos.text.length?-?2)?==?'?'???text?+?'?'?:?text;
????}
????else?if(textEl)
????{
????????textEl.value?+=?text;
????}
????else
????{
????????textEl.value?=?text;
????}
}

function?ubbFormat(what)?
{
????if?(document.selection?&&?document.selection.type?==?"Text")
????{
????????var?range?=?document.selection.createRange();
????????range.text?=?"["+what+"]"?+?range.text?+?"[/"+what+"]";
????}
????else
????{
????????txt=window.prompt("請(qǐng)輸入內(nèi)容","");?????
????????if?(txt!=null)?{???????????
????????????????AddTxt="["+what+"]"+txt;
????????????????AddText(AddTxt);
????????????????AddText("[/"+what+"]");
????????}???????
????}?
}

function?ubbInsert(what)?
{
????if?(document.selection?&&?document.selection.type?==?"Text")
????{
????????var?range?=?document.selection.createRange();
????????range.text?=?"["+what+"]"?+?range.text?+?"[/"+what+"]";
????}
????else
????{
????????txt=window.prompt("請(qǐng)輸入內(nèi)容","");?????
????????if?(txt!=null)?{???????????
????????????????AddTxt="["+what+"]"+txt;
????????????????AddText(AddTxt);
????????????????AddText("[/"+what+"]");
????????}???????
????}?
}

function?chsize(size)?{
????if?(document.selection?&&?document.selection.type?==?"Text")
????{
????????var?range?=?document.selection.createRange();
????????range.text?=?"[size="?+?size?+?"]"?+?range.text?+?"[/size]";
????}
????else
????{???????????????????????
????????txt=window.prompt("請(qǐng)輸入內(nèi)容","");?
????????if?(txt!=null)
????????{?????????????
????????????AddTxt="[size="+size+"]"+txt;
????????????AddText(AddTxt);
????????????AddText("[/size]");
????????}????????
????}
}

function?chfont(font)?{
????if?(document.selection?&&?document.selection.type?==?"Text")?{
????var?range?=?document.selection.createRange();
????range.text?=?""?+?range.text?+?"";
????}
????else
????{??????????????????
????????txt=window.prompt("請(qǐng)輸入內(nèi)容","");
????????if?(txt!=null)
????????{?????????????
????????????AddTxt=""+txt;
????????????AddText(AddTxt);
????????????AddText("
");
????????}????????
????}??
}

function?chcolor(color)?{
????if?(document.selection?&&?document.selection.type?==?"Text")?{
????var?range?=?document.selection.createRange();
????range.text?=?""?+?range.text?+?"";
????}
????else
????{??
????txt=window.prompt("請(qǐng)輸入內(nèi)容","");
????????if(txt!=null)?{
????????????AddTxt=""+txt;
????????????AddText(AddTxt);
????????????AddText("
");
????????}
????}
}

//-->
</script>
</head>
<body>
<form?method=post?name="ubbform"?action="">
<table?align="center"?border="0">
<tr>
????<td>
????<select?name="font"?onFocus="this.selectedIndex=0"?onChange="chfont(this.options[this.selectedIndex].value)"?size="1">
????????<option?value=""?selected>選擇字體</option>
????????<option?value="宋體">宋體</option>
????????<option?value="黑體">黑體</option>
????????<option?value="Arial">Arial</option>
????????<option?value="Book?Antiqua">Book?Antiqua</option>
????????<option?value="Century?Gothic">Century?Gothic</option>
????????<option?value="Courier?New">Courier?New</option>
????????<option?value="Georgia">Georgia</option>
????????<option?value="Impact">Impact</option>
????????<option?value="Tahoma">Tahoma</option>
????????<option?value="Times?New?Roman">Times?New?Roman</option>
????????<option?value="Verdana">Verdana</option>
????</select>
????<select?name="size"?onFocus="this.selectedIndex=0"?onChange="chsize(this.options[this.selectedIndex].value)"?size="1">
??????????<option?value=""?selected>字體大小</option>
??????????<option?value="-2">-2</option>
??????????<option?value="-1">-1</option>
??????????<option?value="1">1</option>
??????????<option?value="2">2</option>
??????????<option?value="3">3</option>
??????????<option?value="4">4</option>
??????????<option?value="5">5</option>
??????????<option?value="6">6</option>
??????????<option?value="7">7</option>
????</select>
????<select?name="color"??onFocus="this.selectedIndex=0"?onChange="chcolor(this.options[this.selectedIndex].value)"?size="1">
??????????<option?value=""?selected>字體顏色</option>
??????????<option?value="Black"?style="background-color:black;color:black;">Black</option>
??????????<option?value="White"?style="background-color:white;color:white;">White</option>
??????????<option?value="Red"?style="background-color:red;color:red;">Red</option>
??????????<option?value="Yellow"?style="background-color:yellow;color:yellow;">Yellow</option>
??????????<option?value="Pink"?style="background-color:pink;color:pink;">Pink</option>
??????????<option?value="Green"?style="background-color:green;color:green;">Green</option>
??????????<option?value="Orange"?style="background-color:orange;color:orange;">Orange</option>
??????????<option?value="Purple"?style="background-color:purple;color:purple;">Purple</option>
??????????<option?value="Blue"?style="background-color:blue;color:blue;">Blue</option>
??????????<option?value="Beige"?style="background-color:beige;color:beige;">Beige</option>
??????????<option?value="Brown"?style="background-color:brown;color:brown;">Brown</option>
??????????<option?value="Teal"?style="background-color:teal;color:teal;">Teal</option>
??????????<option?value="Navy"?style="background-color:navy;color:navy;">Navy</option>
??????????<option?value="Maroon"?style="background-color:maroon;color:maroon;">Maroon</option>
??????????<option?value="LimeGreen"?style="background-color:limegreen;color:limegreen;">LimeGreen</option>
????</select>
????</td>
</tr>
<tr>
????<td>
????<img?src="ubb/bold.gif"?border="0"?alt="粗體"?onClick="ubbFormat('B')"><img?src="ubb/italicize.gif"?border="0"?alt="斜體"?onClick="ubbFormat('I')"><img?src="ubb/underline.gif"?border="0"?alt="下劃線(xiàn)"?onClick="ubbFormat('U')"><img?src="ubb/center.gif"?border="0"?alt="居中對(duì)齊"?onClick="ubbFormat('CENTER')"><img?src="ubb/email.gif"?border="0"?alt="插入EMAIL地址"?onClick="ubbFormat('EMAIL')"><img?src="ubb/url.gif"?border="0"?alt="插入網(wǎng)址"?onClick="ubbFormat('URL')"><img?src="ubb/quote.gif"?border="0"?alt="引用內(nèi)容"?onClick="ubbFormat('QUOTE')"><img?src="ubb/wmv.gif"?border="0"?alt="插入視頻"?onClick="ubbFormat('MEDIA')"><img?src="ubb/flash.gif"?border="0"?alt="插入flash動(dòng)畫(huà)"?onClick="ubbInsert('FLASH')"><img?src="ubb/image.gif"?border="0"?alt="插入圖片"?onClick="ubbInsert('IMG')">
????</td>
</tr>
<tr>
????<td><textarea?name="Content"?rows="10"?cols="80"></textarea></td>
</tr>
<tr>
????<td></td>
</tr>
</table>
</form>
</body>
</html>

以上就是淺析UBB編輯器的內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持錯(cuò)新技術(shù)頻道。

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 资溪县| 新化县| 股票| 西乌| 佛教| 古蔺县| 武夷山市| 新密市| 大英县| 石城县| 古蔺县| 天津市| 柘荣县| 常德市| 吴川市| 靖安县| 新郑市| 衡阳市| 鄄城县| 德庆县| 石棉县| 马鞍山市| 涟源市| 香港| 当阳市| 漳州市| 体育| 隆尧县| 罗江县| 赣榆县| 寻乌县| 大田县| 孝昌县| 保德县| 美姑县| 女性| 宜兴市| 阳高县| 阜康市| 漳平市| 新宁县|