电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

UBB编辑器原来就这么简单


发布日期:2021/11/9
 
<script>

/*

* 功能UBB编辑控制函数

* 参数: tag 为标签名称val 为标签参数

* 返回[标签名称=参数]修饰文字[/标签名称]

* [标签名称]修饰文字[/标签名称]

* [标签名称=参数][/标签名称]

*/

function ubbaction(tag val){

var tag = tagtoUpperCase();

if(typeof(val) == undefined){

val = ;

}

if(val){

val = = + val;

}

var r = documentselectioncreateRange()text;

if(tag == URL){

val = prompt(请输入连接地址:(留空为选定地址) //);

if(val != // && val != ){

val = = + val;

}else{

val = ;

}

}

if(tag == MAIL){

val = prompt(请输入邮箱地址:(留空为选定地址) );

if(val != ){

val = = + val;

}

}

rr = [ + tag + val + ] + r + [/ + tag +];

if(r){

documentselectioncreateRange()text = rr;

}else{

ntentvalue += rr;

}

}

</script>

<form name=form method=post action=>

<input type=button name=Submit value=B onClick=ubbaction(B)>

<input type=button name=Submit value=I onClick=ubbaction(I)>

<input type=button name=Submit value=U onClick=ubbaction(U)>

<select name=ffont onChange=ubbaction(FONT thisoptions[thisselectedIndex]value); thisvalue = ;>

<option value=>FONT</option>

<option value=Arial style=fontfamily:Arial>Arial</option>

<option value=Times style=fontfamily:Times>Times</option>

<option value=Courier style=fontfamily:Courier>Courier</option>

<option value=Impact style=fontfamily:Impact>Impact</option>

<option value=Geneva style=fontfamily:Geneva>Geneva</option>

<option value=Optima style=fontfamily:Optima>Optima</option>

</select>

<select name=fsize onChange=ubbaction(SIZE thisoptions[thisselectedIndex]value); thisvalue = ;>

<option value=>SIZE</option>

<option value=>Small</option>

<option value=>Large</option>

<option value=>Largest</option>

</select>

<select name=fcolor onChange=ubbaction(COLOR thisoptions[thisselectedIndex]value); thisvalue = ;>

<option value=>COLOR</option>

<option value=black >Black</option>

<option value=red >Red</option>

<option value=yellow >Yellow</option>

<option value=pink >Pink</option>

<option value=green >Green</option>

<option value=orange >Orange</option>

<option value=purple >Purple</option>

<option value=blue >Blue</option>

<option value=beige >Beige</option>

<option value=brown >Brown</option>

<option value=teal >Teal</option>

<option value=navy >Navy</option>

<option value=maroon >Maroon</option>

<option value=limegreen >LimeGreen</option>

</select>

<br>

<input type=button name=Submit value=URL onClick=ubbaction(URL)>

<input type=button name=Submit value=IMG onClick=ubbaction(IMG)>

<input type=button name=Submit value=CODE onClick=ubbaction(CODE)>

<input type=button name=Submit value=MAIL onClick=ubbaction(MAIL)>

<input type=button name=Submit value=QUOTE onClick=ubbaction(QUOTE)>

<input type=button name=Submit value=LIST onClick=ubbaction(LIST)>

<br>

<textarea name=content cols= rows= id=content></textarea>

<input type=submit name=Submit value=提交>

</form>

上一篇:驯服Tiger之深入研究枚举类型

下一篇:格式化输出数字