📄 post.js
字号:
AddTxt="[glow=255,red,2]"+txt;
AddText(AddTxt);
AddTxt="[/glow]";
AddText(AddTxt);
} else {
AddTxt="[glow="+txt2+"]"+txt;
AddText(AddTxt);
AddTxt="[/glow]";
AddText(AddTxt);
}
}
}
}
}
function center() {
if (helpmode) {
alert(js_align_help);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="[align=center]"+text+"[/align]";
AddText(AddTxt);
} else {
txt2=prompt(js_align_type,"center");
while ((txt2!="") && (txt2!="center") && (txt2!="left") && (txt2!="right") && (txt2!=null)) {
txt2=prompt(js_align_error,"");
}
txt=prompt(js_align,js_word);
if (txt!=null) {
AddTxt="\r[align="+txt2+"]"+txt;
AddText(AddTxt);
AddTxt="[/align]";
AddText(AddTxt);
}
}
}
function image() {
if (helpmode){
alert(js_img);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="[img]"+text+"[/img]";
AddText(AddTxt);
} else {
txt=prompt(js_url,"http://");
if(txt!=null) {
AddTxt="\r[img]"+txt;
AddText(AddTxt);
AddTxt="[/img]";
AddText(AddTxt);
}
}
}
function showurl() {
if (helpmode){
alert(js_url_help);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="[url="+text+"]"+text+"[/url]";
AddText(AddTxt);
} else {
txt2=prompt(js_url_name,"");
if (txt2!=null) {
txt=prompt(js_url,"http://");
if (txt2!=null) {
if (txt2=="") {
AddTxt="[url]"+txt;
AddText(AddTxt);
AddTxt="[/url]";
AddText(AddTxt);
} else {
if(txt==""){
AddTxt="[url]"+txt2;
AddText(AddTxt);
AddTxt="[/url]";
AddText(AddTxt);
} else{
AddTxt="[url="+txt+"]"+txt2;
AddText(AddTxt);
AddTxt="[/url]";
AddText(AddTxt);
}
}
}
}
}
}
function showcode() {
if (helpmode) {
alert(js_code_help);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="\r\n[code]"+text+"[/code]";
AddText(AddTxt);
} else {
txt=prompt(js_code,"");
if (txt!=null) {
AddTxt="\r[code]"+txt;
AddText(AddTxt);
AddTxt="[/code]";
AddText(AddTxt);
}
}
}
function list() {
if (helpmode) {
alert(js_list_help);
} else if (nomode) {
AddTxt="\r[list]\r[*]\r[*]\r[*]\r[/list]";
AddText(AddTxt);
} else {
txt=prompt(js_list_type,"");
while ((txt!="") && (txt!="A") && (txt!="a") && (txt!="1") && (txt!=null)) {
txt=prompt(js_list_error,"");
}
if (txt!=null) {
if (txt==""){
AddTxt="\r[list]\r\n";
} else if (txt=="1") {
AddTxt="\r[list=1]\r\n";
} else if(txt=="a") {
AddTxt="\r[list=a]\r\n";
}
ltxt="1";
while ((ltxt!="") && (ltxt!=null)) {
ltxt=prompt(js_list,"");
if (ltxt!="") {
AddTxt+="[*]"+ltxt+"\r";
}
}
AddTxt+="[/list]\r\n";
AddText(AddTxt);
}
}
}
function underline() {
if (helpmode) {
alert(js_underline_help);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="[u]"+text+"[/u]";
AddText(AddTxt);
} else {
txt=prompt(js_underline,js_word);
if (txt!=null) {
AddTxt="[u]"+txt;
AddText(AddTxt);
AddTxt="[/u]";
AddText(AddTxt);
}
}
}
function rming() {
if (helpmode) {
alert(js_rm);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="[rm]"+text+"[/rm]";
AddText(AddTxt);
} else {
txt=prompt(js_url,"http://");
if(txt!=null) {
AddTxt="\r[rm]"+txt;
AddText(AddTxt);
AddTxt="[/rm]";
AddText(AddTxt);
}
}
}
function wmv() {
if (helpmode){
alert(js_wmv);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="[wmv]"+text+"[/wmv]";
AddText(AddTxt);
} else {
txt=prompt(js_url,"http://");
if(txt!=null) {
AddTxt="\r[wmv]"+txt;
AddText(AddTxt);
AddTxt="[/wmv]";
AddText(AddTxt);
}
}
}
function setswf() {
if (helpmode){
alert(js_flash);
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="\r[flash=400,300]"+text+"[/flash]";
AddText(AddTxt);
} else {
txt2=prompt(js_height,"400,300");
if (txt2!=null) {
txt=prompt(js_url,"http://");
if (txt!=null) {
if (txt2=="") {
AddTxt="[flash=400,300]"+txt;
AddText(AddTxt);
AddTxt="[/flash]";
AddText(AddTxt);
} else {
AddTxt="\r[flash="+txt2+"]"+txt;
AddText(AddTxt);
AddTxt="[/flash]";
AddText(AddTxt);
}
}
}
}
}
function replac()
{
if (helpmode)
{
alert(js_replace);
}
else
{
txt2=prompt(js_search,"");
if (txt2 != null)
{
if (txt2 != "")
{
txt=prompt(js_keyword,txt2);
}
else
{
replac();
}
var Rtext = txt2; var Itext = txt;
Rtext = new RegExp(Rtext,"g");
document.FORM.content.value =document.FORM.content.value.replace(Rtext,Itext);
}
}
}
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,"[url=$1]$2[/url]");
str = str.replace(/<font[^>]+color=([^ >]+)[^>]*>(.*?)<\/font>/ig,"[color=$1]$2[/color]");
str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/ig,"[img]$1[/img]");
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=([^\]]+)\](\[img\]\1\[\/img\])\[\/url\]/g,"$2");
return str;
}
function trans(){
var str = "";
xydwcopy.focus();
xydwcopy.document.body.innerHTML = "";
xydwcopy.document.execCommand("paste");
str = xydwcopy.document.body.innerHTML;
if(str.length == 0) {
alert("剪切版不存在超文本数据!");
return "";
}
return html_trans(str);
}
function xydwtrans(){
var str = "";
xydwcopy.focus();
xydwcopy.document.body.innerHTML = "";
xydwcopy.document.execCommand("paste");
str = xydwcopy.document.body.innerHTML;
if(str.length == 0) {
alert("剪切版不存在超文本数据!");
return "";
}
return str;
}
function nextpage(){
AddTxt = "[next]"
AddText(AddTxt);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -