Greasy Fork is available in English.

荒年-javaex

javaex

Detta skript bör inte installeras direkt. Det är ett bibliotek för andra skript att inkludera med meta-direktivet // @require https://update.greasyfork.org/scripts/442067/1230286/%E8%8D%92%E5%B9%B4-javaex.js

/**
     _                           
    (_)                          
     _   _ __     ___ _  _    _  
    | | / _` \  / / _`/ _ \ \ /  
    | |/ (_|\ \/ / (_|  __/\ \   
    \ |\__,_ \__/\__,_\___ /\_\  
    /_/                          
                                 
    
    作者:陈霓清
    官网:www.javaex.cn
    版本:4.0.0
    Licences: MIT
*/
;(function(){var javaex=function(){function defaults(args){var defaults={id:"",mode:"",type:"",url:"",dataList:[],isInit:false,callback:function(){return true},name:"",uncheckClass:"",checkedClass:"",second:45,text:"获取验证码",color:"unset",backgroundColor:"transparent",downColor:"unset",downBackgroundColor:"transparent",checkbox:true,isShowAllCheck:false,isAllowJumpUrl:false,icon:false,withoutNodeArr:null,checkboxCallback:function(){return true},aCallback:function(){return true},percent:0,isShowPercent:false,tags:"",mask:true,width:300,maxHeight:"",height:"",top:"30%",title:"温馨提示",closeIcon:true,content:"",textAlign:"left",confirmName:"确定",cancelName:"取消",confirm:function(){return true},cancel:function(){return true},close:function(){return true},live:2000,timeout:10000,timeoutText:"连接超时,请重试",selector:"",scrolling:"yes",offsetLeft:0,offsetTop:0,hasBackground:false,isClickMaskClose:false,isAutoSelected:false,key:"key",isShowFirst:false,isShowAll:false,num:5,size:24,scoreArr:[1,2,3,4,5],levelTextArr:['1分','2分','3分','4分','5分'],score:"",half:false,isReadOnly:false,clickOnce:true,current:1,delay:200,display:"block",mergeColArr:[],tree:0,isClose:false,isDragColWidth:false,leftFixedColNum:0,rightFixedColNum:0,colWidth:null,sort:null,sortSingle:true,sortCallback:function(){return true},maxNum:6,minWidth:140,isSearch:false,hasInputName:false,totalPages:null,pageNum:1,pageSize:null,totalNum:null,position:"right",isShowJumpPage:true,lastPageText:"上一页",nextPageText:"下一页",isShowOnePage:true,isShowSelect:true,isReturnFirst:true,isAutoPlay:true,focusCenter:false,startSlide:1,focusBoxMode:"mouseover",effect:null,date:"",startDate:"",endDate:"",alignment:"left",monthNum:1,splitLine:" - ",minTime:"",maxTime:"",time:"",imgDivId:"image-box",cutBox:"cut-box",moveBox:"move-box",dataUrl:"data-url",threshold:100,event:"scroll",container:window,dataOriginal:"data-original",appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC",isShowTip:false,containerId:"",uploadText:"上传封面",param:{"file":"file"},header:{},chooseBefore:function(){return true},chooseAfter:function(){return true},maxSize:"",imgList:"",dataType:"base64",deleteImage:function(){return true},addImg:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAIBJREFUSA3tl7ENwCAMBN9RpkvFQsyUNGE9IpIs8P8FBUZy58PmkLAAxFXqdY8QcewqCPRDZ4HNgR02Czv2KDZVU7qc5FTt2KPY9VTHN2G8B59y/CZHm6I6Ap1v9idKPfsIdYMpJx7NZmH1ymguVdPKVCBVq+Zobj3Vxt8pmjNlHkcEEcpxsEklAAAAAElFTkSuQmCC",commentCount:0,user:null,list:null,commentMapping:null,replyMapping:null,defaultAvatar:"",curUserAvatar:"",isChangeTimeText:false,unLogin:function(){return true},showMoreReply:function(){return true},initValue:"",step:1,minValue:1,maxValue:100,decrCallback:function(){return true},incrCallback:function(){return true},formData:{},defaultRadioChecked:1,fixedTop:-1,image:null};return $.extend(defaults,args)}var info={getParam:function(key){var reg=new RegExp("(^|&)"+key+"=([^&]*)(&|$)");var r=window.location.search.substr(1).match(reg);if(r!=null){return unescape(r[2])}return null},getCheckboxVal:function(name,passDisabled){let varArr=[];$(':checkbox[name="'+name+'"]:checked').each(function(){if(typeof passDisabled=="undefined"||!passDisabled){varArr.push($(this).val())}else if(!$(this).attr("disabled")){varArr.push($(this).val())}});return varArr},getCheckboxText:function(name,passDisabled){let textArr=[];$(':checkbox[name="'+name+'"]:checked').each(function(){let text=$(this).next().next(".javaex-fill-text").text();if(!text){text=$(this)[0].nextSibling.nodeValue}if(typeof passDisabled=="undefined"||!passDisabled){textArr.push(text)}else if(!$(this).attr("disabled")){textArr.push(text)}});return textArr},setRadioVal:function(name,val){$(':radio[name="'+name+'"][value="'+val+'"]').attr("checked",true)},getRadioVal:function(name){var val=$(':radio[name="'+name+'"]:checked').val();return info.ifnull(val)},getRadioText:function(name){if($(':radio[name="'+name+'"]:checked').length==0){return""}var text=$(':radio[name="'+name+'"]:checked').next().next(".javaex-fill-text").text();if(!text){text=$(':radio[name="'+name+'"]:checked')[0].nextSibling.nodeValue}return info.ifnull(text)},getSelectVal:function(selector){return $(selector).val()},getSelectText:function(selector){return $(selector).find("option:selected").text().trim()},drawer:function(args){var settings=defaults(args);var id=settings.id;var width=String(settings.width);var position=settings.position;var isClickMaskClose=settings.isClickMaskClose;var title=settings.title;var closeIcon=settings.closeIcon;var url=settings.url;if(!id){id=info.getUUID()}if(!!url){closeFn=settings.close;var html='<div id="'+id+'" class="javaex-drawer javaex-drawer-auto">';html+='<div class="javaex-drawer-header">';html+='<div class="javaex-drawer-title">'+title+'</div>';if(closeIcon){html+='<a class="javaex-drawer-close" href="javascript:;" onclick="javaex.callback(\''+id+'\', closeFn);"><span class="icon-close"></span></a>'}html+='</div>';html+='<div class="javaex-drawer-content"><iframe src="'+url+'" width="100%" height="100%" frameborder="0" scrolling="yes" style="overflow: visible;border: 0;"></iframe></div>';html+='</div>';$(document.body).append(html)}var $drawer=$("#"+id);$drawer.show();var tempDrift=0;if(width.indexOf("%")>0){tempDrift=-(width.replace("%",""))+"%"}else if(width.indexOf("px")>0){tempDrift=-(width.replace("px",""))+"px"}else{tempDrift=-(width)+"px";width=width+"px"}$drawer.before('<div class="javaex-mask"></div>');if(position=="left"){$drawer.css({"width":width,"left":tempDrift});$drawer.css("transform","translateX("+$drawer.width()+"px)")}else if(position=="right"){$drawer.css({"width":width,"right":tempDrift});$drawer.css("transform","translateX("+ -($drawer.width())+"px)")}if(isClickMaskClose){$(".javaex-mask").click(function(){$(".javaex-mask").remove();$drawer.css("transform","translateX(0px)");if($drawer.hasClass("javaex-drawer-auto")){setTimeout(function(){$drawer.remove()},200)}})}settings.callback({})},form:function(args){var settings=defaults(args);var formId=settings.id;var formData=settings.formData;var defaultRadioChecked=parseInt(settings.defaultRadioChecked);if(formData==null){return}var $form=$("#"+formId);for(let key in formData){let value=formData[key];let $item=$form.find('[name="'+key+'"]');if($item.length==0){continue}let type=$item[0].type;switch(type){case"checkbox":value=value==null?"":value;if(typeof value==="number"){value=String(value)}value=value.split(",");for(let i=0;i<value.length;i++){$form.find(':checkbox[name="'+key+'"][value="'+value[i]+'"]').attr("checked",true)}break;case"radio":$form.find(':radio[name="'+key+'"][value="'+value+'"]').attr("checked",true);if(!$form.find(':radio[name="'+key+'"]:checked').val()&&defaultRadioChecked>0){$form.find(':radio[name="'+key+'"]').each(function(i){if((i+1)==defaultRadioChecked){$(this).attr("checked",true);return false}})}break;case"select-one":$item.val(value);let selectId=$item.attr("id");if(!!selectId){$("#input-"+selectId).val(info.getSelectText("#"+selectId))}break;default:if(!!value||value==0){$item.val(value)}break}}settings.callback({})},deleteCookie:function(key){var exp=new Date();exp.setTime(exp.getTime()-1);var cval=info.getCookie(key);if(cval!=null){document.cookie=key+"="+cval+"; path=/; expires="+exp.toGMTString()}},getCookie:function(key){var strArr=document.cookie.split("; ");for(let i=0;i<strArr.length;i++){var temp=strArr[i].split("=");if(temp[0]==key){return unescape(temp[1])}}return""},setCookie:function(key,value,time){if(value.constructor===Object){value=JSON.stringify(value)}if(!time){document.cookie=key+"="+escape(value)+"; path=/; expires=-1"}else{let days=parseInt(time);let exp=new Date();exp.setTime(exp.getTime()+days*24*60*60*1000);document.cookie=key+"="+escape(value)+"; path=/; expires="+exp.toGMTString()}},deleteLocalStorage:function(key){if(!!key){localStorage.removeItem(key)}else{localStorage.clear()}},getLocalStorage:function(key){return localStorage.getItem(key)},setLocalStorage:function(key,value){if(value.constructor===Object){value=JSON.stringify(value)}localStorage.setItem(key,value)},deleteSessionStorage:function(key){if(!!key){sessionStorage.removeItem(key)}else{sessionStorage.clear()}},getSessionStorage:function(key){return sessionStorage.getItem(key)},setSessionStorage:function(key,value){if(value.constructor===Object){value=JSON.stringify(value)}sessionStorage.setItem(key,value)},ifnull:function(str,replaceValue){if(typeof str==="number"){return str}if(replaceValue===undefined){return(!str||str=="undefined")?"":str}else{return(!str||str=="undefined")?replaceValue:str}},isJSON:function(str){if(typeof str==="string"){try{var obj=JSON.parse(str);if(typeof obj==="object"&&obj){return true}else{return false}}catch(e){return false}}return false},getUUID:function(){return Date.now().toString(36)+Math.random().toString(36).substr(3,3)},numChose:function(args){var settings=defaults(args);var id=settings.id;var step=settings.step;var minValue=settings.minValue;var maxValue=settings.maxValue;var initValue=settings.initValue;if(!initValue){initValue=$("#"+id).val()}$("#"+id).val(initValue);var wrapId="javaex-numChose-wrap-"+id;var leftId="javaex-numChose-left-"+id;var rightId="javaex-numChose-right-"+id;$("#"+id).wrap('<div id="'+wrapId+'" class="javaex-numChose-wrap"></div>');$("#"+id).before('<span id="'+leftId+'" class="javaex-numChose-left" onselectstart="return false;">-</span>');$("#"+id).after('<span id="'+rightId+'" class="javaex-numChose-right" onselectstart="return false;">+</span>');$("#"+leftId).click(function(){var inputValue=$("#"+id).val();inputValue=Number(inputValue);var newValue=inputValue-step;if(newValue>=minValue){$("#"+id).val(newValue);settings.decrCallback({"val":newValue})}});$("#"+rightId).click(function(){var inputValue=$("#"+id).val();inputValue=Number(inputValue);var newValue=inputValue+step;if(newValue<=maxValue){$("#"+id).val(newValue);settings.incrCallback({"val":newValue})}})},radio:function(){$(":radio.javaex-fill").each(function(){if($(this).hasClass("javaex-rendered")){return true}else{$(this).addClass("javaex-rendered")}if($(this).parent()[0].tagName=="LABEL"){$(this).parent().addClass("javaex-fill-label");var text=$(this)[0].nextSibling.nodeValue;$(this)[0].nextSibling.nodeValue=""}else{var text=$(this)[0].nextSibling.nodeValue;$(this)[0].nextSibling.nodeValue="";$(this).wrap('<label class="javaex-fill-label"></label>')}if(!!text){text=text.replace(/(\s*$)/g,"");if(text.length==0){$(this).parent().append('<span></span>')}else{$(this).parent().append('<span class="javaex-fill-text">'+text+'</span>')}}if($(this).siblings().length==1){$(this).after('<span class="javaex-fill-css javaex-radio-check"></span>')}})},fakeRadio:function(args){var settings=defaults(args);var name=settings.name;var uncheckClass=settings.uncheckClass;var checkedClass=settings.checkedClass;$(':radio[name="'+name+'"]').each(function(){if($(this).is(":checked")){$(this).closest("label").addClass(checkedClass);if(settings.isInit){settings.callback({"val":$(this).val(),"text":$(this)[0].nextSibling.nodeValue})}}else{$(this).closest("label").addClass(uncheckClass)}});$(':radio[name="'+name+'"]').change(function(){$(':radio[name="'+name+'"]').each(function(){$(this).closest("label").removeClass(checkedClass).addClass(uncheckClass)});$(this).closest("label").removeClass(uncheckClass).addClass(checkedClass);settings.callback({"val":$(this).val(),"text":$(this)[0].nextSibling.nodeValue})})},checkbox:function(){$(":checkbox.javaex-fill").each(function(){if($(this).hasClass("javaex-rendered")){return true}else{$(this).addClass("javaex-rendered")}if($(this).parent()[0].tagName=="LABEL"){$(this).parent().addClass("javaex-fill-label");var text=$(this)[0].nextSibling.nodeValue;$(this)[0].nextSibling.nodeValue=""}else{var text=$(this)[0].nextSibling.nodeValue;$(this)[0].nextSibling.nodeValue="";$(this).wrap('<label class="javaex-fill-label"></label>')}if(!!text){text=text.replace(/(\s*$)/g,"");if(text.length==0){$(this).parent().append('<span></span>')}else{$(this).parent().append('<span class="javaex-fill-text">'+text+'</span>')}}if($(this).siblings().length==1){$(this).after('<span class="javaex-fill-css icon-check"></span>')}})},checkboxCheck:function($this){if($this.is(":checked")){$this.parent(".javaex-fill-label").addClass("javaex-checkbox-checked")}else{$this.parent(".javaex-fill-label").removeClass("javaex-checkbox-checked")}var listen=$this.attr("listen");if(listen===undefined){return true}var listenKey=listen.replace(listen.split("-")[0]+"-","");var keyArr=listenKey.split("-");if($this.is(":checked")){var num=0;$(":checkbox.javaex-fill").each(function(){let listenNext=$(this).attr("listen");if(listenNext===undefined){return true}if(listenNext!=listen&&listenNext.indexOf(listen)>=0){if(!$(this).attr("disabled")){$(this).attr("checked",true);$(this).parent(".javaex-fill-label").addClass("javaex-checkbox-checked");$(this).next("span.icon-stop").removeClass("icon-stop").addClass("icon-check")}}if(listenNext==listen){if($(this).is(":checked")||$(this).attr("disabled")){num++}}});if(num==$('[listen="'+listen+'"]').length){var parentListen=listen.replace("-"+keyArr[keyArr.length-1],"");if((parentListen.split("-").length-1)==1){var flag=true;for(let i=1;i<=10;i++){let temp=parentListen+"-"+i;if($('[listen="'+temp+'"]').length>0&&!$('[listen="'+temp+'"]').is(":checked")){flag=false}}if(flag){$(":checkbox.javaex-fill").each(function(){if($(this).attr("listen")==parentListen){$(this).attr("checked",true);$(this).parent(".javaex-fill-label").addClass("javaex-checkbox-checked");return false}})}}else{$(":checkbox.javaex-fill").each(function(){if($(this).attr("listen")==parentListen){$(this).attr("checked",true);$(this).parent(".javaex-fill-label").addClass("javaex-checkbox-checked");return false}});parentListen=parentListen.substring(0,parentListen.length-2);var flag=true;for(let i=1;i<=10;i++){let temp=parentListen+"-"+i;if($('[listen="'+temp+'"]').length.length>0&&!$('[listen="'+temp+'"]').length.is(":checked")){flag=false}}if(flag){$(":checkbox.javaex-fill").each(function(){if($(this).attr("listen")==parentListen){$(this).attr("checked",true);$(this).parent(".javaex-fill-label").addClass("javaex-checkbox-checked");return false}})}}}}else{$(":checkbox.javaex-fill").each(function(){let listenNext=$(this).attr("listen");if(listenNext===undefined){return true}if(listenNext!=listen&&listenNext.indexOf(listen)>=0){$(this).attr("checked",false);$(this).parent(".javaex-fill-label").removeClass("javaex-checkbox-checked")}var parentListen="listen";for(let i=0;i<keyArr.length;i++){if(keyArr[i]!=keyArr[keyArr.length-1]){parentListen+="-";parentListen+=keyArr[i];if(listenNext==parentListen){$(this).attr("checked",false);$(this).parent(".javaex-fill-label").removeClass("javaex-checkbox-checked")}}}})}},listenCheckbox:function(args){var settings=defaults(args);$(document).on("click",":checkbox.javaex-fill",function(){info.checkboxCheck($(this));settings.callback({})})},fakeCheckbox:function(args){var settings=defaults(args);var name=settings.name;var uncheckClass=settings.uncheckClass;var checkedClass=settings.checkedClass;$(':checkbox[name="'+name+'"]').each(function(){if($(this).is(":checked")){$(this).parent("label").addClass(checkedClass)}else{$(this).parent("label").addClass(uncheckClass)}});$(':checkbox[name="'+name+'"]').change(function(){if($(this).is(":checked")){$(this).closest("label").removeClass(uncheckClass).addClass(checkedClass)}else{$(this).closest("label").removeClass(checkedClass).addClass(uncheckClass)}})},timerId:null,code:function(args){var settings=defaults(args);var id=settings.id;var second=parseInt(settings.second);var $id=$("#"+id);if(settings.type=="reset"){clearInterval(info.timerId);$id.removeClass("javaex-code-disabled");$id.text(settings.text);second=parseInt(settings.second)}else{setTimer();function setTimer(){$id.addClass("javaex-code-disabled");$id.text(second+"秒后重试");info.timerId=setInterval(function(){second=second-1;if(second>0){$id.text(second+"秒后重试")}else{clearInterval(info.timerId);$id.removeClass("javaex-code-disabled");$id.text(settings.text);second=parseInt(settings.second)}},1000)}}},tree:function(args){var settings=defaults(args);var id=settings.id;var jsonData=settings.dataList;var checkbox=settings.checkbox;var icon=settings.icon;var withoutNodeArr=settings.withoutNodeArr;var flag=false;var nodeListen="listen-"+id+"1-2";var html='';if(settings.isShowAllCheck){let allListen="listen-"+id+"1";html+='<input type="checkbox" name="javaex-all-check" class="javaex-fill" listen="'+allListen+'"/> 全选'}if(parseInt(settings.type)==1){tree(jsonData)}else{tree2(jsonData)}$("#"+id).empty();$("#"+id).append(html);function tree(jsonData,nodeIndex){if(jsonData.length>0){if(!nodeIndex){nodeIndex=1}html+='<ul>';$.each(jsonData,function(i,data){if(!!data.children&&data.children.length>0){if(data.open){html+='<li class="javaex-tree-parent-li" open="true">'}else{html+='<li class="javaex-tree-parent-li">'}html+='<span class="javaex-tree-icon icon-caret-right"></span>';if(checkbox){if(data.checked){html+='<input type="checkbox" class="javaex-fill" listen="'+nodeListen+'" node="'+nodeIndex+'" name="javaex-tree" value="'+data.id+'" checked/> '}else{html+='<input type="checkbox" class="javaex-fill" listen="'+nodeListen+'" node="'+nodeIndex+'" name="javaex-tree" value="'+data.id+'" /> '}}html+='<a href="javascript:;" node="'+nodeIndex+'" javaex-menu-id="'+data.id+'">';if(icon){if(!!data.icon){flag=true;html+='<span class="javaex-tree-icon '+data.icon+'"></span>'}else{html+='<span class="javaex-tree-icon icon-folder"></span>'}}html+=data.name+'</a>';tree(data.children,(nodeIndex+1))}else{html+='<li class="javaex-tree-child-li">';if(checkbox){if(data.checked){html+='<input type="checkbox" class="javaex-fill" listen="'+nodeListen+'" node="'+nodeIndex+'" name="javaex-tree" value="'+data.id+'" checked/> '}else{html+='<input type="checkbox" class="javaex-fill" listen="'+nodeListen+'" node="'+nodeIndex+'" name="javaex-tree" value="'+data.id+'" /> '}}if(!data.url||settings.isAllowJumpUrl==false){html+='<a href="javascript:;" node="'+nodeIndex+'" javaex-menu-id="'+data.id+'">'}else{html+='<a href="'+data.url+'" node="'+nodeIndex+'" javaex-menu-id="'+data.id+'">'}if(icon){if(!!data.icon){flag=true;html+='<span class="javaex-tree-icon '+data.icon+'"></span>'}else{html+='<span class="javaex-tree-icon icon-folder"></span>'}}html+=data.name+'</a>';html+='</li>'}});html+='</ul>'}}function tree2(jsonData){if(jsonData.length>0){var jsonArr=new Array();$.each(jsonData,function(i,data){if(parseInt(data.parentId)<1){var childrenArr=addChild(jsonData,data.id);data.children=childrenArr;jsonArr.push(data)}});tree(jsonArr)}}function addChild(jsonData,parentId){var childArr=new Array();for(let i=0;i<jsonData.length;i++){if(jsonData[i].parentId==parentId){var childrenArr=addChild(jsonData,jsonData[i].id);jsonData[i].children=childrenArr;childArr.push(jsonData[i])}}return childArr}if(checkbox){info.checkbox();if(settings.isShowAllCheck){$('#'+id+' :checkbox[name="javaex-all-check"]').click(function(){if($(this).is(":checked")){callbackAll()}else{settings.checkboxCallback({"idArr":[]})}})}$('#'+id+' :checkbox[name="javaex-tree"]:checked').each(function(){if($(this).parent().parent("li").attr("class")=="javaex-tree-child-li"){changeCheckBoxStatus($(this))}});$('#'+id+' :checkbox[name="javaex-tree"]').click(function(){changeCheckBoxStatus($(this));callback()})}if(settings.isInit){callback()}settings.callback();function changeCheckBoxStatus(obj){if(!obj.attr("class")){return}var parentLi=obj.parent().parent();if(parentLi.hasClass("javaex-tree-parent-li")){var sibLen=parentLi.siblings().length+1;var checkedNum=0;obj.siblings("span.icon-stop").removeClass("icon-stop").addClass("icon-check");if(obj.is(":checked")){checkedNum++;parentLi.find("label").find("span.icon-stop").removeClass("icon-stop").addClass("icon-check");parentLi.find(":checkbox").attr("checked",true);obj.parent().parent("li").addClass("checked")}else{parentLi.find(":checkbox").attr("checked",false);obj.parent().parent("li").removeClass("checked")}parentLi.siblings("li").children("label").find(":checkbox").each(function(){if($(this).is(":checked")&&$(this).siblings("span.icon-check").length>0){checkedNum++}});var objLi=parentLi.parent().parent("li.javaex-tree-parent-li");if(objLi.length>0){if(checkedNum==sibLen){objLi.children("label").find("span.icon-stop").removeClass("icon-stop").addClass("icon-check");objLi.children("label").find(":checkbox").attr("checked",true);objLi.addClass("checked")}else if(checkedNum==0){objLi.children("label").find(":checkbox").attr("checked",false);objLi.removeClass("checked")}else{objLi.children("label").find("span.icon-check").removeClass("icon-check").addClass("icon-stop");objLi.children("label").find(":checkbox").attr("checked",true);objLi.removeClass("checked")}changeParentCheckBoxStatus(objLi)}}else{var sibLen=parentLi.siblings().length+1;var checkedNum=0;if(obj.is(":checked")){checkedNum++;obj.parent().parent("li").addClass("checked")}else{obj.parent().parent("li").removeClass("checked")}parentLi.siblings("li").children("label").find(":checkbox").each(function(){if($(this).is(":checked")&&$(this).siblings("span.icon-check").length>0){checkedNum++}});var objLi=parentLi.parent().parent("li.javaex-tree-parent-li");if(objLi.length>0){if(checkedNum==sibLen){objLi.children("label").find("span.icon-stop").removeClass("icon-stop").addClass("icon-check");objLi.children("label").find(":checkbox").attr("checked",true);objLi.addClass("checked")}else if(checkedNum==0){objLi.children("label").find(":checkbox").attr("checked",false);objLi.removeClass("checked")}else{objLi.children("label").find("span.icon-check").removeClass("icon-check").addClass("icon-stop");objLi.children("label").find(":checkbox").attr("checked",true);objLi.removeClass("checked")}changeParentCheckBoxStatus(objLi)}}}function changeParentCheckBoxStatus(obj){var flag=false;var sibLen=obj.siblings().length+1;var checkedNum=0;var thisCheckBox=obj.children("label").find(":checkbox");if(thisCheckBox.is(":checked")){checkedNum++;if(thisCheckBox.siblings("span.icon-check").length==0){flag=true}}else{obj.find(":checkbox").attr("checked",false)}obj.siblings("li").children("label").find(":checkbox").each(function(){if($(this).is(":checked")){checkedNum++;if($(this).siblings("span.icon-check").length==0){flag=true}}});var objLi=obj.parent().parent("li.javaex-tree-parent-li");if(objLi.length>0){if(checkedNum==sibLen){if(flag){objLi.children("label").find("span.icon-check").removeClass("icon-check").addClass("icon-stop");objLi.children("label").find(":checkbox").attr("checked",true)}else{objLi.children("label").find("span.icon-stop").removeClass("icon-stop").addClass("icon-check");objLi.children("label").find(":checkbox").attr("checked",true)}}else if(checkedNum==0){objLi.children("label").find(":checkbox").attr("checked",false);objLi.removeClass("checked")}else{objLi.children("label").find("span.icon-check").removeClass("icon-check").addClass("icon-stop");objLi.children("label").find(":checkbox").attr("checked",true)}changeParentCheckBoxStatus(objLi)}}function callback(){var idArr=new Array();$('#'+id+' :checkbox[name="javaex-tree"]:checked').each(function(i){if((withoutNodeArr==null||$.inArray(parseInt($(this).attr("node")),withoutNodeArr)==-1)){idArr.push($(this).val())}});settings.checkboxCallback({"idArr":idArr})}function callbackAll(){var idArr=new Array();$('#'+id+' :checkbox[name="javaex-tree"]').each(function(i){if((withoutNodeArr==null||$.inArray(parseInt($(this).attr("node")),withoutNodeArr)==-1)){idArr.push($(this).val())}});settings.checkboxCallback({"idArr":idArr})}if(settings.isClose){$("#"+id+" li.javaex-tree-parent-li").find("ul>li").hide()}else{$("#"+id+" .javaex-tree-icon.icon-caret-right").addClass("icon-caret-down").removeClass("icon-caret-right")}if(icon&&!flag){$("#"+id+" li").each(function(){if($(this).hasClass("javaex-tree-child-li")){$(this).find(">a>span").addClass("icon-document-alt-fill").removeClass("icon-folder")}})}$("#"+id+" li.javaex-tree-parent-li").each(function(){if($(this).attr("open")){$(this).children("span").addClass("icon-caret-down").removeClass("icon-caret-right");if(icon&&!flag){$(this).children("a").children("span").addClass("icon-folder-open").removeClass("icon-folder")}$(this).children("ul").find(">li").show()}});$("#"+id+" li a").on("click",function(e){$("#"+id+" li a").removeClass("on");$(this).addClass("on");settings.aCallback({"node":$(this).attr("node"),"id":$(this).attr("javaex-menu-id"),"name":$(this).text()})});$("#"+id+" li.javaex-tree-parent-li>span").on("click",function(e){var children=$(this).siblings("ul").find(">li");if(children.is(":hidden")){$(this).addClass("icon-caret-down").removeClass("icon-caret-right");if(icon&&!flag){$(this).siblings("a").children("span").addClass("icon-folder-open").removeClass("icon-folder")}children.show("fast")}else{$(this).addClass("icon-caret-right").removeClass("icon-caret-down");if(icon&&!flag){$(this).siblings("a").children("span").addClass("icon-folder").removeClass("icon-folder-open")}children.hide("fast")}e.stopPropagation()})},progress:function(args){var settings=defaults(args);var percent=parseInt(settings.percent);var id=settings.id;$progress=$("#"+id);if(settings.isShowPercent){$progress.html("<span>"+percent+"%</span>")}else{$progress.html(" ")}if($progress.width()<1){$progress.css({"width":percent+"%","transition":"width 0.8s 0.1s"})}else{$progress.css({"width":percent+"%"})}},lazyload:function(args){var settings=defaults(args);var selector=settings.selector;var elements=$(selector);var effect=settings.effect;if(!effect){effect="fadeIn"}$(document).ready(function(){$(settings.container).trigger(settings.event);checkImage()});$(window).bind("resize",function(){checkImage()});$container=(settings.container===undefined||settings.container===window)?$(window):$(settings.container);if(0===settings.event.indexOf("scroll")){$container.bind(settings.event,function(){return checkImage()})}elements.each(function(){var self=this;var $self=$(self);self.loaded=false;if(!$self.attr("src")){if($self.is("img")){$self.attr("src",settings.placeholder)}}$self.one("appear",function(){if(!this.loaded){if(settings.appear){var elements_left=elements.length;settings.appear.call(self,elements_left,settings)}$("<img />").bind("load",function(){var original=$self.attr(settings.dataOriginal);$self.hide();if($self.is("img")){$self.attr("src",original)}else{$self.css("background-image","url('"+original+"')")}$self[effect](400);self.loaded=true;$self.removeAttr(settings.dataOriginal);var temp=$.grep(elements,function(element){return!element.loaded});elements=$(temp);if(settings.load){var elements_left=elements.length;settings.load.call(self,elements_left,settings)}}).attr("src",$self.attr(settings.dataOriginal))}});$(window).trigger("scroll")});function checkImage(){var counter=0;elements.each(function(){var $this=$(this);if(!$this.is(":visible")){return}if(abovethetop(this,settings)||leftofbegin(this,settings)){}else if(!belowthefold(this,settings)&&!rightoffold(this,settings)){$this.trigger("appear");counter=0}else{if(++counter>0){return false}}})}function belowthefold(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=(window.innerHeight?window.innerHeight:$(window).height())+$(window).scrollTop()}else{fold=$(settings.container).offset().top+$(settings.container).height()}return fold<=$(element).offset().top-settings.threshold};function rightoffold(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=$(window).width()+$(window).scrollLeft()}else{fold=$(settings.container).offset().left+$(settings.container).width()}return fold<=$(element).offset().left-settings.threshold};function abovethetop(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=$(window).scrollTop()}else{fold=$(settings.container).offset().top}return fold>=$(element).offset().top+settings.threshold+$(element).height()};function leftofbegin(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=$(window).scrollLeft()}else{fold=$(settings.container).offset().left}return fold>=$(element).offset().left+settings.threshold+$(element).width()}},add0:function(num){return(num>=0&&num<=9)?("0"+num):num},getToday:function(){var date=new Date();var year=date.getFullYear();var month=date.getMonth()+1;var day=date.getDate();return year+"-"+info.add0(month)+"-"+info.add0(day)},getDay:function(){return new Date().getDate()},getMonth:function(){return new Date().getMonth()+1},getYear:function(){return new Date().getFullYear()},getWeek:function(){var week=new Date().getDay();return week==0?7:week},now:function(){var date=new Date();var year=date.getFullYear();var month=date.getMonth()+1;var day=date.getDate();return year+"-"+info.add0(month)+"-"+info.add0(day)+" "+info.add0(date.getHours())+":"+info.add0(date.getMinutes())+":"+info.add0(date.getSeconds())},dateFormat:function(timestamp,fmt){var timestampStr=info.ifnull(timestamp);if(!timestampStr){return false}var date=(String(timestamp).length>10)?new Date(timestamp):new Date(timestamp*1000);return doDateFormat(date,fmt);function doDateFormat(date,fmt){var o={"M+":date.getMonth()+1,"d+":date.getDate(),"h+":date.getHours()%12==0?12:date.getHours()%12,"H+":date.getHours(),"m+":date.getMinutes(),"s+":date.getSeconds(),"q+":Math.floor((date.getMonth()+3)/3),"S":date.getMilliseconds()};var week={"0":"/u65e5","1":"/u4e00","2":"/u4e8c","3":"/u4e09","4":"/u56db","5":"/u4e94","6":"/u516d"};if(/(y+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length))}if(/(E+)/.test(fmt)){fmt=fmt.replace(RegExp.$1,((RegExp.$1.length>1)?(RegExp.$1.length>2?"/u661f/u671f":"/u5468"):"")+week[date.getDay()+""])}for(var k in o){if(new RegExp("("+k+")").test(fmt)){fmt=fmt.replace(RegExp.$1,(RegExp.$1.length==1)?(o[k]):(("00"+o[k]).substr((""+o[k]).length)))}}return fmt}},getTimeDiff:function(startTime,endTime,type){startTime=startTime.replace(/\-/g,"/");endTime=endTime.replace(/\-/g,"/");type=type.toLowerCase();var sTime=new Date(startTime);var eTime=new Date(endTime);var divNum=1;switch(type){case"second":divNum=1000;break;case"minute":divNum=1000*60;break;case"hour":divNum=1000*3600;break;case"day":divNum=1000*3600*24;break;default:break}var diff=parseInt((eTime.getTime()-sTime.getTime())/parseInt(divNum));return diff>0?diff:0},comment:function(args){var settings=defaults(args);var id=settings.id;var list=settings.list;var url=settings.url;var commentMapping=settings.commentMapping;var replyMapping=settings.replyMapping;var defaultAvatar=settings.defaultAvatar;var curUserAvatar=defaultAvatar;var user=settings.user;if(user!=null&&user.avatar){curUserAvatar=user.avatar}var commentId=settings.commentId;attribute=args;var html='';if(commentId){var replyList=settings.replyList;for(let j=0;j<replyList.length;j++){html+='<li>';html+='<div class="javaex-comment-c-item">';html+='<div class="javaex-comment-left">';html+='<div class="javaex-avatar30">';if(!replyList[j][replyMapping.avatar]){html+='<a href="'+url+replyList[j][replyMapping.userId]+'" target="_blank" style="display: block;"><img src="'+defaultAvatar+'" class="face" /></a>'}else{html+='<a href="'+url+replyList[j][replyMapping.userId]+'" target="_blank" style="display: block;"><img src="'+replyList[j][replyMapping.avatar]+'" class="face" /></a>'}html+='</div>';html+='</div>';html+='<div class="javaex-comment-right l40">';html+='<div class="javaex-comment-c-conent"><a class="javaex-comment-c-replyer" href="'+url+replyList[j][replyMapping.userId]+'" target="_blank">'+replyList[j][replyMapping.username]+'</a><input type="hidden" value="'+replyList[j][replyMapping.userId]+'" />';if(!!replyList[j][replyMapping.toUserId]){html+='<span class="javaex-comment-c-reply">回复</span>';html+='<a class="javaex-comment-c-replyer" href="'+url+replyList[j][replyMapping.toUserId]+'" target="_blank">'+replyList[j][replyMapping.toUsername]+'</a>'}html+='<span class="javaex-comment-c-text">:                    '+replyList[j][replyMapping.content]+'</span>';html+='</div>';html+='<div class="javaex-comment-bottom">';html+='<span class="javaex-comment-time change-time">'+info.dateFormat(replyList[j][replyMapping.time],"yyyy-MM-dd HH:mm:ss")+'</span>';html+='<a href="javascript:;" onclick="javaex.javaexShowReplyTextarea2(this, attribute)"><i class="javaex-icon-comment icon-chat_bubble_outline"></i></a>';html+='</div>';html+='</div>';html+='</div>';html+='</li>'}var tempCommentId="javaex-comment-reply_"+commentId;var $tempCommentId=$("#"+tempCommentId);if($tempCommentId.children("li").length<10){$tempCommentId.html(html)}else{$tempCommentId.append(html)}}else{html+='<div class="javaex-section-hd"><img src="'+curUserAvatar+'" class="javaex-avatar-img"></div>';html+='<div class="javaex-comment-form">';html+='<div class="javaex-comment-form-textwrap"><textarea wrap="virtual" class="javaex-comment-textarea original" placeholder="我来说两句..."></textarea></div>';html+='<div style="text-align:right;"><button class="javaex-btn javaex-comment-submit" onclick="javaex.javaexComment(this, attribute)">发布</button></div>';html+='</div>';html+='<div class="javaex-comment-count-title">全部评论<span>('+settings.commentCount+')</span></div>';html+='<ul class="javaex-comment-ul">';for(let i=0;i<list.length;i++){var commentId=list[i][commentMapping.commentId];html+='<li id="'+commentId+'">';html+='<div class="javaex-comment-left">';html+='<div class="javaex-avatar60">';if(!list[i][commentMapping.avatar]){html+='<a href="'+url+list[i][commentMapping.userId]+'" target="_blank" style="display: block;"><img src="'+defaultAvatar+'" class="face" /></a>'}else{html+='<a href="'+url+list[i][commentMapping.userId]+'" target="_blank" style="display: block;"><img src="'+list[i][commentMapping.avatar]+'" class="face" /></a>'}html+='</div>';html+='</div>';html+='<div class="javaex-comment-right">';html+='<div class="javaex-comment-title"><a class="javaex-comment-author" href="'+url+list[i][commentMapping.userId]+'" target="_blank">'+list[i][commentMapping.username]+'</a><input type="hidden" value="'+list[i][commentMapping.userId]+'" /></div>';html+='<div class="javaex-comment-conent">'+list[i][commentMapping.content]+'</div>';html+='<div class="javaex-comment-bottom">';html+='<span class="javaex-comment-time change-time">'+info.dateFormat(list[i][commentMapping.time],"yyyy-MM-dd HH:mm:ss")+'</span>';html+='<a href="javascript:;" onclick="javaex.javaexShowReplyTextarea1(this, attribute)"><i class="javaex-icon-comment icon-chat_bubble_outline"></i></a>';html+='</div>';var replyList=list[i][commentMapping.replyList];var replyLen=replyList.length;if(replyLen>0){let tempCommentId="javaex-comment-reply_"+commentId;var replyNum=list[i][commentMapping.replyNum];replyNum=replyNum?parseInt(replyNum):0;info.setSessionStorage(tempCommentId,replyNum);html+='<div class="javaex-comment-posrs">';html+='<ul id="'+tempCommentId+'" class="javaex-comment-reply clear">';for(let j=0;j<replyLen;j++){html+='<li>';html+='<div class="javaex-comment-c-item">';html+='<div class="javaex-comment-left">';html+='<div class="javaex-avatar30">';if(!replyList[j][replyMapping.avatar]){html+='<a href="'+url+replyList[j][replyMapping.userId]+'" target="_blank" style="display: block;"><img src="'+defaultAvatar+'" class="face" /></a>'}else{html+='<a href="'+url+replyList[j][replyMapping.userId]+'" target="_blank" style="display: block;"><img src="'+replyList[j][replyMapping.avatar]+'" class="face" /></a>'}html+='</div>';html+='</div>';html+='<div class="javaex-comment-right l40">';html+='<div class="javaex-comment-c-conent"><a class="javaex-comment-c-replyer" href="'+url+replyList[j][replyMapping.userId]+'" target="_blank">'+replyList[j][replyMapping.username]+'</a><input type="hidden" value="'+replyList[j][replyMapping.userId]+'" />';if(!!replyList[j][replyMapping.toUserId]){html+='<span class="javaex-comment-c-reply">回复</span>';html+='<a class="javaex-comment-c-replyer" href="'+url+replyList[j][replyMapping.toUserId]+'" target="_blank">'+replyList[j][replyMapping.toUsername]+'</a>'}html+='<span class="javaex-comment-c-text">:                    '+replyList[j][replyMapping.content]+'</span>';html+='</div>';html+='<div class="javaex-comment-bottom">';html+='<span class="javaex-comment-time change-time">'+info.dateFormat(replyList[j][replyMapping.time],"yyyy-MM-dd HH:mm:ss")+'</span>';html+='<a href="javascript:;" onclick="javaex.javaexShowReplyTextarea2(this, attribute)"><i class="javaex-icon-comment icon-chat_bubble_outline"></i></a>';html+='</div>';html+='</div>';html+='</div>';html+='</li>'}html+='</ul>'}html+='</div>';html+='</div>';html+='</li>'}html+='</ul>';$("#"+id).html(html)}$(".javaex-comment-reply").each(function(){let curNum=$(this).children("li").length;let tempId=$(this).attr("id");let replyNum=parseInt(info.getSessionStorage(tempId));let diff=replyNum-curNum;let commentId=tempId.split("_")[1];if($(this).next(".javaex-comment-submit-part").length>0){$(this).next(".javaex-comment-submit-part").remove()}if(diff>0){var str='<div class="javaex-comment-submit-part clear">剩余<em>'+diff+'</em>条回复,<a href="javascript:;" onclick="javaex.javaexShowMoreReply(\''+commentId+'\', attribute)" class="fold">点击查看</a></div>';$(this).after(str)}});if(settings.isChangeTimeText){info.changeTimeTexts(".change-time")}if(user.isLogin!=1||user.isLogin!="1"){$(document).on("focus","#"+id+" .javaex-comment-textarea",function(){settings.unLogin()})}},javaexShowMoreReply:function(commentId,args){var settings=defaults(args);var key="javaex-comment-reply-page_"+commentId;var pageNum=info.getSessionStorage(key);if(!pageNum||($("#javaex-comment-reply_"+commentId).children("li").length<10)){pageNum=0}info.setSessionStorage(key,parseInt(pageNum)+1);settings.showMoreReply({"commentId":commentId,"pageNum":parseInt(pageNum)+1})},javaexComment:function(obj,args){var settings=defaults(args);var content=$(obj).parent().parent().find("textarea").val().replace(/<(script)[\S\s]*?\1>|<\/?(a|img)[^>]*>/gi,"");content=content.replace(/(^\s*)|(\s*$)/g,"").replace(/\'/g,"\\'");if(!content){info.tip({mode:"toast",content:"说两句再来点我吧",type:"error"});return}settings.callback({"type":"comment","content":content})},javaexShowReplyTextarea1:function(obj,args){attribute=args;var posrLength=$(obj).parent().siblings(".javaex-comment-form.noHd").length;if(posrLength==0){var html='<div class="javaex-comment-form noHd">';html+='<div class="javaex-comment-form-textwrap"><textarea wrap="virtual" class="javaex-comment-textarea original" placeholder="我来说两句..."></textarea></div>';html+='<div style="text-align:right;"><button class="javaex-btn javaex-comment-submit" onclick="javaex.javaexReply1(this, attribute)">发布</button></div>';html+='</div>';$(obj).parent().after(html)}else{$(obj).parent().siblings(".javaex-comment-form.noHd").remove()}},javaexReply1:function(obj,args){var settings=defaults(args);var commentId=$(obj).parents("li").attr("id");var toUserId=$(obj).parent().parent().parent().children("div:first-child").children('input[type="hidden"]').val();var toUsername=$(obj).parent().parent().parent().children("div:first-child").children('a.comment-author').text().replace(/(^\s*)|(\s*$)/g,"");var content=$(obj).parent().parent().find("textarea").val().replace(/<(script)[\S\s]*?\1>|<\/?(a|img)[^>]*>/gi,"");content=content.replace(/(^\s*)|(\s*$)/g,"").replace(/\'/g,"\\'");if(!content){info.tip({mode:"toast",content:"说两句再来点我吧",type:"error"});return}settings.callback({"type":"reply","commentId":commentId,"toUserId":toUserId,"toUsername":toUsername,"content":content})},javaexShowReplyTextarea2:function(obj,args){attribute=args;var posrLength=$(obj).parent().siblings(".javaex-comment-form.noHd").length;if(posrLength==0){var html='<div class="javaex-comment-form noHd">';html+='<div class="javaex-comment-form-textwrap"><textarea wrap="virtual" class="javaex-comment-textarea original" placeholder="我来说两句..."></textarea></div>';html+='<div style="text-align:right;"><button class="javaex-btn javaex-comment-submit" onclick="javaex.javaexReply2(this, attribute)">发布</button></div>';html+='</div>';$(obj).parent().after(html)}else{$(obj).parent().siblings(".javaex-comment-form.noHd").remove()}},javaexReply2:function(obj,args){var settings=defaults(args);var commentId=$(obj).parents("li").parents("li").attr("id");var toUserId=$(obj).parent().parent().parent().children("div:first-child").children('input[type="hidden"]').val();var toUsername=$(obj).parent().parent().parent().children("div:first-child").children('a.comment-c-replyer').text().replace(/(^\s*)|(\s*$)/g,"");var content=$(obj).parent().parent().find("textarea").val().replace(/<(script)[\S\s]*?\1>|<\/?(a|img)[^>]*>/gi,"");content=content.replace(/(^\s*)|(\s*$)/g,"").replace(/\'/g,"\\'");if(!content){info.tip({mode:"toast",content:"说两句再来点我吧",type:"error"});return}settings.callback({"type":"reply","commentId":commentId,"toUserId":toUserId,"toUsername":toUsername,"content":content})},changeTimeText:function(time){var timeText=time;var now=info.now();var day=info.getTimeDiff(time,now,"day");if(day>6){}else if(day>0){if(day==1){timeText="昨天 "+time.split(" ")[1]}else if(day==2){timeText="前天 "+time.split(" ")[1]}else{timeText=day+" 天前"}}else if(day==0){var hour=info.getTimeDiff(time,now,"hour");if(hour>0){timeText=hour+" 小时前"}else if(hour==0){var minute=info.getTimeDiff(time,now,"minute");if(minute>0){timeText=minute+" 分钟前"}else if(minute==0){var second=info.getTimeDiff(time,now,"second");timeText=second+" 秒前"}}}return timeText},changeTimeTexts:function(selector){var now=info.now();$(selector).each(function(){if(isNaN($(this).text())&&!isNaN(Date.parse($(this).text()))){var day=info.getTimeDiff($(this).text(),now,"day");if(day>6){}else if(day>0){if(day==1){$(this).text("昨天 "+$(this).text().split(" ")[1])}else if(day==2){$(this).text("前天 "+$(this).text().split(" ")[1])}else{$(this).text(day+" 天前")}}else if(day==0){var hour=info.getTimeDiff($(this).text(),now,"hour");if(hour>0){$(this).text(hour+" 小时前");$(this).addClass("highlight-color")}else if(hour==0){var minute=info.getTimeDiff($(this).text(),now,"minute");if(minute>0){$(this).text(minute+" 分钟前");$(this).addClass("highlight-color")}else if(minute==0){var second=info.getTimeDiff($(this).text(),now,"second");$(this).text(second+" 秒前");$(this).addClass("highlight-color")}}}}})},tag:function(args){var settings=defaults(args);var id=settings.id;var maxNum=settings.maxNum;var html='';html+='<div class="javaex-tagator">';html+='<div class="javaex-tags"></div>';html+='<input class="javaex-tag-input" autocomplete="false" maxlength="20" placeholder="输入标签按回车保存" onkeydown="if(event.keyCode==13){javaex.saveTag(this.value, \''+id+'\', \''+maxNum+'\');}">';html+='</div>';$(".javaex-tagbox").append(html);var tagArr=settings.tags;if(!!tagArr){var tag="";var tagHtml='';for(let i=0;i<tagArr.length;i++){if(i==0){tag=tagArr[i]}else{tag+=","+tagArr[i]}tagHtml+='<div class="javaex-tag">';tagHtml+='<span>'+tagArr[i]+'</span>';tagHtml+='<div class="javaex-tag-remove" onclick="javascript:javaex.removeTag(this, \''+tagArr[i]+'\', \''+id+'\');">×</div><div style="clear: both;"></div>';tagHtml+='</div>'}$("#"+id).val(tag);$(".javaex-tags").append(tagHtml)}},saveTag:function(tag,id,maxNum){if(tag.length>=20){return false}tag=tag.replace(/(^\s*)|(\s*$)/g,"");if(tag==""){return false}var result=$("#"+id).val();if(result==""){$("#"+id).val(tag)}else{var arr=result.split(",");if(arr.length>=parseInt(maxNum)){return false}for(let i=0;i<arr.length;i++){if(tag==arr[i]){return false}}$("#"+id).val(result+","+tag)}var html='';html+='<div class="javaex-tag">';html+='<span>'+tag+'</span>';html+='<div class="javaex-tag-remove" onclick="javascript:javaex.removeTag(this, \''+tag+'\', \''+id+'\');">×</div><div style="clear: both;"></div>';html+='</div>';$(".javaex-tag-input").val("");$(".javaex-tags").append(html)},removeTag:function(obj,tag,id){obj.parentNode.remove();var result=$("#"+id).val();var index=result.indexOf(","+tag);if(index==-1){result=result.replace(tag+",","");result=result.replace(tag,"")}else{result=result.replace(","+tag,"")}$("#"+id).val(result)},filter:function(args){var settings=defaults(args);var selector=settings.selector;$(selector).each(function(){if($(this).children("li.on").length==0){$(this).children("li").first().addClass("on")}});if(settings.isInit){callback()}$(selector+">li").click(function(){$(this).addClass("on").siblings().removeClass("on");var arr=new Array();$(selector).each(function(){var ulId=$(this).attr("id");var liValue=$(this).children("li.on").attr("val");arr.push(ulId+"="+liValue)});settings.callback(arr)});function callback(){var arr=new Array();$(selector).each(function(){var ulId=$(this).attr("id");var liValue=$(this).children("li.on").attr("val");arr.push(ulId+"="+liValue)});settings.callback(arr)}},score:function(args){var settings=defaults(args);var id=settings.id;var num=parseInt(settings.num);var scoreArr=settings.scoreArr;var isReadOnly=settings.isReadOnly;var half=settings.half;var size=settings.size;var levelTextArr=settings.levelTextArr;var liHtml='<ul>';for(let i=1;i<=num;i++){if(half){liHtml+='<li index="'+i+'" score="'+scoreArr[i-1]+'" tooltip-pos="up"><i class="javaex-score-star icon-star_border" style="font-size:'+size+'px;"></i></li>'}else{liHtml+='<li index="'+i+'" score="'+scoreArr[i-1]+'" tooltip-pos="up"><i class="javaex-score-star icon-star_border" style="font-size:'+size+'px;"></i></li>'}}liHtml+='</ul>';$("#"+id).empty();$("#"+id).append(liHtml);var scoreChange=function(elem,index,halfFlag){return $(elem).each(function(i,scoreElem){return $(scoreElem).find("i").each(function(i,item){if(i<index){$(item).removeClass("icon-star_border");$(item).removeClass("icon-star_half");return $(item).addClass("icon-star")}else if(i==index){$(item).removeClass("icon-star_border");if(halfFlag){$(item).removeClass("icon-star");$(item).addClass("icon-star_half")}else{$(item).removeClass("icon-star_half");$(item).addClass("icon-star")}}else{$(item).removeClass("icon-star");$(item).removeClass("icon-star_half");return $(item).addClass("icon-star_border")}})})};var score=settings.score;if(!!score){$("#"+id+" li").each(function(){let tempScore=Math.ceil(score);let halfFlag=false;if(half){if((Math.ceil(score)-score)<=0.3){halfFlag=false}else{halfFlag=true}}else{score=(Math.ceil(score)-score)<0.5?Math.ceil(score):Math.floor(score)}if($(this).attr("score")==tempScore){$("#"+id).addClass("active");var index=$(this).attr("index");scoreChange($("#"+id),index-1,halfFlag);return false}})}if(!isReadOnly){$("#"+id+" li").each(function(){var $this=$(this);$this.mousemove(function(e){let index=$(this).attr("index")|0;if(parseInt(index)<=0){return false}let halfFlag=false;if(half){if((e.pageX-$(this).offset().left)<=$(this).width()/2){halfFlag=true;$(this).attr("tooltip",levelTextArr[index*2-2])}else{$(this).attr("tooltip",levelTextArr[index*2-1])}}else{$(this).attr("tooltip",levelTextArr[index-1])}return scoreChange($("#"+id),index-1,halfFlag)})});$("#"+id+" li").click(function(e){let halfFlag=false;if(half){if((e.pageX-$(this).offset().left)<=$(this).width()/2){halfFlag=true}}let index=$(this).attr("index")|0;if(parseInt(index)<=0){return}$("#"+id).attr("active",index);scoreChange($("#"+id),index-1,halfFlag);let score=parseInt($(this).attr("score"));if(halfFlag){score=score-0.5}settings.callback({"index":index,"score":score});if(settings.clickOnce){args.isReadOnly=true;args.score=score;info.score(args)}})}},goTopBtn:function(args){var settings=defaults(args);var id=settings.id;$("#"+id).css("display","none");$("#"+id).click(function(){$("body, html").animate({scrollTop:0},500)});$(window).scroll(function(){var sc=$(window).scrollTop();if(sc>300){$("#"+id).css("display","block")}else{$("#"+id).css("display","none")}})},alert:function(args){var settings=defaults(args);var id=settings.id;var width=parseInt(settings.width);var maxHeight="";if(settings.maxHeight!=""){maxHeight=parseInt(settings.maxHeight)}if(!id){id=info.getUUID()}if(settings.mask){info.addMask()}confirmFn=settings.confirm;closeFn=settings.close;var alertHtml='<div id="'+id+'" class="javaex-dialog javaex-animated-zoom-in" style="width:'+width+'px;top:'+settings.top+';left:'+(document.documentElement.clientWidth-width)/2+'px;">';alertHtml+='<div id="javaex-dialog-top-'+id+'" class="javaex-dialog-top">';alertHtml+='<div class="javaex-dialog-title">'+settings.title+'</div>';if(settings.closeIcon){alertHtml+='<div class="javaex-dialog-opt-icon"><a href="javascript:;" onclick="javaex.callback(\''+id+'\', closeFn);"><span class="icon-close"><span></a></div>'}alertHtml+='</div>';if(!!maxHeight){alertHtml+='<div class="javaex-dialog-content" style="overflow: auto;max-height:'+maxHeight+'px;text-align:'+settings.textAlign+';">'}else{alertHtml+='<div class="javaex-dialog-content" style="text-align:'+settings.textAlign+';">'}alertHtml+=settings.content;alertHtml+='</div>';alertHtml+='<div class="javaex-dialog-footer">';alertHtml+='<button class="javaex-btn javaex-dialog-btn-confirm" onclick="javaex.callback(\''+id+'\', confirmFn);">'+settings.confirmName+'</button>';alertHtml+='</div>';alertHtml+='</div>';$(document.body).append(alertHtml);var oDialog=document.getElementById(id);var oDrag=document.getElementById("javaex-dialog-top-"+id);info.drag(oDialog,oDrag);settings.callback({})},confirm:function(args){var settings=defaults(args);var id=settings.id;var width=parseInt(settings.width);var maxHeight="";if(settings.maxHeight!=""){maxHeight=parseInt(settings.maxHeight)}if(!id){id=info.getUUID()}if(settings.mask){info.addMask()}confirmFn=settings.confirm;cancelFn=settings.cancel;closeFn=settings.close;var confirmHtml='<div id="'+id+'" class="javaex-dialog javaex-animated-zoom-in" style="width:'+width+'px;top:'+settings.top+';left:'+(document.documentElement.clientWidth-width)/2+'px;">';confirmHtml+='<div id="javaex-dialog-top-'+id+'" class="javaex-dialog-top">';confirmHtml+='<div class="javaex-dialog-title">'+settings.title+'</div>';if(settings.closeIcon){confirmHtml+='<div class="javaex-dialog-opt-icon"><a href="javascript:;" onclick="javaex.callback(\''+id+'\', closeFn);"><span class="icon-close"><span></a></div>'}confirmHtml+='</div>';if(!!maxHeight){confirmHtml+='<div class="javaex-dialog-content" style="overflow: auto;max-height:'+maxHeight+'px;text-align:'+settings.textAlign+';">'}else{confirmHtml+='<div class="javaex-dialog-content" style="text-align:'+settings.textAlign+';">'}confirmHtml+=settings.content;confirmHtml+='</div>';confirmHtml+='<div class="javaex-dialog-footer">';confirmHtml+='<button class="javaex-btn javaex-dialog-btn-confirm" onclick="javaex.callback(\''+id+'\', confirmFn);">'+settings.confirmName+'</button>';confirmHtml+='<button class="javaex-btn javaex-dialog-btn-cancel" onclick="javaex.callback(\''+id+'\', cancelFn);">'+settings.cancelName+'</button>';confirmHtml+='</div>';confirmHtml+='</div>';$(document.body).append(confirmHtml);var oDialog=document.getElementById(id);var oDrag=document.getElementById("javaex-dialog-top-"+id);info.drag(oDialog,oDrag);settings.callback({})},deleteDialog:function(obj,args){var settings=defaults(args);var offsetTop=parseInt(settings.offsetTop);$(".javaex-danger-dialog").remove();confirmFn=settings.confirm;cancelFn=settings.cancel;var UUID=info.getUUID();var left=obj.getBoundingClientRect().left+document.documentElement.scrollLeft;var top=obj.getBoundingClientRect().top+document.documentElement.scrollTop;var leftInt=left-186+(obj.offsetWidth/2)+30;if((leftInt+320)>$(document).width()){leftInt=$(document).width()-321}var topInt=top+obj.offsetHeight-40-offsetTop;var html='<div id="'+UUID+'" class="javaex-danger-dialog javaex-win javaex-animated-fadein-up" style="left:'+leftInt+'px;top:'+topInt+'px;">';html+='<button class="javaex-btn red" onclick="javaex.callback(\''+UUID+'\', confirmFn);"><span class="icon icon-check_circle"></span> '+settings.confirmName+'</button>';html+='<button class="javaex-btn indigo" onclick="javaex.callback(\''+UUID+'\', cancelFn);"><span class="icon icon-cancel"></span> '+settings.cancelName+'</button>';html+='</div>';var winId="javaex-win-"+UUID;var contentHtml='<div id="'+winId+'" class="javaex-win javaex-win-hint javaex-animated-fadein-up">';contentHtml+='<div class="javaex-error-text">'+settings.content+'</div>';contentHtml+='<div class="javaex-tail"></div>';contentHtml+='</div>';$(document.body).append(html);setTimeout(function(){$("#"+UUID).append(contentHtml);var topHeight=$("#"+winId).height()+5;$("#"+winId).css("top","-"+topHeight+"px")},300);settings.callback({})},panel:function(obj,args){var settings=defaults(args);var position=settings.position;var alignment=settings.alignment;var left=obj.getBoundingClientRect().left+document.documentElement.scrollLeft+parseInt(settings.offsetLeft);var top=obj.getBoundingClientRect().top+document.documentElement.scrollTop+parseInt(settings.offsetTop);$(".javaex-panel").remove();var html='';if(position=="up"){html+='<div class="javaex-panel" style="left:'+left+'px;">'}else if(position=="down"){if(alignment=="left"){html+='<div class="javaex-panel javaex-animated-sideslip alignment-left" style="left:'+left+'px;top:'+(top+obj.offsetHeight)+'px;">'}else{html+='<div class="javaex-panel javaex-animated-sideslip alignment-right" style="top:'+(top+obj.offsetHeight)+'px;">'}}else if(position=="left"){html+='<div class="javaex-panel javaex-panel-left javaex-animated-zoom-in">'}else if(position=="right"){html+='<div class="javaex-panel javaex-panel-right javaex-animated-zoom-in" style="left:'+(left+obj.offsetWidth+10)+'px;">'}html+=settings.content;html+='</div>';$(document.body).append(html);var panelHeight=$(".javaex-panel").height();var panelWidth=$(".javaex-panel").width();if(position=="up"){$(".javaex-panel").addClass("javaex-animated-slide-up");$(".javaex-panel").css("top",(top-panelHeight-1)+"px")}else if(position=="left"){$(".javaex-panel").css({"top":(top+obj.offsetHeight/2-panelHeight/2)+"px","left":(left-panelWidth-10)+"px"})}else if(position=="right"){$(".javaex-panel").css("top",(top+obj.offsetHeight/2-panelHeight/2)+"px")}else if(position=="down"&&alignment=="right"){$(".javaex-panel").css("left",(left+obj.offsetWidth-panelWidth)+"px")}document.onmouseup=function(){var obj=$(".javaex-panel");if(!obj.is(event.target)&&obj.has(event.target).length==0){$(".javaex-panel").remove();document.onmouseup=null}};settings.callback({})},toast:function(obj,args){var settings=defaults(args);var type=settings.type;var offsetTop=parseInt(settings.offsetTop);$(".javaex-toast-warp").remove();var UUID=info.getUUID();var left=obj.getBoundingClientRect().left+document.documentElement.scrollLeft;var top=obj.getBoundingClientRect().top+document.documentElement.scrollTop;var leftInt=left+(obj.offsetWidth/2);var topInt=top+obj.offsetHeight-offsetTop-70;var html='<div id="'+UUID+'" class="javaex-toast-warp" style="position: absolute;left:'+leftInt+'px;top:'+topInt+'px;">';if(type=="error"){html+='<div class="javaex-toast-content javaex-animated-fadein-up error">'+settings.content+'</div>'}else{html+='<div class="javaex-toast-content javaex-animated-fadein-up">'+settings.content+'</div>'}html+='</div>';$(document.body).append(html);setTimeout(function(){$(".javaex-toast-warp").remove()},settings.live)},timeoutId:null,tip:function(args){var settings=defaults(args);var mode=settings.mode;var type=settings.type;var timeout=settings.timeout;$(".javaex-opt-mask").remove();var html='';if(mode=="toast"){$(".javaex-opt-tip").remove();$(".javaex-message-feedback").remove();$(".javaex-opt-mask").remove();html+='<div class="javaex-toast-warp"><div class="javaex-toast-content">'+settings.content+'</div></div>'}else if(mode=="message"){if(type=="submit"){if(!!timeout){timeout=parseInt(timeout)}else{timeout=0}$(".javaex-message-feedback").remove();html+='<div class="javaex-opt-mask"></div>';html+='<div class="javaex-message-feedback javaex-animated-zoom-in">';html+='<div class="javaex-mf-icons javaex-mf-submit">';html+='<span class="javaex-mf-icon javaex-mf-icon-submit"></span>';html+='<span class="javaex-mf-text">'+settings.content+'</span>';html+='</div>';html+='</div>';if(timeout>0){info.timeoutId=setInterval(function(){info.tip({mode:"message",content:settings.timeoutText,type:"error"});clearInterval(info.timeoutId)},timeout)}}else if(type=="success"){clearInterval(info.timeoutId);$(".javaex-message-feedback").remove();html+='<div class="javaex-message-feedback javaex-animated-zoom-in">';html+='<div class="javaex-mf-icons succeed">';html+='<span class="javaex-mf-icon javaex-mf-icon-succeed"></span>';html+='<span class="javaex-mf-text">'+settings.content+'</span>';html+='</div>';html+='</div>'}else if(type=="error"){clearInterval(info.timeoutId);$(".javaex-message-feedback").remove();html+='<div class="javaex-message-feedback javaex-animated-zoom-in">';html+='<div class="javaex-mf-icons javaex-mf-failed">';html+='<span class="javaex-mf-icon javaex-mf-icon-failed"></span>';html+='<span class="javaex-mf-text">'+settings.content+'</span>';html+='</div>';html+='</div>'}}else{if(type=="submit"){if(!!timeout){timeout=parseInt(timeout)}else{timeout=0}$(".javaex-opt-tip").remove();html+='<div class="javaex-opt-mask"></div>';html+='<div class="javaex-opt-tip javaex-animated-fadein-down">';html+='<div style="display: flex;">';html+='<span class="javaex-tip-icon javaex-tip-icon-loading"></span>';html+='<span class="java-opt-tip-msg">'+settings.content+'</span>';html+='</div>';html+='</div>';if(timeout>0){info.timeoutId=setInterval(function(){info.tip({content:settings.timeoutText,type:"error"});clearInterval(info.timeoutId)},timeout)}}else if(type=="success"){clearInterval(info.timeoutId);if($(".javaex-tip-icon-loading").length>0){$(".javaex-opt-tip").css("background-color","#79c37b");$(".javaex-opt-tip .javaex-tip-icon").removeClass("javaex-tip-icon-loading");$(".javaex-opt-tip .javaex-tip-icon").addClass("icon-check");$(".javaex-opt-tip .javaex-tip-icon").css({"font-size":"16px","font-weight":"bold"});$(".javaex-opt-tip .java-opt-tip-msg").text(settings.content)}else{$(".javaex-opt-tip").remove();html+='<div class="javaex-opt-tip success javaex-animated-fadein-down">';html+='<div style="display: flex;">';html+='<span class="javaex-tip-icon icon-check"></span>';html+='<span class="java-opt-tip-msg">'+settings.content+'</span>';html+='</div>';html+='</div>'}}else if(type=="error"){clearInterval(info.timeoutId);if($(".javaex-tip-icon-loading").length>0){$(".javaex-opt-tip").css("background-color","#ff6e6e");$(".javaex-opt-tip .javaex-tip-icon").removeClass("javaex-tip-icon-loading");$(".javaex-opt-tip .javaex-tip-icon").addClass("icon-close");$(".javaex-opt-tip .javaex-tip-icon").css({"font-size":"16px","font-weight":"bold"});$(".javaex-opt-tip .java-opt-tip-msg").text(settings.content)}else{$(".javaex-opt-tip").remove();html+='<div class="javaex-opt-tip error javaex-animated-fadein-down">';html+='<div style="display: flex;">';html+='<span class="javaex-tip-icon icon-close"></span>';html+='<span class="java-opt-tip-msg">'+settings.content+'</span>';html+='</div>';html+='</div>'}}}$(document.body).append(html);if(mode=="message"){var tipWidth=$(".javaex-message-feedback").width();$(".javaex-message-feedback").css("margin-left",-(tipWidth/2))}else{var tipWidth=$(".javaex-opt-tip").width();$(".javaex-opt-tip").css("margin-left",-(tipWidth/2)+"px")}if(mode=="toast"||type=="success"||type=="error"){setTimeout(function(){$(".javaex-opt-tip").remove();$(".javaex-message-feedback").remove();$(".javaex-opt-mask").remove();$(".javaex-toast-warp").remove()},settings.live)}},isIE:function(){if(!!window.ActiveXobject||"ActiveXObject"in window){return true}if((/Trident\/7\./).test(navigator.userAgent)){return true}return false},loading:function(args){var settings=defaults(args);var mode=settings.mode;var containerId=settings.containerId;var id=settings.id;var type=settings.type;var content=settings.content;if(!content){content="正在读取数据,请稍候..."}var top=settings.top;if(mode==""){$(document.body).append('<div id="javaex-loading" class="javaex-loading">'+content+'</div>');document.onload=document.onreadystatechange=function(){if(!this.readyState||this.readyState=="loaded"||this.readyState=="complete"){document.onload=document.onreadystatechange=null;var oLoading=document.getElementById("javaex-loading");if(oLoading!=null){if(info.isIE()){oLoading.removeNode(true)}else{oLoading.remove()}}}}}else if(mode=="manual"){if(!containerId){if(type=="open"){$(document.body).append('<div id="javaex-loading" class="javaex-loading">'+content+'</div>')}else if(type=="close"){$("#javaex-loading").remove()}}else{if(type=="open"){$("#"+containerId).addClass("javaex-temp-relative");if(id==""){$("#"+containerId).append('<div class="javaex-loading-mask"><div style="margin: auto;"><div class="javaex-loading-process"></div></div></div>')}else{$("#"+containerId).append('<div id="'+id+'" class="javaex-loading-mask"><div style="margin: auto;"><div class="javaex-loading-process"></div></div></div>')}}else if(type=="close"){$("#"+containerId).removeClass("javaex-temp-relative");if(id==""){$(".javaex-loading-mask").remove()}else{$("#"+id).remove()}}}}},num:0,dialog:function(args){var settings=defaults(args);var width=parseInt(settings.width);var offsetLeft=parseInt(settings.offsetLeft);var offsetTop=parseInt(settings.offsetTop);var height=settings.height;if(height!=""){height=parseInt(height)}var hasBackground=settings.hasBackground;var type=settings.type;attribute=args;var UUID=info.getUUID();if(settings.id!=""){UUID=settings.id}closeFn=settings.close;var dialogHtml='';if(type=="image"){info.addMask();var image=new Image();image.src=settings.url;var maxWidth=document.documentElement.clientWidth-120;var maxHeight=document.documentElement.clientHeight-120;var arr=info.autoWidthHeight(image.width,image.height,maxWidth,maxHeight);width=arr[0]+40;height=arr[1]+40;dialogHtml='<div id="'+UUID+'" class="javaex-dialog javaex-animated-zoom-in" style="width:'+width+'px;left:'+(maxWidth-width+120)/2+'px;">';dialogHtml+='<div class="javaex-dialog-content" style="padding: 0;">';dialogHtml+='<img src="'+settings.url+'" />';dialogHtml+='</div>';dialogHtml+='<a class="javaex-dialog-close-big" href="javascript:;" onclick="javaex.close(\''+UUID+'\');"></a>';dialogHtml+='</div>'}else if(type=="images"){var selector=settings.selector;var placeholder=settings.placeholder;var original=settings.dataOriginal;$(selector).each(function(i){if($(this).attr("src")==settings.url){info.num=i}});var image=new Image();image.src=settings.url;var maxWidth=document.documentElement.clientWidth-120;var maxHeight=document.documentElement.clientHeight-120;var arr=info.autoWidthHeight(image.width,image.height,maxWidth,maxHeight);width=arr[0];height=arr[1];dialogHtml='<div class="javaex-allcover"></div>';dialogHtml+='<div id="'+UUID+'" class="javaex-area-window">';dialogHtml+='<div id="javaex-box-image-manga" style="width:'+width+'px;height:'+height+'px;left:'+(maxWidth-width+120)/2+'px;top:'+(maxHeight-height+120)/2+'px;">';dialogHtml+='<img id="img-'+UUID+'" src="'+settings.url+'" style="opacity: 1;">';dialogHtml+='</div>';dialogHtml+='<div class="javaex-allcover-prev-image" title="上一张" onclick="javaex.lastImg(\''+UUID+'\', \''+selector+'\', \''+placeholder+'\', \''+original+'\');">';dialogHtml+='<i class="icon icon-chevron-circle-left"></i>';dialogHtml+='</div>';dialogHtml+='<div class="javaex-allcover-next-image" title="下一张" onclick="javaex.nextImg(\''+UUID+'\', \''+selector+'\', \''+placeholder+'\', \''+original+'\');">';dialogHtml+='<i class="icon icon-chevron-circle-right"></i>';dialogHtml+='</div>';dialogHtml+='<div class="javaex-area-tool-image">';dialogHtml+='<a id="javaex-btn-quit-image" class="javaex-btn red" href="javascript:;" onclick="javaex.close(\''+UUID+'\');">';dialogHtml+='<i class="icon icon-cancel" style="vertical-align: middle;height: 30px;line-height: 28px;font-size: 16px;"></i>退出读图模式';dialogHtml+='</a>';dialogHtml+='</div>';dialogHtml+='</div>'}else if(type=="dialog"){let topHeight=(document.documentElement.clientHeight-height)/2+offsetTop;let leftWidth=(document.documentElement.clientWidth-width)/2+offsetLeft;if(settings.mask){info.addMask()}if(settings.title&&settings.title!="温馨提示"){dialogHtml+='<div id="'+UUID+'" class="javaex-dialog javaex-animated-zoom-in" style="width:'+width+'px;height:'+height+'px;top:'+topHeight+'px;left:'+leftWidth+'px;">';dialogHtml+='<div id="javaex-dialog-top-'+UUID+'" class="javaex-dialog-top">';dialogHtml+='<div id="javaex-dialog-title-'+UUID+'" class="javaex-dialog-title">'+settings.title+'</div>';dialogHtml+='<div class="javaex-dialog-opt-icon"><a href="javascript:;" onclick="javaex.callback(\''+UUID+'\', closeFn);"><span class="icon-close"><span></a></div>';dialogHtml+='</div>';if(hasBackground){dialogHtml+='<div id="javaex-dialog-content-'+UUID+'" class="javaex-dialog-content javaex-dialog-window javaex-dialog-bg">'}else{dialogHtml+='<div id="javaex-dialog-content-'+UUID+'" class="javaex-dialog-content javaex-dialog-window">'}}else{dialogHtml='<div id="'+UUID+'" class="javaex-dialog javaex-animated-zoom-in" style="box-shadow: none;width:'+width+'px;height:'+height+'px;top:'+topHeight+'px;left:'+leftWidth+'px;">';if(hasBackground){dialogHtml+='<div id="javaex-dialog-content-'+UUID+'" class="javaex-dialog-content javaex-dialog-window javaex-dialog-bg" style="height:100%;">'}else{dialogHtml+='<div id="javaex-dialog-content-'+UUID+'" class="javaex-dialog-content javaex-dialog-window" style="height:100%;">'}}dialogHtml+='<iframe src="'+settings.url+'" width="100%" height="100%" frameborder="0" scrolling="'+settings.scrolling+'" style="overflow: visible;border: 0;"></iframe>';dialogHtml+='</div>';if(!settings.title||settings.title=="温馨提示"){dialogHtml+='<a class="javaex-dialog-close-big" href="javascript:;" onclick="javaex.callback(\''+UUID+'\', closeFn);"></a>'}dialogHtml+='</div>'}else if(type=="window"){let topHeight=(document.documentElement.clientHeight-height)/2+offsetTop;let leftWidth=(document.documentElement.clientWidth-width)/2+offsetLeft;if(settings.mask){info.addMask()}dialogHtml='<div id="'+UUID+'" class="javaex-dialog javaex-animated-zoom-in" style="width:'+width+'px;height:'+height+'px;top:'+topHeight+'px;left:'+leftWidth+'px;">';dialogHtml+='<div class="javaex-dialog-top">';dialogHtml+='<div id="javaex-dialog-title-'+UUID+'" class="javaex-dialog-title">'+settings.title+'</div>';dialogHtml+='<div class="javaex-dialog-opt-icon clear">';dialogHtml+='<a href="javascript:;" id="javaex-dialog-min-'+UUID+'" onclick="javaex.min(\''+UUID+'\');"><span class="icon-minus"><span></a>';dialogHtml+='<a href="javascript:;" id="javaex-dialog-max-'+UUID+'" onclick="javaex.max(\''+UUID+'\');"><span class="icon-fullscreen"><span></a>';dialogHtml+='<a href="javascript:;" id="javaex-dialog-revert-'+UUID+'" onclick="javaex.revert(\''+UUID+'\', attribute);" style="display:none;"><span class="icon-fullscreen_exit"><span></a>';dialogHtml+='<a href="javascript:;" onclick="javaex.callback(\''+UUID+'\', closeFn);"><span class="icon-close"><span></a>';dialogHtml+='</div>';dialogHtml+='</div>';if(hasBackground){dialogHtml+='<div id="javaex-dialog-content-'+UUID+'" class="javaex-dialog-content javaex-dialog-window javaex-dialog-bg" style="overflow-y:hidden;">'}else{dialogHtml+='<div id="javaex-dialog-content-'+UUID+'" class="javaex-dialog-content javaex-dialog-window" style="overflow-y:hidden;">'}dialogHtml+='<iframe id="javaex-iframe-'+UUID+'" src="'+settings.url+'" width="100%" height="100%" frameborder="0" scrolling="'+settings.scrolling+'" style="overflow: visible;border: 0;"></iframe>';dialogHtml+='</div>';dialogHtml+='<i id="javaex-dialog-resize-'+UUID+'" class="javaex-dialog-resize" onmousemove="javaex.resize(\''+UUID+'\', attribute);"></i>';dialogHtml+='</div>'}$(document.body).append(dialogHtml);var oDialog=document.getElementById(UUID);if(type=="image"){var heightDifference=document.documentElement.clientHeight-oDialog.offsetHeight;oDialog.style.top=(heightDifference/2)+"px";$(".javaex-mask").click(function(){info.close(UUID)})}else if(type=="window"||(type=="dialog"&&!!settings.title&&settings.title!="温馨提示")){var oDrag=document.getElementById("javaex-dialog-title-"+UUID);info.drag(oDialog,oDrag);if(settings.isClickMaskClose){$(".javaex-mask").click(function(){info.close(UUID)})}}settings.callback({})},autoWidthHeight:function(width,height,maxWidth,maxHeight){if(width<maxWidth&&height<maxHeight){}else{if(maxWidth/maxHeight<=width/height){width=maxWidth;height=maxWidth*(height/width)}else{width=maxHeight*(width/height);height=maxHeight}}var arr=new Array(width,height);return arr},lastImg:function(UUID,selector,placeholder,original){info.num--;if(info.num>=0){$("#img-"+UUID).css({"opacity":0,"transition":"opacity 200ms ease 0s"});setTimeout(function(){var image=new Image();image.src=$(selector).eq(info.num).attr("src");var maxWidth=document.documentElement.clientWidth-120;var maxHeight=document.documentElement.clientHeight-120;var arr=info.autoWidthHeight(image.width,image.height,maxWidth,maxHeight);width=arr[0];height=arr[1];$("#javaex-box-image-manga").css({"width":width+"px","height":height+"px","left":(maxWidth-width+120)/2+"px","top":(maxHeight-height+120)/2+"px"});$("#img-"+UUID).attr("src",image.src);$("#img-"+UUID).css({"opacity":1,"transition":""})},200)}else{info.num=$(selector).length-2;info.nextImg(UUID,selector,placeholder,original)}},nextImg:function(UUID,selector,placeholder,original){info.num++;if(info.num<$(selector).length){$("#img-"+UUID).css({"opacity":0,"transition":"opacity 200ms ease 0s"});setTimeout(function(){var image=new Image();var imgSrc=$(selector).eq(info.num).attr("src");if(imgSrc.indexOf(placeholder)!=-1){imgSrc=$(selector).eq(info.num).attr(original)}image.src=imgSrc;var maxWidth=document.documentElement.clientWidth-120;var maxHeight=document.documentElement.clientHeight-120;var arr=info.autoWidthHeight(image.width,image.height,maxWidth,maxHeight);width=arr[0];height=arr[1];$("#javaex-box-image-manga").css({"width":width+"px","height":height+"px","left":(maxWidth-width+120)/2+"px","top":(maxHeight-height+120)/2+"px"});$("#img-"+UUID).attr("src",image.src);$("#img-"+UUID).css({"opacity":1,"transition":""})},200)}else{info.num=-1;info.nextImg(UUID,selector,placeholder,original)}},resize:function(UUID,args){var settings=defaults(args);var dragMinWidth=parseInt(settings.width);var dragMinHeight=parseInt(settings.height);var oDialog=document.getElementById(UUID);var oResize=document.getElementById("javaex-dialog-resize-"+UUID);var oBody=document.getElementById("javaex-dialog-content-"+UUID);var oIframe=document.getElementById("javaex-iframe-"+UUID);oResize.onmousedown=function(event){var oEvent=event||window.event;var absX=oEvent.clientX-oResize.offsetLeft;var absY=oEvent.clientY-oResize.offsetTop;document.onmousemove=function(eve){var oEve=eve||window.event;var offsetLeft=oEve.clientX-absX;var offsetTop=oEve.clientY-absY;var maxWidth=document.documentElement.clientWidth-oDialog.offsetLeft-2;var maxHeight=document.documentElement.clientHeight-oDialog.offsetTop-2;var offsetWidth=oResize.offsetWidth+offsetLeft;var offsetHeight=oResize.offsetHeight+offsetTop;if(offsetWidth<dragMinWidth){offsetWidth=dragMinWidth}if(offsetWidth>maxWidth){offsetWidth=maxWidth}if(offsetHeight<dragMinHeight){offsetHeight=dragMinHeight}if(offsetHeight>maxHeight){offsetHeight=maxHeight}oDialog.style.width=offsetWidth+"px";oDialog.style.height=offsetHeight+"px";return false};oIframe.contentWindow.onmouseup=document.onmouseup=function(){oResize.onmousedown=null;document.onmousemove=null;document.onmouseup=null};return false}},min:function(UUID){var oMin=document.getElementById("javaex-dialog-min-"+UUID);oMin.style.display="none";var oResize=document.getElementById("javaex-dialog-resize-"+UUID);oResize.style.display="none";var oMax=document.getElementById("javaex-dialog-max-"+UUID);oMax.style.display="none";var oRevert=document.getElementById("javaex-dialog-revert-"+UUID);oRevert.style.display="inline-block";var oContent=document.getElementById("javaex-dialog-content-"+UUID);oContent.style.display="none";var oDialog=document.getElementById(UUID);oDialog.style.left="0";oDialog.style.width="260px";oDialog.style.height="40px";offsetTop=document.documentElement.clientHeight-oDialog.offsetHeight;oDialog.style.top=offsetTop+"px"},max:function(UUID){var oMax=document.getElementById("javaex-dialog-max-"+UUID);oMax.style.display="none";var oResize=document.getElementById("javaex-dialog-resize-"+UUID);oResize.style.display="none";var oMin=document.getElementById("javaex-dialog-min-"+UUID);oMin.style.display="inline-block";var oRevert=document.getElementById("javaex-dialog-revert-"+UUID);oRevert.style.display="inline-block";var oDialog=document.getElementById(UUID);oDialog.style.top="0";oDialog.style.left="0";oDialog.style.width=document.documentElement.clientWidth-2+"px";oDialog.style.height=document.documentElement.clientHeight-2+"px";var oContent=document.getElementById("javaex-dialog-content-"+UUID);oContent.style.display="block"},revert:function(UUID,args){var settings=defaults(args);var width=parseInt(settings.width);var height=parseInt(settings.height);var oMin=document.getElementById("javaex-dialog-min-"+UUID);oMin.style.display="inline-block";var oRevert=document.getElementById("javaex-dialog-revert-"+UUID);oRevert.style.display="none";var oMax=document.getElementById("javaex-dialog-max-"+UUID);oMax.style.display="inline-block";var oResize=document.getElementById("javaex-dialog-resize-"+UUID);oResize.style.display="inline-block";var oDialog=document.getElementById(UUID);var offsetTop=parseInt(settings.offsetTop);var offsetLeft=parseInt(settings.offsetLeft);oDialog.style.width=width+"px";oDialog.style.height=height+"px";oDialog.style.left=(document.documentElement.clientWidth-width)/2+offsetLeft+"px";oDialog.style.top=(document.documentElement.clientHeight-height)/2+offsetTop+"px";var oContent=document.getElementById("javaex-dialog-content-"+UUID);oContent.style.display="block"},callback:function(id,fn){if(fn()!=false){info.close(id)}},close:function(id){if(!id){$(".javaex-dialog").removeClass("javaex-animated-zoom-in");$(".javaex-dialog").addClass("javaex-animated-zoom-out");$(".javaex-mask").remove();$(".javaex-panel").remove();if($(".javaex-drawer").length>0){$(".javaex-drawer").css("transform","translateX(0px)")}setTimeout(function(){$(".javaex-dialog").remove()},300)}else{$dialog=$("#"+id);if($dialog.hasClass("javaex-area-window")){$dialog.remove();$(".javaex-allcover").remove()}else if($dialog.hasClass("javaex-danger-dialog")){$dialog.removeClass("javaex-animated-fadein-up");$dialog.addClass("javaex-animated-zoom-out");setTimeout(function(){$dialog.remove()},300)}else if($dialog.hasClass("javaex-drawer")){$dialog.css("transform","translateX(0px)");if($dialog.hasClass("javaex-drawer-auto")){setTimeout(function(){$dialog.remove()},200)}}else{$dialog.removeClass("javaex-animated-zoom-in");$dialog.addClass("javaex-animated-zoom-out");setTimeout(function(){$dialog.remove()},300)}$(".javaex-mask").remove()}},addMask:function(){$(document.body).append('<div class="javaex-mask"></div>')},drag:function(oDialog,oDrag){oDrag.onmousedown=function(event){var oEvent=event||window.event;var absX=oEvent.clientX-oDialog.offsetLeft;var absY=oEvent.clientY-oDialog.offsetTop;document.onmousemove=function(eve){var oEve=eve||window.event;var offsetLeft=oEve.clientX-absX;var offsetTop=oEve.clientY-absY;if(offsetLeft<=0){offsetLeft=0}else if(offsetLeft>=(document.documentElement.clientWidth-oDialog.offsetWidth)){offsetLeft=document.documentElement.clientWidth-oDialog.offsetWidth}if(offsetTop<=0){offsetTop=0}else if(offsetTop>=(document.documentElement.clientHeight-oDialog.offsetHeight)){offsetTop=document.documentElement.clientHeight-oDialog.offsetHeight}oDialog.style.left=offsetLeft+"px";oDialog.style.top=offsetTop+"px"};document.onmouseup=function(){document.onmousemove=null;document.onmouseup=null}}},render:function(){info.radio();info.checkbox()},menu:function(args){var settings=defaults(args);var menuId=settings.id;var cookieKey="javaexMenuUrl-"+menuId;if(settings.isShowAll){$("#"+menuId+" .javaex-menu-item").addClass("javaex-menu-show");$("#"+menuId+" .javaex-menu-item>ul").css("display","block")}$("#"+menuId+" .javaex-menu-item>a").on("click",function(){if($(this).next().css("display")=="none"){if(!settings.isShowAll){$("#"+menuId+" .javaex-menu-item").children("ul").slideUp(300)}$(this).next("ul").slideDown(300);if(settings.isShowAll){$(this).parent("li").addClass("javaex-menu-show")}else{$(this).parent("li").addClass("javaex-menu-show").siblings("li").removeClass("javaex-menu-show")}}else{if($(this).next("ul").length==0){$("#"+menuId+" .javaex-menu-item.javaex-menu-show ul").slideUp(300)}else{$(this).next("ul").slideUp(300)}if(settings.isShowAll){$(this).parent("li").removeClass("javaex-menu-show")}else{$("#"+menuId+" .javaex-menu-item.javaex-menu-show").removeClass("javaex-menu-show")}}});var menuFlag=0;$("#"+menuId+" li.javaex-menu-item>a").click(function(){menuFlag=1;addHover($(this).parent())});$("#"+menuId+" li.javaex-menu-item ul li>a").click(function(){menuFlag=2;addHover($(this).parent())});function addHover(obj){if(menuFlag==1){$("#"+menuId+" li.javaex-menu-item").removeClass("hover")}else if(menuFlag==2){$("#"+menuId+" li.javaex-menu-item ul li").removeClass("hover")}else{$("#"+menuId+" li.javaex-menu-item").removeClass("hover");$("#"+menuId+" li.javaex-menu-item ul li").removeClass("hover")}obj.addClass("hover")}if(settings.isAutoSelected){var url=window.location.href;var flag=menuSelected(url);if(!flag){if(!settings.key){info.deleteCookie(cookieKey);menuSelected(settings.url)}else{var host=window.location.host;if(url==("http://"+host+"/")||url==("https://"+host+"/")||url==("http://"+host)||url==("https://"+host)){info.deleteCookie(cookieKey)}else{var url=info.getCookie(cookieKey);if(!url){url=settings.url;if(!url.startsWith("/")){url="/"+url}}flag=menuSelected(url);if(!flag){url=settings.url;if(!url.startsWith("/")){url="/"+url}menuSelected(url)}}}}}function menuSelected(url){var url2=url.replace(window.location.host,"").replace("http://","").replace("https://","");var flag=false;var menuFlag=false;$("#"+menuId+" li").each(function(){var href=$(this).children().first().attr("href");if(href.indexOf("javascript:page")>=0){href=href.replace(/"/g,"'");href=href.replace("javascript:page('","").replace("');","").replace("')","")}if(url2==href){menuFlag=true;flag=true;info.setCookie(cookieKey,url);if($(this).hasClass("javaex-menu-item")){$("#"+menuId+" li.javaex-menu-item").removeClass("hover");$("#"+menuId+" li.javaex-menu-item ul li").removeClass("hover");$(this).addClass("hover")}else{$(this).addClass("hover").siblings().removeClass("hover");$(this).parent().parent().addClass("javaex-menu-show hover")}return}});if(!menuFlag){$("#"+menuId+" li").each(function(){var href=$(this).children().first().attr("href");if(url.indexOf(href)>=0){flag=true;info.setCookie(cookieKey,url);if($(this).hasClass("javaex-menu-item")){$("#"+menuId+" li.javaex-menu-item").removeClass("hover");$("#"+menuId+" li.javaex-menu-item ul li").removeClass("hover");$(this).addClass("hover")}else{$(this).addClass("hover").siblings().removeClass("hover");$(this).parent().parent().addClass("javaex-menu-show")}return}})}return flag}},tab:function(args){var settings=defaults(args);var tabId=settings.id;var current=parseInt(settings.current);var mode=settings.mode;var display=settings.display;$("#"+tabId+" .javaex-tab-title ul li").each(function(i){if(i==(current-1)){$(this).addClass("current")}});$("#"+tabId+" .javaex-tab-content>div").each(function(i){if(i==(current-1)){$(this).css("display",display)}else{$(this).css("display","none")}});if(settings.isInit){settings.callback({"index":current})}if(mode=="mouseover"){$("#"+tabId+" .javaex-tab-title ul li").mouseover(function(){$this=$(this);setTimeout(function(){$this.addClass("current").siblings().removeClass("current");$("#"+tabId+" .javaex-tab-content>div:eq("+$this.index()+")").show().siblings().hide();$(settings.container).trigger(settings.event);settings.callback({"index":$this.index()+1})},settings.delay)})}else if(mode=="click"){$("#"+tabId+" .javaex-tab-title ul li").click(function(){$(this).addClass("current").siblings().removeClass("current");$("#"+tabId+" .javaex-tab-content>div:eq("+$(this).index()+")").show().siblings().hide();$(settings.container).trigger(settings.event);settings.callback({"index":$(this).index()+1})})}},initTable:function(tableId){$("#"+tableId+" thead tr th").find(".javaex-table-sort-icon").css("opacity",0.3)},table:function(args){var settings=defaults(args);var tableId=settings.id;var mergeColArr=settings.mergeColArr;var tree=settings.tree;var isDragColWidth=settings.isDragColWidth;var mode=settings.mode;var leftFixedColNum=parseInt(settings.leftFixedColNum);var rightFixedColNum=parseInt(settings.rightFixedColNum);var sort=settings.sort;var sortSingle=settings.sortSingle;var colWidth=settings.colWidth;var $table=$("#"+tableId);if(!!colWidth){if(String(colWidth).indexOf("px")==-1){colWidth=colWidth+"px"}$table.find("thead tr th").each(function(i){if(!$(this)[0].style.width&&!$(this).hasClass("javaex-table-num-col")&&!$(this).hasClass("javaex-table-filter-col")){$(this).width(colWidth)}})}if(sort!=null){setSortCol(tableId)}if(leftFixedColNum>0||rightFixedColNum>0){fixedCol(tableId)}function setSortCol(tableId){var html='<svg class="javaex-table-sort-svg" focusable="false" viewBox="0 0 1024 1024" aria-hidden="true" role="presentation"><path class="javaex-table-sort-icon" d="M381.1,165.5c-18.7-7.5-53-3.8-67.4,11.2L176.9,314.3c-9.6,9.6-14.9,22.5-14.9,35.9s5.3,26.2,14.9,35.9 c19.7,19.8,51.7,19.3,70.9,0l64.1-64.7l-0.2,490.5c0,27.9,22.4,50.4,50.1,50.4c27.7,0,50.1-22.5,50.1-50.4V212.2 C412.1,191.8,400.3,173.5,381.1,165.5z"></path><path class="javaex-table-sort-icon" d="M847.5,636.9c-19.7-19.8-51.7-19.3-70.9,0L712,700.1l0.7-488c0-27.8-22.4-50.3-50.1-50.3 c-27.7,0-50.1,22.5-50.1,50.3v598.9c0,20.9,12.3,39.1,31.5,47.1c5.9,2.7,12.3,3.7,18.7,3.7c13.3,0,38.6-5.3,48.2-15l137.3-138.1 C866.7,688.8,866.7,656.7,847.5,636.9z"></path></svg>';for(let i in sort){let field=sort[i];let $th=$("#"+tableId+" thead tr:first").children("th").eq(--i);if($th.children(".javaex-table-sort").length==0){$th.append('<a class="javaex-table-sort"></a>');$th.children(".javaex-table-sort").empty();$th.children(".javaex-table-sort").append(html);let $sort=$th.children(".javaex-table-sort");$sort.bind("click",function(){let $sort0=$sort.find(".javaex-table-sort-icon").eq(0);let $sort1=$sort.find(".javaex-table-sort-icon").eq(1);let sort1Opacity=$sort1.css("opacity");var sortArr=new Array();if(sortSingle){$("#"+tableId+" thead tr th").find(".javaex-table-sort-icon").css("opacity",0.3);if(sort1Opacity==0.7){$sort0.css("opacity",0.7);$sort1.css("opacity",0.3);sortArr.push(field+"=asc")}else{$sort0.css("opacity",0.3);$sort1.css("opacity",0.7);sortArr.push(field+"=desc")}}else{if(sort1Opacity==0.7){$sort0.css("opacity",0.7);$sort1.css("opacity",0.3)}else{$sort0.css("opacity",0.3);$sort1.css("opacity",0.7)}for(let j in sort){let fieldTemp=sort[j];let $thTemp=$("#"+tableId+" thead tr:first").children("th").eq(--j);let $sortTemp0=$thTemp.find(".javaex-table-sort-icon").eq(0);let $sortTemp1=$thTemp.find(".javaex-table-sort-icon").eq(1);if($sortTemp0.css("opacity")==0.7){sortArr.push(fieldTemp+"=asc")}else if($sortTemp1.css("opacity")==0.7){sortArr.push(fieldTemp+"=desc")}}}settings.sortCallback({"sortArr":sortArr})})}}}function fixedCol(tableId){var fixedTableParentId="javaex-fixed-table-parent-"+tableId;if($("#"+fixedTableParentId).length==0){$table.wrap('<div id="'+fixedTableParentId+'" class="javaex-fixed-table-parent"></div>')}var $fixedTableParent=$("#"+fixedTableParentId);var tableWidth=$table.width();let right=$fixedTableParent.width()-tableWidth-2;var colLen=document.getElementById(tableId).rows[0].cells.length;if($fixedTableParent.scrollLeft()==0){$fixedTableParent.scrollLeft(1)}$fixedTableParent.scroll(function(){var left=$fixedTableParent.scrollLeft();left=left+0.1;var trs=$("#"+tableId+" tr");trs.each(function(){if(leftFixedColNum>0){if(leftFixedColNum==1){$(this).children().eq(0).addClass("javaex-table-col-fixed javaex-fixed-alone");$(this).children().eq(0).css({"left":left+"px"})}else{for(let i=0;i<leftFixedColNum;i++){if(i==0){$(this).children().eq(i).addClass("javaex-table-col-fixed javaex-fixed-left");$(this).children().eq(i).css({"left":left+"px"})}else if(i==(leftFixedColNum-1)){$(this).children().eq(i).addClass("javaex-table-col-fixed javaex-fixed-right");$(this).children().eq(i).css({"left":left+"px"})}else{$(this).children().eq(i).addClass("javaex-table-col-fixed javaex-fixed-center");$(this).children().eq(i).css({"left":left+"px"})}}}}if(rightFixedColNum>0){for(let i=0;i<rightFixedColNum;i++){let index=colLen-(i+1);if(i==(rightFixedColNum-1)){$(this).children().eq(index).addClass("javaex-table-col-fixed javaex-fixed-left");$(this).children().eq(index).css({"left":(right+left)+"px"})}else{$(this).children().eq(index).addClass("javaex-table-col-fixed javaex-fixed-center");$(this).children().eq(index).css({"left":(right+left)+"px"})}}}})})}if(isDragColWidth){var curTH;var oTable=document.getElementById(tableId);var minWidth=oTable.offsetWidth;var len=oTable.rows[0].cells.length;for(let i=0;i<len;i++){oTable.rows[0].cells[i].onmousemove=function(event){if(event.offsetX>(this.offsetWidth-10)){this.style.cursor="col-resize"}else{this.style.cursor="auto"}};oTable.rows[0].cells[i].onmousedown=function(){curTH=this;if(event.offsetX>(curTH.offsetWidth-10)){curTH.mouseDown=true;curTH.oldX=event.x;curTH.oldWidth=curTH.offsetWidth}if(mode=="overflow"){curTH.tableWidth=oTable.offsetWidth}oTable.rows[0].cells[i].onmouseup=function(){if(!curTH){curTH=this}curTH.mouseDown=false;curTH.style.cursor="auto";if(leftFixedColNum>0||rightFixedColNum>0){fixedCol(tableId)}};oTable.onmousemove=oTable.rows[0].cells[i].onmousemove=function(event){if(event.offsetX>(this.offsetWidth-10)){this.style.cursor="col-resize"}else{this.style.cursor="auto"}if(!curTH){curTH=this}if(curTH.mouseDown!=null&&curTH.mouseDown){curTH.style.cursor="auto";if((curTH.oldWidth+(event.x-curTH.oldX))>80){curTH.width=curTH.oldWidth+(event.x-curTH.oldX)}curTH.style.width=curTH.width+"px";curTH.style.cursor="col-resize";if(mode=="overflow"){oTable.width=curTH.tableWidth+(curTH.offsetWidth-curTH.oldWidth);if(oTable.width>minWidth){oTable.style.width=oTable.width+"px"}}}return false};return false};document.onmouseup=function(){if(!!curTH){curTH.mouseDown=false;curTH.style.cursor="auto";oTable.onmousemove=null}}}}if(mergeColArr.length>0){for(let i=0;i<mergeColArr.length;i++){tableMerge($("#"+tableId),mergeColArr[i]-1)}$("#"+tableId).removeData()}if(parseInt(tree)>0){$("#"+tableId+" tbody tr").each(function(){setPaddingLeft($(this))});$("#"+tableId+" .icon-caret-down, #"+tableId+" icon-caret-right").on("click",function(e){if($(this).hasClass("icon-caret-down")){$(this).addClass("icon-caret-right").removeClass("icon-caret-down")}else{$(this).addClass("icon-caret-down").removeClass("icon-caret-right")}var flag=false;var objTr=$(this).closest("tr");objTr.nextAll("tr").each(function(){var parentId=$(this).attr("parentId");if(parentId==objTr.attr("id")){if($(this).is(":hidden")){flag=true;$(this).show();$(this).addClass("javaex-animated-slide-down")}}});if(!flag){hideTr(objTr)}e.stopPropagation()});if(settings.isClose){$("#"+tableId+" .icon-caret-down").each(function(){if($(this).closest("tr").is(":visible")){$(this).click()}})}}function setPaddingLeft(objTr){var flag=false;var id=objTr.attr("id");objTr.nextAll("tr").each(function(){if($(this).attr("parentId")==id){flag=true;if(objTr.children("td:eq("+(tree-1)+")").children("span.icon-caret-down").length==0){objTr.children("td:eq("+(tree-1)+")").prepend('<span class="javaex-tree-icon icon-caret-down" style="font-size: 16px;"></span>')}var paddingLeft=parseInt($(this).children("td:eq("+(tree-1)+")").css("padding-left"));$(this).children("td:eq("+(tree-1)+")").css("padding-left",(paddingLeft+16)+"px");setPaddingLeft($(this))}});if(!flag){var objTd=objTr.children("td:eq("+(tree-1)+")");objTd.children("span.icon-caret-down").remove();objTr.prevAll().each(function(){if($(this).children("td:eq("+(tree-1)+")").children("span.icon-caret-down").length>0){var paddingLeft=parseInt($(this).children("td:eq("+(tree-1)+")").css("padding-left"));if(objTd.closest("tr").attr("parentId")==$(this).attr("id")){objTd.css("padding-left",(paddingLeft+24)+"px")}return false}})}}function hideTr(objTr){var id=objTr.attr("id");objTr.nextAll("tr").each(function(){if($(this).attr("parentId")==id){if($(this).children("td:eq("+(tree-1)+")").children("span.icon-caret-down").length>0){$(this).children("td:eq("+(tree-1)+")").children("span.icon-caret-down").addClass("icon-caret-right").removeClass("icon-caret-down")}$(this).hide();$(this).removeClass("javaex-animated-slide-down");hideTr($(this))}})}function tableMerge(obj,colIndex){obj.data("content","");obj.data("rowspan",1);obj.data("td",$());obj.data("trNum",$("#"+tableId+" tbody tr").length);$("tbody tr",obj).each(function(index){var $tr=$(this);var $td=$("td:eq("+colIndex+")",$tr);var currentContent=$td.html();if(obj.data("content")==""){obj.data("content",currentContent);obj.data("td",$td)}else{if(obj.data("content")==currentContent){addRowspan()}else{newRowspan()}}function addRowspan(){var rowspan=obj.data("rowspan")+1;obj.data("rowspan",rowspan);$td.hide();if(++index==obj.data("trNum")){obj.data("td").attr("rowspan",obj.data("rowspan"))}}function newRowspan(){if(obj.data("rowspan")!=1){obj.data("td").attr("rowspan",obj.data("rowspan"))}obj.data("td",$td);obj.data("content",$td.html());obj.data("rowspan",1)}})}},copy:function(){const oPres=document.getElementsByTagName("pre");for(let i=0;i<oPres.length;i++){let oPre=oPres[i];let UUID=info.getUUID();let id="javaex-code-"+UUID;let copyBtn='<div class="javaex-codecopy-btn" data-title="复制" data-clipboard-target="#'+id+'" onclick="javaex.javaexCopyBtnClick(this)" onmouseout="javaex.javaexCopyBtnMouseout(this)"></div>';oPre.setAttribute("id",id);let html=oPre.innerHTML+copyBtn;oPre.innerHTML=html}const clipboardJs=new ClipboardJS('.javaex-codecopy-btn')},javaexCopyBtnClick:function(obj){obj.setAttribute("data-title","复制成功")},javaexCopyBtnMouseout:function(obj){setTimeout(function(){obj.setAttribute("data-title","复制")},1500)},selectCheckbox:function(args){var settings=defaults(args);var selectId=settings.id;var isShowAllCheck=settings.isShowAllCheck;var minWidth=parseInt(settings.minWidth);var dataList=settings.dataList;var checkboxName="name-"+selectId;var checkAllListen="listen-"+selectId;var checkChildListen="listen-"+selectId+"-child";$("#span-"+selectId).remove();var $select=$("#"+selectId);if($select.length==0){return false}$select.css("display","none");var selectHtml='<div id="span-'+selectId+'" class="javaex-select-box">';selectHtml+='<div id="input-'+selectId+'" class="javaex-select"></div>';selectHtml+='<span id="icon-'+selectId+'" class="icon-angle-down javaex-select-close"></span>';selectHtml+='<ul id="ul-'+selectId+'" class="javaex-select-ul"></ul>';selectHtml+='</div>';$select.before(selectHtml);if($select.prop("disabled")){$("#input-"+selectId).addClass("disabled")}var width=$select[0].style.width;if(!!width){$("#input-"+selectId).css("width",width);$("#span-"+selectId).css("width",width)}else{width=$select.width();if(width<minWidth){width=minWidth}$("#input-"+selectId).css("width",width+"px")}var $ul=$("#ul-"+selectId);$ul.empty();if(dataList.length>0){var liHtml='';$.each(dataList,function(i,data){let tempStr='';if(data.selected){tempStr+=' selected '}if(data.disabled){tempStr+=' disabled="disabled" '}liHtml+='<li javaex-val="'+data.value+'"'+tempStr+'>'+data.text+'</li>'});$ul.html(liHtml)}else{$ul.html($select.html().replace(/<option/g,'<li').replace(/<\/option>/g,'</li>').replace(/value=/g,'javaex-val='))}var $ulLi=$("#ul-"+selectId+" li");$ulLi.addClass("javaex-select-ul-item");$ulLi.each(function(i){if(!!$(this).attr("disabled")){$(this).addClass("javaex-disabled")}let val=$(this).attr("javaex-val");let text=$(this).text().trim();let tempStr='';if(!!$(this).attr("disabled")){tempStr+=' disabled="disabled" '}if(!!$(this).attr("selected")){tempStr+=' checked '}$(this).html('<input type="checkbox" class="javaex-fill" name="'+checkboxName+'" listen="'+checkChildListen+'" value="'+val+'" '+tempStr+' />'+text);if(i==$ulLi.length-1){if(isShowAllCheck){$ul.prepend('<li class="javaex-select-ul-item"><input type="checkbox" class="javaex-fill" listen="'+checkAllListen+'"/>全选</li><hr class="javaex-divider"></hr>')}info.render();info.checkboxCheck($ulLi.first(':checkbox[name="'+checkboxName+'"]'));let selectValArr=info.getCheckboxVal(checkboxName,true);let selectTextArr=info.getCheckboxText(checkboxName,true);let str='';for(let i=0;i<selectTextArr.length;i++){str+='<i class="javaex-btn mini">'+selectTextArr[i]+'</i>'}$("#input-"+selectId).html(str);if(settings.isInit){settings.callback({"val":selectValArr,"text":selectTextArr})}}});$ul.css("max-height",28*parseInt(settings.maxNum)+2+"px");$("#span-"+selectId).click(function(event){$(".javaex-date-main").css("display","none");if($(this).find("ul").is(":visible")){$(".javaex-select-ul").css("display","none");$(".javaex-select-ul").removeClass("javaex-animated-slide-up javaex-animated-slide-down");$(".javaex-select-close").removeClass("javaex-select-open");return false}$(".javaex-select-ul").css("display","none");$(".javaex-select-close").removeClass("javaex-select-open");if($select.prop("disabled")){event.preventDefault()}else{$ulLi.removeClass("javaex-select-ul-item-selected");$ulLi.each(function(){if($(this).val()==$("#"+selectId).val()){$(this).addClass("javaex-select-ul-item-selected");return false}});$ulLi.css("display","block");var ulHeight=$ul.height();var elHeight=$("#input-"+selectId).height();var offsetBottom=$(window).height()-elHeight-($("#input-"+selectId).offset().top-$(document).scrollTop());if(offsetBottom<(ulHeight+100)){var top=-(ulHeight+1)+"px";$(this).find("ul").removeClass("javaex-animated-slide-down").addClass("javaex-animated-slide-up");$(this).find("ul").css({"display":"block","top":top})}else{$(this).find("ul").removeClass("javaex-animated-slide-up").addClass("javaex-animated-slide-down");$(this).find("ul").css({"display":"block"})}$("#icon-"+selectId).addClass("javaex-select-open");event.stopPropagation()}});$("#ul-"+selectId+" li").on("click",function(e){if($(this).hasClass("javaex-disabled")){return false}var $this=$(this);var $checkbox=$this.find(":checkbox.javaex-fill");if($checkbox.is(":checked")){$checkbox.attr("checked",false)}else{$checkbox.attr("checked",true)}info.checkboxCheck($checkbox);var selectValArr=info.getCheckboxVal(checkboxName,true);var selectTextArr=info.getCheckboxText(checkboxName,true);var str='';for(let i=0;i<selectTextArr.length;i++){str+='<i class="javaex-btn mini">'+selectTextArr[i]+'</i>'}$("#input-"+selectId).html(str);settings.callback({"val":selectValArr,"text":selectTextArr});e.preventDefault();e.stopPropagation()});$(document).click(function(){$("#ul-"+selectId).css("display","none");$("#ul-"+selectId).removeClass("javaex-animated-slide-up javaex-animated-slide-down");$("#icon-"+selectId).removeClass("javaex-select-open")})},select:function(args){var settings=defaults(args);var mode=settings.mode;if(mode=="checkbox"){info.selectCheckbox(args);return false}var selectId=settings.id;var dataList=settings.dataList;var minWidth=parseInt(settings.minWidth);var isSearch=settings.isSearch;var hasInputName=settings.hasInputName;$("#span-"+selectId).remove();var $select=$("#"+selectId);if($select.length==0){return false}$select.css("display","none");var selectHtml='<div id="span-'+selectId+'" class="javaex-select-box">';if(isSearch){if(hasInputName){selectHtml+='<input id="input-'+selectId+'" name="input-'+selectId+'" type="text" class="javaex-select" autocomplete="off" oninput="javaex.selectSearch(\''+selectId+'\', this.value)" />'}else{selectHtml+='<input id="input-'+selectId+'" type="text" class="javaex-select" autocomplete="off" oninput="javaex.selectSearch(\''+selectId+'\', this.value)" />'}}else{if(hasInputName){selectHtml+='<input id="input-'+selectId+'" name="input-'+selectId+'" type="text" class="javaex-select" autocomplete="off" readonly />'}else{selectHtml+='<input id="input-'+selectId+'" type="text" class="javaex-select" autocomplete="off" readonly />'}}selectHtml+='<span id="icon-'+selectId+'" class="icon-angle-down javaex-select-close"></span>';selectHtml+='<ul id="ul-'+selectId+'" class="javaex-select-ul"></ul>';selectHtml+='</div>';$select.before(selectHtml);if($("#"+selectId).prop("disabled")){$("#input-"+selectId).addClass("disabled")}var width=$select[0].style.width;if(!!width){$("#input-"+selectId).css("width",width);$("#span-"+selectId).css("width",width)}else{width=$select.width();if(width<minWidth){width=minWidth}$("#input-"+selectId).css("width",width+"px")}var $ul=$("#ul-"+selectId);$ul.empty();if(dataList.length>0){var option='';$.each(dataList,function(i,data){let tempStr='';if(data.selected){tempStr+=' selected '}if(data.disabled){tempStr+=' disabled="disabled" '}option+='<option value="'+data.value+'"'+tempStr+'>'+data.text+'</option>'});$("#"+selectId).html(option)}$ul.html($("#"+selectId).html());$("#ul-"+selectId+" option").addClass("javaex-select-ul-item");$("#ul-"+selectId+" option").each(function(){if($(this).val()==$("#"+selectId).val()){$(this).addClass("javaex-select-ul-item-selected");$("#input-"+selectId).val($(this).text().trim());if(settings.isInit){settings.callback({"val":$(this).val(),"text":$(this).text().trim()})}return false}});$ul.css("max-height",28*parseInt(settings.maxNum)+2+"px");$("#span-"+selectId).click(function(event){$(".javaex-date-main").css("display","none");if($(this).find("ul").is(":visible")){if(!isSearch){$(".javaex-select-ul").css("display","none");$(".javaex-select-ul").removeClass("javaex-animated-slide-up javaex-animated-slide-down");$(".javaex-select-close").removeClass("javaex-select-open")}return false}$(".javaex-select-ul").css("display","none");$(".javaex-select-close").removeClass("javaex-select-open");if($("#"+selectId).prop("disabled")){event.preventDefault()}else{$("#ul-"+selectId+" option").removeClass("javaex-select-ul-item-selected");$("#ul-"+selectId+" option").each(function(){if($(this).val()==$("#"+selectId).val()){$(this).addClass("javaex-select-ul-item-selected");return false}});$("#ul-"+selectId+" option").css("display","block");var ulHeight=$("#ul-"+selectId).height();var elHeight=$("#input-"+selectId).height();var offsetBottom=$(window).height()-elHeight-($("#input-"+selectId).offset().top-$(document).scrollTop());if(offsetBottom<(ulHeight+100)){var top=-(ulHeight+1)+"px";$(this).find("ul").removeClass("javaex-animated-slide-down").addClass("javaex-animated-slide-up");$(this).find("ul").css({"display":"block","top":top})}else{$(this).find("ul").removeClass("javaex-animated-slide-up").addClass("javaex-animated-slide-down");$(this).find("ul").css({"display":"block"})}$("#icon-"+selectId).addClass("javaex-select-open");event.stopPropagation()}});$("#ul-"+selectId+" option").on("click",function(e){var selectVal=$(this).val();var selectText=$(this).text();$("#"+selectId).val(selectVal);$("#input-"+selectId).val($(this).text().trim());$("#ul-"+selectId).css("display","none");$("#ul-"+selectId).removeClass("javaex-animated-slide-up javaex-animated-slide-down");if($(this).parent().parent().parent().hasClass("javaex-error-parent")){$(this).parent().parent().parent().removeClass("javaex-error-parent");$(this).parent().parent().parent().find(".javaex-form-error").remove();$(this).parent().parent().parent().find(".javaex-win-hint").remove()}$("#icon-"+selectId).removeClass("javaex-select-open");settings.callback({"val":selectVal,"text":selectText.trim()});if(!!$("#"+selectId).attr("onchange")){$("#"+selectId).trigger("change")}e.preventDefault();e.stopPropagation()});$(document).click(function(){$("#ul-"+selectId).css("display","none");$("#ul-"+selectId).removeClass("javaex-animated-slide-up javaex-animated-slide-down");$("#icon-"+selectId).removeClass("javaex-select-open")})},selectSearch:function(selectId,keyword){keyword=keyword.replace(/(^\s*)|(\s*$)/g,"");if(keyword==""){$("#ul-"+selectId+" option").show()}else{$("#ul-"+selectId+" option").each(function(i){if($(this).text().toLowerCase().indexOf(keyword.toLowerCase())==-1){$(this).css("display","none")}else{$(this).css("display","block")}})}var ulHeight=$("#ul-"+selectId).height();var elHeight=$("#input-"+selectId).height();var offsetBottom=$(window).height()-elHeight-($("#input-"+selectId).offset().top-$(document).scrollTop());if(offsetBottom<(ulHeight+100)){var top=-(ulHeight)+"px";$("#ul-"+selectId).css({"width":$("#span-"+selectId).find("input").width()+22,"display":"block","top":top})}},page:function(args){var settings=defaults(args);var pageId=settings.id;$("#"+pageId).empty();var totalPages=settings.totalPages;if(totalPages==null){return false}totalPages=parseInt(totalPages);var pageNum=parseInt(settings.pageNum);if(pageNum<1||pageNum>totalPages){pageNum=1}var goPageNum=pageNum;var pageSize=null;if(!!settings.pageSize){pageSize=parseInt(settings.pageSize)}var totalNum=null;if(!!settings.totalNum){totalNum=settings.totalNum}var isShowJumpPage=settings.isShowJumpPage;var isShowSelect=settings.isShowSelect;var isReturnFirst=settings.isReturnFirst;var position=settings.position;if(position=="left"){$("#"+pageId).parent().css("text-align","left")}else if(position=="center"){$("#"+pageId).parent().css("text-align","center")}else if(position=="right"){$("#"+pageId).parent().css("text-align","right")}var lastPageText=settings.lastPageText;var nextPageText=settings.nextPageText;showPage(pageId,"jump",goPageNum);function showPage(pageId,type,goPageNum){if(totalPages<=0){$("#"+pageId).append('');return}else if(totalPages<7){if(totalPages==1){if(!settings.isShowOnePage){$("#"+pageId).append('');return}}var pageSizeHtml='';if(isShowSelect){pageSizeHtml+='<span class="javaex-hint"><select id="javaex-pageSize-'+pageId+'">';for(let i=1;i<=10;i++){if(i*10==pageSize){pageSizeHtml+='<option value="'+i+'0" selected>'+i+'0 条/页</option>'}else{pageSizeHtml+='<option value="'+i+'0">'+i+'0 条/页</option>'}}pageSizeHtml+='</select></span>'}var html='<li class="javaex-last-page"><a>'+lastPageText+'</a></li>';for(let i=1;i<=totalPages;i++){if(i==pageNum){html+='<li class="active" page="'+i+'"><a>'+i+'</a></li>'}else{html+='<li page="'+i+'"><a>'+i+'</a></li>'}}html+='<li class="javaex-next-page"><a>'+nextPageText+'</a></li>';$("#"+pageId).append(pageSizeHtml);$("#"+pageId).append(html);showNumber();init(pageId,goPageNum)}else{newPages(pageId,"jump",goPageNum)}}function disableLastAndNextPage(pageNum){if(!pageNum){pageNum=1}if(pageNum==1){$("#"+pageId).find(".javaex-last-page").addClass("disabled");if(totalPages==1){$("#"+pageId).find(".javaex-next-page").addClass("disabled")}else{$("#"+pageId).find(".javaex-next-page").removeClass("disabled")}}else{$("#"+pageId).find(".javaex-last-page").removeClass("disabled");if(pageNum==totalPages){$("#"+pageId).find(".javaex-next-page").addClass("disabled")}else{$("#"+pageId).find(".javaex-next-page").removeClass("disabled")}}}function init(pageId,curPageNum){if(isShowSelect){info.select({id:"javaex-pageSize-"+pageId,maxNum:10,minWidth:88,callback:function(rtn){if(pageSize!=rtn.val){if(isReturnFirst){pageNum=1}else{pageNum=activePage(pageId,$("#"+pageId).children("li.active"))}pageSize=rtn.val;settings.callback({"pageNum":parseInt(pageNum),"pageSize":parseInt(pageSize)})}}})}disableLastAndNextPage(curPageNum);$("#javaex-button-mini-"+pageId).click(function(){var goPageNum=$("#javaex-pager-"+pageId).val();if(isNaN(goPageNum)){goPageNum=1}else{goPageNum=parseInt(goPageNum);if(goPageNum<1){goPageNum=1}else if(goPageNum>totalPages){goPageNum=totalPages}}if(pageNum==goPageNum){return false}pageNum=goPageNum;$("#"+pageId).empty();showPage(pageId,"jump",goPageNum);settings.callback({"pageNum":parseInt(goPageNum),"pageSize":parseInt(pageSize)})});$("#"+pageId).children("li").click(function(){var element=$(this);var pageText=$(this).children("a").text();var pageNum="";var lastPage=$("#"+pageId).children("li.active").attr("page");if(isNaN(pageText)){switch(pageText){case lastPageText:if(lastPage=="1"){return}if(lastPage>=(totalPages-1)||lastPage<=3||totalPages<7){element=$("#"+pageId).children("li.active").prev()}else{newPages(pageId,"prev",(parseInt(lastPage)-1));element=$("#"+pageId).children("li.active")}break;case nextPageText:if(lastPage==totalPages){return}if(lastPage>=(totalPages-2)||lastPage<3||totalPages<7){element=$("#"+pageId).children("li.active").next()}else{newPages(pageId,"next",(parseInt(lastPage)+1));element=$("#"+pageId).children("li.active")}break;case"...":return}}else{pageText=parseInt(pageText);if(totalPages>6){if(pageText<=3||pageText>=(totalPages-3)){newPages(pageId,"jump",pageText)}}}pageNum=activePage(pageId,element);disableLastAndNextPage(pageNum);if(pageNum!=""&&pageNum!=lastPage){$("#javaex-pager-"+pageId).val(pageNum);if(isShowSelect){pageSize=$("#javaex-pageSize-"+pageId).val()}settings.callback({"pageNum":parseInt(pageNum),"pageSize":parseInt(pageSize)})}})}function activePage(pageId,element){element.addClass("active").siblings().removeClass("active");return $("#"+pageId).children("li.active").text()}function showNumber(){var number='';if(!!totalNum||isShowJumpPage){number+='<span class="javaex-hint">当前位置:';if(isShowJumpPage){number+='<input id="javaex-pager-'+pageId+'" class="javaex-pagination-input-pager" type="number" value="'+pageNum+'"><button id="javaex-button-mini-'+pageId+'" class="javaex-btn-mini">跳页</button>'}if(!!totalNum){number+='  共'+totalNum+'条'}number+='</span>'}$("#"+pageId).append(number)}function newPages(pageId,type,curPageNum){var htmlLeft="";var htmlRight="";var htmlC="";var HL='<li><a>...</a></li>';var html='<li class="javaex-last-page"><a>'+lastPageText+'</a></li>';for(let n=0;n<3;n++){htmlC+='<li '+((n-1)==0?'class="active"':'')+' page="'+(curPageNum+n-1)+'"><a>'+(curPageNum+n-1)+'</a></li>';htmlLeft+='<li '+((n+2)==curPageNum?'class="active"':'')+' page="'+(n+2)+'"><a>'+(n+2)+'</a></li>';htmlRight+='<li '+((totalPages+n-3)==curPageNum?'class="active"':'')+' page="'+(totalPages+n-3)+'"><a>'+(totalPages+n-3)+'</a></li>'}switch(type){case"next":if(curPageNum<=4){html+='<li page="1"><a>1</a></li>'+htmlLeft+HL+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}else if(curPageNum>=(totalPages-3)){html+='<li page="1"><a>1</a></li>'+HL+htmlRight+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}else{html+='<li page="1"><a>1</a></li>'+HL+htmlC+HL+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}break;case"prev":if(curPageNum<=4){html+='<li page="1"><a>1</a></li>'+htmlLeft+HL+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}else if(curPageNum>=(totalPages-3)){html+='<li page="1"><a>1</a></li>'+HL+htmlRight+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}else{html+='<li page="1"><a>1</a></li>'+HL+htmlC+HL+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}break;case"jump":if(curPageNum<=4){if(curPageNum==1){html+='<li class="active" page="1"><a>1</a></li>'+htmlLeft+HL+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}else{html+='<li page="1"><a>1</a></li>'+htmlLeft+HL+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}}else if((curPageNum>=totalPages-3)&&(totalPages>=7)){if(curPageNum==totalPages){html+='<li page="1"><a>1</a></li>'+HL+htmlRight+'<li class="active" page="'+totalPages+'"><a>'+totalPages+'</a></li>'}else{html+='<li page="1"><a>1</a></li>'+HL+htmlRight+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}}else{html+='<li page="1"><a>1</a></li>'+HL+htmlC+HL+'<li page="'+totalPages+'"><a>'+totalPages+'</a></li>'}}html+='<li class="javaex-next-page"><a>'+nextPageText+'</a></li>';if(totalPages>5||totalPages<3){var pageSizeHtml='';if(isShowSelect){pageSizeHtml+='<span class="javaex-hint"><select id="javaex-pageSize-'+pageId+'">';for(let i=1;i<=10;i++){if(i*10==pageSize){pageSizeHtml+='<option value="'+i+'0" selected>'+i+'0 条/页</option>'}else{pageSizeHtml+='<option value="'+i+'0">'+i+'0 条/页</option>'}}pageSizeHtml+='</select></span>'}$("#"+pageId).empty();$("#"+pageId).append(pageSizeHtml);$("#"+pageId).append(html);showNumber();init(pageId,curPageNum)}}},loadDataFunction:"",isOver:"",flow:function(args){var settings=defaults(args);var pageId=settings.id;info.loadDataFunction=settings.loadDataFunction;var bottomH=50;init();function init(){var flowLoadingId="flow-loading-"+pageId;var obj=document.getElementById(flowLoadingId);if(obj==null){$("#"+pageId).after('<div id="'+flowLoadingId+'" class="javaex-flow-box" style="display: none;"><div class="javaex-flow-loading"></div></div>')}$("#"+flowLoadingId).show();info.loadDown(pageId);$(window).scroll(function(){var totalheight=parseFloat($(window).height())+parseFloat($(window).scrollTop()+bottomH);if(($(document).height()<=totalheight)&&(info.isOver!=pageId)){$("#"+flowLoadingId).show();info.loadDown(pageId)}else{$("#"+flowLoadingId).hide()}})}},over:function(pageId){info.isOver=pageId},loadDown:function(pageId){info.loadDataFunction()},slide:function(args){var settings=defaults(args);var id=settings.id;var slide=$("#"+id);var isAutoPlay=settings.isAutoPlay;var effect=settings.effect;var startSlide=parseInt(settings.startSlide);var index=startSlide-1;var $self=slide.find(".javaex-slide-focus-bg li").eq(index).find("img");if($self.length==0){$self=slide.find(".javaex-slide-focus-bg li").eq(index).find("a")}var original=$self.attr(settings.dataOriginal);if(!!original){if($self.is("img")){$self.attr("src",original)}else{$self.css("background-image","url('"+original+"')")}$self.removeAttr(settings.dataOriginal)}settings.callback({"index":index+1});var delay=parseInt(settings.delay);if(delay==200){delay=2000}var time=null;var slideBg=slide.find(".javaex-slide-focus-bg");var slideLi=slideBg.find("li");var count=slideLi.length;switch(effect){case"slice":settings["width"]=slide.width();slideBg.css({"width":count*settings["width"]+"px"});slideLi.css({"float":"left","position":"relative"});slideLi.show();break}slide.find(".javaex-slide-focus-bg li").each(function(i){if(effect=="slice"){if(i==index){var sliceWidth=index*slide.width();slide.find(".javaex-slide-focus-bg").css({"margin-left":-sliceWidth+"px"})}}else if(effect=="smooth"){if(i==index){$(this).show()}else{$(this).hide()}}else{if(i==index){$(this).css("opacity",1);$(this).show()}else{$(this).css("opacity",0);$(this).hide()}}});if(slide.find(".javaex-slide-focus-title").length>0){slide.find(".javaex-slide-focus-title li").each(function(i){if(i==index){$(this).show()}else{$(this).hide()}})}if(slide.find(".javaex-slide-focus-box").length>0){if(slide.find(".javaex-slide-focus-box ul").length==0){var html='<ul>';for(let i=0;i<count;i++){html+='<li></li>'}html+='</ul>';slide.find(".javaex-slide-focus-box").empty();slide.find(".javaex-slide-focus-box").append(html)}slide.find(".javaex-slide-focus-box li").eq(index).addClass("on")}autoPlay();slide.find(".javaex-slide-next").on("click",function(){var old=index;if(index>=(count-1)){index=0}else{index++}change.call(slide,index,old)});slide.find(".javaex-slide-prev").on("click",function(){var old=index;if(index<=0){index=count-1}else{index--}change.call(slide,index,old)});slide.find(".javaex-slide-focus-box li").each(function(i){if(settings.focusBoxMode=="mouseover"){$(this).on("mouseover.slidebox",function(){change.call(slide,i,index);index=i})}else{$(this).on("click.slidebox",function(){change.call(slide,i,index);index=i})}});slide.on("mouseover",function(){if(isAutoPlay){clearInterval(time)}$(this).find(".javaex-slide-prev-next>div").css({"opacity":1,"visibility":"visible"})});slide.on("mouseleave",function(){if(isAutoPlay){autoPlay()}$(this).find(".javaex-slide-prev-next>div").css({"opacity":0,"visibility":"hidden"})});function autoPlay(){if(isAutoPlay){time=setInterval(function(){var old=index;if(index>=(count-1)){index=0}else{index++}change.call(slide,index,old)},delay)}}if(settings.focusCenter){var box=slide.find(".javaex-slide-focus-box");box.css("margin-left",-(box.width()/2)+"px")}function change(show,hide){if(effect=="slice"){var sliceWidth=show*settings["width"];slide.find(".javaex-slide-focus-bg").stop().animate({"margin-left":-sliceWidth+"px"})}else if(effect=="smooth"){slide.find(".javaex-slide-focus-bg li").eq(hide).css({"display":"none"});slide.find(".javaex-slide-focus-bg li").eq(show).css({"display":"list-item"})}else{slide.find(".javaex-slide-focus-bg li").eq(hide).css({"opacity":0,"display":"none"});slide.find(".javaex-slide-focus-bg li").eq(show).css({"display":"list-item"}).stop().animate({"opacity":1})}slide.find(".javaex-slide-focus-title li").eq(hide).hide();slide.find(".javaex-slide-focus-title li").eq(show).show();slide.find(".javaex-slide-focus-box li").removeClass("on");slide.find(".javaex-slide-focus-box li").eq(show).addClass("on");var $self=slide.find(".javaex-slide-focus-bg li").eq(show).find("img");if($self.length==0){$self=slide.find(".javaex-slide-focus-bg li").eq(show).find("a")}var original=$self.attr(settings.dataOriginal);if(!!original){if($self.is("img")){$self.attr("src",original)}else{$self.css("background-image","url('"+original+"')")}$self.removeAttr(settings.dataOriginal)}settings.callback({"index":show+1})}},date:function(args){var settings=defaults(args);var dateId=settings.id;if($("#"+dateId).parent(".javaex-date-container").length==0){var marginRight=$("#"+dateId).css("marginRight").replace("px","");marginRight=parseInt(marginRight);var right=6+marginRight;$("#"+dateId).wrap('<div class="javaex-date-container"></div>');$("#"+dateId).parent(".javaex-date-container").append('<i class="icon-calendar"></i>');$("#"+dateId).next(".icon-calendar").css("right",right+"px")}var type=settings.type;if(!type){type="yyyy-MM-dd"}var isTime=false;if(type!="yyyy-MM-dd"){isTime=true}var isClear=false;var initDate="";var initHMS="";var initStart="";var initEnd="";var hideMidDate=0;var monthNum=Math.min(parseInt(settings.monthNum),3);var dateHtml='<div id="javaex-date-box-'+dateId+'" class="javaex-date-main javaex-animated-slide-down" style="display: none;">';dateHtml+='<div class="javaex-date-body javaex-date-ui clear" id="javaex-date-list-'+dateId+'"></div>';dateHtml+='<div class="javaex-date-footer javaex-date-ui">';dateHtml+='<div class="javaex-data-form-btn" style="display:none;">';dateHtml+='<input type="text" id="hide-start-'+dateId+'" value="'+settings.startDate+'" readonly />';dateHtml+='<span> - </span>';dateHtml+='<input type="text" id="hide-end-'+dateId+'" value="'+settings.endDate+'" readonly />';dateHtml+='<input type="text" id="hide-date-'+dateId+'" value="'+settings.date.split(" ")[0]+'" readonly />';if(monthNum==1&&isTime){dateHtml+='<input type="text" id="hide-HMS-'+dateId+'" value="'+settings.date.split(" ")[1]+'" readonly />'}dateHtml+='</div>';dateHtml+='<div class="javaex-data-form-btn">';dateHtml+='<button class="javaex-btn gray" id="javaex-date-clear-'+dateId+'">清空</button>';dateHtml+='<button class="javaex-btn wathet" id="javaex-date-cancel-'+dateId+'">取消</button>';dateHtml+='<button class="javaex-btn blue" id="javaex-date-ok-'+dateId+'">确定</button>';dateHtml+='</div>';dateHtml+='</div>';dateHtml+='</div>';$(document.body).append(dateHtml);init();close(true);$("#"+dateId).bind("click",function(){if($("#javaex-date-box-"+dateId).is(":visible")){return}$(".javaex-date-main").css("display","none");if(monthNum==1){initDate=document.getElementById("hide-date-"+dateId).value;if(isTime){initHMS=document.getElementById("hide-HMS-"+dateId).value}}else{initStart=document.getElementById("hide-start-"+dateId).value;initEnd=document.getElementById("hide-end-"+dateId).value;if(initStart!=""&&initEnd!=""){var hideStartDate=str2date(initStart).getTime();var hideEndDate=str2date(initEnd).getTime();hideMidDate=hideStartDate+(hideEndDate-hideStartDate)/2}}init();show();return});$("#javaex-date-ok-"+dateId).bind("click",function(){close(true);if(monthNum==1&&isTime){var str="";var date=$("#hide-date-"+dateId).val();if(date==""){str=""}else{str=date+" "+getHMStime()}settings.callback({"date":str})}else if(monthNum==1){settings.callback({"date":$("#hide-date-"+dateId).val()})}else{settings.callback({"startDate":$("#hide-start-"+dateId).val(),"endDate":$("#hide-end-"+dateId).val()})}return});$("#javaex-date-cancel-"+dateId).bind("click",function(){if(monthNum==1){document.getElementById("hide-date-"+dateId).value=initDate;if(isTime){document.getElementById("hide-HMS-"+dateId).value=initHMS}}else{document.getElementById("hide-start-"+dateId).value=initStart;document.getElementById("hide-end-"+dateId).value=initEnd}close();isClear=false;return});$("#javaex-date-clear-"+dateId).bind("click",function(){var date=document.getElementById("hide-date-"+dateId).value;var start=document.getElementById("hide-start-"+dateId).value;var end=document.getElementById("hide-end-"+dateId).value;if(monthNum==1){document.getElementById("hide-date-"+dateId).value="";if(isTime){document.getElementById("hide-HMS-"+dateId).value="";$("#javaex-date-hour-"+dateId+" li").removeClass("current");$("#javaex-date-minute-"+dateId+" li").removeClass("current");$("#javaex-date-second-"+dateId+" li").removeClass("current")}}else{document.getElementById("hide-start-"+dateId).value="";document.getElementById("hide-end-"+dateId).value=""}removeCSS();isClear=true;return});function init(){var exDate=this;$("#javaex-date-list-"+dateId).empty();var endDate="";if(!settings.endDate){if(!settings.date){endDate=new Date()}else{endDate=str2date(settings.date.split(" ")[0])}}else{endDate=str2date(settings.endDate)}this.calendarEndDate=new Date(endDate.getFullYear(),endDate.getMonth()+1,0);if(monthNum==1&&isTime){for(let i=0;i<monthNum;i++){var td="";td=fillDate(endDate.getFullYear(),endDate.getMonth(),i);if(0==i){$("#javaex-date-list-"+dateId).append(td)}else{var firstTd=$("#javaex-date-list-"+dateId).find("table").get(0);$(firstTd).before(td)}endDate.setMonth(endDate.getMonth()-1,1)}var timeHtml='';timeHtml+='<table>';timeHtml+='<caption>时间选择</caption>';timeHtml+='<thead>';timeHtml+='<tr>';timeHtml+='<th>小时</th>';timeHtml+='<th>分钟</th>';timeHtml+='<th>秒数</th>';timeHtml+='</tr>';timeHtml+='</thead>';timeHtml+='<tbody>';timeHtml+='<tr>';var hourHtml='';hourHtml+='<td style="padding: 0;">';hourHtml+='<ul id="javaex-date-hour-'+dateId+'" style="height: 180px; overflow: auto;">';for(let n=0;n<24;n++){if(n<10){hourHtml+='<li>0'+n+'</li>'}else{hourHtml+='<li>'+n+'</li>'}}hourHtml+='</ul>';hourHtml+='</td>';timeHtml+=hourHtml;var minuteHtml='';minuteHtml+='<td style="padding: 0;">';minuteHtml+='<ul id="javaex-date-minute-'+dateId+'" style="height: 180px; overflow: auto;">';for(let n=0;n<60;n++){if(n<10){minuteHtml+='<li>0'+n+'</li>'}else{minuteHtml+='<li>'+n+'</li>'}}minuteHtml+='</ul>';minuteHtml+='</td>';timeHtml+=minuteHtml;var secondHtml='';secondHtml+='<td style="padding: 0;">';secondHtml+='<ul id="javaex-date-second-'+dateId+'" style="height: 180px; overflow: auto;">';for(let n=0;n<60;n++){if(n<10){secondHtml+='<li>0'+n+'</li>'}else{secondHtml+='<li>'+n+'</li>'}}secondHtml+='</ul>';secondHtml+='</td>';timeHtml+=secondHtml;timeHtml+='</tr>';timeHtml+='</tbody>';timeHtml+='</table>';$("#javaex-date-list-"+dateId).append(timeHtml)}else{for(let i=0;i<monthNum;i++){var td="";td=fillDate(endDate.getFullYear(),endDate.getMonth(),i);if(0==i){$("#javaex-date-list-"+dateId).append(td)}else{var firstTd=$("#javaex-date-list-"+dateId).find("table").get(0);$(firstTd).before(td)}endDate.setMonth(endDate.getMonth()-1,1)}}this.calendarStartDate=new Date(endDate.getFullYear(),endDate.getMonth()+1,1);$("#last-year-"+dateId).bind("click",function(){exDate.calendarEndDate.setFullYear(exDate.calendarEndDate.getFullYear()-1,exDate.calendarEndDate.getMonth(),1);settings.endDate=date2ymd(exDate.calendarEndDate).join("-");init();return});$("#last-month-"+dateId).bind("click",function(){exDate.calendarEndDate.setMonth(exDate.calendarEndDate.getMonth()-1,1);settings.endDate=date2ymd(exDate.calendarEndDate).join("-");init();return});$("#next-month-"+dateId).bind("click",function(){exDate.calendarEndDate.setMonth(exDate.calendarEndDate.getMonth()+1,1);settings.endDate=date2ymd(exDate.calendarEndDate).join("-");init();return});$("#next-year-"+dateId).bind("click",function(){exDate.calendarEndDate.setFullYear(exDate.calendarEndDate.getFullYear()+1,exDate.calendarEndDate.getMonth(),1);settings.endDate=date2ymd(exDate.calendarEndDate).join("-");init();return});$("#javaex-date-hour-"+dateId+" li").bind("click",function(){$(this).addClass("current").siblings().removeClass("current");setHMStime();return});$("#javaex-date-minute-"+dateId+" li").bind("click",function(){$(this).addClass("current").siblings().removeClass("current");setHMStime();return});$("#javaex-date-second-"+dateId+" li").bind("click",function(){$(this).addClass("current").siblings().removeClass("current");setHMStime();return});addCSS()}function setHMStime(){var hour=$("#javaex-date-hour-"+dateId+" li.current").text();var minute=$("#javaex-date-minute-"+dateId+" li.current").text();var second=$("#javaex-date-second-"+dateId+" li.current").text();$("#hide-HMS-"+dateId).val(hour+":"+minute+":"+second)}function removeCSS(){var csd=this.calendarStartDate;var ced=this.calendarEndDate;var bDate=new Date(csd.getFullYear(),csd.getMonth(),csd.getDate());var choice="";for(let d=new Date(bDate);d.getTime()<=ced.getTime();d.setDate(d.getDate()+1)){choice="javaex-data-choice-style";$("#"+dateId+"_date_"+date2ymd(d).join("-")).removeClass(choice);$("#"+dateId+"_date_"+date2ymd(d).join("-")).removeClass("javaex-started").removeClass("javaex-ended").removeClass("javaex-selected")}}function addCSS(){if(monthNum==1){var date=str2date($("#hide-date-"+dateId).val());$("#"+dateId+"_date_"+date2ymd(new Date(date)).join("-")).removeClass().addClass("javaex-ended");if(isTime){var HMS=$("#hide-HMS-"+dateId).val();var arr=HMS.split(":");$("#javaex-date-hour-"+dateId+" li").each(function(){if($(this).text()==arr[0]){$(this).addClass("current").siblings().removeClass("current");return}});$("#javaex-date-minute-"+dateId+" li").each(function(){if($(this).text()==arr[1]){$(this).addClass("current").siblings().removeClass("current");return}});$("#javaex-date-second-"+dateId+" li").each(function(){if($(this).text()==arr[2]){$(this).addClass("current").siblings().removeClass("current");return}})}return}var startDate=str2date($("#hide-start-"+dateId).val());var endDate=str2date($("#hide-end-"+dateId).val());var choice="";for(let d=new Date(startDate);d.getTime()<=endDate.getTime();d.setDate(d.getDate()+1)){choice="javaex-data-choice-style";$("#"+dateId+"_date_"+date2ymd(d).join("-")).removeClass("javaex-started").removeClass("javaex-ended").removeClass("javaex-selected");$("#"+dateId+"_date_"+date2ymd(d).join("-")).removeClass(choice);$("#"+dateId+"_date_"+date2ymd(d).join("-")).attr("class",choice)}$("#"+dateId+"_date_"+date2ymd(new Date(startDate)).join("-")).removeClass().addClass("javaex-started");$("#"+dateId+"_date_"+date2ymd(new Date(endDate)).join("-")).removeClass().addClass("javaex-ended")}function selectDate(ymd){isClear=false;var ymdFormat=formatDate(ymd);if(this.dateInput==("hide-date-"+dateId)){removeCSS();$("#"+dateId+"_date_"+ymd).attr("class","javaex-selected");$("#"+this.dateInput).val(ymdFormat);return}if($("#"+this.dateInput).val()==""){if(this.dateInput==("hide-start-"+dateId)){removeCSS();$("#"+dateId+"_date_"+ymd).attr("class","javaex-selected");$("#"+this.dateInput).val(ymdFormat);this.dateInput="hide-end-"+dateId}else if(this.dateInput==("hide-end-"+dateId)){if($("#hide-start-"+dateId).val()==""){this.dateInput="hide-start-"+dateId;selectDate(ymd);return}$("#"+this.dateInput).val(ymdFormat);this.dateInput="hide-start-"+dateId;var hideStartDate=str2date($("#hide-start-"+dateId).val()).getTime();var hideEndDate=str2date($("#hide-end-"+dateId).val()).getTime();if(hideEndDate<hideStartDate){var tmp=$("#hide-start-"+dateId).val();$("#hide-start-"+dateId).val($("#hide-end-"+dateId).val());$("#hide-end-"+dateId).val(tmp)}removeCSS();addCSS()}}else{var nowClickDate=str2date(ymdFormat).getTime();if(nowClickDate<hideMidDate){$("#hide-start-"+dateId).val(ymdFormat)}else{$("#hide-end-"+dateId).val(ymdFormat)}removeCSS();addCSS();var hideStartDate=str2date($("#hide-start-"+dateId).val()).getTime();var hideEndDate=str2date($("#hide-end-"+dateId).val()).getTime();hideMidDate=hideStartDate+(hideEndDate-hideStartDate)/2}}function show(){var pos=$("#"+dateId).offset();var left=pos.left;if(settings.alignment=="right"){var width=$("#"+dateId).width();left=left+width-($("#javaex-date-box-"+dateId).width()+20)}$("#javaex-date-box-"+dateId).css("display","block");$("#javaex-date-box-"+dateId).css("left",left+"px");$("#javaex-date-box-"+dateId).css("top",pos.top+$("#"+dateId).height()+3+"px");if(monthNum==1){this.dateInput="hide-date-"+dateId;if(isTime&&settings.date){var diffH=$("#javaex-date-hour-"+dateId+" li.current").position().top;if(diffH>220){diffH=diffH-83+"px";$("#javaex-date-hour-"+dateId).animate({"scrollTop":diffH},500)}var diffM=$("#javaex-date-minute-"+dateId+" li.current").position().top;if(diffM>220){diffM=diffM-83+"px";$("#javaex-date-minute-"+dateId).animate({"scrollTop":diffM},500)}var diffS=$("#javaex-date-second-"+dateId+" li.current").position().top;if(diffS>220){diffS=diffS-83+"px";$("#javaex-date-second-"+dateId).animate({"scrollTop":diffS},500)}}}else{this.dateInput="hide-start-"+dateId}}function close(isOk){if(isOk){var str="";if(isClear){if(monthNum==1){document.getElementById("hide-date-"+dateId).value="";if(isTime){document.getElementById("hide-HMS-"+dateId).value="";$("#javaex-date-hour-"+dateId+" li").removeClass("current");$("#javaex-date-minute-"+dateId+" li").removeClass("current");$("#javaex-date-second-"+dateId+" li").removeClass("current")}}else{document.getElementById("hide-start-"+dateId).value="";document.getElementById("hide-end-"+dateId).value=""}}else{if(monthNum==1){if(isTime){$("#"+dateId).val($("#hide-date-"+dateId).val()+" "+getHMStime())}else{$("#"+dateId).val($("#hide-date-"+dateId).val())}}else{if($("#hide-end-"+dateId).val()==""){$("#"+dateId).val($("#hide-start-"+dateId).val())}else{$("#"+dateId).val($("#hide-start-"+dateId).val()+settings.splitLine+$("#hide-end-"+dateId).val())}}if(monthNum==1){var date=$("#hide-date-"+dateId).val();if(isTime){if(date==""){str=""}else{str=date+" "+getHMStime()}}else{str=date}}else{if($("#hide-end-"+dateId).val()==""){$("#hide-end-"+dateId).val($("#hide-start-"+dateId).val())}str=$("#hide-start-"+dateId).val()+settings.splitLine+$("#hide-end-"+dateId).val();if(str==settings.splitLine){str=""}}}var obj=document.getElementById(dateId);if(obj&&obj.tagName=="INPUT"){$("#"+dateId).val(str)}else{$("#"+dateId).html(str)}isClear=false}$("#javaex-date-box-"+dateId).css("display","none")}function fillDate(year,month,index){var exDate=this;var firstDayOfMonth=new Date(year,month,1);var dateBegin=new Date(year,month,1);var w=dateBegin.getDay();dateBegin.setDate(1-w);var lastDayOfMonth=new Date(year,month+1,0);var dateEnd=new Date(year,month+1,0);w=dateEnd.getDay();dateEnd.setDate(dateEnd.getDate()+6-w);var today=new Date();var table=document.createElement("table");if(monthNum==1&&isTime){$(table).css("position","relative")}var captionLeft='';var captionRight='';if(index==0){if(monthNum==1&&isTime){captionRight+='<a href="javascript:;" id="next-year-'+dateId+'" class="javaex-date-double-right"><i class="icon-angle-double-right"></i></a>';captionRight+='<a href="javascript:;" id="next-month-'+dateId+'" class="javaex-date-right"><i class="icon-angle-right"></i></a>'}else{captionRight+='<a href="javascript:;" id="next-year-'+dateId+'" class="javaex-date-double-right"><i class="icon-angle-double-right"></i></a>';captionRight+='<a href="javascript:;" id="next-month-'+dateId+'" class="javaex-date-right"><i class="icon-angle-right"></i></a>'}}if((index+1)==monthNum){if(monthNum==1&&isTime){captionLeft+='<a href="javascript:;" id="last-year-'+dateId+'" class="javaex-date-double-left"><i class="icon-angle-double-left"></i></a>';captionLeft+='<a href="javascript:;" id="last-month-'+dateId+'" class="javaex-date-left"><i class="icon-angle-left"></i></a>'}else{captionLeft+='<a href="javascript:;" id="last-year-'+dateId+'" class="javaex-date-double-left"><i class="icon-angle-double-left"></i></a>';captionLeft+='<a href="javascript:;" id="last-month-'+dateId+'" class="javaex-date-left"><i class="icon-angle-left"></i></a>'}}cap=document.createElement("caption");$(cap).append(captionLeft+year+"年"+(month+1)+"月"+captionRight);$(table).append(cap);thead=document.createElement("thead");tr=document.createElement("tr");var days=["日","一","二","三","四","五","六"];for(let i=0;i<7;i++){th=document.createElement("th");$(th).append(days[i]);$(tr).append(th)}$(thead).append(tr);$(table).append(thead);tr=document.createElement("tr");td=document.createElement("td");$(td).attr("colSpan",7);$(td).css("text-align","center");$(tr).append(td);var tbody=document.createElement("tbody");$(tbody).append(tr);var tdClass="";var deviation=0;var ymd="";var minTime="";if(settings.minTime=="today"){minTime=new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())}else{minTime=str2date(settings.minTime)}var maxTime="";if(settings.maxTime=="today"){maxTime=new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())}else{maxTime=str2date(settings.maxTime)}for(let d=dateBegin;d.getTime()<=dateEnd.getTime();d.setDate(d.getDate()+1)){if(d.getTime()<firstDayOfMonth.getTime()){tdClass="javaexDateRangeGray";deviation=-1}else if(settings.minTime!=""&&d.getTime()<minTime.getTime()){tdClass="javaexDateRangeGray";deviation=-2}else if(d.getTime()>lastDayOfMonth.getTime()){tdClass="javaexDateRangeGray";deviation=1}else if(settings.maxTime!=""&&d.getTime()>maxTime.getTime()){tdClass="javaexDateRangeGray";deviation=2}else{deviation=0;tdClass=""}if(d.getDay()==0){tr=document.createElement("tr")}td=document.createElement("td");td.innerHTML=d.getDate();if(tdClass!=""){$(td).attr("class",tdClass)}if(deviation==0){ymd=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();$(td).attr("id",dateId+"_date_"+ymd);(function(ymd){$(td).bind("click",ymd,function(){selectDate(ymd);return})})(ymd)}$(td).addClass("riqi");$(tr).append(td);if(d.getDay()==6){$(tbody).append(tr)}}$(table).append(tbody);return table}function str2date(str){var arr=str.split("-");return new Date(arr[0],arr[1]-1,arr[2])}function date2ymd(date){return[date.getFullYear(),(date.getMonth()+1),date.getDate()]}function formatDate(ymd){return ymd.replace(/(\d{4})\-(\d{1,2})\-(\d{1,2})/g,function(ymdFormatDate,y,m,d){if(m<10){m="0"+m}if(d<10){d="0"+d}return y+"-"+m+"-"+d})}function getHMStime(){var hour="";var minute="";var second="";if($("#javaex-date-hour-"+dateId+" li.current").length>0){hour=$("#javaex-date-hour-"+dateId+" li.current").text()}if($("#javaex-date-minute-"+dateId+" li.current").length>0){minute=$("#javaex-date-minute-"+dateId+" li.current").text()}if($("#javaex-date-second-"+dateId+" li.current").length>0){second=$("#javaex-date-second-"+dateId+" li.current").text()}var time="";if(hour!=""&&minute!=""&&second!=""){time=hour+":"+minute+":"+second}return time}},time:function(args){var settings=defaults(args);var timeId=settings.id;var time=settings.time;var initHMS="";var isClear=false;var timeHtml='<div id="javaex-date-box-'+timeId+'" class="javaex-date-main javaex-animated-slide-down clear" style="display: none;">';timeHtml+='<div class="javaex-date-body javaex-date-ui clear" id="javaex-date-list-'+timeId+'">';timeHtml+='<table style="width: calc(100% - 20px);">';timeHtml+='<caption>时间选择</caption>';timeHtml+='<thead>';timeHtml+='<tr>';timeHtml+='<th class="tc">小时</th>';timeHtml+='<th class="tc">分钟</th>';timeHtml+='<th class="tc">秒数</th>';timeHtml+='</tr>';timeHtml+='</thead>';timeHtml+='<tbody>';timeHtml+='<tr>';var hourHtml='';hourHtml+='<td style="padding: 0;">';hourHtml+='<ul id="javaex-date-hour-'+timeId+'" style="height: 180px; overflow: auto;">';for(let n=0;n<24;n++){if(n<10){hourHtml+='<li>0'+n+'</li>'}else{hourHtml+='<li>'+n+'</li>'}}hourHtml+='</ul>';hourHtml+='</td>';timeHtml+=hourHtml;var minuteHtml='';minuteHtml+='<td style="padding: 0;">';minuteHtml+='<ul id="javaex-date-minute-'+timeId+'" style="height: 180px; overflow: auto;">';for(let n=0;n<60;n++){if(n<10){minuteHtml+='<li>0'+n+'</li>'}else{minuteHtml+='<li>'+n+'</li>'}}minuteHtml+='</ul>';minuteHtml+='</td>';timeHtml+=minuteHtml;var secondHtml='';secondHtml+='<td style="padding: 0;">';secondHtml+='<ul id="javaex-date-second-'+timeId+'" style="height: 180px; overflow: auto;">';for(let n=0;n<60;n++){if(n<10){secondHtml+='<li>0'+n+'</li>'}else{secondHtml+='<li>'+n+'</li>'}}secondHtml+='</ul>';secondHtml+='</td>';timeHtml+=secondHtml;timeHtml+='</tr>';timeHtml+='</tbody>';timeHtml+='</table>';timeHtml+='</div>';timeHtml+='<div class="javaex-date-footer javaex-date-ui" style="padding: 0;border-top: none;">';timeHtml+='<div class="javaex-data-form-btn" style="display:none;">';timeHtml+='<input type="text" id="hide-HMS-'+timeId+'" value="'+time+'" readonly />';timeHtml+='</div>';timeHtml+='<div class="javaex-data-form-btn">';timeHtml+='<button class="javaex-btn gray" id="javaex-date-clear-'+timeId+'">清空</button>';timeHtml+='<button class="javaex-btn wathet" id="javaex-date-cancel-'+timeId+'">取消</button>';timeHtml+='<button class="javaex-btn blue" id="javaex-date-ok-'+timeId+'">确定</button>';timeHtml+='</div>';timeHtml+='</div>';timeHtml+='</div>';$(document.body).append(timeHtml);addCSS();show();close(true);$("#"+timeId).bind("click",function(){initHMS=document.getElementById("hide-HMS-"+timeId).value;addCSS();show();return});$("#javaex-date-ok-"+timeId).bind("click",function(){close(true);settings.callback({"time":getHMStime()});return});$("#javaex-date-cancel-"+timeId).bind("click",function(){document.getElementById("hide-HMS-"+timeId).value=initHMS;close();isClear=false;return});$("#javaex-date-clear-"+timeId).bind("click",function(){document.getElementById("hide-HMS-"+timeId).value="";$("#javaex-date-hour-"+timeId+" li").removeClass("current");$("#javaex-date-minute-"+timeId+" li").removeClass("current");$("#javaex-date-second-"+timeId+" li").removeClass("current");isClear=true;return});$("#javaex-date-hour-"+timeId+" li").bind("click",function(){$(this).addClass("current").siblings().removeClass("current");setHMStime();return});$("#javaex-date-minute-"+timeId+" li").bind("click",function(){$(this).addClass("current").siblings().removeClass("current");setHMStime();return});$("#javaex-date-second-"+timeId+" li").bind("click",function(){$(this).addClass("current").siblings().removeClass("current");setHMStime();return});function addCSS(){var HMS=$("#hide-HMS-"+timeId).val();var arr=HMS.split(":");$("#javaex-date-hour-"+timeId+" li").each(function(){if($(this).text()==arr[0]){$(this).addClass("current").siblings().removeClass("current");return}});$("#javaex-date-minute-"+timeId+" li").each(function(){if($(this).text()==arr[1]){$(this).addClass("current").siblings().removeClass("current");return}});$("#javaex-date-second-"+timeId+" li").each(function(){if($(this).text()==arr[2]){$(this).addClass("current").siblings().removeClass("current");return}})}function getHMStime(){var hour="";var minute="";var second="";if($("#javaex-date-hour-"+timeId+" li.current").length>0){hour=$("#javaex-date-hour-"+timeId+" li.current").text()}if($("#javaex-date-minute-"+timeId+" li.current").length>0){minute=$("#javaex-date-minute-"+timeId+" li.current").text()}if($("#javaex-date-second-"+timeId+" li.current").length>0){second=$("#javaex-date-second-"+timeId+" li.current").text()}var time="";if(hour!=""&&minute!=""&&second!=""){time=hour+":"+minute+":"+second}return time}function setHMStime(){var hour=$("#javaex-date-hour-"+timeId+" li.current").text();var minute=$("#javaex-date-minute-"+timeId+" li.current").text();var second=$("#javaex-date-second-"+timeId+" li.current").text();$("#hide-HMS-"+timeId).val(hour+":"+minute+":"+second)}function show(){var pos=$("#"+timeId).offset();var left=pos.left;$("#javaex-date-box-"+timeId).css("display","block");$("#javaex-date-box-"+timeId).css("left",left+"px");$("#javaex-date-box-"+timeId).css("top",pos.top+$("#"+timeId).height()+4+"px");if($("#javaex-date-hour-"+timeId+" li.current").length>0){var diffH=$("#javaex-date-hour-"+timeId+" li.current").position().top;if(diffH>220){diffH=diffH-83+"px";$("#javaex-date-hour-"+timeId).animate({"scrollTop":diffH},500)}}if($("#javaex-date-minute-"+timeId+" li.current").length>0){var diffM=$("#javaex-date-minute-"+timeId+" li.current").position().top;if(diffM>220){diffM=diffM-83+"px";$("#javaex-date-minute-"+timeId).animate({"scrollTop":diffM},500)}}if($("#javaex-date-second-"+timeId+" li.current").length>0){var diffS=$("#javaex-date-second-"+timeId+" li.current").position().top;if(diffS>220){diffS=diffS-83+"px";$("#javaex-date-second-"+timeId).animate({"scrollTop":diffS},500)}}}function close(isOk){if(isOk){var str="";if(isClear){document.getElementById("hide-HMS-"+timeId).value="";$("#javaex-date-hour-"+timeId+" li").removeClass("current");$("#javaex-date-minute-"+timeId+" li").removeClass("current");$("#javaex-date-second-"+timeId+" li").removeClass("current")}else{$("#"+timeId).val(getHMStime());str=getHMStime()}var obj=document.getElementById(timeId);if(obj&&obj.tagName=="INPUT"){$("#"+timeId).val(str)}else{$("#"+timeId).html(str)}isClear=false}$("#javaex-date-box-"+timeId).css("display","none")}},dragging:$(),placeholders:$(),upload:function(args){var settings=defaults(args);var type=settings.type;var url=settings.url;var inputId=settings.id;var isShowTip=settings.isShowTip;var containerId=settings.containerId;var uploadText=settings.uploadText;var addImg=settings.addImg;var maxNum=parseInt(settings.maxNum);var maxSize=settings.maxSize;var param=settings.param;var header=settings.header;var imgList=settings.imgList;var dataType=settings.dataType;if(type=="editImage"){$("#"+inputId).change(function(){var file=$("#"+inputId)[0].files[0];if(!checkImg(file)){return false}if(dataType=="base64"){var reader=new FileReader();if(file){reader.onload=function(event){var base64Img=event.target.result;settings.callback(base64Img)}}reader.readAsDataURL(file)}else if(dataType=="url"){var data=new FormData();for(let key in param){if(key=="file"){data.append(param[key],file)}else{data.append(key,param[key])}}if(isShowTip){info.tip({mode:"message",content:"图片上传中,请稍候...",type:"submit"})}$.ajax({url:url,type:"POST",data:data,dataType:"json",cache:false,contentType:false,processData:false,xhrFields:{withCredentials:true},crossDomain:true,beforeSend:function(request){for(let key in header){request.setRequestHeader(key,header[key])}},success:function(rtn){clearInterval(info.timeoutId);$(".javaex-message-feedback").remove();settings.callback(rtn)},error:function(){info.tip({mode:"message",content:"上传失败,请稍后重试",type:"error"})}})}$("#"+inputId).val("")})}else if(type=="image"){var imageSrc=$("#"+containerId+" .javaex-cover").children("img").attr("src");if(!imageSrc){$("#"+containerId+" .javaex-cover img").attr("src",addImg);$("#"+containerId+" .javaex-cover img").after('<div class="javaex-cover-text">'+uploadText+'</div>')}else{$("#"+containerId+" .javaex-cover img").addClass("javaex-upload-img").removeClass("javaex-upload-img-cover");$("#"+containerId+" .javaex-cover").append('<div class="javaex-cover-mask"><span class="icon-close"></span></div>')}$(document).on("click","#"+containerId+" .javaex-cover-mask",function(){$(this).remove();$("#"+containerId+" .javaex-cover img").attr("src",addImg);$("#"+containerId+" .javaex-cover img").addClass("javaex-upload-img-cover").removeClass("javaex-upload-img");$("#"+containerId+" .javaex-cover img").after('<div class="javaex-cover-text">'+uploadText+'</div>');settings.deleteImage()});$("#"+inputId).change(function(){settings.chooseBefore();var file=$("#"+inputId)[0].files[0];if(!checkImg(file)){return false}if(dataType=="base64"){var reader=new FileReader();var filename=file.name;var fileSuffix="";var pos=filename.lastIndexOf(".");if(pos>-1){fileSuffix=filename.substring(pos+1)}settings.chooseAfter({"filename":filename,"filesize":file.size,"fileSuffix":fileSuffix});if(file){reader.onload=function(event){var base64Img=event.target.result;$("#"+containerId+" .javaex-cover img").addClass("javaex-upload-img").removeClass("javaex-upload-img-cover");$("#"+containerId+" .javaex-cover-text").remove();$("#"+containerId+" .javaex-cover").append('<div class="javaex-cover-mask"><span class="icon-close"></span></div>');settings.callback(base64Img)}}reader.readAsDataURL(file)}else if(dataType=="url"){var data=new FormData();for(let key in param){if(key=="file"){data.append(param[key],file)}else{data.append(key,param[key])}}var filename=file.name;var fileSuffix="";var pos=filename.lastIndexOf(".");if(pos>-1){fileSuffix=filename.substring(pos+1)}settings.chooseAfter({"filename":filename,"filesize":file.size,"fileSuffix":fileSuffix});if(isShowTip){info.tip({content:"图片上传中,请稍候...",type:"submit"})}$.ajax({url:url,type:"post",data:data,dataType:"json",cache:false,contentType:false,processData:false,xhrFields:{withCredentials:true},crossDomain:true,beforeSend:function(request){for(let key in header){request.setRequestHeader(key,header[key])}},success:function(rtn){clearInterval(info.timeoutId);$(".javaex-opt-tip").remove();$(".javaex-opt-mask").remove();$("#"+containerId+" .javaex-cover img").addClass("javaex-upload-img").removeClass("javaex-upload-img-cover");$("#"+containerId+" .javaex-cover-text").remove();$("#"+containerId+" .javaex-cover").append('<div class="javaex-cover-mask"><span class="icon-close"></span></div>');settings.callback(rtn)},error:function(){info.tip({content:"上传失败,请稍后重试",type:"error"})}})}$("#"+inputId).val("")})}else if(type=="images"){if(imgList!=null&&imgList.length>0){for(let i=0;i<imgList.length;i++){var UUID=info.getUUID();var imgHtml='<li id="'+UUID+'" class="javaex-upload-images-thumbnail" style="width:'+settings.width+'px;height:'+settings.height+'px;">';imgHtml+='<div class="javaex-img-trash"><span class="icon-trash-o"></span></div>';imgHtml+='<img src="'+imgList[i]+'" />';imgHtml+='</li>';$("#"+containerId).append(imgHtml);imgBindEvent(UUID);imgSort(containerId)}var imgUrlArr=new Array();$("#"+containerId+" img").each(function(){imgUrlArr.push($(this).attr("src"))});settings.callback(imgUrlArr)}$("#"+inputId).change(function(){if($("#"+containerId+" img").length>(parseInt(maxNum)-1)){info.tip({content:"最多上传"+maxNum+"张图片",type:"error"});return false}if(dataType=="base64"){var uuidArr=new Array();var count=0;var fileLength=$("#"+inputId)[0].files.length;var nowNum=$("#"+containerId+" img").length;$.each($("#"+inputId)[0].files,function(i){if((nowNum+i)<maxNum){var UUID=info.getUUID();uuidArr.push(UUID);var file=$("#"+inputId)[0].files[i];if(!checkImg(file)){return false}var reader=new FileReader();reader.onload=function(event){var base64Img=event.target.result;var imgHtml='<li id="'+UUID+'" class="javaex-upload-images-thumbnail" style="width:'+settings.width+'px;height:'+settings.height+'px;">';imgHtml+='<div class="javaex-img-trash"><span class="icon-trash-o"></span></div>';imgHtml+='<img src="'+base64Img+'" />';imgHtml+='</li>';$("#"+containerId).append(imgHtml);imgBindEvent(UUID);count++;if((count==fileLength)||(nowNum+i)==(parseInt(maxNum)-1)){var imgUrlArr=new Array();$("#"+containerId+" img").each(function(){imgUrlArr.push($(this).attr("src"))});settings.callback(imgUrlArr);imgSort(containerId)}};reader.readAsDataURL(file)}})}else if(dataType=="url"){var image=settings.image;var uuidArr=new Array();var count=0;var fileLength=$("#"+inputId)[0].files.length;var nowNum=$("#"+containerId+" img").length;for(let i=0;i<fileLength;i++){if((nowNum+i)<maxNum){var UUID=info.getUUID();uuidArr.push(UUID);var imgHtml='<li id="'+UUID+'" class="javaex-upload-images-thumbnail" style="width:'+settings.width+'px;height:'+settings.height+'px;">';imgHtml+='<div class="javaex-img-trash"><span class="icon-trash-o"></span></div>';imgHtml+='<img src="'+settings.placeholder+'" />';imgHtml+='</li>';$("#"+containerId).append(imgHtml)}}$.each($("#"+inputId)[0].files,function(i){if((nowNum+i)<maxNum){var UUID=uuidArr[i];var file=$("#"+inputId)[0].files[i];if(!checkImg(file)){return false}var data=new FormData();for(let key in param){if(key=="file"){data.append(param[key],file)}else{data.append(key,param[key])}}$.ajax({url:image.url,type:"post",data:data,dataType:"json",cache:false,contentType:false,processData:false,xhrFields:{withCredentials:true},crossDomain:true,beforeSend:function(request){for(let key in header){request.setRequestHeader(key,header[key])}},success:function(rtn){image.rtnData=rtn;var imgSrc="";if(!image.prefix){if(image.imgUrl.split(".").length==2){imgSrc=image.rtnData[image.imgUrl.split(".")[0]][image.imgUrl.split(".")[1]]}else{imgSrc=image.rtnData[image.imgUrl]}}else{if(image.imgUrl.split(".").length==2){imgSrc=image.prefix+image.rtnData[image.imgUrl.split(".")[0]][image.imgUrl.split(".")[1]]}else{imgSrc=image.prefix+image.rtnData[image.imgUrl]}}$("#"+UUID).find("img").attr("src",imgSrc);imgBindEvent(UUID);count++;if((count==fileLength)||(nowNum+i)==(maxNum-1)){var imgUrlArr=new Array();$("#"+containerId+" img").each(function(){imgUrlArr.push($(this).attr("src"))});settings.callback(imgUrlArr);imgSort(containerId)}},error:function(){info.tip({content:"上传失败,请稍后重试",type:"error"})}})}})}$("#"+inputId).val("")});function imgBindEvent(id){$(document).on("mouseenter","#"+id,function(){$("#"+id+" .javaex-img-trash").stop().animate({height:"30px"})});$(document).on("mouseleave","#"+id,function(){$("#"+id+" .javaex-img-trash").stop().animate({height:0})});$(document).on("click","#"+id+" .javaex-img-trash span",function(){$("#"+id).remove();var imgUrlArr=new Array();$("#"+containerId+" img").each(function(){imgUrlArr.push($(this).attr("src"))});settings.callback(imgUrlArr)})}function imgSort(containerId){options=$.extend({},null);return $("#"+containerId).each(function(){var isHandle,index,items=$(this).children(options.items);var placeholder=$('<'+(/^ul|ol$/i.test(this.tagName)?'li':'div')+' class="javaex-sort-placeholder">');items.find(options.handle).mousedown(function(){isHandle=true}).mouseup(function(){isHandle=false});$(this).data("items",options.items);info.placeholders=info.placeholders.add(placeholder);items.attr("draggable","true").on("dragstart.h5s",function(e){if(options.handle&&!isHandle){return false}isHandle=false;var dt=e.originalEvent.dataTransfer;dt.effectAllowed="move";dt.setData("Text","dummy");index=(info.dragging=$(this)).addClass("javaex-sort-dragging").index()}).on("dragend.h5s",function(){(info.dragging=$(this)).removeClass("javaex-sort-dragging").show();info.placeholders.detach();if(index!=(info.dragging=$(this)).index()){items.parent().trigger("sortupdate",{item:info.dragging});var imgUrlArr=new Array();$("#"+containerId+" img").each(function(){imgUrlArr.push($(this).attr("src"))});settings.callback(imgUrlArr)}info.dragging=null}).not("a[href], img").on("selectstart.h5s",function(){this.dragDrop&&this.dragDrop();return false}).end().add([this,placeholder]).on("dragover.h5s dragenter.h5s drop.h5s",function(e){if(!items.is(info.dragging)&&options.connectWith!==$(info.dragging).parent().data("connectWith")){return true}if(e.type=="drop"){e.stopPropagation();info.placeholders.filter(":visible").after(info.dragging);return false}e.preventDefault();e.originalEvent.dataTransfer.dropEffect="move";if(items.is(this)){if(options.forcePlaceholderSize){placeholder.height(info.dragging.outerHeight())}info.dragging.hide();$(this)[placeholder.index()<$(this).index()?'after':'before'](placeholder);info.placeholders.not(placeholder).detach()}else if(!info.placeholders.is(this)&&!$(this).children(options.items).length){info.placeholders.detach();$(this).append(placeholder)}return false})})}}else if(type=="file"){$("#"+inputId).change(function(){settings.chooseBefore();var file=$("#"+inputId)[0].files[0];if(maxSize==""||maxSize==0||maxSize=="0"){}else{if(file.size>(maxSize*1024*1024)){info.tip({content:"文件过大,单个文件上限 "+maxSize+"M",type:"error"});return false}}var data=new FormData();for(let key in param){if(key=="file"){data.append(param[key],file)}else{data.append(key,param[key])}}var filename=file.name;var fileSuffix="";var pos=filename.lastIndexOf(".");if(pos>-1){fileSuffix=filename.substring(pos+1)}settings.chooseAfter({"filename":filename,"filesize":file.size,"fileSuffix":fileSuffix});if(isShowTip){info.tip({content:"文件上传中,请稍候...",type:"submit",timeout:0})}$.ajax({url:url,type:"post",data:data,dataType:"json",cache:false,contentType:false,processData:false,success:function(rtn){clearInterval(info.timeoutId);$(".javaex-opt-tip").remove();$(".javaex-opt-mask").remove();settings.callback(rtn)},error:function(){info.tip({content:"上传失败,请稍后重试",type:"error"})}});$("#"+inputId).unbind("change")})}function checkImg(file){if(!/\.(gif|jpg|jpeg|png|webp|bmp|GIF|JPG|JPEG|PNG|WEBP|BMP)$/.test(file.name)){info.tip({content:"图片类型必须是.gif,jpeg,jpg,png,webp,bmp中的一种",type:"error"});return false}if(maxSize==""||maxSize==0||maxSize=="0"){}else{if(file.size>(maxSize*1024)){info.tip({content:"图片过大,单张图片上限 "+maxSize+"KB",type:"error"});return false}}return true}},ratio:1,dragAble:false,mouseX:0,mouseY:0,imgDivId:"",cutBox:"",moveBox:"",dataUrl:"",imgSrc:"",image:new Image(),uploadAvatar:function(obj,args){var settings=defaults(args);info.imgDivId=settings.imgDivId;info.moveBox=settings.moveBox;info.cutBox=settings.cutBox;info.dataUrl=settings.dataUrl;var reader=new FileReader();var file=obj.files[0];if(file){reader.onload=function(event){info.imgSrc=event.target.result;info.image.src=info.imgSrc;info.image.onload=function(){$("#"+settings.moveBox).hide();info.setBackgroundImage();info.headPreview();$("#"+info.imgDivId).bind("mousewheel DOMMouseScroll",info.imageZoom);$("#"+info.imgDivId).bind("mousedown",info.mouseDown);$("#"+info.imgDivId).bind("mousemove",info.imageDrag);$(window).bind("mouseup",info.mouseUp);$("#narrow").on("click",function(){info.narrow()});$("#enlarge").on("click",function(){info.enlarge()})}}}reader.readAsDataURL(file)},enlarge:function(){this.ratio=this.ratio*1.1;info.setBackgroundImage()},narrow:function(){this.ratio=this.ratio*0.9;info.setBackgroundImage()},setBackgroundImage:function(){var zoomImgWidth=parseInt(info.image.width)*info.ratio;var zoomImgHeight=parseInt(info.image.height)*info.ratio;var posX=($("#"+info.imgDivId).width()-zoomImgWidth)/2;var posY=($("#"+info.imgDivId).height()-zoomImgHeight)/2;$("#"+info.imgDivId).css({"background-image":"url("+info.image.src+")","background-repeat":"no-repeat","background-size":zoomImgWidth+"px "+zoomImgHeight+"px","background-position":posX+"px "+posY+"px"})},imageZoom:function(event){if(event.originalEvent.wheelDelta>0||event.originalEvent.detail<0){info.ratio=info.ratio*1.1}else{info.ratio=info.ratio*0.9}info.setBackgroundImage();info.headPreview();event.preventDefault()},mouseDown:function(event){event.stopImmediatePropagation();info.dragAble=true;info.mouseX=event.clientX;info.mouseY=event.clientY},imageDrag:function(event){event.stopImmediatePropagation();if(info.dragAble){var diffX=event.clientX-info.mouseX;var diffY=event.clientY-info.mouseY;var arr=$("#"+info.imgDivId).css("background-position").split(" ");var posX=diffX+parseInt(arr[0]);var posY=diffY+parseInt(arr[1]);$("#"+info.imgDivId).css("background-position",posX+"px "+posY+"px");info.mouseX=event.clientX;info.mouseY=event.clientY}},mouseUp:function(event){event.stopImmediatePropagation();info.dragAble=false;info.headPreview()},headPreview:function(){var cutBoxWidth=$("#"+info.cutBox).width();var cutBoxHeight=$("#"+info.cutBox).height();var canvas=document.createElement("canvas");var posArr=$("#"+info.imgDivId).css("background-position").split(" ");var sizeArr=$("#"+info.imgDivId).css("background-size").split(" ");var swidth=parseInt(info.image.width);var sheight=parseInt(info.image.height);var x=parseInt(posArr[0])-$("#"+info.imgDivId).width()/2+cutBoxWidth/2;var y=parseInt(posArr[1])-$("#"+info.imgDivId).height()/2+cutBoxHeight/2;var width=parseInt(sizeArr[0]);var height=parseInt(sizeArr[1]);canvas.width=cutBoxWidth;canvas.height=cutBoxHeight;var context=canvas.getContext("2d");context.drawImage(info.image,0,0,swidth,sheight,x,y,width,height);var avatarPreviewImageSrc=canvas.toDataURL('image/png');$(".javaex-avatar180").html('');$(".javaex-avatar50").html('');$(".javaex-avatar30").html('');$(".javaex-avatar180").append('<img src="'+avatarPreviewImageSrc+'" align="absmiddle" style="width:180px;border-radius:180px;">');$(".javaex-avatar50").append('<img src="'+avatarPreviewImageSrc+'" align="absmiddle" style="width:50px;border-radius:50px;">');$(".javaex-avatar30").append('<img src="'+avatarPreviewImageSrc+'" align="absmiddle" style="width:30px;border-radius:30px;">');$("#"+info.dataUrl).val(avatarPreviewImageSrc)},curRange:"",edit:function(args){var settings=defaults(args);var editId=settings.id;var content=$("#"+editId).html();$("#"+editId).empty();var fixedTop=parseInt(settings.fixedTop);var UUID=info.getUUID();var editHtml='';editHtml+='<div class="javaex-edit-toolbar">';editHtml+='<ul class="javaex-edit-btn-toolbar clear">';editHtml+='<a class="javaex-edit-family edit-btn edit-btn-name-fontsize javaex-edit-combobox">';editHtml+='<span tooltip-pos="down" tooltip="字体" class="edit-button-label"><i>arial</i><span class="icon-caret-down"></span></span>';editHtml+='<ul class="javaex-edit-family-select dropdown-menu javaex-edit-combobox-menu javaex-edit-combobox-paragraph" style="z-index: 2;display:none;">';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-checked"><label class="javaex-edit-combobox-item-label">arial</label></li>';editHtml+='<li class="javaex-edit-combobox-item"><label class="javaex-edit-combobox-item-label">宋体</label></li>';editHtml+='<li class="javaex-edit-combobox-item"><label class="javaex-edit-combobox-item-label">微软雅黑</label></li>';editHtml+='<li class="javaex-edit-combobox-item"><label class="javaex-edit-combobox-item-label">楷体</label></li>';editHtml+='<li class="javaex-edit-combobox-item"><label class="javaex-edit-combobox-item-label">黑体</label></li>';editHtml+='<li class="javaex-edit-combobox-item"><label class="javaex-edit-combobox-item-label">隶书</label></li>';editHtml+='<li class="javaex-edit-combobox-item"><label class="javaex-edit-combobox-item-label">Consolas</label></li>';editHtml+='</ul>';editHtml+='</a>';editHtml+='<a class="javaex-edit-size edit-btn edit-btn-name-fontsize javaex-edit-combobox">';editHtml+='<span tooltip-pos="down" tooltip="字号" class="edit-button-label"><i>16</i><span class="icon-caret-down"></span></span>';editHtml+='<ul class="javaex-edit-size-select dropdown-menu javaex-edit-combobox-menu javaex-edit-combobox-paragraph" style="z-index: 2;display:none;">';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-7"><label class="javaex-edit-combobox-item-label">12</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-6"><label class="javaex-edit-combobox-item-label">14</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-5 javaex-edit-combobox-checked"><label class="javaex-edit-combobox-item-label">16</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-4"><label class="javaex-edit-combobox-item-label">18</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-3"><label class="javaex-edit-combobox-item-label">24</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-2"><label class="javaex-edit-combobox-item-label">32</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-1"><label class="javaex-edit-combobox-item-label">48</label></li>';editHtml+='</ul>';editHtml+='</a>';editHtml+='<a class="javaex-edit-format edit-btn edit-btn-name-fontsize javaex-edit-combobox">';editHtml+='<span tooltip-pos="down" tooltip="段落格式" class="edit-button-label"><i>p</i><span class="icon-caret-down"></span></span>';editHtml+='<ul class="javaex-edit-format-select dropdown-menu javaex-edit-combobox-menu javaex-edit-combobox-paragraph" style="z-index: 2;display:none;">';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-7 javaex-edit-combobox-checked"><label class="javaex-edit-combobox-item-label">p</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-6"><label class="javaex-edit-combobox-item-label">H6</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-5"><label class="javaex-edit-combobox-item-label">H5</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-4"><label class="javaex-edit-combobox-item-label">H4</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-3"><label class="javaex-edit-combobox-item-label">H3</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-2"><label class="javaex-edit-combobox-item-label">H2</label></li>';editHtml+='<li class="javaex-edit-combobox-item javaex-edit-combobox-item-1"><label class="javaex-edit-combobox-item-label">H1</label></li>';editHtml+='</ul>';editHtml+='</a>';editHtml+='<span class="separator-line"></span>';editHtml+='<a class="edit-btn" tooltip-pos="down" tooltip="本地图片"><i class="icon icon-photo"><label for="'+UUID+'" style="display: inline-block; width:100%;height:100%;position: absolute;top: 0;left: 0;cursor: pointer;"></label></i>';editHtml+='<input type="file" style="display:none;" id="'+UUID+'" accept="image/gif, image/jpeg, image/jpg, image/png" /></a>';editHtml+='<a class="edit-btn edit-btn-video" tooltip-pos="down" tooltip="外链视频"><div class="icon icon-video"></div></a>';editHtml+='<a class="edit-btn edit-btn-href" tooltip-pos="down" tooltip="超链接"><div class="icon icon-chain"></div></a>';editHtml+='<a class="edit-btn edit-btn-unlink" tooltip-pos="down" tooltip="去除超链接"><div class="icon icon-chain-broken"></div></a>';editHtml+='<span class="separator-line"></span>';editHtml+='<a class="edit-btn edit-btn-bold" tooltip-pos="down" tooltip="加粗"><div class="icon icon-format_bold"></div></a>';editHtml+='<a class="edit-btn edit-btn-italic" tooltip-pos="down" tooltip="斜体"><div class="icon icon-format_italic"></div></a>';editHtml+='<a class="edit-btn edit-btn-underline" tooltip-pos="down" tooltip="下划线"><div class="icon icon-format_underlined"></div></a>';editHtml+='<a class="edit-btn edit-btn-strikethrough" tooltip-pos="down" tooltip="删除线"><div class="icon icon-strikethrough_s"></div></a>';editHtml+='<span class="edit-btn-foreColor"><a class="edit-btn" tooltip-pos="down" tooltip="字体颜色"><div class="icon icon-format_color_text"></div></a></span>';editHtml+='<span class="edit-btn-backColor"><a class="edit-btn" tooltip-pos="down" tooltip="背景颜色"><div class="icon icon-font_download"></div></a></span>';editHtml+='<span class="separator-line"></span>';editHtml+='<a class="edit-btn edit-btn-superscript" tooltip-pos="down" tooltip="上标"><div class="icon icon-superscript"></div></a>';editHtml+='<a class="edit-btn edit-btn-subscript" tooltip-pos="down" tooltip="下标"><div class="icon icon-subscript"></div></a>';editHtml+='<a class="edit-btn edit-btn-insertHorizontalRule" tooltip-pos="down" tooltip="分隔线"><div class="icon icon-minus"></div></a>';editHtml+='<a class="edit-btn edit-btn-selectAll" tooltip-pos="down" tooltip="全选"><div class="icon icon-select_all"></div></a>';editHtml+='<a class="edit-btn edit-btn-removeFormat" tooltip-pos="down" tooltip="清除格式"><div class="icon icon-format_clear"></div></a>';editHtml+='<span class="separator-line"></span>';editHtml+='<a class="edit-btn edit-btn-indent" tooltip-pos="down" tooltip="增加缩进"><div class="icon icon-format_indent_increase"></div></a>';editHtml+='<a class="edit-btn edit-btn-outdent" tooltip-pos="down" tooltip="减少缩进"><div class="icon icon-format_indent_decrease"></div></a>';editHtml+='<a class="edit-btn edit-btn-justifyleft" tooltip-pos="down" tooltip="居左对齐"><div class="icon icon-format_align_left"></div></a>';editHtml+='<a class="edit-btn edit-btn-justifycenter" tooltip-pos="down" tooltip="居中对齐"><div class="icon icon-format_align_center"></div></a>';editHtml+='<a class="edit-btn edit-btn-justifyright" tooltip-pos="down" tooltip="居右对齐"><div class="icon icon-format_align_right"></div></a>';editHtml+='<span class="separator-line"></span>';editHtml+='<a class="edit-btn edit-btn-insertOrderedList" tooltip-pos="down" tooltip="有序列表"><div class="icon icon-format_list_numbered"></div></a>';editHtml+='<a class="edit-btn edit-btn-insertUnorderedList" tooltip-pos="down" tooltip="无序列表"><div class="icon icon-format_list_bulleted"></div></a>';editHtml+='<a class="edit-btn edit-btn-table" tooltip-pos="down" tooltip="表格"><div class="icon icon-table"></div></a>';editHtml+='<a class="edit-btn edit-btn-quote" tooltip-pos="down" tooltip="添加引用文字"><div class="icon icon-format_quote"></div></a>';editHtml+='<a class="edit-btn edit-btn-code" tooltip-pos="down" tooltip="添加代码"><div class="icon icon-code"></div></a>';editHtml+='</ul>';editHtml+='</div>';editHtml+='<div class="javaex-edit-body">';editHtml+='<div class="javaex-edit-body-container" contenteditable="true">';if(!content){editHtml+='<p><br /></p>'}else{editHtml+=content}editHtml+='</div>';editHtml+='</div>';$("#"+editId).append(editHtml);if(settings.isInit){callback()}if(fixedTop>=0){var toolbarWidth=$("#"+editId+" .javaex-edit-toolbar").width();$(window).scroll(function(){var distanceFromTop=$("#"+editId).offset().top-document.documentElement.scrollTop;if(distanceFromTop<fixedTop){$("#"+editId+" .javaex-edit-toolbar").css({"position":"fixed","top":fixedTop+"px","width":toolbarWidth+"px","z-index":"900"})}else{$("#"+editId+" .javaex-edit-toolbar").css({"position":"relative","top":"unset","width":"auto","z-index":"900"})}})}$("#"+editId+" .javaex-edit-body-container").bind("mouseup keyup",function(){saveCurRange();callback()});var image=settings.image;if(image==null||image.dataType=="base64"){info.upload({type:"editImage",id:UUID,dataType:"base64",callback:function(rtn){restoreSelection();execCommand("insertimage",false,rtn)}})}else{var isShowTip=image.isShowTip;if(!isShowTip){isShowTip=false}info.upload({type:"editImage",url:image.url,id:UUID,param:image.param,header:image.header,dataType:"url",isShowTip:isShowTip,callback:function(rtn){$(".javaex-opt-tip").remove();$(".javaex-opt-mask").remove();restoreSelection();image.rtnData=rtn;if(!image.prefix){if(image.imgUrl.split(".").length==2){execCommand("insertimage",false,image.rtnData[image.imgUrl.split(".")[0]][image.imgUrl.split(".")[1]])}else{execCommand("insertimage",false,image.rtnData[image.imgUrl])}}else{if(image.imgUrl.split(".").length==2){execCommand("insertimage",false,image.prefix+image.rtnData[image.imgUrl.split(".")[0]][image.imgUrl.split(".")[1]])}else{execCommand("insertimage",false,image.prefix+image.rtnData[image.imgUrl])}}}})}var isBold=false;$("#"+editId+" .edit-btn-bold").bind("click",function(){var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("bold",false,null);if(isBold){isBold=false;$(this).removeClass("edit-active")}else{isBold=true;$(this).addClass("edit-active")}return false});var isItalic=false;$("#"+editId+" .edit-btn-italic").bind("click",function(){var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("italic",false,null);if(isItalic){isItalic=false;$(this).removeClass("edit-active")}else{isItalic=true;$(this).addClass("edit-active")}return false});$("#"+editId+" .edit-btn-indent").bind("click",function(){execCommand("indent",false,null);return false});$("#"+editId+" .edit-btn-outdent").bind("click",function(){execCommand("outdent",false,null);return false});$("#"+editId+" .edit-btn-justifyleft").bind("click",function(){execCommand("justifyLeft",false,null);return false});$("#"+editId+" .edit-btn-justifycenter").bind("click",function(){execCommand("justifyCenter",false,null);return false});$("#"+editId+" .edit-btn-justifyright").bind("click",function(){execCommand("justifyRight",false,null);return false});$("#"+editId+" .edit-btn-video").bind("click",function(){var html='<div class="javaex-unit clear" style="margin-left: -20px;">';html+='<div class="javaex-unit-left tl"><p class="subtitle">链接地址</p></div>';html+='<div class="javaex-unit-right"><input type="text" class="javaex-text" id="javaex-edit-video-href" placeholder="请输入视频绝对地址" autocomplete="off"/></div>';html+='</div>';html+='<div style="display: grid; grid-column-gap: 20px; grid-template-columns: 1fr 1fr;">';html+='<div style="grid-column-end: 1; grid-column-start: 1;">';html+='<div class="javaex-unit clear" style="margin-left: -20px;">';html+='<div class="javaex-unit-left tl"><p class="subtitle">播放器宽</p></div>';html+='<div class="javaex-unit-right"><input type="text" class="javaex-text" id="javaex-edit-video-width" value="640" placeholder="宽" /></div>';html+='</div>';html+='</div>';html+='<div style="grid-column-end: 2; grid-column-start: 2;">';html+='<div class="javaex-unit clear" style="margin-left: -20px;">';html+='<div class="javaex-unit-left tl"><p class="subtitle">播放器高</p></div>';html+='<div class="javaex-unit-right"><input type="text" class="javaex-text" id="javaex-edit-video-height" value="400" placeholder="高" /></div>';html+='</div>';html+='</div>';html+='</div>';info.alert({content:html,title:"视频",width:"500px",confirm:function(){info.videoCallback()}});return false});$("#"+editId+" .edit-btn-href").bind("click",function(){var html='<div class="javaex-unit clear" style="margin-left: -20px;">';html+='<div class="javaex-unit-left tl"><p class="subtitle">链接地址</p></div>';html+='<div class="javaex-unit-right"><input type="text" class="javaex-text" id="javaex-edit-href" autocomplete="off"/></div>';html+='</div>';html+='<div class="javaex-unit clear" style="margin-left: -20px;">';html+='<div class="javaex-unit-left tl"><p class="subtitle">链接标题</p></div>';html+='<div class="javaex-unit-right"><input type="text" class="javaex-text" id="javaex-edit-hrefText" autocomplete="off"/></div>';html+='</div>';info.alert({content:html,title:"超链接",width:"500px",confirm:function(){info.hrefCallback()}});return false});$("#"+editId+" .edit-btn-unlink").bind("click",function(){execCommand("unlink",false,null);return false});var isUnderline=false;$("#"+editId+" .edit-btn-underline").bind("click",function(){var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("underline",false,null);if(isUnderline){isUnderline=false;$(this).removeClass("edit-active")}else{isUnderline=true;$(this).addClass("edit-active")}return false});var isStrikethrough=false;$("#"+editId+" .edit-btn-strikethrough").bind("click",function(){var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("strikethrough",false,null);if(isStrikethrough){isStrikethrough=false;$(this).removeClass("edit-active")}else{isStrikethrough=true;$(this).addClass("edit-active")}return false});var isSuperscript=false;$("#"+editId+" .edit-btn-superscript").bind("click",function(){var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("superscript",false,null);if(isSuperscript){isSuperscript=false;$(this).removeClass("edit-active")}else{isSuperscript=true;$(this).addClass("edit-active")}return false});var isSubscript=false;$("#"+editId+" .edit-btn-subscript").bind("click",function(){var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("subscript",false,null);if(isSubscript){isSubscript=false;$(this).removeClass("edit-active")}else{isSubscript=true;$(this).addClass("edit-active")}return false});var isInsertOrderedList=false;$("#"+editId+" .edit-btn-insertOrderedList").bind("click",function(){execCommand("insertOrderedList",false,null);if(isInsertOrderedList){isInsertOrderedList=false;$(this).removeClass("edit-active")}else{isInsertOrderedList=true;$("#"+editId+" .edit-btn-insertUnorderedList").removeClass("edit-active");$(this).addClass("edit-active")}return false});var isInsertUnorderedList=false;$("#"+editId+" .edit-btn-insertUnorderedList").bind("click",function(){execCommand("insertUnorderedList",false,null);if(isInsertUnorderedList){isInsertUnorderedList=false;$(this).removeClass("edit-active")}else{isInsertUnorderedList=true;$("#"+editId+" .edit-btn-insertOrderedList").removeClass("edit-active");$(this).addClass("edit-active")}return false});$("#"+editId+" .edit-btn-insertHorizontalRule").bind("click",function(){execCommand("insertHTML",false,'<hr /><br />');return false});$("#"+editId+" .edit-btn-selectAll").bind("click",function(){execCommand("selectAll",false,null);return false});$("#"+editId+" .edit-btn-removeFormat").bind("click",function(){execCommand("removeFormat",false,null);return false});var isForeColor=false;$("#"+editId+" .edit-btn-foreColor").bind("click",function(){$(this).addClass("edit-active");$("#"+editId+" .edit-btn-backColor .javaex-edit-color-menu").hide();if($("#"+editId+" .edit-btn-foreColor .javaex-edit-color-menu").length==0){$(this).append(editColorMenu())}else{if($("#"+editId+" .edit-btn-foreColor .javaex-edit-color-menu").is(':hidden')){$("#"+editId+" .edit-btn-foreColor .javaex-edit-color-menu").show()}}$("#"+editId+" .edit-btn-foreColor .javaex-edit-color-menu input").bind("click",function(e){$(this).parent().css("display","none");var color=$(this).attr("color-val");execCommand("foreColor",false,color);e.stopPropagation();if(color=="Black"){$("#"+editId+" .edit-btn-foreColor .icon-format_color_text").css("color","unset");$("#"+editId+" .edit-btn-foreColor").removeClass("edit-active")}else{$("#"+editId+" .edit-btn-foreColor .icon-format_color_text").css("color",color)}});return false});var isBackColor=false;$("#"+editId+" .edit-btn-backColor").bind("click",function(){$(this).addClass("edit-active");$("#"+editId+" .edit-btn-foreColor .javaex-edit-color-menu").hide();if($("#"+editId+" .edit-btn-backColor .javaex-edit-color-menu").length==0){$(this).append(editColorMenu())}else{if($("#"+editId+" .edit-btn-backColor .javaex-edit-color-menu").is(':hidden')){$("#"+editId+" .edit-btn-backColor .javaex-edit-color-menu").show()}}$("#"+editId+" .edit-btn-backColor .javaex-edit-color-menu input").bind("click",function(e){$(this).parent().css("display","none");var color=$(this).attr("color-val");execCommand("backColor",false,color);e.stopPropagation();if(color=="White"){$("#"+editId+" .edit-btn-backColor .icon-font_download").css("color","unset");$("#"+editId+" .edit-btn-backColor").removeClass("edit-active")}else{$("#"+editId+" .edit-btn-backColor .icon-font_download").css("color",color)}});return false});$("#"+editId+" .edit-btn-table").bind("click",function(){var html='<div style="display: grid; grid-column-gap: 20px; grid-template-columns: 1fr 1fr;margin-bottom: -20px;">';html+='<div style="grid-column-end: 1; grid-column-start: 1;">';html+='<div class="javaex-unit clear" style="margin-left: -20px;">';html+='<div class="javaex-unit-left tl"><p class="subtitle">表格行数</p></div>';html+='<div class="javaex-unit-right"><input type="text" class="javaex-text" id="javaex-edit-table-row-num" value="2" /></div>';html+='</div>';html+='</div>';html+='<div style="grid-column-end: 2; grid-column-start: 2;">';html+='<div class="javaex-unit clear" style="margin-left: -20px;">';html+='<div class="javaex-unit-left tl"><p class="subtitle">表格列数</p></div>';html+='<div class="javaex-unit-right"><input type="text" class="javaex-text" id="javaex-edit-table-col-num" value="2" /></div>';html+='</div>';html+='</div>';html+='</div>';info.alert({content:html,title:"添加表格",width:"360px",confirm:function(){info.tableCallback()}});return false});$(document).click(function(){$("#"+editId+" .javaex-edit-family-select").hide();$("#"+editId+" .javaex-edit-size-select").hide();$("#"+editId+" .javaex-edit-format-select").hide();$("#"+editId+" .javaex-edit-color-menu").hide()});$("#"+editId+" .javaex-edit-family").bind("click",function(){restoreSelection();$("#"+editId+" .javaex-edit-size-select").hide();$("#"+editId+" .javaex-edit-format-select").hide();$("#"+editId+" .javaex-edit-family-select").show();event.stopPropagation()});$("#"+editId+" .javaex-edit-family-select > li").bind("click",function(){$(this).closest(".javaex-edit-family").find("i").text($(this).text());$(this).addClass("javaex-edit-combobox-checked").siblings().removeClass("javaex-edit-combobox-checked");$("#"+editId+" .javaex-edit-family-select").fadeOut();var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("fontName",false,$(this).text())});$("#"+editId+" .javaex-edit-size").bind("click",function(){restoreSelection();$("#"+editId+" .javaex-edit-family-select").hide();$("#"+editId+" .javaex-edit-format-select").hide();$("#"+editId+" .javaex-edit-size-select").show();event.stopPropagation()});$("#"+editId+" .javaex-edit-size-select > li").bind("click",function(){var fontSize=$(this).text();var fontSizeText="14px";switch(fontSize){case"48":fontSize=7;fontSizeText="48px";break;case"32":fontSize=6;fontSizeText="32px";break;case"24":fontSize=5;fontSizeText="24px";break;case"18":fontSize=4;fontSizeText="18px";break;case"16":fontSize=3;fontSizeText="16px";break;case"14":fontSize=2;fontSizeText="14px";break;case"12":fontSize=1;fontSizeText="12px";break;default:fontSize=3;fontSizeText="16px";break}$(this).closest(".javaex-edit-size").find("i").text($(this).text());$(this).addClass("javaex-edit-combobox-checked").siblings().removeClass("javaex-edit-combobox-checked");$("#"+editId+" .javaex-edit-size-select").fadeOut();var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("fontSize",false,fontSize)});$("#"+editId+" .javaex-edit-format").bind("click",function(){restoreSelection();$("#"+editId+" .javaex-edit-family-select").hide();$("#"+editId+" .javaex-edit-size-select").hide();$("#"+editId+" .javaex-edit-format-select").show();event.stopPropagation()});$("#"+editId+" .javaex-edit-format-select > li").bind("click",function(){$(this).closest(".javaex-edit-format").find("i").text($(this).text());$(this).addClass("javaex-edit-combobox-checked").siblings().removeClass("javaex-edit-combobox-checked");$("#"+editId+" .javaex-edit-format-select").fadeOut();var selection=restoreSelection();if(selection==null||selection.type!="Range"){info.curRange=null}execCommand("removeFormat",false,null);execCommand("formatBlock",false,$(this).text())});$("#"+editId+" .edit-btn-quote").bind("click",function(){info.alert({content:'<textarea id="javaex-edit-quote" wrap="hard" class="javaex-desc" style="height: 160px;"></textarea>',title:"请输入引用内容",width:"500px",confirm:function(){info.quoteCallback()}});return false});$("#"+editId+" .edit-btn-code").bind("click",function(){restoreSelection();execCommand("insertHTML",false,'<pre><code><br /></code></pre><p><br />')});function editColorMenu(){return'<div class="javaex-edit-color-menu"><input type="button" style="background-color: Black" title="黑色" color-val="Black"><input type="button" style="background-color: Sienna" color-val="Sienna" title="赭色"><input type="button" style="background-color: DarkOliveGreen" color-val="DarkOliveGreen" title="暗橄榄绿色"><input type="button" style="background-color: DarkGreen" color-val="DarkGreen" title="暗绿色"><input type="button" style="background-color: DarkSlateBlue" color-val="DarkSlateBlue" title="暗灰蓝色"><input type="button" style="background-color: Navy" color-val="Navy" title="海军色"><input type="button" style="background-color: Indigo" color-val="Indigo" title="靛青色"><input type="button" style="background-color: DarkSlateGray" color-val="DarkSlateGray" title="墨绿色"><input type="button" style="background-color: DarkRed" color-val="DarkRed" title="暗红色"><input type="button" style="background-color: DarkOrange" color-val="DarkOrange" title="暗桔黄色"><input type="button" style="background-color: Olive" color-val="Olive" title="橄榄色"><input type="button" style="background-color: Green" color-val="Green" title="绿色"><input type="button" style="background-color: Teal" color-val="Teal" title="水鸭色"><input type="button" style="background-color: Blue" color-val="Blue" title="蓝色"><input type="button" style="background-color: SlateGray" color-val="SlateGray" title="灰石色"><input type="button" style="background-color: DimGray" color-val="DimGray" title="暗灰色"><input type="button" style="background-color: Red" color-val="Red" title="红色"><input type="button" style="background-color: SandyBrown" color-val="SandyBrown" title="沙褐色"><input type="button" style="background-color: YellowGreen" color-val="YellowGreen" title="黄绿色"><input type="button" style="background-color: SeaGreen" color-val="SeaGreen" title="海绿色"><input type="button" style="background-color: MediumTurquoise" color-val="MediumTurquoise" title="间绿宝石"><input type="button" style="background-color: RoyalBlue" color-val="RoyalBlue" title="皇家蓝"><input type="button" style="background-color: Purple" color-val="Purple" title="紫色"><input type="button" style="background-color: Gray" color-val="Gray" title="灰色"><input type="button" style="background-color: Magenta" color-val="Magenta" title="红紫色"><input type="button" style="background-color: Orange" color-val="Orange" title="橙色"><input type="button" style="background-color: Yellow" color-val="Yellow" title="黄色"><input type="button" style="background-color: Lime" color-val="Lime" title="酸橙色"><input type="button" style="background-color: Cyan" color-val="Cyan" title="青色"><input type="button" style="background-color: DeepSkyBlue" color-val="DeepSkyBlue" title="深天蓝色"><input type="button" style="background-color: DarkOrchid" color-val="DarkOrchid" title="暗紫色"><input type="button" style="background-color: Silver" color-val="Silver" title="银色"><input type="button" style="background-color: Pink" color-val="Pink" title="粉色"><input type="button" style="background-color: Wheat" color-val="Wheat" title="浅黄色"><input type="button" style="background-color: LemonChiffon" color-val="LemonChiffon" title="柠檬绸色"><input type="button" style="background-color: White" color-val="White" title="白色"></div>'}function getCurRange(){var selection=null;var range=null;var parentElement=null;var oEditArea=$("#"+editId+" .javaex-edit-body-container")[0];selection=window.document.getSelection();if(selection.getRangeAt&&selection.rangeCount){range=window.document.getSelection().getRangeAt(0);parentElement=range.commonAncestorContainer}if(parentElement&&(parentElement.id==oEditArea.id||window.jQuery.contains(oEditArea,parentElement))){return range}}function saveCurRange(){info.curRange=getCurRange()}function restoreSelection(){var selection=null;if(!!info.curRange){selection=window.document.getSelection();selection.removeAllRanges();selection.addRange(info.curRange)}return selection}function execCommand(command,mode,data){document.execCommand(command,mode,data);callback()}function callback(){settings.callback({"html":$("#"+editId+" .javaex-edit-body-container").html().replace(/<(script)[\S\s]*?\1>/gi,"").replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),"text":$("#"+editId+" .javaex-edit-body-container").text().replace(/<(script)[\S\s]*?\1>|<\/?(a|img)[^>]*>/gi,"").replace(/\r\n/g,"").replace(/\n/g,"").replace(/\<|\>|\&/g,"")})}},hrefCallback:function(){var href=$("#javaex-edit-href").val();var hrefText=$("#javaex-edit-hrefText").val();if(!!href){if(!hrefText){hrefText=href}if(!!info.curRange){var selection=null;selection=window.document.getSelection();selection.removeAllRanges();selection.addRange(info.curRange)}var hrefHtml='<a href="'+href+'" target="_blank">'+hrefText+'</a>';document.execCommand('insertHTML',false,hrefHtml)}},quoteCallback:function(){var quote=$("#javaex-edit-quote").val();if(!quote){quote="<br/>"}if(!!info.curRange){var selection=null;selection=window.document.getSelection();selection.removeAllRanges();selection.addRange(info.curRange)}var quoteHtml='<div class="javaex-edit-quote"><blockquote>'+quote+'</blockquote></div><br/>';document.execCommand('insertHTML',false,quoteHtml)},tableCallback:function(){var rowNum=$("#javaex-edit-table-row-num").val();var colNum=$("#javaex-edit-table-col-num").val();var html='';html+='<table class="javaex-table unhover edit-table">';html+='	<tbody>';for(let row=0;row<rowNum;row++){html+='	<tr>';for(let col=0;col<colNum;col++){html+='	<td></td>'}html+='	</tr>'}html+='	</tbody>';html+='</table>';html+='<br/>';if(!!info.curRange){var selection=null;selection=window.document.getSelection();selection.removeAllRanges();selection.addRange(info.curRange)}document.execCommand('insertHTML',false,html)},videoCallback:function(){var href=$("#javaex-edit-video-href").val();var width=$("#javaex-edit-video-width").val();var height=$("#javaex-edit-video-height").val();if(!!href&&!!width&&!!height){var html='<video controls="controls" width="'+width+'" height="'+height+'" src="'+href+'">您的浏览器不支持 video 标签。</video>';if(!!info.curRange){var selection=null;selection=window.document.getSelection();selection.removeAllRanges();selection.addRange(info.curRange)}document.execCommand('insertHTML',false,html)}}};return info};window.javaex=javaex()})();$(function(){javaex.radio();javaex.checkbox();javaex.listenCheckbox()});