⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.js

📁 配置JSP环境
💻 JS
字号:
defaultmode = "divmode";
var text = "";
var js_bits 			='已有字节数';
var js_help				='XYDW 代码 - 帮助信息\\n\\n点击相应的代码按钮即可获得相应的说明和提示';
var js_direct			='XYDW 代码 - 直接插入\\n\\n点击代码按钮后不出现提示即直接插入相应代码';
var js_remind			='XYDW 代码 - 提示插入\\n\\n点击代码按钮后出现向导窗口帮助您完成代码插入';
var js_size_help		='文字大小标记\\n设置文字大小.\\n可变范围 1 - 6.\\n 1 为最小 6 为最大.\\n用法:  ';
var js_size				='大小';
var js_font_help		='字体标记\\n给文字设置字体.\\n用法: ';
var js_font				='要设置字体的文字';
var js_word				='文字';
var js_color_help		='颜色标记\\n设置文本颜色.  任何颜色名都可以被使用.\\n用法: ';
var js_color			='选择的颜色是:  ';
var js_bold_help		='加粗标记\\n使文本加粗.\\n用法: [b]这是加粗的文字[/b]';
var js_bold				='文字将被变粗.';
var js_italic_help		='斜体标记\\n使文本字体变为斜体.\\n用法: [i]这是斜体字[/i]';
var js_italic			='文字将变斜体';
var js_quote_help		='引用标记\\n引用一些文字.\\n用法: [quote]引用内容[/quote]';
var js_quote			='被引用的文字';
var js_fly_help			='飞行标记\\n使文字飞行.\\n用法: [fly]文字为这样文字[/fly]';
var js_fly				='飞行文字';
var js_move_help		='移动标记\\n使文字产生移动效果.\\n用法: [move]要产生移动效果的文字[/move]';
var js_move				='要产生移动效果的文字';
var js_shadow_help		='阴影标记\\n使文字产生阴影效果.\\n用法: [SHADOW=宽度, 颜色, 边界]要产生阴影效果的文字[/SHADOW]';
var js_shadow			='要产生阴影效果的文字';
var js_glow_help		='光晕标记\\n使文字产生光晕效果.\\n用法: [GLOW=宽度, 颜色, 边界]要产生光晕效果的文字[/GLOW]';
var js_glow_size		='文字的长度、颜色和边界大小';
var js_glow				='要产生光晕效果的文字';
var js_align_help		='对齐标记\\n使用这个标记, 可以使文本左对齐、居中、右对齐.\\n用法: [align=center|left|right]要对齐的文本[/align]';
var js_align_type		='对齐样式\\n输入 ’center’ 表示居中, ’left’ 表示左对齐, ’right’ 表示右对齐.';
var js_align_error		='错误!\\n类型只能输入 ’center’ 、 ’left’ 或者 ’right’.';
var js_align			='要对齐的文本';
var js_rm				='RM音乐标记\\n插入一个RM链接标记\\n使用方法: [rm]http://www.xydw.com/php.rm[/rm]';
var js_img				='图片标记\\n插入图片\\n用法: [img]http://www.xydw.com/php.gif[/img]';
var js_wmv				='wmv标记\\n插入wmv\\n用法: [wmv]http://www.xydw.com/php.wmv[/wmv]';
var js_url_help			='url标记\\n使用url标记,可以使输入的url地址以超链接的形式在帖子中显示.\\n使用方法:\\n [url]url地址[/url]';
var js_url_name			='URL 名称: 比如 进入 心雨动网(可以为空)';
var js_url				='URL 地址';
var js_code_help		='代码标记\\n使用代码标记,可以使你的程序代码里面的 html 等标志不会被破坏.\\n使用方法:\\n [code]这里是代码文字[/code]';
var js_code				='输入代码';
var js_list_help		='列表标记\\n建造一个文字或则数字列表.\\nUSE: [list]\\n[*]item1\\n[*]item2\\n[*]item3\\n[/list]';
var js_list_type		='列表类型\\n输入 ’a’ 表示字母列表, ’1’ 表示数字列表, 留空表示普通列表.';
var js_list_error		='错误!\\n类型只能输入 ’a’、’A’ 、 ’1’ 或者留空.';
var js_list				='列表项\\n空白表示结束列表';
var js_underline_help	='下划线标记\\n给文字加下划线.\\n用法: [u]要加下划线的文字[/u]';
var js_underline		='下划线文字';
var js_flash			='Flash 动画\\n插入 Flash 动画.\\n用法: [flash=宽度,高度]Flash 文件的地址[/flash]';
var js_height			='宽度,高度';
var js_js_replace		='';
var js_search			='请输入搜寻目标关键字';
var js_keyword			='关键字替换为:';


if (defaultmode == "nomode") {
        helpmode = false;
        divmode = false;
        nomode = true;
} else if (defaultmode == "helpmode") {
        helpmode = true;
        divmode = false;
        nomode = false;
} else {
        helpmode = false;
        divmode = true;
        nomode = false;
}
function checkmode(swtch){
        if (swtch == 1){
                nomode = false;
                divmode = false;
                helpmode = true;
                alert(js_help);
        } else if (swtch == 0) {
                helpmode = false;
                divmode = false;
                nomode = true;
                alert(js_direct);
        } else if (swtch == 2) {
                helpmode = false;
                nomode = false;
                divmode = true;
                alert(js_remind);
        }
}
function getActiveText(selectedtext) {
  text = (document.all) ? document.selection.createRange().text : document.getSelection();
  if (selectedtext.createTextRange) {	
    selectedtext.caretPos = document.selection.createRange().duplicate();	
  }
	return true;
}
function submitonce(theform)
{
	if (document.all||document.getElementById)
	{
		for (i=0;i<theform.length;i++)
		{
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=true;
		}
	}
}
function checklength(theform)
{
	alert(js_bits+theform.content.value.length);
}
function AddText(NewCode) 
{
	if (document.FORM.content.createTextRange && document.FORM.content.caretPos) 
	{
		var caretPos = document.FORM.content.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? NewCode + ' ' : NewCode;
	} 
	else 
	{
		document.FORM.content.value+=NewCode
	}
	setfocus();
}
function setfocus()
{
  document.FORM.content.focus();
}


function showsize(size) {
	if (helpmode) {
		alert(js_size_help+"[size="+size+"] "+size+js_word+"[/size]");
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[size="+size+"]"+text+"[/size]";
		AddText(AddTxt);
	} else {
		txt=prompt(js_size+size,js_word);
		if (txt!=null) {
			AddTxt="[size="+size+"]"+txt;
			AddText(AddTxt);
			AddTxt="[/size]";
			AddText(AddTxt);
		}
	}
}

function showfont(font) {
 	if (helpmode){
		alert(js_font_help+" [font="+font+"]"+font+"[/font]");
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[font="+font+"]"+text+"[/font]";
		AddText(AddTxt);
	} else {
		txt=prompt(js_font+font,js_word);
		if (txt!=null) {
			AddTxt="[font="+font+"]"+txt;
			AddText(AddTxt);
			AddTxt="[/font]";
			AddText(AddTxt);
		}
	}
}
function showcolor(color) {
	if (helpmode) {
		alert(js_color_help+"[color="+color+"]"+color+"[/color]");
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[color="+color+"]"+text+"[/color]";
		AddText(AddTxt);
	} else {  
     	txt=prompt(js_color+color,js_word);
		if(txt!=null) {
			AddTxt="[color="+color+"]"+txt;
			AddText(AddTxt);
			AddTxt="[/color]";
			AddText(AddTxt);
		}
	}
}

function bold() {
	if (helpmode) {
		alert(js_bold_help);
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[b]"+text+"[/b]";
		AddText(AddTxt);
	} else {
		txt=prompt(js_bold,js_word);
		if (txt!=null) {
			AddTxt="[b]"+txt;
			AddText(AddTxt);
			AddTxt="[/b]";
			AddText(AddTxt);
		}
	}
}

function italicize() {
	if (helpmode) {
		alert(js_italic_help);
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[i]"+text+"[/i]";
		AddText(AddTxt);
	} else {
		txt=prompt(js_italic,js_word);
		if (txt!=null) {
			AddTxt="[i]"+txt;
			AddText(AddTxt);
			AddTxt="[/i]";
			AddText(AddTxt);
		}
	}
}

function quoteme() {
	if (helpmode){
		alert(js_quote_help);
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[quote]"+text+"[/quote]";
		AddText(AddTxt);
	} else {
		txt=prompt(js_quote,js_word);
		if(txt!=null) {
			AddTxt="[quote]"+txt;
			AddText(AddTxt);
			AddTxt="[/quote]";
			AddText(AddTxt);
		}
	}
}
function setfly() {
 	if (helpmode){
		alert(js_fly_help);
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[fly]"+text+"[/fly]";
		AddText(AddTxt);
	} else {
		txt=prompt(js_fly,js_word);
		if (txt!=null) {
			AddTxt="[fly]"+txt;
			AddText(AddTxt);
			AddTxt="[/fly]";
			AddText(AddTxt);
		}
	}
}

function movesign() {
	if (helpmode) {
		alert(js_move_help);
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[move]"+text+"[/move]";
		AddText(AddTxt);
	} else {
		txt=prompt(js_move,js_word);
		if (txt!=null) {
			AddTxt="[move]"+txt;
			AddText(AddTxt);
			AddTxt="[/move]";
			AddText(AddTxt);
		}
	}
}

function shadow() {
	if (helpmode) {
		alert(js_shadow_help);
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[SHADOW=255,blue,1]"+text+"[/SHADOW]";
		AddText(AddTxt);
	} else {
		txt2=prompt(js_glow_size,"255,blue,1");
		if (txt2!=null) {
			txt=prompt(js_shadow,js_word);
			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 (helpmode) {
		alert(js_glow_help);
	} else if (nomode || document.selection && document.selection.type == "Text") {
		AddTxt="[glow=255,red,2]"+text+"[/glow]";
		AddText(AddTxt);
	} else {
		txt2=prompt(js_glow_size,"255,red,2");
		if (txt2!=null) {
			txt=prompt(js_glow,js_word);
			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 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 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 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 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 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 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 addsmile(NewCode) {
  document.FORM.content.value += ' '+NewCode+' '; 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -