?? ubbcode.js
字號(hào):
helpstat = false;
stprompt = true;
basic = false;
function AddText(NewCode) {
document.all("content").value+=NewCode
}
function insertem(em){
AddText(em);
}
function thelp(swtch){
if (swtch == 1){
basic = false;
stprompt = false;
helpstat = true;
} else if (swtch == 0) {
helpstat = false;
stprompt = false;
basic = true;
} else if (swtch == 2) {
helpstat = false;
basic = false;
stprompt = true;
}
}
function email() {
if (helpstat) {
alert("Email 標(biāo)記\n插入 Email 超級(jí)鏈接\n用法1: [email]name@domain.com[/email]\n用法2: [email=name@domain.com]某人[/email]");
} else if (basic) {
AddTxt="[email][/email]";
AddText(AddTxt);
} else {
txt2=prompt("鏈接顯示的文字.\n如果為空,那么將只顯示你的 Email 地址","");
if (txt2!=null) {
txt=prompt("Email 地址.","name@domain.com");
if (txt!=null) {
if (txt2=="") {
AddTxt="[email]"+txt+"[/email]";
} else {
AddTxt="[email="+txt+"]"+txt2;
AddText(AddTxt);
AddTxt="[/email]";
}
AddText(AddTxt);
}
}
}
}
function flash() {
if (helpstat){
alert("Flash 動(dòng)畫(huà)\n插入 Flash 動(dòng)畫(huà).\n用法: [flash]Flash 文件的地址[/flash]");
} else if (basic) {
AddTxt="[flash][/flash]";
AddText(AddTxt);
} else {
txt=prompt("Flash 文件的地址","http://");
if (txt!=null) {
AddTxt="[flash]"+txt;
AddText(AddTxt);
AddTxt="[/flash]";
AddText(AddTxt);
}
}
}
function showsize(size) {
if (helpstat) {
alert("文字大小標(biāo)記\n設(shè)置文字大小.\n可變范圍 1 - 6.\n 1 為最小 6 為最大.\n用法: [size="+size+"]這是 "+size+" 文字[/size]");
} else if (basic) {
AddTxt="[size="+size+"][/size]";
AddText(AddTxt);
} else {
txt=prompt("大小 "+size,"文字");
if (txt!=null) {
AddTxt="[size="+size+"]"+txt;
AddText(AddTxt);
AddTxt="[/size]";
AddText(AddTxt);
}
}
}
function bold() {
if (helpstat) {
alert("加粗標(biāo)記\n使文本加粗.\n用法: [b]這是加粗的文字[/b]");
} else if (basic) {
AddTxt="[b][/b]";
AddText(AddTxt);
} else {
txt=prompt("文字將被變粗.","文字");
if (txt!=null) {
AddTxt="[b]"+txt;
AddText(AddTxt);
AddTxt="[/b]";
AddText(AddTxt);
}
}
}
function italicize() {
if (helpstat) {
alert("斜體標(biāo)記\n使文本字體變?yōu)樾斌w.\n用法: [i]這是斜體字[/i]");
} else if (basic) {
AddTxt="[i][/i]";
AddText(AddTxt);
} else {
txt=prompt("文字將變斜體","文字");
if (txt!=null) {
AddTxt="[i]"+txt;
AddText(AddTxt);
AddTxt="[/i]";
AddText(AddTxt);
}
}
}
function quote() {
if (helpstat){
alert("引用標(biāo)記\n引用一些文字.\n用法: [quote]引用內(nèi)容[/quote]");
} else if (basic) {
AddTxt="[quote][/quote]";
AddText(AddTxt);
} else {
txt=prompt("被引用的文字","文字");
if(txt!=null) {
AddTxt="[quote]"+txt;
AddText(AddTxt);
AddTxt="[/quote]";
AddText(AddTxt);
}
}
}
function showcolor(color) {
if (helpstat) {
alert("顏色標(biāo)記\n設(shè)置文本顏色. 任何顏色名都可以被使用.\n用法: [color="+color+"]顏色要改變?yōu)?quot;+color+"的文字[/color]");
} else if (basic) {
AddTxt="[color="+color+"][/color]";
AddText(AddTxt);
} else {
txt=prompt("選擇的顏色是: "+color,"文字");
if(txt!=null) {
AddTxt="[color="+color+"]"+txt;
AddText(AddTxt);
AddTxt="[/color]";
AddText(AddTxt);
}
}
}
function center() {
if (helpstat) {
alert("對(duì)齊標(biāo)記\n使用這個(gè)標(biāo)記, 可以使文本左對(duì)齊、居中、右對(duì)齊.\n用法: [align=center|left|right]要對(duì)齊的文本[/align]");
} else if (basic) {
AddTxt="[align=center|left|right][/align]";
AddText(AddTxt);
} else {
txt2=prompt("對(duì)齊樣式\n輸入 'center' 表示居中, 'left' 表示左對(duì)齊, 'right' 表示右對(duì)齊.","center");
while ((txt2!="") && (txt2!="center") && (txt2!="left") && (txt2!="right") && (txt2!=null)) {
txt2=prompt("錯(cuò)誤!\n類(lèi)型只能輸入 'center' 、 'left' 或者 'right'.","");
}
txt=prompt("要對(duì)齊的文本","文本");
if (txt!=null) {
AddTxt="\r[align="+txt2+"]"+txt;
AddText(AddTxt);
AddTxt="[/align]";
AddText(AddTxt);
}
}
}
function hyperlink() {
if (helpstat) {
alert("超級(jí)鏈接標(biāo)記\n插入一個(gè)超級(jí)鏈接標(biāo)記\n使用方法: [url]http://www.activepower.net[/url]\nUSE: [url=http://www.activepower.net]鏈接文字[/url]");
} else if (basic) {
AddTxt="[url][/url]";
AddText(AddTxt);
} else {
txt2=prompt("鏈接文本顯示.\n如果不想使用, 可以為空, 將只顯示超級(jí)鏈接地址. ","");
if (txt2!=null) {
txt=prompt("超級(jí)鏈接.","http://");
if (txt!=null) {
if (txt2=="") {
AddTxt="[url]"+txt;
AddText(AddTxt);
AddTxt="[/url]";
AddText(AddTxt);
} else {
AddTxt="[url="+txt+"]"+txt2;
AddText(AddTxt);
AddTxt="[/url]";
AddText(AddTxt);
}
}
}
}
}
function image() {
if (helpstat){
alert("圖片標(biāo)記\n插入圖片\n用法: [img]http://www.activepower.net/logo.gif[/img]");
} else if (basic) {
AddTxt="[img][/img]";
AddText(AddTxt);
} else {
txt=prompt("圖片的 URL","http://");
if(txt!=null) {
AddTxt="\r[img]"+txt;
AddText(AddTxt);
AddTxt="[/img]";
AddText(AddTxt);
}
}
}
function showcode() {
if (helpstat) {
alert("代碼標(biāo)記\n使用代碼標(biāo)記,可以使你的程序代碼里面的 html 等標(biāo)志不會(huì)被破壞.\n使用方法:\n [code]這里是代碼文字[/code]");
} else if (basic) {
AddTxt="\r[code]\r[/code]";
AddText(AddTxt);
} else {
txt=prompt("輸入代碼","");
if (txt!=null) {
AddTxt="\r[code]"+txt;
AddText(AddTxt);
AddTxt="[/code]";
AddText(AddTxt);
}
}
}
function list() {
if (helpstat) {
alert("列表標(biāo)記\n建造一個(gè)文字或則數(shù)字列表.\n\nUSE: [list] [*]項(xiàng)目一[/*] [*]項(xiàng)目二[/*] [*]項(xiàng)目三[/*] [/list]");
} else if (basic) {
AddTxt=" [list][*] [/*][*] [/*][*] [/*][/list]";
AddText(AddTxt);
} else {
txt=prompt("列表類(lèi)型\n輸入 'A' 表示有序列表, '1' 表示無(wú)序列表, 留空表示無(wú)序列表.","");
while ((txt!="") && (txt!="A") && (txt!="a") && (txt!="1") && (txt!=null)) {
txt=prompt("錯(cuò)誤!\n類(lèi)型只能輸入 'A' 、 '1' 或者留空.","");
}
if (txt!=null) {
if (txt=="") {
AddTxt="[list]";
} else {
AddTxt="[list="+txt+"]";
}
txt="1";
while ((txt!="") && (txt!=null)) {
txt=prompt("列表項(xiàng)\n空白表示結(jié)束列表","");
if (txt!="") {
AddTxt+="[*]"+txt+"[/*]";
}
}
AddTxt+="[/list] ";
AddText(AddTxt);
}
}
}
function showfont(font) {
if (helpstat){
alert("字體標(biāo)記\n給文字設(shè)置字體.\n用法: [face="+font+"]改變文字字體為"+font+"[/face]");
} else if (basic) {
AddTxt="[face="+font+"][/face]";
AddText(AddTxt);
} else {
txt=prompt("要設(shè)置字體的文字"+font,"文字");
if (txt!=null) {
AddTxt="[face="+font+"]"+txt;
AddText(AddTxt);
AddTxt="[/face]";
AddText(AddTxt);
}
}
}
function underline() {
if (helpstat) {
alert("下劃線(xiàn)標(biāo)記\n給文字加下劃線(xiàn).\n用法: [u]要加下劃線(xiàn)的文字[/u]");
} else if (basic) {
AddTxt="[u][/u]";
AddText(AddTxt);
} else {
txt=prompt("下劃線(xiàn)文字.","文字");
if (txt!=null) {
AddTxt="[u]"+txt;
AddText(AddTxt);
AddTxt="[/u]";
AddText(AddTxt);
}
}
}
function setfly() {
if (helpstat){
alert("飛翔標(biāo)記\n使文字飛行.\n用法: [fly]文字為這樣文字[/fly]");
} else if (basic) {
AddTxt="[fly][/fly]";
AddText(AddTxt);
} else {
txt=prompt("飛翔文字","文字");
if (txt!=null) {
AddTxt="[fly]"+txt;
AddText(AddTxt);
AddTxt="[/fly]";
AddText(AddTxt);
}
}
}
function move() {
if (helpstat) {
alert("移動(dòng)標(biāo)記\n使文字產(chǎn)生移動(dòng)效果.\n用法: [move]要產(chǎn)生移動(dòng)效果的文字[/move]");
} else if (basic) {
AddTxt="[move][/move]";
AddText(AddTxt);
} else {
txt=prompt("要產(chǎn)生移動(dòng)效果的文字","文字");
if (txt!=null) {
AddTxt="[move]"+txt;
AddText(AddTxt);
AddTxt="[/move]";
AddText(AddTxt);
}
}
}
function shadow() {
if (helpstat) {
alert("陰影標(biāo)記\n使文字產(chǎn)生陰影效果.\n用法: [SHADOW=寬度, 顏色, 邊界]要產(chǎn)生陰影效果的文字[/SHADOW]");
} else if (basic) {
AddTxt="[SHADOW=255,blue,1][/SHADOW]";
AddText(AddTxt);
} else {
txt2=prompt("文字的長(zhǎng)度、顏色和邊界大小","255,blue,1");
if (txt2!=null) {
txt=prompt("要產(chǎn)生陰影效果的文字","文字");
if (txt!=null) {
if (txt2=="") {
AddTxt="[SHADOW=255, blue, 1]"+txt;
AddText(AddTxt);
AddTxt="[/SHADOW]";
AddText(AddTxt);
} else {
AddTxt="[SHADOW="+txt2+"]"+txt;
AddText(AddTxt);
AddTxt="[/SHADOW]";
AddText(AddTxt);
}
}
}
}
}
function glow() {
if (helpstat) {
alert("光暈標(biāo)記\n使文字產(chǎn)生光暈效果.\n用法: [GLOW=寬度, 顏色, 邊界]要產(chǎn)生光暈效果的文字[/GLOW]");
} else if (basic) {
AddTxt="[glow=255,red,2][/glow]";
AddText(AddTxt);
} else {
txt2=prompt("文字的長(zhǎng)度、顏色和邊界大小","255,red,2");
if (txt2!=null) {
txt=prompt("要產(chǎn)生光暈效果的文字.","文字");
if (txt!=null) {
if (txt2=="") {
AddTxt="[glow=255,red,2]"+txt;
AddText(AddTxt);
AddTxt="[/glow]";
AddText(AddTxt);
} else {
AddTxt="[glow="+txt2+"]"+txt;
AddText(AddTxt);
AddTxt="[/glow]";
AddText(AddTxt);
}
}
}
}
}
function openscriphtml()
{
if (navigator.appName!="Microsoft Internet Explorer")
alert("此功能 Netscape 用戶(hù)不能使用!");
else
{newwin=window.open('htmledit/editor.html','','width=544,height=294');
newwin.focus();
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -