(function(){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i-1){return true;} return false;}},{key:"_getEmptyObj",value:function _getEmptyObj(){return $();}},{key:"isEmpty",value:function isEmpty(){return this._isNull();}},{key:"val",value:function val(v){if(!!v){this._setProp(function(ele){return ele.value=str;});}else{return this._e[0].value;}}},{key:"text",value:function text(str){if(!!str){this._setProp(function(ele){return ele.textContent=str;});}else{return this._e[0].textContent;}}},{key:"show",value:function show(){this._setProp(function(ele){return ele.style.display="block";});}},{key:"hide",value:function hide(){this._setProp(function(ele){return ele.style.display="none";});}},{key:"showInlineBlock",value:function showInlineBlock(){this._setProp(function(ele){return ele.style.display="inline-block";});}},{key:"toggleDisplay",value:function toggleDisplay(){this._setProp(function(ele){var displayStr=window.getComputedStyle(ele,null).display;if(displayStr=="none"){ele.style.display="block";}else{ele.style.display="none";}});}},{key:"IsShowing",value:function IsShowing(){if(this._isNull()){return false;} var ele=this._e[0];var displayStr=window.getComputedStyle(ele,null).display;if(displayStr=="block"){return true;} return false;}},{key:"style",value:function style(name){var ele=this._e[0];return window.getComputedStyle(ele,null)[name];}},{key:"css",value:function css(prop,value){if(!!value){this._setProp(function(ele){return ele.style[prop]=value;});}else{return this._e[0].style[prop];}}},{key:"prop",value:function prop(propName,value){if(!!value){this._setProp(function(ele){return ele[propName]=value;});}else{if(propName.indexOf("data-")>-1){return this._e[0].getAttribute(propName);}else{return this._e[0][propName];}}}},{key:"height",value:function height(h){if(this._isNull()){return null;} if(h){this._e[0].style.height=h;return;} return this._e[0].clientHeight;}},{key:"width",value:function width(w){if(this._isNull()){return null;} if(w){this._e[0].style.width=w;return;} return this._e[0].clientWidth;}},{key:"parent",value:function parent(){return $(this._e[0].parentNode);}},{key:"eq",value:function eq(index){if(index+1>this._e.length)return console.error("index error");return $&&$(this._e[index]);}},{key:"getNodeWithData",value:function getNodeWithData(dataStr,value){var list=[];for(var i=0;i=-135&&angle<=-45){result=1;}else if(angle>45&&angle<135){result=2;}else if(angle>=135&&angle<=180||angle>=-180&&angle<-135){result=3;}else if(angle>=-45&&angle<=45){result=4;} return result;} function addTouchMoveEventListener(selectorStr,handler){var target=document.querySelector(selectorStr);var startx=void 0,starty=void 0;var done=false;target.addEventListener("touchstart",function(e){startx=e.touches[0].pageX;starty=e.touches[0].pageY;done=false;},false);target.addEventListener("touchend",function(e){if(done)return;var endx=void 0,endy=void 0;endx=e.changedTouches[0].pageX;endy=e.changedTouches[0].pageY;var direction=getDirection(startx,starty,endx,endy);handler(direction);done=true;},false);target.addEventListener("touchcancel",function(e){if(done)return;var endx=void 0,endy=void 0;endx=e.changedTouches[0].pageX;endy=e.changedTouches[0].pageY;var direction=getDirection(startx,starty,endx,endy);handler(direction);done=true;});};(function(){var lastTime=0;var vendors=['webkit','moz'];for(var x=0;x-1||clampValue.indexOf('em')>-1),truncationHTMLContainer;if(opt.truncationHTML){truncationHTMLContainer=document.createElement('span');truncationHTMLContainer.innerHTML=opt.truncationHTML;} function computeStyle(elem,prop){if(!win.getComputedStyle){win.getComputedStyle=function(el,pseudo){this.el=el;this.getPropertyValue=function(prop){var re=/(\-([a-z]){1})/g;if(prop=='float')prop='styleFloat';if(re.test(prop)){prop=prop.replace(re,function(){return arguments[2].toUpperCase();});} return el.currentStyle&&el.currentStyle[prop]?el.currentStyle[prop]:null;};return this;};} return win.getComputedStyle(elem,null).getPropertyValue(prop);} function getMaxLines(height){var availHeight=height||element.clientHeight,lineHeight=getLineHeight(element);return Math.max(Math.floor(availHeight/lineHeight),0);} function getMaxHeight(clmp){var lineHeight=getLineHeight(element);return lineHeight*clmp;} function getLineHeight(elem){var lh=computeStyle(elem,'line-height');if(lh=='normal'){lh=parseFloat(computeStyle(elem,'font-size'))*1.2;} return parseFloat(lh);} var splitOnChars=opt.splitOnChars.slice(0),splitChar=splitOnChars[0],chunks,lastChunk;function getLastChild(elem){if(elem.lastChild.children&&elem.lastChild.children.length>0){return getLastChild(Array.prototype.slice.call(elem.children).pop());}else if(elem.lastChild.nodeValue==opt.truncationChar){return elem.lastChild;} else if(!elem.lastChild||!elem.lastChild.nodeValue||elem.lastChild.nodeValue==''||elem.lastChild.nodeValue==opt.truncationChar){elem.lastChild.parentNode.removeChild(elem.lastChild);return getLastChild(element);} else{return elem.lastChild;}} function truncate(target,maxHeight){if(!maxHeight){return;} function reset(){splitOnChars=opt.splitOnChars.slice(0);splitChar=splitOnChars[0];chunks=null;lastChunk=null;} var nodeValue=target.nodeValue.replace(opt.truncationChar,'');if(!chunks){if(splitOnChars.length>0){splitChar=splitOnChars.shift();} else{splitChar='';} chunks=nodeValue.split(splitChar);} if(chunks.length>1){lastChunk=chunks.pop();applyEllipsis(target,chunks.join(splitChar));} else{chunks=null;} if(truncationHTMLContainer){target.nodeValue=target.nodeValue.replace(opt.truncationChar,'');element.innerHTML=target.nodeValue+' '+truncationHTMLContainer.innerHTML+opt.truncationChar;} if(chunks){if(element.clientHeight<=maxHeight){if(splitOnChars.length>=0&&splitChar!=''){applyEllipsis(target,chunks.join(splitChar)+splitChar+lastChunk);chunks=null;} else{return element.innerHTML;}}} else{if(splitChar==''){applyEllipsis(target,'');target=getLastChild(element);reset();}} if(opt.animate){setTimeout(function(){truncate(target,maxHeight);},opt.animate===true?10:opt.animate);}else{return truncate(target,maxHeight);}} function overflowhidden(){var text=element;var rows=opt.clamp;var lineHeight=getLineHeight(element);var at=rows*parseFloat(lineHeight);var tempstr=element.innerHTML;text.innerHTML=tempstr;text.style.height='auto';var len=tempstr.length;var i=0;if(text.clientHeight<=at){return text.innerHTML;}else{var temp="";text.innerHTML=temp;for(i=0;iat){text.innerHTML=tempstr.substring(0,len-3)+"...";text.style.height=at+'px';return text.innerHTML;}}else{var slen=temp.length;tempstr=temp.substring(0,slen-1);len=tempstr.length;text.innerHTML=tempstr.substring(0,len-3)+"...";text.style.height=at+'px';return text.innerHTML;}}}} function applyEllipsis(elem,str){elem.nodeValue=str+opt.truncationChar;} if(clampValue=='auto'){clampValue=getMaxLines();}else if(isCSSValue){clampValue=getMaxLines(parseInt(clampValue));} var clampedText;if(supportsNativeClamp&&opt.useNativeClamp){sty.overflow='hidden';sty.textOverflow='ellipsis';sty.webkitBoxOrient='vertical';sty.display='-webkit-box';sty.webkitLineClamp=clampValue;if(isCSSValue){sty.height=opt.clamp+'px';}}else{var height=getMaxHeight(clampValue);if(height<=element.clientHeight){clampedText=overflowhidden();}} return{'original':originalText,'clamped':clampedText};} window.$clamp=clamp;})();(function(){window.addOnload(function(){addFooterMediaLink();hideOverLineText();});var resetLineTexting=false;window.addOnResize(function(){if(!resetLineTexting){requestAnimationFrame(resetLineText);resetLineTexting=true;}});function addFooterMediaLink(){var list=document.querySelectorAll(".show-hover-img");for(var i=0;i=currentTotalHeight){currentLeaderEle.height("auto");gLeaderAnimationing=false;return;} currentHeight+=currentIncrement;currentLeaderEle.height(currentHeight+"px");window.requestAnimationFrame(render);})();}else{var lastSelectId=lastSelectEle.attr("data-id");var lastLeaderEle=$(".leader-detail-content").getNodeWithDataByAttribute("data-id",lastSelectId);var lastTotalHeight=lastLeaderEle.height();var lastHeightTmp=lastTotalHeight;var lastDecrement=lastTotalHeight/time;var tmpCrement=currentIncrement;var endAction=function endAction(){lastLeaderEle.removeClass("active");currentLeaderEle.addClass("active");currentLeaderEle.height("auto");lastLeaderEle.height("auto");gLeaderAnimationing=false;};var inOrdeCrementAction=function inOrdeCrementAction(tmp){lastHeightTmp-=tmp;currentHeight+=tmp;};if(lastDecrement=currentTotalHeight){endAction();return;}else{lastLeaderEle.height(lastHeightTmp+"px");currentLeaderEle.height(currentHeight+"px");} if(lastHeightTmp<=0){lastLeaderEle.height("0px");} window.requestAnimationFrame(render);})();}else{tmpCrement=lastDecrement;(function render(){inOrdeCrementAction(tmpCrement);if(lastHeightTmp<=0){endAction();return;}else{lastLeaderEle.height(lastHeightTmp+"px");currentLeaderEle.height(currentHeight+"px");} if(currentHeight>=currentTotalHeight){currentLeaderEle.height("auto");} window.requestAnimationFrame(render);})();}}});setTimeout(function(){for(var _i2=0;_i2<$('.ef').length;_i2++){var element=$('.ef').eq(_i2);var id=element.prop('data-id');if(window.leaderEmailList&&window.leaderEmailList[id]!==""){var origin=window.leaderEmailList[id];var res='';try{res=origin.replace('&','@');res=res.split('').reverse().join('');res=res.slice(4);}catch(error){res='';} element.text(res);}}},500);});})();;(function(){if($(".news-and-events").length===0||$(".people").length===0||$(".campus").length===0)return;window.addEventListener('DOMContentLoaded',function(){addCarousel(".news-and-events .news-content .page-tag-m span",".news-and-events .news-content .news-single",".news-and-events .news-content .content",".news-and-events .news-wrapper");addCarousel(".news-and-events .events-content .page-tag-m span",".news-and-events .events-content .event-item",".news-and-events .events-content .events",".news-and-events .events-wrapper");addCarousel(".people .page-tag-m span",".people .content .people-item",".people .content",".people");addCarousel(".campus .page-tag-m span",".campus .content .campus-img",".campus .content",".campus");});function addCarousel(eventTarget,moveTarget,container,touchContainer){var isOn=false;var stId=void 0;$(eventTarget).on("click",function(){if(isOn)return;isOn=true;$(eventTarget).removeClass("selected");$(this).addClass("selected");var page=Number($(this).prop("data-page"));var width=$(moveTarget).width();var marginRight=parseFloat(window.getComputedStyle(document.querySelector(moveTarget))["margin-right"]);var list=$(eventTarget);for(var i=0;i";for(var i=1;i";} $(".about-uestc .switch-contain .imgs-btns").appendNodeStr(str);} function resetAboutUestc(){initAboutUestc();resetAboutUestcing=false;} function initAboutUestc(){var lineCount=2;if(window.innerWidth<768){lineCount=4;} $(".about-uestc .outter .about-content").css("margin-left","0px");$(".about-uestc .switch-contain .imgs-btns span").removeClass("selected");$($(".about-uestc .switch-contain .imgs-btns span")[0]).addClass("selected");var list=$(".about-uestc .about-content a");var RowItemCount=parseInt(list.length/lineCount);if(list.length%lineCount!=0){RowItemCount=RowItemCount+1;} var outerWidth=$(".about-uestc .outter").width();var mrLength=parseInt(list.eq(0).style("margin-right"));var mbLength=parseInt(list.eq(0).style("margin-bottom"));var itemWidth=list.eq(0).width()+mrLength;var itemHeight=list.eq(0).height()+mbLength;$(".about-uestc .about-content").width(RowItemCount*itemWidth+1+"px");$(".about-uestc .about-content").height("auto");if(lineCount==4){$(".about-uestc .about-content").height(itemHeight*lineCount+"px");} if(lineCount==4){for(var index=0;index=768){requestAnimationFrame(resetNewsImage);resetNewsImging=true;}});function getMoveWidth(){var bodyWidth=getWindowWidth();if(bodyWidth>=1024){$(".campus .outter").css("width",getItemWidth()*3+parseFloat($(".campus .campus-img").style("margin-left"))*3+"px");} return $(".campus .outter").width();} function getItemWidth(){return parseFloat($(".campus .campus-img").style("width"))+parseFloat($(".campus .campus-img").style("margin-right"));} function getNumberFromPxStr(str){return Number(str.slice(0,str.length-2));} function resetNewsImage(){initView();resetNewsImging=false;} function initView(){addNodeForCarousel();} function addNodeForCarousel(){var parentNode=$(".campus .content")._e[0];var oldNodes=$(".campus .content .add-node");for(var i=0;i=0){$(".campus .outter .content").css("transition","none");$(".campus .outter .content").css("margin-left",-Math.floor(totalNum/showNum)*getMoveWidth()+"px");setTimeout(function(){$(".campus .outter .content").css("transition","all 1s");},100);} gIsOn=false;},1000);});$(".campus .icon_arrow_next").click(function(){if(gIsOn)return;gIsOn=true;var nowLeft=getNumberFromPxStr($(".campus .outter .content").css("margin-left"));var targetLeft=nowLeft-getMoveWidth();$(".campus .outter .content").css("margin-left",targetLeft+"px");setTimeout(function(){var showNum=Math.floor(getMoveWidth()/getItemWidth());var totalNum=$(".campus .campus-img").length-$(".campus .campus-img.add-node").length;if(targetLeft<=-(Math.floor(totalNum/showNum)+1)*getMoveWidth()){$(".campus .outter .content").css("transition","none");$(".campus .outter .content").css("margin-left",-getMoveWidth()+"px");setTimeout(function(){$(".campus .outter .content").css("transition","all 1s");},100);} gIsOn=false;},1000);});}})();;(function(){$(".events-content .event-item .title").on("mouseenter",function(e){var bodyWidth=getWindowWidth();var hoverContent=$(this).parent().parent().directChildNodes("content-hover");if(bodyWidth>=1440||bodyWidth<=1023){hoverContent.hide();return;} hoverContent.show();});$(".events-content .event-item .title").on("mouseleave",function(e){var bodyWidth=getWindowWidth();var hoverContent=$(this).parent().parent().directChildNodes("content-hover");if(bodyWidth>=1440||bodyWidth<=1023){hoverContent.hide();return;} var relatedTar=e.relatedTarget;if(relatedTar&&relatedTar.className.indexOf("content-hover")!=-1){return;} hoverContent.hide();});$(".events-content .event-item .content-hover").on("mouseleave",function(e){var bodyWidth=getWindowWidth();var hoverContent=$(this);if(bodyWidth>=1440||bodyWidth<=1023){hoverContent.hide();return;} var relatedTar=e.relatedTarget;var selfTitle=hoverContent.parent().directChildNodes("info").directChildNodes("title");if(selfTitle==relatedTar){return;} hoverContent.hide();});})();;(function(){if($(".news-imgs").length===0)return;var gIsOn=false;var resetNewsImging=false;window.addEventListener('DOMContentLoaded',function(){initView();initEvent();});window.addOnResize(function(){if(!resetNewsImging){requestAnimationFrame(resetNewsImage);resetNewsImging=true;}});function getMoveWidth(){return $(".news-imgs .outter").width();} function getItemWidth(){return parseFloat(document.querySelector(".news-imgs .news-item").offsetWidth+parseFloat($(".news-imgs .news-item").style("margin-right"))+parseFloat($(".news-imgs .news-item").style("margin-left")));} function getNumberFromPxStr(str){return Number(str.slice(0,str.length-2));} function resetNewsImage(){initView();resetNewsImging=false;} function initView(){var bodyWidth=getWindowWidth();if(bodyWidth<1024){var allHeight=0;for(var i=0;i<3;i++){var ele=$(".news-imgs .news-item").eq(i);var itemHeight=ele.height();var marginBottom=parseFloat(ele.style("margin-bottom"));allHeight+=itemHeight+marginBottom;} $(".news-imgs .outter").css("height",allHeight+"px");}else{$(".news-imgs .outter").css("height","auto");} addNodeForCarousel();} function addNodeForCarousel(){var parentNode=$(".news-imgs .content")._e[0];var oldNodes=$(".news-imgs .content .add-node");for(var i=0;i=0){$(".news-imgs .outter .content").css("transition","none");$(".news-imgs .outter .content").css("margin-left",-Math.floor(totalNum/showNum)*getMoveWidth()+"px");setTimeout(function(){$(".news-imgs .outter .content").css("transition","all 1s");},100);} gIsOn=false;},1000);});$(".news-imgs .icon_arrow_next").click(function(){if(gIsOn)return;gIsOn=true;var nowLeft=getNumberFromPxStr($(".news-imgs .outter .content").css("margin-left"));var targetLeft=nowLeft-getMoveWidth();$(".news-imgs .outter .content").css("margin-left",targetLeft+"px");setTimeout(function(){var showNum=Math.floor(getMoveWidth()/getItemWidth());var totalNum=$(".news-imgs .news-item").length-$(".news-imgs .news-item.add-node").length;if(targetLeft<=-(Math.floor(totalNum/showNum)+1)*getMoveWidth()){$(".news-imgs .outter .content").css("transition","none");$(".news-imgs .outter .content").css("margin-left",-getMoveWidth()+"px");setTimeout(function(){$(".news-imgs .outter .content").css("transition","all 1s");},100);} gIsOn=false;},1000);});}})();;(function(){if($(".title-carousel").length===0)return;var gCarouselNum=0;var gCarouselStId="";var gCarouselNow=false;window.addOnload(function(){resetIndexCarouselWidth();carouselInit();eventInit();});document.getElementsByClassName("big-image")[0].addEventListener("load",function(){resetIndexCarouselWidth();});var carouselResizing=false;window.addOnResize(function(){if(!carouselResizing){requestAnimationFrame(resetWidth);carouselResizing=true;}});window.addEventListener("orientationchange",function(){resetWidth();},false);function resetWidth(){gCarouselNum=0;resetIndexCarouselWidth();carouselResizing=false;} function resetIndexCarouselWidth(){var bodyWidth=getWindowWidth();var list=$(".title-carousel .carousel-list .item");var imgWidth=$(".carousel-list img").width();var imgHeight=$(".carousel-list img").height();var finalHeight=bodyWidth/imgWidth*imgHeight;$(".title-carousel").css("height",finalHeight+"px");$(".carousel-list").css("width",bodyWidth*list.length+"px");$(".carousel-list").css("left","-"+gCarouselNum*bodyWidth+"px");list.css("width",bodyWidth+"px");} function carouselInit(stId){if($(".carousel-btns span").isEmpty()||$(".carousel-list").isEmpty()){return;} if(stId){clearInterval(stId);} gCarouselStId=setInterval(function(){if(gCarouselNow)return;var itemCount=$(".carousel-list .item").length;if(gCarouselNum>=itemCount-2){showCarouselIndex(itemCount-1);gCarouselNum=0;}else{gCarouselNum++;} showCarouselIndex(gCarouselNum);},11000);} function eventInit(){$(".carousel-btns span").on("click",function(){var index=Number($(this).prop("data-index"));showCarouselIndex(index);});$(".title-carousel .icon_arrow_last").on("click",function(){toLast();});$(".title-carousel .icon_arrow_next").on("click",function(){toNext();});addTouchMoveEventListener(".carousel-list",function(direction){var bodyWidth=getWindowWidth();if(bodyWidth>1000)return;switch(direction){case 3:toNext();break;case 4:toLast();break;}});} function showCarouselIndex(index){if(gCarouselNow)return;gCarouselNow=true;var itemCount=$(".carousel-list .item").length;if(index!==itemCount-1)gCarouselNum=index;var bodyWidth=getWindowWidth();$(".carousel-btns span").removeClass("selected");$(".carousel-btns span").eq(index!==itemCount-1?index:0).addClass("selected");function getNowLeft(){var left=$(".carousel-list").css("left");return Number(left.slice(0,left.length-2));} var nowLeft=getNowLeft();var targeLeft=-(index*bodyWidth);var isAdd=nowLeft>targeLeft?false:true;var move=Math.abs(nowLeft-targeLeft)/50;function render(){var innerLeft=getNowLeft();if(isAdd&&innerLefttargeLeft){$(".carousel-list").css("left",innerLeft-move+"px");window.requestAnimationFrame(render);}else{$(".carousel-list").css("left",targeLeft+"px");if(index===itemCount-1){setTimeout(function(){$(".carousel-list").css("left","-0px");},100);} gCarouselNow=false;carouselInit(gCarouselStId);return;}} render();} function getNowIndex(){return Number($(".title-carousel .carousel-btns span.selected").attr("data-index"));} function toNext(){var index=getNowIndex();var total=$(".title-carousel .carousel-btns span").length;if(index+1>=total){return;}else{showCarouselIndex(index+1);}} function toLast(){var index=getNowIndex();if(index-1<0){return;}else{showCarouselIndex(index-1);}}})();;(function(){window.addEventListener('DOMContentLoaded',function(){$(".top-nav .drop-down").click(function(){$(".top-nav .link-list").toggleDisplay();});$(".top-nav .icon_search").click(function(){$(".search-wrapper").addClass("show");});$("#SearchInput").on("keydown",function(e){var keyword=$("#SearchInput").val();inputKeyDownAction(e,keyword);});$("#SearchInput768").on("keydown",function(e){var keyword=$("#SearchInput768").val();inputKeyDownAction(e,keyword);});$(".search-wrapper .icon_search_gray").on("click",function(){var keyword=$("#SearchInput").val();if(!!keyword){keywrodSearch(keyword);}else{$(".search-wrapper").removeClass("show");}});$(".search-for-768 .icon_search_gray").on("click",function(){var keyword=$("#SearchInput768").val();if(!!keyword){keywrodSearch(keyword);}});$(".top-nav .link-list >li").on("mouseenter",function(){$(this).directChildNodes("sub-drop-down").show();return false;});$(".top-nav .link-list >li").on("mouseleave",function(){$(this).directChildNodes("sub-drop-down").hide();return false;});$(".link-list .first-level").on("click",function(event){var hrefAttr=$(this).attr("href");if(!hrefAttr){$(this).siblingNodes(true,"sub-drop-down").show();event.preventDefault();return false;} return true;});$(".link-container").on("click",function(){hidePCSearchInput("link-container");});$(".shadow-bg").click(function(){hidePCSearchInput("link-container");});$("section").click(function(){hidePCSearchInput("link-container");});});})();function keywrodSearch(keyword){var url="https://news.uestc.edu.cn/?n=UestcNews.Front.Search.Page&Keyword="+encodeURIComponent(keyword);window.open(url,'_blank');} function inputKeyDownAction(e,keyword){var keyCode=e.keyCode||e.which;if(parseInt(keyCode)===13&&!!keyword){keywrodSearch(keyword);return;}} function hidePCSearchInput(){$(".search-wrapper").removeClass("show");};})();