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

📄 hougnt.html

📁 实现了一个对图象进行处理的算法功能
💻 HTML
📖 第 1 页 / 共 5 页
字号:
		G("signNamePanel").style.display = "none";
	}else{
		if(need_verify==10||len>5000){
			document.getElementById('yzm').innerHTML=yzm_str;
			document.getElementById('yzm').style.display="";
		}else{
			document.getElementById('yzm').innerHTML='';
			document.getElementById('yzm').style.display="none";
		}
		G("signNamePanel").style.display = "";
	}
}


function f_submit(){
	try{
		if(f_check()){
		
			var params = [
					["co",ContentInput.getHtml()],
					["ct",document.post.ct],
					["tn",document.post.tn],
					["word",document.post.word],
					["word1",document.post.word1],
					["lm",document.post.lm],
					["z",document.post.z],
					["sc",document.post.sc],
					["cm",document.post.cm],
					["rn",document.post.rn],
					["bs",document.post.bs],
					["str2",document.post.str2],
					["str3",document.post.str3],
					["rs3",document.post.rs3],
					["str4",document.post.str4],
					["bu",document.post.bu],
					["code",document.post.code],
					["ti",document.post.ti],
					["rs4",document.post.rs4],
					["ch1",document.post.ch1],
					["rs1",document.post.rs1]
				];

			if(document.post.ch1 && document.post.ch1.checked && document.post.useSignName && document.post.useSignName.checked){
				params[params.length] = ["rs10",document.post.signName];
			}
			var paramstr = buildParamDataString(params);

			formApply(paramstr);
		}
	}catch(e){}
	return false;
};

function formApply(paramsStr)
{					
	var url = "/f";	

	this.popup = null;

	var postProcess = function(xmlHttp)
	{
		
		var rst = eval("(" + xmlHttp.responseText + ")");
		var no = rst.resultNo;
		var doAction = function(result){

			switch(result.getActionType()){
				case result.Action_FocusTitle:
					if(document.post.ti){
						document.post.ti.focus();
						document.post.ti.value = document.post.ti.value;
					}
					break;
				case result.Action_FocusContent:
					setTimeout(function(){
						ContentInput.focus();
					},400);
					break;
				case result.Action_ClearYZM:
					if(document.post.word1){
						document.post.word1.value = "";
						document.post.word1.focus();
					}
					break;
				case result.Action_FocusUrl:
					setTimeout(function(){
						ContentInput.focus();
					},400);
					break;
				case result.Action_GoToHead:
					document.location.hash="pgTop";
					break;
				case result.Action_FlushAndGoToHead:
					ContentInput.clearHtml();
					document.location.href = document.location.href.split("#")[0];
					break;
				default:
					break;
			}
		};

		if(no == 0) {// 成功
			setTimeout(function(){
				doAction(rst);
			},500);
		}else{
			if(rst.isNeedWaitForCheck()){// 等待审核
				AlertPopup.alertMessage({width:340,height:165,title:"发表贴子",messageTitle:"等待审核...", content: rst.getMessage()}, function(){
					doAction(rst);
					document.post.Submit3.disabled = false;
					return true;
				});
			}else {// 失败
				AlertPopup.alertError({width:340,height:165,title:"发表贴子",messageTitle:"发贴失败", content: rst.getMessage()}, function(){
					doAction(rst);
					document.post.Submit3.disabled = false;
					return true;
				});
			}
		}
	};
	document.post.Submit3.disabled = true;
	new Ajax.Request(
	  url,
	  {
			method: "post",
			parameters: paramsStr,
			onComplete: function(xmlHttp){postProcess(xmlHttp);}
	   }
	);
};

function f_check() {

	var imageNum = ContentInput.getImageNum();
	if(imageNum > g_pg.imageLimite){
		G("coError").innerHTML = "抱歉,每层楼插入的图片不能超过" + g_pg.imageLimite + "张,请修改后重新提交";
		ContentInput.focus();
		return false;  
	}

	var flashNum = ContentInput.getFlashNum();
	if(flashNum > g_pg.flashLimite){
		G("coError").innerHTML = "抱歉,每层楼插入的视频不能超过" + g_pg.imageLimite + "个,请修改后重新提交";
		ContentInput.focus();
		return false;  
	}

	var smileyNum = ContentInput.getSmileyNum();
	if(smileyNum > g_pg.smileyLimite){
		G("coError").innerHTML = "抱歉,每层楼插入的表情不能超过" + g_pg.smileyLimite + "个,请修改后重新提交";
		ContentInput.focus();
		return false;  
	}

 ls_content = ContentInput.getHtml();

 if(ContentInput.isEmpty())
 {
    G("coError").innerHTML = "内容不能为空";
	ContentInput.focus();
    return false;
 }
 
 
 if(need_verify==10){
  if(document.post.word1.value == '' || document.post.word1.value == null)
   {
     G("yzmError").innerHTML = "验证码不能为空,请输入验证码";
	 document.post.word1.focus();
     return false;
   }
 }
 
 
 document.post.str2.value = fr_as_js_tr();
  return true;
}



r_url=f_escape(window.location.href);
function ResetReplyTitle(no, title) {

		

        if(no == null||no == ""){
          if(title == null || title == '')
            title_src = g_bdThreadTitleTxt;
          else
            title_src = title;
        }
        else{
          title_src = G(title).value;// title is a id on here
          var s = title_src.indexOf(":");
          title_src = title_src.substring(s+1,title_src.length);
        }
        //删除末尾可能的空格  
        if(title_src.lastIndexOf(" ") == title_src.length-1)
		{
			title_src = title_src.substring(0,title_src.lastIndexOf(" "));
		}

		document.post.ti.value='回复' + no + ':' + title_src;
		
		if(no && no!="" && no != '1'){
			if(ContentInput.isEmpty()){
				ContentInput.appendHtml('回复:'+no+'楼<br>');
			}else{
				ContentInput.appendHtml('<br>回复:'+no+'楼<br>');
			}
		}
		setTimeout(function(){
			ContentInput.focus();
		},300);

        return true;
}


function f_load(){


resetChangedSizeImage();

}

function f_focus(){
 
 if(need_verify==10){
  if(document.getElementById('yzm').innerHTML==null || document.getElementById('yzm').innerHTML==''){
    document.getElementById('yzm').innerHTML=yzm_str;
	document.getElementById('yzm').style.display="";
  }
 }
 
  
}

function f_showVerify(){
	var len;
	len = getByte(ContentInput.getHtml())
	if(len>5000||need_verify==10){
		if(document.getElementById('yzm').innerHTML==null || document.getElementById('yzm').innerHTML==''){
			document.getElementById('yzm').innerHTML=yzm_str;
			document.getElementById('yzm').style.display="";
		}
	}else{
		if(document.post.ch1.checked){
			document.getElementById('yzm').innerHTML='';
			document.getElementById('yzm').style.display="none";
		}
	}
}
function f_paste(){

	f_showVerify();
	
	if(document.post.ch1 && document.post.ch1.checked){
		SignNameApply.active();
	}
}



*/




// end 新版









function check_img(){
document.post.word1.focus();
 var o_img = document.getElementById('y_img');
 o_img.src=img_str +"&t="+ Math.random();
 document.post.word1.value="";
}


function f_trim(inputString) {
    if (typeof inputString != 'string') { return inputString; }
    var retValue = inputString;
    var ch = retValue.substring(0, 1);
    while (ch == ' ' || ch == '\r' || ch == '\n') {
   retValue = retValue.substring(1, retValue.length);
   ch = retValue.substring(0, 1);
    }
    ch = retValue.substring(retValue.length-1, retValue.length);
    while (ch == ' ' || ch == '\r' || ch == '\n') {
   retValue = retValue.substring(0, retValue.length-1);
   ch = retValue.substring(retValue.length-1, retValue.length);
    }
    while (retValue.indexOf('  ') != -1) {
   retValue = retValue.substring(0, retValue.indexOf('  ')) +
      retValue.substring(retValue.indexOf('  ')+1, retValue.length);
    }
    return retValue;
}




function h(obj,url){
obj.style.behavior='url(#default#homepage)';
obj.setHomePage(url);
}
function getLeftChars(varField,limit_len) {
    var i = 0;
    var counter = 0;
    var cap = limit_len;
    var j=0;
    for (i = 0; i< varField.value.length; i++) {
     if (varField.value.charCodeAt(i) > 127 || varField.value.charCodeAt(i) == 94) {
        j=j+2;
        }
     else {
        j=j+1
     }
    }  //结束FOR循环
    //var leftchars = cap - varField.value.length;
    var leftchars = cap - j;
    return (leftchars);
}
function onCharsChange(varField,a_str,a_limit) {
    var leftChars = getLeftChars(varField,a_limit);
    if ( leftChars >= 0) {
   return true;
    } else {
      ls_str = a_str + "超过字数限制!";
      window.alert(ls_str);
      //var len = document.thform.ti.value.length + leftChars;
      //document.login.message.value = document.login.ti.value.substring(0, len);
      varField.value=""
      return false;
    }
}
function f_GoPage(form){
  form.rs6.value = f_trim(form.rs6.value);
  if(isNaN(form.rs6.value)|| form.rs6.value=="" || form.rs6.length==0){ alert('请输入一个数字或者不能为空!');return false; }
  if(form.rs6.value > 1) {
     form.pn.value = (1 - 1)*30;
     return true;
  }
  if(form.rs6.value <= 0) {form.pn.value = 0 ; return true;}
  form.pn.value = (form.rs6.value - 1)*30;
  return true;

⌨️ 快捷键说明

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