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

📄 checkreply.js

📁 一个用Java编写的记事本源程序
💻 JS
字号:
function reply(){
document.getElementById('replyForm').action="/postReply.do";
if(document.getElementById('replyForm').txt.value.length > 1000){
alert("评论字数太多,不能发布");
document.getElementById('replyForm').txt.focus();
return false;
}
if(document.getElementById('replyForm').txt.value.length==''){
document.getElementById('replyForm').txt.focus();
return false;
}
//document.getElementById('replyForm').remark.value=document.getElementById('replyForm').remark.value.replace(/>/g,'>');
//document.getElementById('replyForm').remark.value=document.getElementById('replyForm').remark.value.replace(/</g,'&lt;');
document.all.remark.value=UBBCode(document.all.txt.value,"html");
if(document.getElementById('replyForm').remarker.value == null)
document.getElementById('replyForm').remarker.value = '匿名';
document.getElementById('replyForm').submit();
}

function popColor()
{ 
  addUBB("[color="+document.all.select2.value+"][/color]");
}
function addUBB(str)
{
  document.all.txt.value+=str;
}
function addImg()
{
  var txt=prompt("请输入图片地址","http://");
  if(txt!==null)
  {
  addUBB("[Img]"+txt+"[/Img]");
  }
}
function addLink()
{
  var txt=prompt("请输入连接地址","http://");
  if(txt!==null)
  {
   addUBB("[URL]"+txt+"[/URL]");
  }
}
function addMove()
{
  var txt=prompt("请输入文字","文字");
  if(txt!==null)
  {
  addUBB("[Move]"+txt+"[/Move]");
  }
}
function addFly()
{
  var txt=prompt("请输入文字","文字");
  if(txt!==null)
  {
  addUBB("[Fly]"+txt+"[/Fly]");
  }
}
function setSize()
{
  var temp=document.all.select.value;
  addUBB('[size='+temp+'][/size]');

}

function img_auto_size(oldimg,maxSize,openNewWindow){
	var newimg = new Image();
	newimg.src = oldimg.src;
	if (newimg.width > 0 && newimg.height > 0) {
		if (newimg.width > maxSize){ 
			oldimg.width = maxSize;
			oldimg.height = (newimg.height * maxSize) / newimg.width;
			oldimg.onmouseover = function() {
				this.style.cursor= "hand";
			};
			oldimg.onmouseout = function() {
				this.style.cursor="";
			};
			if(openNewWindow){
				oldimg.onclick = function() {
					window.open(this.src, '_blank');
				};
			}
		} else {
			oldimg.width = newimg.width; 
			oldimg.height = newimg.height;
		}
		oldimg.alt = "Click to view in original size " + newimg.width + " x " + newimg.height;
	}
} 

⌨️ 快捷键说明

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