/** * jspceo (v3.0) - class: jc.js * * @author : folier * @email : jspceo@qq.com * @qq : 39886616 * @techno-support : ruixing.cc * copyright(c): jspceo 2008 - 2010 * **/ var jc={dodelete: function(contextpath, table, id, signer, ldabortmsg){var cstr;var dall;if(ldabortmsg==null){cstr = "警告:\r\n此操作将删除此栏目及其下的全部信息,\r\n且不可撤消,请谨慎操作。\r\n\r\n您确定要执行此删除操作吗?";dall=1;}else{cstr = "此操作无法撤消!您确定要执行此删除操作吗?";dall=0;}if(confirm(cstr)){$.ajax({type:"get",url: contextpath + "/jc_sys/update.jc?jc_action=del&jc_table=" + table + "&jc_id=" + id + "&jc_signer=" +signer + "&delall=" + dall + "&jc_backurl=" + escape(document.location.href),success:function(d){if(d.indexof("success")!=-1){new jc.url().set("jc_status", "successdelete").go();}else if(d.indexof("hasson")!=-1){if(ldabortmsg=="") ldabortmsg="对不起,删除失败,由于此节点下面还有内容,因此不能删除此节点。";alert(ldabortmsg);}else{alert(d);}}});}},dodeletefile:function(filename,filesigner,filedivname){if(confirm("警告:此操作不可撤消!\r\n您真地要删除此文件吗?")){var ix=filename.indexof("jc_data/jc_files");if(ix<0)return;var contextpath=filename.substring(0,ix);$.get((contextpath+"/jc_sys/view.jc?s=ajax_delupfile&fp="+escape(filename)+"&jc_signer="+filesigner).replace("//","/"),function(data){if(data=='success'){if(document.getelementbyid(filedivname)==null)document.location.reload();else $('#'+filedivname).hide();}else alert('删除失败! 原因:\r\n'+data);});}},noselect:function(){if($.browser.msie){document.onselectstart=function(){var abstag=event.srcelement.tagname;if(abstag!="input"&&abstag!="textarea")return false;}}else{$("div,table,p").css("-moz-user-select","-moz-none");};return this;},nomenu:function(){document.oncontextmenu=function(e){tg=$.browser.msie?event.srcelement.tagname.touppercase():e.target.tagname.touppercase();if(tg!='input'&&tg!='textarea')return false;};return this;}};jc.page={popup:function(url,name,vars){url=url?url:'about:blank';name=name?name:'';vars=vars?vars:'width=800,height=600,scrollbars=yes,resizable=yes';var win=window.open(url,name,vars);if(!win){alert('似乎某个弹出式窗口拦截器导致了无法打开该网页。\n\n如果您使用了窗口拦截器,请尝试关闭它,以便打开该窗口。');return null;}else{vars=vars.tolowercase();var w=parseint(vars.substring(vars.indexof("width=")+6));var h=parseint(vars.substring(vars.indexof("height=")+7));win.moveto((screen.width-w)/2,(screen.height-h)/2);win.focus();return win;}},dialog:function(url,name,vars){if($.browser.msie){var prm=[];vars=vars.tolowercase();if(vars.indexof("width=")!=-1)prm.push("dialogwidth:"+parseint(vars.substring(vars.indexof("width=")+6))+"px");if(vars.indexof("height=")!=-1)prm.push("dialogheight:"+parseint(vars.substring(vars.indexof("height=")+7))+"px");if(prm.length)prm=prm.join(";");else prm="dialogwidth=800;dialogheight:600px";prm+=";edge:raised; center:yes; resizable: yes; status: no;";showmodaldialog(url,window,prm);}else{this.popup(url,name,vars);};return false;},favorite:function(title,url){if(!title)title=window.title;if(!url)url=document.location.href;var desc='';if(typeof(window.sidebar)=='object'&&typeof(window.sidebar.addpanel)=='function'){window.sidebar.addpanel(title,url,desc);}else{window.external.addfavorite(url,title);};return this;},png:function(img,contextpath){if(contextpath==null){alert("jc.page.png(img, contextpath)方法未指定contextpath参数.");return;};if(contextpath=="") contextpath=".";var str=string(navigator.appversion);if(str.indexof("msie 6")==-1)return;var sc_w=img.width;var sc_h=img.height;var imgname=img.src.touppercase();if(imgname.substring(imgname.length-3,imgname.length)=="png"){img.style.filter+="progid:dximagetransform.microsoft.alphaimageloader(src="+img.src+", sizingmethod=scale);";img.src=contextpath+"/jc_sys/etc/transparent.gif";img.width=sc_w;img.height=sc_h;}},cancelbubble:function(evt){if(window.event){window.event.cancelbubble=true;}else{evt.stoppropagation();};return this;},getyzm:function(guid,contextpath,isen){if(guid==null)guid=0;var t1=isen?"input the number in the picture.":"请填写后面图片中的四位数字";var rtn=[];rtn.push('');rtn.push('');return rtn.join("");},chkyzm:function(guid,contextpath,isen){var t1=isen?"sorry, the appointed validate code is not exists.":"对不起,chkyzm指定编号的验证码不存在!";var t2=isen?"input the validate code, please.":"请输入验证码";var t3=isen?"input the right validate code, please.":"请输入四位数字的验证码!";var t4=isen?"input the right validate code, please.":"对不起,验证码输入不正确!";var o=$("#jc_validatecode"+guid)[0];if(o.length==0){alert(t1);return false;};if(o.value==''){alert(t2);o.focus();return false;}else if(o.value.length!=4){alert(t3);o.focus();return false;};yzmiserr=true;$.ajax({type:"get",async:false,error:function(xmlobj,err,eobj){alert('对不起,数据提交失败,服务器响应出错.');var ewin=window.open('');ewin.document.write('服务器响应错误信息如下:
'+xmlobj.responsetext+'

copyright© jspceo v2.0

');},url:contextpath+'/jc_sys/view.jc?s=ajax_chkvalidatecode&yzm='+$("#jc_validatecode"+guid).val(),datatype:'script'});if(yzmiserr){alert(t4);$("#jc_yzm"+guid).click();};return !yzmiserr;},plug:function(paramobj){var o=paramobj;if(!o.src){alert('初始化jc.page.plug()插件失败,未指定srsc文件地址。');return;};var src=o.src;var width=o.width;var height=o.height;var id=o.id?o.id:'jc_plug';var nobuffer=paramobj.nobuffer;var contextpath=o.root?o.root:"";var ext=src.substring(src.lastindexof(".")+1).tolowercase();if(nobuffer){src+="?"+math.random();};if(width==0&&height==0)initlink();else if(ext=='rm'||ext=='ram'||ext=='rmvb')initrealplayer();else if(ext=='swf')initflashplayer();else if(ext=='gif'||ext=='bmp'||ext=='png'||ext=='jpg'||ext=='jpe'||ext=='jpeg')initpicture();else initmediaplayer();function initlink(){if(o.root==null){alert("jc.page.plug(paramobj)的paramobj参数未指定root属性.");};var p=contextpath+'/jc_sys/ext/';document.write('\r\n 点击查看');};function initpicture(){document.write('');};function initrealplayer(){var s=[];with(s){push(' ');push(' ');push(' ');push(' ');push(' ');push(' ');push('');push(' ');push(' ');push(' ');push('');push(' ');push(' ');push('');push('');};document.writeln(s.join(''));};function initflashplayer(){var vars=o.vars?o.vars:null;var wmode=o.wmode?o.wmode:"transparent";var s=[];with(s){push('');push('\n');push('\n');push('\n');push('\n');if(vars)push(' ');push('');push("');push('');};document.writeln(s.join(""));};function initmediaplayer(){var s=[];with(s){push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');push('');};document.writeln(s.join(""));}}};jc.url=function(url){if(url==null||url=="")url=document.location.href;var bookmark="";if(url.indexof("#")!=-1){bookmark=url.substring(url.indexof("#"));url=url.substring(0,url.indexof("#"));};var file=url;var search="";var searcha=[];var index={};if(url.indexof("?")!=-1){file=url.substring(0,url.indexof("?"));search=url.substring(url.indexof("?")+1);searcha=search.split("&");for(var i=0;i=0;i--)if(searcha[i]==null)searcha.splice(i,1);if(searcha.length)search=searcha.join("&");else search="";url=file+(search==""?"":"?"+search);return url+bookmark;};this.go = function(target){var turl = this.tostring();try{parent.jc_loading(true);}catch(e){}if(target==0){document.location.replace(turl);}else if(target){target1=target.tolowercase();if(target1 == '_blank') window.open(turl); else if (target1 == '_top' ) top.location.href=turl; else if (target1 == '_parent') parent.location.href=turl;else if (target1 == '_self') document.location.href=turl;else{try{$("#"+target)[0].src=turl;}catch(e){try{top.document.getelementbyid(target).src=turl;}catch(e1){document.location.href=turl;} }} }else{if(document.location.href==turl){document.location.reload();}else{document.location.href=turl;}}}};jc.form=function(fm){this.fm=fm;function alt(obj,msg){if(msg)alert("对不起, "+msg+"。");try{fm[obj].focus();fm[obj].select();}catch(e){};return false;};function num(obj,msg,min,max,isfloat){var v=fm[obj].value;var n=isfloat?parsefloat(v):parseint(v);return(v!=n||(min!=null&&n=max))?alt(obj,msg):true;};function getsplit(str,spstr,spexp){var s1=str.replace(new regexp(spexp,"ig"),spstr).split(spstr);var s2=[];for(var i=0;i=min&&(max==0?true:len服务器响应错误信息如下:
'+xmlobj.responsetext+'

copyright© jspceo v2.0

');isnorepeat=false;},url:obj.root+'/jc_sys/view.jc?s=ajax_chkrepeat&tb='+table+'&tid='+tid+'&t0='+t0+'&id='+tmpid+"&by="+by,datatype:'script'});return !isnorepeat;}};jc.form.prototype={xxx:function(a){alert(typeof(this.fm));}};jc.select={up:function(o){for(i=0;i=0;i--)if(o.options[i].selected){if(i==o.options.length-1||o.options[i+1].selected)continue;var v=o.options[i].value;var t=o.options[i].text;var b=o.options[i].style.backgroundcolor;var f=o.options[i].style.color;o.options[i].value=o.options[i+1].value;o.options[i].text=o.options[i+1].text;o.options[i].style.backgroundcolor=o.options[i+1].style.backgroundcolor;o.options[i].style.color=o.options[i+1].style.color;o.options[i+1].value=v;o.options[i+1].text=t;o.options[i+1].style.backgroundcolor=b;o.options[i+1].style.color=f;o.options[i+1].selected=true;o.options[i].selected=false;}},remove:function(o){var j=0;for(i=o.options.length-1;i>=0;i--)if(o.options[i].selected){o.options[i]=null;j=i;};if(o.options.length>j)o.selectedindex=j;else if(o.options.length>0)o.selectedindex=o.options.length-1;},move:function(fobj,tobj,vobj,isl2r){tobj.selectedindex=-1;for(var i=0;i